import{r as uH,a as fH,b as w,R as q,c as zu,d as dH,u as OR,e as hH,f as pH,g as Qi,h as jt,B as mH,i as vH,j as wc,N as gH}from"./vendor-zehgRTIA.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Qv={exports:{}},Sc={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Rj;function yH(){if(Rj)return Sc;Rj=1;var e=uH(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(s,l,u){var h,p={},m=null,v=null;u!==void 0&&(m=""+u),l.key!==void 0&&(m=""+l.key),l.ref!==void 0&&(v=l.ref);for(h in l)n.call(l,h)&&!i.hasOwnProperty(h)&&(p[h]=l[h]);if(s&&s.defaultProps)for(h in l=s.defaultProps,l)p[h]===void 0&&(p[h]=l[h]);return{$$typeof:t,type:s,key:m,ref:v,props:p,_owner:a.current}}return Sc.Fragment=r,Sc.jsx=o,Sc.jsxs=o,Sc}var Dj;function xH(){return Dj||(Dj=1,Qv.exports=yH()),Qv.exports}var f=xH(),pd={},Ij;function bH(){if(Ij)return pd;Ij=1;var e=fH();return pd.createRoot=e.createRoot,pd.hydrateRoot=e.hydrateRoot,pd}var wH=bH();const SH=1,OH=1e6;let eg=0;function _H(){return eg=(eg+1)%Number.MAX_SAFE_INTEGER,eg.toString()}const tg=new Map,$j=e=>{if(tg.has(e))return;const t=setTimeout(()=>{tg.delete(e),Kc({type:"REMOVE_TOAST",toastId:e})},OH);tg.set(e,t)},AH=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,SH)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?$j(r):e.toasts.forEach(n=>{$j(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Vd=[];let zd={toasts:[]};function Kc(e){zd=AH(zd,e),Vd.forEach(t=>{t(zd)})}function jH({...e}){const t=_H(),r=a=>Kc({type:"UPDATE_TOAST",toast:{...a,id:t}}),n=()=>Kc({type:"DISMISS_TOAST",toastId:t});return Kc({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||n()}}}),{id:t,dismiss:n,update:r}}function Ap(){const[e,t]=w.useState(zd);return w.useEffect(()=>(Vd.push(t),()=>{const r=Vd.indexOf(t);r>-1&&Vd.splice(r,1)}),[e]),{...e,toast:jH,dismiss:r=>Kc({type:"DISMISS_TOAST",toastId:r})}}function be(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function TH(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function _R(...e){return t=>e.forEach(r=>TH(r,t))}function it(...e){return w.useCallback(_R(...e),e)}function PH(e,t=[]){let r=[];function n(i,o){const s=w.createContext(o),l=r.length;r=[...r,o];function u(p){const{scope:m,children:v,...b}=p,g=(m==null?void 0:m[e][l])||s,x=w.useMemo(()=>b,Object.values(b));return f.jsx(g.Provider,{value:x,children:v})}function h(p,m){const v=(m==null?void 0:m[e][l])||s,b=w.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,h]}const a=()=>{const i=r.map(o=>w.createContext(o));return function(s){const l=(s==null?void 0:s[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return a.scopeName=e,[n,NH(a,...t)]}function NH(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((s,{useScope:l,scopeName:u})=>{const p=l(i)[`__scope${u}`];return{...s,...p}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var ao=w.forwardRef((e,t)=>{const{children:r,...n}=e,a=w.Children.toArray(r),i=a.find(CH);if(i){const o=i.props.children,s=a.map(l=>l===i?w.Children.count(o)>1?w.Children.only(null):w.isValidElement(o)?o.props.children:null:l);return f.jsx(Ib,{...n,ref:t,children:w.isValidElement(o)?w.cloneElement(o,void 0,s):null})}return f.jsx(Ib,{...n,ref:t,children:r})});ao.displayName="Slot";var Ib=w.forwardRef((e,t)=>{const{children:r,...n}=e;if(w.isValidElement(r)){const a=kH(r);return w.cloneElement(r,{...EH(n,r.props),ref:t?_R(t,a):a})}return w.Children.count(r)>1?w.Children.only(null):null});Ib.displayName="SlotClone";var AR=({children:e})=>f.jsx(f.Fragment,{children:e});function CH(e){return w.isValidElement(e)&&e.type===AR}function EH(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...s)=>{i(...s),a(...s)}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function kH(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function q1(e){const t=e+"CollectionProvider",[r,n]=PH(t),[a,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=v=>{const{scope:b,children:g}=v,x=q.useRef(null),S=q.useRef(new Map).current;return f.jsx(a,{scope:b,itemMap:S,collectionRef:x,children:g})};o.displayName=t;const s=e+"CollectionSlot",l=q.forwardRef((v,b)=>{const{scope:g,children:x}=v,S=i(s,g),O=it(b,S.collectionRef);return f.jsx(ao,{ref:O,children:x})});l.displayName=s;const u=e+"CollectionItemSlot",h="data-radix-collection-item",p=q.forwardRef((v,b)=>{const{scope:g,children:x,...S}=v,O=q.useRef(null),j=it(b,O),P=i(u,g);return q.useEffect(()=>(P.itemMap.set(O,{ref:O,...S}),()=>void P.itemMap.delete(O))),f.jsx(ao,{[h]:"",ref:j,children:x})});p.displayName=u;function m(v){const b=i(e+"CollectionConsumer",v);return q.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const S=Array.from(x.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((P,A)=>S.indexOf(P.ref.current)-S.indexOf(A.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,n]}function MH(e,t){const r=w.createContext(t),n=i=>{const{children:o,...s}=i,l=w.useMemo(()=>s,Object.values(s));return f.jsx(r.Provider,{value:l,children:o})};n.displayName=e+"Provider";function a(i){const o=w.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,a]}function co(e,t=[]){let r=[];function n(i,o){const s=w.createContext(o),l=r.length;r=[...r,o];const u=p=>{var S;const{scope:m,children:v,...b}=p,g=((S=m==null?void 0:m[e])==null?void 0:S[l])||s,x=w.useMemo(()=>b,Object.values(b));return f.jsx(g.Provider,{value:x,children:v})};u.displayName=i+"Provider";function h(p,m){var g;const v=((g=m==null?void 0:m[e])==null?void 0:g[l])||s,b=w.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[u,h]}const a=()=>{const i=r.map(o=>w.createContext(o));return function(s){const l=(s==null?void 0:s[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return a.scopeName=e,[n,RH(a,...t)]}function RH(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((s,{useScope:l,scopeName:u})=>{const p=l(i)[`__scope${u}`];return{...s,...p}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var DH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Me=DH.reduce((e,t)=>{const r=w.forwardRef((n,a)=>{const{asChild:i,...o}=n,s=i?ao:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(s,{...o,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function jR(e,t){e&&zu.flushSync(()=>e.dispatchEvent(t))}function Qt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function IH(e,t=globalThis==null?void 0:globalThis.document){const r=Qt(e);w.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var $H="DismissableLayer",$b="dismissableLayer.update",LH="dismissableLayer.pointerDownOutside",FH="dismissableLayer.focusOutside",Lj,TR=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$l=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:s,...l}=e,u=w.useContext(TR),[h,p]=w.useState(null),m=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=w.useState({}),b=it(t,N=>p(N)),g=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),S=g.indexOf(x),O=h?g.indexOf(h):-1,j=u.layersWithOutsidePointerEventsDisabled.size>0,P=O>=S,A=WH(N=>{const k=N.target,R=[...u.branches].some(W=>W.contains(k));!P||R||(a==null||a(N),o==null||o(N),N.defaultPrevented||s==null||s())},m),T=qH(N=>{const k=N.target;[...u.branches].some(W=>W.contains(k))||(i==null||i(N),o==null||o(N),N.defaultPrevented||s==null||s())},m);return IH(N=>{O===u.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&s&&(N.preventDefault(),s()))},m),w.useEffect(()=>{if(h)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Lj=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),Fj(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Lj)}},[h,m,r,u]),w.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),Fj())},[h,u]),w.useEffect(()=>{const N=()=>v({});return document.addEventListener($b,N),()=>document.removeEventListener($b,N)},[]),f.jsx(Me.div,{...l,ref:b,style:{pointerEvents:j?P?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,T.onFocusCapture),onBlurCapture:be(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,A.onPointerDownCapture)})});$l.displayName=$H;var BH="DismissableLayerBranch",PR=w.forwardRef((e,t)=>{const r=w.useContext(TR),n=w.useRef(null),a=it(t,n);return w.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),f.jsx(Me.div,{...e,ref:a})});PR.displayName=BH;function WH(e,t=globalThis==null?void 0:globalThis.document){const r=Qt(e),n=w.useRef(!1),a=w.useRef(()=>{});return w.useEffect(()=>{const i=s=>{if(s.target&&!n.current){let l=function(){NR(LH,r,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=l,t.addEventListener("click",a.current,{once:!0})):l()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function qH(e,t=globalThis==null?void 0:globalThis.document){const r=Qt(e),n=w.useRef(!1);return w.useEffect(()=>{const a=i=>{i.target&&!n.current&&NR(FH,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Fj(){const e=new CustomEvent($b);document.dispatchEvent(e)}function NR(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?jR(a,i):a.dispatchEvent(i)}var UH=$l,HH=PR,fr=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},VH="Portal",Ll=w.forwardRef((e,t)=>{var s;const{container:r,...n}=e,[a,i]=w.useState(!1);fr(()=>i(!0),[]);const o=r||a&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return o?dH.createPortal(f.jsx(Me.div,{...n,ref:t}),o):null});Ll.displayName=VH;function zH(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var rn=e=>{const{present:t,children:r}=e,n=GH(t),a=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),i=it(n.ref,KH(a));return typeof r=="function"||n.isPresent?w.cloneElement(a,{ref:i}):null};rn.displayName="Presence";function GH(e){const[t,r]=w.useState(),n=w.useRef({}),a=w.useRef(e),i=w.useRef("none"),o=e?"mounted":"unmounted",[s,l]=zH(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=md(n.current);i.current=s==="mounted"?u:"none"},[s]),fr(()=>{const u=n.current,h=a.current;if(h!==e){const m=i.current,v=md(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(h&&m!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),fr(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,p=v=>{const g=md(n.current).includes(v.animationName);if(v.target===t&&g&&(l("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=v=>{v.target===t&&(i.current=md(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function md(e){return(e==null?void 0:e.animationName)||"none"}function KH(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function pi({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,a]=YH({defaultProp:t,onChange:r}),i=e!==void 0,o=i?e:n,s=Qt(r),l=w.useCallback(u=>{if(i){const p=typeof u=="function"?u(e):u;p!==e&&s(p)}else a(u)},[i,e,a,s]);return[o,l]}function YH({defaultProp:e,onChange:t}){const r=w.useState(e),[n]=r,a=w.useRef(n),i=Qt(t);return w.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}var XH="VisuallyHidden",Gu=w.forwardRef((e,t)=>f.jsx(Me.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Gu.displayName=XH;var ZH=Gu,U1="ToastProvider",[H1,JH,QH]=q1("Toast"),[CR,fwe]=co("Toast",[QH]),[eV,jp]=CR(U1),ER=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[s,l]=w.useState(null),[u,h]=w.useState(0),p=w.useRef(!1),m=w.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${U1}\`. Expected non-empty \`string\`.`),f.jsx(H1.Provider,{scope:t,children:f.jsx(eV,{scope:t,label:r,duration:n,swipeDirection:a,swipeThreshold:i,toastCount:u,viewport:s,onViewportChange:l,onToastAdd:w.useCallback(()=>h(v=>v+1),[]),onToastRemove:w.useCallback(()=>h(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:o})})};ER.displayName=U1;var kR="ToastViewport",tV=["F8"],Lb="toast.viewportPause",Fb="toast.viewportResume",MR=w.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=tV,label:a="Notifications ({hotkey})",...i}=e,o=jp(kR,r),s=JH(r),l=w.useRef(null),u=w.useRef(null),h=w.useRef(null),p=w.useRef(null),m=it(t,p,o.onViewportChange),v=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=o.toastCount>0;w.useEffect(()=>{const x=S=>{var j;n.length!==0&&n.every(P=>S[P]||S.code===P)&&((j=p.current)==null||j.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[n]),w.useEffect(()=>{const x=l.current,S=p.current;if(b&&x&&S){const O=()=>{if(!o.isClosePausedRef.current){const T=new CustomEvent(Lb);S.dispatchEvent(T),o.isClosePausedRef.current=!0}},j=()=>{if(o.isClosePausedRef.current){const T=new CustomEvent(Fb);S.dispatchEvent(T),o.isClosePausedRef.current=!1}},P=T=>{!x.contains(T.relatedTarget)&&j()},A=()=>{x.contains(document.activeElement)||j()};return x.addEventListener("focusin",O),x.addEventListener("focusout",P),x.addEventListener("pointermove",O),x.addEventListener("pointerleave",A),window.addEventListener("blur",O),window.addEventListener("focus",j),()=>{x.removeEventListener("focusin",O),x.removeEventListener("focusout",P),x.removeEventListener("pointermove",O),x.removeEventListener("pointerleave",A),window.removeEventListener("blur",O),window.removeEventListener("focus",j)}}},[b,o.isClosePausedRef]);const g=w.useCallback(({tabbingDirection:x})=>{const O=s().map(j=>{const P=j.ref.current,A=[P,...pV(P)];return x==="forwards"?A:A.reverse()});return(x==="forwards"?O.reverse():O).flat()},[s]);return w.useEffect(()=>{const x=p.current;if(x){const S=O=>{var A,T,N;const j=O.altKey||O.ctrlKey||O.metaKey;if(O.key==="Tab"&&!j){const k=document.activeElement,R=O.shiftKey;if(O.target===x&&R){(A=u.current)==null||A.focus();return}const I=g({tabbingDirection:R?"backwards":"forwards"}),L=I.findIndex($=>$===k);rg(I.slice(L+1))?O.preventDefault():R?(T=u.current)==null||T.focus():(N=h.current)==null||N.focus()}};return x.addEventListener("keydown",S),()=>x.removeEventListener("keydown",S)}},[s,g]),f.jsxs(HH,{ref:l,role:"region","aria-label":a.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&f.jsx(Bb,{ref:u,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"forwards"});rg(x)}}),f.jsx(H1.Slot,{scope:r,children:f.jsx(Me.ol,{tabIndex:-1,...i,ref:m})}),b&&f.jsx(Bb,{ref:h,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"backwards"});rg(x)}})]})});MR.displayName=kR;var RR="ToastFocusProxy",Bb=w.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...a}=e,i=jp(RR,r);return f.jsx(Gu,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const s=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(s))&&n()}})});Bb.displayName=RR;var Tp="Toast",rV="toast.swipeStart",nV="toast.swipeMove",aV="toast.swipeCancel",iV="toast.swipeEnd",DR=w.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:a,onOpenChange:i,...o}=e,[s=!0,l]=pi({prop:n,defaultProp:a,onChange:i});return f.jsx(rn,{present:r||s,children:f.jsx(lV,{open:s,...o,ref:t,onClose:()=>l(!1),onPause:Qt(e.onPause),onResume:Qt(e.onResume),onSwipeStart:be(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:be(e.onSwipeMove,u=>{const{x:h,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:be(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:be(e.onSwipeEnd,u=>{const{x:h,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),l(!1)})})})});DR.displayName=Tp;var[oV,sV]=CR(Tp,{onClose(){}}),lV=w.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:s,onPause:l,onResume:u,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:m,onSwipeEnd:v,...b}=e,g=jp(Tp,r),[x,S]=w.useState(null),O=it(t,$=>S($)),j=w.useRef(null),P=w.useRef(null),A=a||g.duration,T=w.useRef(0),N=w.useRef(A),k=w.useRef(0),{onToastAdd:R,onToastRemove:W}=g,E=Qt(()=>{var F;(x==null?void 0:x.contains(document.activeElement))&&((F=g.viewport)==null||F.focus()),o()}),I=w.useCallback($=>{!$||$===1/0||(window.clearTimeout(k.current),T.current=new Date().getTime(),k.current=window.setTimeout(E,$))},[E]);w.useEffect(()=>{const $=g.viewport;if($){const F=()=>{I(N.current),u==null||u()},z=()=>{const H=new Date().getTime()-T.current;N.current=N.current-H,window.clearTimeout(k.current),l==null||l()};return $.addEventListener(Lb,z),$.addEventListener(Fb,F),()=>{$.removeEventListener(Lb,z),$.removeEventListener(Fb,F)}}},[g.viewport,A,l,u,I]),w.useEffect(()=>{i&&!g.isClosePausedRef.current&&I(A)},[i,A,g.isClosePausedRef,I]),w.useEffect(()=>(R(),()=>W()),[R,W]);const L=w.useMemo(()=>x?qR(x):null,[x]);return g.viewport?f.jsxs(f.Fragment,{children:[L&&f.jsx(cV,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),f.jsx(oV,{scope:r,onClose:E,children:zu.createPortal(f.jsx(H1.ItemSlot,{scope:r,children:f.jsx(UH,{asChild:!0,onEscapeKeyDown:be(s,()=>{g.isFocusedToastEscapeKeyDownRef.current||E(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:f.jsx(Me.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...b,ref:O,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:be(e.onKeyDown,$=>{$.key==="Escape"&&(s==null||s($.nativeEvent),$.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,E()))}),onPointerDown:be(e.onPointerDown,$=>{$.button===0&&(j.current={x:$.clientX,y:$.clientY})}),onPointerMove:be(e.onPointerMove,$=>{if(!j.current)return;const F=$.clientX-j.current.x,z=$.clientY-j.current.y,H=!!P.current,U=["left","right"].includes(g.swipeDirection),Y=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,se=U?Y(0,F):0,ne=U?0:Y(0,z),ae=$.pointerType==="touch"?10:2,ue={x:se,y:ne},Re={originalEvent:$,delta:ue};H?(P.current=ue,vd(nV,p,Re,{discrete:!1})):Bj(ue,g.swipeDirection,ae)?(P.current=ue,vd(rV,h,Re,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(F)>ae||Math.abs(z)>ae)&&(j.current=null)}),onPointerUp:be(e.onPointerUp,$=>{const F=P.current,z=$.target;if(z.hasPointerCapture($.pointerId)&&z.releasePointerCapture($.pointerId),P.current=null,j.current=null,F){const H=$.currentTarget,U={originalEvent:$,delta:F};Bj(F,g.swipeDirection,g.swipeThreshold)?vd(iV,v,U,{discrete:!0}):vd(aV,m,U,{discrete:!0}),H.addEventListener("click",Y=>Y.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),cV=e=>{const{__scopeToast:t,children:r,...n}=e,a=jp(Tp,t),[i,o]=w.useState(!1),[s,l]=w.useState(!1);return dV(()=>o(!0)),w.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),s?null:f.jsx(Ll,{asChild:!0,children:f.jsx(Gu,{...n,children:i&&f.jsxs(f.Fragment,{children:[a.label," ",r]})})})},uV="ToastTitle",IR=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return f.jsx(Me.div,{...n,ref:t})});IR.displayName=uV;var fV="ToastDescription",$R=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return f.jsx(Me.div,{...n,ref:t})});$R.displayName=fV;var LR="ToastAction",FR=w.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?f.jsx(WR,{altText:r,asChild:!0,children:f.jsx(V1,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${LR}\`. Expected non-empty \`string\`.`),null)});FR.displayName=LR;var BR="ToastClose",V1=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,a=sV(BR,r);return f.jsx(WR,{asChild:!0,children:f.jsx(Me.button,{type:"button",...n,ref:t,onClick:be(e.onClick,a.onClose)})})});V1.displayName=BR;var WR=w.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...a}=e;return f.jsx(Me.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:t})});function qR(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),hV(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...qR(n))}}),t}function vd(e,t,r,{discrete:n}){const a=r.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?jR(a,i):a.dispatchEvent(i)}var Bj=(e,t,r=0)=>{const n=Math.abs(e.x),a=Math.abs(e.y),i=n>a;return t==="left"||t==="right"?i&&n>r:!i&&a>r};function dV(e=()=>{}){const t=Qt(e);fr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function hV(e){return e.nodeType===e.ELEMENT_NODE}function pV(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function rg(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var mV=ER,UR=MR,HR=DR,VR=IR,zR=$R,GR=FR,KR=V1;function YR(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,qj=Ke,Ku=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return qj(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(u=>{const h=r==null?void 0:r[u],p=i==null?void 0:i[u];if(h===null)return null;const m=Wj(h)||Wj(p);return a[u][m]}),s=r&&Object.entries(r).reduce((u,h)=>{let[p,m]=h;return m===void 0||(u[p]=m),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,h)=>{let{class:p,className:m,...v}=h;return Object.entries(v).every(b=>{let[g,x]=b;return Array.isArray(x)?x.includes({...i,...s}[g]):{...i,...s}[g]===x})?[...u,p,m]:u},[]);return qj(e,o,l,r==null?void 0:r.class,r==null?void 0:r.className)};/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vV=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),XR=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var gV={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yV=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...s},l)=>w.createElement("svg",{ref:l,...gV,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:XR("lucide",a),...s},[...o.map(([u,h])=>w.createElement(u,h)),...Array.isArray(i)?i:[i]]));/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Oe=(e,t)=>{const r=w.forwardRef(({className:n,...a},i)=>w.createElement(yV,{ref:i,iconNode:t,className:XR(`lucide-${vV(e)}`,n),...a}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xV=Oe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ZR=Oe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ws=Oe("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bV=Oe("ArrowUpToLine",[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const JR=Oe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wV=Oe("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const QR=Oe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const eD=Oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SV=Oe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const z1=Oe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OV=Oe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mi=Oe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _V=Oe("CircleDollarSign",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const G1=Oe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oh=Oe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tD=Oe("CloudDrizzle",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M8 19v1",key:"1dk2by"}],["path",{d:"M8 14v1",key:"84yxot"}],["path",{d:"M16 19v1",key:"v220m7"}],["path",{d:"M16 14v1",key:"g12gj6"}],["path",{d:"M12 21v1",key:"q8vafk"}],["path",{d:"M12 16v1",key:"1mx6rx"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sh=Oe("CloudFog",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M16 17H7",key:"pygtm1"}],["path",{d:"M17 21H9",key:"1u2q02"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rD=Oe("CloudLightning",[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wb=Oe("CloudRain",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M16 14v6",key:"1j4efv"}],["path",{d:"M8 14v6",key:"17c4r9"}],["path",{d:"M12 16v6",key:"c8a4gj"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qb=Oe("CloudSnow",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M8 15h.01",key:"a7atzg"}],["path",{d:"M8 19h.01",key:"puxtts"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M12 21h.01",key:"h35vbk"}],["path",{d:"M16 15h.01",key:"rnfrdf"}],["path",{d:"M16 19h.01",key:"1vcnzz"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nD=Oe("CloudSun",[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}],["path",{d:"M15.947 12.65a4 4 0 0 0-5.925-4.128",key:"dpwdj0"}],["path",{d:"M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z",key:"s09mg5"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aD=Oe("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const AV=Oe("Delete",[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const os=Oe("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jV=Oe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const TV=Oe("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PV=Oe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const iD=Oe("Haze",[["path",{d:"m5.2 6.2 1.4 1.4",key:"17imol"}],["path",{d:"M2 13h2",key:"13gyu8"}],["path",{d:"M20 13h2",key:"16rner"}],["path",{d:"m17.4 7.6 1.4-1.4",key:"t4xlah"}],["path",{d:"M22 17H2",key:"1gtaj3"}],["path",{d:"M22 21H2",key:"1gy6en"}],["path",{d:"M16 13a4 4 0 0 0-8 0",key:"1dyczq"}],["path",{d:"M12 5V2.5",key:"1vytko"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oD=Oe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const NV=Oe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const K1=Oe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const CV=Oe("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const EV=Oe("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kV=Oe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sD=Oe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Fl=Oe("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const MV=Oe("PhoneCall",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}],["path",{d:"M14.05 2a9 9 0 0 1 8 7.94",key:"vmijpz"}],["path",{d:"M14.05 6A5 5 0 0 1 18 10",key:"13nbpp"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const RV=Oe("PhoneIncoming",[["polyline",{points:"16 2 16 8 22 8",key:"1ygljm"}],["line",{x1:"22",x2:"16",y1:"2",y2:"8",key:"1xzwqn"}],["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DV=Oe("PhoneMissed",[["line",{x1:"22",x2:"16",y1:"2",y2:"8",key:"1xzwqn"}],["line",{x1:"16",x2:"22",y1:"2",y2:"8",key:"13zxdn"}],["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const IV=Oe("PhoneOutgoing",[["polyline",{points:"22 8 22 2 16 2",key:"1g204g"}],["line",{x1:"16",x2:"22",y1:"8",y2:"2",key:"1ggias"}],["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lD=Oe("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $V=Oe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Y1=Oe("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cD=Oe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const LV=Oe("Sunrise",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const FV=Oe("Sunset",[["path",{d:"M12 10V2",key:"16sf7g"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const BV=Oe("Tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const WV=Oe("ThermometerSnowflake",[["path",{d:"M2 12h10",key:"19562f"}],["path",{d:"M9 4v16",key:"81ygyz"}],["path",{d:"m3 9 3 3-3 3",key:"1sas0l"}],["path",{d:"M12 6 9 9 6 6",key:"pfrgxu"}],["path",{d:"m6 18 3-3 1.5 1.5",key:"1e277p"}],["path",{d:"M20 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"iof6y5"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qV=Oe("ThermometerSun",[["path",{d:"M12 9a4 4 0 0 0-2 7.5",key:"1jvsq6"}],["path",{d:"M12 3v2",key:"1w22ol"}],["path",{d:"m6.6 18.4-1.4 1.4",key:"w2yidj"}],["path",{d:"M20 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"iof6y5"}],["path",{d:"M4 13H2",key:"118le4"}],["path",{d:"M6.34 7.34 4.93 5.93",key:"1brd51"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uD=Oe("Tornado",[["path",{d:"M21 4H3",key:"1hwok0"}],["path",{d:"M18 8H6",key:"41n648"}],["path",{d:"M19 12H9",key:"1g4lpz"}],["path",{d:"M16 16h-6",key:"1j5d54"}],["path",{d:"M11 20H9",key:"39obr8"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fD=Oe("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nl=Oe("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Uj=Oe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const UV=Oe("Truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const HV=Oe("Umbrella",[["path",{d:"M22 12a10.06 10.06 1 0 0-20 0Z",key:"1teyop"}],["path",{d:"M12 12v8a2 2 0 0 0 4 0",key:"ulpmoc"}],["path",{d:"M12 2v1",key:"11qlp1"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const VV=Oe("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zV=Oe("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const GV=Oe("Wind",[["path",{d:"M12.8 19.6A2 2 0 1 0 14 16H2",key:"148xed"}],["path",{d:"M17.5 8a2.5 2.5 0 1 1 2 4H2",key:"1u4tom"}],["path",{d:"M9.8 4.4A2 2 0 1 1 11 8H2",key:"75valh"}]]);/** * @license lucide-react v0.465.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dD=Oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),X1="-",KV=e=>{const t=XV(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const s=o.split(X1);return s[0]===""&&s.length!==1&&s.shift(),hD(s,t)||YV(o)},getConflictingClassGroupIds:(o,s)=>{const l=r[o]||[];return s&&n[o]?[...l,...n[o]]:l}}},hD=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?hD(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(X1);return(o=t.validators.find(({validator:s})=>s(i)))==null?void 0:o.classGroupId},Hj=/^\[(.+)\]$/,YV=e=>{if(Hj.test(e)){const t=Hj.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},XV=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return JV(Object.entries(e.classGroups),r).forEach(([i,o])=>{Ub(o,n,i,t)}),n},Ub=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:Vj(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(ZV(a)){Ub(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{Ub(o,Vj(t,i),r,n)})})},Vj=(e,t)=>{let r=e;return t.split(X1).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},ZV=e=>e.isThemeGetter,JV=(e,t)=>t?e.map(([r,n])=>{const a=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,s])=>[t+o,s])):i);return[r,a]}):e,QV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},pD="!",ez=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,a=t[0],i=t.length,o=s=>{const l=[];let u=0,h=0,p;for(let x=0;xh?p-h:void 0;return{modifiers:l,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:g}};return r?s=>r({className:s,parseClassName:o}):o},tz=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},rz=e=>({cache:QV(e.cacheSize),parseClassName:ez(e),...KV(e)}),nz=/\s+/,az=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(nz);let s="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:v}=r(u);let b=!!v,g=n(b?m.substring(0,v):m);if(!g){if(!b){s=u+(s.length>0?" "+s:s);continue}if(g=n(m),!g){s=u+(s.length>0?" "+s:s);continue}b=!1}const x=tz(h).join(":"),S=p?x+pD:x,O=S+g;if(i.includes(O))continue;i.push(O);const j=a(g,b);for(let P=0;P0?" "+s:s)}return s};function iz(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;np(h),e());return r=rz(u),n=r.cache.get,a=r.cache.set,i=s,s(l)}function s(l){const u=n(l);if(u)return u;const h=az(l,r);return a(l,h),h}return function(){return i(iz.apply(null,arguments))}}const Lt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},vD=/^\[(?:([a-z-]+):)?(.+)\]$/i,sz=/^\d+\/\d+$/,lz=new Set(["px","full","screen"]),cz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,fz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,dz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ri=e=>Ys(e)||lz.has(e)||sz.test(e),Wi=e=>Bl(e,"length",wz),Ys=e=>!!e&&!Number.isNaN(Number(e)),ng=e=>Bl(e,"number",Ys),Oc=e=>!!e&&Number.isInteger(Number(e)),pz=e=>e.endsWith("%")&&Ys(e.slice(0,-1)),Ze=e=>vD.test(e),qi=e=>cz.test(e),mz=new Set(["length","size","percentage"]),vz=e=>Bl(e,mz,gD),gz=e=>Bl(e,"position",gD),yz=new Set(["image","url"]),xz=e=>Bl(e,yz,Oz),bz=e=>Bl(e,"",Sz),_c=()=>!0,Bl=(e,t,r)=>{const n=vD.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},wz=e=>uz.test(e)&&!fz.test(e),gD=()=>!1,Sz=e=>dz.test(e),Oz=e=>hz.test(e),_z=()=>{const e=Lt("colors"),t=Lt("spacing"),r=Lt("blur"),n=Lt("brightness"),a=Lt("borderColor"),i=Lt("borderRadius"),o=Lt("borderSpacing"),s=Lt("borderWidth"),l=Lt("contrast"),u=Lt("grayscale"),h=Lt("hueRotate"),p=Lt("invert"),m=Lt("gap"),v=Lt("gradientColorStops"),b=Lt("gradientColorStopPositions"),g=Lt("inset"),x=Lt("margin"),S=Lt("opacity"),O=Lt("padding"),j=Lt("saturate"),P=Lt("scale"),A=Lt("sepia"),T=Lt("skew"),N=Lt("space"),k=Lt("translate"),R=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto",Ze,t],I=()=>[Ze,t],L=()=>["",ri,Wi],$=()=>["auto",Ys,Ze],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],Y=()=>["","0",Ze],se=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ne=()=>[Ys,Ze];return{cacheSize:500,separator:":",theme:{colors:[_c],spacing:[ri,Wi],blur:["none","",qi,Ze],brightness:ne(),borderColor:[e],borderRadius:["none","","full",qi,Ze],borderSpacing:I(),borderWidth:L(),contrast:ne(),grayscale:Y(),hueRotate:ne(),invert:Y(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[pz,Wi],inset:E(),margin:E(),opacity:ne(),padding:I(),saturate:ne(),scale:ne(),sepia:Y(),skew:ne(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Ze]}],container:["container"],columns:[{columns:[qi]}],"break-after":[{"break-after":se()}],"break-before":[{"break-before":se()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),Ze]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Oc,Ze]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ze]}],grow:[{grow:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",Oc,Ze]}],"grid-cols":[{"grid-cols":[_c]}],"col-start-end":[{col:["auto",{span:["full",Oc,Ze]},Ze]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[_c]}],"row-start-end":[{row:["auto",{span:[Oc,Ze]},Ze]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ze]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[O]}],px:[{px:[O]}],py:[{py:[O]}],ps:[{ps:[O]}],pe:[{pe:[O]}],pt:[{pt:[O]}],pr:[{pr:[O]}],pb:[{pb:[O]}],pl:[{pl:[O]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ze,t]}],"min-w":[{"min-w":[Ze,t,"min","max","fit"]}],"max-w":[{"max-w":[Ze,t,"none","full","min","max","fit","prose",{screen:[qi]},qi]}],h:[{h:[Ze,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ze,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ze,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ze,t,"auto","min","max","fit"]}],"font-size":[{text:["base",qi,Wi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ng]}],"font-family":[{font:[_c]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ze]}],"line-clamp":[{"line-clamp":["none",Ys,ng]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ri,Ze]}],"list-image":[{"list-image":["none",Ze]}],"list-style-type":[{list:["none","disc","decimal",Ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ri,Wi]}],"underline-offset":[{"underline-offset":["auto",ri,Ze]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),gz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vz]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xz]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:z()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[ri,Ze]}],"outline-w":[{outline:[ri,Wi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[ri,Wi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qi,bz]}],"shadow-color":[{shadow:[_c]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",qi,Ze]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[j]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ze]}],duration:[{duration:ne()}],ease:[{ease:["linear","in","out","in-out",Ze]}],delay:[{delay:ne()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Oc,Ze]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ze]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ze]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ze]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ri,Wi,ng]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Az=oz(_z);function de(...e){return Az(Ke(e))}const jz=mV,yD=w.forwardRef(({className:e,...t},r)=>f.jsx(UR,{ref:r,className:de("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));yD.displayName=UR.displayName;const Tz=Ku("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),xD=w.forwardRef(({className:e,variant:t,...r},n)=>f.jsx(HR,{ref:n,className:de(Tz({variant:t}),e),...r}));xD.displayName=HR.displayName;const Pz=w.forwardRef(({className:e,...t},r)=>f.jsx(GR,{ref:r,className:de("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Pz.displayName=GR.displayName;const bD=w.forwardRef(({className:e,...t},r)=>f.jsx(KR,{ref:r,className:de("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:f.jsx(dD,{className:"h-4 w-4"})}));bD.displayName=KR.displayName;const wD=w.forwardRef(({className:e,...t},r)=>f.jsx(VR,{ref:r,className:de("text-sm font-semibold [&+div]:text-xs",e),...t}));wD.displayName=VR.displayName;const SD=w.forwardRef(({className:e,...t},r)=>f.jsx(zR,{ref:r,className:de("text-sm opacity-90",e),...t}));SD.displayName=zR.displayName;function Nz(){const{toasts:e}=Ap();return f.jsxs(jz,{children:[e.map(function({id:t,title:r,description:n,action:a,...i}){return f.jsxs(xD,{...i,children:[f.jsxs("div",{className:"grid gap-1",children:[r&&f.jsx(wD,{children:r}),n&&f.jsx(SD,{children:n})]}),a,f.jsx(bD,{})]},t)}),f.jsx(yD,{})]})}const Ae=w.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:de("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Ae.displayName="Card";const rt=w.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:de("flex flex-col space-y-1.5 p-6",e),...t}));rt.displayName="CardHeader";const st=w.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:de("font-semibold leading-none tracking-tight",e),...t}));st.displayName="CardTitle";const Ko=w.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:de("text-sm text-muted-foreground",e),...t}));Ko.displayName="CardDescription";const We=w.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:de("p-6 pt-0",e),...t}));We.displayName="CardContent";const OD=w.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:de("flex items-center p-6 pt-0",e),...t}));OD.displayName="CardFooter";var Cz="Label",_D=w.forwardRef((e,t)=>f.jsx(Me.label,{...e,ref:t,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));_D.displayName=Cz;var AD=_D;const Ez=Ku("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pn=w.forwardRef(({className:e,...t},r)=>f.jsx(AD,{ref:r,className:de(Ez(),e),...t}));pn.displayName=AD.displayName;const Yo=w.forwardRef(({className:e,type:t,...r},n)=>f.jsx("input",{type:t,className:de("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));Yo.displayName="Input";const Hb=Ku("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),xr=w.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},i)=>{const o=n?ao:"button";return f.jsx(o,{className:de(Hb({variant:t,size:r,className:e})),ref:i,...a})});xr.displayName="Button";const kz=()=>{const[e,t]=w.useState(""),[r,n]=w.useState(!1),a=OR(),{toast:i}=Ap();w.useEffect(()=>{o()},[]);const o=async()=>{try{const l=await fetch("/auth/check",{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!l.ok)return;(await l.json()).authenticated&&a("/dashboard")}catch{}},s=async l=>{l.preventDefault(),n(!0);try{const u=await fetch("/auth/login",{method:"POST",credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({password:e})});if(!u.ok)throw new Error(`HTTP error! status: ${u.status}`);if((await u.json()).success)if(await new Promise(v=>setTimeout(v,100)),(await(await fetch("/auth/check",{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"}})).json()).authenticated)i({title:"Success",description:"Login successful"}),a("/dashboard");else throw new Error("Authentication failed after login")}catch(u){i({title:"Error",description:u.message||"Login failed. Please try again.",variant:"destructive"})}finally{n(!1)}};return f.jsx("div",{className:"min-h-screen w-screen flex items-center justify-center bg-gradient-to-b from-gray-100 to-gray-200 dark:from-gray-900 dark:to-gray-800 p-4",children:f.jsxs(Ae,{className:"w-full max-w-md",children:[f.jsxs(rt,{className:"space-y-1",children:[f.jsx("div",{className:"flex items-center justify-center mb-4",children:f.jsx(K1,{className:"h-12 w-12 text-gray-500"})}),f.jsx(st,{className:"text-2xl text-center",children:"Dashboard Login"}),f.jsx(Ko,{className:"text-center",children:"Enter your password to access the dashboard"})]}),f.jsxs("form",{onSubmit:s,children:[f.jsx(We,{className:"space-y-4",children:f.jsxs("div",{className:"space-y-2",children:[f.jsx(pn,{htmlFor:"password",children:"Password"}),f.jsx(Yo,{id:"password",type:"password",value:e,onChange:l=>t(l.target.value),placeholder:"Enter your password",required:!0})]})}),f.jsx(OD,{children:f.jsx(xr,{className:"w-full",type:"submit",disabled:r,children:r?"Authenticating...":"Login"})})]})]})})};var Mz=Object.defineProperty,Rz=Object.defineProperties,Dz=Object.getOwnPropertyDescriptors,lh=Object.getOwnPropertySymbols,jD=Object.prototype.hasOwnProperty,TD=Object.prototype.propertyIsEnumerable,zj=(e,t,r)=>t in e?Mz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Iz=(e,t)=>{for(var r in t||(t={}))jD.call(t,r)&&zj(e,r,t[r]);if(lh)for(var r of lh(t))TD.call(t,r)&&zj(e,r,t[r]);return e},$z=(e,t)=>Rz(e,Dz(t)),Lz=(e,t)=>{var r={};for(var n in e)jD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&lh)for(var n of lh(e))t.indexOf(n)<0&&TD.call(e,n)&&(r[n]=e[n]);return r};function Fz(e){let t=setTimeout(e,0),r=setTimeout(e,10),n=setTimeout(e,50);return[t,r,n]}function Bz(e){let t=w.useRef();return w.useEffect(()=>{t.current=e}),t.current}var Wz=18,PD=40,qz=`${PD}px`,Uz=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function Hz({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:n}){let[a,i]=w.useState(!1),[o,s]=w.useState(!1),[l,u]=w.useState(!1),h=w.useMemo(()=>r==="none"?!1:(r==="increase-width"||r==="experimental-no-flickering")&&a&&o,[a,o,r]),p=w.useCallback(()=>{let m=e.current,v=t.current;if(!m||!v||l||r==="none")return;let b=m,g=b.getBoundingClientRect().left+b.offsetWidth,x=b.getBoundingClientRect().top+b.offsetHeight/2,S=g-Wz,O=x;document.querySelectorAll(Uz).length===0&&document.elementFromPoint(S,O)===m||(i(!0),u(!0))},[e,t,l,r]);return w.useEffect(()=>{let m=e.current;if(!m||r==="none")return;function v(){let g=window.innerWidth-m.getBoundingClientRect().right;s(g>=PD)}v();let b=setInterval(v,1e3);return()=>{clearInterval(b)}},[e,r]),w.useEffect(()=>{let m=n||document.activeElement===t.current;if(r==="none"||!m)return;let v=setTimeout(p,0),b=setTimeout(p,2e3),g=setTimeout(p,5e3),x=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(v),clearTimeout(b),clearTimeout(g),clearTimeout(x)}},[t,n,r,p]),{hasPWMBadge:a,willPushPWMBadge:h,PWM_BADGE_SPACE_WIDTH:qz}}var ND=w.createContext({}),CD=w.forwardRef((e,t)=>{var r=e,{value:n,onChange:a,maxLength:i,textAlign:o="left",pattern:s,placeholder:l,inputMode:u="numeric",onComplete:h,pushPasswordManagerStrategy:p="increase-width",pasteTransformer:m,containerClassName:v,noScriptCSSFallback:b=Vz,render:g,children:x}=r,S=Lz(r,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),O,j,P,A,T;let[N,k]=w.useState(typeof S.defaultValue=="string"?S.defaultValue:""),R=n??N,W=Bz(R),E=w.useCallback(ie=>{a==null||a(ie),k(ie)},[a]),I=w.useMemo(()=>s?typeof s=="string"?new RegExp(s):s:null,[s]),L=w.useRef(null),$=w.useRef(null),F=w.useRef({value:R,onChange:E,isIOS:typeof window<"u"&&((j=(O=window==null?void 0:window.CSS)==null?void 0:O.supports)==null?void 0:j.call(O,"-webkit-touch-callout","none"))}),z=w.useRef({prev:[(P=L.current)==null?void 0:P.selectionStart,(A=L.current)==null?void 0:A.selectionEnd,(T=L.current)==null?void 0:T.selectionDirection]});w.useImperativeHandle(t,()=>L.current,[]),w.useEffect(()=>{let ie=L.current,ge=$.current;if(!ie||!ge)return;F.current.value!==ie.value&&F.current.onChange(ie.value),z.current.prev=[ie.selectionStart,ie.selectionEnd,ie.selectionDirection];function Ie(){if(document.activeElement!==ie){ae(null),Re(null);return}let Ye=ie.selectionStart,Tt=ie.selectionEnd,Pt=ie.selectionDirection,_t=ie.maxLength,ir=ie.value,wr=z.current.prev,tr=-1,an=-1,Ar;if(ir.length!==0&&Ye!==null&&Tt!==null){let Ti=Ye===Tt,Pi=Ye===ir.length&&ir.length<_t;if(Ti&&!Pi){let Vr=Ye;if(Vr===0)tr=0,an=1,Ar="forward";else if(Vr===_t)tr=Vr-1,an=Vr,Ar="backward";else if(_t>1&&ir.length>1){let ga=0;if(wr[0]!==null&&wr[1]!==null){Ar=Vr{ge&&ge.style.setProperty("--root-height",`${ie.clientHeight}px`)};$e();let vt=new ResizeObserver($e);return vt.observe(ie),()=>{document.removeEventListener("selectionchange",Ie,{capture:!0}),vt.disconnect()}},[]);let[H,U]=w.useState(!1),[Y,se]=w.useState(!1),[ne,ae]=w.useState(null),[ue,Re]=w.useState(null);w.useEffect(()=>{Fz(()=>{var ie,ge,Ie,$e;(ie=L.current)==null||ie.dispatchEvent(new Event("input"));let vt=(ge=L.current)==null?void 0:ge.selectionStart,Ye=(Ie=L.current)==null?void 0:Ie.selectionEnd,Tt=($e=L.current)==null?void 0:$e.selectionDirection;vt!==null&&Ye!==null&&(ae(vt),Re(Ye),z.current.prev=[vt,Ye,Tt])})},[R,Y]),w.useEffect(()=>{W!==void 0&&R!==W&&W.length{let ge=ie.currentTarget.value.slice(0,i);if(ge.length>0&&I&&!I.test(ge)){ie.preventDefault();return}typeof W=="string"&&ge.length{var ie;if(L.current){let ge=Math.min(L.current.value.length,i-1),Ie=L.current.value.length;(ie=L.current)==null||ie.setSelectionRange(ge,Ie),ae(ge),Re(Ie)}se(!0)},[i]),je=w.useCallback(ie=>{var ge,Ie;let $e=L.current;if(!m&&(!F.current.isIOS||!ie.clipboardData||!$e))return;let vt=ie.clipboardData.getData("text/plain"),Ye=m?m(vt):vt;console.log({_content:vt,content:Ye}),ie.preventDefault();let Tt=(ge=L.current)==null?void 0:ge.selectionStart,Pt=(Ie=L.current)==null?void 0:Ie.selectionEnd,_t=(Tt!==Pt?R.slice(0,Tt)+Ye+R.slice(Pt):R.slice(0,Tt)+Ye+R.slice(Tt)).slice(0,i);if(_t.length>0&&I&&!I.test(_t))return;$e.value=_t,E(_t);let ir=Math.min(_t.length,i-1),wr=_t.length;$e.setSelectionRange(ir,wr),ae(ir),Re(wr)},[i,E,I,R]),le=w.useMemo(()=>({position:"relative",cursor:S.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[S.disabled]),pe=w.useMemo(()=>({position:"absolute",inset:0,width:qe.willPushPWMBadge?`calc(100% + ${qe.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:qe.willPushPWMBadge?`inset(0 ${qe.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:o,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[qe.PWM_BADGE_SPACE_WIDTH,qe.willPushPWMBadge,o]),he=w.useMemo(()=>w.createElement("input",$z(Iz({autoComplete:S.autoComplete||"one-time-code"},S),{"data-input-otp":!0,"data-input-otp-placeholder-shown":R.length===0||void 0,"data-input-otp-mss":ne,"data-input-otp-mse":ue,inputMode:u,pattern:I==null?void 0:I.source,"aria-placeholder":l,style:pe,maxLength:i,value:R,ref:L,onPaste:ie=>{var ge;je(ie),(ge=S.onPaste)==null||ge.call(S,ie)},onChange:ct,onMouseOver:ie=>{var ge;U(!0),(ge=S.onMouseOver)==null||ge.call(S,ie)},onMouseLeave:ie=>{var ge;U(!1),(ge=S.onMouseLeave)==null||ge.call(S,ie)},onFocus:ie=>{var ge;we(),(ge=S.onFocus)==null||ge.call(S,ie)},onBlur:ie=>{var ge;se(!1),(ge=S.onBlur)==null||ge.call(S,ie)}})),[ct,we,je,u,pe,i,ue,ne,S,I==null?void 0:I.source,R]),Z=w.useMemo(()=>({slots:Array.from({length:i}).map((ie,ge)=>{var Ie;let $e=Y&&ne!==null&&ue!==null&&(ne===ue&&ge===ne||ge>=ne&&geg?g(Z):w.createElement(ND.Provider,{value:Z},x),[x,Z,g]);return w.createElement(w.Fragment,null,b!==null&&w.createElement("noscript",null,w.createElement("style",null,b)),w.createElement("div",{ref:$,"data-input-otp-container":!0,style:le,className:v},Ue,w.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},he)))});CD.displayName="Input";function Ac(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var Vz=` [data-input-otp] { --nojs-bg: white !important; --nojs-fg: black !important; background-color: var(--nojs-bg) !important; color: var(--nojs-fg) !important; caret-color: var(--nojs-fg) !important; letter-spacing: .25em !important; text-align: center !important; border: 1px solid var(--nojs-fg) !important; border-radius: 4px !important; width: 100% !important; } @media (prefers-color-scheme: dark) { [data-input-otp] { --nojs-bg: black !important; --nojs-fg: white !important; } }`;const ED=w.forwardRef(({className:e,containerClassName:t,...r},n)=>f.jsx(CD,{ref:n,containerClassName:de("flex items-center gap-2 has-[:disabled]:opacity-50",t),className:de("disabled:cursor-not-allowed",e),...r}));ED.displayName="InputOTP";const kD=w.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:de("flex items-center",e),...t}));kD.displayName="InputOTPGroup";const MD=w.forwardRef(({index:e,className:t,...r},n)=>{const a=w.useContext(ND),{char:i,hasFakeCaret:o,isActive:s}=a.slots[e];return f.jsxs("div",{ref:n,className:de("relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",s&&"z-10 ring-1 ring-ring",t),...r,children:[i,o&&f.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:f.jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});MD.displayName="InputOTPSlot";const zz=w.forwardRef(({...e},t)=>f.jsx("div",{ref:t,role:"separator",...e,children:f.jsx(kV,{})}));zz.displayName="InputOTPSeparator";const Gj=3,gd=5*60*1e3,Gz=({onSuccess:e})=>{const[t,r]=w.useState(""),[n,a]=w.useState(()=>parseInt(localStorage.getItem("pinAttempts")||"0")),[i,o]=w.useState(()=>{const v=localStorage.getItem("lastAttemptTime");if(!v)return 0;const b=Date.now()-parseInt(v);return b{let v;return i>0&&(v=setInterval(()=>{o(b=>{const g=b-1e3;return g<=0?(localStorage.removeItem("pinAttempts"),localStorage.removeItem("lastAttemptTime"),0):g})},1e3)),()=>clearInterval(v)},[i]);const l=w.useCallback(v=>{if(i>0)return;const b=n+1;if(a(b),localStorage.setItem("pinAttempts",b.toString()),localStorage.setItem("lastAttemptTime",Date.now().toString()),b>=Gj){o(gd),s({title:"Too many attempts",description:`Please try again in ${Math.ceil(gd/6e4)} minutes`,variant:"destructive"}),r("");return}v==="123456"?(s({title:"Success",description:"PIN accepted"}),a(0),localStorage.removeItem("pinAttempts"),localStorage.removeItem("lastAttemptTime"),e()):(s({title:"Error",description:`Incorrect PIN. ${Gj-b} attempts remaining`,variant:"destructive"}),r(""))},[n,i,e,s]),u=v=>{if(t.length<6){const b=t+v;r(b),b.length===6&&l(b)}},h=()=>{r(v=>v.slice(0,-1))},p=()=>[[1,2,3],[4,5,6],[7,8,9],["clear",0,"delete"]].map((b,g)=>f.jsx("div",{className:"flex justify-center gap-4",children:b.map((x,S)=>x==="delete"?f.jsx(xr,{variant:"ghost",className:"w-16 h-16 text-lg font-medium hover:bg-muted",onClick:h,children:f.jsx(AV,{className:"h-6 w-6"})},x):x==="clear"?f.jsx(xr,{variant:"ghost",className:"w-16 h-16 text-lg font-medium hover:bg-muted",onClick:()=>r(""),children:"Clear"},x):f.jsx(xr,{variant:"ghost",className:"w-16 h-16 text-2xl font-medium hover:bg-muted",onClick:()=>u(x.toString()),children:x},x))},g)),m=t.replace(/./g,"•");return f.jsx("div",{className:"min-h-screen w-screen flex items-center justify-center bg-gradient-to-b from-gray-100 to-gray-200 dark:from-gray-900 dark:to-gray-800 p-4",children:f.jsxs(Ae,{className:"w-full max-w-md",children:[f.jsxs(rt,{className:"space-y-1",children:[f.jsx("div",{className:"flex items-center justify-center mb-4",children:f.jsx(K1,{className:"h-12 w-12 text-gray-500"})}),f.jsx(st,{className:"text-2xl text-center",children:"Enter PIN"}),f.jsx(Ko,{className:"text-center",children:i>0?`Too many attempts. Try again in ${Math.ceil(i/6e4)} minutes`:"Enter your PIN to access the display"})]}),f.jsxs(We,{className:"space-y-8",children:[f.jsx("div",{className:"flex justify-center",children:f.jsx(ED,{maxLength:6,value:m,disabled:!0,children:f.jsx(kD,{children:[0,1,2,3,4,5].map(v=>f.jsx(MD,{index:v,className:"w-14 h-14 text-2xl border-2 rounded-lg",readOnly:!0},v))})})}),f.jsx("div",{className:"space-y-4",children:p()})]})]})})},Kz=({children:e})=>{const[t,r]=w.useState(null),[n,a]=w.useState(!0),i=hH(),{toast:o}=Ap(),s=OR();return w.useEffect(()=>{let l=!0;return(async()=>{try{const h=await fetch("/auth/check",{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!l)return;if(h.status===401){r(!1),s("/login",{state:{from:i}});return}if(!h.ok)throw new Error(`HTTP error! status: ${h.status}`);const p=await h.json();l&&(r(p.authenticated),p.authenticated||s("/login",{state:{from:i}}))}catch{l&&(r(!1),o({title:"Error",description:"Authentication failed. Please try in again.",variant:"destructive"}),s("/login",{state:{from:i}}))}finally{l&&a(!1)}})(),()=>{l=!1}},[i.pathname,o,s]),n?f.jsx("div",{className:"min-h-screen flex items-center justify-center",children:f.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900 dark:border-white"})}):t?e:null},Yz=()=>{const e=()=>{sessionStorage.removeItem("pinVerified"),localStorage.removeItem("pinAttempts"),localStorage.removeItem("lastAttemptTime"),window.location.reload()};return f.jsx(xr,{variant:"ghost",size:"icon",className:"hover:bg-gray-100 dark:hover:bg-gray-800",onClick:e,children:f.jsx(K1,{className:"h-5 w-5"})})},RD=w.createContext();function Xz({children:e}){const[t,r]=w.useState(!1);return w.useEffect(()=>{const n=()=>{r(window.scrollY>100)};return window.addEventListener("scroll",n,{passive:!0}),()=>window.removeEventListener("scroll",n)},[]),f.jsx(RD.Provider,{value:{isStuck:t},children:e})}function DD(){const e=w.useContext(RD);if(e===void 0)throw new Error("useScroll must be used within a ScrollProvider");return e}const ID=w.createContext({theme:"system",setTheme:()=>null,toggleTheme:()=>null});function Zz(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Jz({children:e,storageKey:t="vite-ui-theme",...r}){const[n,a]=w.useState("system"),[i,o]=w.useState(Zz);w.useEffect(()=>{localStorage.removeItem(t)},[t]),w.useEffect(()=>{const u=window.matchMedia("(prefers-color-scheme: dark)"),h=p=>{o(p.matches?"dark":"light")};return o(u.matches?"dark":"light"),u.addEventListener("change",h),()=>u.removeEventListener("change",h)},[]),w.useEffect(()=>{const u=window.document.documentElement,h=n==="system"?i:n;u.classList.remove("light","dark"),u.classList.add(h)},[n,i]);const l={theme:n,systemTheme:i,setTheme:a,toggleTheme:()=>{a(n==="system"?i==="dark"?"light":"dark":n==="light"?"dark":"light")}};return f.jsx(ID.Provider,{...r,value:l,children:e})}const Qz=()=>{const e=w.useContext(ID);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var eG=pH.useId||(()=>{}),tG=0;function Pa(e){const[t,r]=w.useState(eG());return fr(()=>{r(n=>n??String(tG++))},[e]),t?`radix-${t}`:""}const rG=["top","right","bottom","left"],io=Math.min,vn=Math.max,ch=Math.round,yd=Math.floor,Na=e=>({x:e,y:e}),nG={left:"right",right:"left",bottom:"top",top:"bottom"},aG={start:"end",end:"start"};function Vb(e,t,r){return vn(e,io(t,r))}function vi(e,t){return typeof e=="function"?e(t):e}function gi(e){return e.split("-")[0]}function Wl(e){return e.split("-")[1]}function Z1(e){return e==="x"?"y":"x"}function J1(e){return e==="y"?"height":"width"}function oo(e){return["top","bottom"].includes(gi(e))?"y":"x"}function Q1(e){return Z1(oo(e))}function iG(e,t,r){r===void 0&&(r=!1);const n=Wl(e),a=Q1(e),i=J1(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=uh(o)),[o,uh(o)]}function oG(e){const t=uh(e);return[zb(e),t,zb(t)]}function zb(e){return e.replace(/start|end/g,t=>aG[t])}function sG(e,t,r){const n=["left","right"],a=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return r?t?a:n:t?n:a;case"left":case"right":return t?i:o;default:return[]}}function lG(e,t,r,n){const a=Wl(e);let i=sG(gi(e),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(zb)))),i}function uh(e){return e.replace(/left|right|bottom|top/g,t=>nG[t])}function cG(e){return{top:0,right:0,bottom:0,left:0,...e}}function $D(e){return typeof e!="number"?cG(e):{top:e,right:e,bottom:e,left:e}}function fh(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Kj(e,t,r){let{reference:n,floating:a}=e;const i=oo(t),o=Q1(t),s=J1(o),l=gi(t),u=i==="y",h=n.x+n.width/2-a.width/2,p=n.y+n.height/2-a.height/2,m=n[s]/2-a[s]/2;let v;switch(l){case"top":v={x:h,y:n.y-a.height};break;case"bottom":v={x:h,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:p};break;case"left":v={x:n.x-a.width,y:p};break;default:v={x:n.x,y:n.y}}switch(Wl(t)){case"start":v[o]-=m*(r&&u?-1:1);break;case"end":v[o]+=m*(r&&u?-1:1);break}return v}const uG=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,s=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=Kj(u,n,l),m=n,v={},b=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:i,platform:o,elements:s,middlewareData:l}=t,{element:u,padding:h=0}=vi(e,t)||{};if(u==null)return{};const p=$D(h),m={x:r,y:n},v=Q1(a),b=J1(v),g=await o.getDimensions(u),x=v==="y",S=x?"top":"left",O=x?"bottom":"right",j=x?"clientHeight":"clientWidth",P=i.reference[b]+i.reference[v]-m[v]-i.floating[b],A=m[v]-i.reference[v],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let N=T?T[j]:0;(!N||!await(o.isElement==null?void 0:o.isElement(T)))&&(N=s.floating[j]||i.floating[b]);const k=P/2-A/2,R=N/2-g[b]/2-1,W=io(p[S],R),E=io(p[O],R),I=W,L=N-g[b]-E,$=N/2-g[b]/2+k,F=Vb(I,$,L),z=!l.arrow&&Wl(a)!=null&&$!==F&&i.reference[b]/2-($$<=0)){var E,I;const $=(((E=i.flip)==null?void 0:E.index)||0)+1,F=N[$];if(F)return{data:{index:$,overflows:W},reset:{placement:F}};let z=(I=W.filter(H=>H.overflows[0]<=0).sort((H,U)=>H.overflows[1]-U.overflows[1])[0])==null?void 0:I.placement;if(!z)switch(v){case"bestFit":{var L;const H=(L=W.filter(U=>{if(T){const Y=oo(U.placement);return Y===O||Y==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(Y=>Y>0).reduce((Y,se)=>Y+se,0)]).sort((U,Y)=>U[1]-Y[1])[0])==null?void 0:L[0];H&&(z=H);break}case"initialPlacement":z=s;break}if(a!==z)return{reset:{placement:z}}}return{}}}};function Yj(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xj(e){return rG.some(t=>e[t]>=0)}const hG=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=vi(e,t);switch(n){case"referenceHidden":{const i=await au(t,{...a,elementContext:"reference"}),o=Yj(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Xj(o)}}}case"escaped":{const i=await au(t,{...a,altBoundary:!0}),o=Yj(i,r.floating);return{data:{escapedOffsets:o,escaped:Xj(o)}}}default:return{}}}}};async function pG(e,t){const{placement:r,platform:n,elements:a}=e,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=gi(r),s=Wl(r),l=oo(r)==="y",u=["left","top"].includes(o)?-1:1,h=i&&l?-1:1,p=vi(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof b=="number"&&(v=s==="end"?b*-1:b),l?{x:v*h,y:m*u}:{x:m*u,y:v*h}}const mG=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:i,placement:o,middlewareData:s}=t,l=await pG(t,e);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},vG=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:s={fn:x=>{let{x:S,y:O}=x;return{x:S,y:O}}},...l}=vi(e,t),u={x:r,y:n},h=await au(t,l),p=oo(gi(a)),m=Z1(p);let v=u[m],b=u[p];if(i){const x=m==="y"?"top":"left",S=m==="y"?"bottom":"right",O=v+h[x],j=v-h[S];v=Vb(O,v,j)}if(o){const x=p==="y"?"top":"left",S=p==="y"?"bottom":"right",O=b+h[x],j=b-h[S];b=Vb(O,b,j)}const g=s.fn({...t,[m]:v,[p]:b});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:i,[p]:o}}}}}},gG=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=vi(e,t),h={x:r,y:n},p=oo(a),m=Z1(p);let v=h[m],b=h[p];const g=vi(s,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const j=m==="y"?"height":"width",P=i.reference[m]-i.floating[j]+x.mainAxis,A=i.reference[m]+i.reference[j]-x.mainAxis;vA&&(v=A)}if(u){var S,O;const j=m==="y"?"width":"height",P=["top","left"].includes(gi(a)),A=i.reference[p]-i.floating[j]+(P&&((S=o.offset)==null?void 0:S[p])||0)+(P?0:x.crossAxis),T=i.reference[p]+i.reference[j]+(P?0:((O=o.offset)==null?void 0:O[p])||0)-(P?x.crossAxis:0);bT&&(b=T)}return{[m]:v,[p]:b}}}},yG=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:i,platform:o,elements:s}=t,{apply:l=()=>{},...u}=vi(e,t),h=await au(t,u),p=gi(a),m=Wl(a),v=oo(a)==="y",{width:b,height:g}=i.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(S=p,x=m==="end"?"top":"bottom");const O=g-h.top-h.bottom,j=b-h.left-h.right,P=io(g-h[x],O),A=io(b-h[S],j),T=!t.middlewareData.shift;let N=P,k=A;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=j),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=O),T&&!m){const W=vn(h.left,0),E=vn(h.right,0),I=vn(h.top,0),L=vn(h.bottom,0);v?k=b-2*(W!==0||E!==0?W+E:vn(h.left,h.right)):N=g-2*(I!==0||L!==0?I+L:vn(h.top,h.bottom))}await l({...t,availableWidth:k,availableHeight:N});const R=await o.getDimensions(s.floating);return b!==R.width||g!==R.height?{reset:{rects:!0}}:{}}}};function Pp(){return typeof window<"u"}function ql(e){return LD(e)?(e.nodeName||"").toLowerCase():"#document"}function xn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function La(e){var t;return(t=(LD(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function LD(e){return Pp()?e instanceof Node||e instanceof xn(e).Node:!1}function oa(e){return Pp()?e instanceof Element||e instanceof xn(e).Element:!1}function Ra(e){return Pp()?e instanceof HTMLElement||e instanceof xn(e).HTMLElement:!1}function Zj(e){return!Pp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xn(e).ShadowRoot}function Yu(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=sa(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(a)}function xG(e){return["table","td","th"].includes(ql(e))}function Np(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function eS(e){const t=tS(),r=oa(e)?sa(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function bG(e){let t=so(e);for(;Ra(t)&&!al(t);){if(eS(t))return t;if(Np(t))return null;t=so(t)}return null}function tS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function al(e){return["html","body","#document"].includes(ql(e))}function sa(e){return xn(e).getComputedStyle(e)}function Cp(e){return oa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function so(e){if(ql(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zj(e)&&e.host||La(e);return Zj(t)?t.host:t}function FD(e){const t=so(e);return al(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ra(t)&&Yu(t)?t:FD(t)}function iu(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=FD(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),o=xn(a);if(i){const s=Gb(o);return t.concat(o,o.visualViewport||[],Yu(a)?a:[],s&&r?iu(s):[])}return t.concat(a,iu(a,[],r))}function Gb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BD(e){const t=sa(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Ra(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,s=ch(r)!==i||ch(n)!==o;return s&&(r=i,n=o),{width:r,height:n,$:s}}function rS(e){return oa(e)?e:e.contextElement}function Xs(e){const t=rS(e);if(!Ra(t))return Na(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:i}=BD(t);let o=(i?ch(r.width):r.width)/n,s=(i?ch(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const wG=Na(0);function WD(e){const t=xn(e);return!tS()||!t.visualViewport?wG:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function SG(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==xn(e)?!1:t}function Xo(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=rS(e);let o=Na(1);t&&(n?oa(n)&&(o=Xs(n)):o=Xs(e));const s=SG(i,r,n)?WD(i):Na(0);let l=(a.left+s.x)/o.x,u=(a.top+s.y)/o.y,h=a.width/o.x,p=a.height/o.y;if(i){const m=xn(i),v=n&&oa(n)?xn(n):n;let b=m,g=Gb(b);for(;g&&n&&v!==b;){const x=Xs(g),S=g.getBoundingClientRect(),O=sa(g),j=S.left+(g.clientLeft+parseFloat(O.paddingLeft))*x.x,P=S.top+(g.clientTop+parseFloat(O.paddingTop))*x.y;l*=x.x,u*=x.y,h*=x.x,p*=x.y,l+=j,u+=P,b=xn(g),g=Gb(b)}}return fh({width:h,height:p,x:l,y:u})}function nS(e,t){const r=Cp(e).scrollLeft;return t?t.left+r:Xo(La(e)).left+r}function qD(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-(r?0:nS(e,n)),i=n.top+t.scrollTop;return{x:a,y:i}}function OG(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const i=a==="fixed",o=La(n),s=t?Np(t.floating):!1;if(n===o||s&&i)return r;let l={scrollLeft:0,scrollTop:0},u=Na(1);const h=Na(0),p=Ra(n);if((p||!p&&!i)&&((ql(n)!=="body"||Yu(o))&&(l=Cp(n)),Ra(n))){const v=Xo(n);u=Xs(n),h.x=v.x+n.clientLeft,h.y=v.y+n.clientTop}const m=o&&!p&&!i?qD(o,l,!0):Na(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+h.x+m.x,y:r.y*u.y-l.scrollTop*u.y+h.y+m.y}}function _G(e){return Array.from(e.getClientRects())}function AG(e){const t=La(e),r=Cp(e),n=e.ownerDocument.body,a=vn(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=vn(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+nS(e);const s=-r.scrollTop;return sa(n).direction==="rtl"&&(o+=vn(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:s}}function jG(e,t){const r=xn(e),n=La(e),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;const u=tS();(!u||u&&t==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}return{width:i,height:o,x:s,y:l}}function TG(e,t){const r=Xo(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=Ra(e)?Xs(e):Na(1),o=e.clientWidth*i.x,s=e.clientHeight*i.y,l=a*i.x,u=n*i.y;return{width:o,height:s,x:l,y:u}}function Jj(e,t,r){let n;if(t==="viewport")n=jG(e,r);else if(t==="document")n=AG(La(e));else if(oa(t))n=TG(t,r);else{const a=WD(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return fh(n)}function UD(e,t){const r=so(e);return r===t||!oa(r)||al(r)?!1:sa(r).position==="fixed"||UD(r,t)}function PG(e,t){const r=t.get(e);if(r)return r;let n=iu(e,[],!1).filter(s=>oa(s)&&ql(s)!=="body"),a=null;const i=sa(e).position==="fixed";let o=i?so(e):e;for(;oa(o)&&!al(o);){const s=sa(o),l=eS(o);!l&&s.position==="fixed"&&(a=null),(i?!l&&!a:!l&&s.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||Yu(o)&&!l&&UD(e,o))?n=n.filter(h=>h!==o):a=s,o=so(o)}return t.set(e,n),n}function NG(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[...r==="clippingAncestors"?Np(t)?[]:PG(t,this._c):[].concat(r),n],s=o[0],l=o.reduce((u,h)=>{const p=Jj(t,h,a);return u.top=vn(p.top,u.top),u.right=io(p.right,u.right),u.bottom=io(p.bottom,u.bottom),u.left=vn(p.left,u.left),u},Jj(t,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function CG(e){const{width:t,height:r}=BD(e);return{width:t,height:r}}function EG(e,t,r){const n=Ra(t),a=La(t),i=r==="fixed",o=Xo(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Na(0);if(n||!n&&!i)if((ql(t)!=="body"||Yu(a))&&(s=Cp(t)),n){const m=Xo(t,!0,i,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else a&&(l.x=nS(a));const u=a&&!n&&!i?qD(a,s):Na(0),h=o.left+s.scrollLeft-l.x-u.x,p=o.top+s.scrollTop-l.y-u.y;return{x:h,y:p,width:o.width,height:o.height}}function ag(e){return sa(e).position==="static"}function Qj(e,t){if(!Ra(e)||sa(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return La(e)===r&&(r=r.ownerDocument.body),r}function HD(e,t){const r=xn(e);if(Np(e))return r;if(!Ra(e)){let a=so(e);for(;a&&!al(a);){if(oa(a)&&!ag(a))return a;a=so(a)}return r}let n=Qj(e,t);for(;n&&xG(n)&&ag(n);)n=Qj(n,t);return n&&al(n)&&ag(n)&&!eS(n)?r:n||bG(e)||r}const kG=async function(e){const t=this.getOffsetParent||HD,r=this.getDimensions,n=await r(e.floating);return{reference:EG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function MG(e){return sa(e).direction==="rtl"}const RG={convertOffsetParentRelativeRectToViewportRelativeRect:OG,getDocumentElement:La,getClippingRect:NG,getOffsetParent:HD,getElementRects:kG,getClientRects:_G,getDimensions:CG,getScale:Xs,isElement:oa,isRTL:MG};function DG(e,t){let r=null,n;const a=La(e);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const{left:u,top:h,width:p,height:m}=e.getBoundingClientRect();if(s||t(),!p||!m)return;const v=yd(h),b=yd(a.clientWidth-(u+p)),g=yd(a.clientHeight-(h+m)),x=yd(u),O={rootMargin:-v+"px "+-b+"px "+-g+"px "+-x+"px",threshold:vn(0,io(1,l))||1};let j=!0;function P(A){const T=A[0].intersectionRatio;if(T!==l){if(!j)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},1e3)}j=!1}try{r=new IntersectionObserver(P,{...O,root:a.ownerDocument})}catch{r=new IntersectionObserver(P,O)}r.observe(e)}return o(!0),i}function IG(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=rS(e),h=a||i?[...u?iu(u):[],...iu(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",r,{passive:!0}),i&&S.addEventListener("resize",r)});const p=u&&s?DG(u,r):null;let m=-1,v=null;o&&(v=new ResizeObserver(S=>{let[O]=S;O&&O.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var j;(j=v)==null||j.observe(t)})),r()}),u&&!l&&v.observe(u),v.observe(t));let b,g=l?Xo(e):null;l&&x();function x(){const S=Xo(e);g&&(S.x!==g.x||S.y!==g.y||S.width!==g.width||S.height!==g.height)&&r(),g=S,b=requestAnimationFrame(x)}return r(),()=>{var S;h.forEach(O=>{a&&O.removeEventListener("scroll",r),i&&O.removeEventListener("resize",r)}),p==null||p(),(S=v)==null||S.disconnect(),v=null,l&&cancelAnimationFrame(b)}}const $G=mG,LG=vG,FG=dG,BG=yG,WG=hG,eT=fG,qG=gG,UG=(e,t,r)=>{const n=new Map,a={platform:RG,...r},i={...a.platform,_c:n};return uG(e,t,{...a,platform:i})};var Gd=typeof document<"u"?w.useLayoutEffect:w.useEffect;function dh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!dh(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&e.$$typeof)&&!dh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function VD(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tT(e,t){const r=VD(e);return Math.round(t*r)/r}function ig(e){const t=w.useRef(e);return Gd(()=>{t.current=e}),t}function HG(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[h,p]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=w.useState(n);dh(m,n)||v(n);const[b,g]=w.useState(null),[x,S]=w.useState(null),O=w.useCallback(U=>{U!==T.current&&(T.current=U,g(U))},[]),j=w.useCallback(U=>{U!==N.current&&(N.current=U,S(U))},[]),P=i||b,A=o||x,T=w.useRef(null),N=w.useRef(null),k=w.useRef(h),R=l!=null,W=ig(l),E=ig(a),I=ig(u),L=w.useCallback(()=>{if(!T.current||!N.current)return;const U={placement:t,strategy:r,middleware:m};E.current&&(U.platform=E.current),UG(T.current,N.current,U).then(Y=>{const se={...Y,isPositioned:I.current!==!1};$.current&&!dh(k.current,se)&&(k.current=se,zu.flushSync(()=>{p(se)}))})},[m,t,r,E,I]);Gd(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,p(U=>({...U,isPositioned:!1})))},[u]);const $=w.useRef(!1);Gd(()=>($.current=!0,()=>{$.current=!1}),[]),Gd(()=>{if(P&&(T.current=P),A&&(N.current=A),P&&A){if(W.current)return W.current(P,A,L);L()}},[P,A,L,W,R]);const F=w.useMemo(()=>({reference:T,floating:N,setReference:O,setFloating:j}),[O,j]),z=w.useMemo(()=>({reference:P,floating:A}),[P,A]),H=w.useMemo(()=>{const U={position:r,left:0,top:0};if(!z.floating)return U;const Y=tT(z.floating,h.x),se=tT(z.floating,h.y);return s?{...U,transform:"translate("+Y+"px, "+se+"px)",...VD(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Y,top:se}},[r,s,z.floating,h.x,h.y]);return w.useMemo(()=>({...h,update:L,refs:F,elements:z,floatingStyles:H}),[h,L,F,z,H])}const VG=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?eT({element:n.current,padding:a}).fn(r):{}:n?eT({element:n,padding:a}).fn(r):{}}}},zG=(e,t)=>({...$G(e),options:[e,t]}),GG=(e,t)=>({...LG(e),options:[e,t]}),KG=(e,t)=>({...qG(e),options:[e,t]}),YG=(e,t)=>({...FG(e),options:[e,t]}),XG=(e,t)=>({...BG(e),options:[e,t]}),ZG=(e,t)=>({...WG(e),options:[e,t]}),JG=(e,t)=>({...VG(e),options:[e,t]});var QG="Arrow",zD=w.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...i}=e;return f.jsx(Me.svg,{...i,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});zD.displayName=QG;var eK=zD;function tK(e,t=[]){let r=[];function n(i,o){const s=w.createContext(o),l=r.length;r=[...r,o];function u(p){const{scope:m,children:v,...b}=p,g=(m==null?void 0:m[e][l])||s,x=w.useMemo(()=>b,Object.values(b));return f.jsx(g.Provider,{value:x,children:v})}function h(p,m){const v=(m==null?void 0:m[e][l])||s,b=w.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,h]}const a=()=>{const i=r.map(o=>w.createContext(o));return function(s){const l=(s==null?void 0:s[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return a.scopeName=e,[n,rK(a,...t)]}function rK(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((s,{useScope:l,scopeName:u})=>{const p=l(i)[`__scope${u}`];return{...s,...p}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function GD(e){const[t,r]=w.useState(void 0);return fr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,s;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,s=u.blockSize}else o=e.offsetWidth,s=e.offsetHeight;r({width:o,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var aS="Popper",[KD,Ul]=tK(aS),[nK,YD]=KD(aS),XD=e=>{const{__scopePopper:t,children:r}=e,[n,a]=w.useState(null);return f.jsx(nK,{scope:t,anchor:n,onAnchorChange:a,children:r})};XD.displayName=aS;var ZD="PopperAnchor",JD=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,i=YD(ZD,r),o=w.useRef(null),s=it(t,o);return w.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:f.jsx(Me.div,{...a,ref:s})});JD.displayName=ZD;var iS="PopperContent",[aK,iK]=KD(iS),QD=w.forwardRef((e,t)=>{var we,je,le,pe,he,Z;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:b,...g}=e,x=YD(iS,r),[S,O]=w.useState(null),j=it(t,Ue=>O(Ue)),[P,A]=w.useState(null),T=GD(P),N=(T==null?void 0:T.width)??0,k=(T==null?void 0:T.height)??0,R=n+(i!=="center"?"-"+i:""),W=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},E=Array.isArray(u)?u:[u],I=E.length>0,L={padding:W,boundary:E.filter(sK),altBoundary:I},{refs:$,floatingStyles:F,placement:z,isPositioned:H,middlewareData:U}=HG({strategy:"fixed",placement:R,whileElementsMounted:(...Ue)=>IG(...Ue,{animationFrame:v==="always"}),elements:{reference:x.anchor},middleware:[zG({mainAxis:a+k,alignmentAxis:o}),l&&GG({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?KG():void 0,...L}),l&&YG({...L}),XG({...L,apply:({elements:Ue,rects:ie,availableWidth:ge,availableHeight:Ie})=>{const{width:$e,height:vt}=ie.reference,Ye=Ue.floating.style;Ye.setProperty("--radix-popper-available-width",`${ge}px`),Ye.setProperty("--radix-popper-available-height",`${Ie}px`),Ye.setProperty("--radix-popper-anchor-width",`${$e}px`),Ye.setProperty("--radix-popper-anchor-height",`${vt}px`)}}),P&&JG({element:P,padding:s}),lK({arrowWidth:N,arrowHeight:k}),m&&ZG({strategy:"referenceHidden",...L})]}),[Y,se]=rI(z),ne=Qt(b);fr(()=>{H&&(ne==null||ne())},[H,ne]);const ae=(we=U.arrow)==null?void 0:we.x,ue=(je=U.arrow)==null?void 0:je.y,Re=((le=U.arrow)==null?void 0:le.centerOffset)!==0,[qe,ct]=w.useState();return fr(()=>{S&&ct(window.getComputedStyle(S).zIndex)},[S]),f.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:H?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:qe,"--radix-popper-transform-origin":[(pe=U.transformOrigin)==null?void 0:pe.x,(he=U.transformOrigin)==null?void 0:he.y].join(" "),...((Z=U.hide)==null?void 0:Z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(aK,{scope:r,placedSide:Y,onArrowChange:A,arrowX:ae,arrowY:ue,shouldHideArrow:Re,children:f.jsx(Me.div,{"data-side":Y,"data-align":se,...g,ref:j,style:{...g.style,animation:H?void 0:"none"}})})})});QD.displayName=iS;var eI="PopperArrow",oK={top:"bottom",right:"left",bottom:"top",left:"right"},tI=w.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,i=iK(eI,n),o=oK[i.placedSide];return f.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:f.jsx(eK,{...a,ref:r,style:{...a.style,display:"block"}})})});tI.displayName=eI;function sK(e){return e!==null}var lK=e=>({name:"transformOrigin",options:e,fn(t){var x,S,O;const{placement:r,rects:n,middlewareData:a}=t,o=((x=a.arrow)==null?void 0:x.centerOffset)!==0,s=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,h]=rI(r),p={start:"0%",center:"50%",end:"100%"}[h],m=(((S=a.arrow)==null?void 0:S.x)??0)+s/2,v=(((O=a.arrow)==null?void 0:O.y)??0)+l/2;let b="",g="";return u==="bottom"?(b=o?p:`${m}px`,g=`${-l}px`):u==="top"?(b=o?p:`${m}px`,g=`${n.floating.height+l}px`):u==="right"?(b=`${-l}px`,g=o?p:`${v}px`):u==="left"&&(b=`${n.floating.width+l}px`,g=o?p:`${v}px`),{data:{x:b,y:g}}}});function rI(e){const[t,r="center"]=e.split("-");return[t,r]}var oS=XD,Ep=JD,sS=QD,lS=tI,[kp,dwe]=co("Tooltip",[Ul]),Mp=Ul(),nI="TooltipProvider",cK=700,Kb="tooltip.open",[uK,cS]=kp(nI),aI=e=>{const{__scopeTooltip:t,delayDuration:r=cK,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:i}=e,[o,s]=w.useState(!0),l=w.useRef(!1),u=w.useRef(0);return w.useEffect(()=>{const h=u.current;return()=>window.clearTimeout(h)},[]),f.jsx(uK,{scope:t,isOpenDelayed:o,delayDuration:r,onOpen:w.useCallback(()=>{window.clearTimeout(u.current),s(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s(!0),n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(h=>{l.current=h},[]),disableHoverableContent:a,children:i})};aI.displayName=nI;var Rp="Tooltip",[fK,Xu]=kp(Rp),iI=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:o,delayDuration:s}=e,l=cS(Rp,e.__scopeTooltip),u=Mp(t),[h,p]=w.useState(null),m=Pa(),v=w.useRef(0),b=o??l.disableHoverableContent,g=s??l.delayDuration,x=w.useRef(!1),[S=!1,O]=pi({prop:n,defaultProp:a,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(Kb))):l.onClose(),i==null||i(N)}}),j=w.useMemo(()=>S?x.current?"delayed-open":"instant-open":"closed",[S]),P=w.useCallback(()=>{window.clearTimeout(v.current),v.current=0,x.current=!1,O(!0)},[O]),A=w.useCallback(()=>{window.clearTimeout(v.current),v.current=0,O(!1)},[O]),T=w.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{x.current=!0,O(!0),v.current=0},g)},[g,O]);return w.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),f.jsx(oS,{...u,children:f.jsx(fK,{scope:t,contentId:m,open:S,stateAttribute:j,trigger:h,onTriggerChange:p,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayed?T():P()},[l.isOpenDelayed,T,P]),onTriggerLeave:w.useCallback(()=>{b?A():(window.clearTimeout(v.current),v.current=0)},[A,b]),onOpen:P,onClose:A,disableHoverableContent:b,children:r})})};iI.displayName=Rp;var Yb="TooltipTrigger",oI=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Xu(Yb,r),i=cS(Yb,r),o=Mp(r),s=w.useRef(null),l=it(t,s,a.onTriggerChange),u=w.useRef(!1),h=w.useRef(!1),p=w.useCallback(()=>u.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),f.jsx(Ep,{asChild:!0,...o,children:f.jsx(Me.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:l,onPointerMove:be(e.onPointerMove,m=>{m.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:be(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:be(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:be(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:be(e.onBlur,a.onClose),onClick:be(e.onClick,a.onClose)})})});oI.displayName=Yb;var uS="TooltipPortal",[dK,hK]=kp(uS,{forceMount:void 0}),sI=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,i=Xu(uS,t);return f.jsx(dK,{scope:t,forceMount:r,children:f.jsx(rn,{present:r||i.open,children:f.jsx(Ll,{asChild:!0,container:a,children:n})})})};sI.displayName=uS;var il="TooltipContent",lI=w.forwardRef((e,t)=>{const r=hK(il,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...i}=e,o=Xu(il,e.__scopeTooltip);return f.jsx(rn,{present:n||o.open,children:o.disableHoverableContent?f.jsx(cI,{side:a,...i,ref:t}):f.jsx(pK,{side:a,...i,ref:t})})}),pK=w.forwardRef((e,t)=>{const r=Xu(il,e.__scopeTooltip),n=cS(il,e.__scopeTooltip),a=w.useRef(null),i=it(t,a),[o,s]=w.useState(null),{trigger:l,onClose:u}=r,h=a.current,{onPointerInTransitChange:p}=n,m=w.useCallback(()=>{s(null),p(!1)},[p]),v=w.useCallback((b,g)=>{const x=b.currentTarget,S={x:b.clientX,y:b.clientY},O=yK(S,x.getBoundingClientRect()),j=xK(S,O),P=bK(g.getBoundingClientRect()),A=SK([...j,...P]);s(A),p(!0)},[p]);return w.useEffect(()=>()=>m(),[m]),w.useEffect(()=>{if(l&&h){const b=x=>v(x,h),g=x=>v(x,l);return l.addEventListener("pointerleave",b),h.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",b),h.removeEventListener("pointerleave",g)}}},[l,h,v,m]),w.useEffect(()=>{if(o){const b=g=>{const x=g.target,S={x:g.clientX,y:g.clientY},O=(l==null?void 0:l.contains(x))||(h==null?void 0:h.contains(x)),j=!wK(S,o);O?m():j&&(m(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,h,o,u,m]),f.jsx(cI,{...e,ref:i})}),[mK,vK]=kp(Rp,{isInside:!1}),cI=w.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...s}=e,l=Xu(il,r),u=Mp(r),{onClose:h}=l;return w.useEffect(()=>(document.addEventListener(Kb,h),()=>document.removeEventListener(Kb,h)),[h]),w.useEffect(()=>{if(l.trigger){const p=m=>{const v=m.target;v!=null&&v.contains(l.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[l.trigger,h]),f.jsx($l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:f.jsxs(sS,{"data-state":l.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(AR,{children:n}),f.jsx(mK,{scope:r,isInside:!0,children:f.jsx(ZH,{id:l.contentId,role:"tooltip",children:a||n})})]})})});lI.displayName=il;var uI="TooltipArrow",gK=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Mp(r);return vK(uI,r).isInside?null:f.jsx(lS,{...a,...n,ref:t})});gK.displayName=uI;function yK(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function xK(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function bK(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function wK(e,t){const{x:r,y:n}=e;let a=!1;for(let i=0,o=t.length-1;in!=h>n&&r<(u-s)*(n-l)/(h-l)+s&&(a=!a)}return a}function SK(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),OK(t)}function OK(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var _K=aI,AK=iI,jK=oI,TK=sI,fI=lI;const PK=_K,NK=AK,CK=jK,dI=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>f.jsx(TK,{children:f.jsx(fI,{ref:n,sideOffset:t,className:de("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));dI.displayName=fI.displayName;const EK=()=>f.jsxs("svg",{viewBox:"0 0 2687 3338",className:"w-6 h-6","aria-hidden":"true",children:[f.jsx("path",{fill:"white",d:"M911.230469 1807.75C974.730469 1695.5 849.919922 1700.659912 783.610352 1791.25C645.830078 1979.439941 874.950195 2120.310059 1112.429688 2058.800049C1201.44043 2035.72998 1278.759766 2003.080078 1344.580078 1964.159912C1385.389648 1940.040039 1380.900391 1926.060059 1344.580078 1935.139893C1294.040039 1947.800049 1261.69043 1953.73999 1177.700195 1966.97998C1084.719727 1981.669922 832.790039 1984.22998 911.230469 1807.75M1046.799805 1631.389893C1135.280273 1670.419922 1139.650391 1624.129883 1056.980469 1562.070068C925.150391 1463.110107 787.360352 1446.379883 661.950195 1478.280029C265.379883 1579.179932 67.740234 2077.050049 144.099609 2448.399902C357.860352 3487.689941 1934.570313 3457.959961 2143.030273 2467.540039C2204.700195 2174.439941 2141.950195 1852.780029 1917.990234 1665.149902C1773.219727 1543.870117 1575.009766 1536.659912 1403.599609 1591.72998C1380.639648 1599.110107 1381.410156 1616.610107 1403.599609 1612.379883C1571.25 1596.040039 1750.790039 1606 1856.75 1745.280029C2038.769531 1984.459961 2052.570313 2274.080078 1974.629883 2511.209961C1739.610352 3226.25 640.719727 3226.540039 401.719727 2479.26001C308.040039 2186.350098 400.299805 1788.800049 690 1639.100098C785.830078 1589.590088 907.040039 1569.709961 1046.799805 1631.389893Z"}),f.jsx("path",{fill:"white",d:"M1270.089844 1727.72998C1292.240234 1431.47998 1284.94043 952.430176 1257.849609 717.390137C1235.679688 525.310059 1166.200195 416.189941 1093.629883 349.390137C1157.620117 313.180176 1354.129883 485.680176 1447.830078 603.350098C1790.870117 1034.100098 2235.580078 915.060059 2523.480469 721.129883C2569.120117 680.51001 2592.900391 654.030029 2523.480469 651.339844C2260.400391 615.330078 2115 463.060059 1947.530273 293.890137C1672.870117 16.459961 1143.719727 162.169922 1033.969727 303.040039C999.339844 280.299805 966.849609 265 941.709961 252.419922C787.139648 175.160156 670.049805 223.580078 871.780273 341.569824C962.599609 394.689941 1089.849609 483.48999 1168.230469 799.589844C1222.370117 1018.040039 1230.009766 1423.919922 1242.360352 1728.379883C1247 1761.850098 1264.799805 1759.629883 1270.089844 1727.72998"})]}),kK=()=>{var m;const[e,t]=w.useState(new Date),[r,n]=w.useState(null),{isStuck:a}=DD(),{theme:i,systemTheme:o,toggleTheme:s,setTheme:l}=Qz();w.useEffect(()=>{const v=setInterval(()=>{t(new Date)},1e3);return()=>clearInterval(v)},[]),w.useEffect(()=>{const v=async()=>{try{const S=await(await fetch("https://api.openweathermap.org/data/2.5/weather?lat=43.63507&lon=-84.18995&appid=afce0bef1036dde836997b964e994475&units=imperial")).json();n(S)}catch(g){console.error("Error fetching weather:",g)}};v();const b=setInterval(v,3e5);return()=>clearInterval(b)},[]);const u=(v,b)=>{if(!v)return f.jsx(mi,{className:"w-6 h-6 text-red-500"});const g=parseInt(v,10);switch(!0){case(g>=200&&g<300):return f.jsx(rD,{className:"w-7 h-7 text-gray-500"});case(g>=300&&g<500):return f.jsx(tD,{className:"w-7 h-7 text-blue-400"});case(g>=500&&g<600):return f.jsx(Wb,{className:"w-7 h-7 text-blue-400"});case(g>=600&&g<700):return f.jsx(qb,{className:"w-7 h-7 text-blue-200"});case(g>=700&&g<721):return f.jsx(sh,{className:"w-7 h-7 text-gray-400"});case g===721:return f.jsx(iD,{className:"w-7 h-7 text-gray-500"});case(g>=722&&g<781):return f.jsx(sh,{className:"w-7 h-7 text-gray-400"});case g===781:return f.jsx(uD,{className:"w-7 h-7 text-gray-500"});case g===800:return b.getHours()>=6&&b.getHours()<18?f.jsx(cD,{className:"w-7 h-7 text-yellow-500"}):f.jsx(sD,{className:"w-7 h-7 text-gray-300"});case(g>=800&&g<803):return f.jsx(nD,{className:"w-7 h-7 text-gray-400"});case g>=803:return f.jsx(aD,{className:"w-7 h-7 text-gray-400"});default:return f.jsx(mi,{className:"w-6 h-6 text-red-500"})}},h=v=>{const b=v.getHours(),g=String(v.getMinutes()).padStart(2,"0"),x=String(v.getSeconds()).padStart(2,"0"),S=b>=12?"PM":"AM";return`${b%12||12}:${g}:${x} ${S}`},p=v=>v.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"});return f.jsx(Ae,{className:de("w-full bg-white dark:bg-gray-900 shadow-sm",a?"rounded-b-lg border-b-1":"border-b-0 rounded-b-none"),children:f.jsx(We,{className:"p-4",children:f.jsxs("div",{className:"flex flex-col justify-between lg:flex-row items-left sm:items-center flex-wrap",children:[f.jsxs("div",{className:"flex items-center space-x-4",children:[f.jsxs("div",{className:"flex space-x-2",children:[f.jsx("div",{onClick:s,className:de("bg-gradient-to-r from-blue-500 to-blue-600 p-3 rounded-lg shadow-md cursor-pointer hover:opacity-90 transition-opacity",i==="light"&&"ring-1 ring-yellow-300",i==="dark"&&"ring-1 ring-purple-300","ring-offset-2 ring-offset-white dark:ring-offset-gray-900"),children:f.jsx(EK,{})})," "]}),f.jsx("div",{children:f.jsx("h1",{className:"text-2xl font-bold bg-gradient-to-r from-blue-600 to-blue-400 bg-clip-text text-transparent",children:"Store Status"})})]}),f.jsxs("div",{className:"flex items-left sm:items-center justify-start flex-wrap mt-2 sm:mt-0",children:[(r==null?void 0:r.main)&&f.jsx(f.Fragment,{children:f.jsx("div",{className:"flex-col items-center text-center",children:f.jsxs("div",{className:"items-center justify-center space-x-2 rounded-lg px-4 hidden sm:flex",children:[u((m=r.weather[0])==null?void 0:m.id,e),f.jsx("div",{children:f.jsxs("p",{className:"text-xl font-bold tracking-tight dark:text-gray-100",children:[Math.round(r.main.temp),"° F"]})})]})})}),f.jsx("div",{className:"h-10 w-px bg-gradient-to-b from-gray-200 to-gray-200 dark:from-gray-700 dark:to-gray-700 hidden sm:block"}),f.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-3 rounded-lg px-4 py-2",children:[f.jsx(wV,{className:"w-5 h-5 text-green-500 shrink-0"}),f.jsx("div",{children:f.jsx("p",{className:"text-sm sm:text-xl font-bold tracking-tight p-0 dark:text-gray-100",children:p(e)})})]}),f.jsx("div",{className:"h-10 w-px bg-gradient-to-b from-gray-200 to-gray-200 dark:from-gray-700 dark:to-gray-700 hidden sm:block"}),f.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-3 rounded-lg px-4 py-2",children:[f.jsx(oh,{className:"w-5 h-5 text-blue-500 shrink-0"}),f.jsx("div",{children:f.jsx("p",{className:"text-md sm:text-xl font-bold tracking-tight tabular-nums dark:text-gray-100 mr-2",children:h(e)})})]})]})]})})})},MK=()=>{const[e,t]=w.useState([]),{isStuck:r}=DD(),n=w.useRef({}),a=w.useRef(null),[i,o]=w.useState(!0),s=w.useRef(0),l=w.useRef(window.pageYOffset||document.documentElement.scrollTop),p=(b=>{const g=window.matchMedia("(min-width: 768px) and (max-width: 1023px)").matches;return[...b].sort((x,S)=>{const O=x.order?g?x.order.md:x.order.default:0,j=S.order?g?S.order.md:S.order.default:0;return O&&j?O-j:0})})([{id:"stats",label:"Statistics"},{id:"realtime",label:"Realtime",responsiveIds:["realtime-lg","realtime-md"],order:{md:2,default:1}},{id:"products",label:"Top Products",responsiveIds:["products-lg","products-md"],order:{md:1,default:2}},{id:"feed",label:"Activity Feed"},{id:"sales",label:"Sales Metrics"},{id:"campaigns",label:"Campaigns"},{id:"meta",label:"Meta Ads"},{id:"analytics",label:"Analytics"},{id:"behavior",label:"User Behavior"},{id:"gorgias",label:"Customer Service"},{id:"calls",label:"Calls"}]),m=()=>{window.scrollTo({top:0,behavior:"smooth"})},v=(b,g)=>{if(g){const S=g.find(O=>{const j=document.getElementById(O);return j?window.getComputedStyle(j).display!=="none":!1});S&&(b=S)}const x=document.getElementById(b);if(x){const S=x.offsetTop-80;window.scrollTo({top:S,behavior:"smooth"})}};return w.useEffect(()=>{const b=a.current;if(!b)return;const g=()=>{Math.abs(b.scrollLeft-s.current)>5&&o(!1),s.current=b.scrollLeft};return b.addEventListener("scroll",g),()=>b.removeEventListener("scroll",g)},[]),w.useEffect(()=>{const b=()=>{const g=window.pageYOffset||document.documentElement.scrollTop;if(Math.abs(g-l.current)>5)o(!0),l.current=g;else return;const x=[],S=window.innerHeight,O=S*.5;if(p.forEach(j=>{if(j.responsiveIds)j.responsiveIds.find(A=>{const T=document.getElementById(A);if(!T||window.getComputedStyle(T).display==="none")return!1;const k=T.getBoundingClientRect();return k.topO})&&x.push(j.id);else{const P=document.getElementById(j.id);if(P){const A=P.getBoundingClientRect();A.topO&&x.push(j.id)}}}),t(x),i&&x.length>0){const j=n.current[x[0]];j&&a.current&&a.current.scrollTo({left:j.offsetLeft-a.current.offsetWidth/2+j.offsetWidth/2,behavior:"auto"})}};return window.addEventListener("scroll",b),b(),()=>window.removeEventListener("scroll",b)},[p,i]),f.jsx("div",{className:de("sticky z-50 px-4 transition-all duration-200",r?"top-1 sm:top-2 md:top-4 rounded-lg":"rounded-t-none"),children:f.jsx(Ae,{className:de("w-full bg-white dark:bg-gray-900 transition-all duration-200",r?"rounded-lg mt-2 shadow-md":"shadow-sm rounded-t-none border-t-0 -mt-6 pb-2"),children:f.jsx(We,{className:"py-2 px-4",children:f.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center min-w-0 relative",children:[f.jsx("div",{ref:a,className:"overflow-x-auto no-scrollbar min-w-0 -mx-1 px-1 touch-pan-x overscroll-y-contain pr-12",children:f.jsx("div",{className:"flex flex-nowrap space-x-1",children:p.map(({id:b,label:g,responsiveIds:x})=>f.jsx(xr,{ref:S=>n.current[b]=S,variant:e.includes(b)?"default":"ghost",size:"sm",className:de("whitespace-nowrap flex-shrink-0 px-1 md:px-3 py-2 transition-all duration-200",e.includes(b)&&"bg-blue-100 dark:bg-blue-900/70 text-primary dark:text-blue-100 shadow-sm hover:bg-blue-100 dark:hover:bg-blue-900/70 md:hover:bg-blue-200 dark:md:hover:bg-blue-900",!e.includes(b)&&"hover:bg-blue-100 dark:hover:bg-blue-900/40 md:hover:bg-blue-50 dark:md:hover:bg-blue-900/20 hover:text-primary dark:hover:text-blue-100 dark:text-gray-400","focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50"),onClick:()=>v(b,x),children:g},b))})}),f.jsx("div",{className:"absolute -right-2.5 top-0 bottom-0 flex items-center bg-white dark:bg-gray-900 pl-1 pr-0",children:f.jsx(xr,{variant:"icon",size:"sm",className:de("flex-shrink-0 h-10 w-10 p-0 hover:bg-blue-100 dark:hover:bg-blue-900/40",r?"":"hidden"),onClick:m,children:f.jsx(bV,{className:"h-4 w-4"})})})]})})})})};function lt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function _n(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Fr(e,t){const r=lt(e);return isNaN(t)?_n(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function la(e,t){const r=lt(e);if(isNaN(t))return _n(e,NaN);if(!t)return r;const n=r.getDate(),a=_n(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);const i=a.getDate();return n>=i?a:(r.setFullYear(a.getFullYear(),a.getMonth(),n),r)}const fS=6048e5,RK=864e5;let DK={};function Zu(){return DK}function Da(e,t){var s,l,u,h;const r=Zu(),n=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??r.weekStartsOn??((h=(u=r.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,a=lt(e),i=a.getDay(),o=(i=a.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function ol(e){const t=lt(e);return t.setHours(0,0,0,0),t}function hh(e){const t=lt(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Aa(e,t){const r=ol(e),n=ol(t),a=+r-hh(r),i=+n-hh(n);return Math.round((a-i)/RK)}function IK(e){const t=hI(e),r=_n(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),Zo(r)}function Xb(e,t){const r=t*7;return Fr(e,r)}function $K(e,t){return la(e,t*12)}function LK(e){let t;return e.forEach(function(r){const n=lt(r);(t===void 0||t{const n=lt(r);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function Jr(e,t){const r=ol(e),n=ol(t);return+r==+n}function dS(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function BK(e){if(!dS(e)&&typeof e!="number")return!1;const t=lt(e);return!isNaN(Number(t))}function ou(e,t){const r=lt(e),n=lt(t),a=r.getFullYear()-n.getFullYear(),i=r.getMonth()-n.getMonth();return a*12+i}function WK(e,t,r){const n=Da(e,r),a=Da(t,r),i=+n-hh(n),o=+a-hh(a);return Math.round((i-o)/fS)}function hS(e){const t=lt(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function en(e){const t=lt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function pI(e){const t=lt(e),r=_n(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function pS(e,t){var s,l,u,h;const r=Zu(),n=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??r.weekStartsOn??((h=(u=r.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,a=lt(e),i=a.getDay(),o=(i{let n;const a=qK[e];return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function og(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const HK={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},VK={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zK={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},GK={date:og({formats:HK,defaultWidth:"full"}),time:og({formats:VK,defaultWidth:"full"}),dateTime:og({formats:zK,defaultWidth:"full"})},KK={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},YK=(e,t,r,n)=>KK[e];function jc(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let a;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=r!=null&&r.width?String(r.width):o;a=e.formattingValues[s]||e.formattingValues[o]}else{const o=e.defaultWidth,s=r!=null&&r.width?String(r.width):e.defaultWidth;a=e.values[s]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const XK={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ZK={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},JK={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},QK={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},eY={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},tY={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},rY=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},nY={ordinalNumber:rY,era:jc({values:XK,defaultWidth:"wide"}),quarter:jc({values:ZK,defaultWidth:"wide",argumentCallback:e=>e-1}),month:jc({values:JK,defaultWidth:"wide"}),day:jc({values:QK,defaultWidth:"wide"}),dayPeriod:jc({values:eY,defaultWidth:"wide",formattingValues:tY,defaultFormattingWidth:"wide"})};function Tc(e){return(t,r={})=>{const n=r.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?iY(s,p=>p.test(o)):aY(s,p=>p.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=r.valueCallback?r.valueCallback(u):u;const h=t.slice(o.length);return{value:u,rest:h}}}function aY(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function iY(e,t){for(let r=0;r{const n=t.match(e.matchPattern);if(!n)return null;const a=n[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=r.valueCallback?r.valueCallback(o):o;const s=t.slice(a.length);return{value:o,rest:s}}}const sY=/^(\d+)(th|st|nd|rd)?/i,lY=/\d+/i,cY={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},uY={any:[/^b/i,/^(a|c)/i]},fY={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},dY={any:[/1/i,/2/i,/3/i,/4/i]},hY={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},pY={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},mY={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},vY={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},gY={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},yY={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},xY={ordinalNumber:oY({matchPattern:sY,parsePattern:lY,valueCallback:e=>parseInt(e,10)}),era:Tc({matchPatterns:cY,defaultMatchWidth:"wide",parsePatterns:uY,defaultParseWidth:"any"}),quarter:Tc({matchPatterns:fY,defaultMatchWidth:"wide",parsePatterns:dY,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Tc({matchPatterns:hY,defaultMatchWidth:"wide",parsePatterns:pY,defaultParseWidth:"any"}),day:Tc({matchPatterns:mY,defaultMatchWidth:"wide",parsePatterns:vY,defaultParseWidth:"any"}),dayPeriod:Tc({matchPatterns:gY,defaultMatchWidth:"any",parsePatterns:yY,defaultParseWidth:"any"})},vI={code:"en-US",formatDistance:UK,formatLong:GK,formatRelative:YK,localize:nY,match:xY,options:{weekStartsOn:0,firstWeekContainsDate:1}};function bY(e){const t=lt(e);return Aa(t,pI(t))+1}function gI(e){const t=lt(e),r=+Zo(t)-+IK(t);return Math.round(r/fS)+1}function yI(e,t){var h,p,m,v;const r=lt(e),n=r.getFullYear(),a=Zu(),i=(t==null?void 0:t.firstWeekContainsDate)??((p=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??a.firstWeekContainsDate??((v=(m=a.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??1,o=_n(e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const s=Da(o,t),l=_n(e,0);l.setFullYear(n,0,i),l.setHours(0,0,0,0);const u=Da(l,t);return r.getTime()>=s.getTime()?n+1:r.getTime()>=u.getTime()?n:n-1}function wY(e,t){var s,l,u,h;const r=Zu(),n=(t==null?void 0:t.firstWeekContainsDate)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(u=r.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,a=yI(e,t),i=_n(e,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),Da(i,t)}function xI(e,t){const r=lt(e),n=+Da(r,t)-+wY(r,t);return Math.round(n/fS)+1}function St(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Ui={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return St(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):St(r+1,2)},d(e,t){return St(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return St(e.getHours()%12||12,t.length)},H(e,t){return St(e.getHours(),t.length)},m(e,t){return St(e.getMinutes(),t.length)},s(e,t){return St(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return St(a,t.length)}},Ps={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},rT={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return Ui.y(e,t)},Y:function(e,t,r,n){const a=yI(e,n),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return St(o,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):St(i,t.length)},R:function(e,t){const r=hI(e);return St(r,t.length)},u:function(e,t){const r=e.getFullYear();return St(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return St(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return St(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Ui.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return St(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const a=xI(e,n);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):St(a,t.length)},I:function(e,t,r){const n=gI(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):St(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Ui.d(e,t)},D:function(e,t,r){const n=bY(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):St(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return St(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return St(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),a=n===0?7:n;switch(t){case"i":return String(a);case"ii":return St(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let a;switch(n===12?a=Ps.noon:n===0?a=Ps.midnight:a=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let a;switch(n>=17?a=Ps.evening:n>=12?a=Ps.afternoon:n>=4?a=Ps.morning:a=Ps.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Ui.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Ui.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):St(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):St(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ui.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Ui.s(e,t)},S:function(e,t){return Ui.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return aT(n);case"XXXX":case"XX":return Mo(n);case"XXXXX":case"XXX":default:return Mo(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return aT(n);case"xxxx":case"xx":return Mo(n);case"xxxxx":case"xxx":default:return Mo(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nT(n,":");case"OOOO":default:return"GMT"+Mo(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nT(n,":");case"zzzz":default:return"GMT"+Mo(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return St(n,t.length)},T:function(e,t,r){const n=e.getTime();return St(n,t.length)}};function nT(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),i=n%60;return i===0?r+String(a):r+String(a)+t+St(i,2)}function aT(e,t){return e%60===0?(e>0?"-":"+")+St(Math.abs(e)/60,2):Mo(e,t)}function Mo(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=St(Math.trunc(n/60),2),i=St(n%60,2);return r+a+t+i}const iT=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},bI=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},SY=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return iT(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",iT(n,t)).replace("{{time}}",bI(a,t))},OY={p:bI,P:SY},_Y=/^D+$/,AY=/^Y+$/,jY=["D","DD","YY","YYYY"];function TY(e){return _Y.test(e)}function PY(e){return AY.test(e)}function NY(e,t,r){const n=CY(e,t,r);if(console.warn(n),jY.includes(e))throw new RangeError(n)}function CY(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const EY=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kY=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,MY=/^'([^]*?)'?$/,RY=/''/g,DY=/[a-zA-Z]/;function Fa(e,t,r){var h,p,m,v,b,g,x,S;const n=Zu(),a=(r==null?void 0:r.locale)??n.locale??vI,i=(r==null?void 0:r.firstWeekContainsDate)??((p=(h=r==null?void 0:r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??n.firstWeekContainsDate??((v=(m=n.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((g=(b=r==null?void 0:r.locale)==null?void 0:b.options)==null?void 0:g.weekStartsOn)??n.weekStartsOn??((S=(x=n.locale)==null?void 0:x.options)==null?void 0:S.weekStartsOn)??0,s=lt(e);if(!BK(s))throw new RangeError("Invalid time value");let l=t.match(kY).map(O=>{const j=O[0];if(j==="p"||j==="P"){const P=OY[j];return P(O,a.formatLong)}return O}).join("").match(EY).map(O=>{if(O==="''")return{isToken:!1,value:"'"};const j=O[0];if(j==="'")return{isToken:!1,value:IY(O)};if(rT[j])return{isToken:!0,value:O};if(j.match(DY))throw new RangeError("Format string contains an unescaped latin alphabet character `"+j+"`");return{isToken:!1,value:O}});a.localize.preprocessor&&(l=a.localize.preprocessor(s,l));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return l.map(O=>{if(!O.isToken)return O.value;const j=O.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&PY(j)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&TY(j))&&NY(j,t,String(e));const P=rT[j[0]];return P(s,j,a.localize,u)}).join("")}function IY(e){const t=e.match(MY);return t?t[1].replace(RY,"'"):e}function $Y(e){const t=lt(e),r=t.getFullYear(),n=t.getMonth(),a=_n(e,0);return a.setFullYear(r,n+1,0),a.setHours(0,0,0,0),a.getDate()}function LY(e){return Math.trunc(+lt(e)/1e3)}function FY(e){const t=lt(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function BY(e,t){return WK(FY(e),en(e),t)+1}function Zb(e,t){const r=lt(e),n=lt(t);return r.getTime()>n.getTime()}function wI(e,t){const r=lt(e),n=lt(t);return+r<+n}function mS(e,t){const r=lt(e),n=lt(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function WY(e,t){const r=lt(e),n=lt(t);return r.getFullYear()===n.getFullYear()}function sg(e,t){return Fr(e,-t)}function lg(e,t){const r=lt(e),n=r.getFullYear(),a=r.getDate(),i=_n(e,0);i.setFullYear(n,t,15),i.setHours(0,0,0,0);const o=$Y(i);return r.setMonth(t,Math.min(a,o)),r}function oT(e,t){const r=lt(e);return isNaN(+r)?_n(e,NaN):(r.setFullYear(t),r)}var ke=function(){return ke=Object.assign||function(t){for(var r,n=1,a=arguments.length;n1&&(l||!u),p=t>1&&(u||!l),m=function(){n&&i(n)},v=function(){a&&i(a)};return f.jsx(bX,{displayMonth:e.displayMonth,hideNext:h,hidePrevious:p,nextMonth:a,previousMonth:n,onPreviousClick:m,onNextClick:v})}function wX(e){var t,r=It(),n=r.classNames,a=r.disableNavigation,i=r.styles,o=r.captionLayout,s=r.components,l=(t=s==null?void 0:s.CaptionLabel)!==null&&t!==void 0?t:_I,u;return a?u=f.jsx(l,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?u=f.jsx(sT,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?u=f.jsxs(f.Fragment,{children:[f.jsx(sT,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),f.jsx(lT,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=f.jsxs(f.Fragment,{children:[f.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),f.jsx(lT,{displayMonth:e.displayMonth,id:e.id})]}),f.jsx("div",{className:n.caption,style:i.caption,children:u})}function SX(e){var t=It(),r=t.footer,n=t.styles,a=t.classNames.tfoot;return r?f.jsx("tfoot",{className:a,style:n.tfoot,children:f.jsx("tr",{children:f.jsx("td",{colSpan:8,children:r})})}):f.jsx(f.Fragment,{})}function OX(e,t,r){for(var n=r?Zo(new Date):Da(new Date,{locale:e,weekStartsOn:t}),a=[],i=0;i<7;i++){var o=Fr(n,i);a.push(o)}return a}function _X(){var e=It(),t=e.classNames,r=e.styles,n=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,o=e.ISOWeek,s=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,u=OX(a,i,o);return f.jsxs("tr",{style:r.head_row,className:t.head_row,children:[n&&f.jsx("td",{style:r.head_cell,className:t.head_cell}),u.map(function(h,p){return f.jsx("th",{scope:"col",className:t.head_cell,style:r.head_cell,"aria-label":l(h,{locale:a}),children:s(h,{locale:a})},p)})]})}function AX(){var e,t=It(),r=t.classNames,n=t.styles,a=t.components,i=(e=a==null?void 0:a.HeadRow)!==null&&e!==void 0?e:_X;return f.jsx("thead",{style:n.head,className:r.head,children:f.jsx(i,{})})}function jX(e){var t=It(),r=t.locale,n=t.formatters.formatDay;return f.jsx(f.Fragment,{children:n(e.date,{locale:r})})}var vS=w.createContext(void 0);function TX(e){if(!Ju(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return f.jsx(vS.Provider,{value:t,children:e.children})}return f.jsx(PX,{initialProps:e.initialProps,children:e.children})}function PX(e){var t=e.initialProps,r=e.children,n=t.selected,a=t.min,i=t.max,o=function(u,h,p){var m,v;(m=t.onDayClick)===null||m===void 0||m.call(t,u,h,p);var b=!!(h.selected&&a&&(n==null?void 0:n.length)===a);if(!b){var g=!!(!h.selected&&i&&(n==null?void 0:n.length)===i);if(!g){var x=n?SI([],n):[];if(h.selected){var S=x.findIndex(function(O){return Jr(u,O)});x.splice(S,1)}else x.push(u);(v=t.onSelect)===null||v===void 0||v.call(t,x,u,h,p)}}},s={disabled:[]};n&&s.disabled.push(function(u){var h=i&&n.length>i-1,p=n.some(function(m){return Jr(m,u)});return!!(h&&!p)});var l={selected:n,onDayClick:o,modifiers:s};return f.jsx(vS.Provider,{value:l,children:r})}function gS(){var e=w.useContext(vS);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function NX(e,t){var r=t||{},n=r.from,a=r.to;return n&&a?Jr(a,e)&&Jr(n,e)?void 0:Jr(a,e)?{from:a,to:void 0}:Jr(n,e)?void 0:Zb(n,e)?{from:e,to:a}:{from:n,to:e}:a?Zb(e,a)?{from:a,to:e}:{from:e,to:a}:n?wI(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}var yS=w.createContext(void 0);function CX(e){if(!Qu(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return f.jsx(yS.Provider,{value:t,children:e.children})}return f.jsx(EX,{initialProps:e.initialProps,children:e.children})}function EX(e){var t=e.initialProps,r=e.children,n=t.selected,a=n||{},i=a.from,o=a.to,s=t.min,l=t.max,u=function(v,b,g){var x,S;(x=t.onDayClick)===null||x===void 0||x.call(t,v,b,g);var O=NX(v,n);(S=t.onSelect)===null||S===void 0||S.call(t,O,v,b,g)},h={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(h.range_start=[i],o?(h.range_end=[o],Jr(i,o)||(h.range_middle=[{after:i,before:o}])):h.range_end=[i]):o&&(h.range_start=[o],h.range_end=[o]),s&&(i&&!o&&h.disabled.push({after:sg(i,s-1),before:Fr(i,s-1)}),i&&o&&h.disabled.push({after:i,before:Fr(i,s-1)}),!i&&o&&h.disabled.push({after:sg(o,s-1),before:Fr(o,s-1)})),l){if(i&&!o&&(h.disabled.push({before:Fr(i,-l+1)}),h.disabled.push({after:Fr(i,l-1)})),i&&o){var p=Aa(o,i)+1,m=l-p;h.disabled.push({before:sg(i,m)}),h.disabled.push({after:Fr(o,m)})}!i&&o&&(h.disabled.push({before:Fr(o,-l+1)}),h.disabled.push({after:Fr(o,l-1)}))}return f.jsx(yS.Provider,{value:{selected:n,onDayClick:u,modifiers:h},children:r})}function xS(){var e=w.useContext(yS);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Kd(e){return Array.isArray(e)?SI([],e):e!==void 0?[e]:[]}function kX(e){var t={};return Object.entries(e).forEach(function(r){var n=r[0],a=r[1];t[n]=Kd(a)}),t}var ca;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(ca||(ca={}));var MX=ca.Selected,ni=ca.Disabled,RX=ca.Hidden,DX=ca.Today,cg=ca.RangeEnd,ug=ca.RangeMiddle,fg=ca.RangeStart,IX=ca.Outside;function $X(e,t,r){var n,a=(n={},n[MX]=Kd(e.selected),n[ni]=Kd(e.disabled),n[RX]=Kd(e.hidden),n[DX]=[e.today],n[cg]=[],n[ug]=[],n[fg]=[],n[IX]=[],n);return e.fromDate&&a[ni].push({before:e.fromDate}),e.toDate&&a[ni].push({after:e.toDate}),Ju(e)?a[ni]=a[ni].concat(t.modifiers[ni]):Qu(e)&&(a[ni]=a[ni].concat(r.modifiers[ni]),a[fg]=r.modifiers[fg],a[ug]=r.modifiers[ug],a[cg]=r.modifiers[cg]),a}var TI=w.createContext(void 0);function LX(e){var t=It(),r=gS(),n=xS(),a=$X(t,r,n),i=kX(t.modifiers),o=ke(ke({},a),i);return f.jsx(TI.Provider,{value:o,children:e.children})}function PI(){var e=w.useContext(TI);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function FX(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function BX(e){return!!(e&&typeof e=="object"&&"from"in e)}function WX(e){return!!(e&&typeof e=="object"&&"after"in e)}function qX(e){return!!(e&&typeof e=="object"&&"before"in e)}function UX(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function HX(e,t){var r,n=t.from,a=t.to;if(n&&a){var i=Aa(a,n)<0;i&&(r=[a,n],n=r[0],a=r[1]);var o=Aa(e,n)>=0&&Aa(a,e)>=0;return o}return a?Jr(a,e):n?Jr(n,e):!1}function VX(e){return dS(e)}function zX(e){return Array.isArray(e)&&e.every(dS)}function GX(e,t){return t.some(function(r){if(typeof r=="boolean")return r;if(VX(r))return Jr(e,r);if(zX(r))return r.includes(e);if(BX(r))return HX(e,r);if(UX(r))return r.dayOfWeek.includes(e.getDay());if(FX(r)){var n=Aa(r.before,e),a=Aa(r.after,e),i=n>0,o=a<0,s=Zb(r.before,r.after);return s?o&&i:i||o}return WX(r)?Aa(e,r.after)>0:qX(r)?Aa(r.before,e)>0:typeof r=="function"?r(e):!1})}function bS(e,t,r){var n=Object.keys(t).reduce(function(i,o){var s=t[o];return GX(e,s)&&i.push(o),i},[]),a={};return n.forEach(function(i){return a[i]=!0}),r&&!mS(e,r)&&(a.outside=!0),a}function KX(e,t){for(var r=en(e[0]),n=hS(e[e.length-1]),a,i,o=r;o<=n;){var s=bS(o,t),l=!s.disabled&&!s.hidden;if(!l){o=Fr(o,1);continue}if(s.selected)return o;s.today&&!i&&(i=o),a||(a=o),o=Fr(o,1)}return i||a}var YX=365;function NI(e,t){var r=t.moveBy,n=t.direction,a=t.context,i=t.modifiers,o=t.retry,s=o===void 0?{count:0,lastFocused:e}:o,l=a.weekStartsOn,u=a.fromDate,h=a.toDate,p=a.locale,m={day:Fr,week:Xb,month:la,year:$K,startOfWeek:function(x){return a.ISOWeek?Zo(x):Da(x,{locale:p,weekStartsOn:l})},endOfWeek:function(x){return a.ISOWeek?mI(x):pS(x,{locale:p,weekStartsOn:l})}},v=m[r](e,n==="after"?1:-1);n==="before"&&u?v=LK([u,v]):n==="after"&&h&&(v=FK([h,v]));var b=!0;if(i){var g=bS(v,i);b=!g.disabled&&!g.hidden}return b?v:s.count>YX?s.lastFocused:NI(v,{moveBy:r,direction:n,context:a,modifiers:i,retry:ke(ke({},s),{count:s.count+1})})}var CI=w.createContext(void 0);function XX(e){var t=ef(),r=PI(),n=w.useState(),a=n[0],i=n[1],o=w.useState(),s=o[0],l=o[1],u=KX(t.displayMonths,r),h=a??(s&&t.isDateDisplayed(s))?s:u,p=function(){l(a),i(void 0)},m=function(x){i(x)},v=It(),b=function(x,S){if(a){var O=NI(a,{moveBy:x,direction:S,context:v,modifiers:r});Jr(a,O)||(t.goToDate(O,a),m(O))}},g={focusedDay:a,focusTarget:h,blur:p,focus:m,focusDayAfter:function(){return b("day","after")},focusDayBefore:function(){return b("day","before")},focusWeekAfter:function(){return b("week","after")},focusWeekBefore:function(){return b("week","before")},focusMonthBefore:function(){return b("month","before")},focusMonthAfter:function(){return b("month","after")},focusYearBefore:function(){return b("year","before")},focusYearAfter:function(){return b("year","after")},focusStartOfWeek:function(){return b("startOfWeek","before")},focusEndOfWeek:function(){return b("endOfWeek","after")}};return f.jsx(CI.Provider,{value:g,children:e.children})}function wS(){var e=w.useContext(CI);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function ZX(e,t){var r=PI(),n=bS(e,r,t);return n}var SS=w.createContext(void 0);function JX(e){if(!Dp(e.initialProps)){var t={selected:void 0};return f.jsx(SS.Provider,{value:t,children:e.children})}return f.jsx(QX,{initialProps:e.initialProps,children:e.children})}function QX(e){var t=e.initialProps,r=e.children,n=function(i,o,s){var l,u,h;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,o,s),o.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,i,o,s);return}(h=t.onSelect)===null||h===void 0||h.call(t,i,i,o,s)},a={selected:t.selected,onDayClick:n};return f.jsx(SS.Provider,{value:a,children:r})}function EI(){var e=w.useContext(SS);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function eZ(e,t){var r=It(),n=EI(),a=gS(),i=xS(),o=wS(),s=o.focusDayAfter,l=o.focusDayBefore,u=o.focusWeekAfter,h=o.focusWeekBefore,p=o.blur,m=o.focus,v=o.focusMonthBefore,b=o.focusMonthAfter,g=o.focusYearBefore,x=o.focusYearAfter,S=o.focusStartOfWeek,O=o.focusEndOfWeek,j=function(H){var U,Y,se,ne;Dp(r)?(U=n.onDayClick)===null||U===void 0||U.call(n,e,t,H):Ju(r)?(Y=a.onDayClick)===null||Y===void 0||Y.call(a,e,t,H):Qu(r)?(se=i.onDayClick)===null||se===void 0||se.call(i,e,t,H):(ne=r.onDayClick)===null||ne===void 0||ne.call(r,e,t,H)},P=function(H){var U;m(e),(U=r.onDayFocus)===null||U===void 0||U.call(r,e,t,H)},A=function(H){var U;p(),(U=r.onDayBlur)===null||U===void 0||U.call(r,e,t,H)},T=function(H){var U;(U=r.onDayMouseEnter)===null||U===void 0||U.call(r,e,t,H)},N=function(H){var U;(U=r.onDayMouseLeave)===null||U===void 0||U.call(r,e,t,H)},k=function(H){var U;(U=r.onDayPointerEnter)===null||U===void 0||U.call(r,e,t,H)},R=function(H){var U;(U=r.onDayPointerLeave)===null||U===void 0||U.call(r,e,t,H)},W=function(H){var U;(U=r.onDayTouchCancel)===null||U===void 0||U.call(r,e,t,H)},E=function(H){var U;(U=r.onDayTouchEnd)===null||U===void 0||U.call(r,e,t,H)},I=function(H){var U;(U=r.onDayTouchMove)===null||U===void 0||U.call(r,e,t,H)},L=function(H){var U;(U=r.onDayTouchStart)===null||U===void 0||U.call(r,e,t,H)},$=function(H){var U;(U=r.onDayKeyUp)===null||U===void 0||U.call(r,e,t,H)},F=function(H){var U;switch(H.key){case"ArrowLeft":H.preventDefault(),H.stopPropagation(),r.dir==="rtl"?s():l();break;case"ArrowRight":H.preventDefault(),H.stopPropagation(),r.dir==="rtl"?l():s();break;case"ArrowDown":H.preventDefault(),H.stopPropagation(),u();break;case"ArrowUp":H.preventDefault(),H.stopPropagation(),h();break;case"PageUp":H.preventDefault(),H.stopPropagation(),H.shiftKey?g():v();break;case"PageDown":H.preventDefault(),H.stopPropagation(),H.shiftKey?x():b();break;case"Home":H.preventDefault(),H.stopPropagation(),S();break;case"End":H.preventDefault(),H.stopPropagation(),O();break}(U=r.onDayKeyDown)===null||U===void 0||U.call(r,e,t,H)},z={onClick:j,onFocus:P,onBlur:A,onKeyDown:F,onKeyUp:$,onMouseEnter:T,onMouseLeave:N,onPointerEnter:k,onPointerLeave:R,onTouchCancel:W,onTouchEnd:E,onTouchMove:I,onTouchStart:L};return z}function tZ(){var e=It(),t=EI(),r=gS(),n=xS(),a=Dp(e)?t.selected:Ju(e)?r.selected:Qu(e)?n.selected:void 0;return a}function rZ(e){return Object.values(ca).includes(e)}function nZ(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(n){var a=e.modifiersClassNames[n];if(a)r.push(a);else if(rZ(n)){var i=e.classNames["day_".concat(n)];i&&r.push(i)}}),r}function aZ(e,t){var r=ke({},e.styles.day);return Object.keys(t).forEach(function(n){var a;r=ke(ke({},r),(a=e.modifiersStyles)===null||a===void 0?void 0:a[n])}),r}function iZ(e,t,r){var n,a,i,o=It(),s=wS(),l=ZX(e,t),u=eZ(e,l),h=tZ(),p=!!(o.onDayClick||o.mode!=="default");w.useEffect(function(){var T;l.outside||s.focusedDay&&p&&Jr(s.focusedDay,e)&&((T=r.current)===null||T===void 0||T.focus())},[s.focusedDay,e,r,p,l.outside]);var m=nZ(o,l).join(" "),v=aZ(o,l),b=!!(l.outside&&!o.showOutsideDays||l.hidden),g=(i=(a=o.components)===null||a===void 0?void 0:a.DayContent)!==null&&i!==void 0?i:jX,x=f.jsx(g,{date:e,displayMonth:t,activeModifiers:l}),S={style:v,className:m,children:x,role:"gridcell"},O=s.focusTarget&&Jr(s.focusTarget,e)&&!l.outside,j=s.focusedDay&&Jr(s.focusedDay,e),P=ke(ke(ke({},S),(n={disabled:l.disabled,role:"gridcell"},n["aria-selected"]=l.selected,n.tabIndex=j||O?0:-1,n)),u),A={isButton:p,isHidden:b,activeModifiers:l,selectedDays:h,buttonProps:P,divProps:S};return A}function oZ(e){var t=w.useRef(null),r=iZ(e.date,e.displayMonth,t);return r.isHidden?f.jsx("div",{role:"gridcell"}):r.isButton?f.jsx(ph,ke({name:"day",ref:t},r.buttonProps)):f.jsx("div",ke({},r.divProps))}function sZ(e){var t=e.number,r=e.dates,n=It(),a=n.onWeekNumberClick,i=n.styles,o=n.classNames,s=n.locale,l=n.labels.labelWeekNumber,u=n.formatters.formatWeekNumber,h=u(Number(t),{locale:s});if(!a)return f.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:h});var p=l(Number(t),{locale:s}),m=function(v){a(t,r,v)};return f.jsx(ph,{name:"week-number","aria-label":p,className:o.weeknumber,style:i.weeknumber,onClick:m,children:h})}function lZ(e){var t,r,n=It(),a=n.styles,i=n.classNames,o=n.showWeekNumber,s=n.components,l=(t=s==null?void 0:s.Day)!==null&&t!==void 0?t:oZ,u=(r=s==null?void 0:s.WeekNumber)!==null&&r!==void 0?r:sZ,h;return o&&(h=f.jsx("td",{className:i.cell,style:a.cell,children:f.jsx(u,{number:e.weekNumber,dates:e.dates})})),f.jsxs("tr",{className:i.row,style:a.row,children:[h,e.dates.map(function(p){return f.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:f.jsx(l,{displayMonth:e.displayMonth,date:p})},LY(p))})]})}function cT(e,t,r){for(var n=r!=null&&r.ISOWeek?mI(t):pS(t,r),a=r!=null&&r.ISOWeek?Zo(e):Da(e,r),i=Aa(n,a),o=[],s=0;s<=i;s++)o.push(Fr(a,s));var l=o.reduce(function(u,h){var p=r!=null&&r.ISOWeek?gI(h):xI(h,r),m=u.find(function(v){return v.weekNumber===p});return m?(m.dates.push(h),u):(u.push({weekNumber:p,dates:[h]}),u)},[]);return l}function cZ(e,t){var r=cT(en(e),hS(e),t);if(t!=null&&t.useFixedWeeks){var n=BY(e,t);if(n<6){var a=r[r.length-1],i=a.dates[a.dates.length-1],o=Xb(i,6-n),s=cT(Xb(i,1),o,t);r.push.apply(r,s)}}return r}function uZ(e){var t,r,n,a=It(),i=a.locale,o=a.classNames,s=a.styles,l=a.hideHead,u=a.fixedWeeks,h=a.components,p=a.weekStartsOn,m=a.firstWeekContainsDate,v=a.ISOWeek,b=cZ(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:v,locale:i,weekStartsOn:p,firstWeekContainsDate:m}),g=(t=h==null?void 0:h.Head)!==null&&t!==void 0?t:AX,x=(r=h==null?void 0:h.Row)!==null&&r!==void 0?r:lZ,S=(n=h==null?void 0:h.Footer)!==null&&n!==void 0?n:SX;return f.jsxs("table",{id:e.id,className:o.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&f.jsx(g,{}),f.jsx("tbody",{className:o.tbody,style:s.tbody,children:b.map(function(O){return f.jsx(x,{displayMonth:e.displayMonth,dates:O.dates,weekNumber:O.weekNumber},O.weekNumber)})}),f.jsx(S,{displayMonth:e.displayMonth})]})}function fZ(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var dZ=fZ()?w.useLayoutEffect:w.useEffect,dg=!1,hZ=0;function uT(){return"react-day-picker-".concat(++hZ)}function pZ(e){var t,r=e??(dg?uT():null),n=w.useState(r),a=n[0],i=n[1];return dZ(function(){a===null&&i(uT())},[]),w.useEffect(function(){dg===!1&&(dg=!0)},[]),(t=e??a)!==null&&t!==void 0?t:void 0}function mZ(e){var t,r,n=It(),a=n.dir,i=n.classNames,o=n.styles,s=n.components,l=ef().displayMonths,u=pZ(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),h=n.id?"".concat(n.id,"-grid-").concat(e.displayIndex):void 0,p=[i.month],m=o.month,v=e.displayIndex===0,b=e.displayIndex===l.length-1,g=!v&&!b;a==="rtl"&&(t=[v,b],b=t[0],v=t[1]),v&&(p.push(i.caption_start),m=ke(ke({},m),o.caption_start)),b&&(p.push(i.caption_end),m=ke(ke({},m),o.caption_end)),g&&(p.push(i.caption_between),m=ke(ke({},m),o.caption_between));var x=(r=s==null?void 0:s.Caption)!==null&&r!==void 0?r:wX;return f.jsxs("div",{className:p.join(" "),style:m,children:[f.jsx(x,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),f.jsx(uZ,{id:h,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function vZ(e){var t=It(),r=t.classNames,n=t.styles;return f.jsx("div",{className:r.months,style:n.months,children:e.children})}function gZ(e){var t,r,n=e.initialProps,a=It(),i=wS(),o=ef(),s=w.useState(!1),l=s[0],u=s[1];w.useEffect(function(){a.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),u(!0)))},[a.initialFocus,l,i.focus,i.focusTarget,i]);var h=[a.classNames.root,a.className];a.numberOfMonths>1&&h.push(a.classNames.multiple_months),a.showWeekNumber&&h.push(a.classNames.with_weeknumber);var p=ke(ke({},a.styles.root),a.style),m=Object.keys(n).filter(function(b){return b.startsWith("data-")}).reduce(function(b,g){var x;return ke(ke({},b),(x={},x[g]=n[g],x))},{}),v=(r=(t=n.components)===null||t===void 0?void 0:t.Months)!==null&&r!==void 0?r:vZ;return f.jsx("div",ke({className:h.join(" "),style:p,dir:a.dir,id:a.id,nonce:n.nonce,title:n.title,lang:n.lang},m,{children:f.jsx(v,{children:o.displayMonths.map(function(b,g){return f.jsx(mZ,{displayIndex:g,displayMonth:b},g)})})}))}function yZ(e){var t=e.children,r=qY(e,["children"]);return f.jsx(sX,{initialProps:r,children:f.jsx(gX,{children:f.jsx(JX,{initialProps:r,children:f.jsx(TX,{initialProps:r,children:f.jsx(CX,{initialProps:r,children:f.jsx(LX,{children:f.jsx(XX,{children:t})})})})})})})}function xZ(e){return f.jsx(yZ,ke({},e,{children:f.jsx(gZ,{initialProps:e})}))}function kI({className:e,classNames:t,showOutsideDays:r=!0,...n}){return f.jsx(xZ,{showOutsideDays:r,className:de("p-2",e),classNames:{months:"flex flex-col sm:flex-row space-y-2 sm:space-x-2 sm:space-y-0",month:"w-full space-y-2",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-lg font-medium",nav:"space-x-1 flex items-center",nav_button:de(Hb({variant:"ghost",size:"sm"}),"h-6 w-6"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-6 font-normal text-[0.7rem] w-full",row:"flex w-full mt-1",cell:de("w-full relative p-0 text-center text-xs focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:de(Hb({variant:"ghost"}),"h-6 w-6 p-0 font-normal text-xs aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground/50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...a})=>f.jsx(SV,{className:"h-4 w-4"}),IconRight:({...a})=>f.jsx(z1,{className:"h-4 w-4"})},...n})}kI.displayName="Calendar";var hg=0;function OS(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fT()),document.body.insertAdjacentElement("beforeend",e[1]??fT()),hg++,()=>{hg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hg--}},[])}function fT(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var pg="focusScope.autoFocusOnMount",mg="focusScope.autoFocusOnUnmount",dT={bubbles:!1,cancelable:!0},bZ="FocusScope",Ip=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[s,l]=w.useState(null),u=Qt(a),h=Qt(i),p=w.useRef(null),m=it(t,g=>l(g)),v=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let g=function(j){if(v.paused||!s)return;const P=j.target;s.contains(P)?p.current=P:zi(p.current,{select:!0})},x=function(j){if(v.paused||!s)return;const P=j.relatedTarget;P!==null&&(s.contains(P)||zi(p.current,{select:!0}))},S=function(j){if(document.activeElement===document.body)for(const A of j)A.removedNodes.length>0&&zi(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const O=new MutationObserver(S);return s&&O.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),O.disconnect()}}},[n,s,v.paused]),w.useEffect(()=>{if(s){pT.add(v);const g=document.activeElement;if(!s.contains(g)){const S=new CustomEvent(pg,dT);s.addEventListener(pg,u),s.dispatchEvent(S),S.defaultPrevented||(wZ(jZ(MI(s)),{select:!0}),document.activeElement===g&&zi(s))}return()=>{s.removeEventListener(pg,u),setTimeout(()=>{const S=new CustomEvent(mg,dT);s.addEventListener(mg,h),s.dispatchEvent(S),S.defaultPrevented||zi(g??document.body,{select:!0}),s.removeEventListener(mg,h),pT.remove(v)},0)}}},[s,u,h,v]);const b=w.useCallback(g=>{if(!r&&!n||v.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,S=document.activeElement;if(x&&S){const O=g.currentTarget,[j,P]=SZ(O);j&&P?!g.shiftKey&&S===P?(g.preventDefault(),r&&zi(j,{select:!0})):g.shiftKey&&S===j&&(g.preventDefault(),r&&zi(P,{select:!0})):S===O&&g.preventDefault()}},[r,n,v.paused]);return f.jsx(Me.div,{tabIndex:-1,...o,ref:m,onKeyDown:b})});Ip.displayName=bZ;function wZ(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(zi(n,{select:t}),document.activeElement!==r)return}function SZ(e){const t=MI(e),r=hT(t,e),n=hT(t.reverse(),e);return[r,n]}function MI(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function hT(e,t){for(const r of e)if(!OZ(r,{upTo:t}))return r}function OZ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function _Z(e){return e instanceof HTMLInputElement&&"select"in e}function zi(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&_Z(e)&&t&&e.select()}}var pT=AZ();function AZ(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=mT(e,t),e.unshift(t)},remove(t){var r;e=mT(e,t),(r=e[0])==null||r.resume()}}}function mT(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function jZ(e){return e.filter(t=>t.tagName!=="A")}var TZ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ns=new WeakMap,xd=new WeakMap,bd={},vg=0,RI=function(e){return e&&(e.host||RI(e.parentNode))},PZ=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=RI(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},NZ=function(e,t,r,n){var a=PZ(t,Array.isArray(e)?e:[e]);bd[r]||(bd[r]=new WeakMap);var i=bd[r],o=[],s=new Set,l=new Set(a),u=function(p){!p||s.has(p)||(s.add(p),u(p.parentNode))};a.forEach(u);var h=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(m){if(s.has(m))h(m);else try{var v=m.getAttribute(n),b=v!==null&&v!=="false",g=(Ns.get(m)||0)+1,x=(i.get(m)||0)+1;Ns.set(m,g),i.set(m,x),o.push(m),g===1&&b&&xd.set(m,!0),x===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(S){console.error("aria-hidden: cannot operate on ",m,S)}})};return h(t),s.clear(),vg++,function(){o.forEach(function(p){var m=Ns.get(p)-1,v=i.get(p)-1;Ns.set(p,m),i.set(p,v),m||(xd.has(p)||p.removeAttribute(n),xd.delete(p)),v||p.removeAttribute(r)}),vg--,vg||(Ns=new WeakMap,Ns=new WeakMap,xd=new WeakMap,bd={})}},_S=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=TZ(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live]"))),NZ(n,a,r,"aria-hidden")):function(){return null}},_a=function(){return _a=Object.assign||function(t){for(var r,n=1,a=arguments.length;n"u")return zZ;var t=GZ(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},YZ=LI(),Zs="data-scroll-locked",XZ=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,s=e.gap;return r===void 0&&(r="margin"),` .`.concat(EZ,` { overflow: hidden `).concat(n,`; padding-right: `).concat(s,"px ").concat(n,`; } body[`).concat(Zs,`] { overflow: hidden `).concat(n,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` padding-left: `.concat(a,`px; padding-top: `).concat(i,`px; padding-right: `).concat(o,`px; margin-left:0; margin-top:0; margin-right: `).concat(s,"px ").concat(n,`; `),r==="padding"&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),` } .`).concat(Yd,` { right: `).concat(s,"px ").concat(n,`; } .`).concat(Xd,` { margin-right: `).concat(s,"px ").concat(n,`; } .`).concat(Yd," .").concat(Yd,` { right: 0 `).concat(n,`; } .`).concat(Xd," .").concat(Xd,` { margin-right: 0 `).concat(n,`; } body[`).concat(Zs,`] { `).concat(kZ,": ").concat(s,`px; } `)},gT=function(){var e=parseInt(document.body.getAttribute(Zs)||"0",10);return isFinite(e)?e:0},ZZ=function(){w.useEffect(function(){return document.body.setAttribute(Zs,(gT()+1).toString()),function(){var e=gT()-1;e<=0?document.body.removeAttribute(Zs):document.body.setAttribute(Zs,e.toString())}},[])},JZ=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;ZZ();var i=w.useMemo(function(){return KZ(a)},[a]);return w.createElement(YZ,{styles:XZ(i,!t,a,r?"":"!important")})},Jb=!1;if(typeof window<"u")try{var wd=Object.defineProperty({},"passive",{get:function(){return Jb=!0,!0}});window.addEventListener("test",wd,wd),window.removeEventListener("test",wd,wd)}catch{Jb=!1}var Cs=Jb?{passive:!1}:!1,QZ=function(e){return e.tagName==="TEXTAREA"},FI=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!QZ(e)&&r[t]==="visible")},eJ=function(e){return FI(e,"overflowY")},tJ=function(e){return FI(e,"overflowX")},yT=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=BI(e,n);if(a){var i=WI(e,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},rJ=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},nJ=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},BI=function(e,t){return e==="v"?eJ(t):tJ(t)},WI=function(e,t){return e==="v"?rJ(t):nJ(t)},aJ=function(e,t){return e==="h"&&t==="rtl"?-1:1},iJ=function(e,t,r,n,a){var i=aJ(e,window.getComputedStyle(t).direction),o=i*n,s=r.target,l=t.contains(s),u=!1,h=o>0,p=0,m=0;do{var v=WI(e,s),b=v[0],g=v[1],x=v[2],S=g-x-i*b;(b||S)&&BI(e,s)&&(p+=S,m+=b),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(h&&(Math.abs(p)<1||!a)||!h&&(Math.abs(m)<1||!a))&&(u=!0),u},Sd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xT=function(e){return[e.deltaX,e.deltaY]},bT=function(e){return e&&"current"in e?e.current:e},oJ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sJ=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},lJ=0,Es=[];function cJ(e){var t=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),a=w.useState(lJ++)[0],i=w.useState(LI)[0],o=w.useRef(e);w.useEffect(function(){o.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var g=CZ([e.lockRef.current],(e.shards||[]).map(bT),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var S=Sd(g),O=r.current,j="deltaX"in g?g.deltaX:O[0]-S[0],P="deltaY"in g?g.deltaY:O[1]-S[1],A,T=g.target,N=Math.abs(j)>Math.abs(P)?"h":"v";if("touches"in g&&N==="h"&&T.type==="range")return!1;var k=yT(N,T);if(!k)return!0;if(k?A=N:(A=N==="v"?"h":"v",k=yT(N,T)),!k)return!1;if(!n.current&&"changedTouches"in g&&(j||P)&&(n.current=A),!A)return!0;var R=n.current||A;return iJ(R,x,g,R==="h"?j:P,!0)},[]),l=w.useCallback(function(g){var x=g;if(!(!Es.length||Es[Es.length-1]!==i)){var S="deltaY"in x?xT(x):Sd(x),O=t.current.filter(function(A){return A.name===x.type&&(A.target===x.target||x.target===A.shadowParent)&&oJ(A.delta,S)})[0];if(O&&O.should){x.cancelable&&x.preventDefault();return}if(!O){var j=(o.current.shards||[]).map(bT).filter(Boolean).filter(function(A){return A.contains(x.target)}),P=j.length>0?s(x,j[0]):!o.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),u=w.useCallback(function(g,x,S,O){var j={name:g,delta:x,target:S,should:O,shadowParent:uJ(S)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(P){return P!==j})},1)},[]),h=w.useCallback(function(g){r.current=Sd(g),n.current=void 0},[]),p=w.useCallback(function(g){u(g.type,xT(g),g.target,s(g,e.lockRef.current))},[]),m=w.useCallback(function(g){u(g.type,Sd(g),g.target,s(g,e.lockRef.current))},[]);w.useEffect(function(){return Es.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Cs),document.addEventListener("touchmove",l,Cs),document.addEventListener("touchstart",h,Cs),function(){Es=Es.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,Cs),document.removeEventListener("touchmove",l,Cs),document.removeEventListener("touchstart",h,Cs)}},[]);var v=e.removeScrollBar,b=e.inert;return w.createElement(w.Fragment,null,b?w.createElement(i,{styles:sJ(a)}):null,v?w.createElement(JZ,{gapMode:e.gapMode}):null)}function uJ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fJ=FZ($I,cJ);var Lp=w.forwardRef(function(e,t){return w.createElement($p,_a({},e,{ref:t,sideCar:fJ}))});Lp.classNames=$p.classNames;var AS="Popover",[qI,hwe]=co(AS,[Ul]),tf=Ul(),[dJ,uo]=qI(AS),UI=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,s=tf(t),l=w.useRef(null),[u,h]=w.useState(!1),[p=!1,m]=pi({prop:n,defaultProp:a,onChange:i});return f.jsx(oS,{...s,children:f.jsx(dJ,{scope:t,contentId:Pa(),triggerRef:l,open:p,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(v=>!v),[m]),hasCustomAnchor:u,onCustomAnchorAdd:w.useCallback(()=>h(!0),[]),onCustomAnchorRemove:w.useCallback(()=>h(!1),[]),modal:o,children:r})})};UI.displayName=AS;var HI="PopoverAnchor",hJ=w.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=uo(HI,r),i=tf(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=a;return w.useEffect(()=>(o(),()=>s()),[o,s]),f.jsx(Ep,{...i,...n,ref:t})});hJ.displayName=HI;var VI="PopoverTrigger",zI=w.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=uo(VI,r),i=tf(r),o=it(t,a.triggerRef),s=f.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":ZI(a.open),...n,ref:o,onClick:be(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?s:f.jsx(Ep,{asChild:!0,...i,children:s})});zI.displayName=VI;var jS="PopoverPortal",[pJ,mJ]=qI(jS,{forceMount:void 0}),GI=e=>{const{__scopePopover:t,forceMount:r,children:n,container:a}=e,i=uo(jS,t);return f.jsx(pJ,{scope:t,forceMount:r,children:f.jsx(rn,{present:r||i.open,children:f.jsx(Ll,{asChild:!0,container:a,children:n})})})};GI.displayName=jS;var sl="PopoverContent",KI=w.forwardRef((e,t)=>{const r=mJ(sl,e.__scopePopover),{forceMount:n=r.forceMount,...a}=e,i=uo(sl,e.__scopePopover);return f.jsx(rn,{present:n||i.open,children:i.modal?f.jsx(vJ,{...a,ref:t}):f.jsx(gJ,{...a,ref:t})})});KI.displayName=sl;var vJ=w.forwardRef((e,t)=>{const r=uo(sl,e.__scopePopover),n=w.useRef(null),a=it(t,n),i=w.useRef(!1);return w.useEffect(()=>{const o=n.current;if(o)return _S(o)},[]),f.jsx(Lp,{as:ao,allowPinchZoom:!0,children:f.jsx(YI,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),i.current||(s=r.triggerRef.current)==null||s.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,u=s.button===2||l;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:be(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),gJ=w.forwardRef((e,t)=>{const r=uo(sl,e.__scopePopover),n=w.useRef(!1),a=w.useRef(!1);return f.jsx(YI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(s=r.triggerRef.current)==null||s.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),YI=w.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...p}=e,m=uo(sl,r),v=tf(r);return OS(),f.jsx(Ip,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:f.jsx($l,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:f.jsx(sS,{"data-state":ZI(m.open),role:"dialog",id:m.contentId,...v,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),XI="PopoverClose",yJ=w.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=uo(XI,r);return f.jsx(Me.button,{type:"button",...n,ref:t,onClick:be(e.onClick,()=>a.onOpenChange(!1))})});yJ.displayName=XI;var xJ="PopoverArrow",bJ=w.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=tf(r);return f.jsx(lS,{...a,...n,ref:t})});bJ.displayName=xJ;function ZI(e){return e?"open":"closed"}var wJ=UI,SJ=zI,OJ=GI,JI=KI;const _J=wJ,AJ=SJ,QI=w.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},a)=>f.jsx(OJ,{children:f.jsx(JI,{ref:a,align:t,sideOffset:r,className:de("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));QI.displayName=JI.displayName;const jJ=Ku("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),TS=w.forwardRef(({className:e,variant:t,...r},n)=>f.jsx("div",{ref:n,role:"alert",className:de(jJ({variant:t}),e),...r}));TS.displayName="Alert";const TJ=w.forwardRef(({className:e,...t},r)=>f.jsx("h5",{ref:r,className:de("mb-1 font-medium leading-none tracking-tight",e),...t}));TJ.displayName="AlertTitle";const PS=w.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:de("text-sm [&_p]:leading-relaxed",e),...t}));PS.displayName="AlertDescription";const PJ=({scaleFactor:e=1})=>{var k,R,W;const[t,r]=w.useState(new Date),[n,a]=w.useState(v(new Date)),[i,o]=w.useState(!1),[s,l]=w.useState(!1),[u,h]=w.useState(null),[p,m]=w.useState(null);w.useEffect(()=>{setTimeout(()=>l(!0),150);const E=setInterval(()=>{const I=new Date,L=v(I);L.minutes!==n.minutes&&(o(!0),setTimeout(()=>o(!1),200)),a(L),r(I)},1e3);return()=>clearInterval(E)},[n]),w.useEffect(()=>{const E=async()=>{try{const L="afce0bef1036dde836997b964e994475",[$,F]=await Promise.all([fetch(`https://api.openweathermap.org/data/2.5/weather?lat=43.63507&lon=-84.18995&appid=${L}&units=imperial`),fetch(`https://api.openweathermap.org/data/2.5/forecast?lat=43.63507&lon=-84.18995&appid=${L}&units=imperial`)]),z=await $.json(),H=await F.json();h(z);const U=H.list.reduce((Y,se)=>{var ae,ue;const ne=new Date(se.dt*1e3).toLocaleDateString();return Y[ne]||(Y[ne]={...se,precipitation:((ae=se.rain)==null?void 0:ae["3h"])||((ue=se.snow)==null?void 0:ue["3h"])||0,pop:se.pop*100}),Y},{});m(Object.values(U).slice(0,5))}catch(L){console.error("Error fetching weather:",L)}};E();const I=setInterval(E,3e5);return()=>clearInterval(I)},[]);function v(E){let I=E.getHours();const L=E.getMinutes(),$=I>=12?"PM":"AM";return I=I%12,I=I||12,{hours:I.toString(),minutes:L.toString().padStart(2,"0"),ampm:$}}const b=E=>({weekday:E.toLocaleDateString("en-US",{weekday:"long"}),month:E.toLocaleDateString("en-US",{month:"long"}),day:E.getDate()}),g=(E,I,L=!1)=>{if(!E)return f.jsx(mi,{className:"w-12 h-12 text-red-500"});const $=parseInt(E,10),F=L?"w-8 h-8":"w-12 h-12";switch(!0){case($>=200&&$<300):return f.jsx(rD,{className:de(F,"text-gray-700")});case($>=300&&$<500):return f.jsx(tD,{className:de(F,"text-blue-600")});case($>=500&&$<600):return f.jsx(Wb,{className:de(F,"text-blue-600")});case($>=600&&$<700):return f.jsx(qb,{className:de(F,"text-blue-400")});case($>=700&&$<721):return f.jsx(sh,{className:de(F,"text-gray-600")});case $===721:return f.jsx(iD,{className:de(F,"text-gray-700")});case($>=722&&$<781):return f.jsx(sh,{className:de(F,"text-gray-600")});case $===781:return f.jsx(uD,{className:de(F,"text-gray-700")});case $===800:return I.getHours()>=6&&I.getHours()<18?f.jsx(cD,{className:de(F,"text-yellow-700")}):f.jsx(sD,{className:de(F,"text-gray-500")});case($>=800&&$<803):return f.jsx(nD,{className:de(F,"text-gray-600")});case $>=803:return f.jsx(aD,{className:de(F,"text-gray-600")});default:return f.jsx(mi,{className:de(F,"text-red-700")})}},x=(E,I)=>{const L=parseInt(E,10);return L>=200&&L<300?"bg-gradient-to-br from-slate-900 via-purple-900 to-slate-800":L>=300&&L<400?"bg-gradient-to-br from-slate-700 via-blue-800 to-slate-700":L>=500&&L<600?"bg-gradient-to-br from-slate-800 via-blue-900 to-slate-700":L>=600&&L<700?"bg-gradient-to-br from-slate-200 via-blue-100 to-slate-100":L>=700&&L<800?"bg-gradient-to-br from-slate-600 via-slate-500 to-slate-400":L===800?I?"bg-gradient-to-br from-slate-900 via-blue-950 to-slate-800":"bg-gradient-to-br from-sky-400 via-blue-400 to-sky-500":L>800?I?"bg-gradient-to-br from-slate-800 via-slate-700 to-slate-600":"bg-gradient-to-br from-slate-400 via-slate-500 to-slate-400":"bg-gradient-to-br from-slate-700 via-slate-600 to-slate-500"},S=(E,I)=>{const L=parseInt(E,10);return L>=600&&L<700||L===800&&!I||L>800&&!I?"text-slate-900":"text-white"},{hours:O,minutes:j,ampm:P}=v(t),A=b(t),T=E=>E?new Date(E*1e3).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):"--:--",N=()=>{var E,I;return f.jsxs("div",{className:"space-y-4 p-3",children:[f.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[f.jsx(Ae,{className:"p-2",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(qV,{className:"w-5 h-5 text-orange-500"}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"text-xs text-muted-foreground",children:"High"}),f.jsxs("span",{className:"text-sm font-bold",children:[Math.round(u.main.temp_max),"°F"]})]})]})}),f.jsx(Ae,{className:"p-2",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(WV,{className:"w-5 h-5 text-blue-500"}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"text-xs text-muted-foreground",children:"Low"}),f.jsxs("span",{className:"text-sm font-bold",children:[Math.round(u.main.temp_min),"°F"]})]})]})}),f.jsx(Ae,{className:"p-2",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(TV,{className:"w-5 h-5 text-blue-400"}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"text-xs text-muted-foreground",children:"Humidity"}),f.jsxs("span",{className:"text-sm font-bold",children:[u.main.humidity,"%"]})]})]})}),f.jsx(Ae,{className:"p-2",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(GV,{className:"w-5 h-5 text-gray-500"}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"text-xs text-muted-foreground",children:"Wind"}),f.jsxs("span",{className:"text-sm font-bold",children:[Math.round(u.wind.speed)," mph"]})]})]})}),f.jsx(Ae,{className:"p-2",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(LV,{className:"w-5 h-5 text-yellow-500"}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"text-xs text-muted-foreground",children:"Sunrise"}),f.jsx("span",{className:"text-sm font-bold",children:T((E=u.sys)==null?void 0:E.sunrise)})]})]})}),f.jsx(Ae,{className:"p-2",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(FV,{className:"w-5 h-5 text-orange-400"}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"text-xs text-muted-foreground",children:"Sunset"}),f.jsx("span",{className:"text-sm font-bold",children:T((I=u.sys)==null?void 0:I.sunset)})]})]})})]}),p&&f.jsx("div",{children:f.jsx("div",{className:"grid grid-cols-5 gap-2",children:p.map((L,$)=>{var F,z,H,U;return f.jsx(Ae,{className:"p-2",children:f.jsxs("div",{className:"flex flex-col items-center gap-1",children:[f.jsx("span",{className:"text-sm font-medium",children:new Date(L.dt*1e3).toLocaleDateString("en-US",{weekday:"short"})}),g(L.weather[0].id,new Date(L.dt*1e3),!0),f.jsxs("div",{className:"flex justify-center gap-1 items-baseline w-full",children:[f.jsxs("span",{className:"text-sm font-medium",children:[Math.round(L.main.temp_max),"°"]}),f.jsxs("span",{className:"text-xs text-muted-foreground",children:[Math.round(L.main.temp_min),"°"]})]}),f.jsxs("div",{className:"flex flex-col items-center gap-1 w-full pt-1",children:[((F=L.rain)==null?void 0:F["3h"])>0&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Wb,{className:"w-3 h-3 text-blue-400"}),f.jsxs("span",{className:"text-xs",children:[L.rain["3h"].toFixed(2),'"']})]}),((z=L.snow)==null?void 0:z["3h"])>0&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(qb,{className:"w-3 h-3 text-blue-400"}),f.jsxs("span",{className:"text-xs",children:[L.snow["3h"].toFixed(2),'"']})]}),!((H=L.rain)!=null&&H["3h"])&&!((U=L.snow)!=null&&U["3h"])&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(HV,{className:"w-3 h-3 text-gray-400"}),f.jsx("span",{className:"text-xs",children:'0"'})]})]})]})},$)})})})]})};return f.jsxs("div",{className:`flex flex-col space-y-2 items-center w-[250px] transition-opacity duration-300 ${s?"opacity-100":"opacity-0"}`,children:[f.jsx(Ae,{className:"bg-gradient-to-br from-slate-900 via-sky-800 to-cyan-800 dark:bg-slate-800 px-1 py-2 w-full hover:scale-[1.02] transition-transform duration-300",children:f.jsx(We,{className:"p-3",children:f.jsx("div",{className:"flex justify-center items-baseline",children:f.jsxs("div",{className:`transition-opacity duration-200 ${i?"opacity-60":"opacity-100"}`,children:[f.jsx("span",{className:"text-6xl font-bold text-white",children:O}),f.jsx("span",{className:"text-6xl font-bold text-white",children:":"}),f.jsx("span",{className:"text-6xl font-bold text-white",children:j}),f.jsx("span",{className:"text-lg font-medium text-white/90 ml-1",children:P})]})})})}),f.jsxs("div",{className:"grid grid-cols-2 gap-2 w-full",children:[f.jsx(Ae,{className:"bg-gradient-to-br from-slate-900 via-violet-800 to-purple-800 aspect-square flex items-center justify-center",children:f.jsx(We,{className:"h-full p-0",children:f.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[f.jsx("span",{className:"text-6xl font-bold text-white",children:A.day}),f.jsx("span",{className:"text-xs font-bold text-white/70 mt-2",children:A.weekday})]})})}),(u==null?void 0:u.main)&&f.jsxs(_J,{children:[f.jsx(AJ,{asChild:!0,children:f.jsxs(Ae,{className:de(x((k=u.weather[0])==null?void 0:k.id,t.getHours()>=18||t.getHours()<6),"flex items-center justify-center aspect-square cursor-pointer hover:brightness-110 transition-all relative"),children:[f.jsx(We,{className:"p-3",children:f.jsxs("div",{className:"flex flex-col items-center",children:[g((R=u.weather[0])==null?void 0:R.id,t),f.jsxs("span",{className:de("text-2xl font-bold ml-1 mt-2",S((W=u.weather[0])==null?void 0:W.id,t.getHours()>=18||t.getHours()<6)),children:[Math.round(u.main.temp),"°"]})]})}),u.alerts&&f.jsx("div",{className:"absolute top-1 right-1",children:f.jsx(Uj,{className:"w-5 h-5 text-red-500"})})]})}),f.jsxs(QI,{className:"w-[450px]",align:"start",side:"right",sideOffset:10,style:{transform:`scale(${e})`,transformOrigin:"left top"},children:[u.alerts&&f.jsxs(TS,{variant:"warning",className:"mb-3",children:[f.jsx(Uj,{className:"h-3 w-3"}),f.jsx(PS,{className:"text-xs",children:u.alerts[0].event})]}),f.jsx(N,{})]})]})]}),f.jsx(Ae,{className:"w-full",children:f.jsx(We,{className:"p-0",children:f.jsx(kI,{selected:t,className:"w-full"})})})]})};function Qb(e,[t,r]){return Math.min(r,Math.max(t,e))}var NJ=w.createContext(void 0);function Fp(e){const t=w.useContext(NJ);return e||t||"ltr"}function e$(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var CJ=[" ","Enter","ArrowUp","ArrowDown"],EJ=[" ","Enter"],rf="Select",[Bp,Wp,kJ]=q1(rf),[Hl,pwe]=co(rf,[kJ,Ul]),qp=Ul(),[MJ,fo]=Hl(rf),[RJ,DJ]=Hl(rf),t$=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:a,onOpenChange:i,value:o,defaultValue:s,onValueChange:l,dir:u,name:h,autoComplete:p,disabled:m,required:v,form:b}=e,g=qp(t),[x,S]=w.useState(null),[O,j]=w.useState(null),[P,A]=w.useState(!1),T=Fp(u),[N=!1,k]=pi({prop:n,defaultProp:a,onChange:i}),[R,W]=pi({prop:o,defaultProp:s,onChange:l}),E=w.useRef(null),I=x?b||!!x.closest("form"):!0,[L,$]=w.useState(new Set),F=Array.from(L).map(z=>z.props.value).join(";");return f.jsx(oS,{...g,children:f.jsxs(MJ,{required:v,scope:t,trigger:x,onTriggerChange:S,valueNode:O,onValueNodeChange:j,valueNodeHasChildren:P,onValueNodeHasChildrenChange:A,contentId:Pa(),value:R,onValueChange:W,open:N,onOpenChange:k,dir:T,triggerPointerDownPosRef:E,disabled:m,children:[f.jsx(Bp.Provider,{scope:t,children:f.jsx(RJ,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(z=>{$(H=>new Set(H).add(z))},[]),onNativeOptionRemove:w.useCallback(z=>{$(H=>{const U=new Set(H);return U.delete(z),U})},[]),children:r})}),I?f.jsxs(j$,{"aria-hidden":!0,required:v,tabIndex:-1,name:h,autoComplete:p,value:R,onChange:z=>W(z.target.value),disabled:m,form:b,children:[R===void 0?f.jsx("option",{value:""}):null,Array.from(L)]},F):null]})})};t$.displayName=rf;var r$="SelectTrigger",n$=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...a}=e,i=qp(r),o=fo(r$,r),s=o.disabled||n,l=it(t,o.onTriggerChange),u=Wp(r),h=w.useRef("touch"),[p,m,v]=T$(g=>{const x=u().filter(j=>!j.disabled),S=x.find(j=>j.value===o.value),O=P$(x,g,S);O!==void 0&&o.onValueChange(O.value)}),b=g=>{s||(o.onOpenChange(!0),v()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return f.jsx(Ep,{asChild:!0,...i,children:f.jsx(Me.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":A$(o.value)?"":void 0,...a,ref:l,onClick:be(a.onClick,g=>{g.currentTarget.focus(),h.current!=="mouse"&&b(g)}),onPointerDown:be(a.onPointerDown,g=>{h.current=g.pointerType;const x=g.target;x.hasPointerCapture(g.pointerId)&&x.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(b(g),g.preventDefault())}),onKeyDown:be(a.onKeyDown,g=>{const x=p.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&m(g.key),!(x&&g.key===" ")&&CJ.includes(g.key)&&(b(),g.preventDefault())})})})});n$.displayName=r$;var a$="SelectValue",i$=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,children:i,placeholder:o="",...s}=e,l=fo(a$,r),{onValueNodeHasChildrenChange:u}=l,h=i!==void 0,p=it(t,l.onValueNodeChange);return fr(()=>{u(h)},[u,h]),f.jsx(Me.span,{...s,ref:p,style:{pointerEvents:"none"},children:A$(l.value)?f.jsx(f.Fragment,{children:o}):i})});i$.displayName=a$;var IJ="SelectIcon",o$=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...a}=e;return f.jsx(Me.span,{"aria-hidden":!0,...a,ref:t,children:n||"▼"})});o$.displayName=IJ;var $J="SelectPortal",s$=e=>f.jsx(Ll,{asChild:!0,...e});s$.displayName=$J;var Jo="SelectContent",l$=w.forwardRef((e,t)=>{const r=fo(Jo,e.__scopeSelect),[n,a]=w.useState();if(fr(()=>{a(new DocumentFragment)},[]),!r.open){const i=n;return i?zu.createPortal(f.jsx(c$,{scope:e.__scopeSelect,children:f.jsx(Bp.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),i):null}return f.jsx(u$,{...e,ref:t})});l$.displayName=Jo;var Qn=10,[c$,ho]=Hl(Jo),LJ="SelectContentImpl",u$=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:s,sideOffset:l,align:u,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:v,sticky:b,hideWhenDetached:g,avoidCollisions:x,...S}=e,O=fo(Jo,r),[j,P]=w.useState(null),[A,T]=w.useState(null),N=it(t,we=>P(we)),[k,R]=w.useState(null),[W,E]=w.useState(null),I=Wp(r),[L,$]=w.useState(!1),F=w.useRef(!1);w.useEffect(()=>{if(j)return _S(j)},[j]),OS();const z=w.useCallback(we=>{const[je,...le]=I().map(Z=>Z.ref.current),[pe]=le.slice(-1),he=document.activeElement;for(const Z of we)if(Z===he||(Z==null||Z.scrollIntoView({block:"nearest"}),Z===je&&A&&(A.scrollTop=0),Z===pe&&A&&(A.scrollTop=A.scrollHeight),Z==null||Z.focus(),document.activeElement!==he))return},[I,A]),H=w.useCallback(()=>z([k,j]),[z,k,j]);w.useEffect(()=>{L&&H()},[L,H]);const{onOpenChange:U,triggerPointerDownPosRef:Y}=O;w.useEffect(()=>{if(j){let we={x:0,y:0};const je=pe=>{var he,Z;we={x:Math.abs(Math.round(pe.pageX)-(((he=Y.current)==null?void 0:he.x)??0)),y:Math.abs(Math.round(pe.pageY)-(((Z=Y.current)==null?void 0:Z.y)??0))}},le=pe=>{we.x<=10&&we.y<=10?pe.preventDefault():j.contains(pe.target)||U(!1),document.removeEventListener("pointermove",je),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",je),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",je),document.removeEventListener("pointerup",le,{capture:!0})}}},[j,U,Y]),w.useEffect(()=>{const we=()=>U(!1);return window.addEventListener("blur",we),window.addEventListener("resize",we),()=>{window.removeEventListener("blur",we),window.removeEventListener("resize",we)}},[U]);const[se,ne]=T$(we=>{const je=I().filter(he=>!he.disabled),le=je.find(he=>he.ref.current===document.activeElement),pe=P$(je,we,le);pe&&setTimeout(()=>pe.ref.current.focus())}),ae=w.useCallback((we,je,le)=>{const pe=!F.current&&!le;(O.value!==void 0&&O.value===je||pe)&&(R(we),pe&&(F.current=!0))},[O.value]),ue=w.useCallback(()=>j==null?void 0:j.focus(),[j]),Re=w.useCallback((we,je,le)=>{const pe=!F.current&&!le;(O.value!==void 0&&O.value===je||pe)&&E(we)},[O.value]),qe=n==="popper"?ew:f$,ct=qe===ew?{side:s,sideOffset:l,align:u,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:v,sticky:b,hideWhenDetached:g,avoidCollisions:x}:{};return f.jsx(c$,{scope:r,content:j,viewport:A,onViewportChange:T,itemRefCallback:ae,selectedItem:k,onItemLeave:ue,itemTextRefCallback:Re,focusSelectedItem:H,selectedItemText:W,position:n,isPositioned:L,searchRef:se,children:f.jsx(Lp,{as:ao,allowPinchZoom:!0,children:f.jsx(Ip,{asChild:!0,trapped:O.open,onMountAutoFocus:we=>{we.preventDefault()},onUnmountAutoFocus:be(a,we=>{var je;(je=O.trigger)==null||je.focus({preventScroll:!0}),we.preventDefault()}),children:f.jsx($l,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:we=>we.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:f.jsx(qe,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:we=>we.preventDefault(),...S,...ct,onPlaced:()=>$(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:be(S.onKeyDown,we=>{const je=we.ctrlKey||we.altKey||we.metaKey;if(we.key==="Tab"&&we.preventDefault(),!je&&we.key.length===1&&ne(we.key),["ArrowUp","ArrowDown","Home","End"].includes(we.key)){let pe=I().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(we.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(we.key)){const he=we.target,Z=pe.indexOf(he);pe=pe.slice(Z+1)}setTimeout(()=>z(pe)),we.preventDefault()}})})})})})})});u$.displayName=LJ;var FJ="SelectItemAlignedPosition",f$=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...a}=e,i=fo(Jo,r),o=ho(Jo,r),[s,l]=w.useState(null),[u,h]=w.useState(null),p=it(t,N=>h(N)),m=Wp(r),v=w.useRef(!1),b=w.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:S,focusSelectedItem:O}=o,j=w.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&u&&g&&x&&S){const N=i.trigger.getBoundingClientRect(),k=u.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),W=S.getBoundingClientRect();if(i.dir!=="rtl"){const he=W.left-k.left,Z=R.left-he,Ue=N.left-Z,ie=N.width+Ue,ge=Math.max(ie,k.width),Ie=window.innerWidth-Qn,$e=Qb(Z,[Qn,Math.max(Qn,Ie-ge)]);s.style.minWidth=ie+"px",s.style.left=$e+"px"}else{const he=k.right-W.right,Z=window.innerWidth-R.right-he,Ue=window.innerWidth-N.right-Z,ie=N.width+Ue,ge=Math.max(ie,k.width),Ie=window.innerWidth-Qn,$e=Qb(Z,[Qn,Math.max(Qn,Ie-ge)]);s.style.minWidth=ie+"px",s.style.right=$e+"px"}const E=m(),I=window.innerHeight-Qn*2,L=g.scrollHeight,$=window.getComputedStyle(u),F=parseInt($.borderTopWidth,10),z=parseInt($.paddingTop,10),H=parseInt($.borderBottomWidth,10),U=parseInt($.paddingBottom,10),Y=F+z+L+U+H,se=Math.min(x.offsetHeight*5,Y),ne=window.getComputedStyle(g),ae=parseInt(ne.paddingTop,10),ue=parseInt(ne.paddingBottom,10),Re=N.top+N.height/2-Qn,qe=I-Re,ct=x.offsetHeight/2,we=x.offsetTop+ct,je=F+z+we,le=Y-je;if(je<=Re){const he=E.length>0&&x===E[E.length-1].ref.current;s.style.bottom="0px";const Z=u.clientHeight-g.offsetTop-g.offsetHeight,Ue=Math.max(qe,ct+(he?ue:0)+Z+H),ie=je+Ue;s.style.height=ie+"px"}else{const he=E.length>0&&x===E[0].ref.current;s.style.top="0px";const Ue=Math.max(Re,F+g.offsetTop+(he?ae:0)+ct)+le;s.style.height=Ue+"px",g.scrollTop=je-Re+g.offsetTop}s.style.margin=`${Qn}px 0`,s.style.minHeight=se+"px",s.style.maxHeight=I+"px",n==null||n(),requestAnimationFrame(()=>v.current=!0)}},[m,i.trigger,i.valueNode,s,u,g,x,S,i.dir,n]);fr(()=>j(),[j]);const[P,A]=w.useState();fr(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const T=w.useCallback(N=>{N&&b.current===!0&&(j(),O==null||O(),b.current=!1)},[j,O]);return f.jsx(WJ,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:v,onScrollButtonChange:T,children:f.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:f.jsx(Me.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});f$.displayName=FJ;var BJ="SelectPopperPosition",ew=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=Qn,...i}=e,o=qp(r);return f.jsx(sS,{...o,...i,ref:t,align:n,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ew.displayName=BJ;var[WJ,NS]=Hl(Jo,{}),tw="SelectViewport",d$=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...a}=e,i=ho(tw,r),o=NS(tw,r),s=it(t,i.onViewportChange),l=w.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),f.jsx(Bp.Slot,{scope:r,children:f.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:be(a.onScroll,u=>{const h=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=o;if(m!=null&&m.current&&p){const v=Math.abs(l.current-h.scrollTop);if(v>0){const b=window.innerHeight-Qn*2,g=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),S=Math.max(g,x);if(S0?P:0,p.style.justifyContent="flex-end")}}}l.current=h.scrollTop})})})]})});d$.displayName=tw;var h$="SelectGroup",[qJ,UJ]=Hl(h$),HJ=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=Pa();return f.jsx(qJ,{scope:r,id:a,children:f.jsx(Me.div,{role:"group","aria-labelledby":a,...n,ref:t})})});HJ.displayName=h$;var p$="SelectLabel",m$=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=UJ(p$,r);return f.jsx(Me.div,{id:a.id,...n,ref:t})});m$.displayName=p$;var mh="SelectItem",[VJ,v$]=Hl(mh),g$=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:i,...o}=e,s=fo(mh,r),l=ho(mh,r),u=s.value===n,[h,p]=w.useState(i??""),[m,v]=w.useState(!1),b=it(t,O=>{var j;return(j=l.itemRefCallback)==null?void 0:j.call(l,O,n,a)}),g=Pa(),x=w.useRef("touch"),S=()=>{a||(s.onValueChange(n),s.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(VJ,{scope:r,value:n,disabled:a,textId:g,isSelected:u,onItemTextChange:w.useCallback(O=>{p(j=>j||((O==null?void 0:O.textContent)??"").trim())},[]),children:f.jsx(Bp.ItemSlot,{scope:r,value:n,disabled:a,textValue:h,children:f.jsx(Me.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:b,onFocus:be(o.onFocus,()=>v(!0)),onBlur:be(o.onBlur,()=>v(!1)),onClick:be(o.onClick,()=>{x.current!=="mouse"&&S()}),onPointerUp:be(o.onPointerUp,()=>{x.current==="mouse"&&S()}),onPointerDown:be(o.onPointerDown,O=>{x.current=O.pointerType}),onPointerMove:be(o.onPointerMove,O=>{var j;x.current=O.pointerType,a?(j=l.onItemLeave)==null||j.call(l):x.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(o.onPointerLeave,O=>{var j;O.currentTarget===document.activeElement&&((j=l.onItemLeave)==null||j.call(l))}),onKeyDown:be(o.onKeyDown,O=>{var P;((P=l.searchRef)==null?void 0:P.current)!==""&&O.key===" "||(EJ.includes(O.key)&&S(),O.key===" "&&O.preventDefault())})})})})});g$.displayName=mh;var Bc="SelectItemText",y$=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,...i}=e,o=fo(Bc,r),s=ho(Bc,r),l=v$(Bc,r),u=DJ(Bc,r),[h,p]=w.useState(null),m=it(t,S=>p(S),l.onItemTextChange,S=>{var O;return(O=s.itemTextRefCallback)==null?void 0:O.call(s,S,l.value,l.disabled)}),v=h==null?void 0:h.textContent,b=w.useMemo(()=>f.jsx("option",{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=u;return fr(()=>(g(b),()=>x(b)),[g,x,b]),f.jsxs(f.Fragment,{children:[f.jsx(Me.span,{id:l.textId,...i,ref:m}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?zu.createPortal(i.children,o.valueNode):null]})});y$.displayName=Bc;var x$="SelectItemIndicator",b$=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return v$(x$,r).isSelected?f.jsx(Me.span,{"aria-hidden":!0,...n,ref:t}):null});b$.displayName=x$;var rw="SelectScrollUpButton",w$=w.forwardRef((e,t)=>{const r=ho(rw,e.__scopeSelect),n=NS(rw,e.__scopeSelect),[a,i]=w.useState(!1),o=it(t,n.onScrollButtonChange);return fr(()=>{if(r.viewport&&r.isPositioned){let s=function(){const u=l.scrollTop>0;i(u)};const l=r.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),a?f.jsx(O$,{...e,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});w$.displayName=rw;var nw="SelectScrollDownButton",S$=w.forwardRef((e,t)=>{const r=ho(nw,e.__scopeSelect),n=NS(nw,e.__scopeSelect),[a,i]=w.useState(!1),o=it(t,n.onScrollButtonChange);return fr(()=>{if(r.viewport&&r.isPositioned){let s=function(){const u=l.scrollHeight-l.clientHeight,h=Math.ceil(l.scrollTop)l.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),a?f.jsx(O$,{...e,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});S$.displayName=nw;var O$=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=e,i=ho("SelectScrollButton",r),o=w.useRef(null),s=Wp(r),l=w.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),fr(()=>{var h;const u=s().find(p=>p.ref.current===document.activeElement);(h=u==null?void 0:u.ref.current)==null||h.scrollIntoView({block:"nearest"})},[s]),f.jsx(Me.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:be(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:be(a.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:be(a.onPointerLeave,()=>{l()})})}),zJ="SelectSeparator",_$=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return f.jsx(Me.div,{"aria-hidden":!0,...n,ref:t})});_$.displayName=zJ;var aw="SelectArrow",GJ=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=qp(r),i=fo(aw,r),o=ho(aw,r);return i.open&&o.position==="popper"?f.jsx(lS,{...a,...n,ref:t}):null});GJ.displayName=aw;function A$(e){return e===""||e===void 0}var j$=w.forwardRef((e,t)=>{const{value:r,...n}=e,a=w.useRef(null),i=it(t,a),o=e$(r);return w.useEffect(()=>{const s=a.current,l=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==r&&h){const p=new Event("change",{bubbles:!0});h.call(s,r),s.dispatchEvent(p)}},[o,r]),f.jsx(Gu,{asChild:!0,children:f.jsx("select",{...n,ref:i,defaultValue:r})})});j$.displayName="BubbleSelect";function T$(e){const t=Qt(e),r=w.useRef(""),n=w.useRef(0),a=w.useCallback(o=>{const s=r.current+o;t(s),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),i=w.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,i]}function P$(e,t,r){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=KJ(e,Math.max(i,0));a.length===1&&(o=o.filter(u=>u!==r));const l=o.find(u=>u.textValue.toLowerCase().startsWith(a.toLowerCase()));return l!==r?l:void 0}function KJ(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var YJ=t$,N$=n$,XJ=i$,ZJ=o$,JJ=s$,C$=l$,QJ=d$,E$=m$,k$=g$,eQ=y$,tQ=b$,M$=w$,R$=S$,D$=_$;const su=YJ,lu=XJ,ll=w.forwardRef(({className:e,children:t,...r},n)=>f.jsxs(N$,{ref:n,className:de("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,f.jsx(ZJ,{asChild:!0,children:f.jsx(eD,{className:"h-4 w-4 opacity-50"})})]}));ll.displayName=N$.displayName;const I$=w.forwardRef(({className:e,...t},r)=>f.jsx(M$,{ref:r,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(OV,{className:"h-4 w-4"})}));I$.displayName=M$.displayName;const $$=w.forwardRef(({className:e,...t},r)=>f.jsx(R$,{ref:r,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(eD,{className:"h-4 w-4"})}));$$.displayName=R$.displayName;const cl=w.forwardRef(({className:e,children:t,position:r="popper",...n},a)=>f.jsx(JJ,{children:f.jsxs(C$,{ref:a,className:de("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[f.jsx(I$,{}),f.jsx(QJ,{className:de("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx($$,{})]})}));cl.displayName=C$.displayName;const rQ=w.forwardRef(({className:e,...t},r)=>f.jsx(E$,{ref:r,className:de("px-2 py-1.5 text-sm font-semibold",e),...t}));rQ.displayName=E$.displayName;const lo=w.forwardRef(({className:e,children:t,...r},n)=>f.jsxs(k$,{ref:n,className:de("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[f.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(tQ,{children:f.jsx(QR,{className:"h-4 w-4"})})}),f.jsx(eQ,{children:t})]}));lo.displayName=k$.displayName;const nQ=w.forwardRef(({className:e,...t},r)=>f.jsx(D$,{ref:r,className:de("-mx-1 my-1 h-px bg-muted",e),...t}));nQ.displayName=D$.displayName;function Je({className:e,...t}){return f.jsx("div",{className:de("animate-pulse rounded-md bg-primary/10",e),...t})}const ua=w.forwardRef(({className:e,...t},r)=>f.jsx("div",{className:"relative w-full overflow-auto",children:f.jsx("table",{ref:r,className:de("w-full caption-bottom text-sm",e),...t})}));ua.displayName="Table";const fa=w.forwardRef(({className:e,...t},r)=>f.jsx("thead",{ref:r,className:de("[&_tr]:border-b",e),...t}));fa.displayName="TableHeader";const da=w.forwardRef(({className:e,...t},r)=>f.jsx("tbody",{ref:r,className:de("[&_tr:last-child]:border-0",e),...t}));da.displayName="TableBody";const aQ=w.forwardRef(({className:e,...t},r)=>f.jsx("tfoot",{ref:r,className:de("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));aQ.displayName="TableFooter";const er=w.forwardRef(({className:e,...t},r)=>f.jsx("tr",{ref:r,className:de("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));er.displayName="TableRow";const Fe=w.forwardRef(({className:e,...t},r)=>f.jsx("th",{ref:r,className:de("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Fe.displayName="TableHead";const Be=w.forwardRef(({className:e,...t},r)=>f.jsx("td",{ref:r,className:de("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Be.displayName="TableCell";const iQ=w.forwardRef(({className:e,...t},r)=>f.jsx("caption",{ref:r,className:de("mt-4 text-sm text-muted-foreground",e),...t}));iQ.displayName="TableCaption";var bg,wT;function nn(){if(wT)return bg;wT=1;var e=Array.isArray;return bg=e,bg}var wg,ST;function L$(){if(ST)return wg;ST=1;var e=typeof Qi=="object"&&Qi&&Qi.Object===Object&&Qi;return wg=e,wg}var Sg,OT;function Ba(){if(OT)return Sg;OT=1;var e=L$(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Sg=r,Sg}var Og,_T;function nf(){if(_T)return Og;_T=1;var e=Ba(),t=e.Symbol;return Og=t,Og}var _g,AT;function oQ(){if(AT)return _g;AT=1;var e=nf(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,a=e?e.toStringTag:void 0;function i(o){var s=r.call(o,a),l=o[a];try{o[a]=void 0;var u=!0}catch{}var h=n.call(o);return u&&(s?o[a]=l:delete o[a]),h}return _g=i,_g}var Ag,jT;function sQ(){if(jT)return Ag;jT=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Ag=r,Ag}var jg,TT;function Si(){if(TT)return jg;TT=1;var e=nf(),t=oQ(),r=sQ(),n="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?a:n:i&&i in Object(s)?t(s):r(s)}return jg=o,jg}var Tg,PT;function Oi(){if(PT)return Tg;PT=1;function e(t){return t!=null&&typeof t=="object"}return Tg=e,Tg}var Pg,NT;function Vl(){if(NT)return Pg;NT=1;var e=Si(),t=Oi(),r="[object Symbol]";function n(a){return typeof a=="symbol"||t(a)&&e(a)==r}return Pg=n,Pg}var Ng,CT;function CS(){if(CT)return Ng;CT=1;var e=nn(),t=Vl(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(e(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||t(i)?!0:n.test(i)||!r.test(i)||o!=null&&i in Object(o)}return Ng=a,Ng}var Cg,ET;function po(){if(ET)return Cg;ET=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Cg=e,Cg}var Eg,kT;function ES(){if(kT)return Eg;kT=1;var e=Si(),t=po(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!t(s))return!1;var l=e(s);return l==n||l==a||l==r||l==i}return Eg=o,Eg}var kg,MT;function lQ(){if(MT)return kg;MT=1;var e=Ba(),t=e["__core-js_shared__"];return kg=t,kg}var Mg,RT;function cQ(){if(RT)return Mg;RT=1;var e=lQ(),t=function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!t&&t in n}return Mg=r,Mg}var Rg,DT;function F$(){if(DT)return Rg;DT=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Rg=r,Rg}var Dg,IT;function uQ(){if(IT)return Dg;IT=1;var e=ES(),t=cQ(),r=po(),n=F$(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,l=o.toString,u=s.hasOwnProperty,h=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(m){if(!r(m)||t(m))return!1;var v=e(m)?h:i;return v.test(n(m))}return Dg=p,Dg}var Ig,$T;function fQ(){if($T)return Ig;$T=1;function e(t,r){return t==null?void 0:t[r]}return Ig=e,Ig}var $g,LT;function ss(){if(LT)return $g;LT=1;var e=uQ(),t=fQ();function r(n,a){var i=t(n,a);return e(i)?i:void 0}return $g=r,$g}var Lg,FT;function Up(){if(FT)return Lg;FT=1;var e=ss(),t=e(Object,"create");return Lg=t,Lg}var Fg,BT;function dQ(){if(BT)return Fg;BT=1;var e=Up();function t(){this.__data__=e?e(null):{},this.size=0}return Fg=t,Fg}var Bg,WT;function hQ(){if(WT)return Bg;WT=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Bg=e,Bg}var Wg,qT;function pQ(){if(qT)return Wg;qT=1;var e=Up(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var o=this.__data__;if(e){var s=o[i];return s===t?void 0:s}return n.call(o,i)?o[i]:void 0}return Wg=a,Wg}var qg,UT;function mQ(){if(UT)return qg;UT=1;var e=Up(),t=Object.prototype,r=t.hasOwnProperty;function n(a){var i=this.__data__;return e?i[a]!==void 0:r.call(i,a)}return qg=n,qg}var Ug,HT;function vQ(){if(HT)return Ug;HT=1;var e=Up(),t="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=e&&a===void 0?t:a,this}return Ug=r,Ug}var Hg,VT;function gQ(){if(VT)return Hg;VT=1;var e=dQ(),t=hQ(),r=pQ(),n=mQ(),a=vQ();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s-1}return Xg=t,Xg}var Zg,JT;function SQ(){if(JT)return Zg;JT=1;var e=Hp();function t(r,n){var a=this.__data__,i=e(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Zg=t,Zg}var Jg,QT;function Vp(){if(QT)return Jg;QT=1;var e=yQ(),t=xQ(),r=bQ(),n=wQ(),a=SQ();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s0?1:-1},$o=function(t){return af(t)&&t.indexOf("%")===t.length-1},ce=function(t){return VQ(t)&&!of(t)},ur=function(t){return ce(t)||af(t)},zQ=0,Gl=function(t){var r=++zQ;return"".concat(t||"").concat(r)},Wr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ce(t)&&!af(t))return n;var i;if($o(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return of(i)&&(i=n),a&&i>r&&(i=r),i},Zi=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},GQ=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function QQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ow(e){"@babel/helpers - typeof";return ow=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ow(e)}var TP={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ui=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},PP=null,_y=null,LS=function e(t){if(t===PP&&Array.isArray(_y))return _y;var r=[];return w.Children.forEach(t,function(n){ze(n)||(WQ.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),_y=r,PP=t,r};function wn(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return ui(a)}):n=[ui(t)],LS(e).forEach(function(a){var i=bn(a,"type.displayName")||bn(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function mn(e,t){var r=wn(e,t);return r&&r[0]}var NP=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!ce(n)||n<=0||!ce(a)||a<=0)},eee=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],tee=function(t){return t&&t.type&&af(t.type)&&eee.indexOf(t.type)>=0},ree=function(t){return t&&ow(t)==="object"&&"clipDot"in t},nee=function(t,r,n,a){var i,o=(i=Oy==null?void 0:Oy[a])!==null&&i!==void 0?i:[];return!De(t)&&(a&&o.includes(r)||YQ.includes(r))||n&&$S.includes(r)},Te=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(w.isValidElement(t)&&(a=t.props),!zl(a))return null;var i={};return Object.keys(a).forEach(function(o){var s;nee((s=a)===null||s===void 0?void 0:s[o],o,r,n)&&(i[o]=a[o])}),i},sw=function e(t,r){if(t===r)return!0;var n=w.Children.count(t);if(n!==w.Children.count(r))return!1;if(n===0)return!0;if(n===1)return CP(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function cw(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,o=e.style,s=e.title,l=e.desc,u=see(e,oee),h=a||{width:r,height:n,x:0,y:0},p=Ke("recharts-surface",i);return q.createElement("svg",lw({},Te(u,!0,"svg"),{className:p,width:r,height:n,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),q.createElement("title",null,s),q.createElement("desc",null,l),t)}var cee=["children","className"];function uw(){return uw=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function fee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ft=q.forwardRef(function(e,t){var r=e.children,n=e.className,a=uee(e,cee),i=Ke("recharts-layer",n);return q.createElement("g",uw({className:i},Te(a,!0),{ref:t}),r)}),ia=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;ii?0:i+r),n=n>i?i:n,n<0&&(n+=i),i=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(i);++a=i?r:e(r,n,a)}return jy=t,jy}var Ty,RP;function V$(){if(RP)return Ty;RP=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,i="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+e+a+i+"]");function l(u){return s.test(u)}return Ty=l,Ty}var Py,DP;function pee(){if(DP)return Py;DP=1;function e(t){return t.split("")}return Py=e,Py}var Ny,IP;function mee(){if(IP)return Ny;IP=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,i="\\ufe0e\\ufe0f",o="["+e+"]",s="["+a+"]",l="\\ud83c[\\udffb-\\udfff]",u="(?:"+s+"|"+l+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",b=u+"?",g="["+i+"]?",x="(?:"+v+"(?:"+[h,p,m].join("|")+")"+g+b+")*",S=g+b+x,O="(?:"+[h+s+"?",s,p,m,o].join("|")+")",j=RegExp(l+"(?="+l+")|"+O+S,"g");function P(A){return A.match(j)||[]}return Ny=P,Ny}var Cy,$P;function vee(){if($P)return Cy;$P=1;var e=pee(),t=V$(),r=mee();function n(a){return t(a)?r(a):e(a)}return Cy=n,Cy}var Ey,LP;function gee(){if(LP)return Ey;LP=1;var e=hee(),t=V$(),r=vee(),n=W$();function a(i){return function(o){o=n(o);var s=t(o)?r(o):void 0,l=s?s[0]:o.charAt(0),u=s?e(s,1).join(""):o.slice(1);return l[i]()+u}}return Ey=a,Ey}var ky,FP;function yee(){if(FP)return ky;FP=1;var e=gee(),t=e("toUpperCase");return ky=t,ky}var xee=yee();const Kp=jt(xee);function Rt(e){return function(){return e}}const z$=Math.cos,yh=Math.sin,pa=Math.sqrt,xh=Math.PI,Yp=2*xh,fw=Math.PI,dw=2*fw,Ro=1e-6,bee=dw-Ro;function G$(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return G$;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;aRo)if(!(Math.abs(p*l-u*h)>Ro)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let v=n-o,b=a-s,g=l*l+u*u,x=v*v+b*b,S=Math.sqrt(g),O=Math.sqrt(m),j=i*Math.tan((fw-Math.acos((g+m-x)/(2*S*O)))/2),P=j/O,A=j/S;Math.abs(P-1)>Ro&&this._append`L${t+P*h},${r+P*p}`,this._append`A${i},${i},0,0,${+(p*v>h*b)},${this._x1=t+A*l},${this._y1=r+A*u}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(a),l=n*Math.sin(a),u=t+s,h=r+l,p=1^o,m=o?a-i:i-a;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Ro||Math.abs(this._y1-h)>Ro)&&this._append`L${u},${h}`,n&&(m<0&&(m=m%dw+dw),m>bee?this._append`A${n},${n},0,1,${p},${t-s},${r-l}A${n},${n},0,1,${p},${this._x1=u},${this._y1=h}`:m>Ro&&this._append`A${n},${n},0,${+(m>=fw)},${p},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function FS(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new See(t)}function BS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function K$(e){this._context=e}K$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Xp(e){return new K$(e)}function Y$(e){return e[0]}function X$(e){return e[1]}function Z$(e,t){var r=Rt(!0),n=null,a=Xp,i=null,o=FS(s);e=typeof e=="function"?e:e===void 0?Y$:Rt(e),t=typeof t=="function"?t:t===void 0?X$:Rt(t);function s(l){var u,h=(l=BS(l)).length,p,m=!1,v;for(n==null&&(i=a(v=o())),u=0;u<=h;++u)!(u=v;--b)s.point(j[b],P[b]);s.lineEnd(),s.areaEnd()}S&&(j[m]=+e(x,m,p),P[m]=+t(x,m,p),s.point(n?+n(x,m,p):j[m],r?+r(x,m,p):P[m]))}if(O)return s=null,O+""||null}function h(){return Z$().defined(a).curve(o).context(i)}return u.x=function(p){return arguments.length?(e=typeof p=="function"?p:Rt(+p),n=null,u):e},u.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Rt(+p),u):e},u.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Rt(+p),u):n},u.y=function(p){return arguments.length?(t=typeof p=="function"?p:Rt(+p),r=null,u):t},u.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Rt(+p),u):t},u.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Rt(+p),u):r},u.lineX0=u.lineY0=function(){return h().x(e).y(t)},u.lineY1=function(){return h().x(e).y(r)},u.lineX1=function(){return h().x(n).y(t)},u.defined=function(p){return arguments.length?(a=typeof p=="function"?p:Rt(!!p),u):a},u.curve=function(p){return arguments.length?(o=p,i!=null&&(s=o(i)),u):o},u.context=function(p){return arguments.length?(p==null?i=s=null:s=o(i=p),u):i},u}class J${constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Oee(e){return new J$(e,!0)}function _ee(e){return new J$(e,!1)}const WS={draw(e,t){const r=pa(t/xh);e.moveTo(r,0),e.arc(0,0,r,0,Yp)}},Aee={draw(e,t){const r=pa(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},Q$=pa(1/3),jee=Q$*2,Tee={draw(e,t){const r=pa(t/jee),n=r*Q$;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Pee={draw(e,t){const r=pa(t),n=-r/2;e.rect(n,n,r,r)}},Nee=.8908130915292852,eL=yh(xh/10)/yh(7*xh/10),Cee=yh(Yp/10)*eL,Eee=-z$(Yp/10)*eL,kee={draw(e,t){const r=pa(t*Nee),n=Cee*r,a=Eee*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=Yp*i/5,s=z$(o),l=yh(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*a,l*n+s*a)}e.closePath()}},My=pa(3),Mee={draw(e,t){const r=-pa(t/(My*3));e.moveTo(0,r*2),e.lineTo(-My*r,-r),e.lineTo(My*r,-r),e.closePath()}},Dn=-.5,In=pa(3)/2,hw=1/pa(12),Ree=(hw/2+1)*3,Dee={draw(e,t){const r=pa(t/Ree),n=r/2,a=r*hw,i=n,o=r*hw+r,s=-i,l=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(s,l),e.lineTo(Dn*n-In*a,In*n+Dn*a),e.lineTo(Dn*i-In*o,In*i+Dn*o),e.lineTo(Dn*s-In*l,In*s+Dn*l),e.lineTo(Dn*n+In*a,Dn*a-In*n),e.lineTo(Dn*i+In*o,Dn*o-In*i),e.lineTo(Dn*s+In*l,Dn*l-In*s),e.closePath()}};function Iee(e,t){let r=null,n=FS(a);e=typeof e=="function"?e:Rt(e||WS),t=typeof t=="function"?t:Rt(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:Rt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:Rt(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function bh(){}function wh(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function tL(e){this._context=e}tL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:wh(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:wh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $ee(e){return new tL(e)}function rL(e){this._context=e}rL.prototype={areaStart:bh,areaEnd:bh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:wh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Lee(e){return new rL(e)}function nL(e){this._context=e}nL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:wh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Fee(e){return new nL(e)}function aL(e){this._context=e}aL.prototype={areaStart:bh,areaEnd:bh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Bee(e){return new aL(e)}function BP(e){return e<0?-1:1}function WP(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),s=(i*a+o*n)/(n+a);return(BP(i)+BP(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function qP(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ry(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,s=(i-n)/3;e._context.bezierCurveTo(n+s,a+s*t,i-s,o-s*r,i,o)}function Sh(e){this._context=e}Sh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ry(this,this._t0,qP(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ry(this,qP(this,r=WP(this,e,t)),r);break;default:Ry(this,this._t0,r=WP(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function iL(e){this._context=new oL(e)}(iL.prototype=Object.create(Sh.prototype)).point=function(e,t){Sh.prototype.point.call(this,t,e)};function oL(e){this._context=e}oL.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function Wee(e){return new Sh(e)}function qee(e){return new iL(e)}function sL(e){this._context=e}sL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=UP(e),a=UP(t),i=0,o=1;o=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Hee(e){return new Zp(e,.5)}function Vee(e){return new Zp(e,0)}function zee(e){return new Zp(e,1)}function ul(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,s=i.length;r=0;)r[t]=t;return r}function Gee(e,t){return e[t]}function Kee(e){const t=[];return t.key=e,t}function Yee(){var e=Rt([]),t=pw,r=ul,n=Gee;function a(i){var o=Array.from(e.apply(this,arguments),Kee),s,l=o.length,u=-1,h;for(const p of i)for(s=0,++u;s0){for(var r,n,a=0,i=e[0].length,o;a0){for(var r=0,n=e[t[0]],a,i=n.length;r0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ate(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var lL={symbolCircle:WS,symbolCross:Aee,symbolDiamond:Tee,symbolSquare:Pee,symbolStar:kee,symbolTriangle:Mee,symbolWye:Dee},ite=Math.PI/180,ote=function(t){var r="symbol".concat(Kp(t));return lL[r]||WS},ste=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*ite;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},lte=function(t,r){lL["symbol".concat(Kp(t))]=r},qS=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,o=t.sizeType,s=o===void 0?"area":o,l=nte(t,Qee),u=VP(VP({},l),{},{type:n,size:i,sizeType:s}),h=function(){var x=ote(n),S=Iee().type(x).size(ste(i,s,n));return S()},p=u.className,m=u.cx,v=u.cy,b=Te(u,!0);return m===+m&&v===+v&&i===+i?q.createElement("path",mw({},b,{className:Ke("recharts-symbols",p),transform:"translate(".concat(m,", ").concat(v,")"),d:h()})):null};qS.registerSymbol=lte;function fl(e){"@babel/helpers - typeof";return fl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fl(e)}function vw(){return vw=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var O=v.inactive?u:v.color;return q.createElement("li",vw({className:x,style:p,key:"legend-item-".concat(b)},Qo(n.props,v,b)),q.createElement(cw,{width:o,height:o,viewBox:h,style:m},n.renderIcon(v)),q.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},g?g(S,v,b):S))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var s={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return q.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(w.PureComponent);uu(US,"displayName","Legend");uu(US,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Dy,GP;function yte(){if(GP)return Dy;GP=1;var e=Vp();function t(){this.__data__=new e,this.size=0}return Dy=t,Dy}var Iy,KP;function xte(){if(KP)return Iy;KP=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Iy=e,Iy}var $y,YP;function bte(){if(YP)return $y;YP=1;function e(t){return this.__data__.get(t)}return $y=e,$y}var Ly,XP;function wte(){if(XP)return Ly;XP=1;function e(t){return this.__data__.has(t)}return Ly=e,Ly}var Fy,ZP;function Ste(){if(ZP)return Fy;ZP=1;var e=Vp(),t=MS(),r=RS(),n=200;function a(i,o){var s=this.__data__;if(s instanceof e){var l=s.__data__;if(!t||l.lengthv))return!1;var g=p.get(o),x=p.get(s);if(g&&x)return g==s&&x==o;var S=-1,O=!0,j=l&a?new e:void 0;for(p.set(o,s),p.set(s,o);++S-1&&n%1==0&&n-1&&r%1==0&&r<=e}return s0=t,s0}var l0,wN;function Dte(){if(wN)return l0;wN=1;var e=Si(),t=GS(),r=Oi(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",s="[object Error]",l="[object Function]",u="[object Map]",h="[object Number]",p="[object Object]",m="[object RegExp]",v="[object Set]",b="[object String]",g="[object WeakMap]",x="[object ArrayBuffer]",S="[object DataView]",O="[object Float32Array]",j="[object Float64Array]",P="[object Int8Array]",A="[object Int16Array]",T="[object Int32Array]",N="[object Uint8Array]",k="[object Uint8ClampedArray]",R="[object Uint16Array]",W="[object Uint32Array]",E={};E[O]=E[j]=E[P]=E[A]=E[T]=E[N]=E[k]=E[R]=E[W]=!0,E[n]=E[a]=E[x]=E[i]=E[S]=E[o]=E[s]=E[l]=E[u]=E[h]=E[p]=E[m]=E[v]=E[b]=E[g]=!1;function I(L){return r(L)&&t(L.length)&&!!E[e(L)]}return l0=I,l0}var c0,SN;function yL(){if(SN)return c0;SN=1;function e(t){return function(r){return t(r)}}return c0=e,c0}var qc={exports:{}};qc.exports;var ON;function Ite(){return ON||(ON=1,function(e,t){var r=L$(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,s=function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s}(qc,qc.exports)),qc.exports}var u0,_N;function xL(){if(_N)return u0;_N=1;var e=Dte(),t=yL(),r=Ite(),n=r&&r.isTypedArray,a=n?t(n):e;return u0=a,u0}var f0,AN;function $te(){if(AN)return f0;AN=1;var e=kte(),t=VS(),r=nn(),n=gL(),a=zS(),i=xL(),o=Object.prototype,s=o.hasOwnProperty;function l(u,h){var p=r(u),m=!p&&t(u),v=!p&&!m&&n(u),b=!p&&!m&&!v&&i(u),g=p||m||v||b,x=g?e(u.length,String):[],S=x.length;for(var O in u)(h||s.call(u,O))&&!(g&&(O=="length"||v&&(O=="offset"||O=="parent")||b&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||a(O,S)))&&x.push(O);return x}return f0=l,f0}var d0,jN;function Lte(){if(jN)return d0;jN=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return d0=t,d0}var h0,TN;function bL(){if(TN)return h0;TN=1;function e(t,r){return function(n){return t(r(n))}}return h0=e,h0}var p0,PN;function Fte(){if(PN)return p0;PN=1;var e=bL(),t=e(Object.keys,Object);return p0=t,p0}var m0,NN;function Bte(){if(NN)return m0;NN=1;var e=Lte(),t=Fte(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!e(i))return t(i);var o=[];for(var s in Object(i))n.call(i,s)&&s!="constructor"&&o.push(s);return o}return m0=a,m0}var v0,CN;function sf(){if(CN)return v0;CN=1;var e=ES(),t=GS();function r(n){return n!=null&&t(n.length)&&!e(n)}return v0=r,v0}var g0,EN;function Jp(){if(EN)return g0;EN=1;var e=$te(),t=Bte(),r=sf();function n(a){return r(a)?e(a):t(a)}return g0=n,g0}var y0,kN;function Wte(){if(kN)return y0;kN=1;var e=Pte(),t=Ete(),r=Jp();function n(a){return e(a,r,t)}return y0=n,y0}var x0,MN;function qte(){if(MN)return x0;MN=1;var e=Wte(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,o,s,l,u,h){var p=s&t,m=e(i),v=m.length,b=e(o),g=b.length;if(v!=g&&!p)return!1;for(var x=v;x--;){var S=m[x];if(!(p?S in o:n.call(o,S)))return!1}var O=h.get(i),j=h.get(o);if(O&&j)return O==o&&j==i;var P=!0;h.set(i,o),h.set(o,i);for(var A=p;++x-1}return V0=t,V0}var z0,oC;function lre(){if(oC)return z0;oC=1;function e(t,r,n){for(var a=-1,i=t==null?0:t.length;++a=o){var S=u?null:a(l);if(S)return i(S);b=!1,m=n,x=new e}else x=u?[]:g;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ore(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _re(e){return e.value}function Are(e,t){if(q.isValidElement(e))return q.cloneElement(e,t);if(typeof e=="function")return q.createElement(e,t);t.ref;var r=Sre(t,pre);return q.createElement(US,r)}var pC=1,fi=function(e){function t(){var r;mre(this,t);for(var n=arguments.length,a=new Array(n),i=0;ipC||Math.abs(a.height-this.lastBoundingBox.height)>pC)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ai({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,s=a.verticalAlign,l=a.margin,u=a.chartWidth,h=a.chartHeight,p,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var v=this.getBBoxSnapshot();p={left:((u||0)-v.width)/2}}else p=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var b=this.getBBoxSnapshot();m={top:((h||0)-b.height)/2}}else m=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return ai(ai({},p),m)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,s=a.height,l=a.wrapperStyle,u=a.payloadUniqBy,h=a.payload,p=ai(ai({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return q.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(v){n.wrapperNode=v}},Are(i,ai(ai({},this.props),{},{payload:AL(h,u,_re)})))}}],[{key:"getWithHeight",value:function(n,a){var i=ai(ai({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&ce(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])}(w.PureComponent);Qp(fi,"displayName","Legend");Qp(fi,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Z0,mC;function jre(){if(mC)return Z0;mC=1;var e=nf(),t=VS(),r=nn(),n=e?e.isConcatSpreadable:void 0;function a(i){return r(i)||t(i)||!!(n&&i&&i[n])}return Z0=a,Z0}var J0,vC;function PL(){if(vC)return J0;vC=1;var e=vL(),t=jre();function r(n,a,i,o,s){var l=-1,u=n.length;for(i||(i=t),s||(s=[]);++l0&&i(h)?a>1?r(h,a-1,i,o,s):e(s,h):o||(s[s.length]=h)}return s}return J0=r,J0}var Q0,gC;function Tre(){if(gC)return Q0;gC=1;function e(t){return function(r,n,a){for(var i=-1,o=Object(r),s=a(r),l=s.length;l--;){var u=s[t?l:++i];if(n(o[u],u,o)===!1)break}return r}}return Q0=e,Q0}var ex,yC;function Pre(){if(yC)return ex;yC=1;var e=Tre(),t=e();return ex=t,ex}var tx,xC;function NL(){if(xC)return tx;xC=1;var e=Pre(),t=Jp();function r(n,a){return n&&e(n,a,t)}return tx=r,tx}var rx,bC;function Nre(){if(bC)return rx;bC=1;var e=sf();function t(r,n){return function(a,i){if(a==null)return a;if(!e(a))return r(a,i);for(var o=a.length,s=n?o:-1,l=Object(a);(n?s--:++sn||s&&l&&h&&!u&&!p||i&&l&&h||!a&&h||!o)return 1;if(!i&&!s&&!p&&r=u)return h;var p=a[i];return h*(p=="desc"?-1:1)}}return r.index-n.index}return sx=t,sx}var lx,jC;function Mre(){if(jC)return lx;jC=1;var e=DS(),t=IS(),r=Wa(),n=CL(),a=Cre(),i=yL(),o=kre(),s=Kl(),l=nn();function u(h,p,m){p.length?p=e(p,function(g){return l(g)?function(x){return t(x,g.length===1?g[0]:g)}:g}):p=[s];var v=-1;p=e(p,i(r));var b=n(h,function(g,x,S){var O=e(p,function(j){return j(g)});return{criteria:O,index:++v,value:g}});return a(b,function(g,x){return o(g,x,m)})}return lx=u,lx}var cx,TC;function Rre(){if(TC)return cx;TC=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return cx=e,cx}var ux,PC;function Dre(){if(PC)return ux;PC=1;var e=Rre(),t=Math.max;function r(n,a,i){return a=t(a===void 0?n.length-1:a,0),function(){for(var o=arguments,s=-1,l=t(o.length-a,0),u=Array(l);++s0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return px=n,px}var mx,MC;function Fre(){if(MC)return mx;MC=1;var e=$re(),t=Lre(),r=t(e);return mx=r,mx}var vx,RC;function Bre(){if(RC)return vx;RC=1;var e=Kl(),t=Dre(),r=Fre();function n(a,i){return r(t(a,i,e),a+"")}return vx=n,vx}var gx,DC;function em(){if(DC)return gx;DC=1;var e=kS(),t=sf(),r=zS(),n=po();function a(i,o,s){if(!n(s))return!1;var l=typeof o;return(l=="number"?t(s)&&r(o,s.length):l=="string"&&o in s)?e(s[o],i):!1}return gx=a,gx}var yx,IC;function Wre(){if(IC)return yx;IC=1;var e=PL(),t=Mre(),r=Bre(),n=em(),a=r(function(i,o){if(i==null)return[];var s=o.length;return s>1&&n(i,o[0],o[1])?o=[]:s>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(i,e(o,1),[])});return yx=a,yx}var qre=Wre();const XS=jt(qre);function fu(e){"@babel/helpers - typeof";return fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fu(e)}function xw(){return xw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Pc,"-left"),ce(r)&&t&&ce(t.x)&&r=t.y),"".concat(Pc,"-top"),ce(n)&&t&&ce(t.y)&&ng?Math.max(h,l[n]):Math.max(p,l[n])}function nne(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function ane(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,h,p;return o.height>0&&o.width>0&&r?(h=FC({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),p=FC({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=nne({translateX:h,translateY:p,useTranslate3d:s})):u=tne,{cssProperties:u,cssClasses:rne({translateX:h,translateY:p,coordinate:r})}}function hl(e){"@babel/helpers - typeof";return hl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hl(e)}function BC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function WC(e){for(var t=1;tqC||Math.abs(n.height-this.state.lastBoundingBox.height)>qC)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,s=a.animationDuration,l=a.animationEasing,u=a.children,h=a.coordinate,p=a.hasPayload,m=a.isAnimationActive,v=a.offset,b=a.position,g=a.reverseDirection,x=a.useTranslate3d,S=a.viewBox,O=a.wrapperStyle,j=ane({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:v,position:b,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:S}),P=j.cssClasses,A=j.cssProperties,T=WC(WC({transition:m&&i?"transform ".concat(s,"ms ").concat(l):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},O);return q.createElement("div",{tabIndex:-1,className:P,style:T,ref:function(k){n.wrapperNode=k}},u)}}])}(w.PureComponent),pne=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ca={isSsr:pne(),get:function(t){return Ca[t]},set:function(t,r){if(typeof t=="string")Ca[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(a){Ca[a]=t[a]})}}};function pl(e){"@babel/helpers - typeof";return pl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pl(e)}function UC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function HC(e){for(var t=1;t0;return q.createElement(hne,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:m,active:i,coordinate:h,hasPayload:T,offset:v,position:x,reverseDirection:S,useTranslate3d:O,viewBox:j,wrapperStyle:P},_ne(u,HC(HC({},this.props),{},{payload:A})))}}])}(w.PureComponent);ZS(Er,"displayName","Tooltip");ZS(Er,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ca.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var bx,VC;function Ane(){if(VC)return bx;VC=1;var e=Ba(),t=function(){return e.Date.now()};return bx=t,bx}var wx,zC;function jne(){if(zC)return wx;zC=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return wx=t,wx}var Sx,GC;function Tne(){if(GC)return Sx;GC=1;var e=jne(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Sx=r,Sx}var Ox,KC;function IL(){if(KC)return Ox;KC=1;var e=Tne(),t=po(),r=Vl(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(t(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=t(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=e(u);var p=i.test(u);return p||o.test(u)?s(u.slice(2),p?2:8):a.test(u)?n:+u}return Ox=l,Ox}var _x,YC;function Pne(){if(YC)return _x;YC=1;var e=po(),t=Ane(),r=IL(),n="Expected a function",a=Math.max,i=Math.min;function o(s,l,u){var h,p,m,v,b,g,x=0,S=!1,O=!1,j=!0;if(typeof s!="function")throw new TypeError(n);l=r(l)||0,e(u)&&(S=!!u.leading,O="maxWait"in u,m=O?a(r(u.maxWait)||0,l):m,j="trailing"in u?!!u.trailing:j);function P(L){var $=h,F=p;return h=p=void 0,x=L,v=s.apply(F,$),v}function A(L){return x=L,b=setTimeout(k,l),S?P(L):v}function T(L){var $=L-g,F=L-x,z=l-$;return O?i(z,m-F):z}function N(L){var $=L-g,F=L-x;return g===void 0||$>=l||$<0||O&&F>=m}function k(){var L=t();if(N(L))return R(L);b=setTimeout(k,T(L))}function R(L){return b=void 0,j&&h?P(L):(h=p=void 0,v)}function W(){b!==void 0&&clearTimeout(b),x=0,h=g=p=b=void 0}function E(){return b===void 0?v:R(t())}function I(){var L=t(),$=N(L);if(h=arguments,p=this,g=L,$){if(b===void 0)return A(g);if(O)return clearTimeout(b),b=setTimeout(k,l),P(g)}return b===void 0&&(b=setTimeout(k,l)),v}return I.cancel=W,I.flush=E,I}return _x=o,_x}var Ax,XC;function Nne(){if(XC)return Ax;XC=1;var e=Pne(),t=po(),r="Expected a function";function n(a,i,o){var s=!0,l=!0;if(typeof a!="function")throw new TypeError(r);return t(o)&&(s="leading"in o?!!o.leading:s,l="trailing"in o?!!o.trailing:l),e(a,i,{leading:s,maxWait:i,trailing:l})}return Ax=n,Ax}var Cne=Nne();const $L=jt(Cne);function hu(e){"@babel/helpers - typeof";return hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hu(e)}function ZC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ad(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(L=$L(L,g,{trailing:!0,leading:!1}));var $=new ResizeObserver(L),F=A.current.getBoundingClientRect(),z=F.width,H=F.height;return E(z,H),$.observe(A.current),function(){$.disconnect()}},[E,g]);var I=w.useMemo(function(){var L=R.containerWidth,$=R.containerHeight;if(L<0||$<0)return null;ia($o(o)||$o(l),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,o,l),ia(!r||r>0,"The aspect(%s) must be greater than zero.",r);var F=$o(o)?L:o,z=$o(l)?$:l;r&&r>0&&(F?z=F/r:z&&(F=z*r),m&&z>m&&(z=m)),ia(F>0||z>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,F,z,o,l,h,p,r);var H=!Array.isArray(v)&&ui(v.type).endsWith("Chart");return q.Children.map(v,function(U){return q.isValidElement(U)?w.cloneElement(U,Ad({width:F,height:z},H?{style:Ad({height:"100%",width:"100%",maxHeight:z,maxWidth:F},U.props.style)}:{})):U})},[r,v,l,m,p,h,R,o]);return q.createElement("div",{id:x?"".concat(x):void 0,className:Ke("recharts-responsive-container",S),style:Ad(Ad({},P),{},{width:o,height:l,minWidth:h,minHeight:p,maxHeight:m}),ref:A},I)}),tm=function(t){return null};tm.displayName="Cell";function pu(e){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pu(e)}function QC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ow(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ca.isSsr)return{width:0,height:0};var n=Hne(r),a=JSON.stringify({text:t,copyStyle:n});if(ks.widthCache[a])return ks.widthCache[a];try{var i=document.getElementById(eE);i||(i=document.createElement("span"),i.setAttribute("id",eE),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=Ow(Ow({},Une),n);Object.assign(i.style,o),i.textContent="".concat(t);var s=i.getBoundingClientRect(),l={width:s.width,height:s.height};return ks.widthCache[a]=l,++ks.cacheCount>qne&&(ks.cacheCount=0,ks.widthCache={}),l}catch{return{width:0,height:0}}},Vne=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function Th(e,t){return Yne(e)||Kne(e,t)||Gne(e,t)||zne()}function zne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gne(e,t){if(e){if(typeof e=="string")return tE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tE(e,t)}}function tE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function sE(e,t){return hae(e)||dae(e,t)||fae(e,t)||uae()}function uae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fae(e,t){if(e){if(typeof e=="string")return lE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lE(e,t)}}function lE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return F.reduce(function(z,H){var U=H.word,Y=H.width,se=z[z.length-1];if(se&&(a==null||i||se.width+Y+nH.width?z:H})};if(!h)return v;for(var g="…",x=function(F){var z=p.slice(0,F),H=WL({breakAll:u,style:l,children:z+g}).wordsWithComputedWidth,U=m(H),Y=U.length>o||b(U).width>Number(a);return[Y,U]},S=0,O=p.length-1,j=0,P;S<=O&&j<=p.length-1;){var A=Math.floor((S+O)/2),T=A-1,N=x(T),k=sE(N,2),R=k[0],W=k[1],E=x(A),I=sE(E,1),L=I[0];if(!R&&!L&&(S=A+1),R&&L&&(O=A-1),!R&&L){P=W;break}j++}return P||v},cE=function(t){var r=ze(t)?[]:t.toString().split(BL);return[{words:r}]},mae=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Ca.isSsr){var l,u,h=WL({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,m=h.spaceWidth;l=p,u=m}else return cE(a);return pae({breakAll:o,children:a,maxLines:s,style:i},l,u,r,n)}return cE(a)},uE="#808080",es=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,h=t.scaleToFit,p=h===void 0?!1:h,m=t.textAnchor,v=m===void 0?"start":m,b=t.verticalAnchor,g=b===void 0?"end":b,x=t.fill,S=x===void 0?uE:x,O=oE(t,sae),j=w.useMemo(function(){return mae({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:p,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,p,O.style,O.width]),P=O.dx,A=O.dy,T=O.angle,N=O.className,k=O.breakAll,R=oE(O,lae);if(!ur(n)||!ur(i))return null;var W=n+(ce(P)?P:0),E=i+(ce(A)?A:0),I;switch(g){case"start":I=jx("calc(".concat(u,")"));break;case"middle":I=jx("calc(".concat((j.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:I=jx("calc(".concat(j.length-1," * -").concat(s,")"));break}var L=[];if(p){var $=j[0].width,F=O.width;L.push("scale(".concat((ce(F)?F/$:1)/$,")"))}return T&&L.push("rotate(".concat(T,", ").concat(W,", ").concat(E,")")),L.length&&(R.transform=L.join(" ")),q.createElement("text",_w({},Te(R,!0),{x:W,y:E,className:Ke("recharts-text",N),textAnchor:v,fill:S.includes("url")?uE:S}),j.map(function(z,H){var U=z.words.join(k?"":" ");return q.createElement("tspan",{x:W,dy:H===0?I:s,key:"".concat(U,"-").concat(H)},U)}))};function to(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function vae(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function JS(e){let t,r,n;e.length!==2?(t=to,r=(s,l)=>to(e(s),l),n=(s,l)=>e(s)-l):(t=e===to||e===vae?e:gae,r=e,n=e);function a(s,l,u=0,h=s.length){if(u>>1;r(s[p],l)<0?u=p+1:h=p}while(u>>1;r(s[p],l)<=0?u=p+1:h=p}while(uu&&n(s[p-1],l)>-n(s[p],l)?p-1:p}return{left:a,center:o,right:i}}function gae(){return 0}function qL(e){return e===null?NaN:+e}function*yae(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const xae=JS(to),lf=xae.right;JS(qL).center;class fE extends Map{constructor(t,r=Sae){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(dE(this,t))}has(t){return super.has(dE(this,t))}set(t,r){return super.set(bae(this,t),r)}delete(t){return super.delete(wae(this,t))}}function dE({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function bae({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function wae({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Sae(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Oae(e=to){if(e===to)return UL;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function UL(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const _ae=Math.sqrt(50),Aae=Math.sqrt(10),jae=Math.sqrt(2);function Ph(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=_ae?10:i>=Aae?5:i>=jae?2:1;let s,l,u;return a<0?(u=Math.pow(10,-a)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,a)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=a))return[];const s=i-a+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function pE(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function HL(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?UL:Oae(a);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,h=Math.log(l),p=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*p*(l-p)/l)*(u-l/2<0?-1:1),v=Math.max(r,Math.floor(t-u*p/l+m)),b=Math.min(n,Math.floor(t+(l-u)*p/l+m));HL(e,t,v,b,a)}const i=e[t];let o=r,s=n;for(Nc(e,r,t),a(e[n],i)>0&&Nc(e,r,n);o0;)--s}a(e[r],i)===0?Nc(e,r,s):(++s,Nc(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Nc(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Tae(e,t,r){if(e=Float64Array.from(yae(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return pE(e);if(t>=1)return hE(e);var n,a=(n-1)*t,i=Math.floor(a),o=hE(HL(e,i).subarray(0,i+1)),s=pE(e.subarray(i+1));return o+(s-o)*(a-i)}}function Pae(e,t,r=qL){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),s=+r(e[i+1],i+1,e);return o+(s-o)*(a-i)}}function Nae(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Td(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Td(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Eae.exec(e))?new Qr(t[1],t[2],t[3],1):(t=kae.exec(e))?new Qr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Mae.exec(e))?Td(t[1],t[2],t[3],t[4]):(t=Rae.exec(e))?Td(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Dae.exec(e))?wE(t[1],t[2]/100,t[3]/100,1):(t=Iae.exec(e))?wE(t[1],t[2]/100,t[3]/100,t[4]):mE.hasOwnProperty(e)?yE(mE[e]):e==="transparent"?new Qr(NaN,NaN,NaN,0):null}function yE(e){return new Qr(e>>16&255,e>>8&255,e&255,1)}function Td(e,t,r,n){return n<=0&&(e=t=r=NaN),new Qr(e,t,r,n)}function Fae(e){return e instanceof cf||(e=xu(e)),e?(e=e.rgb(),new Qr(e.r,e.g,e.b,e.opacity)):new Qr}function Nw(e,t,r,n){return arguments.length===1?Fae(e):new Qr(e,t,r,n??1)}function Qr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}eO(Qr,Nw,zL(cf,{brighter(e){return e=e==null?Nh:Math.pow(Nh,e),new Qr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gu:Math.pow(gu,e),new Qr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qr(Vo(this.r),Vo(this.g),Vo(this.b),Ch(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xE,formatHex:xE,formatHex8:Bae,formatRgb:bE,toString:bE}));function xE(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}`}function Bae(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}${Fo((isNaN(this.opacity)?1:this.opacity)*255)}`}function bE(){const e=Ch(this.opacity);return`${e===1?"rgb(":"rgba("}${Vo(this.r)}, ${Vo(this.g)}, ${Vo(this.b)}${e===1?")":`, ${e})`}`}function Ch(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fo(e){return e=Vo(e),(e<16?"0":"")+e.toString(16)}function wE(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ra(e,t,r,n)}function GL(e){if(e instanceof ra)return new ra(e.h,e.s,e.l,e.opacity);if(e instanceof cf||(e=xu(e)),!e)return new ra;if(e instanceof ra)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,s=i-a,l=(i+a)/2;return s?(t===i?o=(r-n)/s+(r0&&l<1?0:o,new ra(o,s,l,e.opacity)}function Wae(e,t,r,n){return arguments.length===1?GL(e):new ra(e,t,r,n??1)}function ra(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}eO(ra,Wae,zL(cf,{brighter(e){return e=e==null?Nh:Math.pow(Nh,e),new ra(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gu:Math.pow(gu,e),new ra(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Qr(Tx(e>=240?e-240:e+120,a,n),Tx(e,a,n),Tx(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new ra(SE(this.h),Pd(this.s),Pd(this.l),Ch(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ch(this.opacity);return`${e===1?"hsl(":"hsla("}${SE(this.h)}, ${Pd(this.s)*100}%, ${Pd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function SE(e){return e=(e||0)%360,e<0?e+360:e}function Pd(e){return Math.max(0,Math.min(1,e||0))}function Tx(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const tO=e=>()=>e;function qae(e,t){return function(r){return e+r*t}}function Uae(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Hae(e){return(e=+e)==1?KL:function(t,r){return r-t?Uae(t,r,e):tO(isNaN(t)?r:t)}}function KL(e,t){var r=t-e;return r?qae(e,r):tO(isNaN(e)?t:e)}const OE=function e(t){var r=Hae(t);function n(a,i){var o=r((a=Nw(a)).r,(i=Nw(i)).r),s=r(a.g,i.g),l=r(a.b,i.b),u=KL(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=s(h),a.b=l(h),a.opacity=u(h),a+""}}return n.gamma=e,n}(1);function Vae(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;ar&&(i=t.slice(r,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,l.push({i:o,x:Eh(n,a)})),r=Px.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function rie(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a2?nie:rie,l=u=null,p}function p(m){return m==null||isNaN(m=+m)?i:(l||(l=s(e.map(n),t,r)))(n(o(m)))}return p.invert=function(m){return o(a((u||(u=s(t,e.map(n),Eh)))(m)))},p.domain=function(m){return arguments.length?(e=Array.from(m,kh),h()):e.slice()},p.range=function(m){return arguments.length?(t=Array.from(m),h()):t.slice()},p.rangeRound=function(m){return t=Array.from(m),r=rO,h()},p.clamp=function(m){return arguments.length?(o=m?!0:qr,h()):o!==qr},p.interpolate=function(m){return arguments.length?(r=m,h()):r},p.unknown=function(m){return arguments.length?(i=m,p):i},function(m,v){return n=m,a=v,h()}}function nO(){return rm()(qr,qr)}function aie(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Mh(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ml(e){return e=Mh(Math.abs(e)),e?e[1]:NaN}function iie(e,t){return function(r,n){for(var a=r.length,i=[],o=0,s=e[0],l=0;a>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),i.push(r.substring(a-=s,a+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return i.reverse().join(t)}}function oie(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var sie=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function bu(e){if(!(t=sie.exec(e)))throw new Error("invalid format: "+e);var t;return new aO({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}bu.prototype=aO.prototype;function aO(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}aO.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function lie(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var YL;function cie(e,t){var r=Mh(e,t);if(!r)return e+"";var n=r[0],a=r[1],i=a-(YL=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Mh(e,Math.max(0,t+i-1))[0]}function AE(e,t){var r=Mh(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const jE={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:aie,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>AE(e*100,t),r:AE,s:cie,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function TE(e){return e}var PE=Array.prototype.map,NE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uie(e){var t=e.grouping===void 0||e.thousands===void 0?TE:iie(PE.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?TE:oie(PE.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(p){p=bu(p);var m=p.fill,v=p.align,b=p.sign,g=p.symbol,x=p.zero,S=p.width,O=p.comma,j=p.precision,P=p.trim,A=p.type;A==="n"?(O=!0,A="g"):jE[A]||(j===void 0&&(j=12),P=!0,A="g"),(x||m==="0"&&v==="=")&&(x=!0,m="0",v="=");var T=g==="$"?r:g==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():"",N=g==="$"?n:/[%p]/.test(A)?o:"",k=jE[A],R=/[defgprs%]/.test(A);j=j===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function W(E){var I=T,L=N,$,F,z;if(A==="c")L=k(E)+L,E="";else{E=+E;var H=E<0||1/E<0;if(E=isNaN(E)?l:k(Math.abs(E),j),P&&(E=lie(E)),H&&+E==0&&b!=="+"&&(H=!1),I=(H?b==="("?b:s:b==="-"||b==="("?"":b)+I,L=(A==="s"?NE[8+YL/3]:"")+L+(H&&b==="("?")":""),R){for($=-1,F=E.length;++$z||z>57){L=(z===46?a+E.slice($+1):E.slice($))+L,E=E.slice(0,$);break}}}O&&!x&&(E=t(E,1/0));var U=I.length+E.length+L.length,Y=U>1)+I+E+L+Y.slice(U);break;default:E=Y+I+E+L;break}return i(E)}return W.toString=function(){return p+""},W}function h(p,m){var v=u((p=bu(p),p.type="f",p)),b=Math.max(-8,Math.min(8,Math.floor(ml(m)/3)))*3,g=Math.pow(10,-b),x=NE[8+b/3];return function(S){return v(g*S)+x}}return{format:u,formatPrefix:h}}var Nd,iO,XL;fie({thousands:",",grouping:[3],currency:["$",""]});function fie(e){return Nd=uie(e),iO=Nd.format,XL=Nd.formatPrefix,Nd}function die(e){return Math.max(0,-ml(Math.abs(e)))}function hie(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ml(t)/3)))*3-ml(Math.abs(e)))}function pie(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ml(t)-ml(e))+1}function ZL(e,t,r,n){var a=Tw(e,t,r),i;switch(n=bu(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=hie(a,o))&&(n.precision=i),XL(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=pie(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=die(a))&&(n.precision=i-(n.type==="%")*2);break}}return iO(n)}function mo(e){var t=e.domain;return e.ticks=function(r){var n=t();return Aw(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return ZL(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],s=n[i],l,u,h=10;for(s0;){if(u=jw(o,s,r),u===l)return n[a]=o,n[i]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Rh(){var e=nO();return e.copy=function(){return uf(e,Rh())},Hn.apply(e,arguments),mo(e)}function JL(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,kh),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return JL(e).unknown(t)},e=arguments.length?Array.from(e,kh):[0,1],mo(r)}function QL(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return iMath.pow(e,t)}function xie(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function kE(e){return(t,r)=>-e(-t,r)}function oO(e){const t=e(CE,EE),r=t.domain;let n=10,a,i;function o(){return a=xie(n),i=yie(n),r()[0]<0?(a=kE(a),i=kE(i),e(mie,vie)):e(CE,EE),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],h=l[l.length-1];const p=h0){for(;m<=v;++m)for(b=1;bh)break;S.push(g)}}else for(;m<=v;++m)for(b=n-1;b>=1;--b)if(g=m>0?b/i(-m):b*i(m),!(gh)break;S.push(g)}S.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=bu(l)).precision==null&&(l.trim=!0),l=iO(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return h=>{let p=h/i(Math.round(a(h)));return p*nr(QL(r(),{floor:s=>i(Math.floor(a(s))),ceil:s=>i(Math.ceil(a(s)))})),t}function e4(){const e=oO(rm()).domain([1,10]);return e.copy=()=>uf(e,e4()).base(e.base()),Hn.apply(e,arguments),e}function ME(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function RE(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function sO(e){var t=1,r=e(ME(t),RE(t));return r.constant=function(n){return arguments.length?e(ME(t=+n),RE(t)):t},mo(r)}function t4(){var e=sO(rm());return e.copy=function(){return uf(e,t4()).constant(e.constant())},Hn.apply(e,arguments)}function DE(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function bie(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function wie(e){return e<0?-e*e:e*e}function lO(e){var t=e(qr,qr),r=1;function n(){return r===1?e(qr,qr):r===.5?e(bie,wie):e(DE(r),DE(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},mo(t)}function cO(){var e=lO(rm());return e.copy=function(){return uf(e,cO()).exponent(e.exponent())},Hn.apply(e,arguments),e}function Sie(){return cO.apply(null,arguments).exponent(.5)}function IE(e){return Math.sign(e)*e*e}function Oie(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function r4(){var e=nO(),t=[0,1],r=!1,n;function a(i){var o=Oie(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert(IE(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,kh)).map(IE)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return r4(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Hn.apply(a,arguments),mo(a)}function n4(){var e=[],t=[],r=[],n;function a(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(i=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return a4().domain([e,t]).range(a).unknown(i)},Hn.apply(mo(o),arguments)}function i4(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[lf(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return i4().domain(e).range(t).unknown(r)},Hn.apply(a,arguments)}const Nx=new Date,Cx=new Date;function dr(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),s=a.ceil(i);return i-o(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,s)=>{const l=[];if(i=a.ceil(i),s=s==null?1:Math.floor(s),!(i0))return l;let u;do l.push(u=new Date(+i)),t(i,s),e(i);while(udr(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!i(o););else for(;--s>=0;)for(;t(o,1),!i(o););}),r&&(a.count=(i,o)=>(Nx.setTime(+i),Cx.setTime(+o),e(Nx),e(Cx),Math.floor(r(Nx,Cx))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const Dh=dr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Dh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?dr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Dh);Dh.range;const si=1e3,Bn=si*60,li=Bn*60,yi=li*24,uO=yi*7,$E=yi*30,Ex=yi*365,Bo=dr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*si)},(e,t)=>(t-e)/si,e=>e.getUTCSeconds());Bo.range;const fO=dr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*si)},(e,t)=>{e.setTime(+e+t*Bn)},(e,t)=>(t-e)/Bn,e=>e.getMinutes());fO.range;const dO=dr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Bn)},(e,t)=>(t-e)/Bn,e=>e.getUTCMinutes());dO.range;const hO=dr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*si-e.getMinutes()*Bn)},(e,t)=>{e.setTime(+e+t*li)},(e,t)=>(t-e)/li,e=>e.getHours());hO.range;const pO=dr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*li)},(e,t)=>(t-e)/li,e=>e.getUTCHours());pO.range;const ff=dr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Bn)/yi,e=>e.getDate()-1);ff.range;const nm=dr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yi,e=>e.getUTCDate()-1);nm.range;const o4=dr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yi,e=>Math.floor(e/yi));o4.range;function ls(e){return dr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Bn)/uO)}const am=ls(0),Ih=ls(1),_ie=ls(2),Aie=ls(3),vl=ls(4),jie=ls(5),Tie=ls(6);am.range;Ih.range;_ie.range;Aie.range;vl.range;jie.range;Tie.range;function cs(e){return dr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/uO)}const im=cs(0),$h=cs(1),Pie=cs(2),Nie=cs(3),gl=cs(4),Cie=cs(5),Eie=cs(6);im.range;$h.range;Pie.range;Nie.range;gl.range;Cie.range;Eie.range;const mO=dr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());mO.range;const vO=dr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());vO.range;const xi=dr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());xi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:dr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});xi.range;const bi=dr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());bi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:dr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});bi.range;function s4(e,t,r,n,a,i){const o=[[Bo,1,si],[Bo,5,5*si],[Bo,15,15*si],[Bo,30,30*si],[i,1,Bn],[i,5,5*Bn],[i,15,15*Bn],[i,30,30*Bn],[a,1,li],[a,3,3*li],[a,6,6*li],[a,12,12*li],[n,1,yi],[n,2,2*yi],[r,1,uO],[t,1,$E],[t,3,3*$E],[e,1,Ex]];function s(u,h,p){const m=hx).right(o,m);if(v===o.length)return e.every(Tw(u/Ex,h/Ex,p));if(v===0)return Dh.every(Math.max(Tw(u,h,p),1));const[b,g]=o[m/o[v-1][2]53)return null;"w"in Z||(Z.w=1),"Z"in Z?(ie=Mx(Cc(Z.y,0,1)),ge=ie.getUTCDay(),ie=ge>4||ge===0?$h.ceil(ie):$h(ie),ie=nm.offset(ie,(Z.V-1)*7),Z.y=ie.getUTCFullYear(),Z.m=ie.getUTCMonth(),Z.d=ie.getUTCDate()+(Z.w+6)%7):(ie=kx(Cc(Z.y,0,1)),ge=ie.getDay(),ie=ge>4||ge===0?Ih.ceil(ie):Ih(ie),ie=ff.offset(ie,(Z.V-1)*7),Z.y=ie.getFullYear(),Z.m=ie.getMonth(),Z.d=ie.getDate()+(Z.w+6)%7)}else("W"in Z||"U"in Z)&&("w"in Z||(Z.w="u"in Z?Z.u%7:"W"in Z?1:0),ge="Z"in Z?Mx(Cc(Z.y,0,1)).getUTCDay():kx(Cc(Z.y,0,1)).getDay(),Z.m=0,Z.d="W"in Z?(Z.w+6)%7+Z.W*7-(ge+5)%7:Z.w+Z.U*7-(ge+6)%7);return"Z"in Z?(Z.H+=Z.Z/100|0,Z.M+=Z.Z%100,Mx(Z)):kx(Z)}}function k(le,pe,he,Z){for(var Ue=0,ie=pe.length,ge=he.length,Ie,$e;Ue=ge)return-1;if(Ie=pe.charCodeAt(Ue++),Ie===37){if(Ie=pe.charAt(Ue++),$e=A[Ie in LE?pe.charAt(Ue++):Ie],!$e||(Z=$e(le,he,Z))<0)return-1}else if(Ie!=he.charCodeAt(Z++))return-1}return Z}function R(le,pe,he){var Z=u.exec(pe.slice(he));return Z?(le.p=h.get(Z[0].toLowerCase()),he+Z[0].length):-1}function W(le,pe,he){var Z=v.exec(pe.slice(he));return Z?(le.w=b.get(Z[0].toLowerCase()),he+Z[0].length):-1}function E(le,pe,he){var Z=p.exec(pe.slice(he));return Z?(le.w=m.get(Z[0].toLowerCase()),he+Z[0].length):-1}function I(le,pe,he){var Z=S.exec(pe.slice(he));return Z?(le.m=O.get(Z[0].toLowerCase()),he+Z[0].length):-1}function L(le,pe,he){var Z=g.exec(pe.slice(he));return Z?(le.m=x.get(Z[0].toLowerCase()),he+Z[0].length):-1}function $(le,pe,he){return k(le,t,pe,he)}function F(le,pe,he){return k(le,r,pe,he)}function z(le,pe,he){return k(le,n,pe,he)}function H(le){return o[le.getDay()]}function U(le){return i[le.getDay()]}function Y(le){return l[le.getMonth()]}function se(le){return s[le.getMonth()]}function ne(le){return a[+(le.getHours()>=12)]}function ae(le){return 1+~~(le.getMonth()/3)}function ue(le){return o[le.getUTCDay()]}function Re(le){return i[le.getUTCDay()]}function qe(le){return l[le.getUTCMonth()]}function ct(le){return s[le.getUTCMonth()]}function we(le){return a[+(le.getUTCHours()>=12)]}function je(le){return 1+~~(le.getUTCMonth()/3)}return{format:function(le){var pe=T(le+="",j);return pe.toString=function(){return le},pe},parse:function(le){var pe=N(le+="",!1);return pe.toString=function(){return le},pe},utcFormat:function(le){var pe=T(le+="",P);return pe.toString=function(){return le},pe},utcParse:function(le){var pe=N(le+="",!0);return pe.toString=function(){return le},pe}}}var LE={"-":"",_:" ",0:"0"},br=/^\s*\d+/,$ie=/^%/,Lie=/[\\^$*+?|[\]().{}]/g;function dt(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i[t.toLowerCase(),r]))}function Bie(e,t,r){var n=br.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Wie(e,t,r){var n=br.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function qie(e,t,r){var n=br.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Uie(e,t,r){var n=br.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Hie(e,t,r){var n=br.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function FE(e,t,r){var n=br.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function BE(e,t,r){var n=br.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Vie(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function zie(e,t,r){var n=br.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Gie(e,t,r){var n=br.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function WE(e,t,r){var n=br.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Kie(e,t,r){var n=br.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function qE(e,t,r){var n=br.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Yie(e,t,r){var n=br.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Xie(e,t,r){var n=br.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Zie(e,t,r){var n=br.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Jie(e,t,r){var n=br.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Qie(e,t,r){var n=$ie.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function eoe(e,t,r){var n=br.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function toe(e,t,r){var n=br.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function UE(e,t){return dt(e.getDate(),t,2)}function roe(e,t){return dt(e.getHours(),t,2)}function noe(e,t){return dt(e.getHours()%12||12,t,2)}function aoe(e,t){return dt(1+ff.count(xi(e),e),t,3)}function l4(e,t){return dt(e.getMilliseconds(),t,3)}function ioe(e,t){return l4(e,t)+"000"}function ooe(e,t){return dt(e.getMonth()+1,t,2)}function soe(e,t){return dt(e.getMinutes(),t,2)}function loe(e,t){return dt(e.getSeconds(),t,2)}function coe(e){var t=e.getDay();return t===0?7:t}function uoe(e,t){return dt(am.count(xi(e)-1,e),t,2)}function c4(e){var t=e.getDay();return t>=4||t===0?vl(e):vl.ceil(e)}function foe(e,t){return e=c4(e),dt(vl.count(xi(e),e)+(xi(e).getDay()===4),t,2)}function doe(e){return e.getDay()}function hoe(e,t){return dt(Ih.count(xi(e)-1,e),t,2)}function poe(e,t){return dt(e.getFullYear()%100,t,2)}function moe(e,t){return e=c4(e),dt(e.getFullYear()%100,t,2)}function voe(e,t){return dt(e.getFullYear()%1e4,t,4)}function goe(e,t){var r=e.getDay();return e=r>=4||r===0?vl(e):vl.ceil(e),dt(e.getFullYear()%1e4,t,4)}function yoe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+dt(t/60|0,"0",2)+dt(t%60,"0",2)}function HE(e,t){return dt(e.getUTCDate(),t,2)}function xoe(e,t){return dt(e.getUTCHours(),t,2)}function boe(e,t){return dt(e.getUTCHours()%12||12,t,2)}function woe(e,t){return dt(1+nm.count(bi(e),e),t,3)}function u4(e,t){return dt(e.getUTCMilliseconds(),t,3)}function Soe(e,t){return u4(e,t)+"000"}function Ooe(e,t){return dt(e.getUTCMonth()+1,t,2)}function _oe(e,t){return dt(e.getUTCMinutes(),t,2)}function Aoe(e,t){return dt(e.getUTCSeconds(),t,2)}function joe(e){var t=e.getUTCDay();return t===0?7:t}function Toe(e,t){return dt(im.count(bi(e)-1,e),t,2)}function f4(e){var t=e.getUTCDay();return t>=4||t===0?gl(e):gl.ceil(e)}function Poe(e,t){return e=f4(e),dt(gl.count(bi(e),e)+(bi(e).getUTCDay()===4),t,2)}function Noe(e){return e.getUTCDay()}function Coe(e,t){return dt($h.count(bi(e)-1,e),t,2)}function Eoe(e,t){return dt(e.getUTCFullYear()%100,t,2)}function koe(e,t){return e=f4(e),dt(e.getUTCFullYear()%100,t,2)}function Moe(e,t){return dt(e.getUTCFullYear()%1e4,t,4)}function Roe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?gl(e):gl.ceil(e),dt(e.getUTCFullYear()%1e4,t,4)}function Doe(){return"+0000"}function VE(){return"%"}function zE(e){return+e}function GE(e){return Math.floor(+e/1e3)}var Ms,d4,h4;Ioe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ioe(e){return Ms=Iie(e),d4=Ms.format,Ms.parse,h4=Ms.utcFormat,Ms.utcParse,Ms}function $oe(e){return new Date(e)}function Loe(e){return e instanceof Date?+e:+new Date(+e)}function gO(e,t,r,n,a,i,o,s,l,u){var h=nO(),p=h.invert,m=h.domain,v=u(".%L"),b=u(":%S"),g=u("%I:%M"),x=u("%I %p"),S=u("%a %d"),O=u("%b %d"),j=u("%B"),P=u("%Y");function A(T){return(l(T)t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>Tae(e,i/n))},r.copy=function(){return g4(t).domain(e)},_i.apply(r,arguments)}function sm(){var e=0,t=.5,r=1,n=1,a,i,o,s,l,u=qr,h,p=!1,m;function v(g){return isNaN(g=+g)?m:(g=.5+((g=+h(g))-i)*(n*gr}return Dx=e,Dx}var Ix,ZE;function Uoe(){if(ZE)return Ix;ZE=1;var e=lm(),t=w4(),r=Kl();function n(a){return a&&a.length?e(a,r,t):void 0}return Ix=n,Ix}var Hoe=Uoe();const cm=jt(Hoe);var $x,JE;function S4(){if(JE)return $x;JE=1;function e(t,r){return te.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=ne.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};xe.decimalPlaces=xe.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Ft;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};xe.dividedBy=xe.div=function(e){return di(this,new this.constructor(e))};xe.dividedToIntegerBy=xe.idiv=function(e){var t=this,r=t.constructor;return Et(di(t,new r(e),0,1),r.precision)};xe.equals=xe.eq=function(e){return!this.cmp(e)};xe.exponent=function(){return ar(this)};xe.greaterThan=xe.gt=function(e){return this.cmp(e)>0};xe.greaterThanOrEqualTo=xe.gte=function(e){return this.cmp(e)>=0};xe.isInteger=xe.isint=function(){return this.e>this.d.length-2};xe.isNegative=xe.isneg=function(){return this.s<0};xe.isPositive=xe.ispos=function(){return this.s>0};xe.isZero=function(){return this.s===0};xe.lessThan=xe.lt=function(e){return this.cmp(e)<0};xe.lessThanOrEqualTo=xe.lte=function(e){return this.cmp(e)<1};xe.logarithm=xe.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(yn))throw Error(Un+"NaN");if(r.s<1)throw Error(Un+(r.s?"NaN":"-Infinity"));return r.eq(yn)?new n(0):(Ut=!1,t=di(wu(r,i),wu(e,i),i),Ut=!0,Et(t,a))};xe.minus=xe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?j4(t,e):_4(t,(e.s=-e.s,e))};xe.modulo=xe.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(Un+"NaN");return r.s?(Ut=!1,t=di(r,e,0,1).times(e),Ut=!0,r.minus(t)):Et(new n(r),a)};xe.naturalExponential=xe.exp=function(){return A4(this)};xe.naturalLogarithm=xe.ln=function(){return wu(this)};xe.negated=xe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};xe.plus=xe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_4(t,e):j4(t,(e.s=-e.s,e))};xe.precision=xe.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(zo+e);if(t=ar(a)+1,n=a.d.length-1,r=n*Ft+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};xe.squareRoot=xe.sqrt=function(){var e,t,r,n,a,i,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Un+"NaN")}for(e=ar(s),Ut=!1,a=Math.sqrt(+s),a==0||a==1/0?(t=ja(s.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Zl((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(a.toString()),r=l.precision,a=o=r+3;;)if(i=n,n=i.plus(di(s,i,o+2)).times(.5),ja(i.d).slice(0,o)===(t=ja(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(Et(i,r+1,0),i.times(i).eq(s)){n=i;break}}else if(t!="9999")break;o+=4}return Ut=!0,Et(n,r)};xe.times=xe.mul=function(e){var t,r,n,a,i,o,s,l,u,h=this,p=h.constructor,m=h.d,v=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,r=h.e+e.e,l=m.length,u=v.length,l=0;){for(t=0,a=l+n;a>n;)s=i[a]+v[n]*m[a-n-1]+t,i[a--]=s%gr|0,t=s/gr|0;i[a]=(i[a]+t)%gr|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Ut?Et(e,p.precision):e};xe.toDecimalPlaces=xe.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Ia(e,0,Xl),t===void 0?t=n.rounding:Ia(t,0,8),Et(r,e+ar(r)+1,t))};xe.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=ts(n,!0):(Ia(e,0,Xl),t===void 0?t=a.rounding:Ia(t,0,8),n=Et(new a(n),e+1,t),r=ts(n,!0,e+1)),r};xe.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?ts(a):(Ia(e,0,Xl),t===void 0?t=i.rounding:Ia(t,0,8),n=Et(new i(a),e+ar(a)+1,t),r=ts(n.abs(),!1,e+ar(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};xe.toInteger=xe.toint=function(){var e=this,t=e.constructor;return Et(new t(e),ar(e)+1,t.rounding)};xe.toNumber=function(){return+this};xe.toPower=xe.pow=function(e){var t,r,n,a,i,o,s=this,l=s.constructor,u=12,h=+(e=new l(e));if(!e.s)return new l(yn);if(s=new l(s),!s.s){if(e.s<1)throw Error(Un+"Infinity");return s}if(s.eq(yn))return s;if(n=l.precision,e.eq(yn))return Et(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=s.s,o){if((r=h<0?-h:h)<=O4){for(a=new l(yn),t=Math.ceil(n/Ft+4),Ut=!1;r%2&&(a=a.times(s),a2(a.d,t)),r=Zl(r/2),r!==0;)s=s.times(s),a2(s.d,t);return Ut=!0,e.s<0?new l(yn).div(a):Et(a,n)}}else if(i<0)throw Error(Un+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,Ut=!1,a=e.times(wu(s,n+u)),Ut=!0,a=A4(a),a.s=i,a};xe.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=ar(a),n=ts(a,r<=i.toExpNeg||r>=i.toExpPos)):(Ia(e,1,Xl),t===void 0?t=i.rounding:Ia(t,0,8),a=Et(new i(a),e,t),r=ar(a),n=ts(a,e<=r||r<=i.toExpNeg,e)),n};xe.toSignificantDigits=xe.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Ia(e,1,Xl),t===void 0?t=n.rounding:Ia(t,0,8)),Et(new n(r),e,t)};xe.toString=xe.valueOf=xe.val=xe.toJSON=xe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ar(e),r=e.constructor;return ts(e,t<=r.toExpNeg||t>=r.toExpPos)};function _4(e,t){var r,n,a,i,o,s,l,u,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),Ut?Et(t,p):t;if(l=e.d,u=t.d,o=e.e,a=t.e,l=l.slice(),i=o-a,i){for(i<0?(n=l,i=-i,s=u.length):(n=u,a=o,s=l.length),o=Math.ceil(p/Ft),s=o>s?o+1:s+1,i>s&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(s=l.length,i=u.length,s-i<0&&(i=s,n=u,u=l,l=n),r=0;i;)r=(l[--i]=l[i]+u[i]+r)/gr|0,l[i]%=gr;for(r&&(l.unshift(r),++a),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=a,Ut?Et(t,p):t}function Ia(e,t,r){if(e!==~~e||er)throw Error(zo+e)}function ja(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;to?1:-1;else for(s=l=0;sa[s]?1:-1;break}return l}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]1;)n.shift()}return function(n,a,i,o){var s,l,u,h,p,m,v,b,g,x,S,O,j,P,A,T,N,k,R=n.constructor,W=n.s==a.s?1:-1,E=n.d,I=a.d;if(!n.s)return new R(n);if(!a.s)throw Error(Un+"Division by zero");for(l=n.e-a.e,N=I.length,A=E.length,v=new R(W),b=v.d=[],u=0;I[u]==(E[u]||0);)++u;if(I[u]>(E[u]||0)&&--l,i==null?O=i=R.precision:o?O=i+(ar(n)-ar(a))+1:O=i,O<0)return new R(0);if(O=O/Ft+2|0,u=0,N==1)for(h=0,I=I[0],O++;(u1&&(I=e(I,h),E=e(E,h),N=I.length,A=E.length),P=N,g=E.slice(0,N),x=g.length;x=gr/2&&++T;do h=0,s=t(I,g,N,x),s<0?(S=g[0],N!=x&&(S=S*gr+(g[1]||0)),h=S/T|0,h>1?(h>=gr&&(h=gr-1),p=e(I,h),m=p.length,x=g.length,s=t(p,g,m,x),s==1&&(h--,r(p,N16)throw Error(bO+ar(e));if(!e.s)return new h(yn);for(t==null?(Ut=!1,s=p):s=t,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(Do(2,u))/Math.LN10*2+5|0,s+=n,r=a=i=new h(yn),h.precision=s;;){if(a=Et(a.times(e),s),r=r.times(++l),o=i.plus(di(a,r,s)),ja(o.d).slice(0,s)===ja(i.d).slice(0,s)){for(;u--;)i=Et(i.times(i),s);return h.precision=p,t==null?(Ut=!0,Et(i,p)):i}i=o}}function ar(e){for(var t=e.e*Ft,r=e.d[0];r>=10;r/=10)t++;return t}function qx(e,t,r){if(t>e.LN10.sd())throw Ut=!0,r&&(e.precision=r),Error(Un+"LN10 precision limit exceeded");return Et(new e(e.LN10),t)}function Ki(e){for(var t="";e--;)t+="0";return t}function wu(e,t){var r,n,a,i,o,s,l,u,h,p=1,m=10,v=e,b=v.d,g=v.constructor,x=g.precision;if(v.s<1)throw Error(Un+(v.s?"NaN":"-Infinity"));if(v.eq(yn))return new g(0);if(t==null?(Ut=!1,u=x):u=t,v.eq(10))return t==null&&(Ut=!0),qx(g,u);if(u+=m,g.precision=u,r=ja(b),n=r.charAt(0),i=ar(v),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=ja(v.d),n=r.charAt(0),p++;i=ar(v),n>1?(v=new g("0."+r),i++):v=new g(n+"."+r.slice(1))}else return l=qx(g,u+2,x).times(i+""),v=wu(new g(n+"."+r.slice(1)),u-m).plus(l),g.precision=x,t==null?(Ut=!0,Et(v,x)):v;for(s=o=v=di(v.minus(yn),v.plus(yn),u),h=Et(v.times(v),u),a=3;;){if(o=Et(o.times(h),u),l=s.plus(di(o,new g(a),u)),ja(l.d).slice(0,u)===ja(s.d).slice(0,u))return s=s.times(2),i!==0&&(s=s.plus(qx(g,u+2,x).times(i+""))),s=di(s,new g(p),u),g.precision=x,t==null?(Ut=!0,Et(s,x)):s;s=l,a+=2}}function n2(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Zl(r/Ft),e.d=[],n=(r+1)%Ft,r<0&&(n+=Ft),nLh||e.e<-Lh))throw Error(bO+r)}else e.s=0,e.e=0,e.d=[0];return e}function Et(e,t,r){var n,a,i,o,s,l,u,h,p=e.d;for(o=1,i=p[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=Ft,a=t,u=p[h=0];else{if(h=Math.ceil((n+1)/Ft),i=p.length,h>=i)return e;for(u=i=p[h],o=1;i>=10;i/=10)o++;n%=Ft,a=n-Ft+o}if(r!==void 0&&(i=Do(10,o-a-1),s=u/i%10|0,l=t<0||p[h+1]!==void 0||u%i,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?a>0?u/Do(10,o-a):0:p[h-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return l?(i=ar(e),p.length=1,t=t-i-1,p[0]=Do(10,(Ft-t%Ft)%Ft),e.e=Zl(-t/Ft)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=h,i=1,h--):(p.length=h+1,i=Do(10,Ft-n),p[h]=a>0?(u/Do(10,o-a)%Do(10,a)|0)*i:0),l)for(;;)if(h==0){(p[0]+=i)==gr&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=gr)break;p[h--]=0,i=1}for(n=p.length;p[--n]===0;)p.pop();if(Ut&&(e.e>Lh||e.e<-Lh))throw Error(bO+ar(e));return e}function j4(e,t){var r,n,a,i,o,s,l,u,h,p,m=e.constructor,v=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Ut?Et(t,v):t;if(l=e.d,p=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(h=o<0,h?(r=l,o=-o,s=p.length):(r=p,n=u,s=l.length),a=Math.max(Math.ceil(v/Ft),s)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=l.length,s=p.length,h=a0;--a)l[s++]=0;for(a=p.length;a>o;){if(l[--a]0?i=i.charAt(0)+"."+i.slice(1)+Ki(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ki(-a-1)+i,r&&(n=r-o)>0&&(i+=Ki(n))):a>=o?(i+=Ki(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+Ki(n))):((n=a+1)0&&(a+1===o&&(i+="."),i+=Ki(n))),e.s<0?"-"+i:i}function a2(e,t){if(e.length>t)return e.length=t,!0}function T4(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(zo+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return n2(o,i.toString())}else if(typeof i!="string")throw Error(zo+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,ese.test(i))n2(o,i);else throw Error(zo+i)}if(a.prototype=xe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=T4,a.config=a.set=tse,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(zo+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(zo+r+": "+n);return this}var wO=T4(Qoe);yn=new wO(1);const At=wO;function rse(e){return ose(e)||ise(e)||ase(e)||nse()}function nse(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ase(e,t){if(e){if(typeof e=="string")return kw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kw(e,t)}}function ise(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function ose(e){if(Array.isArray(e))return kw(e)}function kw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,a):e(t-o,i2(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){a=!0,i=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function wse(e){if(Array.isArray(e))return e}function k4(e){var t=Su(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function M4(e,t,r){if(e.lte(0))return new At(0);var n=dm.getDigitCount(e.toNumber()),a=new At(10).pow(n),i=e.div(a),o=n!==1?.05:.1,s=new At(Math.ceil(i.div(o).toNumber())).add(r).mul(o),l=s.mul(a);return t?l:new At(Math.ceil(l))}function Sse(e,t,r){var n=1,a=new At(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new At(10).pow(dm.getDigitCount(e)-1),a=new At(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new At(Math.floor(e)))}else e===0?a=new At(Math.floor((t-1)/2)):r||(a=new At(Math.floor(e)));var o=Math.floor((t-1)/2),s=use(cse(function(l){return a.add(new At(l-o).mul(n)).toNumber()}),Mw);return s(0,t)}function R4(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new At(0),tickMin:new At(0),tickMax:new At(0)};var i=M4(new At(t).sub(e).div(r-1),n,a),o;e<=0&&t>=0?o=new At(0):(o=new At(e).add(t).div(2),o=o.sub(new At(o).mod(i)));var s=Math.ceil(o.sub(e).div(i).toNumber()),l=Math.ceil(new At(t).sub(o).div(i).toNumber()),u=s+l+1;return u>r?R4(e,t,r,n,a+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:i,tickMin:o.sub(new At(s).mul(i)),tickMax:o.add(new At(l).mul(i))})}function Ose(e){var t=Su(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),s=k4([r,n]),l=Su(s,2),u=l[0],h=l[1];if(u===-1/0||h===1/0){var p=h===1/0?[u].concat(Dw(Mw(0,a-1).map(function(){return 1/0}))):[].concat(Dw(Mw(0,a-1).map(function(){return-1/0})),[h]);return r>n?Rw(p):p}if(u===h)return Sse(u,a,i);var m=R4(u,h,o,i),v=m.step,b=m.tickMin,g=m.tickMax,x=dm.rangeStep(b,g.add(new At(.1).mul(v)),v);return r>n?Rw(x):x}function _se(e,t){var r=Su(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=k4([n,a]),s=Su(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,a];if(l===u)return[l];var h=Math.max(t,2),p=M4(new At(u).sub(l).div(h-1),i,0),m=[].concat(Dw(dm.rangeStep(new At(l),new At(u).sub(new At(.99).mul(p)),p)),[u]);return n>a?Rw(m):m}var Ase=C4(Ose),jse=C4(_se),Tse="Invariant failed";function rs(e,t){throw new Error(Tse)}var Pse=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function yl(e){"@babel/helpers - typeof";return yl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yl(e)}function Fh(){return Fh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dse(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ise(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $se(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var l=i.range,u=0;u0?a[u-1].coordinate:a[s-1].coordinate,p=a[u].coordinate,m=u>=s-1?a[0].coordinate:a[u+1].coordinate,v=void 0;if(Br(p-h)!==Br(m-p)){var b=[];if(Br(m-p)===Br(l[1]-l[0])){v=m;var g=p+l[1]-l[0];b[0]=Math.min(g,(g+h)/2),b[1]=Math.max(g,(g+h)/2)}else{v=h;var x=m+l[1]-l[0];b[0]=Math.min(p,(x+p)/2),b[1]=Math.max(p,(x+p)/2)}var S=[Math.min(p,(v+p)/2),Math.max(p,(v+p)/2)];if(t>S[0]&&t<=S[1]||t>=b[0]&&t<=b[1]){o=a[u].index;break}}else{var O=Math.min(h,m),j=Math.max(h,m);if(t>(O+p)/2&&t<=(j+p)/2){o=a[u].index;break}}}else for(var P=0;P0&&P(n[P].coordinate+n[P-1].coordinate)/2&&t<=(n[P].coordinate+n[P+1].coordinate)/2||P===s-1&&t>(n[P].coordinate+n[P-1].coordinate)/2){o=n[P].index;break}return o},SO=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Xt(Xt({},t.type.defaultProps),t.props):t.props,o=i.stroke,s=i.fill,l;switch(a){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},ele=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},s=Object.keys(i),l=0,u=s.length;l=0});if(S&&S.length){var O=S[0].type.defaultProps,j=O!==void 0?Xt(Xt({},O),S[0].props):S[0].props,P=j.barSize,A=j[x];o[A]||(o[A]=[]);var T=ze(P)?r:P;o[A].push({item:S[0],stackList:S.slice(1),barSize:ze(T)?void 0:Wr(T,n,0)})}}return o},tle=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=Wr(r,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var m=!1,v=a/l,b=o.reduce(function(P,A){return P+A.barSize||0},0);b+=(l-1)*u,b>=a&&(b-=(l-1)*u,u=0),b>=a&&v>0&&(m=!0,v*=.9,b=l*v);var g=(a-b)/2>>0,x={offset:g-u,size:0};h=o.reduce(function(P,A){var T={item:A.item,position:{offset:x.offset+x.size+u,size:m?v:A.barSize}},N=[].concat(l2(P),[T]);return x=N[N.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(k){N.push({item:k,position:x})}),N},p)}else{var S=Wr(n,a,0,!0);a-2*S-(l-1)*u<=0&&(u=0);var O=(a-2*S-(l-1)*u)/l;O>1&&(O>>=0);var j=s===+s?Math.min(O,s):O;h=o.reduce(function(P,A,T){var N=[].concat(l2(P),[{item:A.item,position:{offset:S+(O+u)*T+(O-j)/2,size:j}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(k){N.push({item:k,position:N[N.length-1].position})}),N},p)}return h},rle=function(t,r,n,a){var i=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=L4({children:i,legendWidth:l});if(u){var h=a||{},p=h.width,m=h.height,v=u.align,b=u.verticalAlign,g=u.layout;if((g==="vertical"||g==="horizontal"&&b==="middle")&&v!=="center"&&ce(t[v]))return Xt(Xt({},t),{},el({},v,t[v]+(p||0)));if((g==="horizontal"||g==="vertical"&&v==="center")&&b!=="middle"&&ce(t[b]))return Xt(Xt({},t),{},el({},b,t[b]+(m||0)))}return t},nle=function(t,r,n){return ze(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},F4=function(t,r,n,a,i){var o=r.props.children,s=wn(o,hf).filter(function(u){return nle(a,i,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,h){var p=cr(h,n);if(ze(p))return u;var m=Array.isArray(p)?[um(p),cm(p)]:[p,p],v=l.reduce(function(b,g){var x=cr(h,g,0),S=m[0]-Math.abs(Array.isArray(x)?x[0]:x),O=m[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(S,b[0]),Math.max(O,b[1])]},[1/0,-1/0]);return[Math.min(v[0],u[0]),Math.max(v[1],u[1])]},[1/0,-1/0])}return null},ale=function(t,r,n,a,i){var o=r.map(function(s){return F4(t,s,n,i,a)}).filter(function(s){return!ze(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},B4=function(t,r,n,a,i){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&F4(t,l,u,a)||Zc(t,u,n,i)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var h=0,p=u.length;h=2?Br(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var m=i?i.indexOf(p):p;return{coordinate:a(m)+u,value:p,offset:u}});return h.filter(function(p){return!of(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,m){return{coordinate:a(p)+u,value:p,index:m,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+u,value:p,offset:u}}):a.domain().map(function(p,m){return{coordinate:a(p)+u,value:i?i[p]:p,index:m,offset:u}})},Ux=new WeakMap,Cd=function(t,r){if(typeof r!="function")return t;Ux.has(t)||Ux.set(t,new WeakMap);var n=Ux.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},U4=function(t,r,n){var a=t.scale,i=t.type,o=t.layout,s=t.axisType;if(a==="auto")return o==="radial"&&s==="radiusAxis"?{scale:vu(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Rh(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Xc(),realScaleType:"point"}:i==="category"?{scale:vu(),realScaleType:"band"}:{scale:Rh(),realScaleType:"linear"};if(af(a)){var l="scale".concat(Kp(a));return{scale:(KE[l]||Xc)(),realScaleType:KE[l]?l:"point"}}return De(a)?{scale:a}:{scale:Xc(),realScaleType:"point"}},u2=1e-4,H4=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-u2,o=Math.max(a[0],a[1])+u2,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},ile=function(t,r){if(!t)return null;for(var n=0,a=t.length;na)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]=0?(t[s][n][0]=i,t[s][n][1]=i+l,i=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},lle=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n=0?(t[o][n][0]=i,t[o][n][1]=i+s,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},cle={sign:sle,expand:Xee,none:ul,silhouette:Zee,wiggle:Jee,positive:lle},ule=function(t,r,n){var a=r.map(function(s){return s.props.dataKey}),i=cle[n],o=Yee().keys(a).value(function(s,l){return+cr(s,l,0)}).order(pw).offset(i);return o(t)},fle=function(t,r,n,a,i,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(p,m){var v,b=(v=m.type)!==null&&v!==void 0&&v.defaultProps?Xt(Xt({},m.type.defaultProps),m.props):m.props,g=b.stackId,x=b.hide;if(x)return p;var S=b[n],O=p[S]||{hasStack:!1,stackGroups:{}};if(ur(g)){var j=O.stackGroups[g]||{numericAxisId:n,cateAxisId:a,items:[]};j.items.push(m),O.hasStack=!0,O.stackGroups[g]=j}else O.stackGroups[Gl("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[m]};return Xt(Xt({},p),{},el({},S,O))},l),h={};return Object.keys(u).reduce(function(p,m){var v=u[m];if(v.hasStack){var b={};v.stackGroups=Object.keys(v.stackGroups).reduce(function(g,x){var S=v.stackGroups[x];return Xt(Xt({},g),{},el({},x,{numericAxisId:n,cateAxisId:a,items:S.items,stackedData:ule(t,S.items,i)}))},b)}return Xt(Xt({},p),{},el({},m,v))},h)},V4=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var h=Ase(u,i,s);return t.domain([um(h),cm(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),m=jse(p,i,s);return{niceTicks:m}}return null};function f2(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!ze(a[t.dataKey])){var s=vh(r,"value",a[t.dataKey]);if(s)return s.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var l=cr(a,ze(o)?t.dataKey:o);return ze(l)?null:t.scale(l)}var d2=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+a:null;var l=cr(o,r.dataKey,r.domain[s]);return ze(l)?null:r.scale(l)-i/2+a},dle=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},hle=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Xt(Xt({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(ur(i)){var o=r[i];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},ple=function(t){return t.reduce(function(r,n){return[um(n.concat([r[0]]).filter(ce)),cm(n.concat([r[1]]).filter(ce))]},[1/0,-1/0])},z4=function(t,r,n){return Object.keys(t).reduce(function(a,i){var o=t[i],s=o.stackedData,l=s.reduce(function(u,h){var p=ple(h.slice(r,n+1));return[Math.min(u[0],p[0]),Math.max(u[1],p[1])]},[1/0,-1/0]);return[Math.min(l[0],a[0]),Math.max(l[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},h2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,p2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Fw=function(t,r,n){if(De(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(ce(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(h2.test(t[0])){var i=+h2.exec(t[0])[1];a[0]=r[0]-i}else De(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(ce(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(p2.test(t[1])){var o=+p2.exec(t[1])[1];a[1]=r[1]+o}else De(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},Wh=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=XS(r,function(p){return p.coordinate}),o=1/0,s=1,l=i.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},Ole=function(t,r,n,a,i){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,h=Wr(t.cx,o,o/2),p=Wr(t.cy,s,s/2),m=Y4(o,s,n),v=Wr(t.innerRadius,m,0),b=Wr(t.outerRadius,m,m*.8),g=Object.keys(r);return g.reduce(function(x,S){var O=r[S],j=O.domain,P=O.reversed,A;if(ze(O.range))a==="angleAxis"?A=[l,u]:a==="radiusAxis"&&(A=[v,b]),P&&(A=[A[1],A[0]]);else{A=O.range;var T=A,N=gle(T,2);l=N[0],u=N[1]}var k=U4(O,i),R=k.realScaleType,W=k.scale;W.domain(j).range(A),H4(W);var E=V4(W,ii(ii({},O),{},{realScaleType:R})),I=ii(ii(ii({},O),E),{},{range:A,radius:b,realScaleType:R,scale:W,cx:h,cy:p,innerRadius:v,outerRadius:b,startAngle:l,endAngle:u});return ii(ii({},x),{},K4({},S,I))},{})},_le=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},Ale=function(t,r){var n=t.x,a=t.y,i=r.cx,o=r.cy,s=_le({x:n,y:a},{x:i,y:o});if(s<=0)return{radius:s};var l=(n-i)/s,u=Math.acos(l);return a>o&&(u=2*Math.PI-u),{radius:s,angle:Sle(u),angleInRadian:u}},jle=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},Tle=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),s=Math.min(i,o);return t+s*360},y2=function(t,r){var n=t.x,a=t.y,i=Ale({x:n,y:a},r),o=i.radius,s=i.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var h=jle(r),p=h.startAngle,m=h.endAngle,v=s,b;if(p<=m){for(;v>m;)v-=360;for(;v=p&&v<=m}else{for(;v>p;)v-=360;for(;v=m&&v<=p}return b?ii(ii({},r),{},{radius:o,angle:Tle(v,r)}):null},X4=function(t){return!w.isValidElement(t)&&!De(t)&&typeof t!="boolean"?t.className:""};function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}var Ple=["offset"];function Nle(e){return Mle(e)||kle(e)||Ele(e)||Cle()}function Cle(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ele(e,t){if(e){if(typeof e=="string")return Bw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bw(e,t)}}function kle(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Mle(e){if(Array.isArray(e))return Bw(e)}function Bw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function x2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function lr(e){for(var t=1;t=0?1:-1,j,P;a==="insideStart"?(j=v+O*o,P=g):a==="insideEnd"?(j=b-O*o,P=!g):a==="end"&&(j=b+O*o,P=g),P=S<=0?P:!P;var A=Dt(u,h,x,j),T=Dt(u,h,x,j+(P?1:-1)*359),N="M".concat(A.x,",").concat(A.y,` A`).concat(x,",").concat(x,",0,1,").concat(P?0:1,`, `).concat(T.x,",").concat(T.y),k=ze(t.id)?Gl("recharts-radial-line-"):t.id;return q.createElement("text",Tu({},n,{dominantBaseline:"central",className:Ke("recharts-radial-bar-label",s)}),q.createElement("defs",null,q.createElement("path",{id:k,d:N})),q.createElement("textPath",{xlinkHref:"#".concat(k)},r))},qle=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,o=i.cx,s=i.cy,l=i.innerRadius,u=i.outerRadius,h=i.startAngle,p=i.endAngle,m=(h+p)/2;if(a==="outside"){var v=Dt(o,s,u+n,m),b=v.x,g=v.y;return{x:b,y:g,textAnchor:b>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var x=(l+u)/2,S=Dt(o,s,x,m),O=S.x,j=S.y;return{x:O,y:j,textAnchor:"middle",verticalAnchor:"middle"}},Ule=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,o=r,s=o.x,l=o.y,u=o.width,h=o.height,p=h>=0?1:-1,m=p*a,v=p>0?"end":"start",b=p>0?"start":"end",g=u>=0?1:-1,x=g*a,S=g>0?"end":"start",O=g>0?"start":"end";if(i==="top"){var j={x:s+u/2,y:l-p*a,textAnchor:"middle",verticalAnchor:v};return lr(lr({},j),n?{height:Math.max(l-n.y,0),width:u}:{})}if(i==="bottom"){var P={x:s+u/2,y:l+h+m,textAnchor:"middle",verticalAnchor:b};return lr(lr({},P),n?{height:Math.max(n.y+n.height-(l+h),0),width:u}:{})}if(i==="left"){var A={x:s-x,y:l+h/2,textAnchor:S,verticalAnchor:"middle"};return lr(lr({},A),n?{width:Math.max(A.x-n.x,0),height:h}:{})}if(i==="right"){var T={x:s+u+x,y:l+h/2,textAnchor:O,verticalAnchor:"middle"};return lr(lr({},T),n?{width:Math.max(n.x+n.width-T.x,0),height:h}:{})}var N=n?{width:u,height:h}:{};return i==="insideLeft"?lr({x:s+x,y:l+h/2,textAnchor:O,verticalAnchor:"middle"},N):i==="insideRight"?lr({x:s+u-x,y:l+h/2,textAnchor:S,verticalAnchor:"middle"},N):i==="insideTop"?lr({x:s+u/2,y:l+m,textAnchor:"middle",verticalAnchor:b},N):i==="insideBottom"?lr({x:s+u/2,y:l+h-m,textAnchor:"middle",verticalAnchor:v},N):i==="insideTopLeft"?lr({x:s+x,y:l+m,textAnchor:O,verticalAnchor:b},N):i==="insideTopRight"?lr({x:s+u-x,y:l+m,textAnchor:S,verticalAnchor:b},N):i==="insideBottomLeft"?lr({x:s+x,y:l+h-m,textAnchor:O,verticalAnchor:v},N):i==="insideBottomRight"?lr({x:s+u-x,y:l+h-m,textAnchor:S,verticalAnchor:v},N):zl(i)&&(ce(i.x)||$o(i.x))&&(ce(i.y)||$o(i.y))?lr({x:s+Wr(i.x,u),y:l+Wr(i.y,h),textAnchor:"end",verticalAnchor:"end"},N):lr({x:s+u/2,y:l+h/2,textAnchor:"middle",verticalAnchor:"middle"},N)},Hle=function(t){return"cx"in t&&ce(t.cx)};function yr(e){var t=e.offset,r=t===void 0?5:t,n=Rle(e,Ple),a=lr({offset:r},n),i=a.viewBox,o=a.position,s=a.value,l=a.children,u=a.content,h=a.className,p=h===void 0?"":h,m=a.textBreakAll;if(!i||ze(s)&&ze(l)&&!w.isValidElement(u)&&!De(u))return null;if(w.isValidElement(u))return w.cloneElement(u,a);var v;if(De(u)){if(v=w.createElement(u,a),w.isValidElement(v))return v}else v=Fle(a);var b=Hle(i),g=Te(a,!0);if(b&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Wle(a,v,g);var x=b?qle(a):Ule(a);return q.createElement(es,Tu({className:Ke("recharts-label",p)},g,x,{breakAll:m}),v)}yr.displayName="Label";var Z4=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,h=t.outerRadius,p=t.x,m=t.y,v=t.top,b=t.left,g=t.width,x=t.height,S=t.clockWise,O=t.labelViewBox;if(O)return O;if(ce(g)&&ce(x)){if(ce(p)&&ce(m))return{x:p,y:m,width:g,height:x};if(ce(v)&&ce(b))return{x:v,y:b,width:g,height:x}}return ce(p)&&ce(m)?{x:p,y:m,width:0,height:0}:ce(r)&&ce(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:h||l||s||0,clockWise:S}:t.viewBox?t.viewBox:{}},Vle=function(t,r){return t?t===!0?q.createElement(yr,{key:"label-implicit",viewBox:r}):ur(t)?q.createElement(yr,{key:"label-implicit",viewBox:r,value:t}):w.isValidElement(t)?t.type===yr?w.cloneElement(t,{key:"label-implicit",viewBox:r}):q.createElement(yr,{key:"label-implicit",content:t,viewBox:r}):De(t)?q.createElement(yr,{key:"label-implicit",content:t,viewBox:r}):zl(t)?q.createElement(yr,Tu({viewBox:r},t,{key:"label-implicit"})):null:null},zle=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=Z4(t),o=wn(a,yr).map(function(l,u){return w.cloneElement(l,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return o;var s=Vle(t.label,r||i);return[s].concat(Nle(o))};yr.parseViewBox=Z4;yr.renderCallByParent=zle;var Hx,b2;function Gle(){if(b2)return Hx;b2=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Hx=e,Hx}var Kle=Gle();const Yle=jt(Kle);function Pu(e){"@babel/helpers - typeof";return Pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pu(e)}var Xle=["valueAccessor"],Zle=["data","dataKey","clockWise","id","textBreakAll"];function Jle(e){return rce(e)||tce(e)||ece(e)||Qle()}function Qle(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ece(e,t){if(e){if(typeof e=="string")return Ww(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ww(e,t)}}function tce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rce(e){if(Array.isArray(e))return Ww(e)}function Ww(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var sce=function(t){return Array.isArray(t.value)?Yle(t.value):t.value};function hi(e){var t=e.valueAccessor,r=t===void 0?sce:t,n=O2(e,Xle),a=n.data,i=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=O2(n,Zle);return!a||!a.length?null:q.createElement(ft,{className:"recharts-label-list"},a.map(function(h,p){var m=ze(i)?r(h,p):cr(h&&h.payload,i),v=ze(s)?{}:{id:"".concat(s,"-").concat(p)};return q.createElement(yr,Uh({},Te(h,!0),u,v,{parentViewBox:h.parentViewBox,value:m,textBreakAll:l,viewBox:yr.parseViewBox(ze(o)?h:S2(S2({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}hi.displayName="LabelList";function lce(e,t){return e?e===!0?q.createElement(hi,{key:"labelList-implicit",data:t}):q.isValidElement(e)||De(e)?q.createElement(hi,{key:"labelList-implicit",data:t,content:e}):zl(e)?q.createElement(hi,Uh({data:t},e,{key:"labelList-implicit"})):null:null}function cce(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=wn(n,hi).map(function(o,s){return w.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return a;var i=lce(e.label,t);return[i].concat(Jle(a))}hi.renderCallByParent=cce;function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}function qw(){return qw=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, `).concat(p.x,",").concat(p.y,` `);if(a>0){var v=Dt(r,n,a,o),b=Dt(r,n,a,u);m+="L ".concat(b.x,",").concat(b.y,` A `).concat(a,",").concat(a,`,0, `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, `).concat(v.x,",").concat(v.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},pce=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,h=t.endAngle,p=Br(h-u),m=Ed({cx:r,cy:n,radius:i,angle:u,sign:p,cornerRadius:o,cornerIsExternal:l}),v=m.circleTangency,b=m.lineTangency,g=m.theta,x=Ed({cx:r,cy:n,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:l}),S=x.circleTangency,O=x.lineTangency,j=x.theta,P=l?Math.abs(u-h):Math.abs(u-h)-g-j;if(P<0)return s?"M ".concat(b.x,",").concat(b.y,` a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 `):J4({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:h});var A="M ".concat(b.x,",").concat(b.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(v.x,",").concat(v.y,` A`).concat(i,",").concat(i,",0,").concat(+(P>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(O.x,",").concat(O.y,` `);if(a>0){var T=Ed({cx:r,cy:n,radius:a,angle:u,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),N=T.circleTangency,k=T.lineTangency,R=T.theta,W=Ed({cx:r,cy:n,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),E=W.circleTangency,I=W.lineTangency,L=W.theta,$=l?Math.abs(u-h):Math.abs(u-h)-R-L;if($<0&&o===0)return"".concat(A,"L").concat(r,",").concat(n,"Z");A+="L".concat(I.x,",").concat(I.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(E.x,",").concat(E.y,` A`).concat(a,",").concat(a,",0,").concat(+($>180),",").concat(+(p>0),",").concat(N.x,",").concat(N.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(k.x,",").concat(k.y,"Z")}else A+="L".concat(r,",").concat(n,"Z");return A},mce={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Q4=function(t){var r=A2(A2({},mce),t),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,h=r.startAngle,p=r.endAngle,m=r.className;if(o0&&Math.abs(h-p)<360?x=pce({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(g,b/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:h,endAngle:p}):x=J4({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),q.createElement("path",qw({},Te(r,!0),{className:v,d:x,role:"img"}))};function Cu(e){"@babel/helpers - typeof";return Cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cu(e)}function Uw(){return Uw=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function Nce(e,t){return Jl(e.getTime(),t.getTime())}function I2(e,t,r){if(e.size!==t.size)return!1;for(var n={},a=e.entries(),i=0,o,s;(o=a.next())&&!o.done;){for(var l=t.entries(),u=!1,h=0;(s=l.next())&&!s.done;){var p=o.value,m=p[0],v=p[1],b=s.value,g=b[0],x=b[1];!u&&!n[h]&&(u=r.equals(m,g,i,h,e,t,r)&&r.equals(v,x,m,g,e,t,r))&&(n[h]=!0),h++}if(!u)return!1;i++}return!0}function Cce(e,t,r){var n=D2(e),a=n.length;if(D2(t).length!==a)return!1;for(var i;a-- >0;)if(i=n[a],i===tF&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!eF(t,i)||!r.equals(e[i],t[i],i,i,e,t,r))return!1;return!0}function Dc(e,t,r){var n=M2(e),a=n.length;if(M2(t).length!==a)return!1;for(var i,o,s;a-- >0;)if(i=n[a],i===tF&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!eF(t,i)||!r.equals(e[i],t[i],i,i,e,t,r)||(o=R2(e,i),s=R2(t,i),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Ece(e,t){return Jl(e.valueOf(),t.valueOf())}function kce(e,t){return e.source===t.source&&e.flags===t.flags}function $2(e,t,r){if(e.size!==t.size)return!1;for(var n={},a=e.values(),i,o;(i=a.next())&&!i.done;){for(var s=t.values(),l=!1,u=0;(o=s.next())&&!o.done;)!l&&!n[u]&&(l=r.equals(i.value,o.value,i.value,o.value,e,t,r))&&(n[u]=!0),u++;if(!l)return!1}return!0}function Mce(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}var Rce="[object Arguments]",Dce="[object Boolean]",Ice="[object Date]",$ce="[object Map]",Lce="[object Number]",Fce="[object Object]",Bce="[object RegExp]",Wce="[object Set]",qce="[object String]",Uce=Array.isArray,L2=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,F2=Object.assign,Hce=Object.prototype.toString.call.bind(Object.prototype.toString);function Vce(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,a=e.areObjectsEqual,i=e.arePrimitiveWrappersEqual,o=e.areRegExpsEqual,s=e.areSetsEqual,l=e.areTypedArraysEqual;return function(h,p,m){if(h===p)return!0;if(h==null||p==null||typeof h!="object"||typeof p!="object")return h!==h&&p!==p;var v=h.constructor;if(v!==p.constructor)return!1;if(v===Object)return a(h,p,m);if(Uce(h))return t(h,p,m);if(L2!=null&&L2(h))return l(h,p,m);if(v===Date)return r(h,p,m);if(v===RegExp)return o(h,p,m);if(v===Map)return n(h,p,m);if(v===Set)return s(h,p,m);var b=Hce(h);return b===Ice?r(h,p,m):b===Bce?o(h,p,m):b===$ce?n(h,p,m):b===Wce?s(h,p,m):b===Fce?typeof h.then!="function"&&typeof p.then!="function"&&a(h,p,m):b===Rce?a(h,p,m):b===Dce||b===Lce||b===qce?i(h,p,m):!1}}function zce(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,a={areArraysEqual:n?Dc:Pce,areDatesEqual:Nce,areMapsEqual:n?k2(I2,Dc):I2,areObjectsEqual:n?Dc:Cce,arePrimitiveWrappersEqual:Ece,areRegExpsEqual:kce,areSetsEqual:n?k2($2,Dc):$2,areTypedArraysEqual:n?Dc:Mce};if(r&&(a=F2({},a,r(a))),t){var i=Md(a.areArraysEqual),o=Md(a.areMapsEqual),s=Md(a.areObjectsEqual),l=Md(a.areSetsEqual);a=F2({},a,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return a}function Gce(e){return function(t,r,n,a,i,o,s){return e(t,r,s)}}function Kce(e){var t=e.circular,r=e.comparator,n=e.createState,a=e.equals,i=e.strict;if(n)return function(l,u){var h=n(),p=h.cache,m=p===void 0?t?new WeakMap:void 0:p,v=h.meta;return r(l,u,{cache:m,equals:a,meta:v,strict:i})};if(t)return function(l,u){return r(l,u,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var o={cache:void 0,equals:a,meta:void 0,strict:i};return function(l,u){return r(l,u,o)}}var Yce=go();go({strict:!0});go({circular:!0});go({circular:!0,strict:!0});go({createInternalComparator:function(){return Jl}});go({strict:!0,createInternalComparator:function(){return Jl}});go({circular:!0,createInternalComparator:function(){return Jl}});go({circular:!0,createInternalComparator:function(){return Jl},strict:!0});function go(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,a=e.createState,i=e.strict,o=i===void 0?!1:i,s=zce(e),l=Vce(s),u=n?n(l):Gce(l);return Kce({circular:r,comparator:l,createState:a,equals:u,strict:o})}function Xce(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function B2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):Xce(a)};requestAnimationFrame(n)}function Hw(e){"@babel/helpers - typeof";return Hw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hw(e)}function Zce(e){return tue(e)||eue(e)||Qce(e)||Jce()}function Jce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qce(e,t){if(e){if(typeof e=="string")return W2(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return W2(e,t)}}function W2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:S<0?0:S},g=function(S){for(var O=S>1?1:S,j=O,P=0;P<8;++P){var A=p(j)-O,T=v(j);if(Math.abs(A-O)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,o=t.dt,s=o===void 0?17:o,l=function(h,p,m){var v=-(h-p)*n,b=m*i,g=m+(v-b)*s/1e3,x=m*s/1e3+h;return Math.abs(x-p)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kue(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i=0)&&(r[a]=e[a]);return r}function Kx(e){return Iue(e)||Due(e)||Rue(e)||Mue()}function Mue(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rue(e,t){if(e){if(typeof e=="string")return Yw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yw(e,t)}}function Due(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Iue(e){if(Array.isArray(e))return Yw(e)}function Yw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Gh(e){return Gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gh(e)}var $a=function(e){Wue(r,e);var t=que(r);function r(n,a){var i;$ue(this,r),i=t.call(this,n,a);var o=i.props,s=o.isActive,l=o.attributeName,u=o.from,h=o.to,p=o.steps,m=o.children,v=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Jw(i)),i.changeStyle=i.changeStyle.bind(Jw(i)),!s||v<=0)return i.state={style:{}},typeof m=="function"&&(i.state={style:h}),Zw(i);if(p&&p.length)i.state={style:p[0].style};else if(u){if(typeof m=="function")return i.state={style:u},Zw(i);i.state={style:l?Uc({},l,u):u}}else i.state={style:{}};return i}return Fue(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,s=i.canBegin,l=i.attributeName,u=i.shouldReAnimate,h=i.to,p=i.from,m=this.state.style;if(s){if(!o){var v={style:l?Uc({},l,h):h};this.state&&m&&(l&&m[l]!==h||!l&&m!==h)&&this.setState(v);return}if(!(Yce(a.to,h)&&a.canBegin&&a.isActive)){var b=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=b||u?p:a.to;if(this.state&&m){var x={style:l?Uc({},l,g):g};(l&&m[l]!==g||!l&&m!==g)&&this.setState(x)}this.runAnimation(Xn(Xn({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,s=a.to,l=a.duration,u=a.easing,h=a.begin,p=a.onAnimationEnd,m=a.onAnimationStart,v=Nue(o,s,yue(u),l,this.changeStyle),b=function(){i.stopJSAnimation=v()};this.manager.start([m,h,b,l,p])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,s=a.begin,l=a.onAnimationStart,u=o[0],h=u.style,p=u.duration,m=p===void 0?0:p,v=function(g,x,S){if(S===0)return g;var O=x.duration,j=x.easing,P=j===void 0?"ease":j,A=x.style,T=x.properties,N=x.onAnimationEnd,k=S>0?o[S-1]:x,R=T||Object.keys(A);if(typeof P=="function"||P==="spring")return[].concat(Kx(g),[i.runJSAnimation.bind(i,{from:k.style,to:A,duration:O,easing:P}),O]);var W=H2(R,O,P),E=Xn(Xn(Xn({},k.style),A),{},{transition:W});return[].concat(Kx(g),[E,O,N]).filter(oue)};return this.manager.start([l].concat(Kx(o.reduce(v,[h,Math.max(m,s)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=rue());var i=a.begin,o=a.duration,s=a.attributeName,l=a.to,u=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,m=a.steps,v=a.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof u=="function"||typeof v=="function"||u==="spring"){this.runJSAnimation(a);return}if(m.length>1){this.runStepAnimation(a);return}var g=s?Uc({},s,l):l,x=H2(Object.keys(g),o,u);b.start([h,i,Xn(Xn({},g),{},{transition:x}),o,p])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var s=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var l=Eue(a,Cue),u=w.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!s||u===0||o<=0)return i;var p=function(v){var b=v.props,g=b.style,x=g===void 0?{}:g,S=b.className,O=w.cloneElement(v,Xn(Xn({},l),{},{style:Xn(Xn({},x),h),className:S}));return O};return u===1?p(w.Children.only(i)):q.createElement("div",null,w.Children.map(i,function(m){return p(m)}))}}]),r}(w.PureComponent);$a.displayName="Animate";$a.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};$a.propTypes={from:xt.oneOfType([xt.object,xt.string]),to:xt.oneOfType([xt.object,xt.string]),attributeName:xt.string,duration:xt.number,begin:xt.number,easing:xt.oneOfType([xt.string,xt.func]),steps:xt.arrayOf(xt.shape({duration:xt.number.isRequired,style:xt.object.isRequired,easing:xt.oneOfType([xt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),xt.func]),properties:xt.arrayOf("string"),onAnimationEnd:xt.func})),children:xt.oneOfType([xt.node,xt.func]),isActive:xt.bool,canBegin:xt.bool,onAnimationEnd:xt.func,shouldReAnimate:xt.bool,onAnimationStart:xt.func,onAnimationReStart:xt.func};function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}function Kh(){return Kh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,h;if(o>0&&i instanceof Array){for(var p=[0,0,0,0],m=0,v=4;mo?o:i[m];h="M".concat(t,",").concat(r+s*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(u,",").concat(t+l*p[0],",").concat(r)),h+="L ".concat(t+n-l*p[1],",").concat(r),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(u,`, `).concat(t+n,",").concat(r+s*p[1])),h+="L ".concat(t+n,",").concat(r+a-s*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(u,`, `).concat(t+n-l*p[2],",").concat(r+a)),h+="L ".concat(t+l*p[3],",").concat(r+a),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(u,`, `).concat(t,",").concat(r+a-s*p[3])),h+="Z"}else if(o>0&&i===+i&&i>0){var b=Math.min(o,i);h="M ".concat(t,",").concat(r+s*b,` A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+l*b,",").concat(r,` L `).concat(t+n-l*b,",").concat(r,` A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*b,` L `).concat(t+n,",").concat(r+a-s*b,` A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t+n-l*b,",").concat(r+a,` L `).concat(t+l*b,",").concat(r+a,` A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(t,",").concat(r+a-s*b," Z")}else h="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return h},Jue=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(i,i+s),h=Math.max(i,i+s),p=Math.min(o,o+l),m=Math.max(o,o+l);return n>=u&&n<=h&&a>=p&&a<=m}return!1},Que={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},OO=function(t){var r=J2(J2({},Que),t),n=w.useRef(),a=w.useState(-1),i=Hue(a,2),o=i[0],s=i[1];w.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var P=n.current.getTotalLength();P&&s(P)}catch{}},[]);var l=r.x,u=r.y,h=r.width,p=r.height,m=r.radius,v=r.className,b=r.animationEasing,g=r.animationDuration,x=r.animationBegin,S=r.isAnimationActive,O=r.isUpdateAnimationActive;if(l!==+l||u!==+u||h!==+h||p!==+p||h===0||p===0)return null;var j=Ke("recharts-rectangle",v);return O?q.createElement($a,{canBegin:o>0,from:{width:h,height:p,x:l,y:u},to:{width:h,height:p,x:l,y:u},duration:g,animationEasing:b,isActive:O},function(P){var A=P.width,T=P.height,N=P.x,k=P.y;return q.createElement($a,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:g,isActive:S,easing:b},q.createElement("path",Kh({},Te(r,!0),{className:j,d:Q2(N,k,A,T,m),ref:n})))}):q.createElement("path",Kh({},Te(r,!0),{className:j,d:Q2(l,u,h,p,m)}))},efe=["points","className","baseLinePoints","connectNulls"];function Hs(){return Hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rfe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ek(e){return ofe(e)||ife(e)||afe(e)||nfe()}function nfe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function afe(e,t){if(e){if(typeof e=="string")return Qw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qw(e,t)}}function ife(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ofe(e){if(Array.isArray(e))return Qw(e)}function Qw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){tk(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),tk(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Qc=function(t,r){var n=sfe(t);r&&(n=[n.reduce(function(i,o){return[].concat(ek(i),ek(o))},[])]);var a=n.map(function(i){return i.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},lfe=function(t,r,n){var a=Qc(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Qc(r.reverse(),n).slice(1))},cfe=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,o=tfe(t,efe);if(!r||!r.length)return null;var s=Ke("recharts-polygon",n);if(a&&a.length){var l=o.stroke&&o.stroke!=="none",u=lfe(r,a,i);return q.createElement("g",{className:s},q.createElement("path",Hs({},Te(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?q.createElement("path",Hs({},Te(o,!0),{fill:"none",d:Qc(r,i)})):null,l?q.createElement("path",Hs({},Te(o,!0),{fill:"none",d:Qc(a,i)})):null)}var h=Qc(r,i);return q.createElement("path",Hs({},Te(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:s,d:h}))};function e1(){return e1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vfe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var gfe=function(t,r,n,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},yfe=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,h=t.width,p=h===void 0?0:h,m=t.height,v=m===void 0?0:m,b=t.className,g=mfe(t,ufe),x=ffe({x:n,y:i,top:s,left:u,width:p,height:v},g);return!ce(n)||!ce(i)||!ce(p)||!ce(v)||!ce(s)||!ce(u)?null:q.createElement("path",t1({},Te(x,!0),{className:Ke("recharts-cross",b),d:gfe(n,i,p,v,s,u)}))},Yx,nk;function xfe(){if(nk)return Yx;nk=1;var e=lm(),t=w4(),r=Wa();function n(a,i){return a&&a.length?e(a,r(i,2),t):void 0}return Yx=n,Yx}var bfe=xfe();const wfe=jt(bfe);var Xx,ak;function Sfe(){if(ak)return Xx;ak=1;var e=lm(),t=Wa(),r=S4();function n(a,i){return a&&a.length?e(a,t(i,2),r):void 0}return Xx=n,Xx}var Ofe=Sfe();const _fe=jt(Ofe);var Afe=["cx","cy","angle","ticks","axisLine"],jfe=["ticks","tick","angle","tickFormatter","stroke"];function bl(e){"@babel/helpers - typeof";return bl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bl(e)}function eu(){return eu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tfe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Pfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sk(e,t){for(var r=0;ruk?o=a==="outer"?"start":"end":i<-uk?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=Co(Co({},Te(this.props,!1)),{},{fill:"none"},Te(s,!1));if(l==="circle")return q.createElement(hm,Io({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(m){return Dt(a,i,o,m.coordinate)});return q.createElement(cfe,Io({className:"recharts-polar-angle-axis-line"},u,{points:p}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,s=a.tickLine,l=a.tickFormatter,u=a.stroke,h=Te(this.props,!1),p=Te(o,!1),m=Co(Co({},h),{},{fill:"none"},Te(s,!1)),v=i.map(function(b,g){var x=n.getTickLineCoord(b),S=n.getTickTextAnchor(b),O=Co(Co(Co({textAnchor:S},h),{},{stroke:"none",fill:u},p),{},{index:g,payload:b,x:x.x2,y:x.y2});return q.createElement(ft,Io({className:Ke("recharts-polar-angle-axis-tick",X4(o)),key:"tick-".concat(b.coordinate)},Qo(n.props,b,g)),s&&q.createElement("line",Io({className:"recharts-polar-angle-axis-tick-line"},m,x)),o&&t.renderTickItem(o,O,l?l(b.value,g):b.value))});return q.createElement(ft,{className:"recharts-polar-angle-axis-ticks"},v)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!a||!a.length?null:q.createElement(ft,{className:Ke("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var o;return q.isValidElement(n)?o=q.cloneElement(n,a):De(n)?o=n(a):o=q.createElement(es,Io({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(w.PureComponent);vm(gm,"displayName","PolarAngleAxis");vm(gm,"axisType","angleAxis");vm(gm,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Zx,fk;function Ufe(){if(fk)return Zx;fk=1;var e=bL(),t=e(Object.getPrototypeOf,Object);return Zx=t,Zx}var Jx,dk;function Hfe(){if(dk)return Jx;dk=1;var e=Si(),t=Ufe(),r=Oi(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,s=i.hasOwnProperty,l=o.call(Object);function u(h){if(!r(h)||e(h)!=n)return!1;var p=t(h);if(p===null)return!0;var m=s.call(p,"constructor")&&p.constructor;return typeof m=="function"&&m instanceof m&&o.call(m)==l}return Jx=u,Jx}var Vfe=Hfe();const zfe=jt(Vfe);var Qx,hk;function Gfe(){if(hk)return Qx;hk=1;var e=Si(),t=Oi(),r="[object Boolean]";function n(a){return a===!0||a===!1||t(a)&&e(a)==r}return Qx=n,Qx}var Kfe=Gfe();const Yfe=jt(Kfe);function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}function Zh(){return Zh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:m,x:l,y:u},to:{upperWidth:h,lowerWidth:p,height:m,x:l,y:u},duration:g,animationEasing:b,isActive:S},function(j){var P=j.upperWidth,A=j.lowerWidth,T=j.height,N=j.x,k=j.y;return q.createElement($a,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:g,easing:b},q.createElement("path",Zh({},Te(r,!0),{className:O,d:gk(N,k,P,A,T),ref:n})))}):q.createElement("g",null,q.createElement("path",Zh({},Te(r,!0),{className:O,d:gk(l,u,h,p,m)})))},ode=["option","shapeType","propTransformer","activeClassName","isActive"];function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function sde(e,t){if(e==null)return{};var r=lde(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lde(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function yk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Jh(e){for(var t=1;t0?bn(j,"paddingAngle",0):0;if(A){var N=gn(A.endAngle-A.startAngle,j.endAngle-j.startAngle),k=Mt(Mt({},j),{},{startAngle:O+T,endAngle:O+N(g)+T});x.push(k),O=k.endAngle}else{var R=j.endAngle,W=j.startAngle,E=gn(0,R-W),I=E(g),L=Mt(Mt({},j),{},{startAngle:O+T,endAngle:O+I+T});x.push(L),O=L.endAngle}}),q.createElement(ft,null,n.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[s].focus(),a.setState({sectorToFocus:s});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!df(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,o=a.sectors,s=a.className,l=a.label,u=a.cx,h=a.cy,p=a.innerRadius,m=a.outerRadius,v=a.isAnimationActive,b=this.state.isAnimationFinished;if(i||!o||!o.length||!ce(u)||!ce(h)||!ce(p)||!ce(m))return null;var g=Ke("recharts-pie",s);return q.createElement(ft,{tabIndex:this.props.rootTabIndex,className:g,ref:function(S){n.pieRef=S}},this.renderSectors(),l&&this.renderLabels(o),yr.renderCallByParent(this.props,null,!1),(!v||b)&&hi.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n=360?O:O-1)*l,P=x-O*v-j,A=a.reduce(function(k,R){var W=cr(R,S,0);return k+(ce(W)?W:0)},0),T;if(A>0){var N;T=a.map(function(k,R){var W=cr(k,S,0),E=cr(k,h,R),I=(ce(W)?W:0)/A,L;R?L=N.endAngle+Br(g)*l*(W!==0?1:0):L=o;var $=L+Br(g)*((W!==0?v:0)+I*P),F=(L+$)/2,z=(b.innerRadius+b.outerRadius)/2,H=[{name:E,value:W,payload:k,dataKey:S,type:m}],U=Dt(b.cx,b.cy,z,F);return N=Mt(Mt(Mt({percent:I,cornerRadius:i,name:E,tooltipPayload:H,midAngle:F,middleRadius:z,tooltipPosition:U},k),b),{},{value:cr(k,S),startAngle:L,endAngle:$,payload:k,paddingAngle:Br(g)*l}),N})}return Mt(Mt({},b),{},{sectors:T,data:a})});var eb,Sk;function Nde(){if(Sk)return eb;Sk=1;var e=Math.ceil,t=Math.max;function r(n,a,i,o){for(var s=-1,l=t(e((a-n)/(i||1)),0),u=Array(l);l--;)u[o?l:++s]=n,n+=i;return u}return eb=r,eb}var tb,Ok;function mF(){if(Ok)return tb;Ok=1;var e=IL(),t=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*r}return a===a?a:0}return tb=n,tb}var rb,_k;function Cde(){if(_k)return rb;_k=1;var e=Nde(),t=em(),r=mF();function n(a){return function(i,o,s){return s&&typeof s!="number"&&t(i,o,s)&&(o=s=void 0),i=r(i),o===void 0?(o=i,i=0):o=r(o),s=s===void 0?i0&&n.handleDrag(a.changedTouches[0])}),hn(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,s=a.startIndex;o==null||o({endIndex:i,startIndex:s})}),n.detachDragEndListener()}),hn(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),hn(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),hn(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),hn(n,"handleSlideDragStart",function(a){var i=Ck(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return qde(t,e),Lde(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,h=u.length-1,p=Math.min(a,i),m=Math.max(a,i),v=t.getIndexInRange(o,p),b=t.getIndexInRange(o,m);return{startIndex:v-v%l,endIndex:b===h?h:b-b%l}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,s=a.dataKey,l=cr(i[n],s,n);return De(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,s=a.endX,l=this.props,u=l.x,h=l.width,p=l.travellerWidth,m=l.startIndex,v=l.endIndex,b=l.onChange,g=n.pageX-i;g>0?g=Math.min(g,u+h-p-s,u+h-p-o):g<0&&(g=Math.max(g,u-o,u-s));var x=this.getIndex({startX:o+g,endX:s+g});(x.startIndex!==m||x.endIndex!==v)&&b&&b(x),this.setState({startX:o+g,endX:s+g,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=Ck(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,s=a.endX,l=a.startX,u=this.state[o],h=this.props,p=h.x,m=h.width,v=h.travellerWidth,b=h.onChange,g=h.gap,x=h.data,S={startX:this.state.startX,endX:this.state.endX},O=n.pageX-i;O>0?O=Math.min(O,p+m-v-u):O<0&&(O=Math.max(O,p-u)),S[o]=u+O;var j=this.getIndex(S),P=j.startIndex,A=j.endIndex,T=function(){var k=x.length-1;return o==="startX"&&(s>l?P%g===0:A%g===0)||sl?A%g===0:P%g===0)||s>l&&A===k};this.setState(hn(hn({},o,u+O),"brushMoveStartX",n.pageX),function(){b&&T()&&b(j)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,h=this.state[a],p=s.indexOf(h);if(p!==-1){var m=p+n;if(!(m===-1||m>=s.length)){var v=s[m];a==="startX"&&v>=u||a==="endX"&&v<=l||this.setState(hn({},a,v),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return q.createElement("rect",{stroke:u,fill:l,x:a,y:i,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,s=n.height,l=n.data,u=n.children,h=n.padding,p=w.Children.only(u);return p?q.cloneElement(p,{x:a,y:i,width:o,height:s,margin:h,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,s=this,l=this.props,u=l.y,h=l.travellerWidth,p=l.height,m=l.traveller,v=l.ariaLabel,b=l.data,g=l.startIndex,x=l.endIndex,S=Math.max(n,this.props.x),O=ab(ab({},Te(this.props,!1)),{},{x:S,y:u,width:h,height:p}),j=v||"Min value: ".concat((i=b[g])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=b[x])===null||o===void 0?void 0:o.name);return q.createElement(ft,{tabIndex:0,role:"slider","aria-label":j,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),s.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,a))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,O))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,s=i.height,l=i.stroke,u=i.travellerWidth,h=Math.min(n,a)+u,p=Math.max(Math.abs(a-n)-u,0);return q.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:h,y:o,width:p,height:s})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,h=this.state,p=h.startX,m=h.endX,v=5,b={pointerEvents:"none",fill:u};return q.createElement(ft,{className:"recharts-brush-texts"},q.createElement(es,tp({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,m)-v,y:o+s/2},b),this.getTextOfTick(a)),q.createElement(es,tp({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,m)+l+v,y:o+s/2},b),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,s=n.x,l=n.y,u=n.width,h=n.height,p=n.alwaysShowText,m=this.state,v=m.startX,b=m.endX,g=m.isTextActive,x=m.isSlideMoving,S=m.isTravellerMoving,O=m.isTravellerFocused;if(!a||!a.length||!ce(s)||!ce(l)||!ce(u)||!ce(h)||u<=0||h<=0)return null;var j=Ke("recharts-brush",i),P=q.Children.count(o)===1,A=Ide("userSelect","none");return q.createElement(ft,{className:j,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),P&&this.renderPanorama(),this.renderSlide(v,b),this.renderTravellerLayer(v,"startX"),this.renderTravellerLayer(b,"endX"),(g||x||S||O||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(i+s/2)-1;return q.createElement(q.Fragment,null,q.createElement("rect",{x:a,y:i,width:o,height:s,fill:l,stroke:"none"}),q.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),q.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return q.isValidElement(n)?i=q.cloneElement(n,a):De(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,h=n.startIndex,p=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return ab({prevData:i,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},i&&i.length?Hde({data:i,width:o,x:s,travellerWidth:l,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||s!==a.prevX||l!==a.prevTravellerWidth)){a.scale.range([s,s+o-l]);var m=a.scale.domain().map(function(v){return a.scale(v)});return{prevData:i,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,s=i-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>a?s=l:o=l}return a>=n[s]?s:o}}])}(w.PureComponent);hn(_l,"displayName","Brush");hn(_l,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var ib,Ek;function Vde(){if(Ek)return ib;Ek=1;var e=YS();function t(r,n){var a;return e(r,function(i,o,s){return a=n(i,o,s),!a}),!!a}return ib=t,ib}var ob,kk;function zde(){if(kk)return ob;kk=1;var e=hL(),t=Wa(),r=Vde(),n=nn(),a=em();function i(o,s,l){var u=n(o)?e:r;return l&&a(o,s,l)&&(s=void 0),u(o,t(s,3))}return ob=i,ob}var Gde=zde();const Kde=jt(Gde);var ka=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},sb,Mk;function Yde(){if(Mk)return sb;Mk=1;var e=EL();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return sb=t,sb}var lb,Rk;function Xde(){if(Rk)return lb;Rk=1;var e=Yde(),t=NL(),r=Wa();function n(a,i){var o={};return i=r(i,3),t(a,function(s,l,u){e(o,l,i(s,l,u))}),o}return lb=n,lb}var Zde=Xde();const Jde=jt(Zde);var cb,Dk;function Qde(){if(Dk)return cb;Dk=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lhe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function che(e,t){var r=e.x,n=e.y,a=she(e,nhe),i="".concat(r),o=parseInt(i,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||a.height),h=parseInt(u,10),p="".concat(t.width||a.width),m=parseInt(p,10);return Ic(Ic(Ic(Ic(Ic({},t),a),o?{x:o}:{}),l?{y:l}:{}),{},{height:h,width:m,name:t.name,radius:t.radius})}function Fk(e){return q.createElement(dF,o1({shapeType:"rectangle",propTransformer:che,activeClassName:"recharts-active-bar"},e))}var uhe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=typeof n=="number";return i?t(n,a):(i||rs(),r)}},fhe=["value","background"],bF;function Al(e){"@babel/helpers - typeof";return Al=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Al(e)}function dhe(e,t){if(e==null)return{};var r=hhe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hhe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function np(){return np=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(F)0&&Math.abs($)0&&(L=Math.min((Re||0)-($[qe-1]||0),L))}),Number.isFinite(L)){var F=L/I,z=g.layout==="vertical"?n.height:n.width;if(g.padding==="gap"&&(N=F*z/2),g.padding==="no-gap"){var H=Wr(t.barCategoryGap,F*z),U=F*z/2;N=U-H-(U-H)/z*H}}}a==="xAxis"?k=[n.left+(j.left||0)+(N||0),n.left+n.width-(j.right||0)-(N||0)]:a==="yAxis"?k=l==="horizontal"?[n.top+n.height-(j.bottom||0),n.top+(j.top||0)]:[n.top+(j.top||0)+(N||0),n.top+n.height-(j.bottom||0)-(N||0)]:k=g.range,A&&(k=[k[1],k[0]]);var Y=U4(g,i,m),se=Y.scale,ne=Y.realScaleType;se.domain(S).range(k),H4(se);var ae=V4(se,ea(ea({},g),{},{realScaleType:ne}));a==="xAxis"?(E=x==="top"&&!P||x==="bottom"&&P,R=n.left,W=p[T]-E*g.height):a==="yAxis"&&(E=x==="left"&&!P||x==="right"&&P,R=p[T]-E*g.width,W=n.top);var ue=ea(ea(ea({},g),ae),{},{realScaleType:ne,x:R,y:W,scale:se,width:a==="xAxis"?n.width:g.width,height:a==="yAxis"?n.height:g.height});return ue.bandSize=Wh(ue,ae),!g.hide&&a==="xAxis"?p[T]+=(E?-1:1)*ue.height:g.hide||(p[T]+=(E?-1:1)*ue.width),ea(ea({},v),{},bm({},b,ue))},{})},AF=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},_he=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return AF({x:r,y:n},{x:a,y:i})},jF=function(){function e(t){whe(this,e),this.scale=t}return She(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(a){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();bm(jF,"EPS",1e-4);var _O=function(t){var r=Object.keys(t).reduce(function(n,a){return ea(ea({},n),{},bm({},a,jF.create(t[a])))},{});return ea(ea({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,s=i.position;return Jde(a,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(a){return xF(a,function(i,o){return r[o].isInRange(i)})}})};function Ahe(e){return(e%180+180)%180}var jhe=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Ahe(a),o=i*Math.PI/180,s=Math.atan(n/r),l=o>s&&o-1?l[u?i[h]:h]:void 0}}return db=n,db}var hb,Vk;function Phe(){if(Vk)return hb;Vk=1;var e=mF();function t(r){var n=e(r),a=n%1;return n===n?a?n-a:n:0}return hb=t,hb}var pb,zk;function Nhe(){if(zk)return pb;zk=1;var e=_L(),t=Wa(),r=Phe(),n=Math.max;function a(i,o,s){var l=i==null?0:i.length;if(!l)return-1;var u=s==null?0:r(s);return u<0&&(u=n(l+u,0)),e(i,t(o,3),u)}return pb=a,pb}var mb,Gk;function Che(){if(Gk)return mb;Gk=1;var e=The(),t=Nhe(),r=e(t);return mb=r,mb}var Ehe=Che();const khe=jt(Ehe);var Mhe=B$();const Rhe=jt(Mhe);var Dhe=Rhe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),AO=w.createContext(void 0),jO=w.createContext(void 0),TF=w.createContext(void 0),PF=w.createContext({}),NF=w.createContext(void 0),CF=w.createContext(0),EF=w.createContext(0),Kk=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=t.clipPathId,s=t.children,l=t.width,u=t.height,h=Dhe(i);return q.createElement(AO.Provider,{value:n},q.createElement(jO.Provider,{value:a},q.createElement(PF.Provider,{value:i},q.createElement(TF.Provider,{value:h},q.createElement(NF.Provider,{value:o},q.createElement(CF.Provider,{value:u},q.createElement(EF.Provider,{value:l},s)))))))},Ihe=function(){return w.useContext(NF)},kF=function(t){var r=w.useContext(AO);r==null&&rs();var n=r[t];return n==null&&rs(),n},$he=function(){var t=w.useContext(AO);return Zi(t)},Lhe=function(){var t=w.useContext(jO),r=khe(t,function(n){return xF(n.domain,Number.isFinite)});return r||Zi(t)},MF=function(t){var r=w.useContext(jO);r==null&&rs();var n=r[t];return n==null&&rs(),n},Fhe=function(){var t=w.useContext(TF);return t},Bhe=function(){return w.useContext(PF)},TO=function(){return w.useContext(EF)},PO=function(){return w.useContext(CF)};function jl(e){"@babel/helpers - typeof";return jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jl(e)}function Whe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qhe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function Ope(e,t){return BF(e,t+1)}function _pe(e,t,r,n,a){for(var i=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,h=o,p=function(){var b=n==null?void 0:n[l];if(b===void 0)return{v:BF(n,u)};var g=l,x,S=function(){return x===void 0&&(x=r(b,g)),x},O=b.coordinate,j=l===0||lp(e,O,S,h,s);j||(l=0,h=o,u+=1),j&&(h=O+e*(S()/2+a),l+=u)},m;u<=i.length;)if(m=p(),m)return m.v;return[]}function Wu(e){"@babel/helpers - typeof";return Wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wu(e)}function rM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Nr(e){for(var t=1;t0?v.coordinate-x*e:v.coordinate})}else i[m]=v=Nr(Nr({},v),{},{tickCoord:v.coordinate});var S=lp(e,v.tickCoord,g,s,l);S&&(l=v.tickCoord-e*(g()/2+a),i[m]=Nr(Nr({},v),{},{isShow:!0}))},h=o-1;h>=0;h--)u(h);return i}function Npe(e,t,r,n,a,i){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(i){var h=n[s-1],p=r(h,s-1),m=e*(h.coordinate+e*p/2-u);o[s-1]=h=Nr(Nr({},h),{},{tickCoord:m>0?h.coordinate-m*e:h.coordinate});var v=lp(e,h.tickCoord,function(){return p},l,u);v&&(u=h.tickCoord-e*(p/2+a),o[s-1]=Nr(Nr({},h),{},{isShow:!0}))}for(var b=i?s-1:s,g=function(O){var j=o[O],P,A=function(){return P===void 0&&(P=r(j,O)),P};if(O===0){var T=e*(j.coordinate-e*A()/2-l);o[O]=j=Nr(Nr({},j),{},{tickCoord:T<0?j.coordinate-T*e:j.coordinate})}else o[O]=j=Nr(Nr({},j),{},{tickCoord:j.coordinate});var N=lp(e,j.tickCoord,A,l,u);N&&(l=j.tickCoord+e*(A()/2+a),o[O]=Nr(Nr({},j),{},{isShow:!0}))},x=0;x=2?Br(a[1].coordinate-a[0].coordinate):1,S=Spe(i,x,v);return l==="equidistantPreserveStart"?_pe(x,S,g,a,o):(l==="preserveStart"||l==="preserveStartEnd"?m=Npe(x,S,g,a,o,l==="preserveStartEnd"):m=Ppe(x,S,g,a,o),m.filter(function(O){return O.isShow}))}var Cpe=["viewBox"],Epe=["viewBox"],kpe=["ticks"];function Nl(e){"@babel/helpers - typeof";return Nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nl(e)}function zs(){return zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Mpe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Rpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aM(e,t){for(var r=0;r0?l(this.props):l(v)),o<=0||s<=0||!b||!b.length?null:q.createElement(ft,{className:Ke("recharts-cartesian-axis",u),ref:function(x){n.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),yr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o;return q.isValidElement(n)?o=q.cloneElement(n,a):De(n)?o=n(a):o=q.createElement(es,zs({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(w.Component);EO(Ql,"displayName","CartesianAxis");EO(Ql,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Wpe=["x1","y1","x2","y2","key"],qpe=["offset"];function ns(e){"@babel/helpers - typeof";return ns=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ns(e)}function iM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function kr(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zpe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Gpe=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,o=t.width,s=t.height,l=t.ry;return q.createElement("rect",{x:a,y:i,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function UF(e,t){var r;if(q.isValidElement(e))r=q.cloneElement(e,t);else if(De(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,o=t.y2,s=t.key,l=oM(t,Wpe),u=Te(l,!1);u.offset;var h=oM(u,qpe);r=q.createElement("line",Wo({},h,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:s}))}return r}function Kpe(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(s,l){var u=kr(kr({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return UF(a,u)});return q.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Ype(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(s,l){var u=kr(kr({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return UF(a,u)});return q.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function Xpe(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,o=e.height,s=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var h=s.map(function(m){return Math.round(m+a-a)}).sort(function(m,v){return m-v});a!==h[0]&&h.unshift(0);var p=h.map(function(m,v){var b=!h[v+1],g=b?a+o-m:h[v+1]-m;if(g<=0)return null;var x=v%t.length;return q.createElement("rect",{key:"react-".concat(v),y:m,x:n,height:g,width:i,stroke:"none",fill:t[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return q.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function Zpe(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,s=e.width,l=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var h=u.map(function(m){return Math.round(m+i-i)}).sort(function(m,v){return m-v});i!==h[0]&&h.unshift(0);var p=h.map(function(m,v){var b=!h[v+1],g=b?i+s-m:h[v+1]-m;if(g<=0)return null;var x=v%n.length;return q.createElement("rect",{key:"react-".concat(v),x:m,y:o,width:g,height:l,stroke:"none",fill:n[x],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return q.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Jpe=function(t,r){var n=t.xAxis,a=t.width,i=t.height,o=t.offset;return q4(CO(kr(kr(kr({},Ql.defaultProps),n),{},{ticks:ci(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},Qpe=function(t,r){var n=t.yAxis,a=t.width,i=t.height,o=t.offset;return q4(CO(kr(kr(kr({},Ql.defaultProps),n),{},{ticks:ci(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},Rs={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function qo(e){var t,r,n,a,i,o,s=TO(),l=PO(),u=Bhe(),h=kr(kr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Rs.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Rs.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Rs.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Rs.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Rs.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Rs.verticalFill,x:ce(e.x)?e.x:u.left,y:ce(e.y)?e.y:u.top,width:ce(e.width)?e.width:u.width,height:ce(e.height)?e.height:u.height}),p=h.x,m=h.y,v=h.width,b=h.height,g=h.syncWithTicks,x=h.horizontalValues,S=h.verticalValues,O=$he(),j=Lhe();if(!ce(v)||v<=0||!ce(b)||b<=0||!ce(p)||p!==+p||!ce(m)||m!==+m)return null;var P=h.verticalCoordinatesGenerator||Jpe,A=h.horizontalCoordinatesGenerator||Qpe,T=h.horizontalPoints,N=h.verticalPoints;if((!T||!T.length)&&De(A)){var k=x&&x.length,R=A({yAxis:j?kr(kr({},j),{},{ticks:k?x:j.ticks}):void 0,width:s,height:l,offset:u},k?!0:g);ia(Array.isArray(R),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ns(R),"]")),Array.isArray(R)&&(T=R)}if((!N||!N.length)&&De(P)){var W=S&&S.length,E=P({xAxis:O?kr(kr({},O),{},{ticks:W?S:O.ticks}):void 0,width:s,height:l,offset:u},W?!0:g);ia(Array.isArray(E),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ns(E),"]")),Array.isArray(E)&&(N=E)}return q.createElement("g",{className:"recharts-cartesian-grid"},q.createElement(Gpe,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),q.createElement(Kpe,Wo({},h,{offset:u,horizontalPoints:T,xAxis:O,yAxis:j})),q.createElement(Ype,Wo({},h,{offset:u,verticalPoints:N,xAxis:O,yAxis:j})),q.createElement(Xpe,Wo({},h,{horizontalPoints:T})),q.createElement(Zpe,Wo({},h,{verticalPoints:N})))}qo.displayName="CartesianGrid";var eme=["type","layout","connectNulls","ref"],tme=["key"];function Cl(e){"@babel/helpers - typeof";return Cl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cl(e)}function sM(e,t){if(e==null)return{};var r=rme(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rme(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function tu(){return tu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rp){v=[].concat(Ds(l.slice(0,b)),[p-g]);break}var x=v.length%2===0?[0,m]:[m];return[].concat(Ds(t.repeat(l,h)),Ds(v),x).map(function(S){return"".concat(S,"px")}).join(", ")}),ta(r,"id",Gl("recharts-line-")),ta(r,"pathRef",function(o){r.mainCurve=o}),ta(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),ta(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return dme(t,e),lme(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,s=i.xAxis,l=i.yAxis,u=i.layout,h=i.children,p=wn(h,hf);if(!p)return null;var m=function(g,x){return{x:g.x,y:g.y,value:g.value,errorVal:cr(g.payload,x)}},v={clipPath:n?"url(#clipPath-".concat(a,")"):null};return q.createElement(ft,v,p.map(function(b){return q.cloneElement(b,{key:"bar-".concat(b.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:m})}))}},{key:"renderDots",value:function(n,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,h=s.dataKey,p=Te(this.props,!1),m=Te(l,!0),v=u.map(function(g,x){var S=dn(dn(dn({key:"dot-".concat(x),r:3},p),m),{},{value:g.value,dataKey:h,cx:g.x,cy:g.y,index:x,payload:g.payload});return t.renderDotItem(l,S)}),b={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return q.createElement(ft,tu({className:"recharts-line-dots",key:"dots"},b),v)}},{key:"renderCurveStatically",value:function(n,a,i,o){var s=this.props,l=s.type,u=s.layout,h=s.connectNulls;s.ref;var p=sM(s,eme),m=dn(dn(dn({},Te(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:h});return q.createElement(Hh,tu({},m,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,a){var i=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,h=o.animationBegin,p=o.animationDuration,m=o.animationEasing,v=o.animationId,b=o.animateNewValues,g=o.width,x=o.height,S=this.state,O=S.prevPoints,j=S.totalLength;return q.createElement($a,{begin:h,duration:p,isActive:u,easing:m,from:{t:0},to:{t:1},key:"line-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(P){var A=P.t;if(O){var T=O.length/s.length,N=s.map(function(I,L){var $=Math.floor(L*T);if(O[$]){var F=O[$],z=gn(F.x,I.x),H=gn(F.y,I.y);return dn(dn({},I),{},{x:z(A),y:H(A)})}if(b){var U=gn(g*2,I.x),Y=gn(x/2,I.y);return dn(dn({},I),{},{x:U(A),y:Y(A)})}return dn(dn({},I),{},{x:I.x,y:I.y})});return i.renderCurveStatically(N,n,a)}var k=gn(0,j),R=k(A),W;if(l){var E="".concat(l).split(/[,\s]+/gim).map(function(I){return parseFloat(I)});W=i.getStrokeDasharray(R,j,E)}else W=i.generateSimpleStrokeDasharray(j,R);return i.renderCurveStatically(s,n,a,{strokeDasharray:W})})}},{key:"renderCurve",value:function(n,a){var i=this.props,o=i.points,s=i.isAnimationActive,l=this.state,u=l.prevPoints,h=l.totalLength;return s&&o&&o.length&&(!u&&h>0||!df(u,o))?this.renderCurveWithAnimation(n,a):this.renderCurveStatically(o,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,s=a.points,l=a.className,u=a.xAxis,h=a.yAxis,p=a.top,m=a.left,v=a.width,b=a.height,g=a.isAnimationActive,x=a.id;if(i||!s||!s.length)return null;var S=this.state.isAnimationFinished,O=s.length===1,j=Ke("recharts-line",l),P=u&&u.allowDataOverflow,A=h&&h.allowDataOverflow,T=P||A,N=ze(x)?this.id:x,k=(n=Te(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},R=k.r,W=R===void 0?3:R,E=k.strokeWidth,I=E===void 0?2:E,L=ree(o)?o:{},$=L.clipDot,F=$===void 0?!0:$,z=W*2+I;return q.createElement(ft,{className:j},P||A?q.createElement("defs",null,q.createElement("clipPath",{id:"clipPath-".concat(N)},q.createElement("rect",{x:P?m:m-v/2,y:A?p:p-b/2,width:P?v:v*2,height:A?b:b*2})),!F&&q.createElement("clipPath",{id:"clipPath-dots-".concat(N)},q.createElement("rect",{x:m-z/2,y:p-z/2,width:v+z,height:b+z}))):null,!O&&this.renderCurve(T,N),this.renderErrorBar(T,N),(O||o)&&this.renderDots(T,F,N),(!g||S)&&hi.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:a.curPoints}:n.points!==a.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,a){for(var i=n.length%2!==0?[].concat(Ds(n),[0]):n,o=[],s=0;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ave(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&ce(a)&&ce(i)?t.slice(a,i+1):[]};function a3(e){return e==="number"?[0,"auto"]:void 0}var A1=function(t,r,n,a){var i=t.graphicalItems,o=t.tooltipAxis,s=jm(r,t);return n<0||!i||!i.length||n>=s.length?null:i.reduce(function(l,u){var h,p=(h=u.props.data)!==null&&h!==void 0?h:r;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(o.dataKey&&!o.allowDuplicatedCategory){var v=p===void 0?s:p;m=vh(v,o.dataKey,a)}else m=p&&p[n]||s[n];return m?[].concat(Rl(l),[G4(u,m)]):l},[])},vM=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},o=vve(i,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,h=Qse(o,s,u,l);if(h>=0&&u){var p=u[h]&&u[h].value,m=A1(t,r,h,p),v=gve(n,s,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:m,activeCoordinate:v}}return null},yve=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,h=t.layout,p=t.children,m=t.stackOffset,v=W4(h,i);return n.reduce(function(b,g){var x,S=g.type.defaultProps!==void 0?Q(Q({},g.type.defaultProps),g.props):g.props,O=S.type,j=S.dataKey,P=S.allowDataOverflow,A=S.allowDuplicatedCategory,T=S.scale,N=S.ticks,k=S.includeHidden,R=S[o];if(b[R])return b;var W=jm(t.data,{graphicalItems:a.filter(function(ae){var ue,Re=o in ae.props?ae.props[o]:(ue=ae.type.defaultProps)===null||ue===void 0?void 0:ue[o];return Re===R}),dataStartIndex:l,dataEndIndex:u}),E=W.length,I,L,$;Hme(S.domain,P,O)&&(I=Fw(S.domain,null,P),v&&(O==="number"||T!=="auto")&&($=Zc(W,j,"category")));var F=a3(O);if(!I||I.length===0){var z,H=(z=S.domain)!==null&&z!==void 0?z:F;if(j){if(I=Zc(W,j,O),O==="category"&&v){var U=GQ(I);A&&U?(L=I,I=ep(0,E)):A||(I=m2(H,I,g).reduce(function(ae,ue){return ae.indexOf(ue)>=0?ae:[].concat(Rl(ae),[ue])},[]))}else if(O==="category")A?I=I.filter(function(ae){return ae!==""&&!ze(ae)}):I=m2(H,I,g).reduce(function(ae,ue){return ae.indexOf(ue)>=0||ue===""||ze(ue)?ae:[].concat(Rl(ae),[ue])},[]);else if(O==="number"){var Y=ale(W,a.filter(function(ae){var ue,Re,qe=o in ae.props?ae.props[o]:(ue=ae.type.defaultProps)===null||ue===void 0?void 0:ue[o],ct="hide"in ae.props?ae.props.hide:(Re=ae.type.defaultProps)===null||Re===void 0?void 0:Re.hide;return qe===R&&(k||!ct)}),j,i,h);Y&&(I=Y)}v&&(O==="number"||T!=="auto")&&($=Zc(W,j,"category"))}else v?I=ep(0,E):s&&s[R]&&s[R].hasStack&&O==="number"?I=m==="expand"?[0,1]:z4(s[R].stackGroups,l,u):I=B4(W,a.filter(function(ae){var ue=o in ae.props?ae.props[o]:ae.type.defaultProps[o],Re="hide"in ae.props?ae.props.hide:ae.type.defaultProps.hide;return ue===R&&(k||!Re)}),O,h,!0);if(O==="number")I=S1(p,I,R,i,N),H&&(I=Fw(H,I,P));else if(O==="category"&&H){var se=H,ne=I.every(function(ae){return se.indexOf(ae)>=0});ne&&(I=se)}}return Q(Q({},b),{},Ee({},R,Q(Q({},S),{},{axisType:i,domain:I,categoricalDomain:$,duplicateDomain:L,originalDomain:(x=S.domain)!==null&&x!==void 0?x:F,isCategorical:v,layout:h})))},{})},xve=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,h=t.layout,p=t.children,m=jm(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),v=m.length,b=W4(h,i),g=-1;return n.reduce(function(x,S){var O=S.type.defaultProps!==void 0?Q(Q({},S.type.defaultProps),S.props):S.props,j=O[o],P=a3("number");if(!x[j]){g++;var A;return b?A=ep(0,v):s&&s[j]&&s[j].hasStack?(A=z4(s[j].stackGroups,l,u),A=S1(p,A,j,i)):(A=Fw(P,B4(m,n.filter(function(T){var N,k,R=o in T.props?T.props[o]:(N=T.type.defaultProps)===null||N===void 0?void 0:N[o],W="hide"in T.props?T.props.hide:(k=T.type.defaultProps)===null||k===void 0?void 0:k.hide;return R===j&&!W}),"number",h),a.defaultProps.allowDataOverflow),A=S1(p,A,j,i)),Q(Q({},x),{},Ee({},j,Q(Q({axisType:i},a.defaultProps),{},{hide:!0,orientation:bn(pve,"".concat(i,".").concat(g%2),null),domain:A,originalDomain:P,isCategorical:b,layout:h})))}return x},{})},bve=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,h=t.children,p="".concat(a,"Id"),m=wn(h,i),v={};return m&&m.length?v=yve(t,{axes:m,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(v=xve(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),v},wve=function(t){var r=Zi(t),n=ci(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:XS(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Wh(r,n)}},gM=function(t){var r=t.children,n=t.defaultShowTooltip,a=mn(r,_l),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Sve=function(t){return!t||!t.length?!1:t.some(function(r){var n=ui(r&&r.type);return n&&n.indexOf("Bar")>=0})},yM=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Ove=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,h=n.height,p=n.children,m=n.margin||{},v=mn(p,_l),b=mn(p,fi),g=Object.keys(l).reduce(function(A,T){var N=l[T],k=N.orientation;return!N.mirror&&!N.hide?Q(Q({},A),{},Ee({},k,A[k]+N.width)):A},{left:m.left||0,right:m.right||0}),x=Object.keys(o).reduce(function(A,T){var N=o[T],k=N.orientation;return!N.mirror&&!N.hide?Q(Q({},A),{},Ee({},k,bn(A,"".concat(k))+N.height)):A},{top:m.top||0,bottom:m.bottom||0}),S=Q(Q({},x),g),O=S.bottom;v&&(S.bottom+=v.props.height||_l.defaultProps.height),b&&r&&(S=rle(S,a,n,r));var j=u-S.left-S.right,P=h-S.top-S.bottom;return Q(Q({brushBottom:O},S),{},{width:Math.max(j,0),height:Math.max(P,0)})},_ve=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},kO=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,m=function(S,O){var j=O.graphicalItems,P=O.stackGroups,A=O.offset,T=O.updateId,N=O.dataStartIndex,k=O.dataEndIndex,R=S.barSize,W=S.layout,E=S.barGap,I=S.barCategoryGap,L=S.maxBarSize,$=yM(W),F=$.numericAxisName,z=$.cateAxisName,H=Sve(j),U=[];return j.forEach(function(Y,se){var ne=jm(S.data,{graphicalItems:[Y],dataStartIndex:N,dataEndIndex:k}),ae=Y.type.defaultProps!==void 0?Q(Q({},Y.type.defaultProps),Y.props):Y.props,ue=ae.dataKey,Re=ae.maxBarSize,qe=ae["".concat(F,"Id")],ct=ae["".concat(z,"Id")],we={},je=l.reduce(function(Pt,_t){var ir=O["".concat(_t.axisType,"Map")],wr=ae["".concat(_t.axisType,"Id")];ir&&ir[wr]||_t.axisType==="zAxis"||rs();var tr=ir[wr];return Q(Q({},Pt),{},Ee(Ee({},_t.axisType,tr),"".concat(_t.axisType,"Ticks"),ci(tr)))},we),le=je[z],pe=je["".concat(z,"Ticks")],he=P&&P[qe]&&P[qe].hasStack&&hle(Y,P[qe].stackGroups),Z=ui(Y.type).indexOf("Bar")>=0,Ue=Wh(le,pe),ie=[],ge=H&&ele({barSize:R,stackGroups:P,totalSize:_ve(je,z)});if(Z){var Ie,$e,vt=ze(Re)?L:Re,Ye=(Ie=($e=Wh(le,pe,!0))!==null&&$e!==void 0?$e:vt)!==null&&Ie!==void 0?Ie:0;ie=tle({barGap:E,barCategoryGap:I,bandSize:Ye!==Ue?Ye:Ue,sizeList:ge[ct],maxBarSize:vt}),Ye!==Ue&&(ie=ie.map(function(Pt){return Q(Q({},Pt),{},{position:Q(Q({},Pt.position),{},{offset:Pt.position.offset-Ye/2})})}))}var Tt=Y&&Y.type&&Y.type.getComposedData;Tt&&U.push({props:Q(Q({},Tt(Q(Q({},je),{},{displayedData:ne,props:S,dataKey:ue,item:Y,bandSize:Ue,barPosition:ie,offset:A,stackedData:he,layout:W,dataStartIndex:N,dataEndIndex:k}))),{},Ee(Ee(Ee({key:Y.key||"item-".concat(se)},F,je[F]),z,je[z]),"animationId",T)),childIndex:iee(Y,S.children),item:Y})}),U},v=function(S,O){var j=S.props,P=S.dataStartIndex,A=S.dataEndIndex,T=S.updateId;if(!NP({props:j}))return null;var N=j.children,k=j.layout,R=j.stackOffset,W=j.data,E=j.reverseStackOrder,I=yM(k),L=I.numericAxisName,$=I.cateAxisName,F=wn(N,n),z=fle(W,F,"".concat(L,"Id"),"".concat($,"Id"),R,E),H=l.reduce(function(ae,ue){var Re="".concat(ue.axisType,"Map");return Q(Q({},ae),{},Ee({},Re,bve(j,Q(Q({},ue),{},{graphicalItems:F,stackGroups:ue.axisType===L&&z,dataStartIndex:P,dataEndIndex:A}))))},{}),U=Ove(Q(Q({},H),{},{props:j,graphicalItems:F}),O==null?void 0:O.legendBBox);Object.keys(H).forEach(function(ae){H[ae]=h(j,H[ae],U,ae.replace("Map",""),r)});var Y=H["".concat($,"Map")],se=wve(Y),ne=m(j,Q(Q({},H),{},{dataStartIndex:P,dataEndIndex:A,updateId:T,graphicalItems:F,stackGroups:z,offset:U}));return Q(Q({formattedGraphicalItems:ne,graphicalItems:F,offset:U,stackGroups:z},se),H)},b=function(x){function S(O){var j,P,A;return nve(this,S),A=ove(this,S,[O]),Ee(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ee(A,"accessibilityManager",new Ume),Ee(A,"handleLegendBBoxUpdate",function(T){if(T){var N=A.state,k=N.dataStartIndex,R=N.dataEndIndex,W=N.updateId;A.setState(Q({legendBBox:T},v({props:A.props,dataStartIndex:k,dataEndIndex:R,updateId:W},Q(Q({},A.state),{},{legendBBox:T}))))}}),Ee(A,"handleReceiveSyncEvent",function(T,N,k){if(A.props.syncId===T){if(k===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(N)}}),Ee(A,"handleBrushChange",function(T){var N=T.startIndex,k=T.endIndex;if(N!==A.state.dataStartIndex||k!==A.state.dataEndIndex){var R=A.state.updateId;A.setState(function(){return Q({dataStartIndex:N,dataEndIndex:k},v({props:A.props,dataStartIndex:N,dataEndIndex:k,updateId:R},A.state))}),A.triggerSyncEvent({dataStartIndex:N,dataEndIndex:k})}}),Ee(A,"handleMouseEnter",function(T){var N=A.getMouseInfo(T);if(N){var k=Q(Q({},N),{},{isTooltipActive:!0});A.setState(k),A.triggerSyncEvent(k);var R=A.props.onMouseEnter;De(R)&&R(k,T)}}),Ee(A,"triggeredAfterMouseMove",function(T){var N=A.getMouseInfo(T),k=N?Q(Q({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(k),A.triggerSyncEvent(k);var R=A.props.onMouseMove;De(R)&&R(k,T)}),Ee(A,"handleItemMouseEnter",function(T){A.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),Ee(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),Ee(A,"handleMouseMove",function(T){T.persist(),A.throttleTriggeredAfterMouseMove(T)}),Ee(A,"handleMouseLeave",function(T){A.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};A.setState(N),A.triggerSyncEvent(N);var k=A.props.onMouseLeave;De(k)&&k(N,T)}),Ee(A,"handleOuterEvent",function(T){var N=aee(T),k=bn(A.props,"".concat(N));if(N&&De(k)){var R,W;/.*touch.*/i.test(N)?W=A.getMouseInfo(T.changedTouches[0]):W=A.getMouseInfo(T),k((R=W)!==null&&R!==void 0?R:{},T)}}),Ee(A,"handleClick",function(T){var N=A.getMouseInfo(T);if(N){var k=Q(Q({},N),{},{isTooltipActive:!0});A.setState(k),A.triggerSyncEvent(k);var R=A.props.onClick;De(R)&&R(k,T)}}),Ee(A,"handleMouseDown",function(T){var N=A.props.onMouseDown;if(De(N)){var k=A.getMouseInfo(T);N(k,T)}}),Ee(A,"handleMouseUp",function(T){var N=A.props.onMouseUp;if(De(N)){var k=A.getMouseInfo(T);N(k,T)}}),Ee(A,"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),Ee(A,"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&A.handleMouseDown(T.changedTouches[0])}),Ee(A,"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&A.handleMouseUp(T.changedTouches[0])}),Ee(A,"handleDoubleClick",function(T){var N=A.props.onDoubleClick;if(De(N)){var k=A.getMouseInfo(T);N(k,T)}}),Ee(A,"handleContextMenu",function(T){var N=A.props.onContextMenu;if(De(N)){var k=A.getMouseInfo(T);N(k,T)}}),Ee(A,"triggerSyncEvent",function(T){A.props.syncId!==void 0&&yb.emit(xb,A.props.syncId,T,A.eventEmitterSymbol)}),Ee(A,"applySyncEvent",function(T){var N=A.props,k=N.layout,R=N.syncMethod,W=A.state.updateId,E=T.dataStartIndex,I=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)A.setState(Q({dataStartIndex:E,dataEndIndex:I},v({props:A.props,dataStartIndex:E,dataEndIndex:I,updateId:W},A.state)));else if(T.activeTooltipIndex!==void 0){var L=T.chartX,$=T.chartY,F=T.activeTooltipIndex,z=A.state,H=z.offset,U=z.tooltipTicks;if(!H)return;if(typeof R=="function")F=R(U,T);else if(R==="value"){F=-1;for(var Y=0;Y=0){var he,Z;if(L.dataKey&&!L.allowDuplicatedCategory){var Ue=typeof L.dataKey=="function"?pe:"payload.".concat(L.dataKey.toString());he=vh(Y,Ue,F),Z=se&&ne&&vh(ne,Ue,F)}else he=Y==null?void 0:Y[$],Z=se&&ne&&ne[$];if(ct||qe){var ie=T.props.activeIndex!==void 0?T.props.activeIndex:$;return[w.cloneElement(T,Q(Q(Q({},R.props),je),{},{activeIndex:ie})),null,null]}if(!ze(he))return[le].concat(Rl(A.renderActivePoints({item:R,activePoint:he,basePoint:Z,childIndex:$,isRange:se})))}else{var ge,Ie=(ge=A.getItemByXY(A.state.activeCoordinate))!==null&&ge!==void 0?ge:{graphicalItem:le},$e=Ie.graphicalItem,vt=$e.item,Ye=vt===void 0?T:vt,Tt=$e.childIndex,Pt=Q(Q(Q({},R.props),je),{},{activeIndex:Tt});return[w.cloneElement(Ye,Pt),null,null]}return se?[le,null,null]:[le,null]}),Ee(A,"renderCustomized",function(T,N,k){return w.cloneElement(T,Q(Q({key:"recharts-customized-".concat(k)},A.props),A.state))}),Ee(A,"renderMap",{CartesianGrid:{handler:Dd,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Dd},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Dd},YAxis:{handler:Dd},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((j=O.id)!==null&&j!==void 0?j:Gl("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=$L(A.triggeredAfterMouseMove,(P=O.throttleDelay)!==null&&P!==void 0?P:1e3/60),A.state={},A}return cve(S,x),ive(S,[{key:"componentDidMount",value:function(){var j,P;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var j=this.props,P=j.children,A=j.data,T=j.height,N=j.layout,k=mn(P,Er);if(k){var R=k.props.defaultIndex;if(!(typeof R!="number"||R<0||R>this.state.tooltipTicks.length-1)){var W=this.state.tooltipTicks[R]&&this.state.tooltipTicks[R].value,E=A1(this.state,A,R,W),I=this.state.tooltipTicks[R].coordinate,L=(this.state.offset.top+T)/2,$=N==="horizontal",F=$?{x:I,y:L}:{y:I,x:L},z=this.state.formattedGraphicalItems.find(function(U){var Y=U.item;return Y.type.name==="Scatter"});z&&(F=Q(Q({},F),z.props.points[R].tooltipPosition),E=z.props.points[R].tooltipPayload);var H={activeTooltipIndex:R,isTooltipActive:!0,activeLabel:W,activePayload:E,activeCoordinate:F};this.setState(H),this.renderCursor(k),this.accessibilityManager.setIndex(R)}}}},{key:"getSnapshotBeforeUpdate",value:function(j,P){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==P.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==j.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==j.margin){var A,T;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(j){sw([mn(j.children,Er)],[mn(this.props.children,Er)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var j=mn(this.props.children,Er);if(j&&typeof j.props.shared=="boolean"){var P=j.props.shared?"axis":"item";return s.indexOf(P)>=0?P:i}return i}},{key:"getMouseInfo",value:function(j){if(!this.container)return null;var P=this.container,A=P.getBoundingClientRect(),T=Vne(A),N={chartX:Math.round(j.pageX-T.left),chartY:Math.round(j.pageY-T.top)},k=A.width/P.offsetWidth||1,R=this.inRange(N.chartX,N.chartY,k);if(!R)return null;var W=this.state,E=W.xAxisMap,I=W.yAxisMap,L=this.getTooltipEventType();if(L!=="axis"&&E&&I){var $=Zi(E).scale,F=Zi(I).scale,z=$&&$.invert?$.invert(N.chartX):null,H=F&&F.invert?F.invert(N.chartY):null;return Q(Q({},N),{},{xValue:z,yValue:H})}var U=vM(this.state,this.props.data,this.props.layout,R);return U?Q(Q({},N),U):null}},{key:"inRange",value:function(j,P){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,N=j/A,k=P/A;if(T==="horizontal"||T==="vertical"){var R=this.state.offset,W=N>=R.left&&N<=R.left+R.width&&k>=R.top&&k<=R.top+R.height;return W?{x:N,y:k}:null}var E=this.state,I=E.angleAxisMap,L=E.radiusAxisMap;if(I&&L){var $=Zi(I);return y2({x:N,y:k},$)}return null}},{key:"parseEventsOfWrapper",value:function(){var j=this.props.children,P=this.getTooltipEventType(),A=mn(j,Er),T={};A&&P==="axis"&&(A.props.trigger==="click"?T={onClick:this.handleClick}:T={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var N=gh(this.props,this.handleOuterEvent);return Q(Q({},N),T)}},{key:"addListener",value:function(){yb.on(xb,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){yb.removeListener(xb,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(j,P,A){for(var T=this.state.formattedGraphicalItems,N=0,k=T.length;Nb,Object.values(b));return f.jsx(g.Provider,{value:x,children:v})}function h(p,m){const v=(m==null?void 0:m[e][l])||s,b=w.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,h]}const a=()=>{const i=r.map(o=>w.createContext(o));return function(s){const l=(s==null?void 0:s[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return a.scopeName=e,[n,Tve(a,...t)]}function Tve(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((s,{useScope:l,scopeName:u})=>{const p=l(i)[`__scope${u}`];return{...s,...p}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var RO="Progress",DO=100,[Pve,mwe]=jve(RO),[Nve,Cve]=Pve(RO),i3=w.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:a,getValueLabel:i=Eve,...o}=e;(a||a===0)&&!xM(a)&&console.error(kve(`${a}`,"Progress"));const s=xM(a)?a:DO;n!==null&&!bM(n,s)&&console.error(Mve(`${n}`,"Progress"));const l=bM(n,s)?n:null,u=pp(l)?i(l,s):void 0;return f.jsx(Nve,{scope:r,value:l,max:s,children:f.jsx(Me.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":pp(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":l3(l,s),"data-value":l??void 0,"data-max":s,...o,ref:t})})});i3.displayName=RO;var o3="ProgressIndicator",s3=w.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,a=Cve(o3,r);return f.jsx(Me.div,{"data-state":l3(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:t})});s3.displayName=o3;function Eve(e,t){return`${Math.round(e/t*100)}%`}function l3(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function pp(e){return typeof e=="number"}function xM(e){return pp(e)&&!isNaN(e)&&e>0}function bM(e,t){return pp(e)&&!isNaN(e)&&e<=t&&e>=0}function kve(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${DO}\`.`}function Mve(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${DO} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. Defaulting to \`null\`.`}var c3=i3,Rve=s3;const u3=w.forwardRef(({className:e,value:t,...r},n)=>f.jsx(c3,{ref:n,className:de("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...r,children:f.jsx(Rve,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));u3.displayName=c3.displayName;const Dve=({agent:e,formatDuration:t})=>{const r=(e.answered/e.total*100).toFixed(1);return f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:e.name})}),f.jsxs(We,{className:"space-y-2",children:[f.jsxs("div",{className:"flex justify-between text-sm",children:[f.jsx("span",{className:"text-muted-foreground",children:"Answer Rate"}),f.jsxs("span",{className:"font-medium",children:[r,"%"]})]}),f.jsx(u3,{value:parseFloat(r),className:"h-2"}),f.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Calls"}),f.jsx("p",{className:"text-sm font-medium",children:e.total})]}),f.jsxs("div",{className:"space-y-1",children:[f.jsx("p",{className:"text-xs text-muted-foreground",children:"Avg Duration"}),f.jsx("p",{className:"text-sm font-medium",children:t(e.average_duration)})]}),f.jsxs("div",{className:"space-y-1",children:[f.jsx("p",{className:"text-xs text-muted-foreground",children:"Answered"}),f.jsx("p",{className:"text-sm font-medium",children:e.answered})]}),f.jsxs("div",{className:"space-y-1",children:[f.jsx("p",{className:"text-xs text-muted-foreground",children:"Missed"}),f.jsx("p",{className:"text-sm font-medium",children:e.missed})]})]})]})]})},Ive=({onSearch:e,onExport:t})=>f.jsxs("div",{className:"flex items-center justify-between py-4",children:[f.jsx("div",{className:"flex items-center gap-2",children:f.jsxs("div",{className:"relative",children:[f.jsx($V,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),f.jsx(Yo,{placeholder:"Filter agents...",onChange:r=>e(r.target.value),className:"pl-8"})]})}),f.jsxs(xr,{variant:"outline",onClick:t,children:[f.jsx(jV,{className:"mr-2 h-4 w-4"}),"Export"]})]}),$c={inbound:"hsl(262.1 83.3% 57.8%)",outbound:"hsl(142.1 76.2% 36.3%)",missed:"hsl(47.9 95.8% 53.1%)",answered:"hsl(142.1 76.2% 36.3%)",duration:"hsl(221.2 83.2% 53.3%)"},$ve=[{label:"Today",value:"today"},{label:"Yesterday",value:"yesterday"},{label:"Last 7 Days",value:"last7days"},{label:"Last 30 Days",value:"last30days"},{label:"Last 90 Days",value:"last90days"}],Lve=5*60*1e3,ru=e=>{const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=e%60;return t>0?`${t}h ${r}m`:`${r}m ${n}s`},Is=({title:e,value:t,subtitle:r,icon:n,iconColor:a})=>f.jsx(PK,{children:f.jsxs(NK,{children:[f.jsx(CK,{asChild:!0,children:f.jsxs(Ae,{className:"bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsxs(rt,{className:"flex flex-row items-center justify-between pb-2 p-4",children:[f.jsx(st,{className:"text-sm font-medium text-gray-600 dark:text-gray-300",children:e}),f.jsx(n,{className:`h-4 w-4 ${a}`})]}),f.jsxs(We,{className:"p-4 pt-0",children:[f.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:t}),r&&f.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r})]})]})}),f.jsx(dI,{children:f.jsx("p",{children:e})})]})}),Id=({active:e,payload:t,label:r})=>e&&t&&t.length?f.jsx(Ae,{className:"p-3 shadow-lg bg-white dark:bg-gray-900/60 backdrop-blur-sm border-none",children:f.jsxs(We,{className:"p-0 space-y-2",children:[f.jsx("p",{className:"font-medium text-sm text-gray-900 dark:text-gray-100 border-b border-gray-100 dark:border-gray-800 pb-1 mb-2",children:r}),t.map((n,a)=>f.jsx("p",{className:"text-sm text-muted-foreground",children:`${n.name}: ${n.value}`},a))]})}):null,Fve=(e,t)=>{const r=["Name","Total Calls","Answered","Missed","Answer Rate","Avg Duration"],n=e.map(l=>[l.name,l.total,l.answered,l.missed,`${(l.answered/l.total*100).toFixed(1)}%`,ru(l.average_duration)]),a=[r.join(","),...n.map(l=>l.join(","))].join(` `),i=new Blob([a],{type:"text/csv;charset=utf-8;"}),o=document.createElement("a"),s=URL.createObjectURL(i);o.setAttribute("href",s),o.setAttribute("download",`${t}.csv`),o.style.visibility="hidden",document.body.appendChild(o),o.click(),document.body.removeChild(o)},Bve=({agents:e,onSort:t})=>{const[r,n]=w.useState({key:"total",direction:"desc"}),a=o=>{const s=r.key===o&&r.direction==="desc"?"asc":"desc";n({key:o,direction:s}),t(o,s)},i=({column:o})=>f.jsxs(xr,{variant:"ghost",size:"sm",onClick:()=>a(o),className:"flex items-center gap-1 hover:bg-transparent",children:[o.charAt(0).toUpperCase()+o.slice(1),f.jsx(Ws,{className:"h-4 w-4"})]});return f.jsxs(ua,{children:[f.jsx(fa,{children:f.jsxs(er,{className:"hover:bg-transparent",children:[f.jsx(Fe,{children:"Agent"}),f.jsx(Fe,{children:f.jsx(i,{column:"total"})}),f.jsx(Fe,{children:f.jsx(i,{column:"answered"})}),f.jsx(Fe,{children:f.jsx(i,{column:"missed"})}),f.jsx(Fe,{children:f.jsx(i,{column:"average_duration"})})]})}),f.jsx(da,{children:e.map(o=>f.jsxs(er,{className:"hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[f.jsx(Be,{className:"font-medium text-gray-900 dark:text-gray-100",children:o.name}),f.jsx(Be,{children:o.total}),f.jsx(Be,{className:"text-emerald-600 dark:text-emerald-400",children:o.answered}),f.jsx(Be,{className:"text-rose-600 dark:text-rose-400",children:o.missed}),f.jsx(Be,{className:"text-muted-foreground",children:ru(o.average_duration)})]},o.id))})]})},Wve=()=>{var N,k,R,W,E,I,L;const[e,t]=w.useState("last7days"),[r,n]=w.useState(null),[a,i]=w.useState(null),[o,s]=w.useState(!0),[l,u]=w.useState(null),[h,p]=w.useState({key:"total",direction:"desc"}),[m,v]=w.useState(""),[b,g]=w.useState("table"),x=$=>Array.isArray($)?$:[],S=r!=null&&r.by_users?Object.values(r.by_users).sort(($,F)=>(h.direction==="desc"?-1:1)*($[h.key]-F[h.key])):[],O=S.filter($=>$.name.toLowerCase().includes(m.toLowerCase())),j=$=>{try{const[F,z,H]=$.split("-").map(Number),U=new Date(Date.UTC(F,z-1,H));return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"America/New_York"}).format(U)}catch(F){return console.error("Date formatting error:",F,{dateString:$}),"Invalid Date"}},P=()=>{const $=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date);Fve(O,`aircall-agent-metrics-${$}`)},A={hourly:r!=null&&r.by_hour?r.by_hour.map(($,F)=>({hour:`${F.toString().padStart(2,"0")}:00`,calls:$||0})):[],missedReasons:r!=null&&r.by_missed_reason?Object.entries(r.by_missed_reason).map(([$,F])=>({reason:($||"").replace(/_/g," "),count:F||0})):[],daily:x(r==null?void 0:r.daily_data).map($=>({...$,inbound:$.inbound||0,outbound:$.outbound||0,date:$.date||""}))};r!=null&&r.by_hour&&r.by_hour.indexOf(Math.max(...r.by_hour)),(S==null?void 0:S.length)>0&&S[0],(N=S==null?void 0:S.filter($=>$.total>0))==null||N.sort(($,F)=>F.answered/F.total-$.answered/$.total)[0];const T=async()=>{var $;try{s(!0);const F=await fetch(`/api/aircall/metrics/${e}`);if(!F.ok)throw new Error("Failed to fetch metrics");const z=await F.json();n(z),i(($=z._meta)==null?void 0:$.generatedAt),u(null)}catch(F){u(F.message)}finally{s(!1)}};return w.useEffect(()=>{T();const $=setInterval(T,Lve);return()=>clearInterval($)},[e]),l?f.jsx(TS,{variant:"destructive",className:"m-4",children:f.jsxs(PS,{children:["Error loading call data: ",l]})}):f.jsx("div",{className:"space-y-6",children:f.jsxs(Ae,{className:"bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{className:"p-6",children:f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsxs("div",{children:[f.jsx(st,{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:"Aircall Analytics"}),a&&f.jsxs(Ko,{className:"mt-1",children:["Last updated: ",new Date(a).toLocaleString()]})]}),f.jsxs(su,{value:e,onValueChange:t,children:[f.jsx(ll,{className:"w-[180px] h-9",children:f.jsx(lu,{placeholder:"Select range"})}),f.jsx(cl,{children:$ve.map($=>f.jsx(lo,{value:$.value,children:$.label},$.value))})]})]})}),f.jsxs(We,{className:"p-6 pt-0 space-y-6",children:[f.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:o?[...Array(6)].map(($,F)=>f.jsx(Je,{className:"h-32 rounded-lg"},F)):r?f.jsxs(f.Fragment,{children:[f.jsx(Is,{title:"Total Calls",value:r.total,icon:MV,iconColor:"text-gray-500 dark:text-gray-400"}),f.jsx(Is,{title:"Inbound",value:r.by_direction.inbound,subtitle:`${(r.by_direction.inbound/r.total*100).toFixed(1)}%`,icon:RV,iconColor:"text-blue-500 dark:text-blue-400"}),f.jsx(Is,{title:"Outbound",value:r.by_direction.outbound,subtitle:`${(r.by_direction.outbound/r.total*100).toFixed(1)}%`,icon:IV,iconColor:"text-emerald-500 dark:text-emerald-400"}),f.jsx(Is,{title:"Missed",value:r.by_status.missed,subtitle:`${(r.by_status.missed/r.total*100).toFixed(1)}%`,icon:DV,iconColor:"text-rose-500 dark:text-rose-400"}),f.jsx(Is,{title:"Avg Duration",value:ru(r.average_duration),icon:oh,iconColor:"text-purple-500 dark:text-purple-400"}),f.jsx(Is,{title:"Answer Rate",value:`${(r.by_status.answered/r.total*100).toFixed(1)}%`,icon:VV,iconColor:"text-emerald-500 dark:text-emerald-400"})]}):null}),f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[f.jsxs(Ae,{className:"bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{children:f.jsx(st,{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Performance Summary"})}),f.jsxs(We,{className:"space-y-2",children:[f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Peak Hour"}),f.jsxs("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:[r==null?void 0:r.by_hour.indexOf(Math.max(...r.by_hour)),":00"]})]}),f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Busiest Agent"}),f.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:((k=S[0])==null?void 0:k.name)||"N/A"})]}),f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Best Answer Rate"}),f.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:((R=S.filter($=>$.total>0).sort(($,F)=>F.answered/F.total-$.answered/$.total)[0])==null?void 0:R.name)||"N/A"})]})]})]}),f.jsxs(Ae,{className:"bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{children:f.jsx(st,{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Time Period"})}),f.jsxs(We,{className:"space-y-2",children:[f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Date Range"}),f.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:((W=r==null?void 0:r.daily_data)==null?void 0:W.length)>0?f.jsxs(f.Fragment,{children:[j((E=r.daily_data[0])==null?void 0:E.date)," -"," ",j((I=r.daily_data[r.daily_data.length-1])==null?void 0:I.date)]}):"No data available"})]}),f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Avg Daily Calls"}),f.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:((L=r==null?void 0:r.daily_data)==null?void 0:L.length)>0?Math.round(r.total/r.daily_data.length):"N/A"})]}),f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Avg Duration"}),f.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:r!=null&&r.average_duration?ru(r.average_duration):"N/A"})]})]})]})]}),f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[f.jsxs(Ae,{className:"bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{children:f.jsx(st,{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Daily Call Volume"})}),f.jsx(We,{className:"h-[300px]",children:f.jsx(Lo,{width:"100%",height:"100%",children:f.jsxs(MO,{data:A.daily,children:[f.jsx(qo,{strokeDasharray:"3 3",className:"stroke-gray-200 dark:stroke-gray-700"}),f.jsx(Ta,{dataKey:"date",tick:{fontSize:12},className:"text-gray-600 dark:text-gray-300"}),f.jsx(na,{tick:{fontSize:12},className:"text-gray-600 dark:text-gray-300"}),f.jsx(Er,{content:f.jsx(Id,{})}),f.jsx(fi,{}),f.jsx(Xr,{type:"monotone",dataKey:"inbound",stroke:$c.inbound,name:"Inbound",strokeWidth:2,dot:!1}),f.jsx(Xr,{type:"monotone",dataKey:"outbound",stroke:$c.outbound,name:"Outbound",strokeWidth:2,dot:!1})]})})})]}),f.jsxs(Ae,{className:"bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{children:f.jsx(st,{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Call Duration Distribution"})}),f.jsx(We,{className:"h-[300px]",children:f.jsx(Lo,{width:"100%",height:"100%",children:f.jsxs(Jd,{data:(r==null?void 0:r.duration_distribution)||[],children:[f.jsx(qo,{strokeDasharray:"3 3",className:"stroke-gray-200 dark:stroke-gray-700"}),f.jsx(Ta,{dataKey:"range",className:"text-gray-600 dark:text-gray-300"}),f.jsx(na,{className:"text-gray-600 dark:text-gray-300"}),f.jsx(Er,{content:f.jsx(Id,{})}),f.jsx(Ma,{dataKey:"count",fill:$c.duration})]})})})]}),f.jsxs(Ae,{className:"bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{children:f.jsx(st,{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Missed Call Reasons"})}),f.jsx(We,{className:"h-[300px]",children:f.jsx(Lo,{width:"100%",height:"100%",children:f.jsxs(Jd,{data:A.missedReasons,layout:"vertical",children:[f.jsx(qo,{strokeDasharray:"3 3",className:"stroke-gray-200 dark:stroke-gray-700"}),f.jsx(Ta,{type:"number",className:"text-gray-600 dark:text-gray-300"}),f.jsx(na,{dataKey:"reason",type:"category",width:150,className:"text-gray-600 dark:text-gray-300"}),f.jsx(Er,{content:f.jsx(Id,{})}),f.jsx(Ma,{dataKey:"count",fill:$c.missed})]})})})]}),f.jsxs(Ae,{className:"bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{children:f.jsx(st,{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Hourly Distribution"})}),f.jsx(We,{className:"h-[300px]",children:f.jsx(Lo,{width:"100%",height:"100%",children:f.jsxs(Jd,{data:A.hourly,children:[f.jsx(qo,{strokeDasharray:"3 3",className:"stroke-gray-200 dark:stroke-gray-700"}),f.jsx(Ta,{dataKey:"hour",tick:{fontSize:12},interval:2,className:"text-gray-600 dark:text-gray-300"}),f.jsx(na,{tick:{fontSize:12},className:"text-gray-600 dark:text-gray-300"}),f.jsx(Er,{content:f.jsx(Id,{})}),f.jsx(Ma,{dataKey:"calls",fill:$c.inbound,name:"Calls"})]})})})]})]}),f.jsxs(Ae,{className:"bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{children:f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx(st,{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Agent Performance"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(xr,{variant:b==="table"?"default":"outline",size:"sm",onClick:()=>g("table"),children:"Table"}),f.jsx(xr,{variant:b==="cards"?"default":"outline",size:"sm",onClick:()=>g("cards"),children:"Cards"})]})]})}),f.jsxs(We,{children:[f.jsx(Ive,{onSearch:v,onExport:P}),b==="table"?f.jsx(Bve,{agents:O,onSort:($,F)=>p({key:$,direction:F})}):f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:O.map($=>f.jsx(Dve,{agent:$,formatDuration:ru},$.id))})]})]})]})]})})};function f3(e,t){return function(){return e.apply(t,arguments)}}const{toString:qve}=Object.prototype,{getPrototypeOf:IO}=Object,Tm=(e=>t=>{const r=qve.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ma=e=>(e=e.toLowerCase(),t=>Tm(t)===e),Pm=e=>t=>typeof t===e,{isArray:ec}=Array,Hu=Pm("undefined");function Uve(e){return e!==null&&!Hu(e)&&e.constructor!==null&&!Hu(e.constructor)&&Sn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const d3=ma("ArrayBuffer");function Hve(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&d3(e.buffer),t}const Vve=Pm("string"),Sn=Pm("function"),h3=Pm("number"),Nm=e=>e!==null&&typeof e=="object",zve=e=>e===!0||e===!1,Qd=e=>{if(Tm(e)!=="object")return!1;const t=IO(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Gve=ma("Date"),Kve=ma("File"),Yve=ma("Blob"),Xve=ma("FileList"),Zve=e=>Nm(e)&&Sn(e.pipe),Jve=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Sn(e.append)&&((t=Tm(e))==="formdata"||t==="object"&&Sn(e.toString)&&e.toString()==="[object FormData]"))},Qve=ma("URLSearchParams"),[ege,tge,rge,nge]=["ReadableStream","Request","Response","Headers"].map(ma),age=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function pf(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,a;if(typeof e!="object"&&(e=[e]),ec(e))for(n=0,a=e.length;n0;)if(a=r[n],t===a.toLowerCase())return a;return null}const Uo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,m3=e=>!Hu(e)&&e!==Uo;function j1(){const{caseless:e}=m3(this)&&this||{},t={},r=(n,a)=>{const i=e&&p3(t,a)||a;Qd(t[i])&&Qd(n)?t[i]=j1(t[i],n):Qd(n)?t[i]=j1({},n):ec(n)?t[i]=n.slice():t[i]=n};for(let n=0,a=arguments.length;n(pf(t,(a,i)=>{r&&Sn(a)?e[i]=f3(a,r):e[i]=a},{allOwnKeys:n}),e),oge=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sge=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},lge=(e,t,r,n)=>{let a,i,o;const s={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)o=a[i],(!n||n(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=r!==!1&&IO(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},cge=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},uge=e=>{if(!e)return null;if(ec(e))return e;let t=e.length;if(!h3(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},fge=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&IO(Uint8Array)),dge=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let a;for(;(a=n.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},hge=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},pge=ma("HTMLFormElement"),mge=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),wM=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),vge=ma("RegExp"),v3=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};pf(r,(a,i)=>{let o;(o=t(a,i,e))!==!1&&(n[i]=o||a)}),Object.defineProperties(e,n)},gge=e=>{v3(e,(t,r)=>{if(Sn(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Sn(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},yge=(e,t)=>{const r={},n=a=>{a.forEach(i=>{r[i]=!0})};return ec(e)?n(e):n(String(e).split(t)),r},xge=()=>{},bge=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,wb="abcdefghijklmnopqrstuvwxyz",SM="0123456789",g3={DIGIT:SM,ALPHA:wb,ALPHA_DIGIT:wb+wb.toUpperCase()+SM},wge=(e=16,t=g3.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function Sge(e){return!!(e&&Sn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Oge=e=>{const t=new Array(10),r=(n,a)=>{if(Nm(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[a]=n;const i=ec(n)?[]:{};return pf(n,(o,s)=>{const l=r(o,a+1);!Hu(l)&&(i[s]=l)}),t[a]=void 0,i}}return n};return r(e,0)},_ge=ma("AsyncFunction"),Age=e=>e&&(Nm(e)||Sn(e))&&Sn(e.then)&&Sn(e.catch),y3=((e,t)=>e?setImmediate:t?((r,n)=>(Uo.addEventListener("message",({source:a,data:i})=>{a===Uo&&i===r&&n.length&&n.shift()()},!1),a=>{n.push(a),Uo.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Sn(Uo.postMessage)),jge=typeof queueMicrotask<"u"?queueMicrotask.bind(Uo):typeof process<"u"&&process.nextTick||y3,J={isArray:ec,isArrayBuffer:d3,isBuffer:Uve,isFormData:Jve,isArrayBufferView:Hve,isString:Vve,isNumber:h3,isBoolean:zve,isObject:Nm,isPlainObject:Qd,isReadableStream:ege,isRequest:tge,isResponse:rge,isHeaders:nge,isUndefined:Hu,isDate:Gve,isFile:Kve,isBlob:Yve,isRegExp:vge,isFunction:Sn,isStream:Zve,isURLSearchParams:Qve,isTypedArray:fge,isFileList:Xve,forEach:pf,merge:j1,extend:ige,trim:age,stripBOM:oge,inherits:sge,toFlatObject:lge,kindOf:Tm,kindOfTest:ma,endsWith:cge,toArray:uge,forEachEntry:dge,matchAll:hge,isHTMLForm:pge,hasOwnProperty:wM,hasOwnProp:wM,reduceDescriptors:v3,freezeMethods:gge,toObjectSet:yge,toCamelCase:mge,noop:xge,toFiniteNumber:bge,findKey:p3,global:Uo,isContextDefined:m3,ALPHABET:g3,generateString:wge,isSpecCompliantForm:Sge,toJSONObject:Oge,isAsyncFn:_ge,isThenable:Age,setImmediate:y3,asap:jge};function Ge(e,t,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status?a.status:null)}J.inherits(Ge,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:J.toJSONObject(this.config),code:this.code,status:this.status}}});const x3=Ge.prototype,b3={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{b3[e]={value:e}});Object.defineProperties(Ge,b3);Object.defineProperty(x3,"isAxiosError",{value:!0});Ge.from=(e,t,r,n,a,i)=>{const o=Object.create(x3);return J.toFlatObject(e,o,function(l){return l!==Error.prototype},s=>s!=="isAxiosError"),Ge.call(o,e.message,t,r,n,a),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const Tge=null;function T1(e){return J.isPlainObject(e)||J.isArray(e)}function w3(e){return J.endsWith(e,"[]")?e.slice(0,-2):e}function OM(e,t,r){return e?e.concat(t).map(function(a,i){return a=w3(a),!r&&i?"["+a+"]":a}).join(r?".":""):t}function Pge(e){return J.isArray(e)&&!e.some(T1)}const Nge=J.toFlatObject(J,{},null,function(t){return/^is[A-Z]/.test(t)});function Cm(e,t,r){if(!J.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=J.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,x){return!J.isUndefined(x[g])});const n=r.metaTokens,a=r.visitor||h,i=r.dots,o=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&J.isSpecCompliantForm(t);if(!J.isFunction(a))throw new TypeError("visitor must be a function");function u(b){if(b===null)return"";if(J.isDate(b))return b.toISOString();if(!l&&J.isBlob(b))throw new Ge("Blob is not supported. Use a Buffer instead.");return J.isArrayBuffer(b)||J.isTypedArray(b)?l&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function h(b,g,x){let S=b;if(b&&!x&&typeof b=="object"){if(J.endsWith(g,"{}"))g=n?g:g.slice(0,-2),b=JSON.stringify(b);else if(J.isArray(b)&&Pge(b)||(J.isFileList(b)||J.endsWith(g,"[]"))&&(S=J.toArray(b)))return g=w3(g),S.forEach(function(j,P){!(J.isUndefined(j)||j===null)&&t.append(o===!0?OM([g],P,i):o===null?g:g+"[]",u(j))}),!1}return T1(b)?!0:(t.append(OM(x,g,i),u(b)),!1)}const p=[],m=Object.assign(Nge,{defaultVisitor:h,convertValue:u,isVisitable:T1});function v(b,g){if(!J.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+g.join("."));p.push(b),J.forEach(b,function(S,O){(!(J.isUndefined(S)||S===null)&&a.call(t,S,J.isString(O)?O.trim():O,g,m))===!0&&v(S,g?g.concat(O):[O])}),p.pop()}}if(!J.isObject(e))throw new TypeError("data must be an object");return v(e),t}function _M(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function $O(e,t){this._pairs=[],e&&Cm(e,this,t)}const S3=$O.prototype;S3.append=function(t,r){this._pairs.push([t,r])};S3.toString=function(t){const r=t?function(n){return t.call(this,n,_M)}:_M;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function Cge(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function O3(e,t,r){if(!t)return e;const n=r&&r.encode||Cge;J.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let i;if(a?i=a(t,r):i=J.isURLSearchParams(t)?t.toString():new $O(t,r).toString(n),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class AM{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){J.forEach(this.handlers,function(n){n!==null&&t(n)})}}const _3={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ege=typeof URLSearchParams<"u"?URLSearchParams:$O,kge=typeof FormData<"u"?FormData:null,Mge=typeof Blob<"u"?Blob:null,Rge={isBrowser:!0,classes:{URLSearchParams:Ege,FormData:kge,Blob:Mge},protocols:["http","https","file","blob","url","data"]},LO=typeof window<"u"&&typeof document<"u",P1=typeof navigator=="object"&&navigator||void 0,Dge=LO&&(!P1||["ReactNative","NativeScript","NS"].indexOf(P1.product)<0),Ige=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",$ge=LO&&window.location.href||"http://localhost",Lge=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:LO,hasStandardBrowserEnv:Dge,hasStandardBrowserWebWorkerEnv:Ige,navigator:P1,origin:$ge},Symbol.toStringTag,{value:"Module"})),Mr={...Lge,...Rge};function Fge(e,t){return Cm(e,new Mr.classes.URLSearchParams,Object.assign({visitor:function(r,n,a,i){return Mr.isNode&&J.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Bge(e){return J.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Wge(e){const t={},r=Object.keys(e);let n;const a=r.length;let i;for(n=0;n=r.length;return o=!o&&J.isArray(a)?a.length:o,l?(J.hasOwnProp(a,o)?a[o]=[a[o],n]:a[o]=n,!s):((!a[o]||!J.isObject(a[o]))&&(a[o]=[]),t(r,n,a[o],i)&&J.isArray(a[o])&&(a[o]=Wge(a[o])),!s)}if(J.isFormData(e)&&J.isFunction(e.entries)){const r={};return J.forEachEntry(e,(n,a)=>{t(Bge(n),a,r,0)}),r}return null}function qge(e,t,r){if(J.isString(e))try{return(t||JSON.parse)(e),J.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(0,JSON.stringify)(e)}const mf={transitional:_3,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",a=n.indexOf("application/json")>-1,i=J.isObject(t);if(i&&J.isHTMLForm(t)&&(t=new FormData(t)),J.isFormData(t))return a?JSON.stringify(A3(t)):t;if(J.isArrayBuffer(t)||J.isBuffer(t)||J.isStream(t)||J.isFile(t)||J.isBlob(t)||J.isReadableStream(t))return t;if(J.isArrayBufferView(t))return t.buffer;if(J.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Fge(t,this.formSerializer).toString();if((s=J.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Cm(s?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||a?(r.setContentType("application/json",!1),qge(t)):t}],transformResponse:[function(t){const r=this.transitional||mf.transitional,n=r&&r.forcedJSONParsing,a=this.responseType==="json";if(J.isResponse(t)||J.isReadableStream(t))return t;if(t&&J.isString(t)&&(n&&!this.responseType||a)){const o=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?Ge.from(s,Ge.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mr.classes.FormData,Blob:Mr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};J.forEach(["delete","get","head","post","put","patch"],e=>{mf.headers[e]={}});const Uge=J.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Hge=e=>{const t={};let r,n,a;return e&&e.split(` `).forEach(function(o){a=o.indexOf(":"),r=o.substring(0,a).trim().toLowerCase(),n=o.substring(a+1).trim(),!(!r||t[r]&&Uge[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},jM=Symbol("internals");function Lc(e){return e&&String(e).trim().toLowerCase()}function eh(e){return e===!1||e==null?e:J.isArray(e)?e.map(eh):String(e)}function Vge(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const zge=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Sb(e,t,r,n,a){if(J.isFunction(n))return n.call(this,t,r);if(a&&(t=r),!!J.isString(t)){if(J.isString(n))return t.indexOf(n)!==-1;if(J.isRegExp(n))return n.test(t)}}function Gge(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Kge(e,t){const r=J.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(a,i,o){return this[n].call(this,t,a,i,o)},configurable:!0})})}class tn{constructor(t){t&&this.set(t)}set(t,r,n){const a=this;function i(s,l,u){const h=Lc(l);if(!h)throw new Error("header name must be a non-empty string");const p=J.findKey(a,h);(!p||a[p]===void 0||u===!0||u===void 0&&a[p]!==!1)&&(a[p||l]=eh(s))}const o=(s,l)=>J.forEach(s,(u,h)=>i(u,h,l));if(J.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(J.isString(t)&&(t=t.trim())&&!zge(t))o(Hge(t),r);else if(J.isHeaders(t))for(const[s,l]of t.entries())i(l,s,n);else t!=null&&i(r,t,n);return this}get(t,r){if(t=Lc(t),t){const n=J.findKey(this,t);if(n){const a=this[n];if(!r)return a;if(r===!0)return Vge(a);if(J.isFunction(r))return r.call(this,a,n);if(J.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Lc(t),t){const n=J.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Sb(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let a=!1;function i(o){if(o=Lc(o),o){const s=J.findKey(n,o);s&&(!r||Sb(n,n[s],s,r))&&(delete n[s],a=!0)}}return J.isArray(t)?t.forEach(i):i(t),a}clear(t){const r=Object.keys(this);let n=r.length,a=!1;for(;n--;){const i=r[n];(!t||Sb(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const r=this,n={};return J.forEach(this,(a,i)=>{const o=J.findKey(n,i);if(o){r[o]=eh(a),delete r[i];return}const s=t?Gge(i):String(i).trim();s!==i&&delete r[i],r[s]=eh(a),n[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return J.forEach(this,(n,a)=>{n!=null&&n!==!1&&(r[a]=t&&J.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(a=>n.set(a)),n}static accessor(t){const n=(this[jM]=this[jM]={accessors:{}}).accessors,a=this.prototype;function i(o){const s=Lc(o);n[s]||(Kge(a,o),n[s]=!0)}return J.isArray(t)?t.forEach(i):i(t),this}}tn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);J.reduceDescriptors(tn.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});J.freezeMethods(tn);function Ob(e,t){const r=this||mf,n=t||r,a=tn.from(n.headers);let i=n.data;return J.forEach(e,function(s){i=s.call(r,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function j3(e){return!!(e&&e.__CANCEL__)}function tc(e,t,r){Ge.call(this,e??"canceled",Ge.ERR_CANCELED,t,r),this.name="CanceledError"}J.inherits(tc,Ge,{__CANCEL__:!0});function T3(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Ge("Request failed with status code "+r.status,[Ge.ERR_BAD_REQUEST,Ge.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Yge(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xge(e,t){e=e||10;const r=new Array(e),n=new Array(e);let a=0,i=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),h=n[i];o||(o=u),r[a]=l,n[a]=u;let p=i,m=0;for(;p!==a;)m+=r[p++],p=p%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),u-o{r=h,a=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const h=Date.now(),p=h-r;p>=n?o(u,h):(a=u,i||(i=setTimeout(()=>{i=null,o(a)},n-p)))},()=>a&&o(a)]}const mp=(e,t,r=3)=>{let n=0;const a=Xge(50,250);return Zge(i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,l=o-n,u=a(l),h=o<=s;n=o;const p={loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&h?(s-o)/u:void 0,event:i,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(p)},r)},TM=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},PM=e=>(...t)=>J.asap(()=>e(...t)),Jge=Mr.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Mr.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Mr.origin),Mr.navigator&&/(msie|trident)/i.test(Mr.navigator.userAgent)):()=>!0,Qge=Mr.hasStandardBrowserEnv?{write(e,t,r,n,a,i){const o=[e+"="+encodeURIComponent(t)];J.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),J.isString(n)&&o.push("path="+n),J.isString(a)&&o.push("domain="+a),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function eye(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function tye(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function P3(e,t){return e&&!eye(t)?tye(e,t):t}const NM=e=>e instanceof tn?{...e}:e;function as(e,t){t=t||{};const r={};function n(u,h,p,m){return J.isPlainObject(u)&&J.isPlainObject(h)?J.merge.call({caseless:m},u,h):J.isPlainObject(h)?J.merge({},h):J.isArray(h)?h.slice():h}function a(u,h,p,m){if(J.isUndefined(h)){if(!J.isUndefined(u))return n(void 0,u,p,m)}else return n(u,h,p,m)}function i(u,h){if(!J.isUndefined(h))return n(void 0,h)}function o(u,h){if(J.isUndefined(h)){if(!J.isUndefined(u))return n(void 0,u)}else return n(void 0,h)}function s(u,h,p){if(p in t)return n(u,h);if(p in e)return n(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,h,p)=>a(NM(u),NM(h),p,!0)};return J.forEach(Object.keys(Object.assign({},e,t)),function(h){const p=l[h]||a,m=p(e[h],t[h],h);J.isUndefined(m)&&p!==s||(r[h]=m)}),r}const N3=e=>{const t=as({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:i,headers:o,auth:s}=t;t.headers=o=tn.from(o),t.url=O3(P3(t.baseURL,t.url),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let l;if(J.isFormData(r)){if(Mr.hasStandardBrowserEnv||Mr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...h]=l?l.split(";").map(p=>p.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...h].join("; "))}}if(Mr.hasStandardBrowserEnv&&(n&&J.isFunction(n)&&(n=n(t)),n||n!==!1&&Jge(t.url))){const u=a&&i&&Qge.read(i);u&&o.set(a,u)}return t},rye=typeof XMLHttpRequest<"u",nye=rye&&function(e){return new Promise(function(r,n){const a=N3(e);let i=a.data;const o=tn.from(a.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:u}=a,h,p,m,v,b;function g(){v&&v(),b&&b(),a.cancelToken&&a.cancelToken.unsubscribe(h),a.signal&&a.signal.removeEventListener("abort",h)}let x=new XMLHttpRequest;x.open(a.method.toUpperCase(),a.url,!0),x.timeout=a.timeout;function S(){if(!x)return;const j=tn.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),A={data:!s||s==="text"||s==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:j,config:e,request:x};T3(function(N){r(N),g()},function(N){n(N),g()},A),x=null}"onloadend"in x?x.onloadend=S:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(S)},x.onabort=function(){x&&(n(new Ge("Request aborted",Ge.ECONNABORTED,e,x)),x=null)},x.onerror=function(){n(new Ge("Network Error",Ge.ERR_NETWORK,e,x)),x=null},x.ontimeout=function(){let P=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const A=a.transitional||_3;a.timeoutErrorMessage&&(P=a.timeoutErrorMessage),n(new Ge(P,A.clarifyTimeoutError?Ge.ETIMEDOUT:Ge.ECONNABORTED,e,x)),x=null},i===void 0&&o.setContentType(null),"setRequestHeader"in x&&J.forEach(o.toJSON(),function(P,A){x.setRequestHeader(A,P)}),J.isUndefined(a.withCredentials)||(x.withCredentials=!!a.withCredentials),s&&s!=="json"&&(x.responseType=a.responseType),u&&([m,b]=mp(u,!0),x.addEventListener("progress",m)),l&&x.upload&&([p,v]=mp(l),x.upload.addEventListener("progress",p),x.upload.addEventListener("loadend",v)),(a.cancelToken||a.signal)&&(h=j=>{x&&(n(!j||j.type?new tc(null,e,x):j),x.abort(),x=null)},a.cancelToken&&a.cancelToken.subscribe(h),a.signal&&(a.signal.aborted?h():a.signal.addEventListener("abort",h)));const O=Yge(a.url);if(O&&Mr.protocols.indexOf(O)===-1){n(new Ge("Unsupported protocol "+O+":",Ge.ERR_BAD_REQUEST,e));return}x.send(i||null)})},aye=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,a;const i=function(u){if(!a){a=!0,s();const h=u instanceof Error?u:this.reason;n.abort(h instanceof Ge?h:new tc(h instanceof Error?h.message:h))}};let o=t&&setTimeout(()=>{o=null,i(new Ge(`timeout ${t} of ms exceeded`,Ge.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:l}=n;return l.unsubscribe=()=>J.asap(s),l}},iye=function*(e,t){let r=e.byteLength;if(r{const a=oye(e,t);let i=0,o,s=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:h}=await a.next();if(u){s(),l.close();return}let p=h.byteLength;if(r){let m=i+=p;r(m)}l.enqueue(new Uint8Array(h))}catch(u){throw s(u),u}},cancel(l){return s(l),a.return()}},{highWaterMark:2})},Em=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",C3=Em&&typeof ReadableStream=="function",lye=Em&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),E3=(e,...t)=>{try{return!!e(...t)}catch{return!1}},cye=C3&&E3(()=>{let e=!1;const t=new Request(Mr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),EM=64*1024,N1=C3&&E3(()=>J.isReadableStream(new Response("").body)),vp={stream:N1&&(e=>e.body)};Em&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!vp[t]&&(vp[t]=J.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new Ge(`Response type '${t}' is not supported`,Ge.ERR_NOT_SUPPORT,n)})})})(new Response);const uye=async e=>{if(e==null)return 0;if(J.isBlob(e))return e.size;if(J.isSpecCompliantForm(e))return(await new Request(Mr.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(J.isArrayBufferView(e)||J.isArrayBuffer(e))return e.byteLength;if(J.isURLSearchParams(e)&&(e=e+""),J.isString(e))return(await lye(e)).byteLength},fye=async(e,t)=>{const r=J.toFiniteNumber(e.getContentLength());return r??uye(t)},dye=Em&&(async e=>{let{url:t,method:r,data:n,signal:a,cancelToken:i,timeout:o,onDownloadProgress:s,onUploadProgress:l,responseType:u,headers:h,withCredentials:p="same-origin",fetchOptions:m}=N3(e);u=u?(u+"").toLowerCase():"text";let v=aye([a,i&&i.toAbortSignal()],o),b;const g=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let x;try{if(l&&cye&&r!=="get"&&r!=="head"&&(x=await fye(h,n))!==0){let A=new Request(t,{method:"POST",body:n,duplex:"half"}),T;if(J.isFormData(n)&&(T=A.headers.get("content-type"))&&h.setContentType(T),A.body){const[N,k]=TM(x,mp(PM(l)));n=CM(A.body,EM,N,k)}}J.isString(p)||(p=p?"include":"omit");const S="credentials"in Request.prototype;b=new Request(t,{...m,signal:v,method:r.toUpperCase(),headers:h.normalize().toJSON(),body:n,duplex:"half",credentials:S?p:void 0});let O=await fetch(b);const j=N1&&(u==="stream"||u==="response");if(N1&&(s||j&&g)){const A={};["status","statusText","headers"].forEach(R=>{A[R]=O[R]});const T=J.toFiniteNumber(O.headers.get("content-length")),[N,k]=s&&TM(T,mp(PM(s),!0))||[];O=new Response(CM(O.body,EM,N,()=>{k&&k(),g&&g()}),A)}u=u||"text";let P=await vp[J.findKey(vp,u)||"text"](O,e);return!j&&g&&g(),await new Promise((A,T)=>{T3(A,T,{data:P,headers:tn.from(O.headers),status:O.status,statusText:O.statusText,config:e,request:b})})}catch(S){throw g&&g(),S&&S.name==="TypeError"&&/fetch/i.test(S.message)?Object.assign(new Ge("Network Error",Ge.ERR_NETWORK,e,b),{cause:S.cause||S}):Ge.from(S,S&&S.code,e,b)}}),C1={http:Tge,xhr:nye,fetch:dye};J.forEach(C1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const kM=e=>`- ${e}`,hye=e=>J.isFunction(e)||e===null||e===!1,k3={getAdapter:e=>{e=J.isArray(e)?e:[e];const{length:t}=e;let r,n;const a={};for(let i=0;i`adapter ${s} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since : `+i.map(kM).join(` `):" "+kM(i[0]):"as no adapter specified";throw new Ge("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:C1};function _b(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tc(null,e)}function MM(e){return _b(e),e.headers=tn.from(e.headers),e.data=Ob.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),k3.getAdapter(e.adapter||mf.adapter)(e).then(function(n){return _b(e),n.data=Ob.call(e,e.transformResponse,n),n.headers=tn.from(n.headers),n},function(n){return j3(n)||(_b(e),n&&n.response&&(n.response.data=Ob.call(e,e.transformResponse,n.response),n.response.headers=tn.from(n.response.headers))),Promise.reject(n)})}const M3="1.7.9",km={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{km[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const RM={};km.transitional=function(t,r,n){function a(i,o){return"[Axios v"+M3+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,s)=>{if(t===!1)throw new Ge(a(o," has been removed"+(r?" in "+r:"")),Ge.ERR_DEPRECATED);return r&&!RM[o]&&(RM[o]=!0,console.warn(a(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,o,s):!0}};km.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function pye(e,t,r){if(typeof e!="object")throw new Ge("options must be an object",Ge.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let a=n.length;for(;a-- >0;){const i=n[a],o=t[i];if(o){const s=e[i],l=s===void 0||o(s,i,e);if(l!==!0)throw new Ge("option "+i+" must be "+l,Ge.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Ge("Unknown option "+i,Ge.ERR_BAD_OPTION)}}const th={assertOptions:pye,validators:km},Oa=th.validators;class Go{constructor(t){this.defaults=t,this.interceptors={request:new AM,response:new AM}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=` `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=as(this.defaults,r);const{transitional:n,paramsSerializer:a,headers:i}=r;n!==void 0&&th.assertOptions(n,{silentJSONParsing:Oa.transitional(Oa.boolean),forcedJSONParsing:Oa.transitional(Oa.boolean),clarifyTimeoutError:Oa.transitional(Oa.boolean)},!1),a!=null&&(J.isFunction(a)?r.paramsSerializer={serialize:a}:th.assertOptions(a,{encode:Oa.function,serialize:Oa.function},!0)),th.assertOptions(r,{baseUrl:Oa.spelling("baseURL"),withXsrfToken:Oa.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&J.merge(i.common,i[r.method]);i&&J.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=tn.concat(o,i);const s=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(r)===!1||(l=l&&g.synchronous,s.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let h,p=0,m;if(!l){const b=[MM.bind(this),void 0];for(b.unshift.apply(b,s),b.push.apply(b,u),m=b.length,h=Promise.resolve(r);p{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](a);n._listeners=null}),this.promise.then=a=>{let i;const o=new Promise(s=>{n.subscribe(s),i=s}).then(a);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,s){n.reason||(n.reason=new tc(i,o,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new FO(function(a){t=a}),cancel:t}}}function mye(e){return function(r){return e.apply(null,r)}}function vye(e){return J.isObject(e)&&e.isAxiosError===!0}const E1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(E1).forEach(([e,t])=>{E1[t]=e});function R3(e){const t=new Go(e),r=f3(Go.prototype.request,t);return J.extend(r,Go.prototype,t,{allOwnKeys:!0}),J.extend(r,t,null,{allOwnKeys:!0}),r.create=function(a){return R3(as(e,a))},r}const mt=R3(mf);mt.Axios=Go;mt.CanceledError=tc;mt.CancelToken=FO;mt.isCancel=j3;mt.VERSION=M3;mt.toFormData=Cm;mt.AxiosError=Ge;mt.Cancel=mt.CanceledError;mt.all=function(t){return Promise.all(t)};mt.spread=mye;mt.isAxiosError=vye;mt.mergeConfig=as;mt.AxiosHeaders=tn;mt.formToJSON=e=>A3(J.isHTMLForm(e)?new FormData(e):e);mt.getAdapter=k3.getAdapter;mt.HttpStatusCode=E1;mt.default=mt;class us extends Error{}class gye extends us{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class yye extends us{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class xye extends us{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Ks extends us{}class D3 extends us{constructor(t){super(`Invalid unit ${t}`)}}class Cr extends us{}class Hi extends us{constructor(){super("Zone is an abstract class")}}const ve="numeric",ha="short",On="long",gp={year:ve,month:ve,day:ve},I3={year:ve,month:ha,day:ve},bye={year:ve,month:ha,day:ve,weekday:ha},$3={year:ve,month:On,day:ve},L3={year:ve,month:On,day:ve,weekday:On},F3={hour:ve,minute:ve},B3={hour:ve,minute:ve,second:ve},W3={hour:ve,minute:ve,second:ve,timeZoneName:ha},q3={hour:ve,minute:ve,second:ve,timeZoneName:On},U3={hour:ve,minute:ve,hourCycle:"h23"},H3={hour:ve,minute:ve,second:ve,hourCycle:"h23"},V3={hour:ve,minute:ve,second:ve,hourCycle:"h23",timeZoneName:ha},z3={hour:ve,minute:ve,second:ve,hourCycle:"h23",timeZoneName:On},G3={year:ve,month:ve,day:ve,hour:ve,minute:ve},K3={year:ve,month:ve,day:ve,hour:ve,minute:ve,second:ve},Y3={year:ve,month:ha,day:ve,hour:ve,minute:ve},X3={year:ve,month:ha,day:ve,hour:ve,minute:ve,second:ve},wye={year:ve,month:ha,day:ve,weekday:ha,hour:ve,minute:ve},Z3={year:ve,month:On,day:ve,hour:ve,minute:ve,timeZoneName:ha},J3={year:ve,month:On,day:ve,hour:ve,minute:ve,second:ve,timeZoneName:ha},Q3={year:ve,month:On,day:ve,weekday:On,hour:ve,minute:ve,timeZoneName:On},e6={year:ve,month:On,day:ve,weekday:On,hour:ve,minute:ve,second:ve,timeZoneName:On};class vf{get type(){throw new Hi}get name(){throw new Hi}get ianaName(){return this.name}get isUniversal(){throw new Hi}offsetName(t,r){throw new Hi}formatOffset(t,r){throw new Hi}offset(t){throw new Hi}equals(t){throw new Hi}get isValid(){throw new Hi}}let Ab=null;class Mm extends vf{static get instance(){return Ab===null&&(Ab=new Mm),Ab}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:r,locale:n}){return c6(t,r,n)}formatOffset(t,r){return nu(this.offset(t),r)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let rh={};function Sye(e){return rh[e]||(rh[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),rh[e]}const Oye={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function _ye(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,a,i,o,s,l,u,h]=n;return[o,a,i,s,l,u,h]}function Aye(e,t){const r=e.formatToParts(t),n=[];for(let a=0;a=0?b:1e3+b,(m-v)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let DM={};function jye(e,t={}){const r=JSON.stringify([e,t]);let n=DM[r];return n||(n=new Intl.ListFormat(e,t),DM[r]=n),n}let k1={};function M1(e,t={}){const r=JSON.stringify([e,t]);let n=k1[r];return n||(n=new Intl.DateTimeFormat(e,t),k1[r]=n),n}let R1={};function Tye(e,t={}){const r=JSON.stringify([e,t]);let n=R1[r];return n||(n=new Intl.NumberFormat(e,t),R1[r]=n),n}let D1={};function Pye(e,t={}){const{base:r,...n}=t,a=JSON.stringify([e,n]);let i=D1[a];return i||(i=new Intl.RelativeTimeFormat(e,t),D1[a]=i),i}let Hc=null;function Nye(){return Hc||(Hc=new Intl.DateTimeFormat().resolvedOptions().locale,Hc)}let IM={};function Cye(e){let t=IM[e];if(!t){const r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,IM[e]=t}return t}function Eye(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const r=e.indexOf("-u-");if(r===-1)return[e];{let n,a;try{n=M1(e).resolvedOptions(),a=e}catch{const l=e.substring(0,r);n=M1(l).resolvedOptions(),a=l}const{numberingSystem:i,calendar:o}=n;return[a,i,o]}}function kye(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}function Mye(e){const t=[];for(let r=1;r<=12;r++){const n=_e.utc(2009,r,1);t.push(e(n))}return t}function Rye(e){const t=[];for(let r=1;r<=7;r++){const n=_e.utc(2016,11,13+r);t.push(e(n))}return t}function Ld(e,t,r,n){const a=e.listingMode();return a==="error"?null:a==="en"?r(t):n(t)}function Dye(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class Iye{constructor(t,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:a,floor:i,...o}=n;if(!r||Object.keys(o).length>0){const s={useGrouping:!1,...n};n.padTo>0&&(s.minimumIntegerDigits=n.padTo),this.inf=Tye(t,s)}}format(t){if(this.inf){const r=this.floor?Math.floor(t):t;return this.inf.format(r)}else{const r=this.floor?Math.floor(t):HO(t,3);return nr(r,this.padTo)}}}class $ye{constructor(t,r,n){this.opts=n,this.originalZone=void 0;let a;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const o=-1*(t.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&wi.create(s).valid?(a=s,this.dt=t):(a="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,a=t.zone.name):(a="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||a,this.dtf=M1(r,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(r=>{if(r.type==="timeZoneName"){const n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Lye{constructor(t,r,n){this.opts={style:"long",...n},!r&&s6()&&(this.rtf=Pye(t,n))}format(t,r){return this.rtf?this.rtf.format(t,r):s0e(r,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,r){return this.rtf?this.rtf.formatToParts(t,r):[]}}const Fye={firstDay:1,minimalDays:4,weekend:[6,7]};class bt{static fromOpts(t){return bt.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,r,n,a,i=!1){const o=t||Yt.defaultLocale,s=o||(i?"en-US":Nye()),l=r||Yt.defaultNumberingSystem,u=n||Yt.defaultOutputCalendar,h=I1(a)||Yt.defaultWeekSettings;return new bt(s,l,u,h,o)}static resetCache(){Hc=null,k1={},R1={},D1={}}static fromObject({locale:t,numberingSystem:r,outputCalendar:n,weekSettings:a}={}){return bt.create(t,r,n,a)}constructor(t,r,n,a,i){const[o,s,l]=Eye(t);this.locale=o,this.numberingSystem=r||s||null,this.outputCalendar=n||l||null,this.weekSettings=a,this.intl=kye(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Dye(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&r?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:bt.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,I1(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,r=!1){return Ld(this,t,d6,()=>{const n=r?{month:t,day:"numeric"}:{month:t},a=r?"format":"standalone";return this.monthsCache[a][t]||(this.monthsCache[a][t]=Mye(i=>this.extract(i,n,"month"))),this.monthsCache[a][t]})}weekdays(t,r=!1){return Ld(this,t,m6,()=>{const n=r?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},a=r?"format":"standalone";return this.weekdaysCache[a][t]||(this.weekdaysCache[a][t]=Rye(i=>this.extract(i,n,"weekday"))),this.weekdaysCache[a][t]})}meridiems(){return Ld(this,void 0,()=>v6,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[_e.utc(2016,11,13,9),_e.utc(2016,11,13,19)].map(r=>this.extract(r,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Ld(this,t,g6,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[_e.utc(-40,1,1),_e.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[t]})}extract(t,r,n){const a=this.dtFormatter(t,r),i=a.formatToParts(),o=i.find(s=>s.type.toLowerCase()===n);return o?o.value:null}numberFormatter(t={}){return new Iye(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,r={}){return new $ye(t,this.intl,r)}relFormatter(t={}){return new Lye(this.intl,this.isEnglish(),t)}listFormatter(t={}){return jye(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:l6()?Cye(this.locale):Fye}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let jb=null;class Ur extends vf{static get utcInstance(){return jb===null&&(jb=new Ur(0)),jb}static instance(t){return t===0?Ur.utcInstance:new Ur(t)}static parseSpecifier(t){if(t){const r=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new Ur(Im(r[1],r[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${nu(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${nu(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,r){return nu(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class Bye extends vf{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ji(e,t){if(Le(e)||e===null)return t;if(e instanceof vf)return e;if(zye(e)){const r=e.toLowerCase();return r==="default"?t:r==="local"||r==="system"?Mm.instance:r==="utc"||r==="gmt"?Ur.utcInstance:Ur.parseSpecifier(r)||wi.create(e)}else return ro(e)?Ur.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Bye(e)}const BO={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},$M={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Wye=BO.hanidec.replace(/[\[|\]]/g,"").split("");function qye(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r=i&&n<=o&&(t+=n-i)}}return parseInt(t,10)}else return t}let qs={};function Uye(){qs={}}function Zn({numberingSystem:e},t=""){const r=e||"latn";return qs[r]||(qs[r]={}),qs[r][t]||(qs[r][t]=new RegExp(`${BO[r]}${t}`)),qs[r][t]}let LM=()=>Date.now(),FM="system",BM=null,WM=null,qM=null,UM=60,HM,VM=null;class Yt{static get now(){return LM}static set now(t){LM=t}static set defaultZone(t){FM=t}static get defaultZone(){return Ji(FM,Mm.instance)}static get defaultLocale(){return BM}static set defaultLocale(t){BM=t}static get defaultNumberingSystem(){return WM}static set defaultNumberingSystem(t){WM=t}static get defaultOutputCalendar(){return qM}static set defaultOutputCalendar(t){qM=t}static get defaultWeekSettings(){return VM}static set defaultWeekSettings(t){VM=I1(t)}static get twoDigitCutoffYear(){return UM}static set twoDigitCutoffYear(t){UM=t%100}static get throwOnInvalid(){return HM}static set throwOnInvalid(t){HM=t}static resetCaches(){bt.resetCache(),wi.resetCache(),_e.resetCache(),Uye()}}class aa{constructor(t,r){this.reason=t,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const t6=[0,31,59,90,120,151,181,212,243,273,304,334],r6=[0,31,60,91,121,152,182,213,244,274,305,335];function Wn(e,t){return new aa("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function WO(e,t,r){const n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const a=n.getUTCDay();return a===0?7:a}function n6(e,t,r){return r+(gf(e)?r6:t6)[t-1]}function a6(e,t){const r=gf(e)?r6:t6,n=r.findIndex(i=>iVu(n,t,r)?(u=n+1,l=1):u=n,{weekYear:u,weekNumber:l,weekday:s,...$m(e)}}function zM(e,t=4,r=1){const{weekYear:n,weekNumber:a,weekday:i}=e,o=qO(WO(n,1,t),r),s=tl(n);let l=a*7+i-o-7+t,u;l<1?(u=n-1,l+=tl(u)):l>s?(u=n+1,l-=tl(n)):u=n;const{month:h,day:p}=a6(u,l);return{year:u,month:h,day:p,...$m(e)}}function Tb(e){const{year:t,month:r,day:n}=e,a=n6(t,r,n);return{year:t,ordinal:a,...$m(e)}}function GM(e){const{year:t,ordinal:r}=e,{month:n,day:a}=a6(t,r);return{year:t,month:n,day:a,...$m(e)}}function KM(e,t){if(!Le(e.localWeekday)||!Le(e.localWeekNumber)||!Le(e.localWeekYear)){if(!Le(e.weekday)||!Le(e.weekNumber)||!Le(e.weekYear))throw new Ks("Cannot mix locale-based week fields with ISO-based week fields");return Le(e.localWeekday)||(e.weekday=e.localWeekday),Le(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Le(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Hye(e,t=4,r=1){const n=Rm(e.weekYear),a=qn(e.weekNumber,1,Vu(e.weekYear,t,r)),i=qn(e.weekday,1,7);return n?a?i?!1:Wn("weekday",e.weekday):Wn("week",e.weekNumber):Wn("weekYear",e.weekYear)}function Vye(e){const t=Rm(e.year),r=qn(e.ordinal,1,tl(e.year));return t?r?!1:Wn("ordinal",e.ordinal):Wn("year",e.year)}function i6(e){const t=Rm(e.year),r=qn(e.month,1,12),n=qn(e.day,1,xp(e.year,e.month));return t?r?n?!1:Wn("day",e.day):Wn("month",e.month):Wn("year",e.year)}function o6(e){const{hour:t,minute:r,second:n,millisecond:a}=e,i=qn(t,0,23)||t===24&&r===0&&n===0&&a===0,o=qn(r,0,59),s=qn(n,0,59),l=qn(a,0,999);return i?o?s?l?!1:Wn("millisecond",a):Wn("second",n):Wn("minute",r):Wn("hour",t)}function Le(e){return typeof e>"u"}function ro(e){return typeof e=="number"}function Rm(e){return typeof e=="number"&&e%1===0}function zye(e){return typeof e=="string"}function Gye(e){return Object.prototype.toString.call(e)==="[object Date]"}function s6(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function l6(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Kye(e){return Array.isArray(e)?e:[e]}function YM(e,t,r){if(e.length!==0)return e.reduce((n,a)=>{const i=[t(a),a];return n&&r(n[0],i[0])===n[0]?n:i},null)[1]}function Yye(e,t){return t.reduce((r,n)=>(r[n]=e[n],r),{})}function Dl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function I1(e){if(e==null)return null;if(typeof e!="object")throw new Cr("Week settings must be an object");if(!qn(e.firstDay,1,7)||!qn(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!qn(t,1,7)))throw new Cr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function qn(e,t,r){return Rm(e)&&e>=t&&e<=r}function Xye(e,t){return e-t*Math.floor(e/t)}function nr(e,t=2){const r=e<0;let n;return r?n="-"+(""+-e).padStart(t,"0"):n=(""+e).padStart(t,"0"),n}function Yi(e){if(!(Le(e)||e===null||e===""))return parseInt(e,10)}function Eo(e){if(!(Le(e)||e===null||e===""))return parseFloat(e)}function UO(e){if(!(Le(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function HO(e,t,r=!1){const n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function gf(e){return e%4===0&&(e%100!==0||e%400===0)}function tl(e){return gf(e)?366:365}function xp(e,t){const r=Xye(t-1,12)+1,n=e+(t-r)/12;return r===2?gf(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function Dm(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function XM(e,t,r){return-qO(WO(e,1,t),r)+t-1}function Vu(e,t=4,r=1){const n=XM(e,t,r),a=XM(e+1,t,r);return(tl(e)-n+a)/7}function $1(e){return e>99?e:e>Yt.twoDigitCutoffYear?1900+e:2e3+e}function c6(e,t,r,n=null){const a=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(i.timeZone=n);const o={timeZoneName:t,...i},s=new Intl.DateTimeFormat(r,o).formatToParts(a).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function Im(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);const n=parseInt(t,10)||0,a=r<0||Object.is(r,-0)?-n:n;return r*60+a}function u6(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new Cr(`Invalid unit value ${e}`);return t}function bp(e,t){const r={};for(const n in e)if(Dl(e,n)){const a=e[n];if(a==null)continue;r[t(n)]=u6(a)}return r}function nu(e,t){const r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${nr(r,2)}:${nr(n,2)}`;case"narrow":return`${a}${r}${n>0?`:${n}`:""}`;case"techie":return`${a}${nr(r,2)}${nr(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function $m(e){return Yye(e,["hour","minute","second","millisecond"])}const Zye=["January","February","March","April","May","June","July","August","September","October","November","December"],f6=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Jye=["J","F","M","A","M","J","J","A","S","O","N","D"];function d6(e){switch(e){case"narrow":return[...Jye];case"short":return[...f6];case"long":return[...Zye];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const h6=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],p6=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Qye=["M","T","W","T","F","S","S"];function m6(e){switch(e){case"narrow":return[...Qye];case"short":return[...p6];case"long":return[...h6];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const v6=["AM","PM"],e0e=["Before Christ","Anno Domini"],t0e=["BC","AD"],r0e=["B","A"];function g6(e){switch(e){case"narrow":return[...r0e];case"short":return[...t0e];case"long":return[...e0e];default:return null}}function n0e(e){return v6[e.hour<12?0:1]}function a0e(e,t){return m6(t)[e.weekday-1]}function i0e(e,t){return d6(t)[e.month-1]}function o0e(e,t){return g6(t)[e.year<0?0:1]}function s0e(e,t,r="always",n=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(e)===-1;if(r==="auto"&&i){const p=e==="days";switch(t){case 1:return p?"tomorrow":`next ${a[e][0]}`;case-1:return p?"yesterday":`last ${a[e][0]}`;case 0:return p?"today":`this ${a[e][0]}`}}const o=Object.is(t,-0)||t<0,s=Math.abs(t),l=s===1,u=a[e],h=n?l?u[1]:u[2]||u[1]:l?a[e][0]:e;return o?`${s} ${h} ago`:`in ${s} ${h}`}function ZM(e,t){let r="";for(const n of e)n.literal?r+=n.val:r+=t(n.val);return r}const l0e={D:gp,DD:I3,DDD:$3,DDDD:L3,t:F3,tt:B3,ttt:W3,tttt:q3,T:U3,TT:H3,TTT:V3,TTTT:z3,f:G3,ff:Y3,fff:Z3,ffff:Q3,F:K3,FF:X3,FFF:J3,FFFF:e6};class Rr{static create(t,r={}){return new Rr(t,r)}static parseFormat(t){let r=null,n="",a=!1;const i=[];for(let o=0;o0&&i.push({literal:a||/^\s+$/.test(n),val:n}),r=null,n="",a=!a):a||s===r?n+=s:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=s,r=s)}return n.length>0&&i.push({literal:a||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(t){return l0e[t]}constructor(t,r){this.opts=r,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...r}).format()}dtFormatter(t,r={}){return this.loc.dtFormatter(t,{...this.opts,...r})}formatDateTime(t,r){return this.dtFormatter(t,r).format()}formatDateTimeParts(t,r){return this.dtFormatter(t,r).formatToParts()}formatInterval(t,r){return this.dtFormatter(t.start,r).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,r){return this.dtFormatter(t,r).resolvedOptions()}num(t,r=0){if(this.opts.forceSimple)return nr(t,r);const n={...this.opts};return r>0&&(n.padTo=r),this.loc.numberFormatter(n).format(t)}formatDateTimeFromString(t,r){const n=this.loc.listingMode()==="en",a=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(v,b)=>this.loc.extract(t,v,b),o=v=>t.isOffsetFixed&&t.offset===0&&v.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,v.format):"",s=()=>n?n0e(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(v,b)=>n?i0e(t,v):i(b?{month:v}:{month:v,day:"numeric"},"month"),u=(v,b)=>n?a0e(t,v):i(b?{weekday:v}:{weekday:v,month:"long",day:"numeric"},"weekday"),h=v=>{const b=Rr.macroTokenToFormatOpts(v);return b?this.formatWithSystemDefault(t,b):v},p=v=>n?o0e(t,v):i({era:v},"era"),m=v=>{switch(v){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return a?i({day:"numeric"},"day"):this.num(t.day);case"dd":return a?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return a?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return a?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return a?i({month:"numeric"},"month"):this.num(t.month);case"MM":return a?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return a?i({year:"numeric"},"year"):this.num(t.year);case"yy":return a?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return a?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return a?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return p("short");case"GG":return p("long");case"GGGGG":return p("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return h(v)}};return ZM(Rr.parseFormat(r),m)}formatDurationFromString(t,r){const n=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},a=l=>u=>{const h=n(u);return h?this.num(l.get(h),u.length):u},i=Rr.parseFormat(r),o=i.reduce((l,{literal:u,val:h})=>u?l:l.concat(h),[]),s=t.shiftTo(...o.map(n).filter(l=>l));return ZM(i,a(s))}}const y6=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function rc(...e){const t=e.reduce((r,n)=>r+n.source,"");return RegExp(`^${t}$`)}function nc(...e){return t=>e.reduce(([r,n,a],i)=>{const[o,s,l]=i(t,a);return[{...r,...o},s||n,l]},[{},null,1]).slice(0,2)}function ac(e,...t){if(e==null)return[null,null];for(const[r,n]of t){const a=r.exec(e);if(a)return n(a)}return[null,null]}function x6(...e){return(t,r)=>{const n={};let a;for(a=0;av!==void 0&&(b||v&&h)?-v:v;return[{years:m(Eo(r)),months:m(Eo(n)),weeks:m(Eo(a)),days:m(Eo(i)),hours:m(Eo(o)),minutes:m(Eo(s)),seconds:m(Eo(l),l==="-0"),milliseconds:m(UO(u),p)}]}const w0e={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function GO(e,t,r,n,a,i,o){const s={year:t.length===2?$1(Yi(t)):Yi(t),month:f6.indexOf(r)+1,day:Yi(n),hour:Yi(a),minute:Yi(i)};return o&&(s.second=Yi(o)),e&&(s.weekday=e.length>3?h6.indexOf(e)+1:p6.indexOf(e)+1),s}const S0e=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function O0e(e){const[,t,r,n,a,i,o,s,l,u,h,p]=e,m=GO(t,a,n,r,i,o,s);let v;return l?v=w0e[l]:u?v=0:v=Im(h,p),[m,new Ur(v)]}function _0e(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const A0e=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,j0e=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,T0e=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function JM(e){const[,t,r,n,a,i,o,s]=e;return[GO(t,a,n,r,i,o,s),Ur.utcInstance]}function P0e(e){const[,t,r,n,a,i,o,s]=e;return[GO(t,s,r,n,a,i,o),Ur.utcInstance]}const N0e=rc(u0e,zO),C0e=rc(f0e,zO),E0e=rc(d0e,zO),k0e=rc(w6),O6=nc(g0e,ic,yf,xf),M0e=nc(h0e,ic,yf,xf),R0e=nc(p0e,ic,yf,xf),D0e=nc(ic,yf,xf);function I0e(e){return ac(e,[N0e,O6],[C0e,M0e],[E0e,R0e],[k0e,D0e])}function $0e(e){return ac(_0e(e),[S0e,O0e])}function L0e(e){return ac(e,[A0e,JM],[j0e,JM],[T0e,P0e])}function F0e(e){return ac(e,[x0e,b0e])}const B0e=nc(ic);function W0e(e){return ac(e,[y0e,B0e])}const q0e=rc(m0e,v0e),U0e=rc(S6),H0e=nc(ic,yf,xf);function V0e(e){return ac(e,[q0e,O6],[U0e,H0e])}const QM="Invalid Duration",_6={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},z0e={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},..._6},Ln=146097/400,$s=146097/4800,G0e={years:{quarters:4,months:12,weeks:Ln/7,days:Ln,hours:Ln*24,minutes:Ln*24*60,seconds:Ln*24*60*60,milliseconds:Ln*24*60*60*1e3},quarters:{months:3,weeks:Ln/28,days:Ln/4,hours:Ln*24/4,minutes:Ln*24*60/4,seconds:Ln*24*60*60/4,milliseconds:Ln*24*60*60*1e3/4},months:{weeks:$s/7,days:$s,hours:$s*24,minutes:$s*24*60,seconds:$s*24*60*60,milliseconds:$s*24*60*60*1e3},..._6},Ho=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],K0e=Ho.slice(0).reverse();function Vi(e,t,r=!1){const n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new ot(n)}function A6(e,t){let r=t.milliseconds??0;for(const n of K0e.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function eR(e,t){const r=A6(e,t)<0?-1:1;Ho.reduceRight((n,a)=>{if(Le(t[a]))return n;if(n){const i=t[n]*r,o=e[a][n],s=Math.floor(i/o);t[a]+=s*r,t[n]-=s*o*r}return a},null),Ho.reduce((n,a)=>{if(Le(t[a]))return n;if(n){const i=t[n]%1;t[n]-=i,t[a]+=i*e[n][a]}return a},null)}function Y0e(e){const t={};for(const[r,n]of Object.entries(e))n!==0&&(t[r]=n);return t}class ot{constructor(t){const r=t.conversionAccuracy==="longterm"||!1;let n=r?G0e:z0e;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||bt.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,r){return ot.fromObject({milliseconds:t},r)}static fromObject(t,r={}){if(t==null||typeof t!="object")throw new Cr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new ot({values:bp(t,ot.normalizeUnit),loc:bt.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(t){if(ro(t))return ot.fromMillis(t);if(ot.isDuration(t))return t;if(typeof t=="object")return ot.fromObject(t);throw new Cr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,r){const[n]=F0e(t);return n?ot.fromObject(n,r):ot.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,r){const[n]=W0e(t);return n?ot.fromObject(n,r):ot.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,r=null){if(!t)throw new Cr("need to specify a reason the Duration is invalid");const n=t instanceof aa?t:new aa(t,r);if(Yt.throwOnInvalid)throw new xye(n);return new ot({invalid:n})}static normalizeUnit(t){const r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!r)throw new D3(t);return r}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,r={}){const n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Rr.create(this.loc,n).formatDurationFromString(this,t):QM}toHuman(t={}){if(!this.isValid)return QM;const r=Ho.map(n=>{const a=this.values[n];return Le(a)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:n.slice(0,-1)}).format(a)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=HO(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const r=this.toMillis();return r<0||r>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},_e.fromMillis(r,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?A6(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const r=ot.fromDurationLike(t),n={};for(const a of Ho)(Dl(r.values,a)||Dl(this.values,a))&&(n[a]=r.get(a)+this.get(a));return Vi(this,{values:n},!0)}minus(t){if(!this.isValid)return this;const r=ot.fromDurationLike(t);return this.plus(r.negate())}mapUnits(t){if(!this.isValid)return this;const r={};for(const n of Object.keys(this.values))r[n]=u6(t(this.values[n],n));return Vi(this,{values:r},!0)}get(t){return this[ot.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const r={...this.values,...bp(t,ot.normalizeUnit)};return Vi(this,{values:r})}reconfigure({locale:t,numberingSystem:r,conversionAccuracy:n,matrix:a}={}){const o={loc:this.loc.clone({locale:t,numberingSystem:r}),matrix:a,conversionAccuracy:n};return Vi(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return eR(this.matrix,t),Vi(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=Y0e(this.normalize().shiftToAll().toObject());return Vi(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>ot.normalizeUnit(o));const r={},n={},a=this.toObject();let i;for(const o of Ho)if(t.indexOf(o)>=0){i=o;let s=0;for(const u in n)s+=this.matrix[u][o]*n[u],n[u]=0;ro(a[o])&&(s+=a[o]);const l=Math.trunc(s);r[o]=l,n[o]=(s*1e3-l*1e3)/1e3}else ro(a[o])&&(n[o]=a[o]);for(const o in n)n[o]!==0&&(r[i]+=o===i?n[o]:n[o]/this.matrix[i][o]);return eR(this.matrix,r),Vi(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=this.values[r]===0?0:-this.values[r];return Vi(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function r(n,a){return n===void 0||n===0?a===void 0||a===0:n===a}for(const n of Ho)if(!r(this.values[n],t.values[n]))return!1;return!0}}const Ls="Invalid Interval";function X0e(e,t){return!e||!e.isValid?Kt.invalid("missing or invalid start"):!t||!t.isValid?Kt.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:r}={}){return this.isValid?Kt.fromDateTimes(t||this.s,r||this.e):this}splitAt(...t){if(!this.isValid)return[];const r=t.map(Fc).filter(o=>this.contains(o)).sort((o,s)=>o.toMillis()-s.toMillis()),n=[];let{s:a}=this,i=0;for(;a+this.e?this.e:o;n.push(Kt.fromDateTimes(a,s)),a=s,i+=1}return n}splitBy(t){const r=ot.fromDurationLike(t);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,a=1,i;const o=[];for(;nl*a));i=+s>+this.e?this.e:s,o.push(Kt.fromDateTimes(n,i)),n=i,a+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const r=this.s>t.s?this.s:t.s,n=this.e=n?null:Kt.fromDateTimes(r,n)}union(t){if(!this.isValid)return this;const r=this.st.e?this.e:t.e;return Kt.fromDateTimes(r,n)}static merge(t){const[r,n]=t.sort((a,i)=>a.s-i.s).reduce(([a,i],o)=>i?i.overlaps(o)||i.abutsStart(o)?[a,i.union(o)]:[a.concat([i]),o]:[a,o],[[],null]);return n&&r.push(n),r}static xor(t){let r=null,n=0;const a=[],i=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...i),s=o.sort((l,u)=>l.time-u.time);for(const l of s)n+=l.type==="s"?1:-1,n===1?r=l.time:(r&&+r!=+l.time&&a.push(Kt.fromDateTimes(r,l.time)),r=null);return Kt.merge(a)}difference(...t){return Kt.xor([this].concat(t)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ls}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=gp,r={}){return this.isValid?Rr.create(this.s.loc.clone(r),t).formatInterval(this):Ls}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Ls}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ls}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Ls}toFormat(t,{separator:r=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${r}${this.e.toFormat(t)}`:Ls}toDuration(t,r){return this.isValid?this.e.diff(this.s,t,r):ot.invalid(this.invalidReason)}mapEndpoints(t){return Kt.fromDateTimes(t(this.s),t(this.e))}}class Fd{static hasDST(t=Yt.defaultZone){const r=_e.now().setZone(t).set({month:12});return!t.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(t){return wi.isValidZone(t)}static normalizeZone(t){return Ji(t,Yt.defaultZone)}static getStartOfWeek({locale:t=null,locObj:r=null}={}){return(r||bt.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:r=null}={}){return(r||bt.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:r=null}={}){return(r||bt.create(t)).getWeekendDays().slice()}static months(t="long",{locale:r=null,numberingSystem:n=null,locObj:a=null,outputCalendar:i="gregory"}={}){return(a||bt.create(r,n,i)).months(t)}static monthsFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:a=null,outputCalendar:i="gregory"}={}){return(a||bt.create(r,n,i)).months(t,!0)}static weekdays(t="long",{locale:r=null,numberingSystem:n=null,locObj:a=null}={}){return(a||bt.create(r,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:a=null}={}){return(a||bt.create(r,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return bt.create(t).meridiems()}static eras(t="short",{locale:r=null}={}){return bt.create(r,null,"gregory").eras(t)}static features(){return{relative:s6(),localeWeek:l6()}}}function tR(e,t){const r=a=>a.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(ot.fromMillis(n).as("days"))}function Z0e(e,t,r){const n=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const h=tR(l,u);return(h-h%7)/7}],["days",tR]],a={},i=e;let o,s;for(const[l,u]of n)r.indexOf(l)>=0&&(o=l,a[l]=u(e,t),s=i.plus(a),s>t?(a[l]--,e=i.plus(a),e>t&&(s=e,a[l]--,e=i.plus(a))):e=s);return[e,a,s,o]}function J0e(e,t,r,n){let[a,i,o,s]=Z0e(e,t,r);const l=t-a,u=r.filter(p=>["hours","minutes","seconds","milliseconds"].indexOf(p)>=0);u.length===0&&(o0?ot.fromMillis(l,n).shiftTo(...u).plus(h):h}const Q0e="missing Intl.DateTimeFormat.formatToParts support";function pt(e,t=r=>r){return{regex:e,deser:([r])=>t(qye(r))}}const exe=" ",j6=`[ ${exe}]`,T6=new RegExp(j6,"g");function txe(e){return e.replace(/\./g,"\\.?").replace(T6,j6)}function rR(e){return e.replace(/\./g,"").replace(T6," ").toLowerCase()}function Jn(e,t){return e===null?null:{regex:RegExp(e.map(txe).join("|")),deser:([r])=>e.findIndex(n=>rR(r)===rR(n))+t}}function nR(e,t){return{regex:e,deser:([,r,n])=>Im(r,n),groups:t}}function Bd(e){return{regex:e,deser:([t])=>t}}function rxe(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function nxe(e,t){const r=Zn(t),n=Zn(t,"{2}"),a=Zn(t,"{3}"),i=Zn(t,"{4}"),o=Zn(t,"{6}"),s=Zn(t,"{1,2}"),l=Zn(t,"{1,3}"),u=Zn(t,"{1,6}"),h=Zn(t,"{1,9}"),p=Zn(t,"{2,4}"),m=Zn(t,"{4,6}"),v=x=>({regex:RegExp(rxe(x.val)),deser:([S])=>S,literal:!0}),g=(x=>{if(e.literal)return v(x);switch(x.val){case"G":return Jn(t.eras("short"),0);case"GG":return Jn(t.eras("long"),0);case"y":return pt(u);case"yy":return pt(p,$1);case"yyyy":return pt(i);case"yyyyy":return pt(m);case"yyyyyy":return pt(o);case"M":return pt(s);case"MM":return pt(n);case"MMM":return Jn(t.months("short",!0),1);case"MMMM":return Jn(t.months("long",!0),1);case"L":return pt(s);case"LL":return pt(n);case"LLL":return Jn(t.months("short",!1),1);case"LLLL":return Jn(t.months("long",!1),1);case"d":return pt(s);case"dd":return pt(n);case"o":return pt(l);case"ooo":return pt(a);case"HH":return pt(n);case"H":return pt(s);case"hh":return pt(n);case"h":return pt(s);case"mm":return pt(n);case"m":return pt(s);case"q":return pt(s);case"qq":return pt(n);case"s":return pt(s);case"ss":return pt(n);case"S":return pt(l);case"SSS":return pt(a);case"u":return Bd(h);case"uu":return Bd(s);case"uuu":return pt(r);case"a":return Jn(t.meridiems(),0);case"kkkk":return pt(i);case"kk":return pt(p,$1);case"W":return pt(s);case"WW":return pt(n);case"E":case"c":return pt(r);case"EEE":return Jn(t.weekdays("short",!1),1);case"EEEE":return Jn(t.weekdays("long",!1),1);case"ccc":return Jn(t.weekdays("short",!0),1);case"cccc":return Jn(t.weekdays("long",!0),1);case"Z":case"ZZ":return nR(new RegExp(`([+-]${s.source})(?::(${n.source}))?`),2);case"ZZZ":return nR(new RegExp(`([+-]${s.source})(${n.source})?`),2);case"z":return Bd(/[a-z_+-/]{1,256}?/i);case" ":return Bd(/[^\S\n\r]/);default:return v(x)}})(e)||{invalidReason:Q0e};return g.token=e,g}const axe={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function ixe(e,t,r){const{type:n,value:a}=e;if(n==="literal"){const l=/^\s+$/.test(a);return{literal:!l,val:l?" ":a}}const i=t[n];let o=n;n==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=r.hour12?"hour12":"hour24");let s=axe[o];if(typeof s=="object"&&(s=s[i]),s)return{literal:!1,val:s}}function oxe(e){return[`^${e.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,e]}function sxe(e,t,r){const n=e.match(t);if(n){const a={};let i=1;for(const o in r)if(Dl(r,o)){const s=r[o],l=s.groups?s.groups+1:1;!s.literal&&s.token&&(a[s.token.val[0]]=s.deser(n.slice(i,i+l))),i+=l}return[n,a]}else return[n,{}]}function lxe(e){const t=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let r=null,n;return Le(e.z)||(r=wi.create(e.z)),Le(e.Z)||(r||(r=new Ur(e.Z)),n=e.Z),Le(e.q)||(e.M=(e.q-1)*3+1),Le(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Le(e.u)||(e.S=UO(e.u)),[Object.keys(e).reduce((i,o)=>{const s=t(o);return s&&(i[s]=e[o]),i},{}),r,n]}let Pb=null;function cxe(){return Pb||(Pb=_e.fromMillis(1555555555555)),Pb}function uxe(e,t){if(e.literal)return e;const r=Rr.macroTokenToFormatOpts(e.val),n=E6(r,t);return n==null||n.includes(void 0)?e:n}function P6(e,t){return Array.prototype.concat(...e.map(r=>uxe(r,t)))}class N6{constructor(t,r){if(this.locale=t,this.format=r,this.tokens=P6(Rr.parseFormat(r),t),this.units=this.tokens.map(n=>nxe(n,t)),this.disqualifyingUnit=this.units.find(n=>n.invalidReason),!this.disqualifyingUnit){const[n,a]=oxe(this.units);this.regex=RegExp(n,"i"),this.handlers=a}}explainFromTokens(t){if(this.isValid){const[r,n]=sxe(t,this.regex,this.handlers),[a,i,o]=n?lxe(n):[null,null,void 0];if(Dl(n,"a")&&Dl(n,"H"))throw new Ks("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:r,matches:n,result:a,zone:i,specificOffset:o}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function C6(e,t,r){return new N6(e,r).explainFromTokens(t)}function fxe(e,t,r){const{result:n,zone:a,specificOffset:i,invalidReason:o}=C6(e,t,r);return[n,a,i,o]}function E6(e,t){if(!e)return null;const n=Rr.create(t,e).dtFormatter(cxe()),a=n.formatToParts(),i=n.resolvedOptions();return a.map(o=>ixe(o,e,i))}const Nb="Invalid DateTime",aR=864e13;function Vc(e){return new aa("unsupported zone",`the zone "${e.name}" is not supported`)}function Cb(e){return e.weekData===null&&(e.weekData=yp(e.c)),e.weekData}function Eb(e){return e.localWeekData===null&&(e.localWeekData=yp(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function ko(e,t){const r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new _e({...r,...t,old:r})}function k6(e,t,r){let n=e-t*60*1e3;const a=r.offset(n);if(t===a)return[n,t];n-=(a-t)*60*1e3;const i=r.offset(n);return a===i?[n,a]:[e-Math.min(a,i)*60*1e3,Math.max(a,i)]}function Wd(e,t){e+=t*60*1e3;const r=new Date(e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function nh(e,t,r){return k6(Dm(e),t,r)}function iR(e,t){const r=e.o,n=e.c.year+Math.trunc(t.years),a=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...e.c,year:n,month:a,day:Math.min(e.c.day,xp(n,a))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=ot.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=Dm(i);let[l,u]=k6(s,r,e.zone);return o!==0&&(l+=o,u=e.zone.offset(l)),{ts:l,o:u}}function Fs(e,t,r,n,a,i){const{setZone:o,zone:s}=r;if(e&&Object.keys(e).length!==0||t){const l=t||s,u=_e.fromObject(e,{...r,zone:l,specificOffset:i});return o?u:u.setZone(s)}else return _e.invalid(new aa("unparsable",`the input "${a}" can't be parsed as ${n}`))}function qd(e,t,r=!0){return e.isValid?Rr.create(bt.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function kb(e,t){const r=e.c.year>9999||e.c.year<0;let n="";return r&&e.c.year>=0&&(n+="+"),n+=nr(e.c.year,r?6:4),t?(n+="-",n+=nr(e.c.month),n+="-",n+=nr(e.c.day)):(n+=nr(e.c.month),n+=nr(e.c.day)),n}function oR(e,t,r,n,a,i){let o=nr(e.c.hour);return t?(o+=":",o+=nr(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(o+=":")):o+=nr(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(o+=nr(e.c.second),(e.c.millisecond!==0||!n)&&(o+=".",o+=nr(e.c.millisecond,3))),a&&(e.isOffsetFixed&&e.offset===0&&!i?o+="Z":e.o<0?(o+="-",o+=nr(Math.trunc(-e.o/60)),o+=":",o+=nr(Math.trunc(-e.o%60))):(o+="+",o+=nr(Math.trunc(e.o/60)),o+=":",o+=nr(Math.trunc(e.o%60)))),i&&(o+="["+e.zone.ianaName+"]"),o}const M6={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},dxe={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},hxe={ordinal:1,hour:0,minute:0,second:0,millisecond:0},R6=["year","month","day","hour","minute","second","millisecond"],pxe=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],mxe=["year","ordinal","hour","minute","second","millisecond"];function vxe(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new D3(e);return t}function sR(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return vxe(e)}}function gxe(e){return ih[e]||(ah===void 0&&(ah=Yt.now()),ih[e]=e.offset(ah)),ih[e]}function lR(e,t){const r=Ji(t.zone,Yt.defaultZone);if(!r.isValid)return _e.invalid(Vc(r));const n=bt.fromObject(t);let a,i;if(Le(e.year))a=Yt.now();else{for(const l of R6)Le(e[l])&&(e[l]=M6[l]);const o=i6(e)||o6(e);if(o)return _e.invalid(o);const s=gxe(r);[a,i]=nh(e,s,r)}return new _e({ts:a,zone:r,loc:n,o:i})}function cR(e,t,r){const n=Le(r.round)?!0:r.round,a=(o,s)=>(o=HO(o,n||r.calendary?0:2,!0),t.loc.clone(r).relFormatter(r).format(o,s)),i=o=>r.calendary?t.hasSame(e,o)?0:t.startOf(o).diff(e.startOf(o),o).get(o):t.diff(e,o).get(o);if(r.unit)return a(i(r.unit),r.unit);for(const o of r.units){const s=i(o);if(Math.abs(s)>=1)return a(s,o)}return a(e>t?-0:0,r.units[r.units.length-1])}function uR(e){let t={},r;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],r=Array.from(e).slice(0,e.length-1)):r=Array.from(e),[t,r]}let ah,ih={};class _e{constructor(t){const r=t.zone||Yt.defaultZone;let n=t.invalid||(Number.isNaN(t.ts)?new aa("invalid input"):null)||(r.isValid?null:Vc(r));this.ts=Le(t.ts)?Yt.now():t.ts;let a=null,i=null;if(!n)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(r))[a,i]=[t.old.c,t.old.o];else{const s=ro(t.o)&&!t.old?t.o:r.offset(this.ts);a=Wd(this.ts,s),n=Number.isNaN(a.year)?new aa("invalid input"):null,a=n?null:a,i=n?null:s}this._zone=r,this.loc=t.loc||bt.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=a,this.o=i,this.isLuxonDateTime=!0}static now(){return new _e({})}static local(){const[t,r]=uR(arguments),[n,a,i,o,s,l,u]=r;return lR({year:n,month:a,day:i,hour:o,minute:s,second:l,millisecond:u},t)}static utc(){const[t,r]=uR(arguments),[n,a,i,o,s,l,u]=r;return t.zone=Ur.utcInstance,lR({year:n,month:a,day:i,hour:o,minute:s,second:l,millisecond:u},t)}static fromJSDate(t,r={}){const n=Gye(t)?t.valueOf():NaN;if(Number.isNaN(n))return _e.invalid("invalid input");const a=Ji(r.zone,Yt.defaultZone);return a.isValid?new _e({ts:n,zone:a,loc:bt.fromObject(r)}):_e.invalid(Vc(a))}static fromMillis(t,r={}){if(ro(t))return t<-aR||t>aR?_e.invalid("Timestamp out of range"):new _e({ts:t,zone:Ji(r.zone,Yt.defaultZone),loc:bt.fromObject(r)});throw new Cr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,r={}){if(ro(t))return new _e({ts:t*1e3,zone:Ji(r.zone,Yt.defaultZone),loc:bt.fromObject(r)});throw new Cr("fromSeconds requires a numerical input")}static fromObject(t,r={}){t=t||{};const n=Ji(r.zone,Yt.defaultZone);if(!n.isValid)return _e.invalid(Vc(n));const a=bt.fromObject(r),i=bp(t,sR),{minDaysInFirstWeek:o,startOfWeek:s}=KM(i,a),l=Yt.now(),u=Le(r.specificOffset)?n.offset(l):r.specificOffset,h=!Le(i.ordinal),p=!Le(i.year),m=!Le(i.month)||!Le(i.day),v=p||m,b=i.weekYear||i.weekNumber;if((v||h)&&b)throw new Ks("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(m&&h)throw new Ks("Can't mix ordinal dates with month/day");const g=b||i.weekday&&!v;let x,S,O=Wd(l,u);g?(x=pxe,S=dxe,O=yp(O,o,s)):h?(x=mxe,S=hxe,O=Tb(O)):(x=R6,S=M6);let j=!1;for(const W of x){const E=i[W];Le(E)?j?i[W]=S[W]:i[W]=O[W]:j=!0}const P=g?Hye(i,o,s):h?Vye(i):i6(i),A=P||o6(i);if(A)return _e.invalid(A);const T=g?zM(i,o,s):h?GM(i):i,[N,k]=nh(T,u,n),R=new _e({ts:N,zone:n,o:k,loc:a});return i.weekday&&v&&t.weekday!==R.weekday?_e.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${R.toISO()}`):R.isValid?R:_e.invalid(R.invalid)}static fromISO(t,r={}){const[n,a]=I0e(t);return Fs(n,a,r,"ISO 8601",t)}static fromRFC2822(t,r={}){const[n,a]=$0e(t);return Fs(n,a,r,"RFC 2822",t)}static fromHTTP(t,r={}){const[n,a]=L0e(t);return Fs(n,a,r,"HTTP",r)}static fromFormat(t,r,n={}){if(Le(t)||Le(r))throw new Cr("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:i=null}=n,o=bt.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0}),[s,l,u,h]=fxe(o,t,r);return h?_e.invalid(h):Fs(s,l,n,`format ${r}`,t,u)}static fromString(t,r,n={}){return _e.fromFormat(t,r,n)}static fromSQL(t,r={}){const[n,a]=V0e(t);return Fs(n,a,r,"SQL",t)}static invalid(t,r=null){if(!t)throw new Cr("need to specify a reason the DateTime is invalid");const n=t instanceof aa?t:new aa(t,r);if(Yt.throwOnInvalid)throw new gye(n);return new _e({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,r={}){const n=E6(t,bt.fromObject(r));return n?n.map(a=>a?a.val:null).join(""):null}static expandFormat(t,r={}){return P6(Rr.parseFormat(t),bt.fromObject(r)).map(a=>a.val).join("")}static resetCache(){ah=void 0,ih={}}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Cb(this).weekYear:NaN}get weekNumber(){return this.isValid?Cb(this).weekNumber:NaN}get weekday(){return this.isValid?Cb(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Eb(this).weekday:NaN}get localWeekNumber(){return this.isValid?Eb(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Eb(this).weekYear:NaN}get ordinal(){return this.isValid?Tb(this.c).ordinal:NaN}get monthShort(){return this.isValid?Fd.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Fd.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Fd.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Fd.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,r=6e4,n=Dm(this.c),a=this.zone.offset(n-t),i=this.zone.offset(n+t),o=this.zone.offset(n-a*r),s=this.zone.offset(n-i*r);if(o===s)return[this];const l=n-o*r,u=n-s*r,h=Wd(l,o),p=Wd(u,s);return h.hour===p.hour&&h.minute===p.minute&&h.second===p.second&&h.millisecond===p.millisecond?[ko(this,{ts:l}),ko(this,{ts:u})]:[this]}get isInLeapYear(){return gf(this.year)}get daysInMonth(){return xp(this.year,this.month)}get daysInYear(){return this.isValid?tl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Vu(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Vu(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:r,numberingSystem:n,calendar:a}=Rr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:a}}toUTC(t=0,r={}){return this.setZone(Ur.instance(t),r)}toLocal(){return this.setZone(Yt.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(t=Ji(t,Yt.defaultZone),t.equals(this.zone))return this;if(t.isValid){let a=this.ts;if(r||n){const i=t.offset(this.ts),o=this.toObject();[a]=nh(o,i,t)}return ko(this,{ts:a,zone:t})}else return _e.invalid(Vc(t))}reconfigure({locale:t,numberingSystem:r,outputCalendar:n}={}){const a=this.loc.clone({locale:t,numberingSystem:r,outputCalendar:n});return ko(this,{loc:a})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const r=bp(t,sR),{minDaysInFirstWeek:n,startOfWeek:a}=KM(r,this.loc),i=!Le(r.weekYear)||!Le(r.weekNumber)||!Le(r.weekday),o=!Le(r.ordinal),s=!Le(r.year),l=!Le(r.month)||!Le(r.day),u=s||l,h=r.weekYear||r.weekNumber;if((u||o)&&h)throw new Ks("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new Ks("Can't mix ordinal dates with month/day");let p;i?p=zM({...yp(this.c,n,a),...r},n,a):Le(r.ordinal)?(p={...this.toObject(),...r},Le(r.day)&&(p.day=Math.min(xp(p.year,p.month),p.day))):p=GM({...Tb(this.c),...r});const[m,v]=nh(p,this.o,this.zone);return ko(this,{ts:m,o:v})}plus(t){if(!this.isValid)return this;const r=ot.fromDurationLike(t);return ko(this,iR(this,r))}minus(t){if(!this.isValid)return this;const r=ot.fromDurationLike(t).negate();return ko(this,iR(this,r))}startOf(t,{useLocaleWeeks:r=!1}={}){if(!this.isValid)return this;const n={},a=ot.normalizeUnit(t);switch(a){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(a==="weeks")if(r){const i=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),s=o?this:t,l=o?t:this,u=J0e(s,l,i,a);return o?u.negate():u}diffNow(t="milliseconds",r={}){return this.diff(_e.now(),t,r)}until(t){return this.isValid?Kt.fromDateTimes(this,t):this}hasSame(t,r,n){if(!this.isValid)return!1;const a=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(r,n)<=a&&a<=i.endOf(r,n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const r=t.base||_e.fromObject({},{zone:this.zone}),n=t.padding?thisr.valueOf(),Math.min)}static max(...t){if(!t.every(_e.isDateTime))throw new Cr("max requires all arguments be DateTimes");return YM(t,r=>r.valueOf(),Math.max)}static fromFormatExplain(t,r,n={}){const{locale:a=null,numberingSystem:i=null}=n,o=bt.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0});return C6(o,t,r)}static fromStringExplain(t,r,n={}){return _e.fromFormatExplain(t,r,n)}static buildFormatParser(t,r={}){const{locale:n=null,numberingSystem:a=null}=r,i=bt.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0});return new N6(i,t)}static fromFormatParser(t,r,n={}){if(Le(t)||Le(r))throw new Cr("fromFormatParser requires an input string and a format parser");const{locale:a=null,numberingSystem:i=null}=n,o=bt.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0});if(!o.equals(r.locale))throw new Cr(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${r.locale}`);const{result:s,zone:l,specificOffset:u,invalidReason:h}=r.explainFromTokens(t);return h?_e.invalid(h):Fs(s,l,n,`format ${r.format}`,t,u)}static get DATE_SHORT(){return gp}static get DATE_MED(){return I3}static get DATE_MED_WITH_WEEKDAY(){return bye}static get DATE_FULL(){return $3}static get DATE_HUGE(){return L3}static get TIME_SIMPLE(){return F3}static get TIME_WITH_SECONDS(){return B3}static get TIME_WITH_SHORT_OFFSET(){return W3}static get TIME_WITH_LONG_OFFSET(){return q3}static get TIME_24_SIMPLE(){return U3}static get TIME_24_WITH_SECONDS(){return H3}static get TIME_24_WITH_SHORT_OFFSET(){return V3}static get TIME_24_WITH_LONG_OFFSET(){return z3}static get DATETIME_SHORT(){return G3}static get DATETIME_SHORT_WITH_SECONDS(){return K3}static get DATETIME_MED(){return Y3}static get DATETIME_MED_WITH_SECONDS(){return X3}static get DATETIME_MED_WITH_WEEKDAY(){return wye}static get DATETIME_FULL(){return Z3}static get DATETIME_FULL_WITH_SECONDS(){return J3}static get DATETIME_HUGE(){return Q3}static get DATETIME_HUGE_WITH_SECONDS(){return e6}}function Fc(e){if(_e.isDateTime(e))return e;if(e&&e.valueOf&&ro(e.valueOf()))return _e.fromJSDate(e);if(e&&typeof e=="object")return _e.fromObject(e);throw new Cr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function yxe(e,t=[]){let r=[];function n(i,o){const s=w.createContext(o),l=r.length;r=[...r,o];function u(p){const{scope:m,children:v,...b}=p,g=(m==null?void 0:m[e][l])||s,x=w.useMemo(()=>b,Object.values(b));return f.jsx(g.Provider,{value:x,children:v})}function h(p,m){const v=(m==null?void 0:m[e][l])||s,b=w.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,h]}const a=()=>{const i=r.map(o=>w.createContext(o));return function(s){const l=(s==null?void 0:s[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return a.scopeName=e,[n,xxe(a,...t)]}function xxe(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((s,{useScope:l,scopeName:u})=>{const p=l(i)[`__scope${u}`];return{...s,...p}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Mb="rovingFocusGroup.onEntryFocus",bxe={bubbles:!1,cancelable:!0},Lm="RovingFocusGroup",[L1,D6,wxe]=q1(Lm),[Sxe,I6]=yxe(Lm,[wxe]),[Oxe,_xe]=Sxe(Lm),$6=w.forwardRef((e,t)=>f.jsx(L1.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(L1.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Axe,{...e,ref:t})})}));$6.displayName=Lm;var Axe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:h=!1,...p}=e,m=w.useRef(null),v=it(t,m),b=Fp(i),[g=null,x]=pi({prop:o,defaultProp:s,onChange:l}),[S,O]=w.useState(!1),j=Qt(u),P=D6(r),A=w.useRef(!1),[T,N]=w.useState(0);return w.useEffect(()=>{const k=m.current;if(k)return k.addEventListener(Mb,j),()=>k.removeEventListener(Mb,j)},[j]),f.jsx(Oxe,{scope:r,orientation:n,dir:b,loop:a,currentTabStopId:g,onItemFocus:w.useCallback(k=>x(k),[x]),onItemShiftTab:w.useCallback(()=>O(!0),[]),onFocusableItemAdd:w.useCallback(()=>N(k=>k+1),[]),onFocusableItemRemove:w.useCallback(()=>N(k=>k-1),[]),children:f.jsx(Me.div,{tabIndex:S||T===0?-1:0,"data-orientation":n,...p,ref:v,style:{outline:"none",...e.style},onMouseDown:be(e.onMouseDown,()=>{A.current=!0}),onFocus:be(e.onFocus,k=>{const R=!A.current;if(k.target===k.currentTarget&&R&&!S){const W=new CustomEvent(Mb,bxe);if(k.currentTarget.dispatchEvent(W),!W.defaultPrevented){const E=P().filter(z=>z.focusable),I=E.find(z=>z.active),L=E.find(z=>z.id===g),F=[I,L,...E].filter(Boolean).map(z=>z.ref.current);B6(F,h)}}A.current=!1}),onBlur:be(e.onBlur,()=>O(!1))})})}),L6="RovingFocusGroupItem",F6=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,...o}=e,s=Pa(),l=i||s,u=_xe(L6,r),h=u.currentTabStopId===l,p=D6(r),{onFocusableItemAdd:m,onFocusableItemRemove:v}=u;return w.useEffect(()=>{if(n)return m(),()=>v()},[n,m,v]),f.jsx(L1.ItemSlot,{scope:r,id:l,focusable:n,active:a,children:f.jsx(Me.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:be(e.onMouseDown,b=>{n?u.onItemFocus(l):b.preventDefault()}),onFocus:be(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:be(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const g=Pxe(b,u.orientation,u.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let S=p().filter(O=>O.focusable).map(O=>O.ref.current);if(g==="last")S.reverse();else if(g==="prev"||g==="next"){g==="prev"&&S.reverse();const O=S.indexOf(b.currentTarget);S=u.loop?Nxe(S,O+1):S.slice(O+1)}setTimeout(()=>B6(S))}})})})});F6.displayName=L6;var jxe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Txe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Pxe(e,t,r){const n=Txe(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return jxe[n]}function B6(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Nxe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Cxe=$6,Exe=F6,KO="Tabs",[kxe,vwe]=co(KO,[I6]),W6=I6(),[Mxe,YO]=kxe(KO),Rxe=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:s,activationMode:l="automatic",...u}=e,h=Fp(s),[p,m]=pi({prop:n,onChange:a,defaultProp:i});return f.jsx(Mxe,{scope:r,baseId:Pa(),value:p,onValueChange:m,orientation:o,dir:h,activationMode:l,children:f.jsx(Me.div,{dir:h,"data-orientation":o,...u,ref:t})})});Rxe.displayName=KO;var q6="TabsList",U6=w.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...a}=e,i=YO(q6,r),o=W6(r);return f.jsx(Cxe,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:f.jsx(Me.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});U6.displayName=q6;var H6="TabsTrigger",V6=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:a=!1,...i}=e,o=YO(H6,r),s=W6(r),l=K6(o.baseId,n),u=Y6(o.baseId,n),h=n===o.value;return f.jsx(Exe,{asChild:!0,...s,focusable:!a,active:h,children:f.jsx(Me.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":u,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:l,...i,ref:t,onMouseDown:be(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(n):p.preventDefault()}),onKeyDown:be(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(n)}),onFocus:be(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(n)})})})});V6.displayName=H6;var z6="TabsContent",G6=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:a,children:i,...o}=e,s=YO(z6,r),l=K6(s.baseId,n),u=Y6(s.baseId,n),h=n===s.value,p=w.useRef(h);return w.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),f.jsx(rn,{present:a||h,children:({present:m})=>f.jsx(Me.div,{"data-state":h?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});G6.displayName=z6;function K6(e,t){return`${e}-trigger-${t}`}function Y6(e,t){return`${e}-content-${t}`}var X6=U6,Z6=V6,J6=G6;const Dxe=w.forwardRef(({className:e,...t},r)=>f.jsx(X6,{ref:r,className:de("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Dxe.displayName=X6.displayName;const Ixe=w.forwardRef(({className:e,...t},r)=>f.jsx(Z6,{ref:r,className:de("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Ixe.displayName=Z6.displayName;const $xe=w.forwardRef(({className:e,...t},r)=>f.jsx(J6,{ref:r,className:de("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));$xe.displayName=J6.displayName;const Lxe=Ku("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function vr({className:e,variant:t,...r}){return f.jsx("div",{className:de(Lxe({variant:t}),e),...r})}function Fxe(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var XO="ScrollArea",[Q6,gwe]=co(XO),[Bxe,Vn]=Q6(XO),e5=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:a,scrollHideDelay:i=600,...o}=e,[s,l]=w.useState(null),[u,h]=w.useState(null),[p,m]=w.useState(null),[v,b]=w.useState(null),[g,x]=w.useState(null),[S,O]=w.useState(0),[j,P]=w.useState(0),[A,T]=w.useState(!1),[N,k]=w.useState(!1),R=it(t,E=>l(E)),W=Fp(a);return f.jsx(Bxe,{scope:r,type:n,dir:W,scrollHideDelay:i,scrollArea:s,viewport:u,onViewportChange:h,content:p,onContentChange:m,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:A,onScrollbarXEnabledChange:T,scrollbarY:g,onScrollbarYChange:x,scrollbarYEnabled:N,onScrollbarYEnabledChange:k,onCornerWidthChange:O,onCornerHeightChange:P,children:f.jsx(Me.div,{dir:W,...o,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})})});e5.displayName=XO;var t5="ScrollAreaViewport",r5=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:a,...i}=e,o=Vn(t5,r),s=w.useRef(null),l=it(t,s,o.onViewportChange);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),f.jsx(Me.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:f.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});r5.displayName=t5;var qa="ScrollAreaScrollbar",ZO=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=Vn(qa,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,s=e.orientation==="horizontal";return w.useEffect(()=>(s?i(!0):o(!0),()=>{s?i(!1):o(!1)}),[s,i,o]),a.type==="hover"?f.jsx(Wxe,{...n,ref:t,forceMount:r}):a.type==="scroll"?f.jsx(qxe,{...n,ref:t,forceMount:r}):a.type==="auto"?f.jsx(n5,{...n,ref:t,forceMount:r}):a.type==="always"?f.jsx(JO,{...n,ref:t}):null});ZO.displayName=qa;var Wxe=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=Vn(qa,e.__scopeScrollArea),[i,o]=w.useState(!1);return w.useEffect(()=>{const s=a.scrollArea;let l=0;if(s){const u=()=>{window.clearTimeout(l),o(!0)},h=()=>{l=window.setTimeout(()=>o(!1),a.scrollHideDelay)};return s.addEventListener("pointerenter",u),s.addEventListener("pointerleave",h),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",u),s.removeEventListener("pointerleave",h)}}},[a.scrollArea,a.scrollHideDelay]),f.jsx(rn,{present:r||i,children:f.jsx(n5,{"data-state":i?"visible":"hidden",...n,ref:t})})}),qxe=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=Vn(qa,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Bm(()=>l("SCROLL_END"),100),[s,l]=Fxe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(s==="idle"){const u=window.setTimeout(()=>l("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(u)}},[s,a.scrollHideDelay,l]),w.useEffect(()=>{const u=a.viewport,h=i?"scrollLeft":"scrollTop";if(u){let p=u[h];const m=()=>{const v=u[h];p!==v&&(l("SCROLL"),o()),p=v};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[a.viewport,i,l,o]),f.jsx(rn,{present:r||s!=="hidden",children:f.jsx(JO,{"data-state":s==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:be(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:be(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),n5=w.forwardRef((e,t)=>{const r=Vn(qa,e.__scopeScrollArea),{forceMount:n,...a}=e,[i,o]=w.useState(!1),s=e.orientation==="horizontal",l=Bm(()=>{if(r.viewport){const u=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,a=Vn(qa,e.__scopeScrollArea),i=w.useRef(null),o=w.useRef(0),[s,l]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=l5(s.viewport,s.content),h={...n,sizes:s,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:m=>i.current=m,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:m=>o.current=m};function p(m,v){return Kxe(m,o.current,s,v)}return r==="horizontal"?f.jsx(Uxe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const m=a.viewport.scrollLeft,v=fR(m,s,a.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollLeft=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollLeft=p(m,a.dir))}}):r==="vertical"?f.jsx(Hxe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const m=a.viewport.scrollTop,v=fR(m,s);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollTop=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollTop=p(m))}}):null}),Uxe=w.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...a}=e,i=Vn(qa,e.__scopeScrollArea),[o,s]=w.useState(),l=w.useRef(null),u=it(t,l,i.onScrollbarXChange);return w.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),f.jsx(i5,{"data-orientation":"horizontal",...a,ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Fm(r)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const m=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(m),u5(m,p)&&h.preventDefault()}},onResize:()=>{l.current&&i.viewport&&o&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Sp(o.paddingLeft),paddingEnd:Sp(o.paddingRight)}})}})}),Hxe=w.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...a}=e,i=Vn(qa,e.__scopeScrollArea),[o,s]=w.useState(),l=w.useRef(null),u=it(t,l,i.onScrollbarYChange);return w.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),f.jsx(i5,{"data-orientation":"vertical",...a,ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Fm(r)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const m=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(m),u5(m,p)&&h.preventDefault()}},onResize:()=>{l.current&&i.viewport&&o&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Sp(o.paddingTop),paddingEnd:Sp(o.paddingBottom)}})}})}),[Vxe,a5]=Q6(qa),i5=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:h,onResize:p,...m}=e,v=Vn(qa,r),[b,g]=w.useState(null),x=it(t,R=>g(R)),S=w.useRef(null),O=w.useRef(""),j=v.viewport,P=n.content-n.viewport,A=Qt(h),T=Qt(l),N=Bm(p,10);function k(R){if(S.current){const W=R.clientX-S.current.left,E=R.clientY-S.current.top;u({x:W,y:E})}}return w.useEffect(()=>{const R=W=>{const E=W.target;(b==null?void 0:b.contains(E))&&A(W,P)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[j,b,P,A]),w.useEffect(T,[n,T]),Il(b,N),Il(v.content,N),f.jsx(Vxe,{scope:r,scrollbar:b,hasThumb:a,onThumbChange:Qt(i),onThumbPointerUp:Qt(o),onThumbPositionChange:T,onThumbPointerDown:Qt(s),children:f.jsx(Me.div,{...m,ref:x,style:{position:"absolute",...m.style},onPointerDown:be(e.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),S.current=b.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),k(R))}),onPointerMove:be(e.onPointerMove,k),onPointerUp:be(e.onPointerUp,R=>{const W=R.target;W.hasPointerCapture(R.pointerId)&&W.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=O.current,v.viewport&&(v.viewport.style.scrollBehavior=""),S.current=null})})})}),wp="ScrollAreaThumb",o5=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=a5(wp,e.__scopeScrollArea);return f.jsx(rn,{present:r||a.hasThumb,children:f.jsx(zxe,{ref:t,...n})})}),zxe=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...a}=e,i=Vn(wp,r),o=a5(wp,r),{onThumbPositionChange:s}=o,l=it(t,p=>o.onThumbChange(p)),u=w.useRef(),h=Bm(()=>{u.current&&(u.current(),u.current=void 0)},100);return w.useEffect(()=>{const p=i.viewport;if(p){const m=()=>{if(h(),!u.current){const v=Yxe(p,s);u.current=v,s()}};return s(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[i.viewport,h,s]),f.jsx(Me.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:be(e.onPointerDownCapture,p=>{const v=p.target.getBoundingClientRect(),b=p.clientX-v.left,g=p.clientY-v.top;o.onThumbPointerDown({x:b,y:g})}),onPointerUp:be(e.onPointerUp,o.onThumbPointerUp)})});o5.displayName=wp;var QO="ScrollAreaCorner",s5=w.forwardRef((e,t)=>{const r=Vn(QO,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?f.jsx(Gxe,{...e,ref:t}):null});s5.displayName=QO;var Gxe=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,a=Vn(QO,r),[i,o]=w.useState(0),[s,l]=w.useState(0),u=!!(i&&s);return Il(a.scrollbarX,()=>{var p;const h=((p=a.scrollbarX)==null?void 0:p.offsetHeight)||0;a.onCornerHeightChange(h),l(h)}),Il(a.scrollbarY,()=>{var p;const h=((p=a.scrollbarY)==null?void 0:p.offsetWidth)||0;a.onCornerWidthChange(h),o(h)}),u?f.jsx(Me.div,{...n,ref:t,style:{width:i,height:s,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Sp(e){return e?parseInt(e,10):0}function l5(e,t){const r=e/t;return isNaN(r)?0:r}function Fm(e){const t=l5(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Kxe(e,t,r,n="ltr"){const a=Fm(r),i=a/2,o=t||i,s=a-o,l=r.scrollbar.paddingStart+o,u=r.scrollbar.size-r.scrollbar.paddingEnd-s,h=r.content-r.viewport,p=n==="ltr"?[0,h]:[h*-1,0];return c5([l,u],p)(e)}function fR(e,t,r="ltr"){const n=Fm(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,s=i-n,l=r==="ltr"?[0,o]:[o*-1,0],u=Qb(e,l);return c5([0,o],[0,s])(u)}function c5(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function u5(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,s=r.top!==i.top;(o||s)&&t(),r=i,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function Bm(e,t){const r=Qt(e),n=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),w.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Il(e,t){const r=Qt(t);fr(()=>{let n=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return a.observe(e),()=>{window.cancelAnimationFrame(n),a.unobserve(e)}}},[e,r])}var f5=e5,Xxe=r5,Zxe=s5;const e_=w.forwardRef(({className:e,children:t,...r},n)=>f.jsxs(f5,{ref:n,className:de("relative overflow-hidden",e),...r,children:[f.jsx(Xxe,{className:"h-full w-full rounded-[inherit]",children:t}),f.jsx(d5,{}),f.jsx(Zxe,{})]}));e_.displayName=f5.displayName;const d5=w.forwardRef(({className:e,orientation:t="vertical",...r},n)=>f.jsx(ZO,{ref:n,orientation:t,className:de("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:f.jsx(o5,{className:"relative flex-1 rounded-full bg-border"})}));d5.displayName=ZO.displayName;var t_="Dialog",[h5,ywe]=co(t_),[Jxe,va]=h5(t_),p5=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,s=w.useRef(null),l=w.useRef(null),[u=!1,h]=pi({prop:n,defaultProp:a,onChange:i});return f.jsx(Jxe,{scope:t,triggerRef:s,contentRef:l,contentId:Pa(),titleId:Pa(),descriptionId:Pa(),open:u,onOpenChange:h,onOpenToggle:w.useCallback(()=>h(p=>!p),[h]),modal:o,children:r})};p5.displayName=t_;var m5="DialogTrigger",v5=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=va(m5,r),i=it(t,a.triggerRef);return f.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":a_(a.open),...n,ref:i,onClick:be(e.onClick,a.onOpenToggle)})});v5.displayName=m5;var r_="DialogPortal",[Qxe,g5]=h5(r_,{forceMount:void 0}),y5=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,i=va(r_,t);return f.jsx(Qxe,{scope:t,forceMount:r,children:w.Children.map(n,o=>f.jsx(rn,{present:r||i.open,children:f.jsx(Ll,{asChild:!0,container:a,children:o})}))})};y5.displayName=r_;var Op="DialogOverlay",x5=w.forwardRef((e,t)=>{const r=g5(Op,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=va(Op,e.__scopeDialog);return i.modal?f.jsx(rn,{present:n||i.open,children:f.jsx(ebe,{...a,ref:t})}):null});x5.displayName=Op;var ebe=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=va(Op,r);return f.jsx(Lp,{as:ao,allowPinchZoom:!0,shards:[a.contentRef],children:f.jsx(Me.div,{"data-state":a_(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),is="DialogContent",b5=w.forwardRef((e,t)=>{const r=g5(is,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=va(is,e.__scopeDialog);return f.jsx(rn,{present:n||i.open,children:i.modal?f.jsx(tbe,{...a,ref:t}):f.jsx(rbe,{...a,ref:t})})});b5.displayName=is;var tbe=w.forwardRef((e,t)=>{const r=va(is,e.__scopeDialog),n=w.useRef(null),a=it(t,r.contentRef,n);return w.useEffect(()=>{const i=n.current;if(i)return _S(i)},[]),f.jsx(w5,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&i.preventDefault()}),onFocusOutside:be(e.onFocusOutside,i=>i.preventDefault())})}),rbe=w.forwardRef((e,t)=>{const r=va(is,e.__scopeDialog),n=w.useRef(!1),a=w.useRef(!1);return f.jsx(w5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(s=r.triggerRef.current)==null||s.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),w5=w.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,s=va(is,r),l=w.useRef(null),u=it(t,l);return OS(),f.jsxs(f.Fragment,{children:[f.jsx(Ip,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:f.jsx($l,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":a_(s.open),...o,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(nbe,{titleId:s.titleId}),f.jsx(ibe,{contentRef:l,descriptionId:s.descriptionId})]})]})}),n_="DialogTitle",S5=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=va(n_,r);return f.jsx(Me.h2,{id:a.titleId,...n,ref:t})});S5.displayName=n_;var O5="DialogDescription",_5=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=va(O5,r);return f.jsx(Me.p,{id:a.descriptionId,...n,ref:t})});_5.displayName=O5;var A5="DialogClose",j5=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=va(A5,r);return f.jsx(Me.button,{type:"button",...n,ref:t,onClick:be(e.onClick,()=>a.onOpenChange(!1))})});j5.displayName=A5;function a_(e){return e?"open":"closed"}var T5="DialogTitleWarning",[xwe,P5]=MH(T5,{contentName:is,titleName:n_,docsSlug:"dialog"}),nbe=({titleId:e})=>{const t=P5(T5),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},abe="DialogDescriptionWarning",ibe=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${P5(abe).contentName}}.`;return w.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},obe=p5,sbe=v5,lbe=y5,N5=x5,C5=b5,E5=S5,k5=_5,cbe=j5;const M5=obe,ube=sbe,fbe=lbe,R5=w.forwardRef(({className:e,...t},r)=>f.jsx(N5,{ref:r,className:de("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));R5.displayName=N5.displayName;const i_=w.forwardRef(({className:e,children:t,...r},n)=>f.jsxs(fbe,{children:[f.jsx(R5,{}),f.jsxs(C5,{ref:n,className:de("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,f.jsxs(cbe,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[f.jsx(dD,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));i_.displayName=C5.displayName;const o_=({className:e,...t})=>f.jsx("div",{className:de("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});o_.displayName="DialogHeader";const s_=w.forwardRef(({className:e,...t},r)=>f.jsx(E5,{ref:r,className:de("text-lg font-semibold leading-none tracking-tight",e),...t}));s_.displayName=E5.displayName;const D5=w.forwardRef(({className:e,...t},r)=>f.jsx(k5,{ref:r,className:de("text-sm text-muted-foreground",e),...t}));D5.displayName=k5.displayName;const Bt={PLACED_ORDER:"Y8cqcF",SHIPPED_ORDER:"VExpdL",ACCOUNT_CREATED:"TeeypV",CANCELED_ORDER:"YjVMNg",NEW_BLOG_POST:"YcxeDr",PAYMENT_REFUNDED:"R7XUYh"},I5={[Bt.PLACED_ORDER]:Fl,[Bt.SHIPPED_ORDER]:UV,[Bt.ACCOUNT_CREATED]:zV,[Bt.CANCELED_ORDER]:G1,[Bt.PAYMENT_REFUNDED]:os,[Bt.NEW_BLOG_POST]:PV},$5={[Bt.PLACED_ORDER]:{label:"Order Placed",color:"bg-green-500 dark:bg-green-600",textColor:"text-green-600 dark:text-green-400"},[Bt.SHIPPED_ORDER]:{label:"Order Shipped",color:"bg-blue-500 dark:bg-blue-600",textColor:"text-blue-600 dark:text-blue-400"},[Bt.ACCOUNT_CREATED]:{label:"New Account",color:"bg-purple-500 dark:bg-purple-600",textColor:"text-purple-600 dark:text-purple-400"},[Bt.CANCELED_ORDER]:{label:"Order Canceled",color:"bg-red-500 dark:bg-red-600",textColor:"text-red-600 dark:text-red-400"},[Bt.PAYMENT_REFUNDED]:{label:"Payment Refunded",color:"bg-orange-500 dark:bg-orange-600",textColor:"text-orange-600 dark:text-orange-400"},[Bt.NEW_BLOG_POST]:{label:"New Blog Post",color:"bg-indigo-500 dark:bg-indigo-600",textColor:"text-indigo-600 dark:text-indigo-400"}},mr=e=>{const t=typeof e=="string"?parseFloat(e):e,r=Math.abs(t);return`${t<0?"-":""}$${r.toFixed(2)}`},Bs=e=>e?e.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):"",dbe=e=>e?e.replace("usps_","USPS ").replace("ups_","UPS ").replace("fedex_","FedEx ").replace(/_/g," ").split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):"Standard Shipping",hbe=e=>e?e.includes("usps")?"USPS":e.includes("fedex")?"FedEx":e.includes("ups")?"UPS":"Standard":"Standard",pbe=({event:e,children:t})=>{var i,o,s;const r=$5[e.metric_id];if(!r)return t;const n=e.event_properties||{},a=I5[e.metric_id]||Fl;return f.jsxs(M5,{children:[f.jsx(ube,{asChild:!0,children:t}),f.jsxs(i_,{className:"max-w-2xl max-h-[85vh] overflow-hidden flex flex-col",children:[f.jsxs(o_,{className:"border-b border-border px-6 py-4",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a&&f.jsx(a,{className:`h-5 w-5 ${r.textColor}`}),f.jsx(s_,{className:"text-lg font-semibold",children:r.label})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx(D5,{className:"text-base",children:n.OrderId?`Order #${n.OrderId}`:n.title?n.title:n.EmailAddress?n.EmailAddress:"Event Details"}),e.datetime&&f.jsx("time",{className:"text-sm text-muted-foreground",dateTime:e.datetime,children:Fa(new Date(e.datetime),"h:mm a")})]})]}),f.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:f.jsxs("div",{className:"space-y-6",children:[e.metric_id===Bt.PLACED_ORDER&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"grid gap-6 sm:grid-cols-2",children:[f.jsxs("div",{className:"space-y-4",children:[f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Shipping Information"})}),f.jsxs(We,{className:"space-y-1",children:[f.jsx("p",{className:"text-sm font-medium",children:n.ShippingName}),n.ShippingStreet1&&f.jsx("p",{className:"text-sm text-muted-foreground",children:n.ShippingStreet1}),n.ShippingStreet2&&f.jsx("p",{className:"text-sm text-muted-foreground",children:n.ShippingStreet2}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.ShippingCity,", ",n.ShippingState," ",n.ShippingZip]}),n.ShippingCountry!=="US"&&f.jsx("p",{className:"text-sm text-muted-foreground",children:n.ShippingCountry})]})]}),f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Order Properties"})}),f.jsxs(We,{className:"flex flex-wrap gap-2",children:[n.IsOnHold&&f.jsx(vr,{variant:"secondary",className:"bg-blue-100 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",children:"On Hold"}),n.OnHoldReleased&&f.jsx(vr,{variant:"secondary",className:"bg-green-100 dark:bg-green-900/20 text-green-700 dark:text-green-300",children:"Hold Released"}),n.StillOwes&&f.jsx(vr,{variant:"secondary",className:"bg-red-100 dark:bg-red-900/20 text-red-700 dark:text-red-300",children:"Owes"}),n.LocalPickup&&f.jsx(vr,{variant:"secondary",className:"bg-green-100 dark:bg-green-900/20 text-green-700 dark:text-green-300",children:"Local"}),n.HasPreorder&&f.jsx(vr,{variant:"secondary",className:"bg-purple-100 dark:bg-purple-900/20 text-purple-700 dark:text-purple-300",children:"Pre-order"}),n.HasNotions&&f.jsx(vr,{variant:"secondary",className:"bg-yellow-100 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-300",children:"Notions"}),(n.OnlyDigitalGC||n.HasDigitalGC)&&f.jsx(vr,{variant:"secondary",className:"bg-pink-100 dark:bg-pink-900/20 text-pink-700 dark:text-pink-300",children:"eGift Card"}),(n.HasDigiItem||n.OnlyDigiItem)&&f.jsx(vr,{variant:"secondary",className:"bg-indigo-100 dark:bg-indigo-900/20 text-indigo-700 dark:text-indigo-300",children:"Digital"})]})]})]}),f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Order Summary"})}),f.jsxs(We,{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex justify-between text-sm",children:[f.jsx("span",{className:"text-muted-foreground",children:"Subtotal"}),f.jsx("span",{className:"font-medium",children:mr(n.Subtotal)})]}),f.jsxs("div",{className:"flex justify-between text-sm",children:[f.jsx("span",{className:"text-muted-foreground",children:"Shipping"}),f.jsx("span",{className:"font-medium",children:mr(n.ShippingTotal)})]}),f.jsxs("div",{className:"flex justify-between text-sm",children:[f.jsx("span",{className:"text-muted-foreground",children:"Tax"}),f.jsx("span",{className:"font-medium",children:mr(n.SalesTax)})]}),n.PointsDiscount>0&&f.jsxs("div",{className:"flex justify-between text-sm text-green-600 dark:text-green-400",children:[f.jsx("span",{children:"Points Discount"}),f.jsxs("span",{className:"font-medium",children:["-",mr(n.PointsDiscount)]})]}),Array.isArray(n.PromosUsedReg)&&n.PromosUsedReg.map(([l,u],h)=>f.jsxs("div",{className:"flex justify-between text-sm text-green-600 dark:text-green-400",children:[f.jsx("span",{children:l}),f.jsxs("span",{className:"font-medium",children:["-",mr(u)]})]},h))]}),f.jsx("div",{className:"pt-2 border-t",children:f.jsxs("div",{className:"flex justify-between font-medium",children:[f.jsx("span",{children:"Total"}),f.jsx("span",{children:mr(n.TotalAmount)})]})})]})]})]}),f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Order Items"})}),f.jsx(We,{children:f.jsx("div",{className:"divide-y",children:(i=n.Items)==null?void 0:i.map((l,u)=>f.jsxs("div",{className:"flex gap-4 py-4 first:pt-0 last:pb-0",children:[l.ImgThumb&&f.jsx("img",{src:l.ImgThumb,alt:l.ProductName,className:"w-16 h-16 object-cover rounded bg-muted"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsxs("div",{children:[f.jsx("p",{className:"font-medium text-sm",children:l.ProductName}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:[l.Quantity,"x @ ",mr(l.ItemPrice)]})]}),f.jsx("p",{className:"text-sm font-medium text-green-600 dark:text-green-400 shrink-0",children:mr(l.RowTotal)})]}),l.ItemStatus&&l.ItemStatus!=="Ready"&&f.jsx(vr,{variant:"secondary",className:"mt-2",children:l.ItemStatus})]})]},u))})})]})]}),e.metric_id===Bt.SHIPPED_ORDER&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"grid gap-6 sm:grid-cols-2",children:[f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Shipping Address"})}),f.jsxs(We,{className:"space-y-1",children:[f.jsx("p",{className:"text-sm font-medium",children:n.ShippingName}),n.ShippingStreet1&&f.jsx("p",{className:"text-sm text-muted-foreground",children:n.ShippingStreet1}),n.ShippingStreet2&&f.jsx("p",{className:"text-sm text-muted-foreground",children:n.ShippingStreet2}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.ShippingCity,", ",n.ShippingState," ",n.ShippingZip]}),n.ShippingCountry!=="US"&&f.jsx("p",{className:"text-sm text-muted-foreground",children:n.ShippingCountry})]})]}),f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Tracking Information"})}),f.jsxs(We,{className:"space-y-1",children:[f.jsx("p",{className:"text-sm font-medium",children:n.TrackingNumber}),f.jsx("p",{className:"text-sm text-muted-foreground",children:dbe(n.ShipMethod)})]})]})]}),f.jsxs(Ae,{className:"mt-6",children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Shipped Items"})}),f.jsx(We,{children:f.jsx("div",{className:"divide-y",children:(o=n.Items)==null?void 0:o.map((l,u)=>f.jsxs("div",{className:"flex gap-4 py-4 first:pt-0 last:pb-0",children:[l.ImgThumb&&f.jsx("img",{src:l.ImgThumb,alt:l.ProductName,className:"w-16 h-16 object-cover rounded bg-muted"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("p",{className:"font-medium text-sm",children:l.ProductName}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:["Shipped: ",l.QuantitySent," of ",l.QuantityOrdered]}),l.QuantityBackordered>0&&f.jsxs(vr,{variant:"secondary",className:"mt-2",children:[l.QuantityBackordered," Backordered"]})]})]},u))})})]})]}),e.metric_id===Bt.ACCOUNT_CREATED&&f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Customer Information"})}),f.jsxs(We,{className:"space-y-1",children:[f.jsx("p",{className:"text-sm font-medium",children:n.EmailAddress}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.FirstName," ",n.LastName]})]})]}),e.metric_id===Bt.CANCELED_ORDER&&f.jsx(f.Fragment,{children:f.jsxs("div",{className:"grid gap-6 sm:grid-cols-2",children:[f.jsxs("div",{className:"space-y-4",children:[f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Cancellation Details"})}),f.jsxs(We,{className:"space-y-1",children:[f.jsxs("p",{className:"text-sm font-medium",children:["Reason: ",n.CancelReason]}),n.CancelMessage&&f.jsx("p",{className:"text-sm text-muted-foreground",children:n.CancelMessage})]})]}),f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Order Summary"})}),f.jsxs(We,{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex justify-between text-sm",children:[f.jsx("span",{className:"text-muted-foreground",children:"Subtotal"}),f.jsx("span",{className:"font-medium",children:mr(n.Subtotal)})]}),f.jsxs("div",{className:"flex justify-between text-sm",children:[f.jsx("span",{className:"text-muted-foreground",children:"Shipping"}),f.jsx("span",{className:"font-medium",children:mr(n.ShippingTotal)})]}),f.jsxs("div",{className:"flex justify-between text-sm",children:[f.jsx("span",{className:"text-muted-foreground",children:"Tax"}),f.jsx("span",{className:"font-medium",children:mr(n.SalesTax)})]})]}),f.jsx("div",{className:"pt-2 border-t",children:f.jsxs("div",{className:"flex justify-between font-medium text-red-600 dark:text-red-400",children:[f.jsx("span",{children:"Total Refunded"}),f.jsx("span",{children:mr(n.TotalAmount)})]})})]})]})]}),f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Canceled Items"})}),f.jsx(We,{children:f.jsx("div",{className:"divide-y",children:(s=n.Items)==null?void 0:s.map((l,u)=>f.jsxs("div",{className:"flex gap-4 py-4 first:pt-0 last:pb-0",children:[l.ImgThumb&&f.jsx("img",{src:l.ImgThumb,alt:l.ProductName,className:"w-16 h-16 object-cover rounded bg-muted"}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsxs("div",{children:[f.jsx("p",{className:"font-medium text-sm",children:l.ProductName}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:[l.Quantity,"x @ ",mr(l.ItemPrice)]})]}),f.jsx("p",{className:"text-sm font-medium text-red-600 dark:text-red-400 shrink-0",children:mr(l.RowTotal)})]})})]},u))})})]})]})}),e.metric_id===Bt.PAYMENT_REFUNDED&&f.jsxs("div",{className:"grid gap-6 sm:grid-cols-2",children:[f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Refund Details"})}),f.jsxs(We,{className:"space-y-4",children:[f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Amount Refunded"}),f.jsx("span",{className:"text-sm font-medium text-red-600 dark:text-red-400",children:mr(n.PaymentAmount)})]}),f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Payment Method"}),f.jsx("span",{className:"text-sm",children:n.PaymentName})]}),n.OrderMessage&&f.jsx("div",{className:"pt-2 border-t mt-4",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:n.OrderMessage})})]})]}),f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:"Customer Information"})}),f.jsxs(We,{className:"space-y-1",children:[f.jsx("p",{className:"text-sm font-medium",children:n.EmailAddress}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.FirstName," ",n.LastName]})]})]})]}),e.metric_id===Bt.NEW_BLOG_POST&&f.jsxs(Ae,{children:[f.jsx(rt,{className:"pb-2",children:f.jsx(st,{className:"text-sm font-medium",children:n.title})}),f.jsxs(We,{className:"space-y-4",children:[f.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:n.description}),n.url&&f.jsxs("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 dark:text-blue-400 hover:underline inline-flex items-center gap-1",children:["Read More",f.jsx(z1,{className:"h-4 w-4"})]})]})]})]})})]})]})},mbe=({event:e})=>{var s,l;const t=$5[e.metric_id]||{label:"Unknown Event",color:"bg-gray-500",textColor:"text-gray-600 dark:text-gray-400"},r=I5[e.metric_id]||Fl,n=e.event_properties||{},a=((s=e.attributes)==null?void 0:s.datetime)||e.datetime||((l=e.event_properties)==null?void 0:l.datetime),i=a?new Date(a):null,o=i&&!isNaN(i.getTime());return f.jsx(pbe,{event:e,children:f.jsx("button",{className:"w-full focus:outline-none text-left",children:f.jsxs("div",{className:"flex items-center gap-3 p-4 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors border-b border-gray-100 dark:border-gray-800 last:border-b-0",children:[f.jsx("div",{className:`shrink-0 w-10 h-10 rounded-full ${t.color} bg-opacity-10 dark:bg-opacity-20 flex items-center justify-center`,children:f.jsx(r,{className:"h-5 w-5 text-gray-900 dark:text-gray-100"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"flex items-center",children:f.jsx("span",{className:`${t.textColor} text-sm font-medium`,children:t.label})}),e.metric_id===Bt.PLACED_ORDER&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mt-1",children:[f.jsx("div",{className:"flex items-center gap-2",children:f.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:Bs(n.ShippingName)})}),f.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[f.jsxs("span",{className:"text-sm text-gray-500",children:["#",n.OrderId]}),f.jsx("span",{className:"text-sm text-gray-500",children:"•"}),f.jsx("span",{className:"font-medium text-green-600 dark:text-green-400",children:mr(n.TotalAmount)})]})]}),f.jsxs("div",{className:"flex gap-1.5 items-center flex-wrap mt-2",children:[n.IsOnHold&&f.jsx(vr,{variant:"secondary",className:"bg-blue-100 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 text-xs py-0",children:"On Hold"}),n.OnHoldReleased&&f.jsx(vr,{variant:"secondary",className:"bg-green-100 dark:bg-green-900/20 text-green-700 dark:text-green-300 text-xs py-0",children:"Hold Released"}),n.StillOwes&&f.jsx(vr,{variant:"secondary",className:"bg-red-100 dark:bg-red-900/20 text-red-700 dark:text-red-300 text-xs py-0",children:"Owes"}),n.LocalPickup&&f.jsx(vr,{variant:"secondary",className:"bg-green-100 dark:bg-green-900/20 text-green-700 dark:text-green-300 text-xs py-0",children:"Local"}),n.HasPreorder&&f.jsx(vr,{variant:"secondary",className:"bg-purple-100 dark:bg-purple-900/20 text-purple-700 dark:text-purple-300 text-xs py-0",children:"Pre-order"}),n.HasNotions&&f.jsx(vr,{variant:"secondary",className:"bg-yellow-100 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-300 text-xs py-0",children:"Notions"}),(n.OnlyDigitalGC||n.HasDigitalGC)&&f.jsx(vr,{variant:"secondary",className:"bg-pink-100 dark:bg-pink-900/20 text-pink-700 dark:text-pink-300 text-xs py-0",children:"eGift Card"}),(n.HasDigiItem||n.OnlyDigiItem)&&f.jsx(vr,{variant:"secondary",className:"bg-indigo-100 dark:bg-indigo-900/20 text-indigo-700 dark:text-indigo-300 text-xs py-0",children:"Digital"})]})]}),e.metric_id===Bt.SHIPPED_ORDER&&f.jsx(f.Fragment,{children:f.jsxs("div",{className:"mt-1",children:[f.jsx("div",{className:"flex items-center gap-2",children:f.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:Bs(n.ShippingName)})}),f.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[f.jsxs("span",{className:"text-sm text-gray-500",children:["#",n.OrderId]}),f.jsx("span",{className:"text-sm text-gray-500",children:"•"}),f.jsx("span",{className:"font-medium text-blue-600 dark:text-blue-400",children:hbe(n.ShipMethod)})]})]})}),e.metric_id===Bt.ACCOUNT_CREATED&&f.jsxs("div",{className:"mt-1",children:[f.jsx("div",{className:"flex items-center gap-2",children:f.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:n.FirstName&&n.LastName?`${Bs(n.FirstName)} ${Bs(n.LastName)}`:"New Customer"})}),f.jsx("div",{className:"text-sm text-gray-500",children:n.EmailAddress})]}),e.metric_id===Bt.CANCELED_ORDER&&f.jsxs("div",{className:"mt-1",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:Bs(n.ShippingName)}),f.jsx("span",{className:"text-sm text-gray-500",children:"•"}),f.jsxs("span",{className:"text-sm text-gray-500",children:["#",n.OrderId]})]}),f.jsxs("div",{className:"text-sm text-gray-500",children:[mr(n.TotalAmount)," • ",n.CancelReason]})]}),e.metric_id===Bt.PAYMENT_REFUNDED&&f.jsxs("div",{className:"mt-1",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:Bs(n.ShippingName)}),f.jsx("span",{className:"text-sm text-gray-500",children:"•"}),f.jsxs("span",{className:"text-sm text-gray-500",children:["#",n.FromOrder]})]}),f.jsxs("div",{className:"text-sm text-gray-500",children:[mr(n.PaymentAmount)," via"," ",n.PaymentName]})]}),e.metric_id===Bt.NEW_BLOG_POST&&f.jsxs("div",{className:"mt-1",children:[f.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:n.title}),f.jsx("div",{className:"text-sm text-gray-500 line-clamp-1",children:n.description})]})]}),f.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o&&f.jsx("time",{className:"text-sm text-muted-foreground",dateTime:i.toISOString(),children:Fa(i,"h:mm a")}),f.jsx(z1,{className:"h-4 w-4 text-muted-foreground"})]})]})})})},vbe=Object.values(Bt),gbe=({title:e="Live Event Feed",description:t="Real-time event stream",selectedMetrics:r=vbe})=>{const n=w.useMemo(()=>r,[r]),[a,i]=w.useState([]),[o,s]=w.useState(!0),[l,u]=w.useState(null),[h,p]=w.useState(null),m=w.useCallback(async()=>{try{u(null),a.length===0&&s(!0);const b=((await mt.get("/api/klaviyo/events/feed",{params:{timeRange:"today",metricIds:JSON.stringify(n)}})).data.data||[]).map(g=>{var x,S;return{...g,datetime:((x=g.attributes)==null?void 0:x.datetime)||g.datetime,event_properties:{...g.event_properties,datetime:((S=g.attributes)==null?void 0:S.datetime)||g.datetime}}});i(b),p(new Date)}catch(v){console.error("Error fetching events:",v),u(v.message)}finally{s(!1)}},[n]);return w.useEffect(()=>{m();const v=setInterval(m,6e4);return()=>{clearInterval(v)}},[m]),f.jsxs(Ae,{className:"flex flex-col h-full bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{className:"p-6 pb-0",children:f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("div",{children:f.jsx(st,{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:e})}),h&&f.jsxs("span",{className:"text-sm text-muted-foreground",children:["Last updated: ",Fa(h,"hh:mm a")]})]})}),f.jsx(We,{className:"p-6 pt-4 flex-1 overflow-hidden",children:f.jsx(e_,{className:"h-full",children:o&&!a.length?f.jsx("div",{className:"space-y-4 w-full",children:[...Array(5)].map((v,b)=>f.jsxs("div",{className:"flex items-center space-x-4 p-4 border-b dark:border-gray-800",children:[f.jsx("div",{className:"rounded-full",children:f.jsx(Je,{className:"h-10 w-10 rounded-full"})}),f.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[f.jsx(Je,{className:"h-4 w-[200px]"}),f.jsx(Je,{className:"h-3 w-[150px]"})]}),f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Je,{className:"h-3 w-16"}),f.jsx(Je,{className:"h-4 w-4"})]})]},b))}):l?f.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:[f.jsx(mi,{className:"w-12 h-12 text-red-500 mb-4"}),f.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:"Error Loading Feed"}),f.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:l}),f.jsx("button",{onClick:()=>m(),className:"px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",children:"Try Again"})]}):!a||a.length===0?f.jsxs("div",{className:"h-full flex flex-col items-center justify-center py-16 px-4",children:[f.jsx("div",{className:"bg-gray-100 dark:bg-gray-800 rounded-full p-3 mb-4",children:f.jsx(xV,{className:"h-8 w-8 text-muted-foreground"})}),f.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:"No activity yet today"}),f.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-sm",children:"Recent activity will appear here as it happens"})]}):f.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:a.map(v=>f.jsx(mbe,{event:v},v.id))})})})]})},_p=[{value:"today",label:"Today"},{value:"yesterday",label:"Yesterday"},{value:"last7days",label:"Last 7 Days"},{value:"last30days",label:"Last 30 Days"},{value:"last90days",label:"Last 90 Days"},{value:"thisWeek",label:"This Week"},{value:"lastWeek",label:"Last Week"},{value:"thisMonth",label:"This Month"},{value:"lastMonth",label:"Last Month"}],dR=e=>{if(!e)return"";const t=new Date(e);return isNaN(t.getTime())?"":new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16)},Xi=e=>{if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t},Ct=(e,t=0)=>!e||isNaN(e)?"$0":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:t,maximumFractionDigits:t}).format(e),Rb=e=>typeof e!="number"?"0%":`${Math.round(e)}%`,F1=e=>{const t=parseInt(e);return t===0?"12am":t===12?"12pm":t>12?`${t-12}pm`:`${t}am`},Hr=({data:e,dataKey:t,name:r,color:n="hsl(var(--primary))",type:a="line",valueFormatter:i=s=>s,height:o=400})=>{const s=a==="line"?MO:Jd,l=a==="line"?Xr:Ma;return f.jsx("div",{className:"h-[400px] w-full",children:f.jsx(Lo,{width:"100%",height:o,children:f.jsxs(s,{data:e,margin:{top:10,right:30,left:20,bottom:5},children:[f.jsx(qo,{strokeDasharray:"3 3",className:"stroke-muted"}),f.jsx(Ta,{dataKey:"timestamp",tickFormatter:u=>_e.fromISO(u).toFormat("LLL d"),className:"text-xs"}),f.jsx(na,{tickFormatter:i,className:"text-xs"}),f.jsx(Er,{content:({active:u,payload:h,label:p})=>!u||!(h!=null&&h.length)?null:f.jsxs("div",{className:"bg-background border rounded-lg shadow-lg p-3",children:[f.jsx("p",{className:"font-medium",children:_e.fromISO(p).toFormat("LLL d")}),h.map((m,v)=>f.jsxs("p",{className:"text-sm",children:[m.name,": ",i(m.value)]},v))]})}),f.jsx(fi,{}),f.jsx(l,{type:"monotone",dataKey:t,name:r,stroke:n,fill:n,strokeWidth:2,dot:!1})]})})})},ybe=({open:e,onOpenChange:t,title:r,children:n})=>f.jsx(M5,{open:e,onOpenChange:t,children:f.jsxs(i_,{className:"max-w-2xl max-h-[80vh] overflow-auto",children:[f.jsx(o_,{children:f.jsx(s_,{children:r})}),n]})}),xbe=({data:e})=>{var o,s;if(!(e!=null&&e.length))return f.jsx("div",{className:"text-muted-foreground",children:"No data available for the selected time range."});const t=e.map(l=>({timestamp:_e.fromISO(l.timestamp).toFormat("yyyy-MM-dd"),revenue:parseFloat(l.revenue||0),orders:parseInt(l.orders||0),date:_e.fromISO(l.timestamp).toFormat("LLL d")})).sort((l,u)=>_e.fromISO(l.timestamp)-_e.fromISO(u.timestamp)),r=t.reduce((l,u)=>l+u.revenue,0),n=r/t.length,a=Math.max(...t.map(l=>l.revenue)),i=Math.min(...t.map(l=>l.revenue));return f.jsxs("div",{className:"space-y-8",children:[f.jsx(Hr,{data:t,dataKey:"revenue",name:"Revenue",color:"hsl(142.1 76.2% 36.3%)",valueFormatter:l=>Ct(l),height:400}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsx(Ot,{title:"Total Revenue",value:Ct(r),description:`${t.length} days`,colorClass:"text-green-600 dark:text-green-400",icon:os}),f.jsx(Ot,{title:"Average Daily Revenue",value:Ct(n),description:"per day",colorClass:"text-green-600 dark:text-green-400",icon:nl}),f.jsx(Ot,{title:"Highest Day",value:Ct(a),description:(o=t.find(l=>l.revenue===a))==null?void 0:o.date,colorClass:"text-green-600 dark:text-green-400",icon:JR}),f.jsx(Ot,{title:"Lowest Day",value:Ct(i),description:(s=t.find(l=>l.revenue===i))==null?void 0:s.date,colorClass:"text-green-600 dark:text-green-400",icon:ZR})]})]})},bbe=({data:e})=>{var t;return e!=null&&e.length?f.jsxs(f.Fragment,{children:[f.jsx(Hr,{data:e,dataKey:"orders",name:"Orders",color:"hsl(221.2 83.2% 53.3%)"}),((t=e[0])==null?void 0:t.hourlyOrders)&&f.jsxs("div",{className:"mt-8",children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Hourly Distribution"}),f.jsx(Hr,{data:e[0].hourlyOrders.map((r,n)=>({hour:F1(n),orders:r})),dataKey:"orders",name:"Orders",type:"bar",color:"hsl(221.2 83.2% 53.3%)"})]})]}):f.jsx("div",{className:"text-muted-foreground",children:"No data available for the selected time range."})},L5=({stats:e})=>f.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.map((t,r)=>f.jsxs(Ae,{className:"p-4",children:[f.jsx("div",{className:"text-sm text-muted-foreground",children:t.label}),f.jsx("div",{className:"text-2xl font-bold mt-1",children:t.value}),t.description&&f.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:t.description})]},r))}),wbe=({data:e,orderCount:t})=>{var r,n;return e!=null&&e.length?f.jsxs(f.Fragment,{children:[f.jsx(Hr,{data:e,dataKey:"averageOrderValue",name:"Average Order Value",color:"hsl(262.1 83.3% 57.8%)",valueFormatter:a=>Ct(a)}),f.jsx("div",{className:"mt-8",children:f.jsx(L5,{stats:[{label:"Average Items per Order",value:((n=(r=e[0])==null?void 0:r.averageItemsPerOrder)==null?void 0:n.toFixed(1))||"0",description:"items"},{label:"Total Orders",value:(t==null?void 0:t.toLocaleString())||"0",description:"orders"}]})})]}):f.jsx("div",{className:"text-muted-foreground",children:"No data available for the selected time range."})},Sbe=({data:e})=>{var a;if(!(e!=null&&e.length))return f.jsx("div",{className:"text-muted-foreground",children:"No data available for the selected time range."});const t=((a=e[0])==null?void 0:a.canceledOrders)||{total:0,count:0,reasons:{},items:[]},r=e.map(i=>{var o,s;return{timestamp:i.timestamp,total:((o=i.canceledOrders)==null?void 0:o.total)||0,count:((s=i.canceledOrders)==null?void 0:s.count)||0}}),n=Object.entries(t.reasons||{}).map(([i,o])=>({reason:i,count:o,percentage:o/t.count*100})).sort((i,o)=>o.count-i.count);return f.jsxs("div",{className:"space-y-8",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsx(Ot,{title:"Total Cancellations",value:Ct(t.total),description:`${t.count.toLocaleString()} orders`,colorClass:"text-rose-600 dark:text-rose-400",icon:G1}),f.jsx(Ot,{title:"Average Cancellation",value:Ct(t.total/(t.count||1)),description:"per order",colorClass:"text-rose-600 dark:text-rose-400",icon:os})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Daily Cancellation Amount"}),f.jsx(Hr,{data:r,dataKey:"total",name:"Cancellation Amount",color:"hsl(0 84.2% 60.2%)",valueFormatter:i=>Ct(i)})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Daily Cancellation Count"}),f.jsx(Hr,{data:r,dataKey:"count",name:"Cancellation Count",type:"bar",color:"hsl(0 84.2% 60.2%)"})]}),n.length>0&&f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Cancellation Reasons"}),f.jsx("div",{className:"rounded-lg border bg-card",children:f.jsxs(ua,{children:[f.jsx(fa,{children:f.jsxs(er,{children:[f.jsx(Fe,{children:"Reason"}),f.jsx(Fe,{className:"text-right",children:"Count"}),f.jsx(Fe,{className:"text-right",children:"% of Total"})]})}),f.jsx(da,{children:n.map((i,o)=>f.jsxs(er,{children:[f.jsx(Be,{className:"font-medium",children:i.reason}),f.jsx(Be,{className:"text-right",children:i.count.toLocaleString()}),f.jsxs(Be,{className:"text-right",children:[i.percentage.toFixed(1),"%"]})]},o))})]})})]})]})},Obe=({data:e})=>{var n,a,i,o,s,l,u,h;if(!(e!=null&&e.length))return f.jsx("div",{className:"text-muted-foreground",children:"No data available for the selected time range."});const t=((o=(i=(a=(n=e[0])==null?void 0:n.brands)==null?void 0:a.list)==null?void 0:i.map(p=>{var m;return{name:p.name,count:p.count,revenue:p.revenue,percentage:p.count/((m=e[0])==null?void 0:m.itemCount)*100||0}}))==null?void 0:o.sort((p,m)=>m.count-p.count))||[],r=((h=(u=(l=(s=e[0])==null?void 0:s.categories)==null?void 0:l.list)==null?void 0:u.map(p=>{var m;return{name:p.name,count:p.count,revenue:p.revenue,percentage:p.count/((m=e[0])==null?void 0:m.itemCount)*100||0}}))==null?void 0:h.sort((p,m)=>m.count-p.count))||[];return!t.length&&!r.length?f.jsx("div",{className:"text-muted-foreground",children:"No brands or categories data available."}):f.jsxs("div",{className:"space-y-8",children:[t.length>0&&f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"All Brands"}),f.jsx("div",{className:"rounded-lg border bg-card max-h-[400px] overflow-auto",children:f.jsxs(ua,{children:[f.jsx(fa,{className:"sticky top-0 bg-background z-10",children:f.jsxs(er,{children:[f.jsx(Fe,{children:"Brand"}),f.jsx(Fe,{className:"text-right",children:"Items"}),f.jsx(Fe,{className:"text-right",children:"Revenue"}),f.jsx(Fe,{className:"text-right",children:"% of Total"})]})}),f.jsx(da,{children:t.map((p,m)=>f.jsxs(er,{children:[f.jsx(Be,{className:"font-medium",children:p.name}),f.jsx(Be,{className:"text-right",children:p.count.toLocaleString()}),f.jsx(Be,{className:"text-right",children:Ct(p.revenue)}),f.jsxs(Be,{className:"text-right",children:[p.percentage.toFixed(1),"%"]})]},m))})]})})]}),r.length>0&&f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"All Categories"}),f.jsx("div",{className:"rounded-lg border bg-card max-h-[400px] overflow-auto",children:f.jsxs(ua,{children:[f.jsx(fa,{className:"sticky top-0 bg-background z-10",children:f.jsxs(er,{children:[f.jsx(Fe,{children:"Category"}),f.jsx(Fe,{className:"text-right",children:"Items"}),f.jsx(Fe,{className:"text-right",children:"Revenue"}),f.jsx(Fe,{className:"text-right",children:"% of Total"})]})}),f.jsx(da,{children:r.map((p,m)=>f.jsxs(er,{children:[f.jsx(Be,{className:"font-medium",children:p.name}),f.jsx(Be,{className:"text-right",children:p.count.toLocaleString()}),f.jsx(Be,{className:"text-right",children:Ct(p.revenue)}),f.jsxs(Be,{className:"text-right",children:[p.percentage.toFixed(1),"%"]})]},m))})]})})]})]})},_be=({data:e})=>{var a,i,o,s,l,u,h;if(!(e!=null&&e.length))return f.jsx("div",{className:"text-muted-foreground",children:"No data available for the selected time range."});const t=((i=(a=e[0])==null?void 0:a.shipping)==null?void 0:i.shippedCount)||0,r=((s=(o=e[0])==null?void 0:o.shipping)==null?void 0:s.locations)||{},n=((u=(l=e[0])==null?void 0:l.shipping)==null?void 0:u.methodStats)||[];return f.jsxs("div",{className:"space-y-8",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsx(Ot,{title:"Total Shipped Orders",value:t.toLocaleString(),description:"orders",colorClass:"text-teal-600 dark:text-teal-400",icon:Fl}),f.jsx(Ot,{title:"Shipping Locations",value:r.total||0,description:"unique locations",colorClass:"text-teal-600 dark:text-teal-400",icon:CV})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Shipping Methods Distribution"}),f.jsx("div",{className:"h-[400px] w-full",children:f.jsx(Lo,{width:"100%",height:"100%",children:f.jsxs(Ave,{children:[f.jsx(Ai,{data:n,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:150,fill:"hsl(171.2 77.2% 53.3%)",label:({name:p,percent:m})=>`${p} (${(m*100).toFixed(1)}%)`,children:n.map((p,m)=>f.jsx(tm,{fill:`hsl(171.2 77.2% ${53.3-m*10}%)`},`cell-${m}`))}),f.jsx(Er,{formatter:(p,m)=>[`${p.toLocaleString()} orders (${(p/t*100).toFixed(1)}%)`,m]})]})})})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Shipping Locations"}),f.jsx("div",{className:"max-h-[400px] overflow-y-auto pr-2",children:f.jsx("div",{className:"space-y-2",children:(h=r.byState)==null?void 0:h.map(p=>f.jsxs("div",{className:"flex justify-between items-center p-3 bg-gray-50 dark:bg-gray-800 rounded-lg",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:p.state}),f.jsx("span",{className:"text-sm text-muted-foreground ml-2",children:p.country})]}),f.jsxs("div",{className:"text-sm",children:[f.jsx("span",{className:"font-medium",children:p.count.toLocaleString()}),f.jsxs("span",{className:"text-muted-foreground ml-2",children:["(",p.percentage.toFixed(1),"%)"]})]})]},p.state))})})]})]})},Abe=({data:e,type:t})=>{var a,i,o,s,l,u,h;if(!(e!=null&&e.length))return f.jsx("div",{className:"text-muted-foreground",children:"No data available for the selected time range."});const r=e.map(p=>({timestamp:p.timestamp,count:p.count,value:p.value,percentage:p.percentage})),n={pre_orders:"Pre-Orders",local_pickup:"Local Pickup",on_hold:"On Hold"};return f.jsxs("div",{className:"space-y-8",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsx(Ot,{title:`Total ${n[t]}`,value:((i=(a=e[0])==null?void 0:a.totalOrders)==null?void 0:i.toLocaleString())||0,description:`${((s=(o=e[0])==null?void 0:o.percentage)==null?void 0:s.toFixed(1))||0}% of all orders`,colorClass:"text-blue-600 dark:text-blue-400",icon:Y1}),f.jsx(Ot,{title:"Total Value",value:Ct(((l=e[0])==null?void 0:l.value)||0),description:`Avg: ${Ct((((u=e[0])==null?void 0:u.value)||0)/(((h=e[0])==null?void 0:h.count)||1))}`,colorClass:"text-green-600 dark:text-green-400",icon:os})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Daily Order Count"}),f.jsx(Hr,{data:r,dataKey:"count",name:"Orders",type:"bar",color:"hsl(221.2 83.2% 53.3%)"})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Daily Value"}),f.jsx(Hr,{data:r,dataKey:"value",name:"Value",color:"hsl(142.1 76.2% 36.3%)",valueFormatter:p=>Ct(p)})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Percentage of Orders"}),f.jsx(Hr,{data:r,dataKey:"percentage",name:"Percentage",color:"hsl(262.1 83.3% 57.8%)",valueFormatter:p=>`${p.toFixed(1)}%`})]})]})},jbe=({data:e})=>{var r,n,a,i,o,s,l;const t=((n=(r=e[0])==null?void 0:r.hourlyOrders)==null?void 0:n.map((u,h)=>{var p;return{hour:F1(h),orders:u,percentage:u/((p=e[0])==null?void 0:p.orderCount)*100||0}}))||[];return f.jsxs(f.Fragment,{children:[f.jsx(Hr,{data:t,dataKey:"orders",name:"Orders",type:"bar",color:"hsl(322.7 73.9% 64.7%)"}),f.jsx("div",{className:"mt-8",children:f.jsx(L5,{stats:[{label:"Peak Hour",value:F1(((i=(a=e[0])==null?void 0:a.peakOrderHour)==null?void 0:i.hour)||0),description:`${((s=(o=e[0])==null?void 0:o.peakOrderHour)==null?void 0:s.count)||0} orders`},{label:"Average Orders per Hour",value:(((l=e[0])==null?void 0:l.orderCount)/24).toFixed(1),description:"orders"}]})})]})},Tbe=({data:e})=>{var a;if(!(e!=null&&e.length))return f.jsx("div",{className:"text-muted-foreground",children:"No data available for the selected time range."});const t=((a=e[0])==null?void 0:a.refunds)||{total:0,count:0,reasons:{}},r=e.map(i=>{var o,s;return{timestamp:i.timestamp,total:((o=i.refunds)==null?void 0:o.total)||0,count:((s=i.refunds)==null?void 0:s.count)||0}}),n=Object.entries(t.reasons||{}).map(([i,o])=>({reason:i,count:o,percentage:o/t.count*100})).sort((i,o)=>o.count-i.count);return f.jsxs("div",{className:"space-y-8",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsx(Ot,{title:"Total Refunds",value:Ct(t.total),description:`${t.count.toLocaleString()} orders`,colorClass:"text-orange-600 dark:text-orange-400",icon:lD}),f.jsx(Ot,{title:"Average Refund",value:Ct(t.total/(t.count||1)),description:"per order",colorClass:"text-orange-600 dark:text-orange-400",icon:os})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Daily Refund Amount"}),f.jsx(Hr,{data:r,dataKey:"total",name:"Refund Amount",color:"hsl(20.5 90.2% 48.2%)",valueFormatter:i=>Ct(i)})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Daily Refund Count"}),f.jsx(Hr,{data:r,dataKey:"count",name:"Refund Count",type:"bar",color:"hsl(20.5 90.2% 48.2%)"})]}),n.length>0&&f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Refund Reasons"}),f.jsx("div",{className:"rounded-lg border bg-card",children:f.jsxs(ua,{children:[f.jsx(fa,{children:f.jsxs(er,{children:[f.jsx(Fe,{children:"Reason"}),f.jsx(Fe,{className:"text-right",children:"Count"}),f.jsx(Fe,{className:"text-right",children:"% of Total"})]})}),f.jsx(da,{children:n.map((i,o)=>f.jsxs(er,{children:[f.jsx(Be,{className:"font-medium",children:i.reason}),f.jsx(Be,{className:"text-right",children:i.count.toLocaleString()}),f.jsxs(Be,{className:"text-right",children:[i.percentage.toFixed(1),"%"]})]},o))})]})})]})]})},Pbe=({data:e})=>{var o;if(!(e!=null&&e.length))return f.jsx("div",{className:"text-muted-foreground",children:"No data available for the selected time range."});const t=((o=e[0])==null?void 0:o.orderValueRange)||{largest:0,smallest:0,largestOrderId:null,smallestOrderId:null,distribution:{under25:{count:0,total:0},under50:{count:0,total:0},under100:{count:0,total:0},under200:{count:0,total:0},over200:{count:0,total:0}}},r=e.map(s=>{var l,u;return{timestamp:s.timestamp,largest:((l=s.orderValueRange)==null?void 0:l.largest)||0,smallest:((u=s.orderValueRange)==null?void 0:u.smallest)||0,average:s.averageOrderValue||0}}),n=[{range:"Under $25",...t.distribution.under25},{range:"$25-$50",...t.distribution.under50},{range:"$50-$100",...t.distribution.under100},{range:"$100-$200",...t.distribution.under200},{range:"Over $200",...t.distribution.over200}],a=n.reduce((s,l)=>s+(l.count||0),0),i=n.reduce((s,l)=>s+(l.total||0),0);return f.jsxs("div",{className:"space-y-8",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsx(Ot,{title:"Largest Order",value:Ct(t.largest),description:t.largestOrderId?`Order #${t.largestOrderId}`:null,colorClass:"text-violet-600 dark:text-violet-400",icon:nl}),f.jsx(Ot,{title:"Smallest Order",value:Ct(t.smallest),description:t.smallestOrderId?`Order #${t.smallestOrderId}`:null,colorClass:"text-violet-600 dark:text-violet-400",icon:fD})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Order Value Range Over Time"}),f.jsx(Hr,{data:r,dataKey:"largest",name:"Largest Order",color:"hsl(262.1 83.3% 57.8%)",valueFormatter:s=>Ct(s)})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Average Order Value Trend"}),f.jsx(Hr,{data:r,dataKey:"average",name:"Average Order Value",color:"hsl(221.2 83.2% 53.3%)",valueFormatter:s=>Ct(s)})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Order Value Distribution"}),f.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[f.jsx(Ot,{title:"Total Orders",value:a.toLocaleString(),description:"orders analyzed",colorClass:"text-violet-600 dark:text-violet-400",icon:Y1}),f.jsx(Ot,{title:"Total Revenue",value:Ct(i),description:"from all orders",colorClass:"text-violet-600 dark:text-violet-400",icon:os})]}),f.jsx("div",{className:"rounded-lg border bg-card",children:f.jsxs(ua,{children:[f.jsx(fa,{children:f.jsxs(er,{children:[f.jsx(Fe,{children:"Range"}),f.jsx(Fe,{className:"text-right",children:"Orders"}),f.jsx(Fe,{className:"text-right",children:"Total Revenue"}),f.jsx(Fe,{className:"text-right",children:"% of Orders"}),f.jsx(Fe,{className:"text-right",children:"Avg. Order Value"})]})}),f.jsx(da,{children:n.map((s,l)=>{var u;return f.jsxs(er,{children:[f.jsx(Be,{className:"font-medium",children:s.range}),f.jsx(Be,{className:"text-right",children:((u=s.count)==null?void 0:u.toLocaleString())||0}),f.jsx(Be,{className:"text-right",children:Ct(s.total||0)}),f.jsxs(Be,{className:"text-right",children:[(s.count/a*100).toFixed(1),"%"]}),f.jsx(Be,{className:"text-right",children:Ct((s.total||0)/(s.count||1))})]},l)})})]})})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium mb-4",children:"Distribution Chart"}),f.jsx(Hr,{data:n,dataKey:"count",name:"Orders",type:"bar",color:"hsl(262.1 83.3% 57.8%)"})]})]})},Ot=({title:e,value:t,description:r,trend:n,trendValue:a,valuePrefix:i="",valueSuffix:o="",trendPrefix:s="",trendSuffix:l="",className:u="",colorClass:h="text-gray-900 dark:text-gray-100",icon:p,iconColor:m="text-gray-500",onClick:v,info:b,onDetailsClick:g,isLoading:x=!1})=>f.jsxs(Ae,{className:`${u} ${v||g?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors":""}`,onClick:g||v,children:[f.jsxs(rt,{className:"flex flex-row items-center justify-between space-y-0 p-4 pb-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(st,{className:"text-sm font-medium text-gray-600 dark:text-gray-300",children:e}),b&&f.jsx(oD,{className:"w-4 h-4 text-muted-foreground cursor-help",title:b})]}),p&&f.jsx(p,{className:`h-4 w-4 ${m}`})]}),f.jsx(We,{className:"p-4 pt-0",children:x?f.jsxs(f.Fragment,{children:[f.jsx(Je,{className:"h-8 w-32 mb-2"}),f.jsx(Je,{className:"h-4 w-24"})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:`text-2xl font-bold ${h}`,children:[i,t,o]}),r&&f.jsxs("div",{className:"text-sm text-muted-foreground mt-2 items-center gap-2 flex",children:[r,n&&f.jsxs("span",{className:`flex items-center gap-1 ${n==="up"?"text-emerald-600 dark:text-emerald-400":"text-rose-600 dark:text-rose-400"}`,children:[n==="up"?f.jsx(JR,{className:"w-4 h-4"}):f.jsx(ZR,{className:"w-4 h-4"}),s,a,l]})]})]})})]}),Nbe=()=>{const[e,t]=w.useState({}),r=(o,s)=>`${o}_${s}`;return{setCacheData:(o,s,l)=>{t(u=>({...u,[r(o,s)]:{data:l,timestamp:Date.now()}}))},getCacheData:(o,s)=>{var u;const l=r(o,s);return(u=e[l])==null?void 0:u.data},clearCache:()=>t({})}},hR=w.memo(xbe),pR=w.memo(bbe),mR=w.memo(wbe),vR=w.memo(Tbe),gR=w.memo(Pbe),yR=w.memo(Abe),Cbe=w.memo(Obe),Ebe=w.memo(_be),kbe=w.memo(jbe),Mbe=w.memo(Sbe),Rbe=()=>f.jsxs(Ae,{children:[f.jsxs(rt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[f.jsx(Je,{className:"h-4 w-24"}),f.jsx(Je,{className:"h-4 w-4 rounded-full"})]}),f.jsxs(We,{children:[f.jsx(Je,{className:"h-8 w-32 mb-2"}),f.jsx(Je,{className:"h-4 w-24"})]})]}),Ud=({type:e="line"})=>f.jsx("div",{className:"h-[400px] w-full bg-gray-50 dark:bg-gray-800 rounded-lg p-4",children:f.jsx("div",{className:"h-full flex flex-col",children:f.jsx("div",{className:"flex-1 relative",children:e==="bar"?f.jsx("div",{className:"h-full flex items-end justify-between gap-1",children:[...Array(24)].map((t,r)=>f.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-t animate-pulse",style:{height:`${15+Math.random()*70}%`}},r))}):f.jsxs("div",{className:"h-full w-full relative",children:[[...Array(5)].map((t,r)=>f.jsx("div",{className:"absolute w-full h-px bg-gray-200 dark:bg-gray-700",style:{top:`${20+r*20}%`}},r)),f.jsx("div",{className:"absolute inset-0 bg-gray-300 dark:bg-gray-600 animate-pulse",style:{opacity:.2,clipPath:"polygon(0 50%, 100% 20%, 100% 100%, 0 100%)"}})]})})})}),Dbe=({rows:e=5})=>f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"grid grid-cols-3 gap-4 pb-2",children:[...Array(3)].map((t,r)=>f.jsx(Je,{className:"h-5 w-full"},r))}),[...Array(e)].map((t,r)=>f.jsx("div",{className:"grid grid-cols-3 gap-4 py-2",children:[...Array(3)].map((n,a)=>f.jsx(Je,{className:"h-4 w-full"},a))},r))]}),Ibe=({timeRange:e="today",startDate:t,endDate:r,title:n="Sales Dashboard",description:a=""})=>{var qe,ct,we,je,le,pe,he,Z,Ue,ie,ge,Ie,$e,vt,Ye,Tt,Pt,_t,ir,wr,tr,an,Ar,An,Ua,ji,Ti,Pi,Vr,ga,Ni,fs,ds,bf,wf,Sf;const[i,o]=w.useState(null),[s,l]=w.useState(!0),[u,h]=w.useState(null),[p,m]=w.useState(null),[v,b]=w.useState(e),[g,x]=w.useState(null),[S,O]=w.useState(null),[j,P]=w.useState({}),[A,T]=w.useState({}),[N,k]=w.useState(!0),{setCacheData:R,getCacheData:W,clearCache:E}=Nbe(),I=w.useCallback(fe=>["brands_categories","shipping"].includes(fe)?!1:["today","yesterday","last7days","thisWeek","lastWeek"].includes(v),[v]),L=w.useCallback(async(fe,ut)=>{var Vt,ya;const hr=I(fe)?"last30days":v,jn=W(hr,fe);if(jn)return console.log(`Using cached data for ${fe}`),T(Wt=>({...Wt,[fe]:jn})),jn;console.log(`Fetching detail data for ${fe}`),P(Wt=>({...Wt,[fe]:!0}));try{const Wt={...v==="custom"?{startDate:t,endDate:r}:{timeRange:hr},metric:fe,daily:!0};if(["shipping","brands_categories"].includes(fe)){const zt=[(await mt.get("/api/klaviyo/events/stats",{params:Wt})).data.stats];return R(hr,fe,zt),T(jr=>({...jr,[fe]:zt})),h(null),zt}if(["pre_orders","local_pickup","on_hold"].includes(fe)){const zt=(await mt.get("/api/klaviyo/events/stats/details",{params:{...Wt,orderType:ut}})).data.stats;return R(hr,fe,zt),T(jr=>({...jr,[fe]:zt})),h(null),zt}if(["refunds","cancellations"].includes(fe)){const zt=(await mt.get("/api/klaviyo/events/stats/details",{params:{...Wt,eventType:fe==="refunds"?"PAYMENT_REFUNDED":"CANCELED_ORDER"}})).data.stats;return R(hr,fe,zt),T(jr=>({...jr,[fe]:zt})),h(null),zt}if(fe==="order_range"){const zt=(await mt.get("/api/klaviyo/events/stats/details",{params:Wt})).data.stats.map(jr=>{var Va;return{...jr,orderValueRange:{...jr.orderValueRange,distribution:((Va=jr.orderValueRange)==null?void 0:Va.distribution)||{under25:{count:0,total:0},under50:{count:0,total:0},under100:{count:0,total:0},under200:{count:0,total:0},over200:{count:0,total:0}}}}});return R(hr,fe,zt),T(jr=>({...jr,[fe]:zt})),h(null),zt}const Ha=(await mt.get("/api/klaviyo/events/stats/details",{params:Wt})).data.stats;return R(hr,fe,Ha),T(xa=>({...xa,[fe]:Ha})),h(null),Ha}catch(Wt){return console.error(`Error fetching detail data for ${fe}:`,Wt),h(((ya=(Vt=Wt.response)==null?void 0:Vt.data)==null?void 0:ya.error)||Wt.message),null}finally{P(Wt=>({...Wt,[fe]:!1}))}},[v,t,r,I,R,W]),$=w.useCallback(()=>{const fe=["revenue","orders","average_order","refunds","cancellations","order_range","pre_orders","local_pickup","on_hold"];return Promise.all(fe.map(ut=>L(ut,ut))).catch(ut=>{console.error("Error during detail data preload:",ut)})},[L]),F=w.useCallback((fe,ut)=>{if(!fe||!ut)return null;const hr=fe>=ut?"up":"down",Vt=Math.abs(fe-ut)/ut*100;return{trend:hr,value:Vt,current:fe,previous:ut}},[]),z=w.useCallback(()=>{if(!(i!=null&&i.prevPeriodRevenue)&&(i==null?void 0:i.prevPeriodRevenue)!==0)return null;const fe=i.periodProgress<100?i.projectedRevenue:i.revenue,ut=i.prevPeriodRevenue;if(!fe||!ut)return null;const hr=fe>=ut?"up":"down",Vt=Math.abs(fe-ut)/ut*100;return{trend:hr,value:Vt,current:fe,previous:ut}},[i]),H=w.useCallback(()=>i!=null&&i.prevPeriodOrders?F(i.orderCount,i.prevPeriodOrders):null,[i,F]),U=w.useCallback(()=>i!=null&&i.prevPeriodAOV?F(i.averageOrderValue,i.prevPeriodAOV):null,[i,F]);w.useEffect(()=>{let fe=!0;return(async()=>{var hr,jn,Vt,ya,Wt,Ci,Ha,xa,zt,jr,Va,Of,_f,Af;try{l(!0),o(null);const hs=["orders","revenue","refunds","cancellations","shipping"],[Wm,za]=await Promise.all([mt.get("/api/klaviyo/events/dateRange",{params:v==="custom"?{startDate:t,endDate:r}:{timeRange:v}}),mt.get("/api/klaviyo/events/batch",{params:{...v==="custom"?{startDate:t,endDate:r}:{timeRange:v},metrics:JSON.stringify(hs)}})]);if(!fe)return;const qm={...i,orderCount:((jn=(hr=za.data.orders)==null?void 0:hr.data)==null?void 0:jn.length)||0,revenue:((ya=(Vt=za.data.revenue)==null?void 0:Vt.data)==null?void 0:ya.reduce((yo,Ei)=>yo+(Number(Ei.value)||0),0))||0,refunds:{total:((Ci=(Wt=za.data.refunds)==null?void 0:Wt.data)==null?void 0:Ci.reduce((yo,Ei)=>yo+(Number(Ei.value)||0),0))||0,count:((xa=(Ha=za.data.refunds)==null?void 0:Ha.data)==null?void 0:xa.length)||0},canceledOrders:{total:((jr=(zt=za.data.cancellations)==null?void 0:zt.data)==null?void 0:jr.reduce((yo,Ei)=>yo+(Number(Ei.value)||0),0))||0,count:((Of=(Va=za.data.cancellations)==null?void 0:Va.data)==null?void 0:Of.length)||0},shipping:{shippedCount:((Af=(_f=za.data.shipping)==null?void 0:_f.data)==null?void 0:Af.length)||0}};O(Wm.data),o(qm),m(_e.now().setZone("America/New_York")),h(null),$()}catch(hs){console.error("Error loading data:",hs),fe&&h(hs.message)}finally{fe&&(l(!1),k(!1))}})(),()=>{fe=!1}},[v,t,r]),w.useEffect(()=>{if(v!=="today")return;const fe=setInterval(async()=>{try{const ut=await mt.get("/api/klaviyo/events/stats",{params:{timeRange:"today"}});o(ut.data.stats),m(_e.now().setZone("America/New_York"))}catch(ut){console.error("Error auto-refreshing stats:",ut)}},6e4);return()=>clearInterval(fe)},[v]);const Y=w.memo(({metric:fe,type:ut,orderCount:hr})=>{const jn=I(fe)?"last30days":v,Vt=A[fe]||W(jn,fe),ya=j[fe],Wt=["pre_orders","local_pickup","on_hold"].includes(fe);if(w.useEffect(()=>{let Ci=!0;return(async()=>{!Vt&&!ya&&await L(fe,Wt?fe:void 0)})(),()=>{Ci=!1}},[fe,v,Wt]),ya||!Vt&&!u)switch(fe){case"revenue":case"orders":case"average_order":return f.jsx(Ud,{type:"line"});case"refunds":case"order_range":case"pre_orders":case"local_pickup":case"on_hold":return f.jsx(Ud,{type:"bar"});case"brands_categories":case"shipping":return f.jsx(Dbe,{rows:8});case"peak_hour":return f.jsx(Ud,{type:"bar"});default:return f.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}if(!Vt&&u)return f.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:[f.jsx(mi,{className:"w-12 h-12 text-red-500 mb-4"}),f.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:"Error Loading Data"}),f.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:u}),f.jsx("button",{onClick:()=>L(fe),className:"px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",children:"Try Again"})]});if(!Vt)return f.jsx("div",{className:"text-muted-foreground",children:"No data available for the selected time range."});switch(fe){case"revenue":return f.jsx(hR,{data:Vt});case"orders":return f.jsx(pR,{data:Vt});case"average_order":return f.jsx(mR,{data:Vt,orderCount:hr});case"refunds":return f.jsx(vR,{data:Vt});case"order_range":return f.jsx(gR,{data:Vt});case"pre_orders":case"local_pickup":case"on_hold":return f.jsx(yR,{data:Vt,type:ut});default:return f.jsx("div",{className:"text-muted-foreground",children:"Invalid metric selected."})}});Y.displayName="AsyncDetailView";const se=w.useCallback(()=>{if(!g||!i)return f.jsx("div",{className:"text-muted-foreground",children:"No data available for the selected time range."});const fe=A[g];if(j[g])return f.jsx(Ud,{});switch(g){case"revenue":case"best_revenue_day":return f.jsx(hR,{data:fe||[]});case"orders":return f.jsx(pR,{data:fe||[]});case"average_order":return f.jsx(mR,{data:fe||[],orderCount:i.orderCount});case"refunds":return f.jsx(vR,{data:fe||[]});case"cancellations":return f.jsx(Mbe,{data:fe||[]});case"order_range":return f.jsx(gR,{data:fe||[]});case"pre_orders":case"local_pickup":case"on_hold":return f.jsx(yR,{data:fe||[],type:g});case"brands_categories":return f.jsx(Cbe,{data:[i]});case"shipping":return f.jsx(Ebe,{data:[i]});case"peak_hour":return["today","yesterday"].includes(v)?f.jsx(kbe,{data:[i]}):f.jsx("div",{className:"text-muted-foreground",children:"Peak hour details are only available for single-day periods."});default:return f.jsx("div",{className:"text-muted-foreground",children:"Invalid metric selected."})}},[g,i,v,A,j]);if(s&&!i)return f.jsxs(Ae,{className:"w-full bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{className:"p-6",children:f.jsx("div",{className:"flex flex-col space-y-2",children:f.jsxs("div",{className:"flex justify-between items-start",children:[f.jsxs("div",{children:[f.jsx(Je,{className:"h-6 w-48 mb-2"}),f.jsx(Je,{className:"h-4 w-64"})]}),f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsx(Je,{className:"h-4 w-32"}),f.jsx(Je,{className:"h-9 w-[180px]"})]})]})})}),f.jsx(We,{className:"p-6 pt-0",children:f.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[...Array(12)].map((fe,ut)=>f.jsx(Rbe,{},ut))})})]});if(u)return f.jsxs(Ae,{className:"w-full bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{className:"p-6",children:f.jsx("div",{className:"flex flex-col space-y-2",children:f.jsxs("div",{className:"flex justify-between items-start",children:[f.jsxs("div",{children:[f.jsx(st,{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:n}),a&&f.jsx(Ko,{className:"mt-1",children:a})]}),f.jsxs("div",{className:"flex items-center gap-4",children:[p&&!s&&f.jsxs("span",{className:"text-sm text-muted-foreground",children:["Last updated: ",p.toFormat("hh:mm a")]}),f.jsxs(su,{value:v,onValueChange:b,children:[f.jsx(ll,{className:"w-[180px] h-9",children:f.jsx(lu,{placeholder:"Select time range"})}),f.jsx(cl,{children:_p.map(fe=>f.jsx(lo,{value:fe.value,children:fe.label},fe.value))})]})]})]})})}),f.jsx(We,{className:"p-6 pt-0",children:f.jsxs("p",{className:"text-destructive text-center py-8",children:["Error loading stats: ",u]})})]});if(!i)return null;const ne=z(),ae=H(),ue=U(),Re=["today","yesterday"].includes(v);return f.jsxs(Ae,{className:"w-full bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{className:"p-6",children:f.jsx("div",{className:"flex flex-col space-y-2",children:f.jsxs("div",{className:"flex justify-between items-start",children:[f.jsxs("div",{children:[f.jsx(st,{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:n}),a&&f.jsx(Ko,{className:"mt-1",children:a})]}),f.jsxs("div",{className:"flex items-center gap-4",children:[p&&!s&&f.jsxs("span",{className:"text-sm text-muted-foreground",children:["Last updated: ",p.toFormat("hh:mm a")]}),f.jsxs(su,{value:v,onValueChange:b,children:[f.jsx(ll,{className:"w-[180px] h-9",children:f.jsx(lu,{placeholder:"Select time range"})}),f.jsx(cl,{children:_p.map(fe=>f.jsx(lo,{value:fe.value,children:fe.label},fe.value))})]})]})]})})}),f.jsxs(We,{className:"p-6 pt-0",children:[f.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[f.jsx(Ot,{title:"Total Revenue",value:Ct((i==null?void 0:i.revenue)||0),description:(i==null?void 0:i.periodProgress)<100?`${i.periodProgress.toFixed(1)}% complete • Projected: ${Ct(i.projectedRevenue)}`:`Previous: ${Ct(i.prevPeriodRevenue)}`,trend:ne==null?void 0:ne.trend,trendValue:ne!=null&&ne.value?Rb(ne.value):null,colorClass:"text-green-600 dark:text-green-400",icon:os,iconColor:"text-green-500",onDetailsClick:()=>x("revenue"),isLoading:s||!i}),f.jsx(Ot,{title:"Orders",value:i==null?void 0:i.orderCount,description:`${i==null?void 0:i.itemCount} total items`,trend:ae==null?void 0:ae.trend,trendValue:ae!=null&&ae.value?Rb(ae.value):null,colorClass:"text-blue-600 dark:text-blue-400",icon:Y1,iconColor:"text-blue-500",onDetailsClick:()=>x("orders"),isLoading:s||!i}),f.jsx(Ot,{title:"Average Order Value",value:(qe=i==null?void 0:i.averageOrderValue)==null?void 0:qe.toFixed(2),valuePrefix:"$",description:`${(ct=i==null?void 0:i.averageItemsPerOrder)==null?void 0:ct.toFixed(1)} items per order`,trend:ue==null?void 0:ue.trend,trendValue:ue!=null&&ue.value?Rb(ue.value):null,colorClass:"text-purple-600 dark:text-purple-400",icon:_V,iconColor:"text-purple-500",onDetailsClick:()=>x("average_order"),isLoading:s||!i}),f.jsx(Ot,{title:"Brands & Categories",value:((we=i==null?void 0:i.brands)==null?void 0:we.total)||0,description:`${((je=i==null?void 0:i.categories)==null?void 0:je.total)||0} categories`,colorClass:"text-indigo-600 dark:text-indigo-400",icon:BV,iconColor:"text-indigo-500",onDetailsClick:()=>x("brands_categories"),isLoading:s||!i}),f.jsx(Ot,{title:"Shipped Orders",value:((le=i==null?void 0:i.shipping)==null?void 0:le.shippedCount)||0,description:`${((he=(pe=i==null?void 0:i.shipping)==null?void 0:pe.locations)==null?void 0:he.total)||0} locations`,colorClass:"text-teal-600 dark:text-teal-400",icon:Fl,iconColor:"text-teal-500",onDetailsClick:()=>x("shipping"),isLoading:s||!i}),f.jsx(Ot,{title:"Pre-Orders",value:((ie=(Ue=(Z=i==null?void 0:i.orderTypes)==null?void 0:Z.preOrders)==null?void 0:Ue.percentage)==null?void 0:ie.toFixed(1))||"0",valueSuffix:"%",description:`${((Ie=(ge=i==null?void 0:i.orderTypes)==null?void 0:ge.preOrders)==null?void 0:Ie.count)||0} orders`,colorClass:"text-yellow-600 dark:text-yellow-400",icon:oh,iconColor:"text-yellow-500",onDetailsClick:()=>x("pre_orders"),isLoading:s||!i}),f.jsx(Ot,{title:"Local Pickup",value:((Ye=(vt=($e=i==null?void 0:i.orderTypes)==null?void 0:$e.localPickup)==null?void 0:vt.percentage)==null?void 0:Ye.toFixed(1))||"0",valueSuffix:"%",description:`${((Pt=(Tt=i==null?void 0:i.orderTypes)==null?void 0:Tt.localPickup)==null?void 0:Pt.count)||0} orders`,colorClass:"text-cyan-600 dark:text-cyan-400",icon:EV,iconColor:"text-cyan-500",onDetailsClick:()=>x("local_pickup"),isLoading:s||!i}),f.jsx(Ot,{title:"On Hold",value:((wr=(ir=(_t=i==null?void 0:i.orderTypes)==null?void 0:_t.heldItems)==null?void 0:ir.percentage)==null?void 0:wr.toFixed(1))||"0",valueSuffix:"%",description:`${((an=(tr=i==null?void 0:i.orderTypes)==null?void 0:tr.heldItems)==null?void 0:an.count)||0} orders`,colorClass:"text-red-600 dark:text-red-400",icon:mi,iconColor:"text-red-500",onDetailsClick:()=>x("on_hold"),isLoading:s||!i}),Re?f.jsx(Ot,{title:"Peak Hour",value:((Ar=i==null?void 0:i.peakOrderHour)==null?void 0:Ar.displayHour)||"N/A",description:i!=null&&i.peakOrderHour?`${i==null?void 0:i.peakOrderHour.count} orders`:null,colorClass:"text-pink-600 dark:text-pink-400",icon:oh,iconColor:"text-pink-500",onDetailsClick:()=>x("peak_hour"),isLoading:s||!i}):f.jsx(Ot,{title:"Best Revenue Day",value:((Ua=(An=i==null?void 0:i.bestRevenueDay)==null?void 0:An.amount)==null?void 0:Ua.toFixed(2))||"N/A",valuePrefix:"$",description:(ji=i==null?void 0:i.bestRevenueDay)!=null&&ji.displayDate?new Date(i==null?void 0:i.bestRevenueDay.displayDate).toLocaleDateString("en-US",{month:"short",day:"numeric"}):"N/A",colorClass:"text-emerald-600 dark:text-emerald-400",icon:nl,iconColor:"text-emerald-500",isLoading:s||!i}),f.jsx(Ot,{title:"Refunds",value:((Pi=(Ti=i==null?void 0:i.refunds)==null?void 0:Ti.total)==null?void 0:Pi.toFixed(2))||"0.00",valuePrefix:"$",description:`${((Vr=i==null?void 0:i.refunds)==null?void 0:Vr.count)||0} refund orders`,colorClass:"text-orange-600 dark:text-orange-400",icon:lD,iconColor:"text-orange-500",onDetailsClick:()=>x("refunds"),isLoading:s||!i}),f.jsx(Ot,{title:"Cancellations",value:((Ni=(ga=i==null?void 0:i.canceledOrders)==null?void 0:ga.total)==null?void 0:Ni.toFixed(2))||"0.00",valuePrefix:"$",description:`${((fs=i==null?void 0:i.canceledOrders)==null?void 0:fs.count)||0} canceled orders`,colorClass:"text-rose-600 dark:text-rose-400",icon:G1,iconColor:"text-rose-500",onDetailsClick:()=>x("cancellations"),isLoading:s||!i}),f.jsx(Ot,{title:"Order Range",value:((bf=(ds=i==null?void 0:i.orderValueRange)==null?void 0:ds.largest)==null?void 0:bf.toFixed(2))||"0.00",valuePrefix:"$",description:`Min: $${((Sf=(wf=i==null?void 0:i.orderValueRange)==null?void 0:wf.smallest)==null?void 0:Sf.toFixed(2))||"0.00"}`,colorClass:"text-violet-600 dark:text-violet-400",icon:nl,iconColor:"text-violet-500",onDetailsClick:()=>x("order_range"),isLoading:s||!i})]}),f.jsx(ybe,{open:!!g,onOpenChange:()=>x(null),title:g?`${g.split("_").map(fe=>fe.charAt(0).toUpperCase()+fe.slice(1)).join(" ")} Details`:"",children:se()})]})]})},$be=({timeRange:e="today",startDate:t,endDate:r,onTimeRangeChange:n,title:a="Top Products",description:i})=>{const[o,s]=w.useState([]),[l,u]=w.useState(!0),[h,p]=w.useState(null),[m,v]=w.useState(e),[b,g]=w.useState({startDate:dR(t)||"",endDate:dR(r)||""}),[x,S]=w.useState({column:"totalQuantity",direction:"desc"});w.useEffect(()=>{O()},[m,b.startDate,b.endDate]);const O=async()=>{var k,R;try{u(!0),p(null);const W=m==="custom"?{startDate:(k=Xi(b.startDate))==null?void 0:k.toISOString(),endDate:(R=Xi(b.endDate))==null?void 0:R.toISOString()}:{timeRange:m},E=await mt.get("/api/klaviyo/events/products",{params:W});s(E.data.stats.products.list||[])}catch(W){console.error("Error fetching products:",W),p(W.message)}finally{u(!1)}},j=k=>{v(k),n&&n(k)},P=k=>{S(R=>({column:k,direction:R.column===k&&R.direction==="desc"?"asc":"desc"}))},A=[...o].sort((k,R)=>{const W=x.direction==="desc"?-1:1,E=k[x.column],I=R[x.column];return typeof E=="number"?(E-I)*W:String(E).localeCompare(String(I))*W}),T=()=>f.jsxs(er,{children:[f.jsx(Be,{className:"w-[50px] p-1",children:f.jsx(Je,{className:"h-[50px] w-[50px] rounded"})}),f.jsx(Be,{className:"min-w-[200px] px-0",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(Je,{className:"h-4 w-[200px]"}),f.jsx(Je,{className:"h-4 w-[150px]"})]})}),f.jsx(Be,{className:"text-center px-0",children:f.jsx(Je,{className:"h-4 w-12 mx-auto"})}),f.jsx(Be,{className:"text-center px-0",children:f.jsx(Je,{className:"h-4 w-20 mx-auto"})}),f.jsx(Be,{className:"text-center px-0",children:f.jsx(Je,{className:"h-4 w-16 mx-auto"})}),f.jsx(Be,{className:"text-center hidden md:table-cell px-0",children:f.jsx(Je,{className:"h-4 w-16 mx-auto"})})]}),N=()=>f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx(Je,{className:"h-6 w-48 mb-2"}),f.jsx(Je,{className:"h-4 w-64"})]}),f.jsx("div",{className:"flex items-center gap-4",children:f.jsx(Je,{className:"h-9 w-[180px]"})})]}),f.jsxs(ua,{children:[f.jsx(fa,{children:f.jsxs(er,{className:"hover:bg-transparent",children:[f.jsx(Fe,{className:"w-[50px] min-w-[50px]",children:f.jsx(Je,{className:"h-4 w-4"})}),f.jsx(Fe,{className:"min-w-[200px]",children:f.jsx(Je,{className:"h-4 w-24"})}),f.jsx(Fe,{className:"text-right",children:f.jsx(Je,{className:"h-4 w-16 ml-auto"})}),f.jsx(Fe,{className:"text-right",children:f.jsx(Je,{className:"h-4 w-16 ml-auto"})}),f.jsx(Fe,{className:"text-right",children:f.jsx(Je,{className:"h-4 w-16 ml-auto"})}),f.jsx(Fe,{className:"text-right hidden md:table-cell",children:f.jsx(Je,{className:"h-4 w-16 ml-auto"})})]})}),f.jsx(da,{children:[...Array(10)].map((k,R)=>f.jsx(T,{},R))})]})]});return f.jsxs(Ae,{className:"flex flex-col h-full bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{className:"p-6",children:f.jsxs("div",{className:"flex justify-between items-start",children:[f.jsxs("div",{children:[f.jsx(st,{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:a}),i&&f.jsx(Ko,{className:"mt-1",children:i})]}),f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsxs(su,{value:m,onValueChange:j,children:[f.jsx(ll,{className:"w-[180px] h-9",children:f.jsx(lu,{placeholder:"Select time range"})}),f.jsxs(cl,{children:[_p.map(k=>f.jsx(lo,{value:k.value,children:k.label},k.value)),f.jsx(lo,{value:"custom",children:"Custom Range"})]})]}),m==="custom"&&f.jsxs("div",{className:"flex gap-2",children:[f.jsxs("div",{children:[f.jsx(pn,{htmlFor:"startDate",className:"sr-only",children:"Start Date"}),f.jsx(Yo,{id:"startDate",type:"datetime-local",value:b.startDate,onChange:k=>g(R=>({...R,startDate:k.target.value})),className:"h-9"})]}),f.jsxs("div",{children:[f.jsx(pn,{htmlFor:"endDate",className:"sr-only",children:"End Date"}),f.jsx(Yo,{id:"endDate",type:"datetime-local",value:b.endDate,onChange:k=>g(R=>({...R,endDate:k.target.value})),className:"h-9"})]})]})]})]})}),f.jsx(We,{className:"p-6 pt-0 flex-1 overflow-hidden",children:f.jsx(e_,{className:"h-full",children:l&&!o.length?f.jsx(N,{}):h?f.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[f.jsx(mi,{className:"h-12 w-12 text-destructive mb-4"}),f.jsx("p",{className:"font-medium mb-2",children:"Error loading products"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:h})]}):o!=null&&o.length?f.jsxs(ua,{children:[f.jsx(fa,{children:f.jsxs(er,{className:"hover:bg-transparent",children:[f.jsx(Fe,{className:"w-[50px] min-w-[50px]"}),f.jsx(Fe,{className:"min-w-[200px] pr-0 pl-1",children:f.jsxs(xr,{variant:"ghost",onClick:()=>P("name"),className:"h-8 justify-start w-full font-medium hover:bg-transparent",children:["Product",f.jsx(Ws,{className:"ml-2 h-4 w-4"})]})}),f.jsx(Fe,{className:"text-right px-0",children:f.jsxs(xr,{variant:"ghost",onClick:()=>P("totalQuantity"),className:"h-8 justify-end w-full font-medium hover:bg-transparent",children:["Sold",f.jsx(Ws,{className:"ml-2 h-4 w-4"})]})}),f.jsx(Fe,{className:"text-right px-0",children:f.jsxs(xr,{variant:"ghost",onClick:()=>P("totalRevenue"),className:"h-8 justify-end w-full font-medium hover:bg-transparent",children:["Rev",f.jsx(Ws,{className:"ml-2 h-4 w-4"})]})}),f.jsx(Fe,{className:"text-right px-0",children:f.jsxs(xr,{variant:"ghost",onClick:()=>P("orderCount"),className:"h-8 justify-end w-full font-medium hover:bg-transparent",children:["Orders",f.jsx(Ws,{className:"ml-2 h-4 w-4"})]})}),f.jsx(Fe,{className:"text-right hidden md:table-cell",children:f.jsxs(xr,{variant:"ghost",onClick:()=>P("price"),className:"h-8 justify-end w-full font-medium hover:bg-transparent",children:["Price",f.jsx(Ws,{className:"ml-2 h-4 w-4"})]})})]})}),f.jsx(da,{children:A.map(k=>f.jsxs(er,{className:"group hover:bg-muted/50",children:[f.jsx(Be,{className:"w-[50px] p-1",children:k.ImgThumb&&f.jsx("img",{src:k.ImgThumb,alt:"",width:50,height:50,className:"rounded bg-muted",onError:R=>R.target.style.display="none"})}),f.jsx(Be,{className:"min-w-[200px] px-0",children:f.jsxs("div",{className:"flex flex-col min-w-0",children:[f.jsx("a",{href:`https://backend.acherryontop.com/product/${k.id}`,target:"_blank",rel:"noopener noreferrer",className:"font-medium hover:underline line-clamp-2 text-gray-900 dark:text-gray-100",children:k.name}),f.jsx("div",{className:"flex gap-2 text-sm text-muted-foreground px-0",children:f.jsxs("span",{children:["$",k.price.toFixed(2)]})})]})}),f.jsx(Be,{className:"text-center font-medium px-0",children:k.totalQuantity}),f.jsxs(Be,{className:"text-center text-emerald-600 dark:text-emerald-400 font-medium px-0",children:["$",k.totalRevenue.toFixed(2)]}),f.jsx(Be,{className:"text-center text-muted-foreground px-0",children:k.orderCount}),f.jsxs(Be,{className:"text-center hidden md:table-cell px-0",children:["$",k.price.toFixed(2)]})]},k.id))})]}):f.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[f.jsx(Fl,{className:"h-12 w-12 text-muted-foreground mb-4"}),f.jsx("p",{className:"font-medium mb-2",children:"No product data available"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Try selecting a different time range"})]})})})]})};function xR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function F5(...e){return t=>{let r=!1;const n=e.map(a=>{const i=xR(a,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;at[r][n]??r,e)}var W5=e=>{const{present:t,children:r}=e,n=Fbe(t),a=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),i=B5(n.ref,Bbe(a));return typeof r=="function"||n.isPresent?w.cloneElement(a,{ref:i}):null};W5.displayName="Presence";function Fbe(e){const[t,r]=w.useState(),n=w.useRef({}),a=w.useRef(e),i=w.useRef("none"),o=e?"mounted":"unmounted",[s,l]=Lbe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=Hd(n.current);i.current=s==="mounted"?u:"none"},[s]),fr(()=>{const u=n.current,h=a.current;if(h!==e){const m=i.current,v=Hd(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(h&&m!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),fr(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,p=v=>{const g=Hd(n.current).includes(v.animationName);if(v.target===t&&g&&(l("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=v=>{v.target===t&&(i.current=Hd(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function Hd(e){return(e==null?void 0:e.animationName)||"none"}function Bbe(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var q5=w.forwardRef((e,t)=>{const{children:r,...n}=e,a=w.Children.toArray(r),i=a.find(qbe);if(i){const o=i.props.children,s=a.map(l=>l===i?w.Children.count(o)>1?w.Children.only(null):w.isValidElement(o)?o.props.children:null:l);return f.jsx(B1,{...n,ref:t,children:w.isValidElement(o)?w.cloneElement(o,void 0,s):null})}return f.jsx(B1,{...n,ref:t,children:r})});q5.displayName="Slot";var B1=w.forwardRef((e,t)=>{const{children:r,...n}=e;if(w.isValidElement(r)){const a=Hbe(r);return w.cloneElement(r,{...Ube(n,r.props),ref:t?F5(t,a):a})}return w.Children.count(r)>1?w.Children.only(null):null});B1.displayName="SlotClone";var Wbe=({children:e})=>f.jsx(f.Fragment,{children:e});function qbe(e){return w.isValidElement(e)&&e.type===Wbe}function Ube(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...s)=>{i(...s),a(...s)}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function Hbe(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Vbe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],U5=Vbe.reduce((e,t)=>{const r=w.forwardRef((n,a)=>{const{asChild:i,...o}=n,s=i?q5:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(s,{...o,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),l_="Checkbox",[zbe,bwe]=co(l_),[Gbe,Kbe]=zbe(l_),H5=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:a,defaultChecked:i,required:o,disabled:s,value:l="on",onCheckedChange:u,form:h,...p}=e,[m,v]=w.useState(null),b=B5(t,P=>v(P)),g=w.useRef(!1),x=m?h||!!m.closest("form"):!0,[S=!1,O]=pi({prop:a,defaultProp:i,onChange:u}),j=w.useRef(S);return w.useEffect(()=>{const P=m==null?void 0:m.form;if(P){const A=()=>O(j.current);return P.addEventListener("reset",A),()=>P.removeEventListener("reset",A)}},[m,O]),f.jsxs(Gbe,{scope:r,state:S,disabled:s,children:[f.jsx(U5.button,{type:"button",role:"checkbox","aria-checked":no(S)?"mixed":S,"aria-required":o,"data-state":G5(S),"data-disabled":s?"":void 0,disabled:s,value:l,...p,ref:b,onKeyDown:bR(e.onKeyDown,P=>{P.key==="Enter"&&P.preventDefault()}),onClick:bR(e.onClick,P=>{O(A=>no(A)?!0:!A),x&&(g.current=P.isPropagationStopped(),g.current||P.stopPropagation())})}),x&&f.jsx(Ybe,{control:m,bubbles:!g.current,name:n,value:l,checked:S,required:o,disabled:s,form:h,style:{transform:"translateX(-100%)"},defaultChecked:no(i)?!1:i})]})});H5.displayName=l_;var V5="CheckboxIndicator",z5=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...a}=e,i=Kbe(V5,r);return f.jsx(W5,{present:n||no(i.state)||i.state===!0,children:f.jsx(U5.span,{"data-state":G5(i.state),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});z5.displayName=V5;var Ybe=e=>{const{control:t,checked:r,bubbles:n=!0,defaultChecked:a,...i}=e,o=w.useRef(null),s=e$(r),l=GD(t);w.useEffect(()=>{const h=o.current,p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(s!==r&&v){const b=new Event("click",{bubbles:n});h.indeterminate=no(r),v.call(h,no(r)?!1:r),h.dispatchEvent(b)}},[s,r,n]);const u=w.useRef(no(r)?!1:r);return f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??u.current,...i,tabIndex:-1,ref:o,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function no(e){return e==="indeterminate"}function G5(e){return no(e)?"indeterminate":e?"checked":"unchecked"}var K5=H5,Xbe=z5;const Gi=w.forwardRef(({className:e,...t},r)=>f.jsx(K5,{ref:r,className:de("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:f.jsx(Xbe,{className:de("flex items-center justify-center text-current"),children:f.jsx(QR,{className:"h-4 w-4"})})}));Gi.displayName=K5.displayName;var zc={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */var Zbe=zc.exports,wR;function Jbe(){return wR||(wR=1,function(e,t){(function(){var r,n="4.17.21",a=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,h="__lodash_placeholder__",p=1,m=2,v=4,b=1,g=2,x=1,S=2,O=4,j=8,P=16,A=32,T=64,N=128,k=256,R=512,W=30,E="...",I=800,L=16,$=1,F=2,z=3,H=1/0,U=9007199254740991,Y=17976931348623157e292,se=NaN,ne=4294967295,ae=ne-1,ue=ne>>>1,Re=[["ary",N],["bind",x],["bindKey",S],["curry",j],["curryRight",P],["flip",R],["partial",A],["partialRight",T],["rearg",k]],qe="[object Arguments]",ct="[object Array]",we="[object AsyncFunction]",je="[object Boolean]",le="[object Date]",pe="[object DOMException]",he="[object Error]",Z="[object Function]",Ue="[object GeneratorFunction]",ie="[object Map]",ge="[object Number]",Ie="[object Null]",$e="[object Object]",vt="[object Promise]",Ye="[object Proxy]",Tt="[object RegExp]",Pt="[object Set]",_t="[object String]",ir="[object Symbol]",wr="[object Undefined]",tr="[object WeakMap]",an="[object WeakSet]",Ar="[object ArrayBuffer]",An="[object DataView]",Ua="[object Float32Array]",ji="[object Float64Array]",Ti="[object Int8Array]",Pi="[object Int16Array]",Vr="[object Int32Array]",ga="[object Uint8Array]",Ni="[object Uint8ClampedArray]",fs="[object Uint16Array]",ds="[object Uint32Array]",bf=/\b__p \+= '';/g,wf=/\b(__p \+=) '' \+/g,Sf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,fe=/&(?:amp|lt|gt|quot|#39);/g,ut=/[&<>"']/g,hr=RegExp(fe.source),jn=RegExp(ut.source),Vt=/<%-([\s\S]+?)%>/g,ya=/<%([\s\S]+?)%>/g,Wt=/<%=([\s\S]+?)%>/g,Ci=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ha=/^\w*$/,xa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zt=/[\\^$.*+?()[\]{}|]/g,jr=RegExp(zt.source),Va=/^\s+/,Of=/\s/,_f=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Af=/\{\n\/\* \[wrapped with (.+)\] \*/,hs=/,? & /,Wm=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,za=/[()=,{}\[\]\/\s]/,qm=/\\(\\)?/g,yo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ei=/\w*$/,X5=/^[-+]0x[0-9a-f]+$/i,Z5=/^0b[01]+$/i,J5=/^\[object .+?Constructor\]$/,Q5=/^0o[0-7]+$/i,e9=/^(?:0|[1-9]\d*)$/,t9=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jf=/($^)/,r9=/['\n\r\u2028\u2029\\]/g,Tf="\\ud800-\\udfff",n9="\\u0300-\\u036f",a9="\\ufe20-\\ufe2f",i9="\\u20d0-\\u20ff",c_=n9+a9+i9,u_="\\u2700-\\u27bf",f_="a-z\\xdf-\\xf6\\xf8-\\xff",o9="\\xac\\xb1\\xd7\\xf7",s9="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",l9="\\u2000-\\u206f",c9=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",d_="A-Z\\xc0-\\xd6\\xd8-\\xde",h_="\\ufe0e\\ufe0f",p_=o9+s9+l9+c9,Um="['’]",u9="["+Tf+"]",m_="["+p_+"]",Pf="["+c_+"]",v_="\\d+",f9="["+u_+"]",g_="["+f_+"]",y_="[^"+Tf+p_+v_+u_+f_+d_+"]",Hm="\\ud83c[\\udffb-\\udfff]",d9="(?:"+Pf+"|"+Hm+")",x_="[^"+Tf+"]",Vm="(?:\\ud83c[\\udde6-\\uddff]){2}",zm="[\\ud800-\\udbff][\\udc00-\\udfff]",ps="["+d_+"]",b_="\\u200d",w_="(?:"+g_+"|"+y_+")",h9="(?:"+ps+"|"+y_+")",S_="(?:"+Um+"(?:d|ll|m|re|s|t|ve))?",O_="(?:"+Um+"(?:D|LL|M|RE|S|T|VE))?",__=d9+"?",A_="["+h_+"]?",p9="(?:"+b_+"(?:"+[x_,Vm,zm].join("|")+")"+A_+__+")*",m9="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",v9="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",j_=A_+__+p9,g9="(?:"+[f9,Vm,zm].join("|")+")"+j_,y9="(?:"+[x_+Pf+"?",Pf,Vm,zm,u9].join("|")+")",x9=RegExp(Um,"g"),b9=RegExp(Pf,"g"),Gm=RegExp(Hm+"(?="+Hm+")|"+y9+j_,"g"),w9=RegExp([ps+"?"+g_+"+"+S_+"(?="+[m_,ps,"$"].join("|")+")",h9+"+"+O_+"(?="+[m_,ps+w_,"$"].join("|")+")",ps+"?"+w_+"+"+S_,ps+"+"+O_,v9,m9,v_,g9].join("|"),"g"),S9=RegExp("["+b_+Tf+c_+h_+"]"),O9=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_9=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],A9=-1,$t={};$t[Ua]=$t[ji]=$t[Ti]=$t[Pi]=$t[Vr]=$t[ga]=$t[Ni]=$t[fs]=$t[ds]=!0,$t[qe]=$t[ct]=$t[Ar]=$t[je]=$t[An]=$t[le]=$t[he]=$t[Z]=$t[ie]=$t[ge]=$t[$e]=$t[Tt]=$t[Pt]=$t[_t]=$t[tr]=!1;var kt={};kt[qe]=kt[ct]=kt[Ar]=kt[An]=kt[je]=kt[le]=kt[Ua]=kt[ji]=kt[Ti]=kt[Pi]=kt[Vr]=kt[ie]=kt[ge]=kt[$e]=kt[Tt]=kt[Pt]=kt[_t]=kt[ir]=kt[ga]=kt[Ni]=kt[fs]=kt[ds]=!0,kt[he]=kt[Z]=kt[tr]=!1;var j9={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},T9={"&":"&","<":"<",">":">",'"':""","'":"'"},P9={"&":"&","<":"<",">":">",""":'"',"'":"'"},N9={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},C9=parseFloat,E9=parseInt,T_=typeof Qi=="object"&&Qi&&Qi.Object===Object&&Qi,k9=typeof self=="object"&&self&&self.Object===Object&&self,Sr=T_||k9||Function("return this")(),Km=t&&!t.nodeType&&t,xo=Km&&!0&&e&&!e.nodeType&&e,P_=xo&&xo.exports===Km,Ym=P_&&T_.process,Tn=function(){try{var G=xo&&xo.require&&xo.require("util").types;return G||Ym&&Ym.binding&&Ym.binding("util")}catch{}}(),N_=Tn&&Tn.isArrayBuffer,C_=Tn&&Tn.isDate,E_=Tn&&Tn.isMap,k_=Tn&&Tn.isRegExp,M_=Tn&&Tn.isSet,R_=Tn&&Tn.isTypedArray;function on(G,ee,X){switch(X.length){case 0:return G.call(ee);case 1:return G.call(ee,X[0]);case 2:return G.call(ee,X[0],X[1]);case 3:return G.call(ee,X[0],X[1],X[2])}return G.apply(ee,X)}function M9(G,ee,X,ye){for(var He=-1,ht=G==null?0:G.length;++He-1}function Xm(G,ee,X){for(var ye=-1,He=G==null?0:G.length;++ye-1;);return X}function q_(G,ee){for(var X=G.length;X--&&ms(ee,G[X],0)>-1;);return X}function q9(G,ee){for(var X=G.length,ye=0;X--;)G[X]===ee&&++ye;return ye}var U9=ev(j9),H9=ev(T9);function V9(G){return"\\"+N9[G]}function z9(G,ee){return G==null?r:G[ee]}function vs(G){return S9.test(G)}function G9(G){return O9.test(G)}function K9(G){for(var ee,X=[];!(ee=G.next()).done;)X.push(ee.value);return X}function av(G){var ee=-1,X=Array(G.size);return G.forEach(function(ye,He){X[++ee]=[He,ye]}),X}function U_(G,ee){return function(X){return G(ee(X))}}function Ri(G,ee){for(var X=-1,ye=G.length,He=0,ht=[];++X-1}function DB(c,d){var y=this.__data__,_=zf(y,c);return _<0?(++this.size,y.push([c,d])):y[_][1]=d,this}Ga.prototype.clear=EB,Ga.prototype.delete=kB,Ga.prototype.get=MB,Ga.prototype.has=RB,Ga.prototype.set=DB;function Ka(c){var d=-1,y=c==null?0:c.length;for(this.clear();++d=d?c:d)),c}function En(c,d,y,_,C,D){var B,V=d&p,K=d&m,te=d&v;if(y&&(B=C?y(c,_,C,D):y(c)),B!==r)return B;if(!Ht(c))return c;var re=Ve(c);if(re){if(B=F8(c),!V)return zr(c,B)}else{var oe=Pr(c),me=oe==Z||oe==Ue;if(Bi(c))return AA(c,V);if(oe==$e||oe==qe||me&&!C){if(B=K||me?{}:HA(c),!V)return K?P8(c,ZB(B,c)):T8(c,tA(B,c))}else{if(!kt[oe])return C?c:{};B=B8(c,oe,V)}}D||(D=new Gn);var Se=D.get(c);if(Se)return Se;D.set(c,B),xj(c)?c.forEach(function(Ce){B.add(En(Ce,d,y,Ce,c,D))}):gj(c)&&c.forEach(function(Ce,tt){B.set(tt,En(Ce,d,y,tt,c,D))});var Ne=te?K?Cv:Nv:K?Kr:pr,Qe=re?r:Ne(c);return Pn(Qe||c,function(Ce,tt){Qe&&(tt=Ce,Ce=c[tt]),dc(B,tt,En(Ce,d,y,tt,c,D))}),B}function JB(c){var d=pr(c);return function(y){return rA(y,c,d)}}function rA(c,d,y){var _=y.length;if(c==null)return!_;for(c=Nt(c);_--;){var C=y[_],D=d[C],B=c[C];if(B===r&&!(C in c)||!D(B))return!1}return!0}function nA(c,d,y){if(typeof c!="function")throw new Nn(o);return xc(function(){c.apply(r,y)},d)}function hc(c,d,y,_){var C=-1,D=Nf,B=!0,V=c.length,K=[],te=d.length;if(!V)return K;y&&(d=qt(d,sn(y))),_?(D=Xm,B=!1):d.length>=a&&(D=oc,B=!1,d=new So(d));e:for(;++CC?0:C+y),_=_===r||_>C?C:Xe(_),_<0&&(_+=C),_=y>_?0:wj(_);y<_;)c[y++]=d;return c}function iA(c,d){var y=[];return Ii(c,function(_,C,D){d(_,C,D)&&y.push(_)}),y}function Or(c,d,y,_,C){var D=-1,B=c.length;for(y||(y=q8),C||(C=[]);++D0&&y(V)?d>1?Or(V,d-1,y,_,C):Mi(C,V):_||(C[C.length]=V)}return C}var fv=EA(),oA=EA(!0);function ba(c,d){return c&&fv(c,d,pr)}function dv(c,d){return c&&oA(c,d,pr)}function Kf(c,d){return ki(d,function(y){return Qa(c[y])})}function _o(c,d){d=Li(d,c);for(var y=0,_=d.length;c!=null&&y<_;)c=c[Sa(d[y++])];return y&&y==_?c:r}function sA(c,d,y){var _=d(c);return Ve(c)?_:Mi(_,y(c))}function Dr(c){return c==null?c===r?wr:Ie:bo&&bo in Nt(c)?I8(c):Y8(c)}function hv(c,d){return c>d}function t8(c,d){return c!=null&&wt.call(c,d)}function r8(c,d){return c!=null&&d in Nt(c)}function n8(c,d,y){return c>=Tr(d,y)&&c=120&&re.length>=120)?new So(B&&re):r}re=c[0];var oe=-1,me=V[0];e:for(;++oe-1;)V!==c&&Ff.call(V,K,1),Ff.call(c,K,1);return c}function gA(c,d){for(var y=c?d.length:0,_=y-1;y--;){var C=d[y];if(y==_||C!==D){var D=C;Ja(C)?Ff.call(c,C,1):Sv(c,C)}}return c}function xv(c,d){return c+qf(Z_()*(d-c+1))}function v8(c,d,y,_){for(var C=-1,D=sr(Wf((d-c)/(y||1)),0),B=X(D);D--;)B[_?D:++C]=c,c+=y;return B}function bv(c,d){var y="";if(!c||d<1||d>U)return y;do d%2&&(y+=c),d=qf(d/2),d&&(c+=c);while(d);return y}function et(c,d){return $v(GA(c,d,Yr),c+"")}function g8(c){return eA(Ts(c))}function y8(c,d){var y=Ts(c);return id(y,Oo(d,0,y.length))}function vc(c,d,y,_){if(!Ht(c))return c;d=Li(d,c);for(var C=-1,D=d.length,B=D-1,V=c;V!=null&&++CC?0:C+d),y=y>C?C:y,y<0&&(y+=C),C=d>y?0:y-d>>>0,d>>>=0;for(var D=X(C);++_>>1,B=c[D];B!==null&&!cn(B)&&(y?B<=d:B=a){var te=d?null:k8(c);if(te)return Ef(te);B=!1,C=oc,K=new So}else K=d?[]:V;e:for(;++_=_?c:kn(c,d,y)}var _A=cB||function(c){return Sr.clearTimeout(c)};function AA(c,d){if(d)return c.slice();var y=c.length,_=z_?z_(y):new c.constructor(y);return c.copy(_),_}function jv(c){var d=new c.constructor(c.byteLength);return new $f(d).set(new $f(c)),d}function O8(c,d){var y=d?jv(c.buffer):c.buffer;return new c.constructor(y,c.byteOffset,c.byteLength)}function _8(c){var d=new c.constructor(c.source,Ei.exec(c));return d.lastIndex=c.lastIndex,d}function A8(c){return fc?Nt(fc.call(c)):{}}function jA(c,d){var y=d?jv(c.buffer):c.buffer;return new c.constructor(y,c.byteOffset,c.length)}function TA(c,d){if(c!==d){var y=c!==r,_=c===null,C=c===c,D=cn(c),B=d!==r,V=d===null,K=d===d,te=cn(d);if(!V&&!te&&!D&&c>d||D&&B&&K&&!V&&!te||_&&B&&K||!y&&K||!C)return 1;if(!_&&!D&&!te&&c=V)return K;var te=y[_];return K*(te=="desc"?-1:1)}}return c.index-d.index}function PA(c,d,y,_){for(var C=-1,D=c.length,B=y.length,V=-1,K=d.length,te=sr(D-B,0),re=X(K+te),oe=!_;++V1?y[C-1]:r,B=C>2?y[2]:r;for(D=c.length>3&&typeof D=="function"?(C--,D):r,B&&Ir(y[0],y[1],B)&&(D=C<3?r:D,C=1),d=Nt(d);++_-1?C[D?d[B]:B]:r}}function RA(c){return Za(function(d){var y=d.length,_=y,C=Cn.prototype.thru;for(c&&d.reverse();_--;){var D=d[_];if(typeof D!="function")throw new Nn(o);if(C&&!B&&nd(D)=="wrapper")var B=new Cn([],!0)}for(_=B?_:y;++_1&&at.reverse(),re&&KV))return!1;var te=D.get(c),re=D.get(d);if(te&&re)return te==d&&re==c;var oe=-1,me=!0,Se=y&g?new So:r;for(D.set(c,d),D.set(d,c);++oe1?"& ":"")+d[_],d=d.join(y>2?", ":" "),c.replace(_f,`{ /* [wrapped with `+d+`] */ `)}function q8(c){return Ve(c)||To(c)||!!(Y_&&c&&c[Y_])}function Ja(c,d){var y=typeof c;return d=d??U,!!d&&(y=="number"||y!="symbol"&&e9.test(c))&&c>-1&&c%1==0&&c0){if(++d>=I)return arguments[0]}else d=0;return c.apply(r,arguments)}}function id(c,d){var y=-1,_=c.length,C=_-1;for(d=d===r?_:d;++y1?c[d-1]:r;return y=typeof y=="function"?(c.pop(),y):r,ij(c,y)});function oj(c){var d=M(c);return d.__chain__=!0,d}function QW(c,d){return d(c),c}function od(c,d){return d(c)}var eq=Za(function(c){var d=c.length,y=d?c[0]:0,_=this.__wrapped__,C=function(D){return uv(D,c)};return d>1||this.__actions__.length||!(_ instanceof nt)||!Ja(y)?this.thru(C):(_=_.slice(y,+y+(d?1:0)),_.__actions__.push({func:od,args:[C],thisArg:r}),new Cn(_,this.__chain__).thru(function(D){return d&&!D.length&&D.push(r),D}))});function tq(){return oj(this)}function rq(){return new Cn(this.value(),this.__chain__)}function nq(){this.__values__===r&&(this.__values__=bj(this.value()));var c=this.__index__>=this.__values__.length,d=c?r:this.__values__[this.__index__++];return{done:c,value:d}}function aq(){return this}function iq(c){for(var d,y=this;y instanceof Vf;){var _=QA(y);_.__index__=0,_.__values__=r,d?C.__wrapped__=_:d=_;var C=_;y=y.__wrapped__}return C.__wrapped__=c,d}function oq(){var c=this.__wrapped__;if(c instanceof nt){var d=c;return this.__actions__.length&&(d=new nt(this)),d=d.reverse(),d.__actions__.push({func:od,args:[Lv],thisArg:r}),new Cn(d,this.__chain__)}return this.thru(Lv)}function sq(){return SA(this.__wrapped__,this.__actions__)}var lq=Jf(function(c,d,y){wt.call(c,y)?++c[y]:Ya(c,y,1)});function cq(c,d,y){var _=Ve(c)?D_:QB;return y&&Ir(c,d,y)&&(d=r),_(c,Pe(d,3))}function uq(c,d){var y=Ve(c)?ki:iA;return y(c,Pe(d,3))}var fq=MA(ej),dq=MA(tj);function hq(c,d){return Or(sd(c,d),1)}function pq(c,d){return Or(sd(c,d),H)}function mq(c,d,y){return y=y===r?1:Xe(y),Or(sd(c,d),y)}function sj(c,d){var y=Ve(c)?Pn:Ii;return y(c,Pe(d,3))}function lj(c,d){var y=Ve(c)?R9:aA;return y(c,Pe(d,3))}var vq=Jf(function(c,d,y){wt.call(c,y)?c[y].push(d):Ya(c,y,[d])});function gq(c,d,y,_){c=Gr(c)?c:Ts(c),y=y&&!_?Xe(y):0;var C=c.length;return y<0&&(y=sr(C+y,0)),dd(c)?y<=C&&c.indexOf(d,y)>-1:!!C&&ms(c,d,y)>-1}var yq=et(function(c,d,y){var _=-1,C=typeof d=="function",D=Gr(c)?X(c.length):[];return Ii(c,function(B){D[++_]=C?on(d,B,y):pc(B,d,y)}),D}),xq=Jf(function(c,d,y){Ya(c,y,d)});function sd(c,d){var y=Ve(c)?qt:fA;return y(c,Pe(d,3))}function bq(c,d,y,_){return c==null?[]:(Ve(d)||(d=d==null?[]:[d]),y=_?r:y,Ve(y)||(y=y==null?[]:[y]),mA(c,d,y))}var wq=Jf(function(c,d,y){c[y?0:1].push(d)},function(){return[[],[]]});function Sq(c,d,y){var _=Ve(c)?Zm:F_,C=arguments.length<3;return _(c,Pe(d,4),y,C,Ii)}function Oq(c,d,y){var _=Ve(c)?D9:F_,C=arguments.length<3;return _(c,Pe(d,4),y,C,aA)}function _q(c,d){var y=Ve(c)?ki:iA;return y(c,ud(Pe(d,3)))}function Aq(c){var d=Ve(c)?eA:g8;return d(c)}function jq(c,d,y){(y?Ir(c,d,y):d===r)?d=1:d=Xe(d);var _=Ve(c)?KB:y8;return _(c,d)}function Tq(c){var d=Ve(c)?YB:b8;return d(c)}function Pq(c){if(c==null)return 0;if(Gr(c))return dd(c)?gs(c):c.length;var d=Pr(c);return d==ie||d==Pt?c.size:vv(c).length}function Nq(c,d,y){var _=Ve(c)?Jm:w8;return y&&Ir(c,d,y)&&(d=r),_(c,Pe(d,3))}var Cq=et(function(c,d){if(c==null)return[];var y=d.length;return y>1&&Ir(c,d[0],d[1])?d=[]:y>2&&Ir(d[0],d[1],d[2])&&(d=[d[0]]),mA(c,Or(d,1),[])}),ld=uB||function(){return Sr.Date.now()};function Eq(c,d){if(typeof d!="function")throw new Nn(o);return c=Xe(c),function(){if(--c<1)return d.apply(this,arguments)}}function cj(c,d,y){return d=y?r:d,d=c&&d==null?c.length:d,Xa(c,N,r,r,r,r,d)}function uj(c,d){var y;if(typeof d!="function")throw new Nn(o);return c=Xe(c),function(){return--c>0&&(y=d.apply(this,arguments)),c<=1&&(d=r),y}}var Bv=et(function(c,d,y){var _=x;if(y.length){var C=Ri(y,As(Bv));_|=A}return Xa(c,_,d,y,C)}),fj=et(function(c,d,y){var _=x|S;if(y.length){var C=Ri(y,As(fj));_|=A}return Xa(d,_,c,y,C)});function dj(c,d,y){d=y?r:d;var _=Xa(c,j,r,r,r,r,r,d);return _.placeholder=dj.placeholder,_}function hj(c,d,y){d=y?r:d;var _=Xa(c,P,r,r,r,r,r,d);return _.placeholder=hj.placeholder,_}function pj(c,d,y){var _,C,D,B,V,K,te=0,re=!1,oe=!1,me=!0;if(typeof c!="function")throw new Nn(o);d=Rn(d)||0,Ht(y)&&(re=!!y.leading,oe="maxWait"in y,D=oe?sr(Rn(y.maxWait)||0,d):D,me="trailing"in y?!!y.trailing:me);function Se(Jt){var Yn=_,ti=C;return _=C=r,te=Jt,B=c.apply(ti,Yn),B}function Ne(Jt){return te=Jt,V=xc(tt,d),re?Se(Jt):B}function Qe(Jt){var Yn=Jt-K,ti=Jt-te,Mj=d-Yn;return oe?Tr(Mj,D-ti):Mj}function Ce(Jt){var Yn=Jt-K,ti=Jt-te;return K===r||Yn>=d||Yn<0||oe&&ti>=D}function tt(){var Jt=ld();if(Ce(Jt))return at(Jt);V=xc(tt,Qe(Jt))}function at(Jt){return V=r,me&&_?Se(Jt):(_=C=r,B)}function un(){V!==r&&_A(V),te=0,_=K=C=V=r}function $r(){return V===r?B:at(ld())}function fn(){var Jt=ld(),Yn=Ce(Jt);if(_=arguments,C=this,K=Jt,Yn){if(V===r)return Ne(K);if(oe)return _A(V),V=xc(tt,d),Se(K)}return V===r&&(V=xc(tt,d)),B}return fn.cancel=un,fn.flush=$r,fn}var kq=et(function(c,d){return nA(c,1,d)}),Mq=et(function(c,d,y){return nA(c,Rn(d)||0,y)});function Rq(c){return Xa(c,R)}function cd(c,d){if(typeof c!="function"||d!=null&&typeof d!="function")throw new Nn(o);var y=function(){var _=arguments,C=d?d.apply(this,_):_[0],D=y.cache;if(D.has(C))return D.get(C);var B=c.apply(this,_);return y.cache=D.set(C,B)||D,B};return y.cache=new(cd.Cache||Ka),y}cd.Cache=Ka;function ud(c){if(typeof c!="function")throw new Nn(o);return function(){var d=arguments;switch(d.length){case 0:return!c.call(this);case 1:return!c.call(this,d[0]);case 2:return!c.call(this,d[0],d[1]);case 3:return!c.call(this,d[0],d[1],d[2])}return!c.apply(this,d)}}function Dq(c){return uj(2,c)}var Iq=S8(function(c,d){d=d.length==1&&Ve(d[0])?qt(d[0],sn(Pe())):qt(Or(d,1),sn(Pe()));var y=d.length;return et(function(_){for(var C=-1,D=Tr(_.length,y);++C=d}),To=lA(function(){return arguments}())?lA:function(c){return Gt(c)&&wt.call(c,"callee")&&!K_.call(c,"callee")},Ve=X.isArray,Zq=N_?sn(N_):i8;function Gr(c){return c!=null&&fd(c.length)&&!Qa(c)}function Zt(c){return Gt(c)&&Gr(c)}function Jq(c){return c===!0||c===!1||Gt(c)&&Dr(c)==je}var Bi=dB||Jv,Qq=C_?sn(C_):o8;function e7(c){return Gt(c)&&c.nodeType===1&&!bc(c)}function t7(c){if(c==null)return!0;if(Gr(c)&&(Ve(c)||typeof c=="string"||typeof c.splice=="function"||Bi(c)||js(c)||To(c)))return!c.length;var d=Pr(c);if(d==ie||d==Pt)return!c.size;if(yc(c))return!vv(c).length;for(var y in c)if(wt.call(c,y))return!1;return!0}function r7(c,d){return mc(c,d)}function n7(c,d,y){y=typeof y=="function"?y:r;var _=y?y(c,d):r;return _===r?mc(c,d,r,y):!!_}function qv(c){if(!Gt(c))return!1;var d=Dr(c);return d==he||d==pe||typeof c.message=="string"&&typeof c.name=="string"&&!bc(c)}function a7(c){return typeof c=="number"&&X_(c)}function Qa(c){if(!Ht(c))return!1;var d=Dr(c);return d==Z||d==Ue||d==we||d==Ye}function vj(c){return typeof c=="number"&&c==Xe(c)}function fd(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=U}function Ht(c){var d=typeof c;return c!=null&&(d=="object"||d=="function")}function Gt(c){return c!=null&&typeof c=="object"}var gj=E_?sn(E_):l8;function i7(c,d){return c===d||mv(c,d,kv(d))}function o7(c,d,y){return y=typeof y=="function"?y:r,mv(c,d,kv(d),y)}function s7(c){return yj(c)&&c!=+c}function l7(c){if(V8(c))throw new He(i);return cA(c)}function c7(c){return c===null}function u7(c){return c==null}function yj(c){return typeof c=="number"||Gt(c)&&Dr(c)==ge}function bc(c){if(!Gt(c)||Dr(c)!=$e)return!1;var d=Lf(c);if(d===null)return!0;var y=wt.call(d,"constructor")&&d.constructor;return typeof y=="function"&&y instanceof y&&Rf.call(y)==oB}var Uv=k_?sn(k_):c8;function f7(c){return vj(c)&&c>=-U&&c<=U}var xj=M_?sn(M_):u8;function dd(c){return typeof c=="string"||!Ve(c)&&Gt(c)&&Dr(c)==_t}function cn(c){return typeof c=="symbol"||Gt(c)&&Dr(c)==ir}var js=R_?sn(R_):f8;function d7(c){return c===r}function h7(c){return Gt(c)&&Pr(c)==tr}function p7(c){return Gt(c)&&Dr(c)==an}var m7=rd(gv),v7=rd(function(c,d){return c<=d});function bj(c){if(!c)return[];if(Gr(c))return dd(c)?zn(c):zr(c);if(sc&&c[sc])return K9(c[sc]());var d=Pr(c),y=d==ie?av:d==Pt?Ef:Ts;return y(c)}function ei(c){if(!c)return c===0?c:0;if(c=Rn(c),c===H||c===-H){var d=c<0?-1:1;return d*Y}return c===c?c:0}function Xe(c){var d=ei(c),y=d%1;return d===d?y?d-y:d:0}function wj(c){return c?Oo(Xe(c),0,ne):0}function Rn(c){if(typeof c=="number")return c;if(cn(c))return se;if(Ht(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=Ht(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=B_(c);var y=Z5.test(c);return y||Q5.test(c)?E9(c.slice(2),y?2:8):X5.test(c)?se:+c}function Sj(c){return wa(c,Kr(c))}function g7(c){return c?Oo(Xe(c),-U,U):c===0?c:0}function gt(c){return c==null?"":ln(c)}var y7=Os(function(c,d){if(yc(d)||Gr(d)){wa(d,pr(d),c);return}for(var y in d)wt.call(d,y)&&dc(c,y,d[y])}),Oj=Os(function(c,d){wa(d,Kr(d),c)}),hd=Os(function(c,d,y,_){wa(d,Kr(d),c,_)}),x7=Os(function(c,d,y,_){wa(d,pr(d),c,_)}),b7=Za(uv);function w7(c,d){var y=Ss(c);return d==null?y:tA(y,d)}var S7=et(function(c,d){c=Nt(c);var y=-1,_=d.length,C=_>2?d[2]:r;for(C&&Ir(d[0],d[1],C)&&(_=1);++y<_;)for(var D=d[y],B=Kr(D),V=-1,K=B.length;++V1),D}),wa(c,Cv(c),y),_&&(y=En(y,p|m|v,M8));for(var C=d.length;C--;)Sv(y,d[C]);return y});function B7(c,d){return Aj(c,ud(Pe(d)))}var W7=Za(function(c,d){return c==null?{}:p8(c,d)});function Aj(c,d){if(c==null)return{};var y=qt(Cv(c),function(_){return[_]});return d=Pe(d),vA(c,y,function(_,C){return d(_,C[0])})}function q7(c,d,y){d=Li(d,c);var _=-1,C=d.length;for(C||(C=1,c=r);++_d){var _=c;c=d,d=_}if(y||c%1||d%1){var C=Z_();return Tr(c+C*(d-c+C9("1e-"+((C+"").length-1))),d)}return xv(c,d)}var Q7=_s(function(c,d,y){return d=d.toLowerCase(),c+(y?Pj(d):d)});function Pj(c){return zv(gt(c).toLowerCase())}function Nj(c){return c=gt(c),c&&c.replace(t9,U9).replace(b9,"")}function eU(c,d,y){c=gt(c),d=ln(d);var _=c.length;y=y===r?_:Oo(Xe(y),0,_);var C=y;return y-=d.length,y>=0&&c.slice(y,C)==d}function tU(c){return c=gt(c),c&&jn.test(c)?c.replace(ut,H9):c}function rU(c){return c=gt(c),c&&jr.test(c)?c.replace(zt,"\\$&"):c}var nU=_s(function(c,d,y){return c+(y?"-":"")+d.toLowerCase()}),aU=_s(function(c,d,y){return c+(y?" ":"")+d.toLowerCase()}),iU=kA("toLowerCase");function oU(c,d,y){c=gt(c),d=Xe(d);var _=d?gs(c):0;if(!d||_>=d)return c;var C=(d-_)/2;return td(qf(C),y)+c+td(Wf(C),y)}function sU(c,d,y){c=gt(c),d=Xe(d);var _=d?gs(c):0;return d&&_>>0,y?(c=gt(c),c&&(typeof d=="string"||d!=null&&!Uv(d))&&(d=ln(d),!d&&vs(c))?Fi(zn(c),0,y):c.split(d,y)):[]}var pU=_s(function(c,d,y){return c+(y?" ":"")+zv(d)});function mU(c,d,y){return c=gt(c),y=y==null?0:Oo(Xe(y),0,c.length),d=ln(d),c.slice(y,y+d.length)==d}function vU(c,d,y){var _=M.templateSettings;y&&Ir(c,d,y)&&(d=r),c=gt(c),d=hd({},d,_,FA);var C=hd({},d.imports,_.imports,FA),D=pr(C),B=nv(C,D),V,K,te=0,re=d.interpolate||jf,oe="__p += '",me=iv((d.escape||jf).source+"|"+re.source+"|"+(re===Wt?yo:jf).source+"|"+(d.evaluate||jf).source+"|$","g"),Se="//# sourceURL="+(wt.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++A9+"]")+` `;c.replace(me,function(Ce,tt,at,un,$r,fn){return at||(at=un),oe+=c.slice(te,fn).replace(r9,V9),tt&&(V=!0,oe+=`' + __e(`+tt+`) + '`),$r&&(K=!0,oe+=`'; `+$r+`; __p += '`),at&&(oe+=`' + ((__t = (`+at+`)) == null ? '' : __t) + '`),te=fn+Ce.length,Ce}),oe+=`'; `;var Ne=wt.call(d,"variable")&&d.variable;if(!Ne)oe=`with (obj) { `+oe+` } `;else if(za.test(Ne))throw new He(s);oe=(K?oe.replace(bf,""):oe).replace(wf,"$1").replace(Sf,"$1;"),oe="function("+(Ne||"obj")+`) { `+(Ne?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(V?", __e = _.escape":"")+(K?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+oe+`return __p }`;var Qe=Ej(function(){return ht(D,Se+"return "+oe).apply(r,B)});if(Qe.source=oe,qv(Qe))throw Qe;return Qe}function gU(c){return gt(c).toLowerCase()}function yU(c){return gt(c).toUpperCase()}function xU(c,d,y){if(c=gt(c),c&&(y||d===r))return B_(c);if(!c||!(d=ln(d)))return c;var _=zn(c),C=zn(d),D=W_(_,C),B=q_(_,C)+1;return Fi(_,D,B).join("")}function bU(c,d,y){if(c=gt(c),c&&(y||d===r))return c.slice(0,H_(c)+1);if(!c||!(d=ln(d)))return c;var _=zn(c),C=q_(_,zn(d))+1;return Fi(_,0,C).join("")}function wU(c,d,y){if(c=gt(c),c&&(y||d===r))return c.replace(Va,"");if(!c||!(d=ln(d)))return c;var _=zn(c),C=W_(_,zn(d));return Fi(_,C).join("")}function SU(c,d){var y=W,_=E;if(Ht(d)){var C="separator"in d?d.separator:C;y="length"in d?Xe(d.length):y,_="omission"in d?ln(d.omission):_}c=gt(c);var D=c.length;if(vs(c)){var B=zn(c);D=B.length}if(y>=D)return c;var V=y-gs(_);if(V<1)return _;var K=B?Fi(B,0,V).join(""):c.slice(0,V);if(C===r)return K+_;if(B&&(V+=K.length-V),Uv(C)){if(c.slice(V).search(C)){var te,re=K;for(C.global||(C=iv(C.source,gt(Ei.exec(C))+"g")),C.lastIndex=0;te=C.exec(re);)var oe=te.index;K=K.slice(0,oe===r?V:oe)}}else if(c.indexOf(ln(C),V)!=V){var me=K.lastIndexOf(C);me>-1&&(K=K.slice(0,me))}return K+_}function OU(c){return c=gt(c),c&&hr.test(c)?c.replace(fe,J9):c}var _U=_s(function(c,d,y){return c+(y?" ":"")+d.toUpperCase()}),zv=kA("toUpperCase");function Cj(c,d,y){return c=gt(c),d=y?r:d,d===r?G9(c)?tB(c):L9(c):c.match(d)||[]}var Ej=et(function(c,d){try{return on(c,r,d)}catch(y){return qv(y)?y:new He(y)}}),AU=Za(function(c,d){return Pn(d,function(y){y=Sa(y),Ya(c,y,Bv(c[y],c))}),c});function jU(c){var d=c==null?0:c.length,y=Pe();return c=d?qt(c,function(_){if(typeof _[1]!="function")throw new Nn(o);return[y(_[0]),_[1]]}):[],et(function(_){for(var C=-1;++CU)return[];var y=ne,_=Tr(c,ne);d=Pe(d),c-=ne;for(var C=rv(_,d);++y0||d<0)?new nt(y):(c<0?y=y.takeRight(-c):c&&(y=y.drop(c)),d!==r&&(d=Xe(d),y=d<0?y.dropRight(-d):y.take(d-c)),y)},nt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},nt.prototype.toArray=function(){return this.take(ne)},ba(nt.prototype,function(c,d){var y=/^(?:filter|find|map|reject)|While$/.test(d),_=/^(?:head|last)$/.test(d),C=M[_?"take"+(d=="last"?"Right":""):d],D=_||/^find/.test(d);C&&(M.prototype[d]=function(){var B=this.__wrapped__,V=_?[1]:arguments,K=B instanceof nt,te=V[0],re=K||Ve(B),oe=function(tt){var at=C.apply(M,Mi([tt],V));return _&&me?at[0]:at};re&&y&&typeof te=="function"&&te.length!=1&&(K=re=!1);var me=this.__chain__,Se=!!this.__actions__.length,Ne=D&&!me,Qe=K&&!Se;if(!D&&re){B=Qe?B:new nt(this);var Ce=c.apply(B,V);return Ce.__actions__.push({func:od,args:[oe],thisArg:r}),new Cn(Ce,me)}return Ne&&Qe?c.apply(this,V):(Ce=this.thru(oe),Ne?_?Ce.value()[0]:Ce.value():Ce)})}),Pn(["pop","push","shift","sort","splice","unshift"],function(c){var d=kf[c],y=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",_=/^(?:pop|shift)$/.test(c);M.prototype[c]=function(){var C=arguments;if(_&&!this.__chain__){var D=this.value();return d.apply(Ve(D)?D:[],C)}return this[y](function(B){return d.apply(Ve(B)?B:[],C)})}}),ba(nt.prototype,function(c,d){var y=M[d];if(y){var _=y.name+"";wt.call(ws,_)||(ws[_]=[]),ws[_].push({name:d,func:y})}}),ws[Qf(r,S).name]=[{name:"wrapper",func:r}],nt.prototype.clone=OB,nt.prototype.reverse=_B,nt.prototype.value=AB,M.prototype.at=eq,M.prototype.chain=tq,M.prototype.commit=rq,M.prototype.next=nq,M.prototype.plant=iq,M.prototype.reverse=oq,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=sq,M.prototype.first=M.prototype.head,sc&&(M.prototype[sc]=aq),M},ys=rB();xo?((xo.exports=ys)._=ys,Km._=ys):Sr._=ys}).call(Zbe)}(zc,zc.exports)),zc.exports}Jbe();const Zr=(e,t=!0)=>{if(typeof e!="number")return"$0.00";const r=parseFloat(e.toFixed(t?2:0));return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:t?2:0,maximumFractionDigits:t?2:0}).format(r)},Db=e=>typeof e!="number"?"0%":`${e>=0?"+":""}${Math.round(e)}%`,oi={revenue:"#8b5cf6",orders:"#10b981",avgOrderValue:"#9333ea",movingAverage:"#f59e0b",prevRevenue:"#f97316",prevOrders:"#0ea5e9",prevAvgOrderValue:"#f59e0b"},Gc=w.memo(({title:e,value:t,description:r,trend:n,trendValue:a,valuePrefix:i="",valueSuffix:o="",trendPrefix:s="",trendSuffix:l="",className:u="",colorClass:h="text-gray-900 dark:text-gray-100",info:p})=>f.jsxs(Ae,{className:u,children:[f.jsx(rt,{className:"flex flex-row items-center justify-between space-y-0 p-4 pb-2",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:e}),p&&f.jsx(oD,{className:"w-4 h-4 text-muted-foreground cursor-help",title:p})]})}),f.jsxs(We,{className:"p-4 pt-0",children:[f.jsxs("div",{className:`text-2xl font-bold mb-1 ${h}`,children:[i,t,o]}),r&&f.jsx("div",{className:"text-sm text-muted-foreground",children:r}),n&&f.jsxs("div",{className:`text-sm flex items-center gap-1 mt-2 ${n==="up"?"text-emerald-600 dark:text-emerald-400":"text-rose-600 dark:text-rose-400"}`,children:[n==="up"?f.jsx(nl,{className:"w-4 h-4"}):f.jsx(fD,{className:"w-4 h-4"}),s,a,l]})]})]}));Gc.displayName="StatCard";const Qbe=({active:e,payload:t,label:r})=>{if(e&&t&&t.length){const a=new Date(r).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric"}),i=t.filter(s=>!s.dataKey.toLowerCase().includes("prev")),o=t.filter(s=>s.dataKey.toLowerCase().includes("prev"));return f.jsx(Ae,{className:"p-3 shadow-lg bg-white dark:bg-gray-800 border-none",children:f.jsxs(We,{className:"p-0 space-y-2",children:[f.jsx("p",{className:"font-medium text-sm border-b pb-1 mb-2",children:a}),f.jsx("div",{className:"space-y-1",children:i.map((s,l)=>{const u=s.dataKey.toLowerCase().includes("revenue")||s.dataKey==="avgOrderValue"||s.dataKey==="movingAverage"||s.dataKey==="aovMovingAverage"?Zr(s.value):s.value.toLocaleString();return f.jsxs("div",{className:"flex justify-between items-center text-sm",children:[f.jsxs("span",{style:{color:s.stroke||oi[s.dataKey.toLowerCase()]},children:[s.name,":"]}),f.jsx("span",{className:"font-medium ml-4",children:u})]},l)})}),o.length>0&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"border-t my-2"}),f.jsxs("div",{className:"space-y-1",children:[f.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Previous Period"}),o.map((s,l)=>{const u=s.dataKey.toLowerCase().includes("revenue")||s.dataKey.includes("avgOrderValue")?Zr(s.value):s.value.toLocaleString();return f.jsxs("div",{className:"flex justify-between items-center text-sm",children:[f.jsxs("span",{style:{color:s.stroke||oi[s.dataKey.toLowerCase()]},children:[s.name.replace("Previous ",""),":"]}),f.jsx("span",{className:"font-medium ml-4",children:u})]},l)})]})]})]})})}return null},W1=e=>!Array.isArray(e)||e.length===0?[]:e.map((t,r,n)=>{const a=Math.max(0,r-6),o=n.slice(a,r+1).filter(m=>m&&typeof m.revenue=="number"&&typeof m.orders=="number"&&!isNaN(m.revenue)&&!isNaN(m.orders));if(o.length===0)return{...t,movingAverage:0,orderMovingAverage:0,aovMovingAverage:0};const s=o.reduce((m,v)=>m+v.revenue,0),l=o.reduce((m,v)=>m+v.orders,0),u=s/o.length,h=l/o.length,p=h>0?u/h:0;return{...t,movingAverage:Number(u.toFixed(2)),orderMovingAverage:Number(h.toFixed(2)),aovMovingAverage:Number(p.toFixed(2))}}),SR=(e=[],t=[],r=[],n=[])=>{const a=new Set([...e.map(l=>l.datetime),...t.map(l=>l.datetime)].filter(Boolean)),i=new Map;for(const l of a)i.set(l,{timestamp:l,orders:0,revenue:0,avgOrderValue:0,prevOrders:0,prevRevenue:0,prevAvgOrderValue:0,growth:{revenue:0,orders:0,avgOrderValue:0}});e.forEach(l=>{if(!(l!=null&&l.datetime))return;const u=i.get(l.datetime);u&&(u.orders=Number(l.count||0))}),t.forEach(l=>{if(!(l!=null&&l.datetime))return;const u=i.get(l.datetime);u&&(u.revenue=Number(l.value||0),u.orders>0&&(u.avgOrderValue=u.revenue/u.orders))});const o=Array.from(a).sort();new Map(o.map((l,u)=>[l,u])),r.forEach((l,u)=>{if(u>=o.length)return;const h=o[u],p=i.get(h);p&&(p.prevOrders=Number(l.count||0))}),n.forEach((l,u)=>{if(u>=o.length)return;const h=o[u],p=i.get(h);p&&(p.prevRevenue=Number(l.value||0),p.prevOrders>0&&(p.prevAvgOrderValue=p.prevRevenue/p.prevOrders))});for(const l of i.values())l.prevRevenue>0&&(l.growth.revenue=(l.revenue-l.prevRevenue)/l.prevRevenue*100),l.prevOrders>0&&(l.growth.orders=(l.orders-l.prevOrders)/l.prevOrders*100),l.prevAvgOrderValue>0&&(l.growth.avgOrderValue=(l.avgOrderValue-l.prevAvgOrderValue)/l.prevAvgOrderValue*100);const s=Array.from(i.values()).sort((l,u)=>new Date(l.timestamp)-new Date(u.timestamp)).map(l=>({...l,revenue:Number(l.revenue.toFixed(2)),orders:Number(l.orders),avgOrderValue:Number(l.avgOrderValue.toFixed(2)),prevRevenue:Number(l.prevRevenue.toFixed(2)),prevOrders:Number(l.prevOrders),prevAvgOrderValue:Number(l.prevAvgOrderValue.toFixed(2)),growth:{revenue:Number(l.growth.revenue.toFixed(2)),orders:Number(l.growth.orders.toFixed(2)),avgOrderValue:Number(l.growth.avgOrderValue.toFixed(2))}}));return W1(s)},ewe=(e=[])=>{if(!Array.isArray(e))return{};const t=e.filter(S=>S&&typeof S.revenue=="number"&&typeof S.orders=="number"&&!isNaN(S.revenue)&&!isNaN(S.orders));if(t.length===0)return{};const r=t.reduce((S,O)=>S+O.revenue,0),n=t.reduce((S,O)=>S+O.orders,0),a=n?r/n:0,i=t.reduce((S,O)=>S+(O.prevRevenue||0),0),o=t.reduce((S,O)=>S+(O.prevOrders||0),0),s=o?i/o:0,l=t.reduce((S,O)=>O.revenue>((S==null?void 0:S.revenue)||0)?{revenue:O.revenue,timestamp:O.timestamp,orders:O.orders,avgOrderValue:O.avgOrderValue,prevRevenue:O.prevRevenue,prevOrders:O.prevOrders}:S,null),u={revenue:i?(r-i)/i*100:0,orders:o?(n-o)/o*100:0,avgOrderValue:s?(a-s)/s*100:0},h=t.reduce((S,O,j,P)=>{if(j===0)return{revenue:[],orders:[],avgOrderValue:[]};const A=P[j-1];return{revenue:[...S.revenue,O.revenue-A.revenue],orders:[...S.orders,O.orders-A.orders],avgOrderValue:[...S.avgOrderValue,O.avgOrderValue-A.avgOrderValue]}},{revenue:[],orders:[],avgOrderValue:[]});t.slice(-7);const p=Math.max(...t.map(S=>S.revenue)),m=Math.min(...t.filter(S=>S.revenue>0).map(S=>S.revenue)),v=t[t.length-1],b={revenue:(v==null?void 0:v.movingAverage)||0,orders:(v==null?void 0:v.orderMovingAverage)||0,avgOrderValue:(v==null?void 0:v.aovMovingAverage)||0},g=r/t.length,x=n/t.length;return{totalRevenue:r,totalOrders:n,avgOrderValue:a,bestDay:l,prevRevenue:i,prevOrders:o,prevAvgOrderValue:s,growth:u,trends:h,periodHigh:p,periodLow:m,averageDaily:g,averageOrders:x,movingAverages:b}},Y5=w.memo(({stats:e={}})=>{const{totalRevenue:t=0,totalOrders:r=0,avgOrderValue:n=0,bestDay:a=null,prevRevenue:i=0,prevOrders:o=0,prevAvgOrderValue:s=0,growth:l={revenue:0,orders:0,avgOrderValue:0}}=e;return f.jsxs("div",{className:"grid grid-cols-4 gap-4 py-4 max-w-4xl",children:[f.jsx(Gc,{title:"Total Revenue",value:Zr(t,!1),description:`Previous: ${Zr(i,!1)}`,trend:l.revenue>=0?"up":"down",trendValue:Db(l.revenue),info:"Total revenue for the selected period",colorClass:"text-green-600 dark:text-green-400"}),f.jsx(Gc,{title:"Total Orders",value:r.toLocaleString(),description:`Previous: ${o.toLocaleString()} orders`,trend:l.orders>=0?"up":"down",trendValue:Db(l.orders),info:"Total number of orders for the selected period",colorClass:"text-blue-600 dark:text-blue-400"}),f.jsx(Gc,{title:"Average Order Value",value:Zr(n),description:`Previous: ${Zr(s)}`,trend:l.avgOrderValue>=0?"up":"down",trendValue:Db(l.avgOrderValue),info:"Average value per order for the selected period",colorClass:"text-purple-600 dark:text-purple-400"}),f.jsx(Gc,{title:"Best Day",value:Zr((a==null?void 0:a.revenue)||0,!1),description:a!=null&&a.timestamp?`${new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"})} - ${a.orders} orders`:"No data",info:"Day with highest revenue in the selected period",colorClass:"text-orange-600 dark:text-orange-400"})]})});Y5.displayName="SummaryStats";const twe=()=>f.jsx("div",{className:"h-[400px] w-full bg-gray-50 dark:bg-gray-800 rounded-lg p-4",children:f.jsx("div",{className:"h-full flex flex-col",children:f.jsx("div",{className:"flex-1 relative",children:f.jsxs("div",{className:"h-full w-full relative",children:[[...Array(5)].map((e,t)=>f.jsx("div",{className:"absolute w-full h-px bg-gray-200 dark:bg-gray-700",style:{top:`${20+t*20}%`}},t)),f.jsx("div",{className:"absolute inset-0 bg-gray-300 dark:bg-gray-600 animate-pulse",style:{opacity:.2,clipPath:"polygon(0 50%, 100% 20%, 100% 100%, 0 100%)"}})]})})})}),rwe=()=>f.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[...Array(4)].map((e,t)=>f.jsxs(Ae,{children:[f.jsxs(rt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[f.jsx(Je,{className:"h-4 w-24"}),f.jsx(Je,{className:"h-4 w-4 rounded-full"})]}),f.jsxs(We,{children:[f.jsx(Je,{className:"h-8 w-32 mb-2"}),f.jsx(Je,{className:"h-4 w-24"})]})]},t))}),nwe=()=>f.jsx("div",{className:"mt-4 overflow-x-auto rounded-lg border bg-card",children:f.jsxs(ua,{children:[f.jsx(fa,{children:f.jsx(er,{children:[...Array(8)].map((e,t)=>f.jsx(Fe,{children:f.jsx(Je,{className:"h-4 w-20"})},t))})}),f.jsx(da,{children:[...Array(5)].map((e,t)=>f.jsx(er,{children:[...Array(8)].map((r,n)=>f.jsx(Be,{children:f.jsx(Je,{className:"h-4 w-16"})},n))},t))})]})}),awe=({timeRange:e="last30days",startDate:t,endDate:r,title:n="Sales Overview",description:a="Track your sales performance over time"})=>{const[i,o]=w.useState({data:[],loading:!0,error:null}),[s,l]=w.useState({data:[],loading:!1,error:null}),[u,h]=w.useState(e),[p,m]=w.useState(!1),[v,b]=w.useState({revenue:!0,orders:!0,avgOrderValue:!0,movingAverage:!0,prevRevenue:!1,prevOrders:!1,prevAvgOrderValue:!1}),g=w.useMemo(()=>i.data.length?W1(i.data):[],[i.data]),x=w.useMemo(()=>s.data.length?W1(s.data):[],[s.data]),S=w.useMemo(()=>g.map((E,I)=>{var L,$,F,z;return{...E,prevRevenue:((L=x[I])==null?void 0:L.revenue)||0,prevOrders:(($=x[I])==null?void 0:$.orders)||0,prevAvgOrderValue:((F=x[I])==null?void 0:F.avgOrderValue)||0,prevMovingAverage:((z=x[I])==null?void 0:z.movingAverage)||0}}),[g,x]),[O,j]=w.useState({totalRevenue:0,totalOrders:0,avgOrderValue:0,bestDay:null,prevRevenue:0,prevOrders:0,prevAvgOrderValue:0,growth:{revenue:0,orders:0,avgOrderValue:0}}),P=w.useCallback(async E=>{var I,L;if(!(!(E!=null&&E.timeRange)&&!(E!=null&&E.startDate))){o($=>({...$,loading:!0,error:null}));try{const $=await mt.get("/api/klaviyo/events/batch",{params:{...E,metrics:JSON.stringify(["orders","revenue"])}}),F=((I=$.data.orders)==null?void 0:I.data)||[],z=((L=$.data.revenue)==null?void 0:L.data)||[],H=SR(F,z,[],[]);o(Y=>({...Y,data:H,loading:!1,error:null}));const U=ewe(H);j(Y=>({...Y,totalRevenue:U.totalRevenue||0,totalOrders:U.totalOrders||0,avgOrderValue:U.avgOrderValue||0,bestDay:U.bestDay||null}))}catch($){o(F=>({...F,error:$.message,loading:!1}))}}},[]),A=w.useCallback(async E=>{var L,$;if(!(E!=null&&E.timeRange)&&!(E!=null&&E.startDate))return;const I=getPreviousPeriodParams(E);if(I){l(F=>({...F,loading:!0}));try{const F=await mt.get("/api/klaviyo/events/batch",{params:{...I,metrics:JSON.stringify(["orders","revenue"])}}),z=((L=F.data.orders)==null?void 0:L.data)||[],H=(($=F.data.revenue)==null?void 0:$.data)||[],U=SR(z,H,[],[]);if(l(Y=>({...Y,data:U,loading:!1})),i.data.length>0){const Y=U.reduce((ae,ue)=>ae+ue.revenue,0),se=U.reduce((ae,ue)=>ae+ue.orders,0),ne=se>0?Y/se:0;j(ae=>({...ae,prevRevenue:Y,prevOrders:se,prevAvgOrderValue:ne,growth:{revenue:Y>0?(ae.totalRevenue-Y)/Y*100:0,orders:se>0?(ae.totalOrders-se)/se*100:0,avgOrderValue:ne>0?(ae.avgOrderValue-ne)/ne*100:0}}))}}catch(F){console.error("Error fetching previous period:",F),l(z=>({...z,error:F.message,loading:!1}))}}},[i.data]),T=w.useCallback(E=>{o(I=>({...I,data:[],loading:!0,error:null})),l(I=>({...I,data:[],loading:!1,error:null})),P(E),(v.prevRevenue||v.prevOrders||v.prevAvgOrderValue)&&A(E)},[P,A,v]),N=w.useCallback(E=>{var L,$;h(E);const I=E==="custom"?{startDate:(L=Xi(customDateRange.startDate))==null?void 0:L.toISOString(),endDate:($=Xi(customDateRange.endDate))==null?void 0:$.toISOString()}:{timeRange:E};T(I)},[customDateRange,T]),k=w.useCallback((E,I)=>{var L,$;setCustomDateRange(F=>({...F,[E]:I})),u==="custom"&&customDateRange.startDate&&customDateRange.endDate&&T({startDate:(L=Xi(customDateRange.startDate))==null?void 0:L.toISOString(),endDate:($=Xi(customDateRange.endDate))==null?void 0:$.toISOString()})},[u,customDateRange,T]);w.useEffect(()=>{var I,L;const E=u==="custom"?{startDate:(I=Xi(customDateRange.startDate))==null?void 0:I.toISOString(),endDate:(L=Xi(customDateRange.endDate))==null?void 0:L.toISOString()}:{timeRange:u};T(E)},[u,customDateRange.startDate,customDateRange.endDate,T]),w.useEffect(()=>{if(u!=="today")return;const E=()=>T({timeRange:"today"}),I=setInterval(E,6e4);return E(),()=>clearInterval(I)},[u,T]);const R=i.loading&&!i.data.length,W=s.loading&&(v.prevRevenue||v.prevOrders||v.prevAvgOrderValue);return f.jsxs(Ae,{className:"w-full bg-white dark:bg-gray-900/60 backdrop-blur-sm",children:[f.jsx(rt,{className:"p-6",children:f.jsxs("div",{className:"flex flex-col space-y-2",children:[f.jsxs("div",{className:"flex justify-between items-start",children:[f.jsx("div",{children:f.jsx(st,{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:n})}),f.jsx("div",{className:"flex items-center gap-4",children:f.jsxs(su,{value:u,onValueChange:N,children:[f.jsx(ll,{className:"w-[180px] h-9",children:f.jsx(lu,{placeholder:"Select time range"})}),f.jsxs(cl,{children:[_p.map(E=>f.jsx(lo,{value:E.value,children:E.label},E.value)),f.jsx(lo,{value:"custom",children:"Custom Range"})]})]})})]}),u==="custom"&&f.jsxs("div",{className:"grid grid-cols-2 gap-4 max-w-md",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(pn,{htmlFor:"startDate",children:"Start Date"}),f.jsx(Yo,{id:"startDate",type:"datetime-local",value:customDateRange.startDate,onChange:E=>k("startDate",E.target.value),className:"h-9"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(pn,{htmlFor:"endDate",children:"End Date"}),f.jsx(Yo,{id:"endDate",type:"datetime-local",value:customDateRange.endDate,onChange:E=>k("endDate",E.target.value),className:"h-9"})]})]}),R?f.jsx(rwe,{}):f.jsx(Y5,{stats:O}),f.jsxs("div",{className:"flex flex-wrap gap-4 pt-2",children:[f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Gi,{id:"revenue",checked:v.revenue,onCheckedChange:E=>b(I=>({...I,revenue:E}))}),f.jsx(pn,{htmlFor:"revenue",className:"text-sm",children:"Revenue"})]}),f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Gi,{id:"orders",checked:v.orders,onCheckedChange:E=>b(I=>({...I,orders:E}))}),f.jsx(pn,{htmlFor:"orders",className:"text-sm",children:"Orders"})]}),f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Gi,{id:"avgOrderValue",checked:v.avgOrderValue,onCheckedChange:E=>b(I=>({...I,avgOrderValue:E}))}),f.jsx(pn,{htmlFor:"avgOrderValue",className:"text-sm",children:"AOV"})]}),f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Gi,{id:"movingAverage",checked:v.movingAverage,onCheckedChange:E=>b(I=>({...I,movingAverage:E}))}),f.jsx(pn,{htmlFor:"movingAverage",className:"text-sm",children:"7-Day Avg"})]}),f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Gi,{id:"prevRevenue",checked:v.prevRevenue,onCheckedChange:E=>b(I=>({...I,prevRevenue:E}))}),f.jsx(pn,{htmlFor:"prevRevenue",className:"text-sm",children:"Prev Revenue"})]}),f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Gi,{id:"prevOrders",checked:v.prevOrders,onCheckedChange:E=>b(I=>({...I,prevOrders:E}))}),f.jsx(pn,{htmlFor:"prevOrders",className:"text-sm",children:"Prev Orders"})]}),f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Gi,{id:"prevAvgOrderValue",checked:v.prevAvgOrderValue,onCheckedChange:E=>b(I=>({...I,prevAvgOrderValue:E}))}),f.jsx(pn,{htmlFor:"prevAvgOrderValue",className:"text-sm",children:"Prev AOV"})]})]})]})}),f.jsx(We,{className:"p-6 pt-0",children:R?f.jsxs("div",{className:"space-y-6",children:[f.jsx(twe,{}),f.jsx("div",{className:"mt-4 flex justify-end",children:f.jsx(Je,{className:"h-9 w-24"})}),p&&f.jsx(nwe,{})]}):i.error?f.jsx("div",{className:"flex items-center justify-center h-[400px] text-destructive",children:f.jsxs("div",{className:"text-center",children:[f.jsx(mi,{className:"h-12 w-12 mx-auto mb-4"}),f.jsx("div",{className:"font-medium mb-2",children:"Error loading sales data"}),f.jsx("div",{className:"text-sm text-muted-foreground",children:i.error})]})}):g.length?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"h-[400px] mt-4 bg-card rounded-lg p-4 relative",children:[W&&f.jsxs("div",{className:"absolute top-2 right-2 flex items-center gap-2 text-sm text-muted-foreground",children:[f.jsx(NV,{className:"h-4 w-4 animate-spin"}),"Loading previous period..."]}),f.jsx(Lo,{width:"100%",height:"100%",children:f.jsxs(MO,{data:S,margin:{top:5,right:30,left:20,bottom:5},children:[f.jsx(qo,{strokeDasharray:"3 3",className:"stroke-muted"}),f.jsx(Ta,{dataKey:"timestamp",tickFormatter:formatXAxis,className:"text-xs",tick:{fill:"currentColor"}}),f.jsx(na,{yAxisId:"revenue",tickFormatter:E=>Zr(E,!1),className:"text-xs",tick:{fill:"currentColor"}}),f.jsx(na,{yAxisId:"orders",orientation:"right",tickFormatter:E=>E.toLocaleString(),className:"text-xs",tick:{fill:"currentColor"}}),f.jsx(Er,{content:f.jsx(Qbe,{})}),f.jsx(fi,{}),f.jsx(wm,{y:averageRevenue,yAxisId:"revenue",stroke:"currentColor",strokeDasharray:"3 3",label:{value:`Avg Revenue: ${Zr(averageRevenue)}`,fill:"currentColor",fontSize:12}}),v.revenue&&f.jsx(Xr,{yAxisId:"revenue",type:"monotone",dataKey:"revenue",name:"Revenue",stroke:oi.revenue,strokeWidth:2,dot:!1}),v.movingAverage&&f.jsx(Xr,{yAxisId:"revenue",type:"monotone",dataKey:"movingAverage",name:"7-Day Average",stroke:oi.movingAverage,strokeWidth:2,dot:!1,strokeDasharray:"5 5"}),v.prevRevenue&&s.data.length>0&&f.jsx(Xr,{yAxisId:"revenue",type:"monotone",dataKey:"prevRevenue",name:"Previous Revenue",stroke:oi.prevRevenue,strokeWidth:2,dot:!1,strokeDasharray:"5 5"}),v.orders&&f.jsx(Xr,{yAxisId:"orders",type:"monotone",dataKey:"orders",name:"Orders",stroke:oi.orders,strokeWidth:2,dot:!1}),v.prevOrders&&s.data.length>0&&f.jsx(Xr,{yAxisId:"orders",type:"monotone",dataKey:"prevOrders",name:"Previous Orders",stroke:oi.prevOrders,strokeWidth:2,dot:!1,strokeDasharray:"5 5"}),v.avgOrderValue&&f.jsx(Xr,{yAxisId:"revenue",type:"monotone",dataKey:"avgOrderValue",name:"Avg Order Value",stroke:oi.avgOrderValue,strokeWidth:2,dot:!1}),v.prevAvgOrderValue&&s.data.length>0&&f.jsx(Xr,{yAxisId:"revenue",type:"monotone",dataKey:"prevAvgOrderValue",name:"Previous Avg Order",stroke:oi.prevAvgOrderValue,strokeWidth:2,dot:!1,strokeDasharray:"5 5"})]})})]}),f.jsx("div",{className:"mt-4 flex justify-end",children:f.jsxs(xr,{variant:"outline",onClick:()=>m(!p),className:"h-9",children:[p?"Hide":"Show"," Details"]})}),p&&f.jsx("div",{className:"mt-4 overflow-x-auto rounded-lg border bg-card",children:f.jsxs(ua,{children:[f.jsx(fa,{children:f.jsxs(er,{children:[f.jsx(Fe,{children:"Date"}),f.jsx(Fe,{className:"text-right",children:"Orders"}),f.jsx(Fe,{className:"text-right",children:"Revenue"}),f.jsx(Fe,{className:"text-right",children:"Avg Order"}),f.jsx(Fe,{className:"text-right",children:"Prev Orders"}),f.jsx(Fe,{className:"text-right",children:"Prev Revenue"}),f.jsx(Fe,{className:"text-right",children:"Prev Avg Order"}),f.jsx(Fe,{className:"text-right",children:"7-Day Avg"})]})}),f.jsx(da,{children:i.data.map(E=>f.jsxs(er,{children:[f.jsx(Be,{children:formatXAxis(E.timestamp)}),f.jsx(Be,{className:"text-right",children:E.orders.toLocaleString()}),f.jsx(Be,{className:"text-right",children:Zr(E.revenue)}),f.jsx(Be,{className:"text-right",children:Zr(E.avgOrderValue)}),f.jsx(Be,{className:"text-right",children:E.prevOrders.toLocaleString()}),f.jsx(Be,{className:"text-right",children:Zr(E.prevRevenue)}),f.jsx(Be,{className:"text-right",children:Zr(E.prevAvgOrderValue)}),f.jsx(Be,{className:"text-right",children:Zr(E.movingAverage)})]},E.timestamp))})]})})]}):f.jsx("div",{className:"flex items-center justify-center h-[400px] text-muted-foreground",children:f.jsxs("div",{className:"text-center",children:[f.jsx(nl,{className:"h-12 w-12 mx-auto mb-4"}),f.jsx("div",{className:"font-medium mb-2",children:"No sales data available"}),f.jsx("div",{className:"text-sm",children:"Try selecting a different time range"})]})})})]})},iwe=()=>f.jsx("div",{className:"min-h-screen w-screen",children:f.jsx("div",{className:"w-full",children:f.jsx("div",{className:"p-6",children:f.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-gray-100 text-left mb-5",children:"Black Friday 2024"})})})}),owe=({children:e})=>{const[t,r]=q.useState(()=>sessionStorage.getItem("pinVerified")==="true"),n=()=>{r(!0),sessionStorage.setItem("pinVerified","true")};return t?e:f.jsx(Gz,{onSuccess:n})},swe=()=>f.jsx("div",{className:"min-h-screen w-screen overflow-hidden",children:f.jsx("div",{className:"flex",children:f.jsxs("div",{style:{transform:"scale(2)",transformOrigin:"top left",padding:"1.5rem",marginBottom:"1.5rem"},children:[f.jsx("span",{className:"absolute top-0 left-0",children:f.jsx(Yz,{})}),f.jsx(PJ,{scaleFactor:2})]})})}),lwe=()=>f.jsx(Xz,{children:f.jsxs("div",{className:"min-h-screen max-w-[1800px] mx-auto",children:[f.jsx("div",{className:"p-4",children:f.jsx(kK,{})}),f.jsx(MK,{}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[f.jsx("div",{className:"col-span-8",children:f.jsx("div",{className:"space-y-4 h-full w-full",children:f.jsx(Ibe,{})})}),f.jsx("div",{className:"col-span-4 h-[530px]",children:f.jsx("div",{className:"h-full",children:f.jsx("div",{className:"h-full",children:f.jsx(gbe,{})})})})]}),f.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[f.jsx("div",{className:"col-span-4 h-[800px]",children:f.jsx($be,{})}),f.jsx("div",{className:"col-span-8 h-full w-full flex",children:f.jsx(awe,{className:"w-full h-full"})})]}),f.jsx(Wve,{})]})]})});function cwe(){return f.jsx(Jz,{defaultTheme:"system",storageKey:"vite-ui-theme",children:f.jsxs(mH,{children:[f.jsxs(vH,{children:[f.jsx(wc,{path:"/black-friday",element:f.jsx(iwe,{})}),f.jsx(wc,{path:"/login",element:f.jsx(kz,{})}),f.jsx(wc,{path:"/small",element:f.jsx(owe,{children:f.jsx(swe,{})})}),f.jsx(wc,{path:"/dashboard",element:f.jsx(Kz,{children:f.jsx(lwe,{})})}),f.jsx(wc,{path:"/",element:f.jsx(gH,{to:"/dashboard",replace:!0})})]}),f.jsx(Nz,{})]})})}wH.createRoot(document.getElementById("root")).render(f.jsx(w.StrictMode,{children:f.jsx(cwe,{})})); //# sourceMappingURL=index-ClSvHF_l.js.map