@meridianjs/admin-dashboard 0.1.34 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ProjectTimelinePage-NmU5j1-P.js → ProjectTimelinePage-5sYFj4UJ.js} +1 -1
- package/dist/assets/{WorkspaceReportingPage-DDKH1sld.js → WorkspaceReportingPage-O-m_dFIA.js} +1 -1
- package/dist/assets/index-9nouokxr.css +1 -0
- package/dist/assets/index-DtooOXiQ.js +590 -0
- package/dist/assets/{vendor-editor-Ba0DY8XI.js → vendor-editor-BmhD0BxF.js} +3 -3
- package/dist/index.html +3 -3
- package/package.json +3 -1
- package/dist/assets/index-CzA9ZcAk.css +0 -1
- package/dist/assets/index-D9XCYXux.js +0 -590
|
@@ -1,590 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectTimelinePage-NmU5j1-P.js","assets/vendor-query-DtBTlSlq.js","assets/vendor-react-aoclG454.js","assets/vendor-radix-Bj-t5iGX.js","assets/vendor-dnd-6EGxH1Lf.js","assets/vendor-editor-Ba0DY8XI.js","assets/WorkspaceReportingPage-DDKH1sld.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var SP=Object.defineProperty;var CP=(e,t,r)=>t in e?SP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Yf=(e,t,r)=>CP(e,typeof t!="symbol"?t+"":t,r);import{j as a,u as Le,a as Ne,b as we,R as _P,Q as OP,c as PP}from"./vendor-query-DtBTlSlq.js";import{a as pp,c as E,r as p,b as MP,u as qt,d as au,N as na,e as kt,L as Va,O as bl,f as gp,g as Na,R as AP,h as mc,i as EP,j as Ke,k as _s,B as DP}from"./vendor-react-aoclG454.js";import{C as Zw,R as TP,T as IP,P as RP,S as xp,a as Jw,O as Hs,b as wl,c as Ks,d as su,e as Li,D as Fi,f as jl,g as ej,h as tj,i as $P,j as rj,I as nj,k as aj,l as sj,m as ij,L as oj,n as lj,o as zP,p as LP,q as cj,r as dj,F as uj,u as xi,t as ts,s as FP,v as fj,w as mj,x as BP,y as hj,z as pj,A as WP,B as gj,V as UP,E as xj,G as vj,H as qP,J as HP,K as yj,M as KP,N as YP,Q as GP,U as bj,W as VP,X as XP,Y as wj,Z as iu,_ as QP,$ as xs,a0 as ZP,a1 as JP,a2 as jj,a3 as eM,a4 as tM,a5 as Nj,a6 as rM,a7 as nM,a8 as kj,a9 as aM,aa as sM,ab as iM,ac as oM,ad as lM,ae as cM,af as dM,ag as uM,ah as fM,ai as mM,aj as hM,ak as Sj,al as pM,am as gM,an as xM,ao as vM,ap as yM,aq as bM}from"./vendor-radix-Bj-t5iGX.js";import{u as Cj,a as vp,P as _j,D as Ho,S as yp,h as Oj,b as Uc,c as bp,C as wp,d as wM,v as jM,r as NM,e as kM,f as SM,M as CM,g as Pj}from"./vendor-dnd-6EGxH1Lf.js";import{E as _M,u as Mj,i as Aj,a as Ej,b as Dj,c as Tj,d as OM,e as PM,w as MM}from"./vendor-editor-Ba0DY8XI.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)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(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var Ij,fv=pp;Ij=fv.createRoot,fv.hydrateRoot;const AM="modulepreload",EM=function(e){return"/"+e},mv={},Rj=function(t,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(r.map(c=>{if(c=EM(c),c in mv)return;mv[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":AM,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((m,h)=>{f.addEventListener("load",m),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};var DM=function(){return null},TM=e=>{switch(e){case"success":return $M;case"info":return LM;case"warning":return zM;case"error":return FM;default:return null}},IM=Array(12).fill(0),RM=({visible:e,className:t})=>E.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},E.createElement("div",{className:"sonner-spinner"},IM.map((r,n)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),$M=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),zM=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),LM=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),FM=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),BM=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),WM=()=>{let[e,t]=E.useState(document.hidden);return E.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Xm=1,UM=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Xm++,i=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,i,o=n.then(async c=>{if(i=["resolve",c],E.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(HM(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:d,description:u})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>o.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Xm++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},_r=new UM,qM=(e,t)=>{let r=(t==null?void 0:t.id)||Xm++;return _r.addToast({title:e,...t,id:r}),r},HM=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",KM=qM,YM=()=>_r.toasts,GM=()=>_r.getActiveToasts(),z=Object.assign(KM,{success:_r.success,info:_r.info,warning:_r.warning,error:_r.error,custom:_r.custom,message:_r.message,promise:_r.promise,dismiss:_r.dismiss,loading:_r.loading},{getHistory:YM,getToasts:GM});function VM(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}VM(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
3
|
-
`);function hc(e){return e.label!==void 0}var XM=3,QM="32px",ZM="16px",hv=4e3,JM=356,eA=14,tA=20,rA=200;function fn(...e){return e.filter(Boolean).join(" ")}function nA(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var aA=e=>{var t,r,n,s,i,o,l,c,d,u,f;let{invert:m,toast:h,unstyled:g,interacting:x,setHeights:v,visibleToasts:y,heights:j,index:b,toasts:N,expanded:k,removeToast:w,defaultRichColors:S,closeButton:C,style:P,cancelButtonStyle:M,actionButtonStyle:A,className:_="",descriptionClassName:D="",duration:O,position:R,gap:F,loadingIcon:H,expandByDefault:ne,classNames:G,icons:oe,closeButtonAriaLabel:ce="Close toast",pauseWhenPageIsHidden:B}=e,[Y,U]=E.useState(null),[X,$]=E.useState(null),[K,V]=E.useState(!1),[L,se]=E.useState(!1),[he,Q]=E.useState(!1),[Pe,re]=E.useState(!1),[Oe,Ce]=E.useState(!1),[q,ve]=E.useState(0),[Me,We]=E.useState(0),Ue=E.useRef(h.duration||O||hv),Ct=E.useRef(null),_t=E.useRef(null),ur=b===0,Sr=b+1<=y,dt=h.type,bt=h.dismissible!==!1,Gr=h.className||"",Ia=h.descriptionClassName||"",Vr=E.useMemo(()=>j.findIndex(ee=>ee.toastId===h.id)||0,[j,h.id]),Xn=E.useMemo(()=>{var ee;return(ee=h.closeButton)!=null?ee:C},[h.closeButton,C]),Rr=E.useMemo(()=>h.duration||O||hv,[h.duration,O]),$r=E.useRef(0),fr=E.useRef(0),nr=E.useRef(0),Vt=E.useRef(null),[_n,Qn]=R.split("-"),ke=E.useMemo(()=>j.reduce((ee,ye,Ae)=>Ae>=Vr?ee:ee+ye.height,0),[j,Vr]),de=WM(),pe=h.invert||m,ie=dt==="loading";fr.current=E.useMemo(()=>Vr*F+ke,[Vr,ke]),E.useEffect(()=>{Ue.current=Rr},[Rr]),E.useEffect(()=>{V(!0)},[]),E.useEffect(()=>{let ee=_t.current;if(ee){let ye=ee.getBoundingClientRect().height;return We(ye),v(Ae=>[{toastId:h.id,height:ye,position:h.position},...Ae]),()=>v(Ae=>Ae.filter(ut=>ut.toastId!==h.id))}},[v,h.id]),E.useLayoutEffect(()=>{if(!K)return;let ee=_t.current,ye=ee.style.height;ee.style.height="auto";let Ae=ee.getBoundingClientRect().height;ee.style.height=ye,We(Ae),v(ut=>ut.find(Xe=>Xe.toastId===h.id)?ut.map(Xe=>Xe.toastId===h.id?{...Xe,height:Ae}:Xe):[{toastId:h.id,height:Ae,position:h.position},...ut])},[K,h.title,h.description,v,h.id]);let fe=E.useCallback(()=>{se(!0),ve(fr.current),v(ee=>ee.filter(ye=>ye.toastId!==h.id)),setTimeout(()=>{w(h)},rA)},[h,w,v,fr]);E.useEffect(()=>{if(h.promise&&dt==="loading"||h.duration===1/0||h.type==="loading")return;let ee;return k||x||B&&de?(()=>{if(nr.current<$r.current){let ye=new Date().getTime()-$r.current;Ue.current=Ue.current-ye}nr.current=new Date().getTime()})():Ue.current!==1/0&&($r.current=new Date().getTime(),ee=setTimeout(()=>{var ye;(ye=h.onAutoClose)==null||ye.call(h,h),fe()},Ue.current)),()=>clearTimeout(ee)},[k,x,h,dt,B,de,fe]),E.useEffect(()=>{h.delete&&fe()},[fe,h.delete]);function qe(){var ee,ye,Ae;return oe!=null&&oe.loading?E.createElement("div",{className:fn(G==null?void 0:G.loader,(ee=h==null?void 0:h.classNames)==null?void 0:ee.loader,"sonner-loader"),"data-visible":dt==="loading"},oe.loading):H?E.createElement("div",{className:fn(G==null?void 0:G.loader,(ye=h==null?void 0:h.classNames)==null?void 0:ye.loader,"sonner-loader"),"data-visible":dt==="loading"},H):E.createElement(RM,{className:fn(G==null?void 0:G.loader,(Ae=h==null?void 0:h.classNames)==null?void 0:Ae.loader),visible:dt==="loading"})}return E.createElement("li",{tabIndex:0,ref:_t,className:fn(_,Gr,G==null?void 0:G.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,G==null?void 0:G.default,G==null?void 0:G[dt],(r=h==null?void 0:h.classNames)==null?void 0:r[dt]),"data-sonner-toast":"","data-rich-colors":(n=h.richColors)!=null?n:S,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":K,"data-promise":!!h.promise,"data-swiped":Oe,"data-removed":L,"data-visible":Sr,"data-y-position":_n,"data-x-position":Qn,"data-index":b,"data-front":ur,"data-swiping":he,"data-dismissible":bt,"data-type":dt,"data-invert":pe,"data-swipe-out":Pe,"data-swipe-direction":X,"data-expanded":!!(k||ne&&K),style:{"--index":b,"--toasts-before":b,"--z-index":N.length-b,"--offset":`${L?q:fr.current}px`,"--initial-height":ne?"auto":`${Me}px`,...P,...h.style},onDragEnd:()=>{Q(!1),U(null),Vt.current=null},onPointerDown:ee=>{ie||!bt||(Ct.current=new Date,ve(fr.current),ee.target.setPointerCapture(ee.pointerId),ee.target.tagName!=="BUTTON"&&(Q(!0),Vt.current={x:ee.clientX,y:ee.clientY}))},onPointerUp:()=>{var ee,ye,Ae,ut;if(Pe||!bt)return;Vt.current=null;let Xe=Number(((ee=_t.current)==null?void 0:ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qe=Number(((ye=_t.current)==null?void 0:ye.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mr=new Date().getTime()-((Ae=Ct.current)==null?void 0:Ae.getTime()),Xt=Y==="x"?Xe:Qe,On=Math.abs(Xt)/mr;if(Math.abs(Xt)>=tA||On>.11){ve(fr.current),(ut=h.onDismiss)==null||ut.call(h,h),$(Y==="x"?Xe>0?"right":"left":Qe>0?"down":"up"),fe(),re(!0),Ce(!1);return}Q(!1),U(null)},onPointerMove:ee=>{var ye,Ae,ut,Xe;if(!Vt.current||!bt||((ye=window.getSelection())==null?void 0:ye.toString().length)>0)return;let Qe=ee.clientY-Vt.current.y,mr=ee.clientX-Vt.current.x,Xt=(Ae=e.swipeDirections)!=null?Ae:nA(R);!Y&&(Math.abs(mr)>1||Math.abs(Qe)>1)&&U(Math.abs(mr)>Math.abs(Qe)?"x":"y");let On={x:0,y:0};Y==="y"?(Xt.includes("top")||Xt.includes("bottom"))&&(Xt.includes("top")&&Qe<0||Xt.includes("bottom")&&Qe>0)&&(On.y=Qe):Y==="x"&&(Xt.includes("left")||Xt.includes("right"))&&(Xt.includes("left")&&mr<0||Xt.includes("right")&&mr>0)&&(On.x=mr),(Math.abs(On.x)>0||Math.abs(On.y)>0)&&Ce(!0),(ut=_t.current)==null||ut.style.setProperty("--swipe-amount-x",`${On.x}px`),(Xe=_t.current)==null||Xe.style.setProperty("--swipe-amount-y",`${On.y}px`)}},Xn&&!h.jsx?E.createElement("button",{"aria-label":ce,"data-disabled":ie,"data-close-button":!0,onClick:ie||!bt?()=>{}:()=>{var ee;fe(),(ee=h.onDismiss)==null||ee.call(h,h)},className:fn(G==null?void 0:G.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=oe==null?void 0:oe.close)!=null?i:BM):null,h.jsx||p.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:E.createElement(E.Fragment,null,dt||h.icon||h.promise?E.createElement("div",{"data-icon":"",className:fn(G==null?void 0:G.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||qe():null,h.type!=="loading"?h.icon||(oe==null?void 0:oe[dt])||TM(dt):null):null,E.createElement("div",{"data-content":"",className:fn(G==null?void 0:G.content,(l=h==null?void 0:h.classNames)==null?void 0:l.content)},E.createElement("div",{"data-title":"",className:fn(G==null?void 0:G.title,(c=h==null?void 0:h.classNames)==null?void 0:c.title)},typeof h.title=="function"?h.title():h.title),h.description?E.createElement("div",{"data-description":"",className:fn(D,Ia,G==null?void 0:G.description,(d=h==null?void 0:h.classNames)==null?void 0:d.description)},typeof h.description=="function"?h.description():h.description):null),p.isValidElement(h.cancel)?h.cancel:h.cancel&&hc(h.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||M,onClick:ee=>{var ye,Ae;hc(h.cancel)&&bt&&((Ae=(ye=h.cancel).onClick)==null||Ae.call(ye,ee),fe())},className:fn(G==null?void 0:G.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,p.isValidElement(h.action)?h.action:h.action&&hc(h.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||A,onClick:ee=>{var ye,Ae;hc(h.action)&&((Ae=(ye=h.action).onClick)==null||Ae.call(ye,ee),!ee.defaultPrevented&&fe())},className:fn(G==null?void 0:G.actionButton,(f=h==null?void 0:h.classNames)==null?void 0:f.actionButton)},h.action.label):null))};function pv(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function sA(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",l=i?ZM:QM;function c(d){["top","right","bottom","left"].forEach(u=>{r[`${o}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${o}-${d}`]=l:r[`${o}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(l)}),r}var iA=p.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:f,duration:m,style:h,visibleToasts:g=XM,toastOptions:x,dir:v=pv(),gap:y=eA,loadingIcon:j,icons:b,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:k}=e,[w,S]=E.useState([]),C=E.useMemo(()=>Array.from(new Set([n].concat(w.filter(B=>B.position).map(B=>B.position)))),[w,n]),[P,M]=E.useState([]),[A,_]=E.useState(!1),[D,O]=E.useState(!1),[R,F]=E.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=E.useRef(null),ne=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),G=E.useRef(null),oe=E.useRef(!1),ce=E.useCallback(B=>{S(Y=>{var U;return(U=Y.find(X=>X.id===B.id))!=null&&U.delete||_r.dismiss(B.id),Y.filter(({id:X})=>X!==B.id)})},[]);return E.useEffect(()=>_r.subscribe(B=>{if(B.dismiss){S(Y=>Y.map(U=>U.id===B.id?{...U,delete:!0}:U));return}setTimeout(()=>{MP.flushSync(()=>{S(Y=>{let U=Y.findIndex(X=>X.id===B.id);return U!==-1?[...Y.slice(0,U),{...Y[U],...B},...Y.slice(U+1)]:[B,...Y]})})})}),[]),E.useEffect(()=>{if(u!=="system"){F(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:Y})=>{F(Y?"dark":"light")})}catch{B.addListener(({matches:U})=>{try{F(U?"dark":"light")}catch(X){console.error(X)}})}},[u]),E.useEffect(()=>{w.length<=1&&_(!1)},[w]),E.useEffect(()=>{let B=Y=>{var U,X;s.every($=>Y[$]||Y.code===$)&&(_(!0),(U=H.current)==null||U.focus()),Y.code==="Escape"&&(document.activeElement===H.current||(X=H.current)!=null&&X.contains(document.activeElement))&&_(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[s]),E.useEffect(()=>{if(H.current)return()=>{G.current&&(G.current.focus({preventScroll:!0}),G.current=null,oe.current=!1)}},[H.current]),E.createElement("section",{ref:t,"aria-label":`${N} ${ne}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((B,Y)=>{var U;let[X,$]=B.split("-");return w.length?E.createElement("ol",{key:B,dir:v==="auto"?pv():v,tabIndex:-1,ref:H,className:l,"data-sonner-toaster":!0,"data-theme":R,"data-y-position":X,"data-lifted":A&&w.length>1&&!i,"data-x-position":$,style:{"--front-toast-height":`${((U=P[0])==null?void 0:U.height)||0}px`,"--width":`${JM}px`,"--gap":`${y}px`,...h,...sA(c,d)},onBlur:K=>{oe.current&&!K.currentTarget.contains(K.relatedTarget)&&(oe.current=!1,G.current&&(G.current.focus({preventScroll:!0}),G.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||oe.current||(oe.current=!0,G.current=K.relatedTarget)},onMouseEnter:()=>_(!0),onMouseMove:()=>_(!0),onMouseLeave:()=>{D||_(!1)},onDragEnd:()=>_(!1),onPointerDown:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},w.filter(K=>!K.position&&Y===0||K.position===B).map((K,V)=>{var L,se;return E.createElement(aA,{key:K.id,icons:b,index:V,toast:K,defaultRichColors:f,duration:(L=x==null?void 0:x.duration)!=null?L:m,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:r,visibleToasts:g,closeButton:(se=x==null?void 0:x.closeButton)!=null?se:o,interacting:D,position:B,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,removeToast:ce,toasts:w.filter(he=>he.position==K.position),heights:P.filter(he=>he.position==K.position),setHeights:M,expandByDefault:i,gap:y,loadingIcon:j,expanded:A,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))}),oA=(e,t,r,n,s,i,o,l)=>{let c=document.documentElement,d=["light","dark"];function u(h){(Array.isArray(e)?e:[e]).forEach(g=>{let x=g==="class",v=x&&i?s.map(y=>i[y]||y):s;x?(c.classList.remove(...v),c.classList.add(i&&i[h]?i[h]:h)):c.setAttribute(g,h)}),f(h)}function f(h){l&&d.includes(h)&&(c.style.colorScheme=h)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(n)u(n);else try{let h=localStorage.getItem(t)||r,g=o&&h==="system"?m():h;u(g)}catch{}},gv=["light","dark"],$j="(prefers-color-scheme: dark)",lA=typeof window>"u",jp=p.createContext(void 0),cA={setTheme:e=>{},themes:[]},dA=()=>{var e;return(e=p.useContext(jp))!=null?e:cA},uA=e=>p.useContext(jp)?p.createElement(p.Fragment,null,e.children):p.createElement(mA,{...e}),fA=["light","dark"],mA=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:n=!0,storageKey:s="theme",themes:i=fA,defaultTheme:o=r?"system":"light",attribute:l="data-theme",value:c,children:d,nonce:u,scriptProps:f})=>{let[m,h]=p.useState(()=>pA(s,o)),[g,x]=p.useState(()=>m==="system"?Gf():m),v=c?Object.values(c):i,y=p.useCallback(k=>{let w=k;if(!w)return;k==="system"&&r&&(w=Gf());let S=c?c[w]:w,C=t?gA(u):null,P=document.documentElement,M=A=>{A==="class"?(P.classList.remove(...v),S&&P.classList.add(S)):A.startsWith("data-")&&(S?P.setAttribute(A,S):P.removeAttribute(A))};if(Array.isArray(l)?l.forEach(M):M(l),n){let A=gv.includes(o)?o:null,_=gv.includes(w)?w:A;P.style.colorScheme=_}C==null||C()},[u]),j=p.useCallback(k=>{let w=typeof k=="function"?k(m):k;h(w);try{localStorage.setItem(s,w)}catch{}},[m]),b=p.useCallback(k=>{let w=Gf(k);x(w),m==="system"&&r&&!e&&y("system")},[m,e]);p.useEffect(()=>{let k=window.matchMedia($j);return k.addListener(b),b(k),()=>k.removeListener(b)},[b]),p.useEffect(()=>{let k=w=>{w.key===s&&(w.newValue?h(w.newValue):j(o))};return window.addEventListener("storage",k),()=>window.removeEventListener("storage",k)},[j]),p.useEffect(()=>{y(e??m)},[e,m]);let N=p.useMemo(()=>({theme:m,setTheme:j,forcedTheme:e,resolvedTheme:m==="system"?g:m,themes:r?[...i,"system"]:i,systemTheme:r?g:void 0}),[m,j,e,g,r,i]);return p.createElement(jp.Provider,{value:N},p.createElement(hA,{forcedTheme:e,storageKey:s,attribute:l,enableSystem:r,enableColorScheme:n,defaultTheme:o,value:c,themes:i,nonce:u,scriptProps:f}),d)},hA=p.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:i,value:o,themes:l,nonce:c,scriptProps:d})=>{let u=JSON.stringify([r,t,i,e,l,o,n,s]).slice(1,-1);return p.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${oA.toString()})(${u})`}})}),pA=(e,t)=>{if(lA)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},gA=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Gf=e=>(e||(e=window.matchMedia($j)),e.matches?"dark":"light");function xA({children:e}){return a.jsx(uA,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:e})}const zj=p.createContext(null),cs="meridian_token",ho="meridian_user",pc="meridian_workspace";function xv(e){try{const t=e.split(".")[1],r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return Array.isArray(n.roles)?n.roles:[]}catch{return[]}}function vA({children:e}){const[t,r]=p.useState(()=>{try{const f=localStorage.getItem(ho),m=localStorage.getItem(cs);if(!f)return null;const h=JSON.parse(f);return h.roles=m?xv(m):[],h}catch{return null}}),[n,s]=p.useState(()=>{const f=localStorage.getItem(cs),m=localStorage.getItem(ho);return f&&!m?(localStorage.removeItem(cs),null):f}),[i,o]=p.useState(()=>{try{const f=localStorage.getItem(pc);return f?JSON.parse(f):null}catch{return null}}),l=(f,m)=>{const h=xv(m),g={...f,roles:h};r(g),s(m),localStorage.setItem(cs,m),localStorage.setItem(ho,JSON.stringify(g))},c=()=>{const f=localStorage.getItem(cs);f&&fetch("/auth/logout",{method:"POST",headers:{Authorization:`Bearer ${f}`,"Content-Type":"application/json"}}).catch(()=>{}),r(null),s(null),o(null),localStorage.removeItem(cs),localStorage.removeItem(ho),localStorage.removeItem(pc)};p.useEffect(()=>{const f=()=>{localStorage.getItem(cs)&&c()};return window.addEventListener("meridian:unauthorized",f),()=>window.removeEventListener("meridian:unauthorized",f)},[]);const d=f=>{o(f),f?localStorage.setItem(pc,JSON.stringify(f)):localStorage.removeItem(pc)},u=f=>{r(m=>{if(!m)return m;const h={...m,...f};return localStorage.setItem(ho,JSON.stringify(h)),h})};return a.jsx(zj.Provider,{value:{user:t,token:n,workspace:i,isAuthenticated:!!n&&!!t,login:l,logout:c,setWorkspace:d,updateLocalUser:u},children:e})}function De(){const e=p.useContext(zj);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const Lj=p.createContext(null);function yA({children:e}){const[t,r]=p.useState(!1);return p.useEffect(()=>{const n=s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"&&(s.preventDefault(),r(i=>!i))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),a.jsx(Lj.Provider,{value:{open:t,setOpen:r,toggle:()=>r(n=>!n)},children:e})}function Fj(){const e=p.useContext(Lj);if(!e)throw new Error("useCommandPalette must be used within CommandPaletteProvider");return e}function Bj(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Bj(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Je(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Bj(e))&&(n&&(n+=" "),n+=t);return n}const Np="-",bA=e=>{const t=jA(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Np);return l[0]===""&&l.length!==1&&l.shift(),Wj(l,t)||wA(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},Wj=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?Wj(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Np);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},vv=/^\[(.+)\]$/,wA=e=>{if(vv.test(e)){const t=vv.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},jA=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return kA(Object.entries(e.classGroups),r).forEach(([i,o])=>{Qm(o,n,i,t)}),n},Qm=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:yv(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(NA(s)){Qm(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{Qm(o,yv(t,i),r,n)})})},yv=(e,t)=>{let r=e;return t.split(Np).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},NA=e=>e.isThemeGetter,kA=(e,t)=>t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[r,s]}):e,SA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(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 s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},Uj="!",CA=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,o=l=>{const c=[];let d=0,u=0,f;for(let v=0;v<l.length;v++){let y=l[v];if(d===0){if(y===s&&(n||l.slice(v,v+i)===t)){c.push(l.slice(u,v)),u=v+i;continue}if(y==="/"){f=v;continue}}y==="["?d++:y==="]"&&d--}const m=c.length===0?l:l.substring(u),h=m.startsWith(Uj),g=h?m.substring(1):m,x=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:x}};return r?l=>r({className:l,parseClassName:o}):o},_A=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},OA=e=>({cache:SA(e.cacheSize),parseClassName:CA(e),...bA(e)}),PA=/\s+/,MA=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(PA);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:h}=r(d);let g=!!h,x=n(g?m.substring(0,h):m);if(!x){if(!g){l=d+(l.length>0?" "+l:l);continue}if(x=n(m),!x){l=d+(l.length>0?" "+l:l);continue}g=!1}const v=_A(u).join(":"),y=f?v+Uj:v,j=y+x;if(i.includes(j))continue;i.push(j);const b=s(x,g);for(let N=0;N<b.length;++N){const k=b[N];i.push(y+k)}l=d+(l.length>0?" "+l:l)}return l};function AA(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=qj(t))&&(n&&(n+=" "),n+=r);return n}const qj=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=qj(e[n]))&&(r&&(r+=" "),r+=t);return r};function EA(e,...t){let r,n,s,i=o;function o(c){const d=t.reduce((u,f)=>f(u),e());return r=OA(d),n=r.cache.get,s=r.cache.set,i=l,l(c)}function l(c){const d=n(c);if(d)return d;const u=MA(c,r);return s(c,u),u}return function(){return i(AA.apply(null,arguments))}}const at=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Hj=/^\[(?:([a-z-]+):)?(.+)\]$/i,DA=/^\d+\/\d+$/,TA=new Set(["px","full","screen"]),IA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RA=/\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$/,$A=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,LA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ea=e=>vi(e)||TA.has(e)||DA.test(e),Ra=e=>Bi(e,"length",YA),vi=e=>!!e&&!Number.isNaN(Number(e)),Vf=e=>Bi(e,"number",vi),po=e=>!!e&&Number.isInteger(Number(e)),FA=e=>e.endsWith("%")&&vi(e.slice(0,-1)),Te=e=>Hj.test(e),$a=e=>IA.test(e),BA=new Set(["length","size","percentage"]),WA=e=>Bi(e,BA,Kj),UA=e=>Bi(e,"position",Kj),qA=new Set(["image","url"]),HA=e=>Bi(e,qA,VA),KA=e=>Bi(e,"",GA),go=()=>!0,Bi=(e,t,r)=>{const n=Hj.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},YA=e=>RA.test(e)&&!$A.test(e),Kj=()=>!1,GA=e=>zA.test(e),VA=e=>LA.test(e),XA=()=>{const e=at("colors"),t=at("spacing"),r=at("blur"),n=at("brightness"),s=at("borderColor"),i=at("borderRadius"),o=at("borderSpacing"),l=at("borderWidth"),c=at("contrast"),d=at("grayscale"),u=at("hueRotate"),f=at("invert"),m=at("gap"),h=at("gradientColorStops"),g=at("gradientColorStopPositions"),x=at("inset"),v=at("margin"),y=at("opacity"),j=at("padding"),b=at("saturate"),N=at("scale"),k=at("sepia"),w=at("skew"),S=at("space"),C=at("translate"),P=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",Te,t],_=()=>[Te,t],D=()=>["",ea,Ra],O=()=>["auto",vi,Te],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["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"],ne=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",Te],oe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>[vi,Te];return{cacheSize:500,separator:":",theme:{colors:[go],spacing:[ea,Ra],blur:["none","",$a,Te],brightness:ce(),borderColor:[e],borderRadius:["none","","full",$a,Te],borderSpacing:_(),borderWidth:D(),contrast:ce(),grayscale:G(),hueRotate:ce(),invert:G(),gap:_(),gradientColorStops:[e],gradientColorStopPositions:[FA,Ra],inset:A(),margin:A(),opacity:ce(),padding:_(),saturate:ce(),scale:ce(),sepia:G(),skew:ce(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",Te]}],container:["container"],columns:[{columns:[$a]}],"break-after":[{"break-after":oe()}],"break-before":[{"break-before":oe()}],"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:[...R(),Te]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",po,Te]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Te]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",po,Te]}],"grid-cols":[{"grid-cols":[go]}],"col-start-end":[{col:["auto",{span:["full",po,Te]},Te]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[go]}],"row-start-end":[{row:["auto",{span:[po,Te]},Te]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Te]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Te,t]}],"min-w":[{"min-w":[Te,t,"min","max","fit"]}],"max-w":[{"max-w":[Te,t,"none","full","min","max","fit","prose",{screen:[$a]},$a]}],h:[{h:[Te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$a,Ra]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Vf]}],"font-family":[{font:[go]}],"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",Te]}],"line-clamp":[{"line-clamp":["none",vi,Vf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ea,Te]}],"list-image":[{"list-image":["none",Te]}],"list-style-type":[{list:["none","disc","decimal",Te]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ea,Ra]}],"underline-offset":[{"underline-offset":["auto",ea,Te]}],"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:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te]}],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",Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),UA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",WA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},HA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:F()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[ea,Te]}],"outline-w":[{outline:[ea,Ra]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ea,Ra]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$a,KA]}],"shadow-color":[{shadow:[go]}],opacity:[{opacity:[y]}],"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:[c]}],"drop-shadow":[{"drop-shadow":["","none",$a,Te]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"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",Te]}],duration:[{duration:ce()}],ease:[{ease:["linear","in","out","in-out",Te]}],delay:[{delay:ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",Te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[po,Te]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[w]}],"skew-y":[{"skew-y":[w]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Te]}],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",Te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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",Te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ea,Ra,Vf]}],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"]}}},QA=EA(XA);function T(...e){return QA(Je(e))}const ou=RP,qa=TP,Ha=IP,da=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(Zw,{ref:n,sideOffset:t,className:T("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}));da.displayName=Zw.displayName;const Yj=p.createContext([]);function ZA({widgets:e,children:t}){return E.createElement(Yj.Provider,{value:e},t)}function JA(e){return p.useContext(Yj).filter(r=>r.zone===e).map(r=>r.component)}var Xw;const Ni=((Xw=window.__MERIDIAN_CONFIG__)==null?void 0:Xw.apiUrl)??void 0??"";class kp extends Error{constructor(t,r,n){super(r),this.status=t,this.data=n,this.name="ApiError"}}function Gj(){return localStorage.getItem("meridian_token")}async function xo(e,t={}){var i;const r=Gj(),n={"Content-Type":"application/json",...t.headers};r&&(n.Authorization=`Bearer ${r}`);const s=await fetch(`${Ni}${e}`,{...t,headers:n});if(!s.ok){let o;try{o=await s.json()}catch{o=null}const l=((i=o==null?void 0:o.error)==null?void 0:i.message)??`HTTP ${s.status}`;throw s.status===401&&window.dispatchEvent(new CustomEvent("meridian:unauthorized")),new kp(s.status,l,o)}if(s.status!==204)return s.json()}const te={get:e=>xo(e,{method:"GET"}),post:(e,t)=>xo(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>xo(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>xo(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>xo(e,{method:"DELETE"}),upload:async(e,t)=>{var i;const r=Gj(),n={};r&&(n.Authorization=`Bearer ${r}`);const s=await fetch(`${Ni}${e}`,{method:"POST",headers:n,body:t});if(!s.ok){let o;try{o=await s.json()}catch{o=null}const l=((i=o==null?void 0:o.error)==null?void 0:i.message)??`HTTP ${s.status}`;throw s.status===401&&window.dispatchEvent(new CustomEvent("meridian:unauthorized")),new kp(s.status,l,o)}if(s.status!==204)return s.json()}},At={all:["issues"],byProject:(e,t)=>[...At.all,"project",e,...t?[t]:[]],detail:e=>[...At.all,e],comments:e=>[...At.all,e,"comments"],activities:e=>[...At.all,e,"activities"]};function Nl(e,t){return Le({queryKey:e?At.byProject(e,t):At.all,queryFn:()=>{var n,s,i;const r=new URLSearchParams;return e&&r.set("project_id",e),(n=t==null?void 0:t.priority)!=null&&n.length&&r.set("priority",t.priority.join(",")),t!=null&&t.assignee_id&&r.set("assignee_id",t.assignee_id),(s=t==null?void 0:t.type)!=null&&s.length&&r.set("type",t.type.join(",")),(i=t==null?void 0:t.status)!=null&&i.length&&r.set("status",t.status.join(",")),te.get(`/admin/issues?${r}`)},select:r=>r.issues,enabled:e!==void 0?!!e:!0})}function Vj(e){return Le({queryKey:At.detail(e),queryFn:()=>te.get(`/admin/issues/${e}`),select:t=>t.issue,enabled:!!e})}function eE(e){return Le({queryKey:At.comments(e),queryFn:()=>te.get(`/admin/issues/${e}/comments`),select:t=>t.comments,enabled:!!e})}function Xj(){const e=Ne();return we({mutationFn:t=>te.post("/admin/issues",t),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:At.byProject(r.project_id)})}})}function lu(e,t){const r=Ne();return we({mutationFn:n=>te.put(`/admin/issues/${e}`,n),onMutate:async n=>{await r.cancelQueries({queryKey:At.byProject(t)});const s=r.getQueryData(At.byProject(t));return r.setQueryData(At.byProject(t),i=>i&&{...i,issues:i.issues.map(o=>o.id===e?{...o,...n}:o)}),{previous:s}},onError:(n,s,i)=>{i!=null&&i.previous&&r.setQueryData(At.byProject(t),i.previous)},onSettled:()=>{r.invalidateQueries({queryKey:At.byProject(t)}),r.invalidateQueries({queryKey:At.detail(e)})}})}function tE(e){return Le({queryKey:At.activities(e),queryFn:()=>te.get(`/admin/issues/${e}/activities`),select:t=>t.activities,enabled:!!e})}function rE(e){const t=Ne();return we({mutationFn:r=>te.post(`/admin/issues/${e}/comments`,{body:r}),onSuccess:()=>{t.invalidateQueries({queryKey:At.comments(e)})}})}const bv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,wv=Je,kl=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return wv(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(d=>{const u=r==null?void 0:r[d],f=i==null?void 0:i[d];if(u===null)return null;const m=bv(u)||bv(f);return s[d][m]}),l=r&&Object.entries(r).reduce((d,u)=>{let[f,m]=u;return m===void 0||(d[f]=m),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:f,className:m,...h}=u;return Object.entries(h).every(g=>{let[x,v]=g;return Array.isArray(v)?v.includes({...i,...l}[x]):{...i,...l}[x]===v})?[...d,f,m]:d},[]);return wv(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)},yi=kl("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 hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",indigo:"bg-indigo text-indigo-foreground hover:opacity-90"},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","icon-sm":"h-7 w-7"}},defaultVariants:{variant:"default",size:"default"}}),Z=p.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const o=n?xp:"button";return a.jsx(o,{className:T(yi({variant:t,size:r,className:e})),ref:i,...s})});Z.displayName="Button";const Ee=p.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:T("flex h-9 w-full rounded-lg border border-input bg-transparent px-3 py-1 text-sm shadow-none transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-[#9ca3af] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Ee.displayName="Input";/**
|
|
4
|
-
* @license lucide-react v0.468.0 - ISC
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the ISC license.
|
|
7
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/const nE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qj=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
|
|
9
|
-
* @license lucide-react v0.468.0 - ISC
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the ISC license.
|
|
12
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/var aE={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"};/**
|
|
14
|
-
* @license lucide-react v0.468.0 - ISC
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the ISC license.
|
|
17
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/const sE=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...l},c)=>p.createElement("svg",{ref:c,...aE,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Qj("lucide",s),...l},[...o.map(([d,u])=>p.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
|
|
19
|
-
* @license lucide-react v0.468.0 - ISC
|
|
20
|
-
*
|
|
21
|
-
* This source code is licensed under the ISC license.
|
|
22
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/const J=(e,t)=>{const r=p.forwardRef(({className:n,...s},i)=>p.createElement(sE,{ref:i,iconNode:t,className:Qj(`lucide-${nE(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
|
|
24
|
-
* @license lucide-react v0.468.0 - ISC
|
|
25
|
-
*
|
|
26
|
-
* This source code is licensed under the ISC license.
|
|
27
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/const cu=J("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"}]]);/**
|
|
29
|
-
* @license lucide-react v0.468.0 - ISC
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the ISC license.
|
|
32
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/const Sl=J("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
34
|
-
* @license lucide-react v0.468.0 - ISC
|
|
35
|
-
*
|
|
36
|
-
* This source code is licensed under the ISC license.
|
|
37
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
-
*/const Sp=J("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
39
|
-
* @license lucide-react v0.468.0 - ISC
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the ISC license.
|
|
42
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/const Cp=J("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
44
|
-
* @license lucide-react v0.468.0 - ISC
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the ISC license.
|
|
47
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/const Cl=J("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
49
|
-
* @license lucide-react v0.468.0 - ISC
|
|
50
|
-
*
|
|
51
|
-
* This source code is licensed under the ISC license.
|
|
52
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
-
*/const ki=J("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
|
54
|
-
* @license lucide-react v0.468.0 - ISC
|
|
55
|
-
*
|
|
56
|
-
* This source code is licensed under the ISC license.
|
|
57
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/const Zj=J("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
|
|
59
|
-
* @license lucide-react v0.468.0 - ISC
|
|
60
|
-
*
|
|
61
|
-
* This source code is licensed under the ISC license.
|
|
62
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
-
*/const Jj=J("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
|
|
64
|
-
* @license lucide-react v0.468.0 - ISC
|
|
65
|
-
*
|
|
66
|
-
* This source code is licensed under the ISC license.
|
|
67
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
-
*/const iE=J("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
|
|
69
|
-
* @license lucide-react v0.468.0 - ISC
|
|
70
|
-
*
|
|
71
|
-
* This source code is licensed under the ISC license.
|
|
72
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
-
*/const e1=J("CalendarDays",[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
|
|
74
|
-
* @license lucide-react v0.468.0 - ISC
|
|
75
|
-
*
|
|
76
|
-
* This source code is licensed under the ISC license.
|
|
77
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/const Wi=J("CalendarRange",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]]);/**
|
|
79
|
-
* @license lucide-react v0.468.0 - ISC
|
|
80
|
-
*
|
|
81
|
-
* This source code is licensed under the ISC license.
|
|
82
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/const cr=J("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"}]]);/**
|
|
84
|
-
* @license lucide-react v0.468.0 - ISC
|
|
85
|
-
*
|
|
86
|
-
* This source code is licensed under the ISC license.
|
|
87
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/const oE=J("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
|
|
89
|
-
* @license lucide-react v0.468.0 - ISC
|
|
90
|
-
*
|
|
91
|
-
* This source code is licensed under the ISC license.
|
|
92
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/const Xa=J("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
|
|
94
|
-
* @license lucide-react v0.468.0 - ISC
|
|
95
|
-
*
|
|
96
|
-
* This source code is licensed under the ISC license.
|
|
97
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/const lE=J("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
|
|
99
|
-
* @license lucide-react v0.468.0 - ISC
|
|
100
|
-
*
|
|
101
|
-
* This source code is licensed under the ISC license.
|
|
102
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/const lr=J("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
104
|
-
* @license lucide-react v0.468.0 - ISC
|
|
105
|
-
*
|
|
106
|
-
* This source code is licensed under the ISC license.
|
|
107
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/const Kn=J("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
109
|
-
* @license lucide-react v0.468.0 - ISC
|
|
110
|
-
*
|
|
111
|
-
* This source code is licensed under the ISC license.
|
|
112
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
-
*/const du=J("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
114
|
-
* @license lucide-react v0.468.0 - ISC
|
|
115
|
-
*
|
|
116
|
-
* This source code is licensed under the ISC license.
|
|
117
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/const kn=J("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
119
|
-
* @license lucide-react v0.468.0 - ISC
|
|
120
|
-
*
|
|
121
|
-
* This source code is licensed under the ISC license.
|
|
122
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
-
*/const _p=J("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
124
|
-
* @license lucide-react v0.468.0 - ISC
|
|
125
|
-
*
|
|
126
|
-
* This source code is licensed under the ISC license.
|
|
127
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
-
*/const Ui=J("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
|
129
|
-
* @license lucide-react v0.468.0 - ISC
|
|
130
|
-
*
|
|
131
|
-
* This source code is licensed under the ISC license.
|
|
132
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/const rs=J("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
134
|
-
* @license lucide-react v0.468.0 - ISC
|
|
135
|
-
*
|
|
136
|
-
* This source code is licensed under the ISC license.
|
|
137
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/const t1=J("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
139
|
-
* @license lucide-react v0.468.0 - ISC
|
|
140
|
-
*
|
|
141
|
-
* This source code is licensed under the ISC license.
|
|
142
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
-
*/const Op=J("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"}]]);/**
|
|
144
|
-
* @license lucide-react v0.468.0 - ISC
|
|
145
|
-
*
|
|
146
|
-
* This source code is licensed under the ISC license.
|
|
147
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
-
*/const rn=J("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
149
|
-
* @license lucide-react v0.468.0 - ISC
|
|
150
|
-
*
|
|
151
|
-
* This source code is licensed under the ISC license.
|
|
152
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
-
*/const cE=J("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
154
|
-
* @license lucide-react v0.468.0 - ISC
|
|
155
|
-
*
|
|
156
|
-
* This source code is licensed under the ISC license.
|
|
157
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
-
*/const Yn=J("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
159
|
-
* @license lucide-react v0.468.0 - ISC
|
|
160
|
-
*
|
|
161
|
-
* This source code is licensed under the ISC license.
|
|
162
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
-
*/const r1=J("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
164
|
-
* @license lucide-react v0.468.0 - ISC
|
|
165
|
-
*
|
|
166
|
-
* This source code is licensed under the ISC license.
|
|
167
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
-
*/const n1=J("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
169
|
-
* @license lucide-react v0.468.0 - ISC
|
|
170
|
-
*
|
|
171
|
-
* This source code is licensed under the ISC license.
|
|
172
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
-
*/const a1=J("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
174
|
-
* @license lucide-react v0.468.0 - ISC
|
|
175
|
-
*
|
|
176
|
-
* This source code is licensed under the ISC license.
|
|
177
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
-
*/const dE=J("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
179
|
-
* @license lucide-react v0.468.0 - ISC
|
|
180
|
-
*
|
|
181
|
-
* This source code is licensed under the ISC license.
|
|
182
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
-
*/const Pp=J("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"}]]);/**
|
|
184
|
-
* @license lucide-react v0.468.0 - ISC
|
|
185
|
-
*
|
|
186
|
-
* This source code is licensed under the ISC license.
|
|
187
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
-
*/const Ys=J("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
189
|
-
* @license lucide-react v0.468.0 - ISC
|
|
190
|
-
*
|
|
191
|
-
* This source code is licensed under the ISC license.
|
|
192
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
-
*/const s1=J("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
194
|
-
* @license lucide-react v0.468.0 - ISC
|
|
195
|
-
*
|
|
196
|
-
* This source code is licensed under the ISC license.
|
|
197
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
-
*/const Mp=J("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
199
|
-
* @license lucide-react v0.468.0 - ISC
|
|
200
|
-
*
|
|
201
|
-
* This source code is licensed under the ISC license.
|
|
202
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
-
*/const _l=J("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
204
|
-
* @license lucide-react v0.468.0 - ISC
|
|
205
|
-
*
|
|
206
|
-
* This source code is licensed under the ISC license.
|
|
207
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
-
*/const uE=J("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/**
|
|
209
|
-
* @license lucide-react v0.468.0 - ISC
|
|
210
|
-
*
|
|
211
|
-
* This source code is licensed under the ISC license.
|
|
212
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
-
*/const fE=J("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
|
|
214
|
-
* @license lucide-react v0.468.0 - ISC
|
|
215
|
-
*
|
|
216
|
-
* This source code is licensed under the ISC license.
|
|
217
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
-
*/const mE=J("FileImage",[["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"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
|
|
219
|
-
* @license lucide-react v0.468.0 - ISC
|
|
220
|
-
*
|
|
221
|
-
* This source code is licensed under the ISC license.
|
|
222
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
-
*/const hE=J("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"}]]);/**
|
|
224
|
-
* @license lucide-react v0.468.0 - ISC
|
|
225
|
-
*
|
|
226
|
-
* This source code is licensed under the ISC license.
|
|
227
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
-
*/const pE=J("File",[["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"}]]);/**
|
|
229
|
-
* @license lucide-react v0.468.0 - ISC
|
|
230
|
-
*
|
|
231
|
-
* This source code is licensed under the ISC license.
|
|
232
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
-
*/const Ap=J("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
234
|
-
* @license lucide-react v0.468.0 - ISC
|
|
235
|
-
*
|
|
236
|
-
* This source code is licensed under the ISC license.
|
|
237
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
-
*/const ua=J("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
239
|
-
* @license lucide-react v0.468.0 - ISC
|
|
240
|
-
*
|
|
241
|
-
* This source code is licensed under the ISC license.
|
|
242
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
-
*/const Zm=J("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
244
|
-
* @license lucide-react v0.468.0 - ISC
|
|
245
|
-
*
|
|
246
|
-
* This source code is licensed under the ISC license.
|
|
247
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
-
*/const i1=J("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
249
|
-
* @license lucide-react v0.468.0 - ISC
|
|
250
|
-
*
|
|
251
|
-
* This source code is licensed under the ISC license.
|
|
252
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
-
*/const gE=J("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
|
|
254
|
-
* @license lucide-react v0.468.0 - ISC
|
|
255
|
-
*
|
|
256
|
-
* This source code is licensed under the ISC license.
|
|
257
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
-
*/const xE=J("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
|
|
259
|
-
* @license lucide-react v0.468.0 - ISC
|
|
260
|
-
*
|
|
261
|
-
* This source code is licensed under the ISC license.
|
|
262
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
-
*/const vE=J("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
|
|
264
|
-
* @license lucide-react v0.468.0 - ISC
|
|
265
|
-
*
|
|
266
|
-
* This source code is licensed under the ISC license.
|
|
267
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
-
*/const o1=J("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
|
|
269
|
-
* @license lucide-react v0.468.0 - ISC
|
|
270
|
-
*
|
|
271
|
-
* This source code is licensed under the ISC license.
|
|
272
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
-
*/const Er=J("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
274
|
-
* @license lucide-react v0.468.0 - ISC
|
|
275
|
-
*
|
|
276
|
-
* This source code is licensed under the ISC license.
|
|
277
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
-
*/const Jc=J("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
279
|
-
* @license lucide-react v0.468.0 - ISC
|
|
280
|
-
*
|
|
281
|
-
* This source code is licensed under the ISC license.
|
|
282
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
-
*/const yE=J("Link2Off",[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
|
|
284
|
-
* @license lucide-react v0.468.0 - ISC
|
|
285
|
-
*
|
|
286
|
-
* This source code is licensed under the ISC license.
|
|
287
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
-
*/const uu=J("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
289
|
-
* @license lucide-react v0.468.0 - ISC
|
|
290
|
-
*
|
|
291
|
-
* This source code is licensed under the ISC license.
|
|
292
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
-
*/const bE=J("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
294
|
-
* @license lucide-react v0.468.0 - ISC
|
|
295
|
-
*
|
|
296
|
-
* This source code is licensed under the ISC license.
|
|
297
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
-
*/const l1=J("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
299
|
-
* @license lucide-react v0.468.0 - ISC
|
|
300
|
-
*
|
|
301
|
-
* This source code is licensed under the ISC license.
|
|
302
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
-
*/const yn=J("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
|
|
304
|
-
* @license lucide-react v0.468.0 - ISC
|
|
305
|
-
*
|
|
306
|
-
* This source code is licensed under the ISC license.
|
|
307
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
-
*/const c1=J("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
|
|
309
|
-
* @license lucide-react v0.468.0 - ISC
|
|
310
|
-
*
|
|
311
|
-
* This source code is licensed under the ISC license.
|
|
312
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
-
*/const qi=J("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"}]]);/**
|
|
314
|
-
* @license lucide-react v0.468.0 - ISC
|
|
315
|
-
*
|
|
316
|
-
* This source code is licensed under the ISC license.
|
|
317
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
-
*/const fu=J("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
319
|
-
* @license lucide-react v0.468.0 - ISC
|
|
320
|
-
*
|
|
321
|
-
* This source code is licensed under the ISC license.
|
|
322
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
-
*/const wE=J("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
324
|
-
* @license lucide-react v0.468.0 - ISC
|
|
325
|
-
*
|
|
326
|
-
* This source code is licensed under the ISC license.
|
|
327
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
-
*/const d1=J("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
329
|
-
* @license lucide-react v0.468.0 - ISC
|
|
330
|
-
*
|
|
331
|
-
* This source code is licensed under the ISC license.
|
|
332
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
-
*/const Hi=J("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
334
|
-
* @license lucide-react v0.468.0 - ISC
|
|
335
|
-
*
|
|
336
|
-
* This source code is licensed under the ISC license.
|
|
337
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
-
*/const jE=J("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
339
|
-
* @license lucide-react v0.468.0 - ISC
|
|
340
|
-
*
|
|
341
|
-
* This source code is licensed under the ISC license.
|
|
342
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
-
*/const NE=J("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
344
|
-
* @license lucide-react v0.468.0 - ISC
|
|
345
|
-
*
|
|
346
|
-
* This source code is licensed under the ISC license.
|
|
347
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
-
*/const kE=J("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
349
|
-
* @license lucide-react v0.468.0 - ISC
|
|
350
|
-
*
|
|
351
|
-
* This source code is licensed under the ISC license.
|
|
352
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
-
*/const Ep=J("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
|
|
354
|
-
* @license lucide-react v0.468.0 - ISC
|
|
355
|
-
*
|
|
356
|
-
* This source code is licensed under the ISC license.
|
|
357
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
-
*/const Ds=J("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
359
|
-
* @license lucide-react v0.468.0 - ISC
|
|
360
|
-
*
|
|
361
|
-
* This source code is licensed under the ISC license.
|
|
362
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
-
*/const mu=J("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
364
|
-
* @license lucide-react v0.468.0 - ISC
|
|
365
|
-
*
|
|
366
|
-
* This source code is licensed under the ISC license.
|
|
367
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
-
*/const it=J("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
369
|
-
* @license lucide-react v0.468.0 - ISC
|
|
370
|
-
*
|
|
371
|
-
* This source code is licensed under the ISC license.
|
|
372
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
-
*/const SE=J("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
|
|
374
|
-
* @license lucide-react v0.468.0 - ISC
|
|
375
|
-
*
|
|
376
|
-
* This source code is licensed under the ISC license.
|
|
377
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
-
*/const CE=J("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
|
|
379
|
-
* @license lucide-react v0.468.0 - ISC
|
|
380
|
-
*
|
|
381
|
-
* This source code is licensed under the ISC license.
|
|
382
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
-
*/const Go=J("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
384
|
-
* @license lucide-react v0.468.0 - ISC
|
|
385
|
-
*
|
|
386
|
-
* This source code is licensed under the ISC license.
|
|
387
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
-
*/const Ol=J("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
389
|
-
* @license lucide-react v0.468.0 - ISC
|
|
390
|
-
*
|
|
391
|
-
* This source code is licensed under the ISC license.
|
|
392
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
-
*/const _E=J("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
394
|
-
* @license lucide-react v0.468.0 - ISC
|
|
395
|
-
*
|
|
396
|
-
* This source code is licensed under the ISC license.
|
|
397
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
-
*/const Dp=J("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
399
|
-
* @license lucide-react v0.468.0 - ISC
|
|
400
|
-
*
|
|
401
|
-
* This source code is licensed under the ISC license.
|
|
402
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
403
|
-
*/const Tp=J("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
404
|
-
* @license lucide-react v0.468.0 - ISC
|
|
405
|
-
*
|
|
406
|
-
* This source code is licensed under the ISC license.
|
|
407
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
-
*/const OE=J("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
409
|
-
* @license lucide-react v0.468.0 - ISC
|
|
410
|
-
*
|
|
411
|
-
* This source code is licensed under the ISC license.
|
|
412
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
413
|
-
*/const PE=J("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
414
|
-
* @license lucide-react v0.468.0 - ISC
|
|
415
|
-
*
|
|
416
|
-
* This source code is licensed under the ISC license.
|
|
417
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
418
|
-
*/const Jm=J("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
419
|
-
* @license lucide-react v0.468.0 - ISC
|
|
420
|
-
*
|
|
421
|
-
* This source code is licensed under the ISC license.
|
|
422
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
423
|
-
*/const u1=J("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
424
|
-
* @license lucide-react v0.468.0 - ISC
|
|
425
|
-
*
|
|
426
|
-
* This source code is licensed under the ISC license.
|
|
427
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
428
|
-
*/const f1=J("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
429
|
-
* @license lucide-react v0.468.0 - ISC
|
|
430
|
-
*
|
|
431
|
-
* This source code is licensed under the ISC license.
|
|
432
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
433
|
-
*/const ME=J("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
434
|
-
* @license lucide-react v0.468.0 - ISC
|
|
435
|
-
*
|
|
436
|
-
* This source code is licensed under the ISC license.
|
|
437
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
438
|
-
*/const m1=J("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
|
|
439
|
-
* @license lucide-react v0.468.0 - ISC
|
|
440
|
-
*
|
|
441
|
-
* This source code is licensed under the ISC license.
|
|
442
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
443
|
-
*/const AE=J("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"}]]);/**
|
|
444
|
-
* @license lucide-react v0.468.0 - ISC
|
|
445
|
-
*
|
|
446
|
-
* This source code is licensed under the ISC license.
|
|
447
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
448
|
-
*/const EE=J("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
449
|
-
* @license lucide-react v0.468.0 - ISC
|
|
450
|
-
*
|
|
451
|
-
* This source code is licensed under the ISC license.
|
|
452
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
453
|
-
*/const DE=J("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
454
|
-
* @license lucide-react v0.468.0 - ISC
|
|
455
|
-
*
|
|
456
|
-
* This source code is licensed under the ISC license.
|
|
457
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
458
|
-
*/const TE=J("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
|
|
459
|
-
* @license lucide-react v0.468.0 - ISC
|
|
460
|
-
*
|
|
461
|
-
* This source code is licensed under the ISC license.
|
|
462
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
463
|
-
*/const IE=J("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
464
|
-
* @license lucide-react v0.468.0 - ISC
|
|
465
|
-
*
|
|
466
|
-
* This source code is licensed under the ISC license.
|
|
467
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
468
|
-
*/const Hr=J("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
469
|
-
* @license lucide-react v0.468.0 - ISC
|
|
470
|
-
*
|
|
471
|
-
* This source code is licensed under the ISC license.
|
|
472
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
473
|
-
*/const RE=J("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
|
|
474
|
-
* @license lucide-react v0.468.0 - ISC
|
|
475
|
-
*
|
|
476
|
-
* This source code is licensed under the ISC license.
|
|
477
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
478
|
-
*/const $E=J("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
|
|
479
|
-
* @license lucide-react v0.468.0 - ISC
|
|
480
|
-
*
|
|
481
|
-
* This source code is licensed under the ISC license.
|
|
482
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
483
|
-
*/const zE=J("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
|
|
484
|
-
* @license lucide-react v0.468.0 - ISC
|
|
485
|
-
*
|
|
486
|
-
* This source code is licensed under the ISC license.
|
|
487
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
488
|
-
*/const LE=J("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
489
|
-
* @license lucide-react v0.468.0 - ISC
|
|
490
|
-
*
|
|
491
|
-
* This source code is licensed under the ISC license.
|
|
492
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
493
|
-
*/const h1=J("UserMinus",[["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:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
494
|
-
* @license lucide-react v0.468.0 - ISC
|
|
495
|
-
*
|
|
496
|
-
* This source code is licensed under the ISC license.
|
|
497
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
498
|
-
*/const Ki=J("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"}]]);/**
|
|
499
|
-
* @license lucide-react v0.468.0 - ISC
|
|
500
|
-
*
|
|
501
|
-
* This source code is licensed under the ISC license.
|
|
502
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
503
|
-
*/const FE=J("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
504
|
-
* @license lucide-react v0.468.0 - ISC
|
|
505
|
-
*
|
|
506
|
-
* This source code is licensed under the ISC license.
|
|
507
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
508
|
-
*/const BE=J("UserX",[["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:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/**
|
|
509
|
-
* @license lucide-react v0.468.0 - ISC
|
|
510
|
-
*
|
|
511
|
-
* This source code is licensed under the ISC license.
|
|
512
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
513
|
-
*/const hu=J("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
514
|
-
* @license lucide-react v0.468.0 - ISC
|
|
515
|
-
*
|
|
516
|
-
* This source code is licensed under the ISC license.
|
|
517
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
518
|
-
*/const Ts=J("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/**
|
|
519
|
-
* @license lucide-react v0.468.0 - ISC
|
|
520
|
-
*
|
|
521
|
-
* This source code is licensed under the ISC license.
|
|
522
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
523
|
-
*/const Wa=J("Users",[["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"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
524
|
-
* @license lucide-react v0.468.0 - ISC
|
|
525
|
-
*
|
|
526
|
-
* This source code is licensed under the ISC license.
|
|
527
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
528
|
-
*/const nt=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
529
|
-
* @license lucide-react v0.468.0 - ISC
|
|
530
|
-
*
|
|
531
|
-
* This source code is licensed under the ISC license.
|
|
532
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
533
|
-
*/const ns=J("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function WE({issue:e}){const t=lu(e.id,e.project_id),[r,n]=p.useState(""),[s,i]=p.useState(""),[o,l]=p.useState(!1),c=e.metadata??{},d=Object.entries(c),u=()=>{if(!r.trim())return;const m={...c,[r.trim()]:s};t.mutate({metadata:m},{onSuccess:()=>{z.success("Metadata saved"),n(""),i(""),l(!1)},onError:()=>z.error("Failed to save metadata")})},f=m=>{const h={...c};delete h[m],t.mutate({metadata:Object.keys(h).length?h:null},{onSuccess:()=>z.success("Entry removed"),onError:()=>z.error("Failed to update metadata")})};return a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsxs("div",{className:"px-5 py-3 border-b border-border/60 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(dE,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Metadata"})]}),!o&&a.jsxs("button",{onClick:()=>l(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(it,{className:"h-3.5 w-3.5"}),"Add field"]})]}),a.jsxs("div",{className:"px-5 py-3 space-y-2",children:[d.length===0&&!o&&a.jsx("p",{className:"text-xs text-muted-foreground/50 italic",children:"No metadata fields yet"}),d.map(([m,h])=>a.jsxs("div",{className:"flex items-center gap-2 group",children:[a.jsx("span",{className:"text-xs font-mono text-muted-foreground w-28 shrink-0 truncate",children:m}),a.jsx("span",{className:"text-xs text-foreground flex-1 truncate",children:String(h)}),a.jsx("button",{onClick:()=>f(m),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(Hr,{className:"h-3 w-3"})})]},m)),o&&a.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[a.jsx(Ee,{autoFocus:!0,placeholder:"key",value:r,onChange:m=>n(m.target.value),onKeyDown:m=>{m.key==="Enter"&&u(),m.key==="Escape"&&l(!1)},className:"h-7 text-xs font-mono w-28 shrink-0"}),a.jsx(Ee,{placeholder:"value",value:s,onChange:m=>i(m.target.value),onKeyDown:m=>{m.key==="Enter"&&u(),m.key==="Escape"&&l(!1)},className:"h-7 text-xs flex-1"}),a.jsx(Z,{size:"sm",className:"h-7 px-2 text-xs",onClick:u,disabled:!r.trim()||t.isPending,children:"Save"}),a.jsx(Z,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>{l(!1),n(""),i("")},children:"Cancel"})]})]})]})}const UE=[{zone:"issue.details.after",component:WE}];function pu(e=!0){return Le({queryKey:["workspaces"],queryFn:()=>te.get("/admin/workspaces"),select:t=>t.workspaces,enabled:e})}function qE(){const e=Ne();return we({mutationFn:t=>te.post("/admin/workspaces",t),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]})}})}function HE(e){const t=Ne();return we({mutationFn:r=>te.put(`/admin/workspaces/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:["workspaces"]})}})}function KE(e){const t=Ne();return we({mutationFn:r=>{const n=new FormData;return n.append("logo",r),te.upload(`/admin/workspaces/${e}/logo`,n)},onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}function YE(e){const t=Ne();return we({mutationFn:()=>te.delete(`/admin/workspaces/${e}/logo`),onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}const Ip={list:e=>["workspaces",e,"invitations"]};function GE(e){return Le({queryKey:Ip.list(e),queryFn:()=>te.get(`/admin/workspaces/${e}/invitations`),select:t=>t.invitations,enabled:!!e})}function VE(e){const t=Ne();return we({mutationFn:r=>te.post(`/admin/workspaces/${e}/invitations`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Ip.list(e)})}})}function XE(e){const t=Ne();return we({mutationFn:r=>te.delete(`/admin/workspaces/${e}/invitations/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Ip.list(e)})}})}const gu={list:e=>["workspaces",e,"members"]};function Pl(e){return Le({queryKey:gu.list(e),queryFn:()=>te.get(`/admin/workspaces/${e}/members`),select:t=>t.members,enabled:!!e})}function QE(e){const t=Ne();return we({mutationFn:r=>te.post(`/admin/workspaces/${e}/members`,r),onSuccess:()=>{t.invalidateQueries({queryKey:gu.list(e)})}})}function ZE(e){const t=Ne();return we({mutationFn:({userId:r,role:n})=>te.patch(`/admin/workspaces/${e}/members/${r}`,{role:n}),onSuccess:()=>{t.invalidateQueries({queryKey:gu.list(e)})}})}function JE(e){const t=Ne();return we({mutationFn:r=>te.delete(`/admin/workspaces/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:gu.list(e)})}})}const Qa={list:e=>["workspaces",e,"teams"],members:(e,t)=>["workspaces",e,"teams",t,"members"]};function xu(e){return Le({queryKey:Qa.list(e),queryFn:()=>te.get(`/admin/workspaces/${e}/teams`),select:t=>t.teams,enabled:!!e})}function eD(e){const t=Ne();return we({mutationFn:r=>te.post(`/admin/workspaces/${e}/teams`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Qa.list(e)})}})}function tD(e){const t=Ne();return we({mutationFn:r=>te.delete(`/admin/workspaces/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Qa.list(e)})}})}function rD(e,t){return Le({queryKey:Qa.members(e,t),queryFn:()=>te.get(`/admin/workspaces/${e}/teams/${t}/members`),select:r=>r.members,enabled:!!(e&&t)})}function nD(e,t){const r=Ne();return we({mutationFn:n=>te.post(`/admin/workspaces/${e}/teams/${t}/members`,{user_id:n}),onSuccess:()=>{r.invalidateQueries({queryKey:Qa.members(e,t)}),r.invalidateQueries({queryKey:Qa.list(e)})}})}function aD(e,t){const r=Ne();return we({mutationFn:n=>te.delete(`/admin/workspaces/${e}/teams/${t}/members/${n}`),onSuccess:()=>{r.invalidateQueries({queryKey:Qa.members(e,t)}),r.invalidateQueries({queryKey:Qa.list(e)})}})}function vu(){return Le({queryKey:["setup-status"],queryFn:()=>te.get("/auth/setup"),staleTime:6e4,retry:!1})}function sD(){const{login:e}=De();return we({mutationFn:t=>te.post("/auth/login",t),onSuccess:t=>{e(t.user,t.token)}})}function iD(){const{login:e}=De();return we({mutationFn:t=>te.post("/auth/register",t),onSuccess:t=>{e(t.user,t.token)}})}function oD(e){const{login:t}=De();return we({mutationFn:r=>te.post(`/auth/invite/${e}`,r),onSuccess:r=>{t(r.user,r.token)}})}var Qw;const lD=((Qw=window.__MERIDIAN_CONFIG__)==null?void 0:Qw.apiUrl)??void 0??"";function cD(e,t){const r=`${lD}/admin/events?token=${encodeURIComponent(e)}&workspaceId=${encodeURIComponent(t)}`;return new EventSource(r)}function dD(){const{token:e,workspace:t}=De(),r=Ne(),n=p.useRef(null);p.useEffect(()=>{if(!e||!t)return;const s=cD(e,t.id);n.current=s;const i=o=>{o.forEach(l=>r.invalidateQueries({queryKey:l}))};return s.addEventListener("issue.created",()=>{i([["issues"],["notifications"]])}),s.addEventListener("issue.status_changed",()=>{i([["issues"]])}),s.addEventListener("issue.assigned",()=>{i([["issues"],["notifications"]])}),s.addEventListener("comment.created",()=>{i([["issues"],["notifications"]])}),s.onerror=()=>{},()=>{s.close(),n.current=null}},[e,t==null?void 0:t.id,r])}const Xf=768;function uD(){const[e,t]=p.useState(void 0);return p.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Xf-1}px)`),n=()=>{t(window.innerWidth<Xf)};return r.addEventListener("change",n),t(window.innerWidth<Xf),()=>r.removeEventListener("change",n)},[]),!!e}const Yi=p.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>a.jsx(Jw,{ref:s,decorative:r,orientation:t,className:T("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...n}));Yi.displayName=Jw.displayName;const fD=jl,mD=wl,p1=p.forwardRef(({className:e,...t},r)=>a.jsx(Hs,{className:T("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));p1.displayName=Hs.displayName;const hD=kl("fixed z-50 gap-4 bg-background border-border transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:duration-300",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-xl"}},defaultVariants:{side:"right"}}),g1=p.forwardRef(({side:e="right",className:t,children:r,...n},s)=>a.jsxs(mD,{children:[a.jsx(p1,{}),a.jsxs(Ks,{ref:s,className:T(hD({side:e}),t),...n,children:[r,a.jsxs(su,{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-secondary",children:[a.jsx(nt,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));g1.displayName=Ks.displayName;const x1=({className:e,...t})=>a.jsx("div",{className:T("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border",e),...t});x1.displayName="SheetHeader";const v1=p.forwardRef(({className:e,...t},r)=>a.jsx(Li,{ref:r,className:T("text-base font-semibold text-foreground",e),...t}));v1.displayName=Li.displayName;const y1=p.forwardRef(({className:e,...t},r)=>a.jsx(Fi,{ref:r,className:T("text-sm text-muted-foreground",e),...t}));y1.displayName=Fi.displayName;function le({className:e,...t}){return a.jsx("div",{className:T("animate-pulse rounded-md bg-muted",e),...t})}const pD="sidebar_state",gD=60*60*24*7,xD="16rem",vD="18rem",yD="3rem",bD="b",b1=p.createContext(null);function Rp(){const e=p.useContext(b1);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function yu({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:s,children:i,...o}){const l=uD(),[c,d]=p.useState(!1),[u,f]=p.useState(e),m=t??u,h=p.useCallback(y=>{const j=typeof y=="function"?y(m):y;r?r(j):f(j),document.cookie=`${pD}=${j}; path=/; max-age=${gD}`},[r,m]),g=p.useCallback(()=>l?d(y=>!y):h(y=>!y),[l,h,d]);p.useEffect(()=>{const y=j=>{j.key===bD&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]);const x=m?"expanded":"collapsed",v=p.useMemo(()=>({state:x,open:m,setOpen:h,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:g}),[x,m,h,l,c,d,g]);return a.jsx(b1.Provider,{value:v,children:a.jsx(ou,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":xD,"--sidebar-width-icon":yD,...s},className:T("group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex h-svh w-full",n),...o,children:i})})})}function bu({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...i}){const{isMobile:o,state:l,openMobile:c,setOpenMobile:d}=Rp();return r==="none"?a.jsx("div",{"data-slot":"sidebar",className:T("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",n),...i,children:s}):o?a.jsx(fD,{open:c,onOpenChange:d,...i,children:a.jsxs(g1,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-[var(--sidebar-width)] p-0 [&>button]:hidden",style:{"--sidebar-width":vD},side:e,children:[a.jsxs(x1,{className:"sr-only",children:[a.jsx(v1,{children:"Sidebar"}),a.jsx(y1,{children:"Displays the mobile sidebar."})]}),a.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):a.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[a.jsx("div",{"data-slot":"sidebar-gap",className:T("relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),a.jsx("div",{"data-slot":"sidebar-container",className:T("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem+2px)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...i,children:a.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function wu({className:e,onClick:t,...r}){const{toggleSidebar:n}=Rp();return a.jsxs(Z,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:T("size-7",e),onClick:s=>{t==null||t(s),n()},...r,children:[a.jsx(NE,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function ju({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:T("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function Nu({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:T("flex flex-col gap-2 p-2",e),...t})}function ku({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:T("flex flex-col gap-2 p-2",e),...t})}function jv({className:e,...t}){return a.jsx(Yi,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:T("bg-sidebar-border mx-2 w-auto",e),...t})}function Su({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:T("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function bs({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:T("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Nv({className:e,asChild:t=!1,...r}){const n=t?xp:"div";return a.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:T("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})}function ws({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:T("w-full text-sm",e),...t})}function gr({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:T("flex w-full min-w-0 flex-col gap-1",e),...t})}function Mt({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:T("group/menu-item relative",e),...t})}const wD=kl("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),wt=p.forwardRef(function({asChild:t=!1,isActive:r=!1,variant:n="default",size:s="default",tooltip:i,className:o,...l},c){const d=t?xp:"button",{isMobile:u,state:f}=Rp(),m=a.jsx(d,{ref:c,"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":r,className:T(wD({variant:n,size:s}),o),...l});return i?(typeof i=="string"&&(i={children:i}),a.jsxs(qa,{children:[a.jsx(Ha,{asChild:!0,children:m}),a.jsx(da,{side:"right",align:"center",hidden:f!=="collapsed"||u,...i})]})):m});wt.displayName="SidebarMenuButton";const jD=250,ND=300,Fr={all:["projects"],list:()=>[...Fr.all,"list"],detail:e=>[...Fr.all,e],byKey:e=>[...Fr.all,"key",e],activities:e=>[...Fr.all,e,"activities"]};function Gi(){const{workspace:e}=De();return Le({queryKey:[...Fr.list(),e==null?void 0:e.id],queryFn:()=>{const t=e!=null&&e.id?`?workspace_id=${e.id}`:"";return te.get(`/admin/projects${t}`)},select:t=>t.projects,enabled:!!(e!=null&&e.id)})}function ka(e){return Le({queryKey:Fr.byKey(e),queryFn:()=>te.get(`/admin/projects/by-identifier/${encodeURIComponent(e)}`),select:t=>t.project,enabled:!!e})}function kD(e,t={}){const[r,n]=p.useState(e),s=t.enabled!==!1;return p.useEffect(()=>{if(!s)return;const l=setTimeout(()=>n(e),jD);return()=>clearTimeout(l)},[e,s]),{...Le({queryKey:["projects","suggest-identifier",r],queryFn:()=>te.get(`/admin/projects/suggest-identifier?name=${encodeURIComponent(r)}`),select:l=>l.identifier,enabled:s&&r.trim().length>0}),flush:()=>n(e)}}function SD(e,t={}){const r=e.toUpperCase().replace(/[^A-Z0-9]/g,""),[n,s]=p.useState(r),i=t.enabled!==!1&&r.length>=3;p.useEffect(()=>{if(!r){s("");return}const l=setTimeout(()=>s(r),ND);return()=>clearTimeout(l)},[r]);const o=Le({queryKey:["projects","check-identifier",n],queryFn:()=>te.get(`/admin/projects/check-identifier/${encodeURIComponent(n)}`),select:l=>l.available,enabled:i&&n.length>=3});return{available:o.data,isLoading:o.isLoading,isFetching:o.isFetching}}function CD(){const e=Ne();return we({mutationFn:t=>te.post("/admin/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Fr.list()})}})}function _D(){const e=Ne();return we({mutationFn:t=>te.delete(`/admin/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Fr.list()})}})}function OD(e){const t=Ne();return we({mutationFn:()=>te.post(`/admin/projects/${e}/share`,{}),onSuccess:()=>{t.invalidateQueries({queryKey:Fr.detail(e)}),t.invalidateQueries({queryKey:Fr.list()})}})}function PD(e){const t=Ne();return we({mutationFn:()=>te.delete(`/admin/projects/${e}/share`),onSuccess:()=>{t.invalidateQueries({queryKey:Fr.detail(e)}),t.invalidateQueries({queryKey:Fr.list()})}})}function MD(e){return Le({queryKey:Fr.activities(e),queryFn:()=>te.get(`/admin/projects/${e}/activities`),select:t=>t.activities,enabled:!!e})}const ln=zP,cn=LP,AD=p.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(ej,{ref:s,className:T("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n,children:[r,a.jsx(kn,{className:"ml-auto"})]}));AD.displayName=ej.displayName;const ED=p.forwardRef(({className:e,...t},r)=>a.jsx(tj,{ref:r,className:T("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",e),...t}));ED.displayName=tj.displayName;const Kr=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx($P,{children:a.jsx(rj,{ref:n,sideOffset:t,className:T("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",e),...r})}));Kr.displayName=rj.displayName;const ht=p.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(nj,{ref:n,className:T("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r}));ht.displayName=nj.displayName;const DD=p.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(aj,{ref:s,className:T("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(sj,{children:a.jsx(lr,{className:"h-4 w-4"})})}),t]}));DD.displayName=aj.displayName;const TD=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(ij,{ref:n,className:T("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(sj,{children:a.jsx(rn,{className:"h-2 w-2 fill-current"})})}),t]}));TD.displayName=ij.displayName;const $p=p.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(oj,{ref:n,className:T("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...r}));$p.displayName=oj.displayName;const Bn=p.forwardRef(({className:e,...t},r)=>a.jsx(lj,{ref:r,className:T("-mx-1 my-1 h-px bg-border",e),...t}));Bn.displayName=lj.displayName;const Bt=p.forwardRef(({className:e,...t},r)=>a.jsx(cj,{ref:r,className:T("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));Bt.displayName=cj.displayName;const Vo=p.forwardRef(({className:e,...t},r)=>a.jsx(dj,{ref:r,className:T("aspect-square h-full w-full",e),...t}));Vo.displayName=dj.displayName;const Wt=p.forwardRef(({className:e,...t},r)=>a.jsx(uj,{ref:r,className:T("flex h-full w-full items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground",e),...t}));Wt.displayName=uj.displayName;function ID(){var s;const{workspace:e,setWorkspace:t}=De(),{data:r}=pu(),n=kt();return a.jsx(gr,{children:a.jsx(Mt,{children:a.jsxs(ln,{children:[a.jsx(cn,{asChild:!0,children:a.jsxs(wt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[e!=null&&e.logo_url?a.jsx("img",{src:e.logo_url,alt:e.name,className:"size-8 rounded-lg object-cover shrink-0"}):a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx("span",{className:"text-[13px] font-bold",children:(((s=e==null?void 0:e.name)==null?void 0:s[0])??"M").toUpperCase()})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:(e==null?void 0:e.name)??"Meridian"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.slug)??""})]}),a.jsx(Ui,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Kr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"bottom",align:"start",sideOffset:4,children:[a.jsx($p,{className:"text-xs text-muted-foreground font-normal",children:"Workspaces"}),r==null?void 0:r.map(i=>a.jsxs(ht,{className:"cursor-pointer gap-2 p-2",onClick:()=>{t({id:i.id,name:i.name,slug:i.slug,logo_url:i.logo_url}),n(`/${i.slug}/projects`)},children:[i.logo_url?a.jsx("img",{src:i.logo_url,alt:i.name,className:"size-6 rounded-sm object-cover shrink-0"}):a.jsx("div",{className:"flex size-6 items-center justify-center rounded-sm bg-foreground text-background shrink-0",children:a.jsx("span",{className:"text-[10px] font-bold",children:i.name[0].toUpperCase()})}),a.jsx("span",{className:"flex-1 truncate",children:i.name}),i.id===(e==null?void 0:e.id)&&a.jsx(lr,{className:"size-3.5 text-muted-foreground shrink-0"})]},i.id)),a.jsx(Bn,{}),a.jsxs(ht,{className:"cursor-pointer gap-2 p-2 text-muted-foreground",onClick:()=>n("/setup"),children:[a.jsx("div",{className:"flex size-6 items-center justify-center rounded-md border bg-background",children:a.jsx("span",{className:"text-xs font-semibold",children:"+"})}),a.jsx("span",{children:"Create workspace"})]})]})]})})})}function RD(){var i,o,l,c;const{user:e,logout:t}=De(),r=kt(),n=e&&(`${((i=e.first_name)==null?void 0:i[0])??""}${((o=e.last_name)==null?void 0:o[0])??""}`.toUpperCase()||((c=(l=e.email)==null?void 0:l[0])==null?void 0:c.toUpperCase()))||"?",s=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(gr,{children:a.jsx(Mt,{children:a.jsxs(ln,{children:[a.jsx(cn,{asChild:!0,children:a.jsxs(wt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsxs(Bt,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&a.jsx(Vo,{src:e.avatar_url,alt:s??"",className:"object-cover"}),a.jsx(Wt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:n})]}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:s}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(Ui,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Kr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx($p,{className:"p-0 font-normal",children:a.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[a.jsxs(Bt,{className:"h-8 w-8 rounded-lg",children:[(e==null?void 0:e.avatar_url)&&a.jsx(Vo,{src:e.avatar_url,alt:s??"",className:"object-cover"}),a.jsx(Wt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:n})]}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:s}),a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:(e==null?void 0:e.email)??""})]})]})}),a.jsx(Bn,{}),a.jsxs(ht,{className:"cursor-pointer gap-2",onClick:()=>r("/profile"),children:[a.jsx(hu,{className:"size-4"}),"Profile"]}),a.jsx(Bn,{}),a.jsxs(ht,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(fu,{className:"size-4"}),"Sign out"]})]})]})})})}function $D({...e}){var v;const{workspace:t,projectKey:r}=qt(),{data:n}=Gi(),{toggle:s}=Fj(),{user:i}=De(),o=au(),l=t??"",c=o.pathname===`/${l}/projects`,d=o.pathname.includes("/notifications"),u=o.pathname.includes("/settings"),f=o.pathname.includes("/roles"),m=o.pathname===`/${l}/reporting`,h=o.pathname.startsWith("/reporting"),g=o.pathname.startsWith("/org/settings"),x=((v=i==null?void 0:i.roles)==null?void 0:v.includes("super-admin"))??!1;return a.jsxs(bu,{collapsible:"offcanvas",...e,children:[a.jsx(Nu,{children:a.jsx(ID,{})}),a.jsxs(Su,{children:[a.jsx(bs,{children:a.jsx(ws,{children:a.jsxs(gr,{children:[a.jsx(Mt,{children:a.jsxs(wt,{onClick:s,tooltip:"Search",children:[a.jsx(Ol,{}),a.jsx("span",{children:"Search"}),a.jsx("kbd",{className:"ml-auto hidden text-[10px] text-sidebar-foreground/40 font-mono sm:inline-flex",children:"⌘K"})]})}),a.jsx(Mt,{children:a.jsx(wt,{asChild:!0,isActive:c,tooltip:"Projects",children:a.jsxs(na,{to:`/${l}/projects`,end:!0,children:[a.jsx(Er,{}),a.jsx("span",{children:"Projects"})]})})}),a.jsx(Mt,{children:a.jsx(wt,{asChild:!0,isActive:d,tooltip:"Notifications",children:a.jsxs(na,{to:`/${l}/notifications`,children:[a.jsx(ki,{}),a.jsx("span",{children:"Notifications"})]})})}),a.jsx(Mt,{children:a.jsx(wt,{asChild:!0,isActive:m,tooltip:"Reports",children:a.jsxs(na,{to:`/${l}/reporting`,children:[a.jsx(Xa,{}),a.jsx("span",{children:"Reports"})]})})}),a.jsx(Mt,{children:a.jsx(wt,{asChild:!0,isActive:u,tooltip:"Settings",children:a.jsxs(na,{to:`/${l}/settings`,children:[a.jsx(Tp,{}),a.jsx("span",{children:"Workspace settings"})]})})})]})})}),n&&n.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(jv,{}),a.jsxs(bs,{children:[a.jsx(Nv,{children:"Recent"}),a.jsx(ws,{children:a.jsx(gr,{children:n.slice(0,5).map(y=>a.jsx(Mt,{children:a.jsx(wt,{asChild:!0,isActive:y.identifier===r,tooltip:y.name,className:"data-[active=true]:bg-indigo-50 dark:data-[active=true]:bg-indigo-950/50 data-[active=true]:text-indigo-700 dark:data-[active=true]:text-indigo-300",children:a.jsxs(na,{to:`/${l}/projects/${y.identifier}/board`,children:[a.jsx("span",{className:"font-mono text-[10px] text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:y.identifier}),a.jsx("span",{className:"truncate",children:y.name})]})})},y.id))})})]})]}),a.jsx(jv,{}),a.jsxs(bs,{children:[a.jsx(Nv,{children:"Global"}),a.jsx(ws,{children:a.jsxs(gr,{children:[a.jsx(Mt,{children:a.jsx(wt,{asChild:!0,isActive:h,tooltip:"Global Reports",children:a.jsxs(na,{to:"/reporting",children:[a.jsx(Xa,{}),a.jsx("span",{children:"Global Reports"})]})})}),a.jsx(Mt,{children:a.jsx(wt,{asChild:!0,isActive:g,tooltip:"Org Settings",children:a.jsxs(na,{to:"/org/settings",children:[a.jsx(Dp,{}),a.jsx("span",{children:"Org Settings"})]})})})]})})]}),a.jsx(bs,{className:"mt-auto",children:a.jsx(ws,{children:a.jsx(gr,{children:x&&a.jsx(Mt,{children:a.jsx(wt,{asChild:!0,isActive:f,tooltip:"Roles & Permissions",children:a.jsxs(na,{to:`/${l}/roles`,children:[a.jsx(Jm,{}),a.jsx("span",{children:"Roles"})]})})})})})})]}),a.jsx(ku,{children:a.jsx(RD,{})})]})}function Cu(){const{theme:e,setTheme:t}=dA();return a.jsxs(qa,{children:[a.jsx(Ha,{asChild:!0,children:a.jsxs(Z,{variant:"ghost",size:"icon-sm",onClick:()=>t(e==="dark"?"light":"dark"),className:"text-muted-foreground hover:text-foreground",children:[a.jsx(AE,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),a.jsx(jE,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),a.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),a.jsx(da,{children:"Toggle theme"})]})}const Ml={all:["notifications"],list:()=>[...Ml.all,"list"]};function zD(){return Le({queryKey:Ml.list(),queryFn:()=>te.get("/admin/notifications"),select:e=>e.notifications})}function LD(){return Le({queryKey:[...Ml.list(),"unread"],queryFn:()=>te.get("/admin/notifications?unread=true"),select:e=>e.count})}function FD(){const e=Ne();return we({mutationFn:t=>te.post(`/admin/notifications/${t}/read`),onSuccess:()=>{e.invalidateQueries({queryKey:Ml.all})}})}function BD(){const e=Ne();return we({mutationFn:()=>te.post("/admin/notifications/read-all"),onSuccess:()=>{e.invalidateQueries({queryKey:Ml.all})}})}function WD(){const e=au(),{projectKey:t}=qt(),{data:r}=Gi(),n=r==null?void 0:r.find(i=>i.identifier===t),s=e.pathname;return s.includes("/board")?{icon:Er,label:n?`${n.name} / Board`:"Board"}:s.includes("/issues")?{icon:ua,label:n?`${n.name} / Issues`:"Issues"}:s.includes("/sprints")?{icon:ns,label:n?`${n.name} / Sprints`:"Sprints"}:s.includes("/timeline")?{icon:Wi,label:n?`${n.name} / Timeline`:"Timeline"}:s.includes("/access")?{icon:qi,label:n?`${n.name} / Access`:"Access"}:s.includes("/reports")?{icon:Xa,label:n?`${n.name} / Reports`:"Reports"}:s.includes("/activity")?{icon:cu,label:n?`${n.name} / Activity`:"Activity"}:s.endsWith("/projects")?{icon:Jc,label:"Projects"}:s.includes("/notifications")?{icon:ki,label:"Notifications"}:s.includes("/settings")?{icon:Tp,label:"Settings"}:{icon:Jc,label:"Meridian"}}function UD(){const{data:e=0}=LD(),{icon:t,label:r}=WD(),{workspace:n}=De(),s=(n==null?void 0:n.slug)??"";return a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(wu,{className:"-ml-1"}),a.jsx(Yi,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(t,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:r})]}),a.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[a.jsx(Cu,{}),a.jsx(Z,{variant:"ghost",size:"icon",asChild:!0,className:"relative size-8 text-muted-foreground hover:text-foreground",children:a.jsxs(Va,{to:`/${s}/notifications`,children:[a.jsx(ki,{className:"h-4 w-4",strokeWidth:1.5}),e>0&&a.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-indigo text-[9px] font-bold text-white flex items-center justify-center leading-none",children:e>9?"9+":e})]})})]})]})})}function qD(){const{user:e,token:t,login:r}=De();p.useEffect(()=>{!e||!t||!e.email||fetch("/admin/users/me",{headers:{Authorization:`Bearer ${t}`}}).then(n=>n.ok?n.json():null).then(n=>{n&&r({id:n.id,email:n.email,first_name:n.first_name??"",last_name:n.last_name??""},t)}).catch(()=>{})},[e==null?void 0:e.id])}function HD(){return qD(),a.jsxs(yu,{children:[a.jsx($D,{variant:"inset"}),a.jsxs(ju,{className:"flex flex-col min-w-0",children:[a.jsx(UD,{}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(bl,{})})]})]})}const Al={project:e=>["projects",e,"access"]};function _u(e){return Le({queryKey:Al.project(e),queryFn:()=>te.get(`/admin/projects/${e}/access`),enabled:!!e})}function w1(e){const t=Ne();return we({mutationFn:({userId:r,role:n})=>te.post(`/admin/projects/${e}/members`,{user_id:r,role:n}),onSuccess:()=>{t.invalidateQueries({queryKey:Al.project(e)})}})}function j1(e){const t=Ne();return we({mutationFn:r=>te.delete(`/admin/projects/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Al.project(e)})}})}function N1(e){const t=Ne();return we({mutationFn:r=>te.post(`/admin/projects/${e}/teams`,{team_id:r}),onSuccess:()=>{t.invalidateQueries({queryKey:Al.project(e)})}})}function k1(e){const t=Ne();return we({mutationFn:r=>te.delete(`/admin/projects/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Al.project(e)})}})}const Gs=jl,KD=wl,S1=p.forwardRef(({className:e,...t},r)=>a.jsx(Hs,{ref:r,className:T("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));S1.displayName=Hs.displayName;const as=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(KD,{children:[a.jsx(S1,{}),a.jsxs(Ks,{ref:n,className:T("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 bg-background border border-border 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%] rounded-lg",e),...r,children:[t,a.jsxs(su,{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:[a.jsx(nt,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));as.displayName=Ks.displayName;const Vs=({className:e,...t})=>a.jsx("div",{className:T("flex flex-col space-y-1.5",e),...t});Vs.displayName="DialogHeader";const C1=({className:e,...t})=>a.jsx("div",{className:T("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});C1.displayName="DialogFooter";const Xs=p.forwardRef(({className:e,...t},r)=>a.jsx(Li,{ref:r,className:T("text-base font-semibold leading-none tracking-tight",e),...t}));Xs.displayName=Li.displayName;const El=p.forwardRef(({className:e,...t},r)=>a.jsx(Fi,{ref:r,className:T("text-sm text-muted-foreground",e),...t}));El.displayName=Fi.displayName;function YD({open:e,onClose:t,project:r}){const[n,s]=p.useState(null),i=OD(r.id),o=PD(r.id),l=r.share_token,c=n??(l?`${window.location.origin}/share/${l}`:null),d=()=>{i.mutate(void 0,{onSuccess:h=>{const g=`${window.location.origin}/share/${h.project.share_token}`;s(g),z.success("Public link enabled")},onError:()=>z.error("Failed to enable public link")})},u=()=>{o.mutate(void 0,{onSuccess:()=>{s(null),z.success("Public link revoked")},onError:()=>z.error("Failed to revoke link")})},f=()=>{c&&navigator.clipboard.writeText(c).then(()=>{z.success("Link copied to clipboard")})},m=!!c;return a.jsx(Gs,{open:e,onOpenChange:h=>!h&&t(),children:a.jsxs(as,{className:"sm:max-w-md overflow-hidden",children:[a.jsxs(Vs,{children:[a.jsxs(Xs,{className:"flex items-center gap-2",children:[a.jsx(uu,{className:"h-4 w-4"}),"Share project"]}),a.jsx(El,{children:"Allow anyone with the link to view this project without logging in."})]}),a.jsx("div",{className:"space-y-4 pt-2",children:m?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/50 px-3 py-2 overflow-hidden",children:[a.jsx(Zm,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),a.jsx("span",{className:"text-xs text-muted-foreground min-w-0 flex-1 break-all",children:c})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(Z,{variant:"outline",size:"sm",className:"flex-1",onClick:f,children:[a.jsx(a1,{className:"h-3.5 w-3.5 mr-1.5"}),"Copy link"]}),a.jsxs(Z,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:u,disabled:o.isPending,children:[a.jsx(Hr,{className:"h-3.5 w-3.5 mr-1.5"}),"Revoke"]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Anyone with this link can view the board, issues, and timeline. No account required."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-dashed border-border px-3 py-4 text-center justify-center",children:[a.jsx(qi,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"This project is private"})]}),a.jsxs(Z,{className:"w-full",onClick:d,disabled:i.isPending,children:[a.jsx(Zm,{className:"h-4 w-4 mr-2"}),"Enable public link"]}),a.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Generates a secret link for read-only access. No write permissions granted."})]})})]})})}const kv=["board","issues","sprints","timeline","access","reports","activity"];function GD(){const{projectKey:e,workspace:t}=qt(),{data:r,error:n}=ka(e??""),{user:s}=De(),{data:i}=_u((r==null?void 0:r.id)??""),[o,l]=p.useState(!1),c=kt(),d=au(),[u]=gp(),f=(s==null?void 0:s.roles)??[],m=f.includes("super-admin")||f.includes("admin"),h=i==null?void 0:i.members.some(y=>y.user_id===(s==null?void 0:s.id)&&y.role==="manager"),g=m||h;p.useEffect(()=>{n&&n instanceof kp&&(n.status===403||n.status===404)&&c(`/${t}/projects`,{replace:!0})},[n,t,c]),p.useEffect(()=>{const y=u.get("tab");if(!y||!kv.includes(y))return;kv.every(b=>!d.pathname.endsWith(`/${b}`))&&c(`/${t}/projects/${e}/${y}`,{replace:!0})},[]);const x=`/${t}/projects/${e}`,v=[{to:`${x}/board`,label:"Board",icon:Jc,end:!0},{to:`${x}/issues`,label:"Issues",icon:ua,end:!1},{to:`${x}/sprints`,label:"Sprints",icon:ns,end:!0},{to:`${x}/timeline`,label:"Timeline",icon:Wi,end:!0},{to:`${x}/access`,label:"Access",icon:qi,end:!0},{to:`${x}/reports`,label:"Reports",icon:Xa,end:!0},{to:`${x}/activity`,label:"Activity",icon:cu,end:!0}];return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"px-6 pt-5 border-b border-border bg-white dark:bg-card shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-2.5 mb-4",children:[r&&a.jsx("span",{className:"text-xs font-mono text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 border border-indigo-200 dark:border-indigo-800 px-2 py-0.5 rounded",children:r.identifier}),a.jsx("h1",{className:"text-sm font-semibold",children:(r==null?void 0:r.name)??""})]}),a.jsxs("div",{className:"flex items-center -mb-px",children:[a.jsx("div",{className:"flex flex-1",children:v.map(({to:y,label:j,icon:b,end:N})=>a.jsxs(na,{to:y,end:N,className:({isActive:k})=>`flex items-center gap-1.5 px-3 py-2 text-sm border-b-2 transition-colors ${k?"border-foreground text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[a.jsx(b,{className:"h-3.5 w-3.5",strokeWidth:1.5}),j]},y))}),g&&r&&a.jsx("div",{className:"pb-px pr-1",children:a.jsxs(Z,{variant:"ghost",size:"sm",onClick:()=>l(!0),className:"h-7 px-2 text-xs text-muted-foreground",children:[a.jsx(OE,{className:"h-3.5 w-3.5 mr-1"}),"Share"]})})]})]}),a.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:a.jsx(bl,{})}),r&&a.jsx(YD,{open:o,onClose:()=>l(!1),project:r})]})}function VD(){var s,i;const{user:e,logout:t}=De(),r=e?`${((s=e.first_name)==null?void 0:s[0])??""}${((i=e.last_name)==null?void 0:i[0])??""}`.toUpperCase()||e.email[0].toUpperCase():"?",n=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(gr,{children:a.jsx(Mt,{children:a.jsxs(ln,{children:[a.jsx(cn,{asChild:!0,children:a.jsxs(wt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsx(Bt,{className:"h-8 w-8 rounded-lg shrink-0",children:a.jsx(Wt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:n}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(Ui,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Kr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(Bn,{}),a.jsxs(ht,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(fu,{className:"size-4"}),"Sign out"]})]})]})})})}function XD(){const{workspace:e}=De(),t=kt(),r=(e==null?void 0:e.slug)??"";return a.jsxs(bu,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Nu,{children:a.jsx(gr,{children:a.jsx(Mt,{children:a.jsxs(wt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx(Xa,{className:"size-4"})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:"Reporting"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Time analytics"})]})]})})})}),a.jsx(Su,{children:a.jsx(bs,{children:a.jsx(ws,{children:a.jsx(gr,{children:a.jsx(Mt,{children:a.jsxs(wt,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Sp,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(ku,{children:a.jsx(VD,{})})]})}function QD(){return a.jsxs(yu,{children:[a.jsx(XD,{}),a.jsxs(ju,{className:"flex flex-col min-w-0",children:[a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(wu,{className:"-ml-1"}),a.jsx(Yi,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Xa,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:"Reporting"})]}),a.jsx("div",{className:"ml-auto",children:a.jsx(Cu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(bl,{})})]})]})}function ZD(){var s,i;const{user:e,logout:t}=De(),r=e?`${((s=e.first_name)==null?void 0:s[0])??""}${((i=e.last_name)==null?void 0:i[0])??""}`.toUpperCase()||e.email[0].toUpperCase():"?",n=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(gr,{children:a.jsx(Mt,{children:a.jsxs(ln,{children:[a.jsx(cn,{asChild:!0,children:a.jsxs(wt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsx(Bt,{className:"h-8 w-8 rounded-lg shrink-0",children:a.jsx(Wt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:n}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(Ui,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Kr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(Bn,{}),a.jsxs(ht,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(fu,{className:"size-4"}),"Sign out"]})]})]})})})}function JD(){const{workspace:e}=De(),t=kt(),r=(e==null?void 0:e.slug)??"";return a.jsxs(bu,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Nu,{children:a.jsx(gr,{children:a.jsx(Mt,{children:a.jsxs(wt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx(Dp,{className:"size-4"})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:"Org Settings"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Global configuration"})]})]})})})}),a.jsx(Su,{children:a.jsx(bs,{children:a.jsx(ws,{children:a.jsx(gr,{children:a.jsx(Mt,{children:a.jsxs(wt,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Sp,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(ku,{children:a.jsx(ZD,{})})]})}function eT(){return a.jsxs(yu,{children:[a.jsx(JD,{}),a.jsxs(ju,{className:"flex flex-col min-w-0",children:[a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(wu,{className:"-ml-1"}),a.jsx(Yi,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Dp,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:"Org Settings"})]}),a.jsx("div",{className:"ml-auto",children:a.jsx(Cu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(bl,{})})]})]})}function tT(){var s,i;const{user:e,logout:t}=De(),r=e?`${((s=e.first_name)==null?void 0:s[0])??""}${((i=e.last_name)==null?void 0:i[0])??""}`.toUpperCase()||e.email[0].toUpperCase():"?",n=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(gr,{children:a.jsx(Mt,{children:a.jsxs(ln,{children:[a.jsx(cn,{asChild:!0,children:a.jsxs(wt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsxs(Bt,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&a.jsx(Vo,{src:e.avatar_url,alt:n??"",className:"object-cover"}),a.jsx(Wt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})]}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:n}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(Ui,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Kr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(Bn,{}),a.jsxs(ht,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(fu,{className:"size-4"}),"Sign out"]})]})]})})})}function rT(){const{workspace:e}=De(),t=kt(),r=(e==null?void 0:e.slug)??"";return a.jsxs(bu,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Nu,{children:a.jsx(gr,{children:a.jsx(Mt,{children:a.jsxs(wt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx(hu,{className:"size-4"})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:"Profile"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Personal settings"})]})]})})})}),a.jsx(Su,{children:a.jsx(bs,{children:a.jsx(ws,{children:a.jsx(gr,{children:a.jsx(Mt,{children:a.jsxs(wt,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Sp,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(ku,{children:a.jsx(tT,{})})]})}function nT(){return a.jsxs(yu,{children:[a.jsx(rT,{}),a.jsxs(ju,{className:"flex flex-col min-w-0",children:[a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(wu,{className:"-ml-1"}),a.jsx(Yi,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(hu,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:"Profile"})]}),a.jsx("div",{className:"ml-auto",children:a.jsx(Cu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(bl,{})})]})]})}var Sv=1,aT=.9,sT=.8,iT=.17,Qf=.1,Zf=.999,oT=.9999,lT=.99,cT=/[\\\/_+.#"@\[\(\{&]/,dT=/[\\\/_+.#"@\[\(\{&]/g,uT=/[\s-]/,_1=/[\s-]/g;function eh(e,t,r,n,s,i,o){if(i===t.length)return s===e.length?Sv:lT;var l=`${s},${i}`;if(o[l]!==void 0)return o[l];for(var c=n.charAt(i),d=r.indexOf(c,s),u=0,f,m,h,g;d>=0;)f=eh(e,t,r,n,d+1,i+1,o),f>u&&(d===s?f*=Sv:cT.test(e.charAt(d-1))?(f*=sT,h=e.slice(s,d-1).match(dT),h&&s>0&&(f*=Math.pow(Zf,h.length))):uT.test(e.charAt(d-1))?(f*=aT,g=e.slice(s,d-1).match(_1),g&&s>0&&(f*=Math.pow(Zf,g.length))):(f*=iT,s>0&&(f*=Math.pow(Zf,d-s))),e.charAt(d)!==t.charAt(i)&&(f*=oT)),(f<Qf&&r.charAt(d-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(d-1)!==n.charAt(i))&&(m=eh(e,t,r,n,d+1,i+2,o),m*Qf>f&&(f=m*Qf)),f>u&&(u=f),d=r.indexOf(c,d+1);return o[l]=u,u}function Cv(e){return e.toLowerCase().replace(_1," ")}function fT(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,eh(e,t,Cv(e),Cv(t),0,0,{})}var vo='[cmdk-group=""]',Jf='[cmdk-group-items=""]',mT='[cmdk-group-heading=""]',zp='[cmdk-item=""]',_v=`${zp}:not([aria-disabled="true"])`,th="cmdk-item-select",vs="data-value",hT=(e,t,r)=>fT(e,t,r),O1=p.createContext(void 0),Dl=()=>p.useContext(O1),P1=p.createContext(void 0),Lp=()=>p.useContext(P1),M1=p.createContext(void 0),A1=p.forwardRef((e,t)=>{let r=fi(()=>{var B,Y;return{search:"",value:(Y=(B=e.value)!=null?B:e.defaultValue)!=null?Y:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=fi(()=>new Set),s=fi(()=>new Map),i=fi(()=>new Map),o=fi(()=>new Set),l=E1(e),{label:c,children:d,value:u,onValueChange:f,filter:m,shouldFilter:h,loop:g,disablePointerSelection:x=!1,vimBindings:v=!0,...y}=e,j=xi(),b=xi(),N=xi(),k=p.useRef(null),w=ST();Is(()=>{if(u!==void 0){let B=u.trim();r.current.value=B,S.emit()}},[u]),Is(()=>{w(6,D)},[]);let S=p.useMemo(()=>({subscribe:B=>(o.current.add(B),()=>o.current.delete(B)),snapshot:()=>r.current,setState:(B,Y,U)=>{var X,$,K;if(!Object.is(r.current[B],Y)){if(r.current[B]=Y,B==="search")_(),M(),w(1,A);else if(B==="value"&&(U||w(5,D),((X=l.current)==null?void 0:X.value)!==void 0)){let V=Y??"";(K=($=l.current).onValueChange)==null||K.call($,V);return}S.emit()}},emit:()=>{o.current.forEach(B=>B())}}),[]),C=p.useMemo(()=>({value:(B,Y,U)=>{var X;Y!==((X=i.current.get(B))==null?void 0:X.value)&&(i.current.set(B,{value:Y,keywords:U}),r.current.filtered.items.set(B,P(Y,U)),w(2,()=>{M(),S.emit()}))},item:(B,Y)=>(n.current.add(B),Y&&(s.current.has(Y)?s.current.get(Y).add(B):s.current.set(Y,new Set([B]))),w(3,()=>{_(),M(),r.current.value||A(),S.emit()}),()=>{i.current.delete(B),n.current.delete(B),r.current.filtered.items.delete(B);let U=O();w(4,()=>{_(),(U==null?void 0:U.getAttribute("id"))===B&&A(),S.emit()})}),group:B=>(s.current.has(B)||s.current.set(B,new Set),()=>{i.current.delete(B),s.current.delete(B)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:j,inputId:N,labelId:b,listInnerRef:k}),[]);function P(B,Y){var U,X;let $=(X=(U=l.current)==null?void 0:U.filter)!=null?X:hT;return B?$(B,r.current.search,Y):0}function M(){if(!r.current.search||l.current.shouldFilter===!1)return;let B=r.current.filtered.items,Y=[];r.current.filtered.groups.forEach(X=>{let $=s.current.get(X),K=0;$.forEach(V=>{let L=B.get(V);K=Math.max(L,K)}),Y.push([X,K])});let U=k.current;R().sort((X,$)=>{var K,V;let L=X.getAttribute("id"),se=$.getAttribute("id");return((K=B.get(se))!=null?K:0)-((V=B.get(L))!=null?V:0)}).forEach(X=>{let $=X.closest(Jf);$?$.appendChild(X.parentElement===$?X:X.closest(`${Jf} > *`)):U.appendChild(X.parentElement===U?X:X.closest(`${Jf} > *`))}),Y.sort((X,$)=>$[1]-X[1]).forEach(X=>{var $;let K=($=k.current)==null?void 0:$.querySelector(`${vo}[${vs}="${encodeURIComponent(X[0])}"]`);K==null||K.parentElement.appendChild(K)})}function A(){let B=R().find(U=>U.getAttribute("aria-disabled")!=="true"),Y=B==null?void 0:B.getAttribute(vs);S.setState("value",Y||void 0)}function _(){var B,Y,U,X;if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let $=0;for(let K of n.current){let V=(Y=(B=i.current.get(K))==null?void 0:B.value)!=null?Y:"",L=(X=(U=i.current.get(K))==null?void 0:U.keywords)!=null?X:[],se=P(V,L);r.current.filtered.items.set(K,se),se>0&&$++}for(let[K,V]of s.current)for(let L of V)if(r.current.filtered.items.get(L)>0){r.current.filtered.groups.add(K);break}r.current.filtered.count=$}function D(){var B,Y,U;let X=O();X&&(((B=X.parentElement)==null?void 0:B.firstChild)===X&&((U=(Y=X.closest(vo))==null?void 0:Y.querySelector(mT))==null||U.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function O(){var B;return(B=k.current)==null?void 0:B.querySelector(`${zp}[aria-selected="true"]`)}function R(){var B;return Array.from(((B=k.current)==null?void 0:B.querySelectorAll(_v))||[])}function F(B){let Y=R()[B];Y&&S.setState("value",Y.getAttribute(vs))}function H(B){var Y;let U=O(),X=R(),$=X.findIndex(V=>V===U),K=X[$+B];(Y=l.current)!=null&&Y.loop&&(K=$+B<0?X[X.length-1]:$+B===X.length?X[0]:X[$+B]),K&&S.setState("value",K.getAttribute(vs))}function ne(B){let Y=O(),U=Y==null?void 0:Y.closest(vo),X;for(;U&&!X;)U=B>0?NT(U,vo):kT(U,vo),X=U==null?void 0:U.querySelector(_v);X?S.setState("value",X.getAttribute(vs)):H(B)}let G=()=>F(R().length-1),oe=B=>{B.preventDefault(),B.metaKey?G():B.altKey?ne(1):H(1)},ce=B=>{B.preventDefault(),B.metaKey?F(0):B.altKey?ne(-1):H(-1)};return p.createElement(ts.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:B=>{var Y;if((Y=y.onKeyDown)==null||Y.call(y,B),!B.defaultPrevented)switch(B.key){case"n":case"j":{v&&B.ctrlKey&&oe(B);break}case"ArrowDown":{oe(B);break}case"p":case"k":{v&&B.ctrlKey&&ce(B);break}case"ArrowUp":{ce(B);break}case"Home":{B.preventDefault(),F(0);break}case"End":{B.preventDefault(),G();break}case"Enter":if(!B.nativeEvent.isComposing&&B.keyCode!==229){B.preventDefault();let U=O();if(U){let X=new Event(th);U.dispatchEvent(X)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:_T},c),Ou(e,B=>p.createElement(P1.Provider,{value:S},p.createElement(O1.Provider,{value:C},B))))}),pT=p.forwardRef((e,t)=>{var r,n;let s=xi(),i=p.useRef(null),o=p.useContext(M1),l=Dl(),c=E1(e),d=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:o==null?void 0:o.forceMount;Is(()=>{if(!d)return l.item(s,o==null?void 0:o.id)},[d]);let u=D1(s,i,[e.value,e.children,i],e.keywords),f=Lp(),m=Rs(w=>w.value&&w.value===u.current),h=Rs(w=>d||l.filter()===!1?!0:w.search?w.filtered.items.get(s)>0:!0);p.useEffect(()=>{let w=i.current;if(!(!w||e.disabled))return w.addEventListener(th,g),()=>w.removeEventListener(th,g)},[h,e.onSelect,e.disabled]);function g(){var w,S;x(),(S=(w=c.current).onSelect)==null||S.call(w,u.current)}function x(){f.setState("value",u.current,!0)}if(!h)return null;let{disabled:v,value:y,onSelect:j,forceMount:b,keywords:N,...k}=e;return p.createElement(ts.div,{ref:Xo([i,t]),...k,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!m,"data-disabled":!!v,"data-selected":!!m,onPointerMove:v||l.getDisablePointerSelection()?void 0:x,onClick:v?void 0:g},e.children)}),gT=p.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=xi(),l=p.useRef(null),c=p.useRef(null),d=xi(),u=Dl(),f=Rs(h=>s||u.filter()===!1?!0:h.search?h.filtered.groups.has(o):!0);Is(()=>u.group(o),[]),D1(o,l,[e.value,e.heading,c]);let m=p.useMemo(()=>({id:o,forceMount:s}),[s]);return p.createElement(ts.div,{ref:Xo([l,t]),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},r&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),Ou(e,h=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},p.createElement(M1.Provider,{value:m},h))))}),xT=p.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=p.useRef(null),i=Rs(o=>!o.search);return!r&&!i?null:p.createElement(ts.div,{ref:Xo([s,t]),...n,"cmdk-separator":"",role:"separator"})}),vT=p.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,i=Lp(),o=Rs(u=>u.search),l=Rs(u=>u.value),c=Dl(),d=p.useMemo(()=>{var u;let f=(u=c.listInnerRef.current)==null?void 0:u.querySelector(`${zp}[${vs}="${encodeURIComponent(l)}"]`);return f==null?void 0:f.getAttribute("id")},[]);return p.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),p.createElement(ts.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":d,id:c.inputId,type:"text",value:s?e.value:o,onChange:u=>{s||i.setState("search",u.target.value),r==null||r(u.target.value)}})}),yT=p.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=p.useRef(null),o=p.useRef(null),l=Dl();return p.useEffect(()=>{if(o.current&&i.current){let c=o.current,d=i.current,u,f=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let m=c.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(u),f.unobserve(c)}}},[]),p.createElement(ts.div,{ref:Xo([i,t]),...s,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},Ou(e,c=>p.createElement("div",{ref:Xo([o,l.listInnerRef]),"cmdk-list-sizer":""},c)))}),bT=p.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...l}=e;return p.createElement(jl,{open:r,onOpenChange:n},p.createElement(wl,{container:o},p.createElement(Hs,{"cmdk-overlay":"",className:s}),p.createElement(Ks,{"aria-label":e.label,"cmdk-dialog":"",className:i},p.createElement(A1,{ref:t,...l}))))}),wT=p.forwardRef((e,t)=>Rs(r=>r.filtered.count===0)?p.createElement(ts.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),jT=p.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return p.createElement(ts.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Ou(e,o=>p.createElement("div",{"aria-hidden":!0},o)))}),Dr=Object.assign(A1,{List:yT,Item:pT,Input:vT,Group:gT,Separator:xT,Dialog:bT,Empty:wT,Loading:jT});function NT(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function kT(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function E1(e){let t=p.useRef(e);return Is(()=>{t.current=e}),t}var Is=typeof window>"u"?p.useEffect:p.useLayoutEffect;function fi(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function Xo(e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}function Rs(e){let t=Lp(),r=()=>e(t.snapshot());return FP.useSyncExternalStore(t.subscribe,r,r)}function D1(e,t,r,n=[]){let s=p.useRef(),i=Dl();return Is(()=>{var o;let l=(()=>{var d;for(let u of r){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(d=u.current.textContent)==null?void 0:d.trim():s.current}})(),c=n.map(d=>d.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(vs,l),s.current=l}),s}var ST=()=>{let[e,t]=p.useState(),r=fi(()=>new Map);return Is(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function CT(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ou({asChild:e,children:t},r){return e&&p.isValidElement(t)?p.cloneElement(CT(t),{ref:t.ref},r(t.props.children)):r(t)}var _T={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Os=p.forwardRef(({className:e,...t},r)=>a.jsx(Dr,{ref:r,className:T("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Os.displayName=Dr.displayName;const OT=({children:e,open:t,onOpenChange:r})=>a.jsx(Gs,{open:t,onOpenChange:r,children:a.jsx(as,{className:"overflow-hidden p-0 shadow-lg max-w-[560px]",children:a.jsx(Os,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Pu=p.forwardRef(({className:e,...t},r)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(Ol,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(Dr.Input,{ref:r,className:T("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Pu.displayName=Dr.Input.displayName;const Ps=p.forwardRef(({className:e,...t},r)=>a.jsx(Dr.List,{ref:r,className:T("max-h-[320px] overflow-y-auto overflow-x-hidden",e),...t}));Ps.displayName=Dr.List.displayName;const Mu=p.forwardRef((e,t)=>a.jsx(Dr.Empty,{ref:t,className:"py-6 text-center text-sm text-muted-foreground",...e}));Mu.displayName=Dr.Empty.displayName;const Ka=p.forwardRef(({className:e,...t},r)=>a.jsx(Dr.Group,{ref:r,className:T("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Ka.displayName=Dr.Group.displayName;const T1=p.forwardRef(({className:e,...t},r)=>a.jsx(Dr.Separator,{ref:r,className:T("-mx-1 h-px bg-border",e),...t}));T1.displayName=Dr.Separator.displayName;const en=p.forwardRef(({className:e,...t},r)=>a.jsx(Dr.Item,{ref:r,className:T("relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));en.displayName=Dr.Item.displayName;function PT(){const{open:e,setOpen:t}=Fj(),r=kt(),{data:n}=Gi(),{workspace:s}=De(),i=(s==null?void 0:s.slug)??"",o=l=>{t(!1),l()};return a.jsxs(OT,{open:e,onOpenChange:t,children:[a.jsx(Pu,{placeholder:"Search or jump to..."}),a.jsxs(Ps,{children:[a.jsx(Mu,{children:"No results found."}),a.jsxs(Ka,{heading:"Navigation",children:[a.jsxs(en,{onSelect:()=>o(()=>r(`/${i}/projects`)),children:[a.jsx(Jc,{className:"text-muted-foreground"}),a.jsx("span",{children:"Projects"})]}),a.jsxs(en,{onSelect:()=>o(()=>r(`/${i}/notifications`)),children:[a.jsx(ki,{className:"text-muted-foreground"}),a.jsx("span",{children:"Notifications"})]}),a.jsxs(en,{onSelect:()=>o(()=>r(`/${i}/settings`)),children:[a.jsx(Tp,{className:"text-muted-foreground"}),a.jsx("span",{children:"Settings"})]})]}),n&&n.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(T1,{}),a.jsxs(Ka,{heading:"Projects",children:[n.map(l=>a.jsxs(en,{value:`${l.name} board`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/board`)),children:[a.jsx(Er,{className:"text-muted-foreground"}),a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:l.identifier}),a.jsx("span",{className:"truncate",children:l.name}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Board"})]})]},`${l.id}-board`)),n.map(l=>a.jsxs(en,{value:`${l.name} issues`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/issues`)),children:[a.jsx(ua,{className:"text-muted-foreground"}),a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:l.identifier}),a.jsx("span",{className:"truncate",children:l.name}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Issues"})]})]},`${l.id}-issues`))]})]})]})]})}function yr({zone:e,props:t}){const r=JA(e);return r.length?a.jsx(a.Fragment,{children:r.map((n,s)=>a.jsx(n,{...t},n.displayName??n.name??s))}):null}function Fp({flow:e,inviteToken:t,label:r,disabled:n}){const s=()=>{const i=`${Ni}/auth/google?flow=${e}${t?`&invite_token=${encodeURIComponent(t)}`:""}`;window.location.href=i};return a.jsxs(Z,{type:"button",variant:"outline",className:"w-full gap-2",onClick:s,disabled:n,children:[a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18","aria-hidden":"true",children:[a.jsx("path",{d:"M17.64 9.205c0-.639-.057-1.252-.164-1.841H9v3.481h4.844a4.14 4.14 0 0 1-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4"}),a.jsx("path",{d:"M9 18c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332A8.997 8.997 0 0 0 9 18z",fill:"#34A853"}),a.jsx("path",{d:"M3.964 10.71A5.41 5.41 0 0 1 3.682 9c0-.593.102-1.17.282-1.71V4.958H.957A8.996 8.996 0 0 0 0 9c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05"}),a.jsx("path",{d:"M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 0 0 .957 4.958L3.964 7.29C4.672 5.163 6.656 3.58 9 3.58z",fill:"#EA4335"})]}),r??"Continue with Google"]})}function MT(){const[e,t]=p.useState(""),[r,n]=p.useState(""),[s,i]=p.useState(!1),o=kt(),l=sD(),{data:c}=vu(),d=u=>{u.preventDefault(),l.mutate({email:e,password:r},{onSuccess:()=>o("/"),onError:f=>z.error(f.message??"Invalid email or password")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px]",children:[a.jsx(yr,{zone:"login.before",props:{}}),a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx("div",{className:"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Welcome to Meridian"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Sign in to access the admin area"})]})]}),a.jsxs("form",{onSubmit:d,className:"space-y-2",children:[a.jsx(Ee,{type:"email",placeholder:"Email",value:e,onChange:u=>t(u.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ee,{type:s?"text":"password",placeholder:"Password",value:r,onChange:u=>n(u.target.value),autoComplete:"current-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10"}),a.jsx("button",{type:"button",onClick:()=>i(!s),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:s?a.jsx(Mp,{className:"h-4 w-4"}):a.jsx(_l,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(Z,{type:"submit",className:"w-full h-10 font-medium",disabled:l.isPending,children:l.isPending?"Signing in...":"Continue with Email"})})]}),(c==null?void 0:c.googleOAuthEnabled)&&a.jsxs("div",{className:"mt-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-border"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),a.jsx("div",{className:"h-px flex-1 bg-border"})]}),a.jsx(Fp,{flow:"login"})]}),a.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Don't have an account?"," ",a.jsx(Va,{to:"/register",className:"text-indigo hover:opacity-80 transition-opacity",children:"Create one"})]}),a.jsx(yr,{zone:"login.after",props:{}})]})})}function AT(){const[e,t]=p.useState(""),[r,n]=p.useState(""),[s,i]=p.useState(""),[o,l]=p.useState(""),[c,d]=p.useState(!1),u=kt(),f=iD(),{data:m}=vu(),h=(m==null?void 0:m.needsSetup)===!0,g=x=>{x.preventDefault(),f.mutate({email:s,password:o,first_name:e,last_name:r},{onSuccess:()=>u("/"),onError:v=>z.error(v.message??"Registration failed")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px]",children:[a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx("div",{className:"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold text-foreground",children:h?"Set up your account":"Create your account"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:h?"You're the first user — you'll be the super admin.":"Get started with Meridian"})]})]}),a.jsxs("form",{onSubmit:g,className:"space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Ee,{placeholder:"First name",value:e,onChange:x=>t(x.target.value),required:!0,className:"bg-white dark:bg-card h-10"}),a.jsx(Ee,{placeholder:"Last name",value:r,onChange:x=>n(x.target.value),required:!0,className:"bg-white dark:bg-card h-10"})]}),a.jsx(Ee,{type:"email",placeholder:"Email",value:s,onChange:x=>i(x.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ee,{type:c?"text":"password",placeholder:"Password",value:o,onChange:x=>l(x.target.value),autoComplete:"new-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10"}),a.jsx("button",{type:"button",onClick:()=>d(!c),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:c?a.jsx(Mp,{className:"h-4 w-4"}):a.jsx(_l,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(Z,{type:"submit",className:"w-full h-10 font-medium",disabled:f.isPending,children:f.isPending?"Creating account...":"Create Account"})})]}),(m==null?void 0:m.googleOAuthEnabled)&&a.jsxs("div",{className:"mt-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-border"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),a.jsx("div",{className:"h-px flex-1 bg-border"})]}),a.jsx(Fp,{flow:"register",label:h?"Set up with Google":"Continue with Google"})]}),a.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Already have an account?"," ",a.jsx(Va,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]})})}function ET(){const[e,t]=p.useState(""),r=kt(),{setWorkspace:n}=De(),s=qE(),i=o=>{o.preventDefault(),e.trim()&&s.mutate({name:e.trim()},{onSuccess:l=>{const c={id:l.workspace.id,name:l.workspace.name,slug:l.workspace.slug};n(c),r(`/${c.slug}/projects`,{replace:!0})},onError:l=>z.error(l.message??"Failed to create workspace")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[380px]",children:[a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx("div",{className:"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Create your workspace"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"A workspace is where your team's projects and issues live."})]})]}),a.jsxs("form",{onSubmit:i,className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Ee,{placeholder:"Workspace name (e.g. Acme Corp)",value:e,onChange:o=>t(o.target.value),autoFocus:!0,required:!0,className:"bg-white dark:bg-card h-10"}),a.jsx("p",{className:"text-xs text-muted-foreground px-0.5",children:"You can rename it later from settings."})]}),a.jsx(Z,{type:"submit",className:"w-full h-10 font-medium",disabled:!e.trim()||s.isPending,children:s.isPending?"Creating workspace...":"Create workspace"})]})]})})}function DT(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const I1=E.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Tl=()=>{const e=E.useContext(I1);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};DT(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
534
|
-
[data-state=closed]
|
|
535
|
-
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function TT(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function IT(){return Bp(/^Mac/)}function RT(){return Bp(/^iPhone/)}function Ov(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function $T(){return Bp(/^iPad/)||IT()&&navigator.maxTouchPoints>1}function R1(){return RT()||$T()}function Bp(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const zT=24,LT=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Pv(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const em=typeof document<"u"&&window.visualViewport;function Mv(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function $1(e){for(Mv(e)&&(e=e.parentElement);e&&!Mv(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const FT=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let gc=0,tm;function BT(e={}){let{isDisabled:t}=e;LT(()=>{if(!t)return gc++,gc===1&&R1()&&(tm=WT()),()=>{gc--,gc===0&&(tm==null||tm())}},[t])}function WT(){let e,t=0,r=f=>{e=$1(f.target),!(e===document.documentElement&&e===document.body)&&(t=f.changedTouches[0].pageY)},n=f=>{if(!e||e===document.documentElement||e===document.body){f.preventDefault();return}let m=f.changedTouches[0].pageY,h=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((h<=0&&m>t||h>=g&&m<t)&&f.preventDefault(),t=m)},s=f=>{let m=f.target;rh(m)&&m!==document.activeElement&&(f.preventDefault(),m.style.transform="translateY(-2000px)",m.focus(),requestAnimationFrame(()=>{m.style.transform=""}))},i=f=>{let m=f.target;rh(m)&&(m.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{m.style.transform="",em&&(em.height<window.innerHeight?requestAnimationFrame(()=>{Av(m)}):em.addEventListener("resize",()=>Av(m),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},l=window.pageXOffset,c=window.pageYOffset,d=Pv(UT(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=Pv(yo(document,"touchstart",r,{passive:!1,capture:!0}),yo(document,"touchmove",n,{passive:!1,capture:!0}),yo(document,"touchend",s,{passive:!1,capture:!0}),yo(document,"focus",i,!0),yo(window,"scroll",o));return()=>{d(),u(),window.scrollTo(l,c)}}function UT(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function yo(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function Av(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let r=$1(e);if(r!==document.documentElement&&r!==document.body&&r!==e){let n=r.getBoundingClientRect().top,s=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const o=r.getBoundingClientRect().bottom+zT;i>o&&(r.scrollTop+=s-n)}e=r.parentElement}}function rh(e){return e instanceof HTMLInputElement&&!FT.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function qT(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function HT(...e){return t=>e.forEach(r=>qT(r,t))}function z1(...e){return p.useCallback(HT(...e),e)}const L1=new WeakMap;function Dt(e,t,r=!1){if(!e||!(e instanceof HTMLElement))return;let n={};Object.entries(t).forEach(([s,i])=>{if(s.startsWith("--")){e.style.setProperty(s,i);return}n[s]=e.style[s],e.style[s]=i}),!r&&L1.set(e,n)}function KT(e,t){if(!e||!(e instanceof HTMLElement))return;let r=L1.get(e);r&&(e.style[t]=r[t])}const Pt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function xc(e,t){if(!e)return null;const r=window.getComputedStyle(e),n=r.transform||r.webkitTransform||r.mozTransform;let s=n.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[Pt(t)?13:12]):(s=n.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Pt(t)?5:4]):null)}function YT(e){return 8*(Math.log(e+1)-2)}function rm(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}function GT(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}const ft={DURATION:.5,EASE:[.32,.72,0,1]},F1=.4,VT=.25,XT=100,B1=8,ds=16,nh=26,nm="vaul-dragging";function W1(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...r)=>t.current==null?void 0:t.current.call(t,...r),[])}function QT({defaultProp:e,onChange:t}){const r=E.useState(e),[n]=r,s=E.useRef(n),i=W1(t);return E.useEffect(()=>{s.current!==n&&(i(n),s.current=n)},[n,s,i]),r}function U1({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=QT({defaultProp:t,onChange:r}),i=e!==void 0,o=i?e:n,l=W1(r),c=E.useCallback(d=>{if(i){const f=typeof d=="function"?d(e):d;f!==e&&l(f)}else s(d)},[i,e,s,l]);return[o,c]}function ZT({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:s,fadeFromIndex:i,onSnapPointChange:o,direction:l="bottom",container:c,snapToSequentialPoint:d}){const[u,f]=U1({prop:e,defaultProp:r==null?void 0:r[0],onChange:t}),[m,h]=E.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);E.useEffect(()=>{function S(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const g=E.useMemo(()=>u===(r==null?void 0:r[r.length-1])||null,[r,u]),x=E.useMemo(()=>{var S;return(S=r==null?void 0:r.findIndex(C=>C===u))!=null?S:null},[r,u]),v=r&&r.length>0&&(i||i===0)&&!Number.isNaN(i)&&r[i]===u||!r,y=E.useMemo(()=>{const S=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var C;return(C=r==null?void 0:r.map(P=>{const M=typeof P=="string";let A=0;if(M&&(A=parseInt(P,10)),Pt(l)){const D=M?A:m?P*S.height:0;return m?l==="bottom"?S.height-D:-S.height+D:D}const _=M?A:m?P*S.width:0;return m?l==="right"?S.width-_:-S.width+_:_}))!=null?C:[]},[r,m,c]),j=E.useMemo(()=>x!==null?y==null?void 0:y[x]:null,[y,x]),b=E.useCallback(S=>{var C;const P=(C=y==null?void 0:y.findIndex(M=>M===S))!=null?C:null;o(P),Dt(n.current,{transition:`transform ${ft.DURATION}s cubic-bezier(${ft.EASE.join(",")})`,transform:Pt(l)?`translate3d(0, ${S}px, 0)`:`translate3d(${S}px, 0, 0)`}),y&&P!==y.length-1&&i!==void 0&&P!==i&&P<i?Dt(s.current,{transition:`opacity ${ft.DURATION}s cubic-bezier(${ft.EASE.join(",")})`,opacity:"0"}):Dt(s.current,{transition:`opacity ${ft.DURATION}s cubic-bezier(${ft.EASE.join(",")})`,opacity:"1"}),f(r==null?void 0:r[Math.max(P,0)])},[n.current,r,y,i,s,f]);E.useEffect(()=>{if(u||e){var S;const C=(S=r==null?void 0:r.findIndex(P=>P===e||P===u))!=null?S:-1;y&&C!==-1&&typeof y[C]=="number"&&b(y[C])}},[u,e,r,y,b]);function N({draggedDistance:S,closeDrawer:C,velocity:P,dismissible:M}){if(i===void 0)return;const A=l==="bottom"||l==="right"?(j??0)-S:(j??0)+S,_=x===i-1,D=x===0,O=S>0;if(_&&Dt(s.current,{transition:`opacity ${ft.DURATION}s cubic-bezier(${ft.EASE.join(",")})`}),!d&&P>2&&!O){M?C():b(y[0]);return}if(!d&&P>2&&O&&y&&r){b(y[r.length-1]);return}const R=y==null?void 0:y.reduce((H,ne)=>typeof H!="number"||typeof ne!="number"?H:Math.abs(ne-A)<Math.abs(H-A)?ne:H),F=Pt(l)?window.innerHeight:window.innerWidth;if(P>F1&&Math.abs(S)<F*.4){const H=O?1:-1;if(H>0&&g&&r){b(y[r.length-1]);return}if(D&&H<0&&M&&C(),x===null)return;b(y[x+H]);return}b(R)}function k({draggedDistance:S}){if(j===null)return;const C=l==="bottom"||l==="right"?j-S:j+S;(l==="bottom"||l==="right")&&C<y[y.length-1]||(l==="top"||l==="left")&&C>y[y.length-1]||Dt(n.current,{transform:Pt(l)?`translate3d(0, ${C}px, 0)`:`translate3d(${C}px, 0, 0)`})}function w(S,C){if(!r||typeof x!="number"||!y||i===void 0)return null;const P=x===i-1;if(x>=i&&C)return 0;if(P&&!C)return 1;if(!v&&!P)return null;const A=P?x+1:x-1,_=P?y[A]-y[A-1]:y[A+1]-y[A],D=S/Math.abs(_);return P?1-D:D}return{isLastSnapPoint:g,activeSnapPoint:u,shouldFade:v,getPercentageDragged:w,setActiveSnapPoint:f,activeSnapPointIndex:x,onRelease:N,onDrag:k,snapPointsOffset:y}}const JT=()=>()=>{};function e5(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:s}=Tl(),i=E.useRef(null),o=p.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-nh)/window.innerWidth}E.useEffect(()=>{if(t&&r){i.current&&clearTimeout(i.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;GT(n&&!s?rm(document.body,{background:"black"}):JT,rm(c,{transformOrigin:Pt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${ft.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ft.EASE.join(",")})`}));const d=rm(c,{borderRadius:`${B1}px`,overflow:"hidden",...Pt(e)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{d(),i.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty("background")},ft.DURATION*1e3)}}},[t,r,o])}let bo=null;function t5({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:s,noBodyStyles:i}){const[o,l]=E.useState(()=>typeof window<"u"?window.location.href:""),c=E.useRef(0),d=E.useCallback(()=>{if(Ov()&&bo===null&&e&&!i){bo={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:f,innerHeight:m}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-f}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=m-window.innerHeight;h&&c.current>=m&&(document.body.style.top=`${-(c.current+h)}px`)}),300)}},[e]),u=E.useCallback(()=>{if(Ov()&&bo!==null&&!i){const f=-parseInt(document.body.style.top,10),m=-parseInt(document.body.style.left,10);Object.assign(document.body.style,bo),window.requestAnimationFrame(()=>{if(s&&o!==window.location.href){l(window.location.href);return}window.scrollTo(m,f)}),bo=null}},[o]);return E.useEffect(()=>{function f(){c.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),E.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),E.useEffect(()=>{r||!n||(e?(!window.matchMedia("(display-mode: standalone)").matches&&d(),t||window.setTimeout(()=>{u()},500)):u())},[e,n,o,t,r,d,u]),{restorePositionSetting:u}}function r5({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:s,snapPoints:i,shouldScaleBackground:o=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=VT,scrollLockTimeout:d=XT,dismissible:u=!0,handleOnly:f=!1,fadeFromIndex:m=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:g,fixed:x,modal:v=!0,onClose:y,nested:j,noBodyStyles:b=!1,direction:N="bottom",defaultOpen:k=!1,disablePreventScroll:w=!0,snapToSequentialPoint:S=!1,preventScrollRestoration:C=!1,repositionInputs:P=!0,onAnimationEnd:M,container:A,autoFocus:_=!1}){var D,O;const[R=!1,F]=U1({defaultProp:k,prop:e,onChange:ke=>{t==null||t(ke),!ke&&!j&&bt(),setTimeout(()=>{M==null||M(ke)},ft.DURATION*1e3),ke&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),ke||(document.body.style.pointerEvents="auto")}}),[H,ne]=E.useState(!1),[G,oe]=E.useState(!1),[ce,B]=E.useState(!1),Y=E.useRef(null),U=E.useRef(null),X=E.useRef(null),$=E.useRef(null),K=E.useRef(null),V=E.useRef(!1),L=E.useRef(null),se=E.useRef(0),he=E.useRef(!1),Q=E.useRef(!k),Pe=E.useRef(0),re=E.useRef(null),Oe=E.useRef(((D=re.current)==null?void 0:D.getBoundingClientRect().height)||0),Ce=E.useRef(((O=re.current)==null?void 0:O.getBoundingClientRect().width)||0),q=E.useRef(0),ve=E.useCallback(ke=>{i&&ke===_t.length-1&&(U.current=new Date)},[]),{activeSnapPoint:Me,activeSnapPointIndex:We,setActiveSnapPoint:Ue,onRelease:Ct,snapPointsOffset:_t,onDrag:ur,shouldFade:Sr,getPercentageDragged:dt}=ZT({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:g,drawerRef:re,fadeFromIndex:m,overlayRef:Y,onSnapPointChange:ve,direction:N,container:A,snapToSequentialPoint:S});BT({isDisabled:!R||G||!v||ce||!H||!P||!w});const{restorePositionSetting:bt}=t5({isOpen:R,modal:v,nested:j??!1,hasBeenOpened:H,preventScrollRestoration:C,noBodyStyles:b});function Gr(){return(window.innerWidth-nh)/window.innerWidth}function Ia(ke){var de,pe;!u&&!i||re.current&&!re.current.contains(ke.target)||(Oe.current=((de=re.current)==null?void 0:de.getBoundingClientRect().height)||0,Ce.current=((pe=re.current)==null?void 0:pe.getBoundingClientRect().width)||0,oe(!0),X.current=new Date,R1()&&window.addEventListener("touchend",()=>V.current=!1,{once:!0}),ke.target.setPointerCapture(ke.pointerId),se.current=Pt(N)?ke.pageY:ke.pageX)}function Vr(ke,de){var pe;let ie=ke;const fe=(pe=window.getSelection())==null?void 0:pe.toString(),qe=re.current?xc(re.current,N):null,ee=new Date;if(ie.tagName==="SELECT"||ie.hasAttribute("data-vaul-no-drag")||ie.closest("[data-vaul-no-drag]"))return!1;if(N==="right"||N==="left")return!0;if(U.current&&ee.getTime()-U.current.getTime()<500)return!1;if(qe!==null&&(N==="bottom"?qe>0:qe<0))return!0;if(fe&&fe.length>0)return!1;if(K.current&&ee.getTime()-K.current.getTime()<d&&qe===0||de)return K.current=ee,!1;for(;ie;){if(ie.scrollHeight>ie.clientHeight){if(ie.scrollTop!==0)return K.current=new Date,!1;if(ie.getAttribute("role")==="dialog")return!0}ie=ie.parentNode}return!0}function Xn(ke){if(re.current&&G){const de=N==="bottom"||N==="right"?1:-1,pe=(se.current-(Pt(N)?ke.pageY:ke.pageX))*de,ie=pe>0,fe=i&&!u&&!ie;if(fe&&We===0)return;const qe=Math.abs(pe),ee=document.querySelector("[data-vaul-drawer-wrapper]"),ye=N==="bottom"||N==="top"?Oe.current:Ce.current;let Ae=qe/ye;const ut=dt(qe,ie);if(ut!==null&&(Ae=ut),fe&&Ae>=1||!V.current&&!Vr(ke.target,ie))return;if(re.current.classList.add(nm),V.current=!0,Dt(re.current,{transition:"none"}),Dt(Y.current,{transition:"none"}),i&&ur({draggedDistance:pe}),ie&&!i){const Qe=YT(pe),mr=Math.min(Qe*-1,0)*de;Dt(re.current,{transform:Pt(N)?`translate3d(0, ${mr}px, 0)`:`translate3d(${mr}px, 0, 0)`});return}const Xe=1-Ae;if((Sr||m&&We===m-1)&&(n==null||n(ke,Ae),Dt(Y.current,{opacity:`${Xe}`,transition:"none"},!0)),ee&&Y.current&&o){const Qe=Math.min(Gr()+Ae*(1-Gr()),1),mr=8-Ae*8,Xt=Math.max(0,14-Ae*14);Dt(ee,{borderRadius:`${mr}px`,transform:Pt(N)?`scale(${Qe}) translate3d(0, ${Xt}px, 0)`:`scale(${Qe}) translate3d(${Xt}px, 0, 0)`,transition:"none"},!0)}if(!i){const Qe=qe*de;Dt(re.current,{transform:Pt(N)?`translate3d(0, ${Qe}px, 0)`:`translate3d(${Qe}px, 0, 0)`})}}}E.useEffect(()=>{window.requestAnimationFrame(()=>{Q.current=!0})},[]),E.useEffect(()=>{var ke;function de(){if(!re.current||!P)return;const pe=document.activeElement;if(rh(pe)||he.current){var ie;const fe=((ie=window.visualViewport)==null?void 0:ie.height)||0,qe=window.innerHeight;let ee=qe-fe;const ye=re.current.getBoundingClientRect().height||0,Ae=ye>qe*.8;q.current||(q.current=ye);const ut=re.current.getBoundingClientRect().top;if(Math.abs(Pe.current-ee)>60&&(he.current=!he.current),i&&i.length>0&&_t&&We){const Xe=_t[We]||0;ee+=Xe}if(Pe.current=ee,ye>fe||he.current){const Xe=re.current.getBoundingClientRect().height;let Qe=Xe;Xe>fe&&(Qe=fe-(Ae?ut:nh)),x?re.current.style.height=`${Xe-Math.max(ee,0)}px`:re.current.style.height=`${Math.max(Qe,fe-ut)}px`}else TT()||(re.current.style.height=`${q.current}px`);i&&i.length>0&&!he.current?re.current.style.bottom="0px":re.current.style.bottom=`${Math.max(ee,0)}px`}}return(ke=window.visualViewport)==null||ke.addEventListener("resize",de),()=>{var pe;return(pe=window.visualViewport)==null?void 0:pe.removeEventListener("resize",de)}},[We,i,_t]);function Rr(ke){fr(),y==null||y(),ke||F(!1),setTimeout(()=>{i&&Ue(i[0])},ft.DURATION*1e3)}function $r(){if(!re.current)return;const ke=document.querySelector("[data-vaul-drawer-wrapper]"),de=xc(re.current,N);Dt(re.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${ft.DURATION}s cubic-bezier(${ft.EASE.join(",")})`}),Dt(Y.current,{transition:`opacity ${ft.DURATION}s cubic-bezier(${ft.EASE.join(",")})`,opacity:"1"}),o&&de&&de>0&&R&&Dt(ke,{borderRadius:`${B1}px`,overflow:"hidden",...Pt(N)?{transform:`scale(${Gr()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Gr()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${ft.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ft.EASE.join(",")})`},!0)}function fr(){!G||!re.current||(re.current.classList.remove(nm),V.current=!1,oe(!1),$.current=new Date)}function nr(ke){if(!G||!re.current)return;re.current.classList.remove(nm),V.current=!1,oe(!1),$.current=new Date;const de=xc(re.current,N);if(!ke||!Vr(ke.target,!1)||!de||Number.isNaN(de)||X.current===null)return;const pe=$.current.getTime()-X.current.getTime(),ie=se.current-(Pt(N)?ke.pageY:ke.pageX),fe=Math.abs(ie)/pe;if(fe>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),i){Ct({draggedDistance:ie*(N==="bottom"||N==="right"?1:-1),closeDrawer:Rr,velocity:fe,dismissible:u}),s==null||s(ke,!0);return}if(N==="bottom"||N==="right"?ie>0:ie<0){$r(),s==null||s(ke,!0);return}if(fe>F1){Rr(),s==null||s(ke,!1);return}var qe;const ee=Math.min((qe=re.current.getBoundingClientRect().height)!=null?qe:0,window.innerHeight);var ye;const Ae=Math.min((ye=re.current.getBoundingClientRect().width)!=null?ye:0,window.innerWidth),ut=N==="left"||N==="right";if(Math.abs(de)>=(ut?Ae:ee)*c){Rr(),s==null||s(ke,!1);return}s==null||s(ke,!0),$r()}E.useEffect(()=>(R&&(Dt(document.documentElement,{scrollBehavior:"auto"}),U.current=new Date),()=>{KT(document.documentElement,"scrollBehavior")}),[R]);function Vt(ke){const de=ke?(window.innerWidth-ds)/window.innerWidth:1,pe=ke?-ds:0;L.current&&window.clearTimeout(L.current),Dt(re.current,{transition:`transform ${ft.DURATION}s cubic-bezier(${ft.EASE.join(",")})`,transform:Pt(N)?`scale(${de}) translate3d(0, ${pe}px, 0)`:`scale(${de}) translate3d(${pe}px, 0, 0)`}),!ke&&re.current&&(L.current=setTimeout(()=>{const ie=xc(re.current,N);Dt(re.current,{transition:"none",transform:Pt(N)?`translate3d(0, ${ie}px, 0)`:`translate3d(${ie}px, 0, 0)`})},500))}function _n(ke,de){if(de<0)return;const pe=(window.innerWidth-ds)/window.innerWidth,ie=pe+de*(1-pe),fe=-ds+de*ds;Dt(re.current,{transform:Pt(N)?`scale(${ie}) translate3d(0, ${fe}px, 0)`:`scale(${ie}) translate3d(${fe}px, 0, 0)`,transition:"none"})}function Qn(ke,de){const pe=Pt(N)?window.innerHeight:window.innerWidth,ie=de?(pe-ds)/pe:1,fe=de?-ds:0;de&&Dt(re.current,{transition:`transform ${ft.DURATION}s cubic-bezier(${ft.EASE.join(",")})`,transform:Pt(N)?`scale(${ie}) translate3d(0, ${fe}px, 0)`:`scale(${ie}) translate3d(${fe}px, 0, 0)`})}return E.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),E.createElement(jl,{defaultOpen:k,onOpenChange:ke=>{!u&&!ke||(ke?ne(!0):Rr(!0),F(ke))},open:R},E.createElement(I1.Provider,{value:{activeSnapPoint:Me,snapPoints:i,setActiveSnapPoint:Ue,drawerRef:re,overlayRef:Y,onOpenChange:t,onPress:Ia,onRelease:nr,onDrag:Xn,dismissible:u,shouldAnimate:Q,handleOnly:f,isOpen:R,isDragging:G,shouldFade:Sr,closeDrawer:Rr,onNestedDrag:_n,onNestedOpenChange:Vt,onNestedRelease:Qn,keyboardIsOpen:he,modal:v,snapPointsOffset:_t,activeSnapPointIndex:We,direction:N,shouldScaleBackground:o,setBackgroundColorOnScale:l,noBodyStyles:b,container:A,autoFocus:_}},r))}const q1=E.forwardRef(function({...e},t){const{overlayRef:r,snapPoints:n,onRelease:s,shouldFade:i,isOpen:o,modal:l,shouldAnimate:c}=Tl(),d=z1(t,r),u=n&&n.length>0;if(!l)return null;const f=E.useCallback(m=>s(m),[s]);return E.createElement(Hs,{onMouseUp:f,ref:d,"data-vaul-overlay":"","data-vaul-snap-points":o&&u?"true":"false","data-vaul-snap-points-overlay":o&&i?"true":"false","data-vaul-animate":c!=null&&c.current?"true":"false",...e})});q1.displayName="Drawer.Overlay";const H1=E.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:r,...n},s){const{drawerRef:i,onPress:o,onRelease:l,onDrag:c,keyboardIsOpen:d,snapPointsOffset:u,activeSnapPointIndex:f,modal:m,isOpen:h,direction:g,snapPoints:x,container:v,handleOnly:y,shouldAnimate:j,autoFocus:b}=Tl(),[N,k]=E.useState(!1),w=z1(s,i),S=E.useRef(null),C=E.useRef(null),P=E.useRef(!1),M=x&&x.length>0;e5();const A=(D,O,R=0)=>{if(P.current)return!0;const F=Math.abs(D.y),H=Math.abs(D.x),ne=H>F,G=["bottom","right"].includes(O)?1:-1;if(O==="left"||O==="right"){if(!(D.x*G<0)&&H>=0&&H<=R)return ne}else if(!(D.y*G<0)&&F>=0&&F<=R)return!ne;return P.current=!0,!0};E.useEffect(()=>{M&&window.requestAnimationFrame(()=>{k(!0)})},[]);function _(D){S.current=null,P.current=!1,l(D)}return E.createElement(Ks,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":N?"true":"false","data-vaul-snap-points":h&&M?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":j!=null&&j.current?"true":"false",...n,ref:w,style:u&&u.length>0?{"--snap-point-height":`${u[f??0]}px`,...t}:t,onPointerDown:D=>{y||(n.onPointerDown==null||n.onPointerDown.call(n,D),S.current={x:D.pageX,y:D.pageY},o(D))},onOpenAutoFocus:D=>{r==null||r(D),b||D.preventDefault()},onPointerDownOutside:D=>{if(e==null||e(D),!m||D.defaultPrevented){D.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:D=>{if(!m){D.preventDefault();return}},onPointerMove:D=>{if(C.current=D,y||(n.onPointerMove==null||n.onPointerMove.call(n,D),!S.current))return;const O=D.pageY-S.current.y,R=D.pageX-S.current.x,F=D.pointerType==="touch"?10:2;A({x:R,y:O},g,F)?c(D):(Math.abs(R)>F||Math.abs(O)>F)&&(S.current=null)},onPointerUp:D=>{n.onPointerUp==null||n.onPointerUp.call(n,D),S.current=null,P.current=!1,l(D)},onPointerOut:D=>{n.onPointerOut==null||n.onPointerOut.call(n,D),_(C.current)},onContextMenu:D=>{n.onContextMenu==null||n.onContextMenu.call(n,D),C.current&&_(C.current)}})});H1.displayName="Drawer.Content";const n5=250,a5=120,s5=E.forwardRef(function({preventCycle:e=!1,children:t,...r},n){const{closeDrawer:s,isDragging:i,snapPoints:o,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:d,handleOnly:u,isOpen:f,onPress:m,onDrag:h}=Tl(),g=E.useRef(null),x=E.useRef(!1);function v(){if(x.current){b();return}window.setTimeout(()=>{y()},a5)}function y(){if(i||e||x.current){b();return}if(b(),!o||o.length===0){d||s();return}if(l===o[o.length-1]&&d){s();return}const k=o.findIndex(S=>S===l);if(k===-1)return;const w=o[k+1];c(w)}function j(){g.current=window.setTimeout(()=>{x.current=!0},n5)}function b(){g.current&&window.clearTimeout(g.current),x.current=!1}return E.createElement("div",{onClick:v,onPointerCancel:b,onPointerDown:N=>{u&&m(N),j()},onPointerMove:N=>{u&&h(N)},ref:n,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},E.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});s5.displayName="Drawer.Handle";function i5(e){const t=Tl(),{container:r=t.container,...n}=e;return E.createElement(wl,{container:r,...n})}const Sa={Root:r5,Content:H1,Overlay:q1,Portal:i5,Title:Li,Description:Fi},Qs=({shouldScaleBackground:e=!1,direction:t="right",...r})=>a.jsx(Sa.Root,{shouldScaleBackground:e,direction:t,...r});Qs.displayName="Drawer";const o5=Sa.Portal,K1=p.forwardRef(({className:e,...t},r)=>a.jsx(Sa.Overlay,{ref:r,className:T("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));K1.displayName=Sa.Overlay.displayName;const Zs=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(o5,{children:[a.jsx(K1,{}),a.jsx(Sa.Content,{ref:n,className:T("fixed inset-y-0 right-0 z-50 flex h-full flex-col border-l border-border bg-background shadow-xl","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right","w-full max-w-lg",e),...r,children:t})]}));Zs.displayName="DrawerContent";const Vi=({className:e,...t})=>a.jsx("div",{className:T("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border shrink-0",e),...t});Vi.displayName="DrawerHeader";const Xi=({className:e,...t})=>a.jsx("div",{className:T("flex-1 overflow-y-auto px-6 py-4",e),...t});Xi.displayName="DrawerBody";const Il=({className:e,...t})=>a.jsx("div",{className:T("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 px-6 py-4 border-t border-border shrink-0",e),...t});Il.displayName="DrawerFooter";const Qi=p.forwardRef(({className:e,...t},r)=>a.jsx(Sa.Title,{ref:r,className:T("text-base font-semibold text-foreground",e),...t}));Qi.displayName=Sa.Title.displayName;const l5=p.forwardRef(({className:e,...t},r)=>a.jsx(Sa.Description,{ref:r,className:T("text-sm text-muted-foreground",e),...t}));l5.displayName=Sa.Description.displayName;const c5=kl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),gt=p.forwardRef(({className:e,...t},r)=>a.jsx(fj,{ref:r,className:T(c5(),e),...t}));gt.displayName=fj.displayName;const Au=p.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:T("flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-none placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 resize-none",e),ref:r,...t}));Au.displayName="Textarea";const Ev=[{name:"Backlog",key:"backlog",color:"#94a3b8",category:"backlog",position:0},{name:"Todo",key:"todo",color:"#64748b",category:"unstarted",position:1},{name:"In Progress",key:"in_progress",color:"#6366f1",category:"started",position:2},{name:"In Review",key:"in_review",color:"#f59e0b",category:"started",position:3},{name:"Done",key:"done",color:"#10b981",category:"completed",position:4},{name:"Cancelled",key:"cancelled",color:"#9ca3af",category:"cancelled",position:5}],am=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"];function d5(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function u5({chip:e,onRemove:t}){const{attributes:r,listeners:n,setNodeRef:s,transform:i,transition:o,isDragging:l}=bp({id:e.key});return a.jsxs("div",{ref:s,style:{transform:wp.Transform.toString(i),transition:o},className:T("flex items-center gap-1 pl-1 pr-1.5 py-0.5 rounded-full border text-xs font-medium transition-opacity",l?"opacity-50":"opacity-100"),children:[a.jsx("span",{...r,...n,className:"text-muted-foreground/50 hover:text-muted-foreground cursor-grab touch-none",children:a.jsx(i1,{className:"h-3 w-3"})}),a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:e.color}}),a.jsx("span",{className:"text-[11px]",children:e.name}),a.jsx("button",{type:"button",onClick:t,className:"ml-0.5 text-muted-foreground/50 hover:text-muted-foreground transition-colors",children:a.jsx(nt,{className:"h-3 w-3"})})]})}const f5=3;function m5({open:e,onClose:t}){var R;const[r,n]=p.useState(""),[s,i]=p.useState(""),[o,l]=p.useState(""),[c,d]=p.useState(!1),[u,f]=p.useState(!1),[m,h]=p.useState(Ev),[g,x]=p.useState(""),[v,y]=p.useState(am[2]),{workspace:j}=De(),b=CD(),N=kD(r,{enabled:e}),k=SD(s,{enabled:e});p.useEffect(()=>{e&&N.data&&!c&&i(N.data)},[e,N.data,c]);const w=k.available===!1||b.isError&&((R=b.error)==null?void 0:R.status)===409,S=s.trim().length>=f5&&/^[A-Z0-9]+$/i.test(s.trim()),C=Cj(vp(_j,{activationConstraint:{distance:5}})),P=F=>{n(F)},M=()=>{r.trim()&&!c&&N.flush()},A=()=>{n(""),i(""),l(""),d(!1),f(!1),h(Ev),x(""),y(am[2]),b.reset(),t()},_=()=>{if(!g.trim())return;const F=d5(g.trim());if(m.some(H=>H.key===F)){z.error("A status with this name already exists");return}h(H=>[...H,{name:g.trim(),key:F,color:v,category:"started",position:H.length}]),x("")},D=F=>{const{active:H,over:ne}=F;!ne||H.id===ne.id||h(G=>{const oe=G.findIndex(B=>B.key===H.id),ce=G.findIndex(B=>B.key===ne.id);return Uc(G,oe,ce).map((B,Y)=>({...B,position:Y}))})},O=F=>{F.preventDefault(),!(!r.trim()||!s.trim()||!S||w)&&b.mutate({name:r.trim(),identifier:s.trim().toUpperCase(),description:o.trim()||void 0,workspace_id:j.id,initial_statuses:m},{onSuccess:()=>{z.success("Project created"),A()},onError:H=>{(H==null?void 0:H.status)===409?z.error("This project key is already in use."):z.error(H.message??"Failed to create project")}})};return a.jsx(Qs,{open:e,onOpenChange:F=>!F&&A(),dismissible:!1,children:a.jsxs(Zs,{className:"max-w-md",children:[a.jsx(Vi,{children:a.jsx(Qi,{children:"New project"})}),a.jsxs("form",{onSubmit:O,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(Xi,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(gt,{htmlFor:"project-name",children:"Name"}),a.jsx(Ee,{id:"project-name",placeholder:"My Project",value:r,onChange:F=>P(F.target.value),onBlur:M,autoFocus:!0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Project key below will auto-fill when you finish typing; you can change it."})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(gt,{htmlFor:"project-id",children:["Identifier",a.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Used as issue prefix (e.g. PROJ-1)"})]}),a.jsx(Ee,{id:"project-id",placeholder:"PROJ",value:s,onChange:F=>{i(F.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"")),d(!0)},maxLength:5,className:T("font-mono",w&&"border-destructive"),"aria-invalid":w}),w&&a.jsx("p",{className:"text-xs text-destructive",children:"This project key is already in use."})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(gt,{htmlFor:"project-desc",children:["Description",a.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(Au,{id:"project-desc",placeholder:"What is this project about?",value:o,onChange:F=>l(F.target.value),className:"min-h-[80px]"})]}),a.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[a.jsx("button",{type:"button",onClick:()=>f(!u),className:"w-full flex items-center justify-between px-3 py-2.5 text-xs font-medium hover:bg-muted/40 transition-colors",children:a.jsxs("span",{className:"flex items-center gap-1.5",children:[u?a.jsx(Kn,{className:"h-3.5 w-3.5"}):a.jsx(kn,{className:"h-3.5 w-3.5"}),"Statuses",a.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",m.length,")"]})]})}),u&&a.jsxs("div",{className:"px-3 pb-3 border-t border-border space-y-3 pt-3",children:[a.jsx(Ho,{sensors:C,onDragEnd:D,children:a.jsx(yp,{items:m.map(F=>F.key),strategy:Oj,children:a.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.map(F=>a.jsx(u5,{chip:F,onRemove:()=>h(H=>H.filter(ne=>ne.key!==F.key).map((ne,G)=>({...ne,position:G})))},F.key))})})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:am.map(F=>a.jsx("button",{type:"button",onClick:()=>y(F),className:T("h-4 w-4 rounded-full border-2 transition-transform hover:scale-110",v===F?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:F}},F))}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[a.jsx(Ee,{placeholder:"Status name…",value:g,onChange:F=>x(F.target.value),onKeyDown:F=>{F.key==="Enter"&&(F.preventDefault(),_())},className:"h-7 text-xs flex-1"}),a.jsx(Z,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 shrink-0",onClick:_,disabled:!g.trim(),children:a.jsx(it,{className:"h-3.5 w-3.5"})})]})]})]})]})]}),a.jsxs(Il,{children:[a.jsx(Z,{type:"button",variant:"ghost",onClick:A,children:"Cancel"}),a.jsx(Z,{type:"submit",disabled:!r.trim()||!s.trim()||!S||w||b.isPending,children:b.isPending?"Creating...":"Create project"})]})]})]})})}const Fe=KP,Ye=YP,Re=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(mj,{ref:n,className:T("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-none 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,a.jsx(BP,{asChild:!0,children:a.jsx(Kn,{className:"h-4 w-4 opacity-50"})})]}));Re.displayName=mj.displayName;const Y1=p.forwardRef(({className:e,...t},r)=>a.jsx(hj,{ref:r,className:T("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(_p,{className:"h-4 w-4"})}));Y1.displayName=hj.displayName;const G1=p.forwardRef(({className:e,...t},r)=>a.jsx(pj,{ref:r,className:T("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Kn,{className:"h-4 w-4"})}));G1.displayName=pj.displayName;const $e=p.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>a.jsx(WP,{children:a.jsxs(gj,{ref:s,className:T("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-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",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:[a.jsx(Y1,{}),a.jsx(UP,{className:T("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(G1,{})]})}));$e.displayName=gj.displayName;const h5=p.forwardRef(({className:e,...t},r)=>a.jsx(xj,{ref:r,className:T("px-2 py-1.5 text-xs font-medium text-muted-foreground",e),...t}));h5.displayName=xj.displayName;const be=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(vj,{ref:n,className:T("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:[a.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(qP,{children:a.jsx(lr,{className:"h-4 w-4"})})}),a.jsx(HP,{children:t})]}));be.displayName=vj.displayName;const p5=p.forwardRef(({className:e,...t},r)=>a.jsx(yj,{ref:r,className:T("-mx-1 my-1 h-px bg-border",e),...t}));p5.displayName=yj.displayName;function g5({open:e,onClose:t,projectId:r,projectName:n}){const{workspace:s}=De(),i=(s==null?void 0:s.id)??"",{data:o,isLoading:l}=_u(r),{data:c}=Pl(i),{data:d}=xu(i),u=w1(r),f=j1(r),m=N1(r),h=k1(r),[g,x]=p.useState(""),[v,y]=p.useState(""),j=new Set((o==null?void 0:o.members.map(w=>w.user_id))??[]),b=new Set((o==null?void 0:o.teams.map(w=>w.team_id))??[]),N=(c??[]).filter(w=>!j.has(w.user_id)),k=(d??[]).filter(w=>!b.has(w.id));return a.jsx(Gs,{open:e,onOpenChange:w=>!w&&t(),children:a.jsxs(as,{className:"sm:max-w-[480px]",children:[a.jsx(Vs,{children:a.jsxs(Xs,{children:["Access — ",n]})}),a.jsxs("div",{className:"space-y-5 pt-1",children:[a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"})}),l?a.jsx("div",{className:"space-y-2",children:[1,2].map(w=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(le,{className:"h-7 w-7 rounded-full"}),a.jsx(le,{className:"h-3.5 w-32"})]},w))}):(o==null?void 0:o.members.length)===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No individual members."}):a.jsx("div",{className:"space-y-1",children:o==null?void 0:o.members.map(w=>{var _;const S=w.user,C=(S==null?void 0:S.first_name)??"",P=(S==null?void 0:S.last_name)??"",M=`${C} ${P}`.trim()||(S==null?void 0:S.email)||"Unknown",A=(C[0]??P[0]??((_=S==null?void 0:S.email)==null?void 0:_[0])??"U").toUpperCase();return a.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[a.jsx(Bt,{className:"h-7 w-7 shrink-0",children:a.jsx(Wt,{className:"text-[11px] font-medium",children:A})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:M}),a.jsx("span",{className:T("text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",w.role==="manager"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:w.role}),a.jsx("button",{onClick:()=>f.mutate(w.user_id,{onSuccess:()=>z.success("Access removed"),onError:()=>z.error("Failed to remove")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(nt,{className:"h-3.5 w-3.5"})})]},w.id)})}),N.length>0&&a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx(Ki,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Fe,{value:g,onValueChange:x,children:[a.jsx(Re,{className:"h-8 text-xs flex-1",children:a.jsx(Ye,{placeholder:"Add person…"})}),a.jsx($e,{children:N.map(w=>{const S=w.user,C=(S==null?void 0:S.first_name)??"",P=(S==null?void 0:S.last_name)??"",M=`${C} ${P}`.trim()||(S==null?void 0:S.email)||"Unknown";return a.jsx(be,{value:w.user_id,children:M},w.user_id)})})]}),g&&a.jsx(Z,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:u.isPending,onClick:()=>u.mutate({userId:g},{onSuccess:()=>{z.success("Access granted"),x("")},onError:()=>z.error("Failed to grant access")}),children:"Add"})]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"})}),l?a.jsx("div",{className:"space-y-2",children:[1].map(w=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(le,{className:"h-7 w-7 rounded-lg"}),a.jsx(le,{className:"h-3.5 w-28"})]},w))}):(o==null?void 0:o.teams.length)===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No teams have access."}):a.jsx("div",{className:"space-y-1",children:o==null?void 0:o.teams.map(w=>{const S=w.team;return a.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[a.jsx("div",{className:"h-7 w-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(Ts,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:(S==null?void 0:S.name)??"Unknown team"}),S&&a.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[S.member_count," ",S.member_count===1?"member":"members"]}),a.jsx("button",{onClick:()=>h.mutate(w.team_id,{onSuccess:()=>z.success("Team access removed"),onError:()=>z.error("Failed to remove team")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(nt,{className:"h-3.5 w-3.5"})})]},w.id)})}),k.length>0&&a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx(Ts,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Fe,{value:v,onValueChange:y,children:[a.jsx(Re,{className:"h-8 text-xs flex-1",children:a.jsx(Ye,{placeholder:"Add team…"})}),a.jsx($e,{children:k.map(w=>a.jsx(be,{value:w.id,children:w.name},w.id))})]}),v&&a.jsx(Z,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:m.isPending,onClick:()=>m.mutate(v,{onSuccess:()=>{z.success("Team access granted"),y("")},onError:()=>z.error("Failed to add team")}),children:"Add"})]})]}),a.jsx("div",{className:"flex justify-end pt-1",children:a.jsx(Z,{variant:"outline",size:"sm",onClick:t,children:"Close"})})]})]})})}const V1=6048e5,x5=864e5,v5=36e5,vc=43200,Dv=1440,Tv=Symbol.for("constructDateFrom");function pt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Tv in e?e[Tv](t):e instanceof Date?new e.constructor(t):new Date(t)}function ze(e,t){return pt(t||e,e)}function Ar(e,t,r){const n=ze(e,r==null?void 0:r.in);return isNaN(t)?pt((r==null?void 0:r.in)||e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Wp(e,t,r){const n=ze(e,r==null?void 0:r.in);if(isNaN(t))return pt((r==null?void 0:r.in)||e,NaN);if(!t)return n;const s=n.getDate(),i=pt((r==null?void 0:r.in)||e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return s>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),s),n)}let y5={};function Zi(){return y5}function Si(e,t){var l,c,d,u;const r=Zi(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=ze(e,t==null?void 0:t.in),i=s.getDay(),o=(i<n?7:0)+i-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function Qo(e,t){return Si(e,{...t,weekStartsOn:1})}function X1(e,t){const r=ze(e,t==null?void 0:t.in),n=r.getFullYear(),s=pt(r,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const i=Qo(s),o=pt(r,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const l=Qo(o);return r.getTime()>=i.getTime()?n+1:r.getTime()>=l.getTime()?n:n-1}function ed(e){const t=ze(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 Gn(e,...t){const r=pt.bind(null,e||t.find(n=>typeof n=="object"));return t.map(r)}function Ci(e,t){const r=ze(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function Eu(e,t,r){const[n,s]=Gn(r==null?void 0:r.in,e,t),i=Ci(n),o=Ci(s),l=+i-ed(i),c=+o-ed(o);return Math.round((l-c)/x5)}function b5(e,t){const r=X1(e,t),n=pt(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Qo(n)}function w5(e,t,r){return Ar(e,t*7,r)}function j5(e,t,r){return Wp(e,t*12,r)}function N5(e,t){let r,n=t==null?void 0:t.in;return e.forEach(s=>{!n&&typeof s=="object"&&(n=pt.bind(null,s));const i=ze(s,n);(!r||r<i||isNaN(+i))&&(r=i)}),pt(n,r||NaN)}function k5(e,t){let r,n=t==null?void 0:t.in;return e.forEach(s=>{!n&&typeof s=="object"&&(n=pt.bind(null,s));const i=ze(s,n);(!r||r>i||isNaN(+i))&&(r=i)}),pt(n,r||NaN)}function qc(e,t){const r=+ze(e)-+ze(t);return r<0?-1:r>0?1:r}function Up(e){return pt(e,Date.now())}function _i(e,t,r){const[n,s]=Gn(r==null?void 0:r.in,e,t);return+Ci(n)==+Ci(s)}function Q1(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function S5(e){return!(!Q1(e)&&typeof e!="number"||isNaN(+ze(e)))}function qp(e,t,r){const[n,s]=Gn(r==null?void 0:r.in,e,t),i=n.getFullYear()-s.getFullYear(),o=n.getMonth()-s.getMonth();return i*12+o}function Z1(e,t,r){const[n,s]=Gn(r==null?void 0:r.in,e,t),i=Iv(n,s),o=Math.abs(Eu(n,s));n.setDate(n.getDate()-i*o);const l=+(Iv(n,s)===-i),c=i*(o-l);return c===0?0:c}function Iv(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function J1(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function C5(e,t,r){const[n,s]=Gn(r==null?void 0:r.in,e,t),i=(+n-+s)/v5;return J1(r==null?void 0:r.roundingMethod)(i)}function _5(e,t){return+ze(e)-+ze(t)}function eN(e,t){const r=ze(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function Hp(e,t){const r=ze(e,t==null?void 0:t.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function O5(e,t){const r=ze(e,t==null?void 0:t.in);return+eN(r,t)==+Hp(r,t)}function tN(e,t,r){const[n,s,i]=Gn(r==null?void 0:r.in,e,e,t),o=qc(s,i),l=Math.abs(qp(s,i));if(l<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*l);let c=qc(s,i)===-o;O5(n)&&l===1&&qc(n,i)===1&&(c=!1);const d=o*(l-+c);return d===0?0:d}function P5(e,t,r){const n=_5(e,t)/1e3;return J1(r==null?void 0:r.roundingMethod)(n)}function rN(e,t){const[r,n]=Gn(e,t.start,t.end);return{start:r,end:n}}function M5(e,t){const{start:r,end:n}=rN(t==null?void 0:t.in,e);let s=+r>+n;const i=s?+r:+n,o=s?n:r;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(pt(r,o)),o.setMonth(o.getMonth()+l);return s?c.reverse():c}function nN(e,t){const r=ze(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function A5(e,t){const r=ze(e,t==null?void 0:t.in),n=r.getFullYear();return r.setFullYear(n+1,0,0),r.setHours(23,59,59,999),r}function aN(e,t){const r=ze(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function E5(e,t){const{start:r,end:n}=rN(t==null?void 0:t.in,e);let s=+r>+n;const i=s?+r:+n,o=s?n:r;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(pt(r,o)),o.setFullYear(o.getFullYear()+l);return s?c.reverse():c}function sN(e,t){var l,c,d,u;const r=Zi(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=ze(e,t==null?void 0:t.in),i=s.getDay(),o=(i<n?-7:0)+6-(i-n);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function D5(e,t){return sN(e,{...t,weekStartsOn:1})}const T5={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},I5=(e,t,r)=>{let n;const s=T5[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function sm(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const R5={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$5={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z5={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},L5={date:sm({formats:R5,defaultWidth:"full"}),time:sm({formats:$5,defaultWidth:"full"}),dateTime:sm({formats:z5,defaultWidth:"full"})},F5={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},B5=(e,t,r,n)=>F5[e];function wo(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;s=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const W5={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},U5={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},q5={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"]},H5={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"]},K5={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"}},Y5={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"}},G5=(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"},V5={ordinalNumber:G5,era:wo({values:W5,defaultWidth:"wide"}),quarter:wo({values:U5,defaultWidth:"wide",argumentCallback:e=>e-1}),month:wo({values:q5,defaultWidth:"wide"}),day:wo({values:H5,defaultWidth:"wide"}),dayPeriod:wo({values:K5,defaultWidth:"wide",formattingValues:Y5,defaultFormattingWidth:"wide"})};function jo(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?Q5(l,f=>f.test(o)):X5(l,f=>f.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const u=t.slice(o.length);return{value:d,rest:u}}}function X5(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function Q5(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Z5(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=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 l=t.slice(s.length);return{value:o,rest:l}}}const J5=/^(\d+)(th|st|nd|rd)?/i,e3=/\d+/i,t3={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},r3={any:[/^b/i,/^(a|c)/i]},n3={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},a3={any:[/1/i,/2/i,/3/i,/4/i]},s3={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},i3={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]},o3={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},l3={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]},c3={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},d3={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}},u3={ordinalNumber:Z5({matchPattern:J5,parsePattern:e3,valueCallback:e=>parseInt(e,10)}),era:jo({matchPatterns:t3,defaultMatchWidth:"wide",parsePatterns:r3,defaultParseWidth:"any"}),quarter:jo({matchPatterns:n3,defaultMatchWidth:"wide",parsePatterns:a3,defaultParseWidth:"any",valueCallback:e=>e+1}),month:jo({matchPatterns:s3,defaultMatchWidth:"wide",parsePatterns:i3,defaultParseWidth:"any"}),day:jo({matchPatterns:o3,defaultMatchWidth:"wide",parsePatterns:l3,defaultParseWidth:"any"}),dayPeriod:jo({matchPatterns:c3,defaultMatchWidth:"any",parsePatterns:d3,defaultParseWidth:"any"})},ys={code:"en-US",formatDistance:I5,formatLong:L5,formatRelative:B5,localize:V5,match:u3,options:{weekStartsOn:0,firstWeekContainsDate:1}};function f3(e,t){const r=ze(e,t==null?void 0:t.in);return Eu(r,aN(r))+1}function Kp(e,t){const r=ze(e,t==null?void 0:t.in),n=+Qo(r)-+b5(r);return Math.round(n/V1)+1}function iN(e,t){var u,f,m,h;const r=ze(e,t==null?void 0:t.in),n=r.getFullYear(),s=Zi(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((h=(m=s.locale)==null?void 0:m.options)==null?void 0:h.firstWeekContainsDate)??1,o=pt((t==null?void 0:t.in)||e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=Si(o,t),c=pt((t==null?void 0:t.in)||e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const d=Si(c,t);return+r>=+l?n+1:+r>=+d?n:n-1}function m3(e,t){var l,c,d,u;const r=Zi(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=iN(e,t),i=pt((t==null?void 0:t.in)||e,0);return i.setFullYear(s,0,n),i.setHours(0,0,0,0),Si(i,t)}function Yp(e,t){const r=ze(e,t==null?void 0:t.in),n=+Si(r,t)-+m3(r,t);return Math.round(n/V1)+1}function Ge(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const za={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Ge(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Ge(r+1,2)},d(e,t){return Ge(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 Ge(e.getHours()%12||12,t.length)},H(e,t){return Ge(e.getHours(),t.length)},m(e,t){return Ge(e.getMinutes(),t.length)},s(e,t){return Ge(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return Ge(s,t.length)}},si={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Rv={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(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return za.y(e,t)},Y:function(e,t,r,n){const s=iN(e,n),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return Ge(o,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):Ge(i,t.length)},R:function(e,t){const r=X1(e);return Ge(r,t.length)},u:function(e,t){const r=e.getFullYear();return Ge(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 Ge(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 Ge(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 za.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 Ge(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 s=Yp(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):Ge(s,t.length)},I:function(e,t,r){const n=Kp(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Ge(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):za.d(e,t)},D:function(e,t,r){const n=f3(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Ge(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 s=e.getDay(),i=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Ge(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),i=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Ge(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return Ge(s,t.length);case"io":return r.ordinalNumber(s,{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 s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=si.noon:n===0?s=si.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=si.evening:n>=12?s=si.afternoon:n>=4?s=si.morning:s=si.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{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 za.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):za.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Ge(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Ge(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):za.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):za.s(e,t)},S:function(e,t){return za.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return zv(n);case"XXXX":case"XX":return ms(n);case"XXXXX":case"XXX":default:return ms(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return zv(n);case"xxxx":case"xx":return ms(n);case"xxxxx":case"xxx":default:return ms(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+$v(n,":");case"OOOO":default:return"GMT"+ms(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+$v(n,":");case"zzzz":default:return"GMT"+ms(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return Ge(n,t.length)},T:function(e,t,r){return Ge(+e,t.length)}};function $v(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),i=n%60;return i===0?r+String(s):r+String(s)+t+Ge(i,2)}function zv(e,t){return e%60===0?(e>0?"-":"+")+Ge(Math.abs(e)/60,2):ms(e,t)}function ms(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Ge(Math.trunc(n/60),2),i=Ge(n%60,2);return r+s+t+i}const Lv=(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"})}},oN=(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"})}},h3=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return Lv(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}}",Lv(n,t)).replace("{{time}}",oN(s,t))},p3={p:oN,P:h3},g3=/^D+$/,x3=/^Y+$/,v3=["D","DD","YY","YYYY"];function y3(e){return g3.test(e)}function b3(e){return x3.test(e)}function w3(e,t,r){const n=j3(e,t,r);if(console.warn(n),v3.includes(e))throw new RangeError(n)}function j3(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 N3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,k3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,S3=/^'([^]*?)'?$/,C3=/''/g,_3=/[a-zA-Z]/;function ue(e,t,r){var u,f,m,h,g,x,v,y;const n=Zi(),s=(r==null?void 0:r.locale)??n.locale??ys,i=(r==null?void 0:r.firstWeekContainsDate)??((f=(u=r==null?void 0:r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(m=n.locale)==null?void 0:m.options)==null?void 0:h.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((x=(g=r==null?void 0:r.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??n.weekStartsOn??((y=(v=n.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??0,l=ze(e,r==null?void 0:r.in);if(!S5(l))throw new RangeError("Invalid time value");let c=t.match(k3).map(j=>{const b=j[0];if(b==="p"||b==="P"){const N=p3[b];return N(j,s.formatLong)}return j}).join("").match(N3).map(j=>{if(j==="''")return{isToken:!1,value:"'"};const b=j[0];if(b==="'")return{isToken:!1,value:O3(j)};if(Rv[b])return{isToken:!0,value:j};if(b.match(_3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:j}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(j=>{if(!j.isToken)return j.value;const b=j.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&b3(b)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&y3(b))&&w3(b,t,String(e));const N=Rv[b[0]];return N(l,b,s.localize,d)}).join("")}function O3(e){const t=e.match(S3);return t?t[1].replace(C3,"'"):e}function ah(e,t,r){const n=Zi(),s=(r==null?void 0:r.locale)??n.locale??ys,i=2520,o=qc(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:o}),[c,d]=Gn(r==null?void 0:r.in,...o>0?[t,e]:[e,t]),u=P5(d,c),f=(ed(d)-ed(c))/1e3,m=Math.round((u-f)/60);let h;if(m<2)return r!=null&&r.includeSeconds?u<5?s.formatDistance("lessThanXSeconds",5,l):u<10?s.formatDistance("lessThanXSeconds",10,l):u<20?s.formatDistance("lessThanXSeconds",20,l):u<40?s.formatDistance("halfAMinute",0,l):u<60?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",1,l):m===0?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",m,l);if(m<45)return s.formatDistance("xMinutes",m,l);if(m<90)return s.formatDistance("aboutXHours",1,l);if(m<Dv){const g=Math.round(m/60);return s.formatDistance("aboutXHours",g,l)}else{if(m<i)return s.formatDistance("xDays",1,l);if(m<vc){const g=Math.round(m/Dv);return s.formatDistance("xDays",g,l)}else if(m<vc*2)return h=Math.round(m/vc),s.formatDistance("aboutXMonths",h,l)}if(h=tN(d,c),h<12){const g=Math.round(m/vc);return s.formatDistance("xMonths",g,l)}else{const g=h%12,x=Math.trunc(h/12);return g<3?s.formatDistance("aboutXYears",x,l):g<9?s.formatDistance("overXYears",x,l):s.formatDistance("almostXYears",x+1,l)}}function P3(e,t){return ah(e,Up(e),t)}function Ko(e,t){return ze(e,t==null?void 0:t.in).getDate()}function M3(e,t){return ze(e,t==null?void 0:t.in).getDay()}function Za(e,t){const r=ze(e,t==null?void 0:t.in),n=r.getFullYear(),s=r.getMonth(),i=pt(r,0);return i.setFullYear(n,s+1,0),i.setHours(0,0,0,0),i.getDate()}function Hc(e,t){return ze(e,t==null?void 0:t.in).getMonth()}function A3(e,t){return ze(e,t==null?void 0:t.in).getFullYear()}function E3(e,t){return+ze(e)>+ze(t)}function D3(e,t){return+ze(e)<+ze(t)}function T3(e,t,r){const[n,s]=Gn(r==null?void 0:r.in,e,t);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()}function I3(e,t,r){const[n,s]=Gn(r==null?void 0:r.in,e,t);return n.getFullYear()===s.getFullYear()}function R3(e,t){return _i(pt(e,e),Up(e))}function lN(e,t,r){return Ar(e,-1,r)}function $3(e,t){return _i(pt(e,e),lN(Up(e)))}function z3(e,t,r){const n=ze(e,r==null?void 0:r.in),s=n.getFullYear(),i=n.getDate(),o=pt(e,0);o.setFullYear(s,t,15),o.setHours(0,0,0,0);const l=Za(o);return n.setMonth(t,Math.min(i,l)),n}function L3(e,t,r){const n=ze(e,r==null?void 0:r.in);return isNaN(+n)?pt(e,NaN):(n.setFullYear(t),n)}function F3(){const[e,t]=p.useState(!1),[r,n]=p.useState(null),[s,i]=p.useState(""),[o,l]=p.useState("all"),{workspace:c}=qt(),{data:d,isLoading:u}=Gi(),f=_D(),m=kt(),h=(d??[]).filter(g=>(o==="all"||g.status===o)&&(!s||g.name.toLowerCase().includes(s.toLowerCase())||g.identifier.toLowerCase().includes(s.toLowerCase())));return a.jsxs("div",{className:"p-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("h1",{className:"text-base font-semibold",children:"Projects"}),a.jsxs(Z,{size:"sm",onClick:()=>t(!0),children:[a.jsx(it,{className:"h-4 w-4"}),"Create"]})]}),a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("div",{className:"flex items-center gap-1",children:["all","active","paused","archived"].map(g=>a.jsx("button",{onClick:()=>l(g),className:T("px-3 h-7 rounded-md text-xs font-medium transition-colors",o===g?"bg-foreground text-background":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:g==="all"?"All":g.charAt(0).toUpperCase()+g.slice(1)},g))}),a.jsxs("div",{className:"relative",children:[a.jsx(Ol,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Ee,{placeholder:"Search...",value:s,onChange:g=>i(g.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),a.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-2.5 border-b border-border",children:[a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Project"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Identifier"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Created"}),a.jsx("span",{})]}),u?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(g=>a.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3",children:[a.jsx(le,{className:"h-4 w-48"}),a.jsx(le,{className:"h-4 w-12"}),a.jsx(le,{className:"h-5 w-16 rounded-full"}),a.jsx(le,{className:"h-4 w-24"}),a.jsx("div",{})]},g))}):h.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Er,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:s||o!=="all"?"No projects match":"No projects yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s||o!=="all"?"Try adjusting your filters.":"Create your first project to get started."}),!s&&o==="all"&&a.jsxs(Z,{size:"sm",onClick:()=>t(!0),children:[a.jsx(it,{className:"h-4 w-4"}),"Create project"]})]}):a.jsx("div",{className:"divide-y divide-border",children:h.map(g=>a.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3 hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors group",onClick:()=>m(`/${c}/projects/${g.identifier}/board`),children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:g.name}),g.description&&a.jsx("span",{className:"text-xs text-muted-foreground truncate hidden xl:block",children:g.description})]}),a.jsx("span",{className:"text-sm text-muted-foreground font-mono",children:g.identifier}),a.jsx("div",{children:a.jsxs("span",{className:T("inline-flex items-center gap-1.5 text-xs",g.status==="active"&&"text-emerald-600",g.status==="paused"&&"text-amber-600",g.status==="archived"&&"text-muted-foreground"),children:[a.jsx("span",{className:T("h-1.5 w-1.5 rounded-full shrink-0",g.status==="active"&&"bg-emerald-500",g.status==="paused"&&"bg-amber-500",g.status==="archived"&&"bg-zinc-400")}),g.status.charAt(0).toUpperCase()+g.status.slice(1)]})}),a.jsx("span",{className:"text-sm text-muted-foreground",children:ue(new Date(g.created_at),"MMM d, yyyy")}),a.jsx("div",{className:"flex justify-end",onClick:x=>x.stopPropagation(),children:a.jsxs(ln,{children:[a.jsx(cn,{asChild:!0,children:a.jsx(Z,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(Ys,{className:"h-4 w-4"})})}),a.jsxs(Kr,{align:"end",children:[a.jsxs(ht,{onClick:()=>m(`/${c}/projects/${g.identifier}/board`),children:[a.jsx(Er,{className:"h-4 w-4"}),"Open board"]}),a.jsxs(ht,{onClick:()=>m(`/${c}/projects/${g.identifier}/issues`),children:[a.jsx(ua,{className:"h-4 w-4"}),"View issues"]}),a.jsxs(ht,{onClick:()=>n({id:g.id,name:g.name}),children:[a.jsx(qi,{className:"h-4 w-4"}),"Manage access"]}),a.jsx(Bn,{}),a.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:()=>{confirm(`Delete "${g.name}"? This cannot be undone.`)&&f.mutate(g.id,{onSuccess:()=>z.success("Project deleted"),onError:()=>z.error("Failed to delete project")})},children:[a.jsx(Hr,{className:"h-4 w-4"}),"Delete"]})]})]})})]},g.id))}),!u&&h.length>0&&a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:["1 — ",h.length," of ",h.length," result",h.length!==1?"s":""]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a.jsx("span",{children:"1 of 1 pages"}),a.jsx(Z,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Prev"}),a.jsx(Z,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Next"})]})]})]}),a.jsx(m5,{open:e,onClose:()=>t(!1)}),r&&a.jsx(g5,{open:!!r,onClose:()=>n(null),projectId:r.id,projectName:r.name})]})}const Rl={byProject:e=>["projects",e,"statuses"]};function Ji(e){return Le({queryKey:Rl.byProject(e??""),queryFn:()=>te.get(`/admin/projects/${e}/statuses`),select:t=>t.statuses,enabled:!!e})}function B3(e){const t=Ne();return we({mutationFn:r=>te.post(`/admin/projects/${e}/statuses`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Rl.byProject(e)})}})}function W3(e,t){const r=Ne();return we({mutationFn:n=>te.put(`/admin/projects/${e}/statuses/${t}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:Rl.byProject(e)})}})}function U3(e){const t=Ne();return we({mutationFn:r=>te.delete(`/admin/projects/${e}/statuses/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Rl.byProject(e)})}})}function q3(e){const t=Ne();return we({mutationFn:r=>te.post(`/admin/projects/${e}/statuses/reorder`,{orderedIds:r}),onSuccess:()=>{t.invalidateQueries({queryKey:Rl.byProject(e)})}})}const Gp={all:["users"],list:()=>[...Gp.all,"list"]};function Du(){return Le({queryKey:Gp.list(),queryFn:()=>te.get("/admin/users"),select:e=>e.users,staleTime:1e3*60*5})}function Js(){return Le({queryKey:[...Gp.list(),"map"],queryFn:()=>te.get("/admin/users"),select:e=>new Map(e.users.map(t=>{var o;const r=t.first_name??"",n=t.last_name??"",s=`${r} ${n}`.trim()||t.email,i=(r[0]??n[0]??((o=t.email)==null?void 0:o[0])??"U").toUpperCase();return[t.id,{name:s,initials:i}]})),staleTime:1e3*60*5})}const $s={backlog:"Backlog",todo:"Todo",in_progress:"In Progress",in_review:"In Review",done:"Done",cancelled:"Cancelled"},wn={urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"None"},Vp={urgent:"text-red-500",high:"text-orange-500",medium:"text-yellow-500",low:"text-blue-400",none:"text-zinc-400"},Ja={task:"Task",bug:"Bug",feature:"Feature",improvement:"Improvement",epic:"Epic"},H3=({priority:e})=>{const t=T("h-3 w-3 shrink-0",Vp[e]);switch(e){case"urgent":return a.jsx(ns,{className:t});case"high":return a.jsx(Cl,{className:t});case"medium":return a.jsx(Hi,{className:t});case"low":return a.jsx(Sl,{className:t});default:return a.jsx(rn,{className:"h-3 w-3 shrink-0 text-zinc-300"})}};function cN({issue:e,childCount:t=0,onClick:r}){var f,m;const{data:n}=Js(),{attributes:s,listeners:i,setNodeRef:o,transform:l,transition:c,isDragging:d}=bp({id:e.id}),u={transform:wp.Transform.toString(l),transition:c};return a.jsxs("div",{ref:o,style:u,...s,...i,onClick:r,className:T("bg-white dark:bg-card border border-border rounded-lg px-3 py-2.5 cursor-pointer select-none","hover:border-zinc-300 dark:hover:border-zinc-600 transition-colors",d&&"opacity-40 shadow-lg ring-2 ring-indigo/30"),children:[a.jsx("p",{className:"text-[13px] text-foreground leading-snug line-clamp-2 mb-2",children:e.title}),a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("span",{className:"text-[11px] font-mono text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:e.identifier}),e.parent_id&&a.jsx("span",{className:"flex items-center text-zinc-400 dark:text-zinc-500 shrink-0",title:"Child issue",children:a.jsx(yn,{className:"h-3 w-3"})}),t>0&&a.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:[a.jsx(yn,{className:"h-2.5 w-2.5"}),t]})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[(e.assignee_ids??[]).length>0&&a.jsxs("div",{className:"flex -space-x-1",children:[(e.assignee_ids??[]).slice(0,2).map(h=>{const g=n==null?void 0:n.get(h);return a.jsx(Bt,{className:"h-4 w-4 border border-background",children:a.jsx(Wt,{className:"text-[8px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:(g==null?void 0:g.initials)??"?"})},h)}),(((f=e.assignee_ids)==null?void 0:f.length)??0)>2&&a.jsxs("span",{className:"text-[9px] text-muted-foreground ml-1.5 self-center",children:["+",(((m=e.assignee_ids)==null?void 0:m.length)??0)-2]})]}),a.jsx(H3,{priority:e.priority})]})]})]})}function yc(e,t){const r=e.replace("#",""),n=parseInt(r.substring(0,2),16),s=parseInt(r.substring(2,4),16),i=parseInt(r.substring(4,6),16);return isNaN(n)||isNaN(s)||isNaN(i)?`rgba(148,163,184,${t})`:`rgba(${n},${s},${i},${t})`}const K3=({category:e,color:t})=>{const r="h-3.5 w-3.5 shrink-0",n={color:t};switch(e){case"completed":return a.jsx(rs,{className:r,style:n});case"started":return a.jsx(Yn,{className:r,style:n});default:return a.jsx(rn,{className:r,style:n})}};function Y3({id:e,label:t,color:r,category:n,issues:s,childCounts:i,sortable:o,onIssueClick:l,onRename:c,onDelete:d,isRenaming:u,renameValue:f,onRenameChange:m,onRenameSubmit:h,onRenameCancel:g}){const{setNodeRef:x,isOver:v}=wM({id:e}),{attributes:y,listeners:j,setNodeRef:b,transform:N,transition:k,isDragging:w}=bp({id:e,disabled:!o}),S=p.useRef(null),C=p.useRef(!1);p.useEffect(()=>{u&&(C.current=!1,setTimeout(()=>{var O;return(O=S.current)==null?void 0:O.focus()},0))},[u]);const P=o?{transform:wp.Transform.toString(N),transition:k}:void 0,M=yc(r,.08),A=yc(r,.16),_=yc(r,.35),D=!!(c||d);return a.jsxs("div",{ref:b,style:P,className:T("flex flex-col min-w-[260px] max-w-[280px] w-full group/col",w&&"opacity-50"),children:[a.jsxs("div",{className:T("flex items-center gap-2 mb-2 px-1",o&&"cursor-grab"),children:[o&&a.jsx("span",{...y,...j,className:"text-muted-foreground/40 hover:text-muted-foreground touch-none",children:a.jsx(i1,{className:"h-3.5 w-3.5"})}),a.jsx(K3,{category:n,color:r}),u?a.jsx("input",{ref:S,value:f??"",onChange:O=>m==null?void 0:m(O.target.value),onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),h==null||h()),O.key==="Escape"&&(O.preventDefault(),C.current=!0,g==null||g())},onBlur:()=>{C.current||h==null||h()},className:"flex-1 text-xs font-medium bg-transparent border-b border-foreground/30 outline-none py-0.5 min-w-0"}):a.jsx("span",{className:"text-xs font-medium text-foreground",children:t}),a.jsx("span",{className:"ml-1 text-[11px] font-medium rounded-full px-1.5 py-0.5 tabular-nums min-w-[18px] text-center",style:{backgroundColor:yc(r,.12),color:r},children:s.length}),D&&!u&&a.jsxs(ln,{children:[a.jsx(cn,{asChild:!0,children:a.jsx("button",{className:"ml-auto h-5 w-5 flex items-center justify-center rounded opacity-0 group-hover/col:opacity-100 hover:bg-muted transition-opacity text-muted-foreground hover:text-foreground",onClick:O=>O.stopPropagation(),children:a.jsx(Ys,{className:"h-3.5 w-3.5"})})}),a.jsxs(Kr,{align:"end",className:"w-40",children:[c&&a.jsx(ht,{onClick:c,children:"Rename"}),c&&d&&a.jsx(Bn,{}),d&&a.jsx(ht,{className:"text-destructive focus:text-destructive",onClick:d,children:"Delete status"})]})]})]}),a.jsxs("div",{ref:x,className:T("flex-1 flex flex-col gap-2 min-h-[200px] p-2 rounded-xl transition-colors"),style:{backgroundColor:v?A:M,boxShadow:v?`inset 0 0 0 1px ${_}`:void 0},children:[a.jsx(yp,{items:s.map(O=>O.id),strategy:jM,children:s.map(O=>a.jsx(cN,{issue:O,childCount:(i==null?void 0:i.get(O.id))??0,onClick:()=>l==null?void 0:l(O)},O.id))}),s.length===0&&a.jsx("div",{className:"flex-1 flex items-center justify-center min-h-[120px]",children:a.jsx("p",{className:"text-xs text-muted-foreground/40",children:"Drop here"})})]})]})}const im=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"],G3=[{value:"backlog",label:"Backlog"},{value:"unstarted",label:"Not Started"},{value:"started",label:"In Progress"},{value:"completed",label:"Done"},{value:"cancelled",label:"Cancelled"}];function V3({open:e,onClose:t,projectId:r}){const[n,s]=p.useState(""),[i,o]=p.useState(im[0]),[l,c]=p.useState(""),[d,u]=p.useState("started"),f=B3(r),m=l||i,h=()=>{n.trim()&&f.mutate({name:n.trim(),color:m,category:d},{onSuccess:()=>{z.success("Status created"),s(""),o(im[0]),c(""),u("started"),t()},onError:()=>z.error("Failed to create status")})};return a.jsx(Qs,{open:e,onOpenChange:g=>!g&&t(),children:a.jsxs(Zs,{className:"sm:max-w-sm",children:[a.jsx(Vi,{children:a.jsx(Qi,{className:"text-sm font-medium",children:"New Status"})}),a.jsx(Xi,{children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Name"}),a.jsx(Ee,{placeholder:"e.g. In Review",value:n,onChange:g=>s(g.target.value),onKeyDown:g=>g.key==="Enter"&&h(),autoFocus:!0,className:"h-8 text-sm"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Color"}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[im.map(g=>a.jsx("button",{onClick:()=>{o(g),c("")},className:T("h-6 w-6 rounded-full border-2 transition-transform hover:scale-110",i===g&&!l?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:g}},g)),a.jsxs("div",{className:"flex items-center gap-1.5 ml-1",children:[a.jsx("div",{className:"h-6 w-6 rounded-full border border-border shrink-0",style:{backgroundColor:l||"#e5e7eb"}}),a.jsx(Ee,{placeholder:"#hex",value:l,onChange:g=>c(g.target.value),className:"h-6 w-20 text-xs px-1.5"})]})]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Category"}),a.jsxs(Fe,{value:d,onValueChange:g=>u(g),children:[a.jsx(Re,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx($e,{children:G3.map(g=>a.jsx(be,{value:g.value,className:"text-xs",children:g.label},g.value))})]})]})]})}),a.jsxs(Il,{className:"mt-2",children:[a.jsx(Z,{variant:"ghost",size:"sm",onClick:t,className:"text-xs",children:"Cancel"}),a.jsx(Z,{size:"sm",onClick:h,disabled:!n.trim()||f.isPending,className:"text-xs",children:"Create"})]})]})})}function X3({projectId:e}){const[t,r]=p.useState(!1);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex flex-col min-w-[260px] max-w-[280px] w-full",children:a.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-2 px-3 py-2 rounded-xl border border-dashed border-border text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted/30 transition-colors text-xs font-medium h-9",children:[a.jsx(it,{className:"h-3.5 w-3.5"}),"Add status"]})}),a.jsx(V3,{open:t,onClose:()=>r(!1),projectId:e})]})}function Q3({open:e,statusName:t,issueCount:r,otherStatuses:n,onConfirm:s,onCancel:i,isLoading:o}){const[l,c]=p.useState(""),d=()=>{r>0&&!l||s(r>0?l:null)};return a.jsx(Gs,{open:e,onOpenChange:u=>{u||i()},children:a.jsxs(as,{className:"sm:max-w-md",children:[a.jsxs(Vs,{children:[a.jsx(Xs,{children:"Delete status"}),a.jsx(El,{children:r>0?`${r} issue${r!==1?"s":""} in "${t}" will be moved to another status.`:`Delete the "${t}" status. This cannot be undone.`})]}),r>0&&a.jsxs("div",{className:"py-2",children:[a.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Move issues to"}),a.jsxs(Fe,{value:l,onValueChange:c,children:[a.jsx(Re,{children:a.jsx(Ye,{placeholder:"Select a status..."})}),a.jsx($e,{children:n.map(u=>a.jsx(be,{value:u.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:u.color}}),u.name]})},u.id))})]})]}),a.jsxs(C1,{children:[a.jsx(Z,{variant:"outline",onClick:i,disabled:o,children:"Cancel"}),a.jsx(Z,{variant:"destructive",onClick:d,disabled:r>0&&!l||o,children:o?"Deleting…":"Delete status"})]})]})})}function om(e,t){var n;const r={};for(const s of t)r[s.key]=[];for(const s of e)if(r[s.status]!==void 0)r[s.status].push(s);else{const i=((n=t[0])==null?void 0:n.key)??"backlog";r[i]=[...r[i]??[],s]}return r}function Z3(e,t,r){var i;const n=new Map(t.map(o=>[o.id,o])),s={};for(const o of r)s[o.key]=[];for(const o of r)for(const l of e[o.key]??[]){const c=n.get(l.id);c&&c.status===o.key&&(s[o.key].push(c),n.delete(l.id))}for(const o of n.values()){const l=s[o.status];if(l)l.push(o);else{const c=(i=r[0])==null?void 0:i.key;c&&s[c].push(o)}}return s}function dN({issues:e,projectId:t,statuses:r,onIssueClick:n,onColumnsReorder:s,readOnly:i=!1,filters:o}){var X;const[l,c]=p.useState(()=>r.map($=>$.id)),[d,u]=p.useState(()=>om(e,r)),[f,m]=p.useState(null),[h,g]=p.useState(null),[x,v]=p.useState(null),[y,j]=p.useState(null),[b,N]=p.useState(""),k=p.useRef(null),w=p.useRef(!1),S=Ne(),C=At.byProject(t,o),P=U3(t),M=W3(t,y??""),A=p.useMemo(()=>{const $=new Map;for(const K of e)K.parent_id&&$.set(K.parent_id,($.get(K.parent_id)??0)+1);return $},[e]);p.useEffect(()=>{c($=>{const K=new Set(r.map(se=>se.id)),V=$.filter(se=>K.has(se)),L=r.map(se=>se.id).filter(se=>!$.includes(se));return V.length===$.length&&L.length===0?$:[...V,...L]})},[r]),p.useEffect(()=>{w.current||u($=>Z3($,e,r))},[e,r]);const _=[...r].sort(($,K)=>{const V=l.indexOf($.id),L=l.indexOf(K.id);return V===-1&&L===-1?$.position-K.position:V===-1?1:L===-1?-1:V-L}),D=Cj(vp(_j,i?{activationConstraint:{distance:1/0}}:{activationConstraint:{distance:5}})),O=p.useCallback($=>{if(h){const K=$.droppableContainers.filter(V=>l.includes(V.id));return NM({...$,droppableContainers:K})}return kM($)},[h,l]),R=p.useCallback($=>{for(const[K,V]of Object.entries(d))if(V.some(L=>L.id===$))return K;return null},[d]),F=p.useCallback($=>r.some(K=>K.id===$),[r]),H=$=>{const K=$.active.id;if(w.current=!0,F(K)){g(K);return}for(const[V,L]of Object.entries(d)){const se=L.find(he=>he.id===K);if(se){m(se),k.current=V;return}}},ne=$=>{const{active:K,over:V}=$;if(!V||h)return;const L=K.id,se=V.id;if(F(L))return;const he=R(L),Q=r.find(re=>re.key===se||re.id===se),Pe=(Q==null?void 0:Q.key)??R(se);!he||!Pe||he===Pe||u(re=>{const Oe=[...re[he]??[]],Ce=[...re[Pe]??[]],q=Oe.findIndex(We=>We.id===L);if(q===-1)return re;const[ve]=Oe.splice(q,1),Me={...ve,status:Pe};if(Q)Ce.push(Me);else{const We=Ce.findIndex(Ue=>Ue.id===se);if(We===-1)Ce.push(Me);else{const Ue=K.rect.current.translated!=null&&K.rect.current.translated.top>V.rect.top+V.rect.height/2;Ce.splice(Ue?We+1:We,0,Me)}}return{...re,[he]:Oe,[Pe]:Ce}})},G=$=>{var re;const{active:K,over:V}=$;if(m(null),w.current=!1,h){if(g(null),!V||K.id===V.id)return;const Oe=l.indexOf(K.id),Ce=l.indexOf(V.id);if(Oe===-1||Ce===-1||Oe===Ce)return;const q=Uc(l,Oe,Ce);c(q),s==null||s(q);return}if(!V){const Oe=k.current;k.current=null,Oe&&u(om(e,r));return}const L=K.id,se=V.id,he=k.current;k.current=null;const Q=r.find(Oe=>Oe.key===se||Oe.id===se),Pe=(Q==null?void 0:Q.key)??R(se);if(!(!he||!Pe))if(he===Pe)u(Oe=>{const Ce=Oe[he]??[],q=Ce.findIndex(Me=>Me.id===L),ve=Ce.findIndex(Me=>Me.id===se);return q===-1||ve===-1||q===ve?Oe:{...Oe,[he]:Uc(Ce,q,ve)}});else{if(!r.find(q=>q.key===se||q.id===se))u(q=>{const ve=[...q[Pe]??[]],Me=ve.findIndex(ur=>ur.id===L);if(Me===-1)return q;const We=$.active.rect.current.translated!=null&&$.active.rect.current.translated.top>$.over.rect.top+$.over.rect.height/2,[Ue]=ve.splice(Me,1),Ct=ve.findIndex(ur=>ur.id===se);if(Ct===-1)return ve.splice(Me,0,Ue),q;const _t=We?Ct+1:Ct;return ve.splice(_t,0,Ue),{...q,[Pe]:ve}});else{const q=((re=$.active.rect.current.translated)==null?void 0:re.top)??1/0,ve=$.over.rect.top+$.over.rect.height/2;q<ve&&u(Me=>{const We=Me[Pe]??[],Ue=We.findIndex(Ct=>Ct.id===L);return Ue<=0?Me:{...Me,[Pe]:Uc(We,Ue,0)}})}const Ce=S.getQueryData(C);S.setQueryData(C,q=>q&&{...q,issues:q.issues.map(ve=>ve.id===L?{...ve,status:Pe}:ve)}),te.put(`/admin/issues/${L}`,{status:Pe}).then(()=>{S.invalidateQueries({queryKey:C})}).catch(()=>{Ce&&S.setQueryData(C,Ce),u(om((Ce==null?void 0:Ce.issues)??e,r)),z.error("Failed to update issue status")})}},oe=$=>{v($)},ce=async $=>{if(!x)return;const K=d[x.key]??[];if(K.length>0){const V=r.find(L=>L.id===$);if(!V)return;try{await Promise.all(K.map(L=>te.put(`/admin/issues/${L.id}`,{status:V.key}))),S.invalidateQueries({queryKey:At.byProject(t)})}catch{z.error("Failed to move issues");return}}P.mutate(x.id,{onSuccess:()=>{z.success(`Status "${x.name}" deleted`),v(null)},onError:()=>z.error("Failed to delete status")})},B=()=>{const $=b.trim();!$||!y||M.mutate({name:$},{onSuccess:()=>{z.success("Status renamed"),j(null)},onError:()=>z.error("Failed to rename status")})},Y=()=>{j(null)},U=h?r.find($=>$.id===h):null;return a.jsxs(Ho,{sensors:D,collisionDetection:O,onDragStart:H,onDragOver:ne,onDragEnd:G,children:[a.jsxs("div",{className:"flex gap-4 min-h-full overflow-x-auto px-6 py-4 pb-6",children:[a.jsx(yp,{items:l,strategy:Oj,children:_.map($=>a.jsx(Y3,{id:$.id,label:$.name,color:$.color,category:$.category,issues:d[$.key]??[],childCounts:A,sortable:!0,onIssueClick:n,onRename:i?void 0:()=>{j($.id),N($.name)},onDelete:i?void 0:()=>oe($),isRenaming:y===$.id,renameValue:y===$.id?b:"",onRenameChange:N,onRenameSubmit:B,onRenameCancel:Y},$.id))}),!i&&a.jsx(X3,{projectId:t})]}),a.jsxs(SM,{children:[f&&a.jsx(cN,{issue:f}),U&&a.jsx("div",{className:"opacity-80 min-w-[260px] max-w-[280px]",children:a.jsxs("div",{className:"h-9 flex items-center gap-2 px-3 rounded-xl border border-border bg-background text-xs font-medium text-foreground",children:[a.jsx("div",{className:"h-3 w-3 rounded-full shrink-0",style:{backgroundColor:U.color}}),U.name]})})]}),x&&a.jsx(Q3,{open:!!x,statusName:x.name,issueCount:((X=d[x.key])==null?void 0:X.length)??0,otherStatuses:r.filter($=>$.id!==x.id),onConfirm:ce,onCancel:()=>v(null),isLoading:P.isPending})]})}const jt=VP,Nt=XP,yt=p.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>a.jsx(GP,{children:a.jsx(bj,{ref:s,align:t,sideOffset:r,className:T("z-50 w-72 rounded-md border border-border bg-popover p-1 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})}));yt.displayName=bj.displayName;const J3=[{value:"urgent",label:"Urgent"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"},{value:"none",label:"None"}],eI=[{value:"bug",label:"Bug"},{value:"feature",label:"Feature"},{value:"task",label:"Task"},{value:"epic",label:"Epic"},{value:"story",label:"Story"}];function bc({label:e,activeCount:t,children:r}){const[n,s]=p.useState(!1);return a.jsxs(jt,{open:n,onOpenChange:s,children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{className:T("inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md border text-xs font-medium transition-colors",t>0?"border-foreground/30 bg-foreground/5 text-foreground":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"),children:[e,t>0&&a.jsx("span",{className:"flex items-center justify-center h-4 w-4 rounded-full bg-foreground text-background text-[10px] font-semibold",children:t}),a.jsx(Kn,{className:"h-3 w-3 opacity-60"})]})}),a.jsx(yt,{className:"w-48 p-1",align:"start",children:r})]})}function lm({options:e,selected:t,onToggle:r}){return a.jsx("div",{className:"flex flex-col gap-0.5",children:e.map(n=>{const s=t.includes(n.value);return a.jsxs("button",{onClick:()=>r(n.value),className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs hover:bg-muted w-full text-left",children:[a.jsx("div",{className:T("h-3.5 w-3.5 rounded border flex items-center justify-center shrink-0",s?"bg-foreground border-foreground":"border-border"),children:s&&a.jsx(lr,{className:"h-2.5 w-2.5 text-background"})}),n.color&&a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:n.color}}),a.jsx("span",{className:"truncate",children:n.label})]},n.value)})})}function tI({statuses:e,members:t,filters:r,onChange:n}){var c,d,u,f,m,h,g;const s=(((c=r.priority)==null?void 0:c.length)??0)>0||!!r.assignee_id||(((d=r.type)==null?void 0:d.length)??0)>0||(((u=r.status)==null?void 0:u.length)??0)>0,i=(x,v)=>{const y=r[x]??[],j=y.includes(v)?y.filter(b=>b!==v):[...y,v];n({...r,[x]:j.length?j:void 0})},o=x=>{n({...r,assignee_id:r.assignee_id===x?void 0:x})},l=r.assignee_id?((f=t.find(x=>x.userId===r.assignee_id))==null?void 0:f.name)??"Assignee":"Assignee";return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(bc,{label:r.assignee_id?l:"Assignee",activeCount:r.assignee_id?1:0,children:a.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground px-2 py-1.5",children:"No members"}),t.map(x=>{const v=r.assignee_id===x.userId;return a.jsxs("button",{onClick:()=>o(x.userId),className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs hover:bg-muted w-full text-left",children:[a.jsx("div",{className:T("h-3.5 w-3.5 rounded border flex items-center justify-center shrink-0",v?"bg-foreground border-foreground":"border-border"),children:v&&a.jsx(lr,{className:"h-2.5 w-2.5 text-background"})}),a.jsx("span",{className:"h-5 w-5 rounded-full bg-muted flex items-center justify-center text-[10px] font-medium shrink-0",children:x.initials}),a.jsx("span",{className:"truncate",children:x.name})]},x.userId)})]})}),a.jsx(bc,{label:"Priority",activeCount:((m=r.priority)==null?void 0:m.length)??0,children:a.jsx(lm,{options:J3,selected:r.priority??[],onToggle:x=>i("priority",x)})}),a.jsx(bc,{label:"Type",activeCount:((h=r.type)==null?void 0:h.length)??0,children:a.jsx(lm,{options:eI,selected:r.type??[],onToggle:x=>i("type",x)})}),a.jsx(bc,{label:"Status",activeCount:((g=r.status)==null?void 0:g.length)??0,children:a.jsx(lm,{options:e.map(x=>({value:x.key,label:x.name,color:x.color})),selected:r.status??[],onToggle:x=>i("status",x)})}),s&&a.jsxs("button",{onClick:()=>n({}),className:"inline-flex items-center gap-1 h-7 px-2 rounded text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[a.jsx(nt,{className:"h-3 w-3"}),"Clear"]})]})}const rI={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function Xp(){return Le({queryKey:["org","calendar"],queryFn:()=>te.get("/admin/org/calendar"),select:e=>({working_days:e.working_days??rI,timezone:e.timezone})})}function nI(){const e=Ne();return we({mutationFn:t=>te.put("/admin/org/calendar",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","calendar"]})}})}function Qp(e){const t=e??new Date().getFullYear();return Le({queryKey:["org","holidays",t],queryFn:()=>te.get(`/admin/org/holidays?year=${t}`),select:r=>r.holidays})}function aI(){const e=Ne();return we({mutationFn:t=>te.post("/admin/org/holidays",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function sI(){const e=Ne();return we({mutationFn:({id:t,...r})=>te.put(`/admin/org/holidays/${t}`,r),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function iI(){const e=Ne();return we({mutationFn:t=>te.delete(`/admin/org/holidays/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function oI(){return Le({queryKey:["app-config"],queryFn:()=>te.get("/admin/config"),staleTime:1/0})}const lI=["sun","mon","tue","wed","thu","fri","sat"];function cI(e,t,r){const n=lI[M3(e)];if(!t[n])return!1;const s=Hc(e),i=Ko(e);for(const o of r){const l=new Date(o.date);if(o.recurring){if(Hc(l)===s&&Ko(l)===i)return!1}else if(l.getFullYear()===e.getFullYear()&&Hc(l)===s&&Ko(l)===i)return!1}return!0}function uN(e,t,r,n){let s=0,i=new Date(e);i.setHours(0,0,0,0);const o=new Date(t);for(o.setHours(0,0,0,0);i<=o;)cI(i,r,n)&&s++,i=Ar(i,1);return s}const Oi={all:["sprints"],byProject:e=>["sprints","project",e],detail:e=>["sprints",e]};function eo(e){return Le({queryKey:e?Oi.byProject(e):Oi.all,queryFn:()=>{const t=e?`/admin/sprints?project_id=${e}`:"/admin/sprints";return te.get(t)},select:t=>t.sprints,enabled:!!e})}function dI(e){const t=Ne();return we({mutationFn:r=>te.post("/admin/sprints",{...r,project_id:e}),onSuccess:()=>{t.invalidateQueries({queryKey:Oi.byProject(e)})}})}function uI(e,t){const r=Ne();return we({mutationFn:n=>te.put(`/admin/sprints/${e}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:Oi.byProject(t)}),r.invalidateQueries({queryKey:Oi.detail(e)})}})}function fI(e){const t=Ne();return we({mutationFn:r=>te.delete(`/admin/sprints/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Oi.byProject(e)})}})}const Tu={byProject:e=>["task-lists","project",e]};function $l(e){return Le({queryKey:e?Tu.byProject(e):["task-lists"],queryFn:()=>te.get(`/admin/projects/${e}/task-lists`),select:t=>t.task_lists,enabled:!!e})}function mI(e){const t=Ne();return we({mutationFn:r=>te.post(`/admin/projects/${e}/task-lists`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Tu.byProject(e)})}})}function hI(e){const t=Ne();return we({mutationFn:({id:r,...n})=>te.put(`/admin/task-lists/${r}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Tu.byProject(e)})}})}function pI(e){const t=Ne();return we({mutationFn:r=>te.delete(`/admin/task-lists/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Tu.byProject(e)}),t.invalidateQueries({queryKey:At.byProject(e)})}})}function Fv(e,t,r){const n=(e==null?void 0:e[0])??"",s=(t==null?void 0:t[0])??"";return(n+s).toUpperCase()||((r==null?void 0:r[0])??"U").toUpperCase()}function Bv(e,t,r){return`${e??""} ${t??""}`.trim()||r}function zl({value:e,onChange:t,disabled:r}){const[n,s]=p.useState(!1),[i,o]=p.useState(e),{data:l}=Du(),c=e.slice().sort().join(",");p.useEffect(()=>{o(e)},[c]);const d=f=>{const m=i.includes(f)?i.filter(h=>h!==f):[...i,f];o(m),t(m)},u=(l??[]).filter(f=>i.includes(f.id));return a.jsxs(jt,{open:n,onOpenChange:s,children:[a.jsx(Nt,{asChild:!0,disabled:r,children:a.jsx("button",{type:"button",className:T("flex items-center gap-1 min-h-[28px] rounded-md px-1.5 py-1","hover:bg-accent transition-colors text-left","focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",r&&"pointer-events-none opacity-50"),children:u.length===0?a.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[a.jsx(Ki,{className:"h-3.5 w-3.5"}),"Assign"]}):a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"flex -space-x-1.5",children:u.slice(0,3).map(f=>a.jsx(Bt,{className:"h-5 w-5 border border-background ring-0",children:a.jsx(Wt,{className:"text-[9px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:Fv(f.first_name,f.last_name,f.email)})},f.id))}),u.length>3&&a.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",u.length-3]}),a.jsx("span",{className:"text-xs text-foreground ml-1 hidden sm:inline",children:u.length===1?Bv(u[0].first_name,u[0].last_name,u[0].email):`${u.length} assignees`})]})})}),a.jsx(yt,{className:"w-60 p-0",align:"start",children:a.jsxs(Os,{children:[a.jsx(Pu,{placeholder:"Search users...",className:"h-8 text-xs"}),a.jsxs(Ps,{children:[a.jsx(Mu,{className:"text-xs py-4",children:"No users found."}),a.jsx(Ka,{children:(l??[]).map(f=>{const m=i.includes(f.id),h=Bv(f.first_name,f.last_name,f.email),g=Fv(f.first_name,f.last_name,f.email);return a.jsxs(en,{value:h,onSelect:()=>d(f.id),className:"gap-2 py-1.5",children:[a.jsx(Bt,{className:"h-5 w-5 shrink-0",children:a.jsx(Wt,{className:"text-[9px] bg-muted text-muted-foreground",children:g})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-xs font-medium truncate",children:h}),a.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:f.email})]}),a.jsx(lr,{className:T("h-3.5 w-3.5 shrink-0",m?"opacity-100 text-indigo-500":"opacity-0")})]},f.id)})})]})]})})]})}function gI(e,t,r="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:r}).format(t).split(/\s/g).slice(2).join(" ")}const cm={},Lo={};function js(e,t){try{const n=(cm[e]||(cm[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return n in Lo?Lo[n]:Wv(n,n.split(":"))}catch{if(e in Lo)return Lo[e];const r=e==null?void 0:e.match(xI);return r?Wv(e,r.slice(1)):NaN}}const xI=/([+-]\d\d):?(\d\d)?/;function Wv(e,t){const r=+(t[0]||0),n=+(t[1]||0),s=+(t[2]||0)/60;return Lo[e]=r*60+n>0?r*60+n+s:r*60-n-s}class $n extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(js(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),fN(this),sh(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new $n(...r,t):new $n(Date.now(),t)}withTimeZone(t){return new $n(+this,t)}getTimezoneOffset(){const t=-js(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),sh(this),+this}[Symbol.for("constructDateFrom")](t){return new $n(+new Date(t),this.timeZone)}}const Uv=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Uv.test(e))return;const t=e.replace(Uv,"$1UTC");$n.prototype[t]&&(e.startsWith("get")?$n.prototype[e]=function(){return this.internal[t]()}:($n.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),vI(this),+this},$n.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),sh(this),+this}))});function sh(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-js(e.timeZone,e)*60))}function vI(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),fN(e)}function fN(e){const t=js(e.timeZone,e),r=t>0?Math.floor(t):Math.ceil(t),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const s=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),o=s-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=s-r;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const u=s>0?d.getSeconds():(d.getSeconds()-60)%60,f=Math.round(-(js(e.timeZone,e)*60))%60;(f||u)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+f),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+f+u));const m=js(e.timeZone,e),h=m>0?Math.floor(m):Math.ceil(m),x=-new Date(+e).getTimezoneOffset()-h,v=h!==r,y=x-c;if(v&&y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y);const j=js(e.timeZone,e),b=j>0?Math.floor(j):Math.ceil(j),N=h-b;N&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N))}}class ir extends $n{static tz(t,...r){return r.length?new ir(...r,t):new ir(Date.now(),t)}toISOString(){const[t,r,n]=this.tzComponents(),s=`${t}${r}:${n}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,r,n,s]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${n} ${r} ${s}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[r,n,s]=this.tzComponents();return`${t} GMT${r}${n}${s} (${gI(this.timeZone,this)})`}toLocaleString(t,r){return Date.prototype.toLocaleString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}toLocaleDateString(t,r){return Date.prototype.toLocaleDateString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}toLocaleTimeString(t,r){return Date.prototype.toLocaleTimeString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),r=t>0?"-":"+",n=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),s=String(Math.abs(t)%60).padStart(2,"0");return[r,n,s]}withTimeZone(t){return new ir(+this,t)}[Symbol.for("constructDateFrom")](t){return new ir(+new Date(t),this.timeZone)}}const qv=5,yI=4;function bI(e,t){const r=t.startOfMonth(e),n=r.getDay()>0?r.getDay():7,s=t.addDays(e,-n+1),i=t.addDays(s,qv*7-1);return t.getMonth(e)===t.getMonth(i)?qv:yI}function mN(e,t){const r=t.startOfMonth(e),n=r.getDay();return n===1?r:n===0?t.addDays(r,-1*6):t.addDays(r,-1*(n-1))}function wI(e,t){const r=mN(e,t),n=bI(e,t);return t.addDays(r,n*7-1)}const hN={...ys,labels:{labelDayButton:(e,t,r,n)=>{let s;n&&typeof n.format=="function"?s=n.format.bind(n):s=(o,l)=>ue(o,l,{locale:ys,...r});let i=s(e,"PPPP");return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,r)=>{let n;return r&&typeof r.format=="function"?n=r.format.bind(r):n=(s,i)=>ue(s,i,{locale:ys,...t}),n(e,"LLLL yyyy")},labelGridcell:(e,t,r,n)=>{let s;n&&typeof n.format=="function"?s=n.format.bind(n):s=(o,l)=>ue(o,l,{locale:ys,...r});let i=s(e,"PPPP");return t!=null&&t.today&&(i=`Today, ${i}`),i},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,r)=>{let n;return r&&typeof r.format=="function"?n=r.format.bind(r):n=(s,i)=>ue(s,i,{locale:ys,...t}),n(e,"cccc")}}};class Ur{constructor(t,r){this.Date=Date,this.today=()=>{var n;return(n=this.overrides)!=null&&n.today?this.overrides.today():this.options.timeZone?ir.tz(this.options.timeZone):new this.Date},this.newDate=(n,s,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(n,s,i):this.options.timeZone?new ir(n,s,i,this.options.timeZone):new Date(n,s,i)},this.addDays=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(n,s):Ar(n,s)},this.addMonths=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(n,s):Wp(n,s)},this.addWeeks=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(n,s):w5(n,s)},this.addYears=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(n,s):j5(n,s)},this.differenceInCalendarDays=(n,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(n,s):Eu(n,s)},this.differenceInCalendarMonths=(n,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(n,s):qp(n,s)},this.eachMonthOfInterval=n=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(n):M5(n)},this.eachYearOfInterval=n=>{var l;const s=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(n):E5(n),i=new Set(s.map(c=>this.getYear(c)));if(i.size===s.length)return s;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=n=>{var s;return(s=this.overrides)!=null&&s.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(n):wI(n,this)},this.endOfISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(n):D5(n)},this.endOfMonth=n=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(n):Hp(n)},this.endOfWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(n,s):sN(n,this.options)},this.endOfYear=n=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(n):A5(n)},this.format=(n,s,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(n,s,this.options):ue(n,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.getISOWeek?this.overrides.getISOWeek(n):Kp(n)},this.getMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(n,this.options):Hc(n,this.options)},this.getYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(n,this.options):A3(n,this.options)},this.getWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(n,this.options):Yp(n,this.options)},this.isAfter=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(n,s):E3(n,s)},this.isBefore=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(n,s):D3(n,s)},this.isDate=n=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(n):Q1(n)},this.isSameDay=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(n,s):_i(n,s)},this.isSameMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(n,s):T3(n,s)},this.isSameYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(n,s):I3(n,s)},this.max=n=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(n):N5(n)},this.min=n=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(n):k5(n)},this.setMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(n,s):z3(n,s)},this.setYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(n,s):L3(n,s)},this.startOfBroadcastWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(n,this):mN(n,this)},this.startOfDay=n=>{var s;return(s=this.overrides)!=null&&s.startOfDay?this.overrides.startOfDay(n):Ci(n)},this.startOfISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.startOfISOWeek?this.overrides.startOfISOWeek(n):Qo(n)},this.startOfMonth=n=>{var s;return(s=this.overrides)!=null&&s.startOfMonth?this.overrides.startOfMonth(n):nN(n)},this.startOfWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(n,this.options):Si(n,this.options)},this.startOfYear=n=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(n):aN(n)},this.options={locale:hN,...t},this.overrides=r}getDigitMap(){const{numerals:t="latn"}=this.options,r=new Intl.NumberFormat("en-US",{numberingSystem:t}),n={};for(let s=0;s<10;s++)n[s.toString()]=r.format(s);return n}replaceDigits(t){const r=this.getDigitMap();return t.replace(/\d/g,n=>r[n]||n)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var r;const t=(r=this.options.locale)==null?void 0:r.code;return t&&Ur.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:r,timeZone:n,numerals:s}=this.options,i=r==null?void 0:r.code;if(i&&Ur.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:n,numberingSystem:s}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}Ur.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Vn=new Ur;class pN{constructor(t,r,n=Vn){this.date=t,this.displayMonth=r,this.outside=!!(r&&!n.isSameMonth(t,r)),this.dateLib=n,this.isoDate=n.format(t,"yyyy-MM-dd"),this.displayMonthId=n.format(r,"yyyy-MM"),this.dateMonthId=n.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class jI{constructor(t,r){this.date=t,this.weeks=r}}class NI{constructor(t,r){this.days=r,this.weekNumber=t}}function kI(e){return E.createElement("button",{...e})}function SI(e){return E.createElement("span",{...e})}function CI(e){const{size:t=24,orientation:r="left",className:n}=e;return E.createElement("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24"},r==="up"&&E.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),r==="down"&&E.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),r==="left"&&E.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),r==="right"&&E.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function _I(e){const{day:t,modifiers:r,...n}=e;return E.createElement("td",{...n})}function OI(e){const{day:t,modifiers:r,...n}=e,s=E.useRef(null);return E.useEffect(()=>{var i;r.focused&&((i=s.current)==null||i.focus())},[r.focused]),E.createElement("button",{ref:s,...n})}var je;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(je||(je={}));var mt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(mt||(mt={}));var vn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(vn||(vn={}));var zr;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(zr||(zr={}));function PI(e){const{options:t,className:r,components:n,classNames:s,...i}=e,o=[s[je.Dropdown],r].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return E.createElement("span",{"data-disabled":i.disabled,className:s[je.DropdownRoot]},E.createElement(n.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:u})=>E.createElement(n.Option,{key:c,value:c,disabled:u},d))),E.createElement("span",{className:s[je.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,E.createElement(n.Chevron,{orientation:"down",size:18,className:s[je.Chevron]})))}function MI(e){return E.createElement("div",{...e})}function AI(e){return E.createElement("div",{...e})}function EI(e){const{calendarMonth:t,displayIndex:r,...n}=e;return E.createElement("div",{...n},e.children)}function DI(e){const{calendarMonth:t,displayIndex:r,...n}=e;return E.createElement("div",{...n})}function TI(e){return E.createElement("table",{...e})}function II(e){return E.createElement("div",{...e})}const gN=p.createContext(void 0);function Ll(){const e=p.useContext(gN);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function RI(e){const{components:t}=Ll();return E.createElement(t.Dropdown,{...e})}function $I(e){const{onPreviousClick:t,onNextClick:r,previousMonth:n,nextMonth:s,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Ll(),u=p.useCallback(m=>{s&&(r==null||r(m))},[s,r]),f=p.useCallback(m=>{n&&(t==null||t(m))},[n,t]);return E.createElement("nav",{...i},E.createElement(o.PreviousMonthButton,{type:"button",className:l[je.PreviousMonthButton],tabIndex:n?void 0:-1,"aria-disabled":n?void 0:!0,"aria-label":c(n),onClick:f},E.createElement(o.Chevron,{disabled:n?void 0:!0,className:l[je.Chevron],orientation:"left"})),E.createElement(o.NextMonthButton,{type:"button",className:l[je.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":d(s),onClick:u},E.createElement(o.Chevron,{disabled:s?void 0:!0,orientation:"right",className:l[je.Chevron]})))}function zI(e){const{components:t}=Ll();return E.createElement(t.Button,{...e})}function LI(e){return E.createElement("option",{...e})}function FI(e){const{components:t}=Ll();return E.createElement(t.Button,{...e})}function BI(e){const{rootRef:t,...r}=e;return E.createElement("div",{...r,ref:t})}function WI(e){return E.createElement("select",{...e})}function UI(e){const{week:t,...r}=e;return E.createElement("tr",{...r})}function qI(e){return E.createElement("th",{...e})}function HI(e){return E.createElement("thead",{"aria-hidden":!0},E.createElement("tr",{...e}))}function KI(e){const{week:t,...r}=e;return E.createElement("th",{...r})}function YI(e){return E.createElement("th",{...e})}function GI(e){return E.createElement("tbody",{...e})}function VI(e){const{components:t}=Ll();return E.createElement(t.Dropdown,{...e})}const XI=Object.freeze(Object.defineProperty({__proto__:null,Button:kI,CaptionLabel:SI,Chevron:CI,Day:_I,DayButton:OI,Dropdown:PI,DropdownNav:MI,Footer:AI,Month:EI,MonthCaption:DI,MonthGrid:TI,Months:II,MonthsDropdown:RI,Nav:$I,NextMonthButton:zI,Option:LI,PreviousMonthButton:FI,Root:BI,Select:WI,Week:UI,WeekNumber:KI,WeekNumberHeader:YI,Weekday:qI,Weekdays:HI,Weeks:GI,YearsDropdown:VI},Symbol.toStringTag,{value:"Module"}));function ia(e,t,r=!1,n=Vn){let{from:s,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=n;return s&&i?(o(i,s)<0&&([s,i]=[i,s]),o(t,s)>=(r?1:0)&&o(i,t)>=(r?1:0)):!r&&i?l(i,t):!r&&s?l(s,t):!1}function Zp(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Iu(e){return!!(e&&typeof e=="object"&&"from"in e)}function Jp(e){return!!(e&&typeof e=="object"&&"after"in e)}function eg(e){return!!(e&&typeof e=="object"&&"before"in e)}function xN(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function vN(e,t){return Array.isArray(e)&&e.every(t.isDate)}function oa(e,t,r=Vn){const n=Array.isArray(t)?t:[t],{isSameDay:s,differenceInCalendarDays:i,isAfter:o}=r;return n.some(l=>{if(typeof l=="boolean")return l;if(r.isDate(l))return s(e,l);if(vN(l,r))return l.some(c=>s(e,c));if(Iu(l))return ia(l,e,!1,r);if(xN(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(Zp(l)){const c=i(l.before,e),d=i(l.after,e),u=c>0,f=d<0;return o(l.before,l.after)?f&&u:u||f}return Jp(l)?i(e,l.after)>0:eg(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function QI(e,t,r,n,s){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:u=s.today()}=t,{isSameDay:f,isSameMonth:m,startOfMonth:h,isBefore:g,endOfMonth:x,isAfter:v}=s,y=r&&h(r),j=n&&x(n),b={[mt.focused]:[],[mt.outside]:[],[mt.disabled]:[],[mt.hidden]:[],[mt.today]:[]},N={};for(const k of e){const{date:w,displayMonth:S}=k,C=!!(S&&!m(w,S)),P=!!(y&&g(w,y)),M=!!(j&&v(w,j)),A=!!(i&&oa(w,i,s)),_=!!(o&&oa(w,o,s))||P||M||!d&&!c&&C||d&&c===!1&&C,D=f(w,u);C&&b.outside.push(k),A&&b.disabled.push(k),_&&b.hidden.push(k),D&&b.today.push(k),l&&Object.keys(l).forEach(O=>{const R=l==null?void 0:l[O];R&&oa(w,R,s)&&(N[O]?N[O].push(k):N[O]=[k])})}return k=>{const w={[mt.focused]:!1,[mt.disabled]:!1,[mt.hidden]:!1,[mt.outside]:!1,[mt.today]:!1},S={};for(const C in b){const P=b[C];w[C]=P.some(M=>M===k)}for(const C in N)S[C]=N[C].some(P=>P===k);return{...w,...S}}}function ZI(e,t,r={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[i])=>(r[i]?s.push(r[i]):t[mt[i]]?s.push(t[mt[i]]):t[vn[i]]&&s.push(t[vn[i]]),s),[t[je.Day]])}function JI(e){return{...XI,...e}}function e4(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([r,n])=>{r.startsWith("data-")&&(t[r]=n)}),t}function t4(){const e={};for(const t in je)e[je[t]]=`rdp-${je[t]}`;for(const t in mt)e[mt[t]]=`rdp-${mt[t]}`;for(const t in vn)e[vn[t]]=`rdp-${vn[t]}`;for(const t in zr)e[zr[t]]=`rdp-${zr[t]}`;return e}function yN(e,t,r){return(r??new Ur(t)).formatMonthYear(e)}const r4=yN;function n4(e,t,r){return(r??new Ur(t)).format(e,"d")}function a4(e,t=Vn){return t.format(e,"LLLL")}function s4(e,t,r){return(r??new Ur(t)).format(e,"cccccc")}function i4(e,t=Vn){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function o4(){return""}function bN(e,t=Vn){return t.format(e,"yyyy")}const l4=bN,c4=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:yN,formatDay:n4,formatMonthCaption:r4,formatMonthDropdown:a4,formatWeekNumber:i4,formatWeekNumberHeader:o4,formatWeekdayName:s4,formatYearCaption:l4,formatYearDropdown:bN},Symbol.toStringTag,{value:"Module"}));function d4(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...c4,...e}}function tg(e,t,r,n){let s=(n??new Ur(r)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const u4=tg;function rg(e,t,r){return(r??new Ur(t)).formatMonthYear(e)}const f4=rg;function wN(e,t,r,n){let s=(n??new Ur(r)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function jN(e){return"Choose the Month"}function NN(){return""}const m4="Go to the Next Month";function kN(e,t){return m4}function SN(e){return"Go to the Previous Month"}function CN(e,t,r){return(r??new Ur(t)).format(e,"cccc")}function _N(e,t){return`Week ${e}`}function ON(e){return"Week Number"}function PN(e){return"Choose the Year"}const h4=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:f4,labelDay:u4,labelDayButton:tg,labelGrid:rg,labelGridcell:wN,labelMonthDropdown:jN,labelNav:NN,labelNext:kN,labelPrevious:SN,labelWeekNumber:_N,labelWeekNumberHeader:ON,labelWeekday:CN,labelYearDropdown:PN},Symbol.toStringTag,{value:"Module"})),mn=(e,t,r)=>t||(r?typeof r=="function"?r:(...n)=>r:e);function p4(e,t){var n;const r=((n=t.locale)==null?void 0:n.labels)??{};return{...h4,...e??{},labelDayButton:mn(tg,e==null?void 0:e.labelDayButton,r.labelDayButton),labelMonthDropdown:mn(jN,e==null?void 0:e.labelMonthDropdown,r.labelMonthDropdown),labelNext:mn(kN,e==null?void 0:e.labelNext,r.labelNext),labelPrevious:mn(SN,e==null?void 0:e.labelPrevious,r.labelPrevious),labelWeekNumber:mn(_N,e==null?void 0:e.labelWeekNumber,r.labelWeekNumber),labelYearDropdown:mn(PN,e==null?void 0:e.labelYearDropdown,r.labelYearDropdown),labelGrid:mn(rg,e==null?void 0:e.labelGrid,r.labelGrid),labelGridcell:mn(wN,e==null?void 0:e.labelGridcell,r.labelGridcell),labelNav:mn(NN,e==null?void 0:e.labelNav,r.labelNav),labelWeekNumberHeader:mn(ON,e==null?void 0:e.labelWeekNumberHeader,r.labelWeekNumberHeader),labelWeekday:mn(CN,e==null?void 0:e.labelWeekday,r.labelWeekday)}}function g4(e,t,r,n,s){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=s;return c({start:o(e),end:l(e)}).map(m=>{const h=n.formatMonthDropdown(m,s),g=d(m),x=t&&m<i(t)||r&&m>i(r)||!1;return{value:g,label:h,disabled:x}})}function x4(e,t={},r={}){let n={...t==null?void 0:t[je.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{n={...n,...r==null?void 0:r[s]}}),n}function v4(e,t,r,n){const s=n??e.today(),i=r?e.startOfBroadcastWeek(s,e):t?e.startOfISOWeek(s):e.startOfWeek(s),o=[];for(let l=0;l<7;l++){const c=e.addDays(i,l);o.push(c)}return o}function y4(e,t,r,n,s=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=n,d=i(e),u=o(t),f=l({start:d,end:u});return s&&f.reverse(),f.map(m=>{const h=r.formatYearDropdown(m,n);return{value:c(m),label:h,disabled:!1}})}function b4(e,t={}){var l;const{weekStartsOn:r,locale:n}=t,s=r??((l=n==null?void 0:n.options)==null?void 0:l.weekStartsOn)??0,i=c=>{const d=typeof c=="number"||typeof c=="string"?new Date(c):c;return new ir(d.getFullYear(),d.getMonth(),d.getDate(),12,0,0,e)},o=c=>{const d=i(c);return new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,0,0,0)};return{today:()=>i(ir.tz(e)),newDate:(c,d,u)=>new ir(c,d,u,12,0,0,e),startOfDay:c=>i(c),startOfWeek:(c,d)=>{const u=i(c),f=(d==null?void 0:d.weekStartsOn)??s,m=(u.getDay()-f+7)%7;return u.setDate(u.getDate()-m),u},startOfISOWeek:c=>{const d=i(c),u=(d.getDay()-1+7)%7;return d.setDate(d.getDate()-u),d},startOfMonth:c=>{const d=i(c);return d.setDate(1),d},startOfYear:c=>{const d=i(c);return d.setMonth(0,1),d},endOfWeek:(c,d)=>{const u=i(c),h=((((d==null?void 0:d.weekStartsOn)??s)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+h),u},endOfISOWeek:c=>{const d=i(c),u=(7-d.getDay())%7;return d.setDate(d.getDate()+u),d},endOfMonth:c=>{const d=i(c);return d.setMonth(d.getMonth()+1,0),d},endOfYear:c=>{const d=i(c);return d.setMonth(11,31),d},eachMonthOfInterval:c=>{const d=i(c.start),u=i(c.end),f=[],m=new ir(d.getFullYear(),d.getMonth(),1,12,0,0,e),h=u.getFullYear()*12+u.getMonth();for(;m.getFullYear()*12+m.getMonth()<=h;)f.push(new ir(m,e)),m.setMonth(m.getMonth()+1,1);return f},addDays:(c,d)=>{const u=i(c);return u.setDate(u.getDate()+d),u},addWeeks:(c,d)=>{const u=i(c);return u.setDate(u.getDate()+d*7),u},addMonths:(c,d)=>{const u=i(c);return u.setMonth(u.getMonth()+d),u},addYears:(c,d)=>{const u=i(c);return u.setFullYear(u.getFullYear()+d),u},eachYearOfInterval:c=>{const d=i(c.start),u=i(c.end),f=[],m=new ir(d.getFullYear(),0,1,12,0,0,e);for(;m.getFullYear()<=u.getFullYear();)f.push(new ir(m,e)),m.setFullYear(m.getFullYear()+1,0,1);return f},getWeek:(c,d)=>{var f;const u=o(c);return Yp(u,{weekStartsOn:(d==null?void 0:d.weekStartsOn)??s,firstWeekContainsDate:(d==null?void 0:d.firstWeekContainsDate)??((f=n==null?void 0:n.options)==null?void 0:f.firstWeekContainsDate)??1})},getISOWeek:c=>{const d=o(c);return Kp(d)},differenceInCalendarDays:(c,d)=>{const u=o(c),f=o(d);return Eu(u,f)},differenceInCalendarMonths:(c,d)=>{const u=o(c),f=o(d);return qp(u,f)}}}const Fl=e=>e instanceof HTMLElement?e:null,dm=e=>[...e.querySelectorAll("[data-animated-month]")??[]],w4=e=>Fl(e.querySelector("[data-animated-month]")),um=e=>Fl(e.querySelector("[data-animated-caption]")),fm=e=>Fl(e.querySelector("[data-animated-weeks]")),j4=e=>Fl(e.querySelector("[data-animated-nav]")),N4=e=>Fl(e.querySelector("[data-animated-weekdays]"));function k4(e,t,{classNames:r,months:n,focused:s,dateLib:i}){const o=p.useRef(null),l=p.useRef(n),c=p.useRef(!1);p.useLayoutEffect(()=>{const d=l.current;if(l.current=n,!t||!e.current||!(e.current instanceof HTMLElement)||n.length===0||d.length===0||n.length!==d.length)return;const u=i.isSameMonth(n[0].date,d[0].date),f=i.isAfter(n[0].date,d[0].date),m=f?r[zr.caption_after_enter]:r[zr.caption_before_enter],h=f?r[zr.weeks_after_enter]:r[zr.weeks_before_enter],g=o.current,x=e.current.cloneNode(!0);if(x instanceof HTMLElement?(dm(x).forEach(b=>{if(!(b instanceof HTMLElement))return;const N=w4(b);N&&b.contains(N)&&b.removeChild(N);const k=um(b);k&&k.classList.remove(m);const w=fm(b);w&&w.classList.remove(h)}),o.current=x):o.current=null,c.current||u||s)return;const v=g instanceof HTMLElement?dm(g):[],y=dm(e.current);if(y!=null&&y.every(j=>j instanceof HTMLElement)&&v&&v.every(j=>j instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const j=j4(e.current);j&&(j.style.zIndex="1"),y.forEach((b,N)=>{const k=v[N];if(!k)return;b.style.position="relative",b.style.overflow="hidden";const w=um(b);w&&w.classList.add(m);const S=fm(b);S&&S.classList.add(h);const C=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),j&&(j.style.zIndex=""),w&&w.classList.remove(m),S&&S.classList.remove(h),b.style.position="",b.style.overflow="",b.contains(k)&&b.removeChild(k)};k.style.pointerEvents="none",k.style.position="absolute",k.style.overflow="hidden",k.setAttribute("aria-hidden","true");const P=N4(k);P&&(P.style.opacity="0");const M=um(k);M&&(M.classList.add(f?r[zr.caption_before_exit]:r[zr.caption_after_exit]),M.addEventListener("animationend",C));const A=fm(k);A&&A.classList.add(f?r[zr.weeks_before_exit]:r[zr.weeks_after_exit]),b.insertBefore(k,b.firstChild)})}})}function S4(e,t,r,n){const s=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=r??{},{addDays:d,differenceInCalendarDays:u,differenceInCalendarMonths:f,endOfBroadcastWeek:m,endOfISOWeek:h,endOfMonth:g,endOfWeek:x,isAfter:v,startOfBroadcastWeek:y,startOfISOWeek:j,startOfWeek:b}=n,N=c?y(s,n):o?j(s):b(s),k=c?m(i):o?h(g(i)):x(g(i)),w=t&&(c?m(t):o?h(t):x(t)),S=w&&v(k,w)?w:k,C=u(S,N),P=f(i,s)+1,M=[];for(let D=0;D<=C;D++){const O=d(N,D);M.push(O)}const _=(c?35:42)*P;if(l&&M.length<_){const D=_-M.length;for(let O=0;O<D;O++){const R=d(M[M.length-1],1);M.push(R)}}return M}function C4(e){const t=[];return e.reduce((r,n)=>{const s=n.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return r.concat(s.slice())},t.slice())}function _4(e,t,r,n){const{numberOfMonths:s=1}=r,i=[];for(let o=0;o<s;o++){const l=n.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function Hv(e,t,r,n){const{month:s,defaultMonth:i,today:o=n.today(),numberOfMonths:l=1}=e;let c=s||i||o;const{differenceInCalendarMonths:d,addMonths:u,startOfMonth:f}=n;if(r&&d(r,c)<l-1){const m=-1*(l-1);c=u(r,m)}return t&&d(c,t)<0&&(c=t),f(c)}function O4(e,t,r,n){const{addDays:s,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:u,startOfBroadcastWeek:f,startOfISOWeek:m,startOfWeek:h}=n,g=e.reduce((x,v)=>{const y=r.broadcastCalendar?f(v,n):r.ISOWeek?m(v):h(v),j=r.broadcastCalendar?i(v):r.ISOWeek?o(l(v)):c(l(v)),b=t.filter(S=>S>=y&&S<=j),N=r.broadcastCalendar?35:42;if(r.fixedWeeks&&b.length<N){const S=t.filter(C=>{const P=N-b.length;return C>j&&C<=s(j,P)});b.push(...S)}const k=b.reduce((S,C)=>{const P=r.ISOWeek?d(C):u(C),M=S.find(_=>_.weekNumber===P),A=new pN(C,v,n);return M?M.days.push(A):S.push(new NI(P,[A])),S},[]),w=new jI(v,k);return x.push(w),x},[]);return r.reverseMonths?g.reverse():g}function P4(e,t){let{startMonth:r,endMonth:n}=e;const{startOfYear:s,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:d,newDate:u,today:f}=t,{fromYear:m,toYear:h,fromMonth:g,toMonth:x}=e;!r&&g&&(r=g),!r&&m&&(r=t.newDate(m,0,1)),!n&&x&&(n=x),!n&&h&&(n=u(h,11,31));const v=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return r?r=o(r):m?r=u(m,0,1):!r&&v&&(r=s(c(e.today??f(),-100))),n?n=l(n):h?n=u(h,11,31):!n&&v&&(n=d(e.today??f())),[r&&i(r),n&&i(n)]}function M4(e,t,r,n){if(r.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=r,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=n,d=s?i:1,u=o(e);if(!t)return l(u,d);if(!(c(t,e)<i))return l(u,d)}function A4(e,t,r,n){if(r.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i}=r,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=n,d=s?i??1:1,u=o(e);if(!t)return l(u,-d);if(!(c(u,t)<=0))return l(u,-d)}function E4(e){const t=[];return e.reduce((r,n)=>r.concat(n.weeks.slice()),t.slice())}function Ru(e,t){const[r,n]=p.useState(e);return[t===void 0?r:t,n]}function D4(e,t){var N;const[r,n]=P4(e,t),{startOfMonth:s,endOfMonth:i}=t,o=Hv(e,r,n,t),[l,c]=Ru(o,e.month?o:void 0);p.useEffect(()=>{const k=Hv(e,r,n,t);c(k)},[e.timeZone]);const{months:d,weeks:u,days:f,previousMonth:m,nextMonth:h}=p.useMemo(()=>{const k=_4(l,n,{numberOfMonths:e.numberOfMonths},t),w=S4(k,e.endMonth?i(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),S=O4(k,w,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),C=E4(S),P=C4(S),M=A4(l,r,e,t),A=M4(l,n,e,t);return{months:S,weeks:C,days:P,previousMonth:M,nextMonth:A}},[t,l.getTime(),n==null?void 0:n.getTime(),r==null?void 0:r.getTime(),e.disableNavigation,e.broadcastCalendar,(N=e.endMonth)==null?void 0:N.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:g,onMonthChange:x}=e,v=k=>u.some(w=>w.days.some(S=>S.isEqualTo(k))),y=k=>{if(g)return;let w=s(k);r&&w<s(r)&&(w=s(r)),n&&w>s(n)&&(w=s(n)),c(w),x==null||x(w)};return{months:d,weeks:u,days:f,navStart:r,navEnd:n,previousMonth:m,nextMonth:h,goToMonth:y,goToDay:k=>{v(k)||y(k.date)}}}var In;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(In||(In={}));function Kv(e){return!e[mt.disabled]&&!e[mt.hidden]&&!e[mt.outside]}function T4(e,t,r,n){let s,i=-1;for(const o of e){const l=t(o);Kv(l)&&(l[mt.focused]&&i<In.FocusedModifier?(s=o,i=In.FocusedModifier):n!=null&&n.isEqualTo(o)&&i<In.LastFocused?(s=o,i=In.LastFocused):r(o.date)&&i<In.Selected?(s=o,i=In.Selected):l[mt.today]&&i<In.Today&&(s=o,i=In.Today))}return s||(s=e.find(o=>Kv(t(o)))),s}function I4(e,t,r,n,s,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:u,addWeeks:f,addYears:m,endOfBroadcastWeek:h,endOfISOWeek:g,endOfWeek:x,max:v,min:y,startOfBroadcastWeek:j,startOfISOWeek:b,startOfWeek:N}=o;let w={day:d,week:f,month:u,year:m,startOfWeek:S=>c?j(S,o):l?b(S):N(S),endOfWeek:S=>c?h(S):l?g(S):x(S)}[e](r,t==="after"?1:-1);return t==="before"&&n?w=v([n,w]):t==="after"&&s&&(w=y([s,w])),w}function MN(e,t,r,n,s,i,o,l=0){if(l>365)return;const c=I4(e,t,r.date,n,s,i,o),d=!!(i.disabled&&oa(c,i.disabled,o)),u=!!(i.hidden&&oa(c,i.hidden,o)),f=c,m=new pN(c,f,o);return!d&&!u?m:MN(e,t,m,n,s,i,o,l+1)}function R4(e,t,r,n,s){const{autoFocus:i}=e,[o,l]=p.useState(),c=T4(t.days,r,n||(()=>!1),o),[d,u]=p.useState(i?c:void 0);return{isFocusTarget:x=>!!(c!=null&&c.isEqualTo(x)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(x,v)=>{if(!d)return;const y=MN(x,v,d,t.navStart,t.navEnd,e,s);y&&(e.disableNavigation&&!t.days.some(b=>b.isEqualTo(y))||(t.goToDay(y),u(y)))}}}function $4(e,t){const{selected:r,required:n,onSelect:s}=e,[i,o]=Ru(r,s?r:void 0),l=s?r:i,{isSameDay:c}=t,d=h=>(l==null?void 0:l.some(g=>c(g,h)))??!1,{min:u,max:f}=e;return{selected:l,select:(h,g,x)=>{let v=[...l??[]];if(d(h)){if((l==null?void 0:l.length)===u||n&&(l==null?void 0:l.length)===1)return;v=l==null?void 0:l.filter(y=>!c(y,h))}else(l==null?void 0:l.length)===f?v=[h]:v=[...v,h];return s||o(v),s==null||s(v,h,g,x),v},isSelected:d}}function z4(e,t,r=0,n=0,s=!1,i=Vn){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:d,isBefore:u}=i;let f;if(!o&&!l)f={from:e,to:r>0?void 0:e};else if(o&&!l)c(o,e)?r===0?f={from:o,to:e}:s?f={from:o,to:void 0}:f=void 0:u(e,o)?f={from:e,to:o}:f={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))s?f={from:o,to:l}:f=void 0;else if(c(o,e))f={from:o,to:r>0?void 0:e};else if(c(l,e))f={from:e,to:r>0?void 0:e};else if(u(e,o))f={from:e,to:l};else if(d(e,o))f={from:o,to:e};else if(d(e,l))f={from:o,to:e};else throw new Error("Invalid range");if(f!=null&&f.from&&(f!=null&&f.to)){const m=i.differenceInCalendarDays(f.to,f.from);n>0&&m>n?f={from:e,to:void 0}:r>1&&m<r&&(f={from:e,to:void 0})}return f}function L4(e,t,r=Vn){const n=Array.isArray(t)?t:[t];let s=e.from;const i=r.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(n.includes(s.getDay()))return!0;s=r.addDays(s,1)}return!1}function Yv(e,t,r=Vn){return ia(e,t.from,!1,r)||ia(e,t.to,!1,r)||ia(t,e.from,!1,r)||ia(t,e.to,!1,r)}function F4(e,t,r=Vn){const n=Array.isArray(t)?t:[t];if(n.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:r.isDate(l)?ia(e,l,!1,r):vN(l,r)?l.some(c=>ia(e,c,!1,r)):Iu(l)?l.from&&l.to?Yv(e,{from:l.from,to:l.to},r):!1:xN(l)?L4(e,l.dayOfWeek,r):Zp(l)?r.isAfter(l.before,l.after)?Yv(e,{from:r.addDays(l.after,1),to:r.addDays(l.before,-1)},r):oa(e.from,l,r)||oa(e.to,l,r):Jp(l)||eg(l)?oa(e.from,l,r)||oa(e.to,l,r):!1))return!0;const o=n.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=r.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=c;d++){if(o.some(u=>u(l)))return!0;l=r.addDays(l,1)}}return!1}function B4(e,t){const{disabled:r,excludeDisabled:n,selected:s,required:i,onSelect:o}=e,[l,c]=Ru(s,o?s:void 0),d=o?s:l;return{selected:d,select:(m,h,g)=>{const{min:x,max:v}=e,y=m?z4(m,d,x,v,i,t):void 0;return n&&r&&(y!=null&&y.from)&&y.to&&F4({from:y.from,to:y.to},r,t)&&(y.from=m,y.to=void 0),o||c(y),o==null||o(y,m,h,g),y},isSelected:m=>d&&ia(d,m,!1,t)}}function W4(e,t){const{selected:r,required:n,onSelect:s}=e,[i,o]=Ru(r,s?r:void 0),l=s?r:i,{isSameDay:c}=t;return{selected:l,select:(f,m,h)=>{let g=f;return!n&&l&&l&&c(f,l)&&(g=void 0),s||o(g),s==null||s(g,f,m,h),g},isSelected:f=>l?c(l,f):!1}}function U4(e,t){const r=W4(e,t),n=$4(e,t),s=B4(e,t);switch(e.mode){case"single":return r;case"multiple":return n;case"range":return s;default:return}}function Jr(e,t){return e instanceof ir&&e.timeZone===t?e:new ir(e,t)}function ii(e,t,r){return Jr(e,t)}function Gv(e,t,r){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?ii(e,t):Array.isArray(e)?e.map(n=>n instanceof Date?ii(n,t):n):Iu(e)?{...e,from:e.from?Jr(e.from,t):e.from,to:e.to?Jr(e.to,t):e.to}:Zp(e)?{before:ii(e.before,t),after:ii(e.after,t)}:Jp(e)?{after:ii(e.after,t)}:eg(e)?{before:ii(e.before,t)}:e}function mm(e,t,r){return e&&(Array.isArray(e)?e.map(n=>Gv(n,t)):Gv(e,t))}function q4(e){var ke;let t=e;const r=t.timeZone;if(r&&(t={...e,timeZone:r},t.today&&(t.today=Jr(t.today,r)),t.month&&(t.month=Jr(t.month,r)),t.defaultMonth&&(t.defaultMonth=Jr(t.defaultMonth,r)),t.startMonth&&(t.startMonth=Jr(t.startMonth,r)),t.endMonth&&(t.endMonth=Jr(t.endMonth,r)),t.mode==="single"&&t.selected?t.selected=Jr(t.selected,r):t.mode==="multiple"&&t.selected?t.selected=(ke=t.selected)==null?void 0:ke.map(de=>Jr(de,r)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?Jr(t.selected.from,r):t.selected.from,to:t.selected.to?Jr(t.selected.to,r):t.selected.to}),t.disabled!==void 0&&(t.disabled=mm(t.disabled,r)),t.hidden!==void 0&&(t.hidden=mm(t.hidden,r)),t.modifiers)){const de={};Object.keys(t.modifiers).forEach(pe=>{var ie;de[pe]=mm((ie=t.modifiers)==null?void 0:ie[pe],r)}),t.modifiers=de}const{components:n,formatters:s,labels:i,dateLib:o,locale:l,classNames:c}=p.useMemo(()=>{const de={...hN,...t.locale},pe=t.broadcastCalendar?1:t.weekStartsOn,ie=t.noonSafe&&t.timeZone?b4(t.timeZone,{weekStartsOn:pe,locale:de}):void 0,fe=t.dateLib&&ie?{...ie,...t.dateLib}:t.dateLib??ie,qe=new Ur({locale:de,weekStartsOn:pe,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},fe);return{dateLib:qe,components:JI(t.components),formatters:d4(t.formatters),labels:p4(t.labels,qe.options),locale:de,classNames:{...t4(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:o.today()});const{captionLayout:d,mode:u,navLayout:f,numberOfMonths:m=1,onDayBlur:h,onDayClick:g,onDayFocus:x,onDayKeyDown:v,onDayMouseEnter:y,onDayMouseLeave:j,onNextClick:b,onPrevClick:N,showWeekNumber:k,styles:w}=t,{formatCaption:S,formatDay:C,formatMonthDropdown:P,formatWeekNumber:M,formatWeekNumberHeader:A,formatWeekdayName:_,formatYearDropdown:D}=s,O=D4(t,o),{days:R,months:F,navStart:H,navEnd:ne,previousMonth:G,nextMonth:oe,goToMonth:ce}=O,B=QI(R,t,H,ne,o),{isSelected:Y,select:U,selected:X}=U4(t,o)??{},{blur:$,focused:K,isFocusTarget:V,moveFocus:L,setFocused:se}=R4(t,O,B,Y??(()=>!1),o),{labelDayButton:he,labelGridcell:Q,labelGrid:Pe,labelMonthDropdown:re,labelNav:Oe,labelPrevious:Ce,labelNext:q,labelWeekday:ve,labelWeekNumber:Me,labelWeekNumberHeader:We,labelYearDropdown:Ue}=i,Ct=p.useMemo(()=>v4(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),_t=u!==void 0||g!==void 0,ur=p.useCallback(()=>{G&&(ce(G),N==null||N(G))},[G,ce,N]),Sr=p.useCallback(()=>{oe&&(ce(oe),b==null||b(oe))},[ce,oe,b]),dt=p.useCallback((de,pe)=>ie=>{ie.preventDefault(),ie.stopPropagation(),se(de),!pe.disabled&&(U==null||U(de.date,pe,ie),g==null||g(de.date,pe,ie))},[U,g,se]),bt=p.useCallback((de,pe)=>ie=>{se(de),x==null||x(de.date,pe,ie)},[x,se]),Gr=p.useCallback((de,pe)=>ie=>{$(),h==null||h(de.date,pe,ie)},[$,h]),Ia=p.useCallback((de,pe)=>ie=>{const fe={ArrowLeft:[ie.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[ie.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[ie.shiftKey?"year":"week","after"],ArrowUp:[ie.shiftKey?"year":"week","before"],PageUp:[ie.shiftKey?"year":"month","before"],PageDown:[ie.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(fe[ie.key]){ie.preventDefault(),ie.stopPropagation();const[qe,ee]=fe[ie.key];L(qe,ee)}v==null||v(de.date,pe,ie)},[L,v,t.dir]),Vr=p.useCallback((de,pe)=>ie=>{y==null||y(de.date,pe,ie)},[y]),Xn=p.useCallback((de,pe)=>ie=>{j==null||j(de.date,pe,ie)},[j]),Rr=p.useCallback(de=>pe=>{const ie=Number(pe.target.value),fe=o.setMonth(o.startOfMonth(de),ie);ce(fe)},[o,ce]),$r=p.useCallback(de=>pe=>{const ie=Number(pe.target.value),fe=o.setYear(o.startOfMonth(de),ie);ce(fe)},[o,ce]),{className:fr,style:nr}=p.useMemo(()=>({className:[c[je.Root],t.className].filter(Boolean).join(" "),style:{...w==null?void 0:w[je.Root],...t.style}}),[c,t.className,t.style,w]),Vt=e4(t),_n=p.useRef(null);k4(_n,!!t.animate,{classNames:c,months:F,focused:K,dateLib:o});const Qn={dayPickerProps:t,selected:X,select:U,isSelected:Y,months:F,nextMonth:oe,previousMonth:G,goToMonth:ce,getModifiers:B,components:n,classNames:c,styles:w,labels:i,formatters:s};return E.createElement(gN.Provider,{value:Qn},E.createElement(n.Root,{rootRef:t.animate?_n:void 0,className:fr,style:nr,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Vt},E.createElement(n.Months,{className:c[je.Months],style:w==null?void 0:w[je.Months]},!t.hideNavigation&&!f&&E.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[je.Nav],style:w==null?void 0:w[je.Nav],"aria-label":Oe(),onPreviousClick:ur,onNextClick:Sr,previousMonth:G,nextMonth:oe}),F.map((de,pe)=>E.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:c[je.Month],style:w==null?void 0:w[je.Month],key:pe,displayIndex:pe,calendarMonth:de},f==="around"&&!t.hideNavigation&&pe===0&&E.createElement(n.PreviousMonthButton,{type:"button",className:c[je.PreviousMonthButton],tabIndex:G?void 0:-1,"aria-disabled":G?void 0:!0,"aria-label":Ce(G),onClick:ur,"data-animated-button":t.animate?"true":void 0},E.createElement(n.Chevron,{disabled:G?void 0:!0,className:c[je.Chevron],orientation:t.dir==="rtl"?"right":"left"})),E.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:c[je.MonthCaption],style:w==null?void 0:w[je.MonthCaption],calendarMonth:de,displayIndex:pe},d!=null&&d.startsWith("dropdown")?E.createElement(n.DropdownNav,{className:c[je.Dropdowns],style:w==null?void 0:w[je.Dropdowns]},(()=>{const ie=d==="dropdown"||d==="dropdown-months"?E.createElement(n.MonthsDropdown,{key:"month",className:c[je.MonthsDropdown],"aria-label":re(),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:Rr(de.date),options:g4(de.date,H,ne,s,o),style:w==null?void 0:w[je.Dropdown],value:o.getMonth(de.date)}):E.createElement("span",{key:"month"},P(de.date,o)),fe=d==="dropdown"||d==="dropdown-years"?E.createElement(n.YearsDropdown,{key:"year",className:c[je.YearsDropdown],"aria-label":Ue(o.options),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:$r(de.date),options:y4(H,ne,s,o,!!t.reverseYears),style:w==null?void 0:w[je.Dropdown],value:o.getYear(de.date)}):E.createElement("span",{key:"year"},D(de.date,o));return o.getMonthYearOrder()==="year-first"?[fe,ie]:[ie,fe]})(),E.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},S(de.date,o.options,o))):E.createElement(n.CaptionLabel,{className:c[je.CaptionLabel],role:"status","aria-live":"polite"},S(de.date,o.options,o))),f==="around"&&!t.hideNavigation&&pe===m-1&&E.createElement(n.NextMonthButton,{type:"button",className:c[je.NextMonthButton],tabIndex:oe?void 0:-1,"aria-disabled":oe?void 0:!0,"aria-label":q(oe),onClick:Sr,"data-animated-button":t.animate?"true":void 0},E.createElement(n.Chevron,{disabled:oe?void 0:!0,className:c[je.Chevron],orientation:t.dir==="rtl"?"left":"right"})),pe===m-1&&f==="after"&&!t.hideNavigation&&E.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[je.Nav],style:w==null?void 0:w[je.Nav],"aria-label":Oe(),onPreviousClick:ur,onNextClick:Sr,previousMonth:G,nextMonth:oe}),E.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":Pe(de.date,o.options,o)||void 0,className:c[je.MonthGrid],style:w==null?void 0:w[je.MonthGrid]},!t.hideWeekdays&&E.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:c[je.Weekdays],style:w==null?void 0:w[je.Weekdays]},k&&E.createElement(n.WeekNumberHeader,{"aria-label":We(o.options),className:c[je.WeekNumberHeader],style:w==null?void 0:w[je.WeekNumberHeader],scope:"col"},A()),Ct.map(ie=>E.createElement(n.Weekday,{"aria-label":ve(ie,o.options,o),className:c[je.Weekday],key:String(ie),style:w==null?void 0:w[je.Weekday],scope:"col"},_(ie,o.options,o)))),E.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:c[je.Weeks],style:w==null?void 0:w[je.Weeks]},de.weeks.map(ie=>E.createElement(n.Week,{className:c[je.Week],key:ie.weekNumber,style:w==null?void 0:w[je.Week],week:ie},k&&E.createElement(n.WeekNumber,{week:ie,style:w==null?void 0:w[je.WeekNumber],"aria-label":Me(ie.weekNumber,{locale:l}),className:c[je.WeekNumber],scope:"row",role:"rowheader"},M(ie.weekNumber,o)),ie.days.map(fe=>{const{date:qe}=fe,ee=B(fe);if(ee[mt.focused]=!ee.hidden&&!!(K!=null&&K.isEqualTo(fe)),ee[vn.selected]=(Y==null?void 0:Y(qe))||ee.selected,Iu(X)){const{from:Xe,to:Qe}=X;ee[vn.range_start]=!!(Xe&&Qe&&o.isSameDay(qe,Xe)),ee[vn.range_end]=!!(Xe&&Qe&&o.isSameDay(qe,Qe)),ee[vn.range_middle]=ia(X,qe,!0,o)}const ye=x4(ee,w,t.modifiersStyles),Ae=ZI(ee,c,t.modifiersClassNames),ut=!_t&&!ee.hidden?Q(qe,ee,o.options,o):void 0;return E.createElement(n.Day,{key:`${fe.isoDate}_${fe.displayMonthId}`,day:fe,modifiers:ee,className:Ae.join(" "),style:ye,role:"gridcell","aria-selected":ee.selected||void 0,"aria-label":ut,"data-day":fe.isoDate,"data-month":fe.outside?fe.dateMonthId:void 0,"data-selected":ee.selected||void 0,"data-disabled":ee.disabled||void 0,"data-hidden":ee.hidden||void 0,"data-outside":fe.outside||void 0,"data-focused":ee.focused||void 0,"data-today":ee.today||void 0},!ee.hidden&&_t?E.createElement(n.DayButton,{className:c[je.DayButton],style:w==null?void 0:w[je.DayButton],type:"button",day:fe,modifiers:ee,disabled:!ee.focused&&ee.disabled||void 0,"aria-disabled":ee.focused&&ee.disabled||void 0,tabIndex:V(fe)?0:-1,"aria-label":he(qe,ee,o.options,o),onClick:dt(fe,ee),onBlur:Gr(fe,ee),onFocus:bt(fe,ee),onKeyDown:Ia(fe,ee),onMouseEnter:Vr(fe,ee),onMouseLeave:Xn(fe,ee)},C(qe,o.options,o)):!ee.hidden&&C(fe.date,o.options,o))})))))))),t.footer&&E.createElement(n.Footer,{className:c[je.Footer],style:w==null?void 0:w[je.Footer],role:"status","aria-live":"polite"},t.footer)))}function dr({className:e,classNames:t,showOutsideDays:r=!0,...n}){return a.jsx(q4,{showOutsideDays:r,className:T("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",month_caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium pointer-events-none",nav:"flex items-center gap-1",button_previous:T(yi({variant:"outline"}),"absolute left-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"),button_next:T(yi({variant:"outline"}),"absolute right-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"),month_grid:"w-full border-collapse",weekdays:"flex",weekday:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem] text-center",week:"flex w-full mt-2",day:"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 rounded-md",day_button:T(yi({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),selected:"[&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground [&>button]:focus:bg-primary [&>button]:focus:text-primary-foreground",today:"[&>button]:bg-accent [&>button]:text-accent-foreground",outside:"day-outside text-muted-foreground [&>button]:text-muted-foreground aria-selected:text-muted-foreground",disabled:"text-muted-foreground opacity-50",hidden:"invisible",...t},components:{Chevron:({orientation:s})=>s==="left"?a.jsx(du,{className:"h-4 w-4"}):a.jsx(kn,{className:"h-4 w-4"})},...n})}dr.displayName="Calendar";function H4(e,t=[]){let r=[];function n(i,o){const l=p.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:h,...g}=f,x=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(x.Provider,{value:v,children:h})};d.displayName=i+"Provider";function u(f,m){var x;const h=((x=m==null?void 0:m[e])==null?void 0:x[c])||l,g=p.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=r.map(o=>p.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,K4(s,...t)]}function K4(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function Y4(e){const t=G4(e),r=p.forwardRef((n,s)=>{const{children:i,...o}=n,l=p.Children.toArray(i),c=l.find(X4);if(c){const d=c.props.children,u=l.map(f=>f===c?p.Children.count(d)>1?p.Children.only(null):p.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...o,ref:s,children:p.isValidElement(d)?p.cloneElement(d,void 0,u):null})}return a.jsx(t,{...o,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function G4(e){const t=p.forwardRef((r,n)=>{const{children:s,...i}=r;if(p.isValidElement(s)){const o=Z4(s),l=Q4(i,s.props);return s.type!==p.Fragment&&(l.ref=n?wj(n,o):o),p.cloneElement(s,l)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var V4=Symbol("radix.slottable");function X4(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===V4}function Q4(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function Z4(e){var n,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var J4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],AN=J4.reduce((e,t)=>{const r=Y4(`Primitive.${t}`),n=p.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),$u="Switch",[eR]=H4($u),[tR,rR]=eR($u),EN=p.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...f}=e,[m,h]=p.useState(null),g=iu(t,b=>h(b)),x=p.useRef(!1),v=m?u||!!m.closest("form"):!0,[y,j]=QP({prop:s,defaultProp:i??!1,onChange:d,caller:$u});return a.jsxs(tR,{scope:r,checked:y,disabled:l,children:[a.jsx(AN.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":RN(y),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:g,onClick:xs(e.onClick,b=>{j(N=>!N),v&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),v&&a.jsx(IN,{control:m,bubbles:!x.current,name:n,value:c,checked:y,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});EN.displayName=$u;var DN="SwitchThumb",TN=p.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=rR(DN,r);return a.jsx(AN.span,{"data-state":RN(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});TN.displayName=DN;var nR="SwitchBubbleInput",IN=p.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const o=p.useRef(null),l=iu(o,i),c=ZP(r),d=JP(t);return p.useEffect(()=>{const u=o.current;if(!u)return;const f=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&h){const g=new Event("click",{bubbles:n});h.call(u,r),u.dispatchEvent(g)}},[c,r,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});IN.displayName=nR;function RN(e){return e?"checked":"unchecked"}var $N=EN,aR=TN;const to=p.forwardRef(({className:e,...t},r)=>a.jsx($N,{className:T("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:a.jsx(aR,{className:T("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));to.displayName=$N.displayName;function sR(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?ue(new Date(e.start_date),"MMM d"):"—",r=e.end_date?ue(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function zu({open:e,onClose:t,projectId:r,defaultStatus:n="backlog",defaultTaskListId:s,defaultParentId:i}){const o=kt(),{workspace:l,projectKey:c}=qt(),{workspace:d}=De(),[u,f]=p.useState(""),[m,h]=p.useState(""),[g,x]=p.useState(n),[v,y]=p.useState("medium"),[j,b]=p.useState("task"),[N,k]=p.useState([]),[w,S]=p.useState(""),[C,P]=p.useState(s??""),[M,A]=p.useState(void 0),[_,D]=p.useState(void 0),[O,R]=p.useState(!1),[F,H]=p.useState("weekly"),[ne,G]=p.useState(void 0),oe=Xj(),{data:ce}=Ji(r),{data:B}=eo(r||void 0),{data:Y}=$l(r||void 0),U=(B??[]).filter(V=>V.status!=="completed"),X=ce&&ce.length>0?Object.fromEntries(ce.map(V=>[V.key,V.name])):$s,$=()=>{f(""),h(""),x(n),y("medium"),b("task"),k([]),S(""),P(s??""),A(void 0),D(void 0),R(!1),H("weekly"),G(void 0),t()},K=V=>{V.preventDefault(),u.trim()&&oe.mutate({title:u.trim(),description:m.trim()||void 0,status:g,priority:v,type:j,project_id:r,workspace_id:d.id,assignee_ids:N.length>0?N:void 0,sprint_id:w||null,task_list_id:C||null,parent_id:i||null,start_date:M?ue(M,"yyyy-MM-dd"):null,due_date:_?ue(_,"yyyy-MM-dd"):null,recurrence_frequency:O?F:void 0,recurrence_end_date:O&&ne?ue(ne,"yyyy-MM-dd"):void 0},{onSuccess:()=>{z.success("Issue created"),$()},onError:L=>z.error(L.message??"Failed to create issue")})};return a.jsx(Qs,{open:e,onOpenChange:V=>!V&&$(),children:a.jsxs(Zs,{className:"max-w-md",children:[a.jsx(Vi,{children:a.jsx(Qi,{children:"New issue"})}),a.jsxs("form",{onSubmit:K,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(Xi,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(gt,{htmlFor:"issue-title",children:"Title"}),a.jsx(Ee,{id:"issue-title",placeholder:"Issue title",value:u,onChange:V=>f(V.target.value),autoFocus:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(gt,{htmlFor:"issue-desc",children:["Description ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(Au,{id:"issue-desc",placeholder:"Add more context...",value:m,onChange:V=>h(V.target.value)})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(gt,{children:"Status"}),a.jsxs(Fe,{value:g,onValueChange:x,children:[a.jsx(Re,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx($e,{children:Object.entries(X).map(([V,L])=>a.jsx(be,{value:V,className:"text-xs",children:L},V))})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(gt,{children:"Priority"}),a.jsxs(Fe,{value:v,onValueChange:y,children:[a.jsx(Re,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx($e,{children:Object.entries(wn).map(([V,L])=>a.jsx(be,{value:V,className:"text-xs",children:L},V))})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(gt,{children:"Type"}),a.jsxs(Fe,{value:j,onValueChange:b,children:[a.jsx(Re,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx($e,{children:Object.entries(Ja).map(([V,L])=>a.jsx(be,{value:V,className:"text-xs",children:L},V))})]})]})]}),i&&a.jsx("div",{className:"rounded-md bg-muted/50 border border-border px-3 py-2 text-xs text-muted-foreground",children:"Will be created as a child issue"}),(Y??[]).length>0&&!i&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(gt,{children:["List ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Fe,{value:C||"none",onValueChange:V=>P(V==="none"?"":V),children:[a.jsx(Re,{className:"h-8 text-xs",children:a.jsx(Ye,{placeholder:"No list"})}),a.jsxs($e,{children:[a.jsx(be,{value:"none",className:"text-xs",children:a.jsx("span",{className:"text-muted-foreground",children:"No list"})}),(Y??[]).map(V=>a.jsx(be,{value:V.id,className:"text-xs",children:V.name},V.id))]})]})]}),U.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(gt,{children:["Sprint ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Fe,{value:w||"none",onValueChange:V=>S(V==="none"?"":V),children:[a.jsx(Re,{className:"h-8 text-xs",children:a.jsx(Ye,{placeholder:"No sprint"})}),a.jsxs($e,{children:[a.jsx(be,{value:"none",className:"text-xs",children:a.jsx("span",{className:"text-muted-foreground",children:"No sprint"})}),U.map(V=>{const L=sR(V);return a.jsx(be,{value:V.id,className:"text-xs",children:a.jsxs("div",{children:[a.jsx("span",{children:V.name}),L&&a.jsx("span",{className:"block text-[10px] text-muted-foreground leading-tight",children:L})]})},V.id)})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(gt,{children:["Assignees ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(zl,{value:N,onChange:k})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(gt,{children:["Start Date ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-2 h-9 w-full rounded-md border border-input px-3 text-sm bg-transparent hover:bg-accent transition-colors text-left",children:[a.jsx(cr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:M?"text-foreground":"text-muted-foreground",children:M?ue(M,"MMM d, yyyy"):"No start date"}),M&&a.jsx("button",{type:"button",onClick:V=>{V.stopPropagation(),A(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(nt,{className:"h-3.5 w-3.5"})})]})}),a.jsx(yt,{className:"w-auto p-0",align:"start",children:a.jsx(dr,{mode:"single",selected:M,onSelect:A,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(gt,{children:["Due Date ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-2 h-9 w-full rounded-md border border-input px-3 text-sm bg-transparent hover:bg-accent transition-colors text-left",children:[a.jsx(cr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:_?"text-foreground":"text-muted-foreground",children:_?ue(_,"MMM d, yyyy"):"No due date"}),_&&a.jsx("button",{type:"button",onClick:V=>{V.stopPropagation(),D(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(nt,{className:"h-3.5 w-3.5"})})]})}),a.jsx(yt,{className:"w-auto p-0",align:"start",children:a.jsx(dr,{mode:"single",selected:_,onSelect:D,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(to,{id:"recurring",checked:O,onCheckedChange:R}),a.jsxs(gt,{htmlFor:"recurring",className:"cursor-pointer font-normal flex items-center gap-1.5",children:[a.jsx(Go,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Recurring"]})]}),O&&a.jsx("div",{className:"space-y-3 pl-4 border-l-2 border-indigo-200 dark:border-indigo-800",children:a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(gt,{children:"Frequency"}),a.jsxs(Fe,{value:F,onValueChange:V=>H(V),children:[a.jsx(Re,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsxs($e,{children:[a.jsx(be,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(be,{value:"monthly",className:"text-xs",children:"Monthly"})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(gt,{children:["Until ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-2 h-8 w-full rounded-md border border-input px-3 text-xs bg-transparent hover:bg-accent transition-colors text-left",children:[a.jsx(cr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:ne?"text-foreground":"text-muted-foreground",children:ne?ue(ne,"MMM d, yyyy"):"No end date"}),ne&&a.jsx("button",{type:"button",onClick:V=>{V.stopPropagation(),G(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(nt,{className:"h-3.5 w-3.5"})})]})}),a.jsx(yt,{className:"w-auto p-0",align:"start",children:a.jsx(dr,{mode:"single",selected:ne,onSelect:G,initialFocus:!0})})]})]})]})})]})]}),a.jsxs(Il,{className:"flex-col-reverse sm:flex-row sm:items-center sm:justify-between gap-2",children:[a.jsxs(Z,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 justify-start sm:justify-center",onClick:()=>{$(),o(`/${l}/projects/${c}/issues/new`)},children:[a.jsx(s1,{className:"h-3.5 w-3.5"}),"Open full form"]}),a.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[a.jsx(Z,{type:"button",variant:"ghost",onClick:$,children:"Cancel"}),a.jsx(Z,{type:"submit",disabled:!u.trim()||oe.isPending,children:oe.isPending?"Creating...":"Create issue"})]})]})]})]})})}const ng={byIssue:e=>["attachments",e]};function zN(e){return Le({queryKey:ng.byIssue(e),queryFn:()=>te.get(`/admin/issues/${e}/attachments`),select:t=>t.attachments,enabled:!!e})}function LN(e){const t=Ne();return we({mutationFn:({file:r,commentId:n})=>{const s=new FormData;return s.append("file",r),n&&s.append("comment_id",n),te.upload(`/admin/issues/${e}/attachments`,s)},onSuccess:()=>{t.invalidateQueries({queryKey:ng.byIssue(e)})}})}function iR(e){const t=Ne();return we({mutationFn:r=>te.delete(`/admin/issues/${e}/attachments/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:ng.byIssue(e)})}})}function Zo(e){return e.startsWith("image/")}function Lu(e){return e.startsWith("video/")}function Fu(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function td(e){if(e.startsWith("/"))return!0;try{const{protocol:t}=new URL(e);return t==="http:"||t==="https:"}catch{return!1}}function ag(e,t){if(!td(e)){console.error("downloadFile: blocked unsafe URL",e);return}const r=document.createElement("a");r.href=e,r.download=t,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}function sg({mimeType:e,className:t}){return Zo(e)?a.jsx(mE,{className:t}):Lu(e)?a.jsx(mu,{className:t}):e.startsWith("text/")||e.includes("json")?a.jsx(fE,{className:t}):e.includes("zip")||e.includes("tar")||e.includes("gz")?a.jsx(uE,{className:t}):e.includes("pdf")||e.includes("word")||e.includes("document")?a.jsx(hE,{className:t}):a.jsx(pE,{className:t})}function FN({attachment:e,onClose:t}){return e?a.jsx(Qs,{open:!0,onOpenChange:r=>!r&&t(),children:a.jsxs(Zs,{className:"max-w-2xl w-full p-0 overflow-hidden",children:[a.jsxs(Vi,{className:"flex-row items-center justify-between px-4 py-3 border-b border-border shrink-0 pr-10",children:[a.jsx(Qi,{className:"text-sm font-medium truncate",children:e.original_name}),a.jsxs(Z,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:()=>ag(e.url,e.original_name),children:[a.jsx(Pp,{className:"h-3.5 w-3.5"}),"Download"]})]}),a.jsxs(Xi,{className:"flex items-center justify-center bg-black/5 dark:bg-black/30 min-h-[320px] max-h-[75vh] overflow-auto p-0",children:[Zo(e.mime_type)&&td(e.url)&&a.jsx("img",{src:e.url,alt:e.original_name,className:"max-w-full max-h-[75vh] object-contain"}),Lu(e.mime_type)&&td(e.url)&&a.jsx("video",{src:e.url,controls:!0,className:"max-w-full max-h-[75vh]"})]}),a.jsxs("div",{className:"px-4 py-2 border-t border-border text-[11px] text-muted-foreground flex items-center gap-3 shrink-0",children:[a.jsx("span",{children:Fu(e.size)}),a.jsx("span",{children:"·"}),a.jsx("span",{children:e.mime_type}),a.jsx("span",{children:"·"}),a.jsxs("span",{children:["Uploaded ",ue(new Date(e.created_at),"MMM d, yyyy")]})]})]})}):null}function oR({attachment:e}){const[t,r]=p.useState(null),n=Zo(e.mime_type)||Lu(e.mime_type),s=()=>{n?r(e):ag(e.url,e.original_name)};return a.jsxs(a.Fragment,{children:[Zo(e.mime_type)?a.jsx("button",{type:"button",onClick:s,className:"block rounded-md overflow-hidden border border-border hover:opacity-90 transition-opacity",title:e.original_name,children:a.jsx("img",{src:td(e.url)?e.url:"",alt:e.original_name,className:"max-h-48 max-w-xs object-cover"})}):a.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-2 px-2.5 py-1.5 rounded-lg border border-border bg-muted/40 hover:bg-muted transition-colors text-left max-w-xs",title:n?"View":"Download",children:[a.jsx(sg,{mimeType:e.mime_type,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"text-xs text-foreground truncate",children:e.original_name}),a.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:Fu(e.size)}),!n&&a.jsx(Pp,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}),t&&a.jsx(FN,{attachment:t,onClose:()=>r(null)})]})}function lR({attachment:e,onOpen:t,onDelete:r,isDeleting:n}){const s=Zo(e.mime_type)||Lu(e.mime_type),i=()=>{s?t(e):ag(e.url,e.original_name)};return a.jsxs("div",{className:"flex items-center gap-3 py-2.5 px-3 rounded-lg hover:bg-muted/50 group transition-colors",children:[a.jsx("button",{type:"button",onClick:i,className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground hover:bg-primary/10 hover:text-primary transition-colors",title:s?"View":"Download",children:a.jsx(sg,{mimeType:e.mime_type,className:"h-4 w-4"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("button",{type:"button",onClick:i,className:"text-xs font-medium text-foreground truncate block text-left w-full hover:underline",children:e.original_name}),a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5 flex items-center gap-1.5",children:[a.jsx("span",{children:Fu(e.size)}),a.jsx("span",{children:"·"}),a.jsx("span",{children:ue(new Date(e.created_at),"MMM d, yyyy")}),e.comment_id&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"·"}),a.jsx("span",{className:"italic",children:"from comment"})]}),!s&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"·"}),a.jsxs("span",{className:"flex items-center gap-0.5",children:[a.jsx(Pp,{className:"h-2.5 w-2.5"}),"Click to download"]})]})]})]}),a.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all",onClick:()=>r(e.id),disabled:n,children:a.jsx(Hr,{className:"h-3.5 w-3.5"})})]})}function cR({onFiles:e,isUploading:t}){const[r,n]=p.useState(!1),s=p.useRef(null),i=p.useCallback(o=>{o.preventDefault(),n(!1);const l=Array.from(o.dataTransfer.files);l.length>0&&e(l)},[e]);return a.jsxs("div",{onDragOver:o=>{o.preventDefault(),n(!0)},onDragLeave:()=>n(!1),onDrop:i,onClick:()=>{var o;return!t&&((o=s.current)==null?void 0:o.click())},className:T("flex flex-col items-center justify-center gap-1.5 rounded-xl border-2 border-dashed px-4 py-6","cursor-pointer transition-colors",r?"border-primary/60 bg-primary/5":"border-border hover:border-muted-foreground/40 hover:bg-muted/30",t&&"opacity-60 cursor-wait"),children:[a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted",children:a.jsx(LE,{className:"h-4 w-4 text-muted-foreground"})}),a.jsx("p",{className:"text-xs font-medium text-foreground",children:t?"Uploading…":"Drop files or click to browse"}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Up to 50 MB per file"}),a.jsx("input",{ref:s,type:"file",multiple:!0,className:"hidden",onChange:o=>{const l=Array.from(o.target.files??[]);l.length>0&&e(l),o.target.value=""}})]})}function dR({issueId:e,className:t}){const[r,n]=p.useState(null),{data:s,isLoading:i}=zN(e),o=LN(e),l=iR(e),c=u=>{u.forEach(f=>{o.mutate({file:f},{onSuccess:()=>z.success(`${f.name} uploaded`),onError:()=>z.error(`Failed to upload ${f.name}`)})})},d=u=>{l.mutate(u,{onSuccess:()=>z.success("Attachment removed"),onError:()=>z.error("Failed to remove attachment")})};return a.jsxs("div",{className:T("px-6 py-4 space-y-4",t),children:[a.jsx(cR,{onFiles:c,isUploading:o.isPending}),i?a.jsx("div",{className:"space-y-2",children:[1,2].map(u=>a.jsxs("div",{className:"flex items-center gap-3 px-3",children:[a.jsx(le,{className:"h-8 w-8 rounded-md shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3 w-2/3"}),a.jsx(le,{className:"h-2.5 w-1/3"})]})]},u))}):s&&s.length>0?a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[a.jsx(Ep,{className:"h-3 w-3 text-muted-foreground"}),a.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:[s.length," ",s.length===1?"file":"files"]})]}),a.jsx("div",{children:s.map(u=>a.jsx(lR,{attachment:u,onOpen:n,onDelete:d,isDeleting:l.isPending},u.id))})]}):a.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No attachments yet."}),a.jsx(FN,{attachment:r,onClose:()=>n(null)})]})}const es={byIssue:e=>["time-logs",e],activeTimer:e=>["time-logs",e,"active-timer"]};function uR(e){return Le({queryKey:es.byIssue(e),queryFn:()=>te.get(`/admin/issues/${e}/time-logs`),enabled:!!e})}function fR(e){return Le({queryKey:es.activeTimer(e),queryFn:()=>te.get(`/admin/issues/${e}/time-logs/timer`),select:t=>t.active_timer,enabled:!!e,refetchInterval:1e4})}function mR(e){const t=Ne();return we({mutationFn:r=>te.post(`/admin/issues/${e}/time-logs`,r),onSuccess:()=>{t.invalidateQueries({queryKey:es.byIssue(e)})}})}function hR(e){const t=Ne();return we({mutationFn:()=>te.post(`/admin/issues/${e}/time-logs/timer`,{action:"start"}),onSuccess:()=>{t.invalidateQueries({queryKey:es.activeTimer(e)}),t.invalidateQueries({queryKey:es.byIssue(e)})}})}function pR(e){const t=Ne();return we({mutationFn:()=>te.post(`/admin/issues/${e}/time-logs/timer`,{action:"stop"}),onSuccess:()=>{t.invalidateQueries({queryKey:es.activeTimer(e)}),t.invalidateQueries({queryKey:es.byIssue(e)})}})}function gR(e){const t=Ne();return we({mutationFn:r=>te.delete(`/admin/issues/${e}/time-logs/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:es.byIssue(e)})}})}const xR=kl("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium 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",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground",muted:"border-transparent bg-muted text-muted-foreground"}},defaultVariants:{variant:"default"}});function Bu({className:e,variant:t,...r}){return a.jsx("div",{className:T(xR({variant:t}),e),...r})}function ih(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function Vv(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/1e3),n=Math.floor(r/3600),s=Math.floor(r%3600/60),i=r%60,o=String(s).padStart(2,"0"),l=String(i).padStart(2,"0");return n>0?`${n}:${o}:${l}`:`${o}:${l}`}function vR({startedAt:e}){const[t,r]=p.useState(()=>Vv(e));return p.useEffect(()=>{const n=setInterval(()=>r(Vv(e)),1e3);return()=>clearInterval(n)},[e]),a.jsx("span",{className:"font-mono tabular-nums text-sm font-semibold text-foreground",children:t})}function yR({onSubmit:e,isPending:t,onCancel:r}){const[n,s]=p.useState(""),[i,o]=p.useState(""),[l,c]=p.useState(""),[d,u]=p.useState(new Date().toISOString().split("T")[0]),f=m=>{m.preventDefault();const h=parseInt(n||"0",10),g=parseInt(i||"0",10),x=h*60+g;if(x<=0){z.error("Please enter a duration greater than 0.");return}e({duration_minutes:x,description:l.trim()||void 0,logged_date:d||void 0})};return a.jsxs("form",{onSubmit:f,className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[a.jsx("p",{className:"text-xs font-medium text-foreground",children:"Log time manually"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Hours"}),a.jsx(Ee,{type:"number",min:"0",max:"999",placeholder:"0",value:n,onChange:m=>s(m.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Minutes"}),a.jsx(Ee,{type:"number",min:"0",max:"59",placeholder:"0",value:i,onChange:m=>o(m.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Date"}),a.jsx(Ee,{type:"date",value:d,onChange:m=>u(m.target.value),className:"h-8 text-sm"})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:["Description ",a.jsx("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),a.jsx(Ee,{placeholder:"What did you work on?",value:l,onChange:m=>c(m.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:r,className:"h-7 text-xs",children:"Cancel"}),a.jsx(Z,{type:"submit",size:"sm",disabled:t,className:"h-7 text-xs",children:t?"Saving…":"Log time"})]})]})}function bR({entry:e,userName:t,onDelete:r,isDeleting:n}){const s=e.started_at!=null&&e.stopped_at==null;return a.jsxs("div",{className:"flex items-start gap-3 py-2.5 px-3 rounded-lg hover:bg-muted/50 group transition-colors",children:[a.jsx("div",{className:T("flex h-7 w-7 shrink-0 items-center justify-center rounded-full mt-0.5",s?"bg-emerald-50 dark:bg-emerald-950/40":"bg-muted"),children:s?a.jsx(IE,{className:"h-3.5 w-3.5 text-emerald-600"}):e.source==="timer"?a.jsx(Yn,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(cE,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s?a.jsx(vR,{startedAt:e.started_at}):a.jsx("span",{className:"text-sm font-semibold text-foreground tabular-nums",children:ih(e.duration_minutes??0)}),a.jsx(Bu,{variant:"muted",className:T("text-[10px] px-1.5 py-0",s?"bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400":""),children:s?"Running":e.source==="timer"?"Timer":"Manual"}),t&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:t})]}),e.description&&a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.logged_date&&!s&&a.jsx("p",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:ue(new Date(e.logged_date),"MMM d, yyyy")})]}),!s&&a.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all mt-0.5",onClick:()=>r(e.id),disabled:n,children:a.jsx(Hr,{className:"h-3.5 w-3.5"})})]})}function wR({issueId:e,className:t}){const[r,n]=p.useState(!1),{data:s,isLoading:i}=uR(e),{data:o}=fR(e),{data:l}=Js(),c=mR(e),d=hR(e),u=pR(e),f=gR(e),m=(s==null?void 0:s.time_logs)??[],h=(s==null?void 0:s.total_minutes)??0,g=o!=null,x=b=>{c.mutate(b,{onSuccess:()=>{n(!1),z.success("Time logged")},onError:()=>z.error("Failed to log time")})},v=()=>{d.mutate(void 0,{onSuccess:()=>z.success("Timer started"),onError:b=>z.error(b.message??"Failed to start timer")})},y=()=>{u.mutate(void 0,{onSuccess:b=>{const N=b.time_log.duration_minutes??0;z.success(`Timer stopped — ${ih(N)} logged`)},onError:()=>z.error("Failed to stop timer")})},j=b=>{f.mutate(b,{onSuccess:()=>z.success("Time entry removed"),onError:()=>z.error("Failed to remove entry")})};return a.jsxs("div",{className:T("px-6 py-4 space-y-4",t),children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider font-medium mb-0.5",children:"Total logged"}),a.jsx("p",{className:"text-xl font-bold text-foreground tabular-nums",children:h>0?ih(h):"—"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!r&&a.jsxs(Z,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>n(!0),children:[a.jsx(it,{className:"h-3.5 w-3.5"}),"Log time"]}),g?a.jsxs(Z,{size:"sm",variant:"destructive",className:"h-8 text-xs gap-1.5",onClick:y,disabled:u.isPending,children:[a.jsx(ME,{className:"h-3.5 w-3.5 fill-current"}),"Stop"]}):a.jsxs(Z,{size:"sm",className:"h-8 text-xs gap-1.5 bg-emerald-600 hover:bg-emerald-700 text-white",onClick:v,disabled:d.isPending,children:[a.jsx(mu,{className:"h-3.5 w-3.5 fill-current"}),"Start"]})]})]}),r&&a.jsx(yR,{onSubmit:x,isPending:c.isPending,onCancel:()=>n(!1)}),i?a.jsx("div",{className:"space-y-2",children:[1,2].map(b=>a.jsxs("div",{className:"flex items-center gap-3 px-3",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3 w-1/3"}),a.jsx(le,{className:"h-2.5 w-1/4"})]})]},b))}):m.length>0?a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx(Yn,{className:"h-3 w-3 text-muted-foreground"}),a.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:[m.length," ",m.length===1?"entry":"entries"]})]}),a.jsx("div",{children:m.map(b=>{var N;return a.jsx(bR,{entry:b,userName:(N=l==null?void 0:l.get(b.user_id))==null?void 0:N.name,onDelete:j,isDeleting:f.isPending},b.id)})})]}):a.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No time logged yet."})]})}function us({onClick:e,active:t,title:r,children:n}){return a.jsx("button",{type:"button",title:r,onMouseDown:s=>{s.preventDefault(),e()},className:T("flex h-6 w-6 items-center justify-center rounded transition-colors shrink-0","text-muted-foreground hover:text-foreground hover:bg-muted",t&&"bg-muted text-foreground"),children:n})}function Xv(){return a.jsx("span",{className:"mx-0.5 h-3.5 w-px shrink-0 bg-border"})}function BN({issueId:e,compact:t,className:r,onSuccess:n}){const[s,i]=p.useState(!0),[o,l]=p.useState([]),[c,d]=p.useState(!1),u=p.useRef(null),f=p.useRef(async()=>{}),{user:m}=De(),h=rE(e),g=LN(e),x=(m==null?void 0:m.first_name)??"",v=(m==null?void 0:m.last_name)??"",y=`${x} ${v}`.trim()||(m==null?void 0:m.email)||"?",j=m&&`${x[0]??""}${v[0]??""}`.toUpperCase()||"?",b=KN(y),N=p.useMemo(()=>_M.create({name:"submitShortcut",addKeyboardShortcuts(){return{"Mod-Enter":()=>(f.current(),!0)}}}),[]),k=Mj({extensions:[Aj,Ej,Dj.configure({placeholder:"Leave a comment…"}),N],editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:_}){i(_.isEmpty)}}),w=!s||o.length>0,S=25*1024*1024,C=_=>{const D=_.filter(R=>R.size>S);D.length>0&&z.error(`Files must be under 25 MB: ${D.map(R=>R.name).join(", ")}`);const O=_.filter(R=>R.size<=S);l(R=>{const F=new Set(R.map(H=>`${H.name}-${H.size}`));return[...R,...O.filter(H=>!F.has(`${H.name}-${H.size}`))]})},P=_=>{l(D=>D.filter((O,R)=>R!==_))},M=async()=>{if(!(!w||c)){d(!0);try{const _=k!=null&&k.isEmpty?"":(k==null?void 0:k.getHTML())??"",O=(await h.mutateAsync(_||" ")).comment.id;for(const R of o)await g.mutateAsync({file:R,commentId:O});k==null||k.commands.clearContent(),i(!0),l([]),z.success("Comment added"),n==null||n()}catch{z.error("Failed to add comment")}finally{d(!1)}}};f.current=M;const A="h-3 w-3";return a.jsxs("div",{className:T("flex gap-3 items-start",r),children:[a.jsx(Bt,{className:"h-7 w-7 shrink-0 mt-1",children:a.jsx(Wt,{className:T("text-[11px] font-semibold",b.bg,b.text),children:j})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:T("rounded-md border border-input overflow-hidden transition-shadow","focus-within:ring-1 focus-within:ring-ring",c&&"opacity-60 pointer-events-none"),children:[k&&a.jsxs("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-border/70 bg-muted/30",children:[a.jsx(us,{title:"Bold (⌘B)",active:k.isActive("bold"),onClick:()=>k.chain().focus().toggleBold().run(),children:a.jsx(Zj,{className:A})}),a.jsx(us,{title:"Italic (⌘I)",active:k.isActive("italic"),onClick:()=>k.chain().focus().toggleItalic().run(),children:a.jsx(o1,{className:A})}),a.jsx(us,{title:"Strikethrough",active:k.isActive("strike"),onClick:()=>k.chain().focus().toggleStrike().run(),children:a.jsx(m1,{className:A})}),a.jsx(us,{title:"Inline code",active:k.isActive("code"),onClick:()=>k.chain().focus().toggleCode().run(),children:a.jsx(n1,{className:A})}),a.jsx(Xv,{}),a.jsx(us,{title:"Bullet list",active:k.isActive("bulletList"),onClick:()=>k.chain().focus().toggleBulletList().run(),children:a.jsx(c1,{className:A})}),a.jsx(us,{title:"Ordered list",active:k.isActive("orderedList"),onClick:()=>k.chain().focus().toggleOrderedList().run(),children:a.jsx(l1,{className:A})}),a.jsx(Xv,{}),a.jsx(us,{title:"Code block",active:k.isActive("codeBlock"),onClick:()=>k.chain().focus().toggleCodeBlock().run(),children:a.jsx(r1,{className:A})})]}),a.jsx(Tj,{editor:k,className:T("px-3 py-2.5 text-sm",t?"min-h-[68px]":"min-h-[80px]")})]}),o.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:o.map((_,D)=>a.jsxs("span",{className:"inline-flex items-center gap-1 pl-1.5 pr-1 py-0.5 rounded-md bg-muted border border-border text-[11px] text-foreground max-w-[180px]",children:[a.jsx(sg,{mimeType:_.type,className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"truncate",children:_.name}),a.jsxs("span",{className:"text-muted-foreground shrink-0",children:["(",Fu(_.size),")"]}),a.jsx("button",{type:"button",onClick:()=>P(D),className:"ml-0.5 rounded hover:text-destructive transition-colors shrink-0",children:a.jsx(nt,{className:"h-3 w-3"})})]},D))}),a.jsxs("div",{className:"flex items-center justify-between mt-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Z,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>{var _;return(_=u.current)==null?void 0:_.click()},disabled:c,title:"Attach files",children:a.jsx(Ep,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-[11px] text-muted-foreground/50 hidden sm:block",children:[a.jsx("kbd",{className:"px-1 py-0.5 rounded border border-border bg-muted font-mono text-[10px]",children:"⌘ Enter"})," to submit"]})]}),a.jsx(Z,{size:"icon",className:"h-8 w-8",onClick:M,disabled:!w||c,children:a.jsx(_E,{className:"h-3.5 w-3.5"})})]}),a.jsx("input",{ref:u,type:"file",multiple:!0,className:"hidden",onChange:_=>{const D=Array.from(_.target.files??[]);D.length>0&&C(D),_.target.value=""}})]})]})}/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:WN,setPrototypeOf:Qv,isFrozen:jR,getPrototypeOf:NR,getOwnPropertyDescriptor:kR}=Object;let{freeze:br,seal:nn,create:oh}=Object,{apply:lh,construct:ch}=typeof Reflect<"u"&&Reflect;br||(br=function(t){return t});nn||(nn=function(t){return t});lh||(lh=function(t,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i];return t.apply(r,s)});ch||(ch=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return new t(...n)});const wc=wr(Array.prototype.forEach),SR=wr(Array.prototype.lastIndexOf),Zv=wr(Array.prototype.pop),No=wr(Array.prototype.push),CR=wr(Array.prototype.splice),Kc=wr(String.prototype.toLowerCase),hm=wr(String.prototype.toString),pm=wr(String.prototype.match),ko=wr(String.prototype.replace),_R=wr(String.prototype.indexOf),OR=wr(String.prototype.trim),hn=wr(Object.prototype.hasOwnProperty),hr=wr(RegExp.prototype.test),So=PR(TypeError);function wr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return lh(e,t,n)}}function PR(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ch(e,r)}}function Ie(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Kc;Qv&&Qv(e,null);let n=t.length;for(;n--;){let s=t[n];if(typeof s=="string"){const i=r(s);i!==s&&(jR(t)||(t[n]=i),s=i)}e[s]=!0}return e}function MR(e){for(let t=0;t<e.length;t++)hn(e,t)||(e[t]=null);return e}function Tn(e){const t=oh(null);for(const[r,n]of WN(e))hn(e,r)&&(Array.isArray(n)?t[r]=MR(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Tn(n):t[r]=n);return t}function Co(e,t){for(;e!==null;){const n=kR(e,t);if(n){if(n.get)return wr(n.get);if(typeof n.value=="function")return wr(n.value)}e=NR(e)}function r(){return null}return r}const Jv=br(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),gm=br(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xm=br(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),AR=br(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),vm=br(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ER=br(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ey=br(["#text"]),ty=br(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ym=br(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ry=br(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),jc=br(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),DR=nn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),TR=nn(/<%[\w\W]*|[\w\W]*%>/gm),IR=nn(/\$\{[\w\W]*/gm),RR=nn(/^data-[\-\w.\u00B7-\uFFFF]+$/),$R=nn(/^aria-[\-\w]+$/),UN=nn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zR=nn(/^(?:\w+script|data):/i),LR=nn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qN=nn(/^html$/i),FR=nn(/^[a-z][.\w]*(-[.\w]+)+$/i);var ny=Object.freeze({__proto__:null,ARIA_ATTR:$R,ATTR_WHITESPACE:LR,CUSTOM_ELEMENT:FR,DATA_ATTR:RR,DOCTYPE_NAME:qN,ERB_EXPR:TR,IS_ALLOWED_URI:UN,IS_SCRIPT_OR_DATA:zR,MUSTACHE_EXPR:DR,TMPLIT_EXPR:IR});const _o={element:1,text:3,progressingInstruction:7,comment:8,document:9},BR=function(){return typeof window>"u"?null:window},WR=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";r&&r.hasAttribute(s)&&(n=r.getAttribute(s));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},ay=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function HN(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:BR();const t=Se=>HN(Se);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==_o.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,s=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:h}=e,g=c.prototype,x=Co(g,"cloneNode"),v=Co(g,"remove"),y=Co(g,"nextSibling"),j=Co(g,"childNodes"),b=Co(g,"parentNode");if(typeof o=="function"){const Se=r.createElement("template");Se.content&&Se.content.ownerDocument&&(r=Se.content.ownerDocument)}let N,k="";const{implementation:w,createNodeIterator:S,createDocumentFragment:C,getElementsByTagName:P}=r,{importNode:M}=n;let A=ay();t.isSupported=typeof WN=="function"&&typeof b=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:_,ERB_EXPR:D,TMPLIT_EXPR:O,DATA_ATTR:R,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:ne,CUSTOM_ELEMENT:G}=ny;let{IS_ALLOWED_URI:oe}=ny,ce=null;const B=Ie({},[...Jv,...gm,...xm,...vm,...ey]);let Y=null;const U=Ie({},[...ty,...ym,...ry,...jc]);let X=Object.seal(oh(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,K=null;const V=Object.seal(oh(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let L=!0,se=!0,he=!1,Q=!0,Pe=!1,re=!0,Oe=!1,Ce=!1,q=!1,ve=!1,Me=!1,We=!1,Ue=!0,Ct=!1;const _t="user-content-";let ur=!0,Sr=!1,dt={},bt=null;const Gr=Ie({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ia=null;const Vr=Ie({},["audio","video","img","source","image","track"]);let Xn=null;const Rr=Ie({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$r="http://www.w3.org/1998/Math/MathML",fr="http://www.w3.org/2000/svg",nr="http://www.w3.org/1999/xhtml";let Vt=nr,_n=!1,Qn=null;const ke=Ie({},[$r,fr,nr],hm);let de=Ie({},["mi","mo","mn","ms","mtext"]),pe=Ie({},["annotation-xml"]);const ie=Ie({},["title","style","font","a","script"]);let fe=null;const qe=["application/xhtml+xml","text/html"],ee="text/html";let ye=null,Ae=null;const ut=r.createElement("form"),Xe=function(I){return I instanceof RegExp||I instanceof Function},Qe=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ae&&Ae===I)){if((!I||typeof I!="object")&&(I={}),I=Tn(I),fe=qe.indexOf(I.PARSER_MEDIA_TYPE)===-1?ee:I.PARSER_MEDIA_TYPE,ye=fe==="application/xhtml+xml"?hm:Kc,ce=hn(I,"ALLOWED_TAGS")?Ie({},I.ALLOWED_TAGS,ye):B,Y=hn(I,"ALLOWED_ATTR")?Ie({},I.ALLOWED_ATTR,ye):U,Qn=hn(I,"ALLOWED_NAMESPACES")?Ie({},I.ALLOWED_NAMESPACES,hm):ke,Xn=hn(I,"ADD_URI_SAFE_ATTR")?Ie(Tn(Rr),I.ADD_URI_SAFE_ATTR,ye):Rr,Ia=hn(I,"ADD_DATA_URI_TAGS")?Ie(Tn(Vr),I.ADD_DATA_URI_TAGS,ye):Vr,bt=hn(I,"FORBID_CONTENTS")?Ie({},I.FORBID_CONTENTS,ye):Gr,$=hn(I,"FORBID_TAGS")?Ie({},I.FORBID_TAGS,ye):Tn({}),K=hn(I,"FORBID_ATTR")?Ie({},I.FORBID_ATTR,ye):Tn({}),dt=hn(I,"USE_PROFILES")?I.USE_PROFILES:!1,L=I.ALLOW_ARIA_ATTR!==!1,se=I.ALLOW_DATA_ATTR!==!1,he=I.ALLOW_UNKNOWN_PROTOCOLS||!1,Q=I.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pe=I.SAFE_FOR_TEMPLATES||!1,re=I.SAFE_FOR_XML!==!1,Oe=I.WHOLE_DOCUMENT||!1,ve=I.RETURN_DOM||!1,Me=I.RETURN_DOM_FRAGMENT||!1,We=I.RETURN_TRUSTED_TYPE||!1,q=I.FORCE_BODY||!1,Ue=I.SANITIZE_DOM!==!1,Ct=I.SANITIZE_NAMED_PROPS||!1,ur=I.KEEP_CONTENT!==!1,Sr=I.IN_PLACE||!1,oe=I.ALLOWED_URI_REGEXP||UN,Vt=I.NAMESPACE||nr,de=I.MATHML_TEXT_INTEGRATION_POINTS||de,pe=I.HTML_INTEGRATION_POINTS||pe,X=I.CUSTOM_ELEMENT_HANDLING||{},I.CUSTOM_ELEMENT_HANDLING&&Xe(I.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=I.CUSTOM_ELEMENT_HANDLING.tagNameCheck),I.CUSTOM_ELEMENT_HANDLING&&Xe(I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),I.CUSTOM_ELEMENT_HANDLING&&typeof I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pe&&(se=!1),Me&&(ve=!0),dt&&(ce=Ie({},ey),Y=[],dt.html===!0&&(Ie(ce,Jv),Ie(Y,ty)),dt.svg===!0&&(Ie(ce,gm),Ie(Y,ym),Ie(Y,jc)),dt.svgFilters===!0&&(Ie(ce,xm),Ie(Y,ym),Ie(Y,jc)),dt.mathMl===!0&&(Ie(ce,vm),Ie(Y,ry),Ie(Y,jc))),I.ADD_TAGS&&(typeof I.ADD_TAGS=="function"?V.tagCheck=I.ADD_TAGS:(ce===B&&(ce=Tn(ce)),Ie(ce,I.ADD_TAGS,ye))),I.ADD_ATTR&&(typeof I.ADD_ATTR=="function"?V.attributeCheck=I.ADD_ATTR:(Y===U&&(Y=Tn(Y)),Ie(Y,I.ADD_ATTR,ye))),I.ADD_URI_SAFE_ATTR&&Ie(Xn,I.ADD_URI_SAFE_ATTR,ye),I.FORBID_CONTENTS&&(bt===Gr&&(bt=Tn(bt)),Ie(bt,I.FORBID_CONTENTS,ye)),I.ADD_FORBID_CONTENTS&&(bt===Gr&&(bt=Tn(bt)),Ie(bt,I.ADD_FORBID_CONTENTS,ye)),ur&&(ce["#text"]=!0),Oe&&Ie(ce,["html","head","body"]),ce.table&&(Ie(ce,["tbody"]),delete $.tbody),I.TRUSTED_TYPES_POLICY){if(typeof I.TRUSTED_TYPES_POLICY.createHTML!="function")throw So('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof I.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw So('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');N=I.TRUSTED_TYPES_POLICY,k=N.createHTML("")}else N===void 0&&(N=WR(h,s)),N!==null&&typeof k=="string"&&(k=N.createHTML(""));br&&br(I),Ae=I}},mr=Ie({},[...gm,...xm,...AR]),Xt=Ie({},[...vm,...ER]),On=function(I){let ae=b(I);(!ae||!ae.tagName)&&(ae={namespaceURI:Vt,tagName:"template"});const ge=Kc(I.tagName),ot=Kc(ae.tagName);return Qn[I.namespaceURI]?I.namespaceURI===fr?ae.namespaceURI===nr?ge==="svg":ae.namespaceURI===$r?ge==="svg"&&(ot==="annotation-xml"||de[ot]):!!mr[ge]:I.namespaceURI===$r?ae.namespaceURI===nr?ge==="math":ae.namespaceURI===fr?ge==="math"&&pe[ot]:!!Xt[ge]:I.namespaceURI===nr?ae.namespaceURI===fr&&!pe[ot]||ae.namespaceURI===$r&&!de[ot]?!1:!Xt[ge]&&(ie[ge]||!mr[ge]):!!(fe==="application/xhtml+xml"&&Qn[I.namespaceURI]):!1},Pn=function(I){No(t.removed,{element:I});try{b(I).removeChild(I)}catch{v(I)}},ls=function(I,ae){try{No(t.removed,{attribute:ae.getAttributeNode(I),from:ae})}catch{No(t.removed,{attribute:null,from:ae})}if(ae.removeAttribute(I),I==="is")if(ve||Me)try{Pn(ae)}catch{}else try{ae.setAttribute(I,"")}catch{}},nv=function(I){let ae=null,ge=null;if(q)I="<remove></remove>"+I;else{const Ot=pm(I,/^[\r\n\t ]+/);ge=Ot&&Ot[0]}fe==="application/xhtml+xml"&&Vt===nr&&(I='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+I+"</body></html>");const ot=N?N.createHTML(I):I;if(Vt===nr)try{ae=new m().parseFromString(ot,fe)}catch{}if(!ae||!ae.documentElement){ae=w.createDocument(Vt,"template",null);try{ae.documentElement.innerHTML=_n?k:ot}catch{}}const ar=ae.body||ae.documentElement;return I&&ge&&ar.insertBefore(r.createTextNode(ge),ar.childNodes[0]||null),Vt===nr?P.call(ae,Oe?"html":"body")[0]:Oe?ae.documentElement:ar},av=function(I){return S.call(I.ownerDocument||I,I,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Hf=function(I){return I instanceof f&&(typeof I.nodeName!="string"||typeof I.textContent!="string"||typeof I.removeChild!="function"||!(I.attributes instanceof u)||typeof I.removeAttribute!="function"||typeof I.setAttribute!="function"||typeof I.namespaceURI!="string"||typeof I.insertBefore!="function"||typeof I.hasChildNodes!="function")},sv=function(I){return typeof l=="function"&&I instanceof l};function Zn(Se,I,ae){wc(Se,ge=>{ge.call(t,I,ae,Ae)})}const iv=function(I){let ae=null;if(Zn(A.beforeSanitizeElements,I,null),Hf(I))return Pn(I),!0;const ge=ye(I.nodeName);if(Zn(A.uponSanitizeElement,I,{tagName:ge,allowedTags:ce}),re&&I.hasChildNodes()&&!sv(I.firstElementChild)&&hr(/<[/\w!]/g,I.innerHTML)&&hr(/<[/\w!]/g,I.textContent)||I.nodeType===_o.progressingInstruction||re&&I.nodeType===_o.comment&&hr(/<[/\w]/g,I.data))return Pn(I),!0;if(!(V.tagCheck instanceof Function&&V.tagCheck(ge))&&(!ce[ge]||$[ge])){if(!$[ge]&&lv(ge)&&(X.tagNameCheck instanceof RegExp&&hr(X.tagNameCheck,ge)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ge)))return!1;if(ur&&!bt[ge]){const ot=b(I)||I.parentNode,ar=j(I)||I.childNodes;if(ar&&ot){const Ot=ar.length;for(let Cr=Ot-1;Cr>=0;--Cr){const Jn=x(ar[Cr],!0);Jn.__removalCount=(I.__removalCount||0)+1,ot.insertBefore(Jn,y(I))}}}return Pn(I),!0}return I instanceof c&&!On(I)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&hr(/<\/no(script|embed|frames)/i,I.innerHTML)?(Pn(I),!0):(Pe&&I.nodeType===_o.text&&(ae=I.textContent,wc([_,D,O],ot=>{ae=ko(ae,ot," ")}),I.textContent!==ae&&(No(t.removed,{element:I.cloneNode()}),I.textContent=ae)),Zn(A.afterSanitizeElements,I,null),!1)},ov=function(I,ae,ge){if(Ue&&(ae==="id"||ae==="name")&&(ge in r||ge in ut))return!1;if(!(se&&!K[ae]&&hr(R,ae))){if(!(L&&hr(F,ae))){if(!(V.attributeCheck instanceof Function&&V.attributeCheck(ae,I))){if(!Y[ae]||K[ae]){if(!(lv(I)&&(X.tagNameCheck instanceof RegExp&&hr(X.tagNameCheck,I)||X.tagNameCheck instanceof Function&&X.tagNameCheck(I))&&(X.attributeNameCheck instanceof RegExp&&hr(X.attributeNameCheck,ae)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(ae,I))||ae==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&hr(X.tagNameCheck,ge)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ge))))return!1}else if(!Xn[ae]){if(!hr(oe,ko(ge,ne,""))){if(!((ae==="src"||ae==="xlink:href"||ae==="href")&&I!=="script"&&_R(ge,"data:")===0&&Ia[I])){if(!(he&&!hr(H,ko(ge,ne,"")))){if(ge)return!1}}}}}}}return!0},lv=function(I){return I!=="annotation-xml"&&pm(I,G)},cv=function(I){Zn(A.beforeSanitizeAttributes,I,null);const{attributes:ae}=I;if(!ae||Hf(I))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let ot=ae.length;for(;ot--;){const ar=ae[ot],{name:Ot,namespaceURI:Cr,value:Jn}=ar,ai=ye(Ot),Kf=Jn;let Qt=Ot==="value"?Kf:OR(Kf);if(ge.attrName=ai,ge.attrValue=Qt,ge.keepAttr=!0,ge.forceKeepAttr=void 0,Zn(A.uponSanitizeAttribute,I,ge),Qt=ge.attrValue,Ct&&(ai==="id"||ai==="name")&&(ls(Ot,I),Qt=_t+Qt),re&&hr(/((--!?|])>)|<\/(style|title|textarea)/i,Qt)){ls(Ot,I);continue}if(ai==="attributename"&&pm(Qt,"href")){ls(Ot,I);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){ls(Ot,I);continue}if(!Q&&hr(/\/>/i,Qt)){ls(Ot,I);continue}Pe&&wc([_,D,O],uv=>{Qt=ko(Qt,uv," ")});const dv=ye(I.nodeName);if(!ov(dv,ai,Qt)){ls(Ot,I);continue}if(N&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Cr)switch(h.getAttributeType(dv,ai)){case"TrustedHTML":{Qt=N.createHTML(Qt);break}case"TrustedScriptURL":{Qt=N.createScriptURL(Qt);break}}if(Qt!==Kf)try{Cr?I.setAttributeNS(Cr,Ot,Qt):I.setAttribute(Ot,Qt),Hf(I)?Pn(I):Zv(t.removed)}catch{ls(Ot,I)}}Zn(A.afterSanitizeAttributes,I,null)},kP=function Se(I){let ae=null;const ge=av(I);for(Zn(A.beforeSanitizeShadowDOM,I,null);ae=ge.nextNode();)Zn(A.uponSanitizeShadowNode,ae,null),iv(ae),cv(ae),ae.content instanceof i&&Se(ae.content);Zn(A.afterSanitizeShadowDOM,I,null)};return t.sanitize=function(Se){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ae=null,ge=null,ot=null,ar=null;if(_n=!Se,_n&&(Se="<!-->"),typeof Se!="string"&&!sv(Se))if(typeof Se.toString=="function"){if(Se=Se.toString(),typeof Se!="string")throw So("dirty is not a string, aborting")}else throw So("toString is not a function");if(!t.isSupported)return Se;if(Ce||Qe(I),t.removed=[],typeof Se=="string"&&(Sr=!1),Sr){if(Se.nodeName){const Jn=ye(Se.nodeName);if(!ce[Jn]||$[Jn])throw So("root node is forbidden and cannot be sanitized in-place")}}else if(Se instanceof l)ae=nv("<!---->"),ge=ae.ownerDocument.importNode(Se,!0),ge.nodeType===_o.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?ae=ge:ae.appendChild(ge);else{if(!ve&&!Pe&&!Oe&&Se.indexOf("<")===-1)return N&&We?N.createHTML(Se):Se;if(ae=nv(Se),!ae)return ve?null:We?k:""}ae&&q&&Pn(ae.firstChild);const Ot=av(Sr?Se:ae);for(;ot=Ot.nextNode();)iv(ot),cv(ot),ot.content instanceof i&&kP(ot.content);if(Sr)return Se;if(ve){if(Me)for(ar=C.call(ae.ownerDocument);ae.firstChild;)ar.appendChild(ae.firstChild);else ar=ae;return(Y.shadowroot||Y.shadowrootmode)&&(ar=M.call(n,ar,!0)),ar}let Cr=Oe?ae.outerHTML:ae.innerHTML;return Oe&&ce["!doctype"]&&ae.ownerDocument&&ae.ownerDocument.doctype&&ae.ownerDocument.doctype.name&&hr(qN,ae.ownerDocument.doctype.name)&&(Cr="<!DOCTYPE "+ae.ownerDocument.doctype.name+`>
|
|
536
|
-
`+Cr),Pe&&wc([_,D,O],Jn=>{Cr=ko(Cr,Jn," ")}),N&&We?N.createHTML(Cr):Cr},t.setConfig=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qe(Se),Ce=!0},t.clearConfig=function(){Ae=null,Ce=!1},t.isValidAttribute=function(Se,I,ae){Ae||Qe({});const ge=ye(Se),ot=ye(I);return ov(ge,ot,ae)},t.addHook=function(Se,I){typeof I=="function"&&No(A[Se],I)},t.removeHook=function(Se,I){if(I!==void 0){const ae=SR(A[Se],I);return ae===-1?void 0:CR(A[Se],ae,1)[0]}return Zv(A[Se])},t.removeHooks=function(Se){A[Se]=[]},t.removeAllHooks=function(){A=ay()},t}var UR=HN();function qR({onClick:e,active:t,disabled:r,title:n,children:s}){return a.jsx("button",{type:"button",title:n,disabled:r,onMouseDown:i=>{i.preventDefault(),e()},className:T("flex h-[26px] w-[26px] items-center justify-center rounded transition-colors shrink-0","text-muted-foreground hover:text-foreground hover:bg-muted","disabled:opacity-30 disabled:cursor-not-allowed",t&&"bg-muted text-foreground"),children:s})}function Nc(){return a.jsx("span",{className:"mx-0.5 h-4 w-px shrink-0 bg-border"})}function ig({content:e="",onChange:t,placeholder:r="Add a description…",className:n,toolbarClassName:s,editorClassName:i}){const o=Mj({extensions:[Aj.configure({heading:{levels:[1,2,3]}}),Ej,OM,PM.configure({nested:!0}),Dj.configure({placeholder:r})],content:e||"",editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:d}){t&&t(d.isEmpty?"":d.getHTML())}});if(!o)return null;const l=(d,u,f,m,h)=>a.jsx(qR,{title:d,onClick:f,active:m,disabled:h,children:u},d),c="h-3.5 w-3.5";return a.jsxs("div",{className:T("flex flex-col overflow-hidden",n),children:[a.jsxs("div",{className:T("flex flex-wrap items-center gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30",s),children:[l("Undo",a.jsx(zE,{className:c}),()=>o.chain().focus().undo().run(),!1,!o.can().undo()),l("Redo",a.jsx(CE,{className:c}),()=>o.chain().focus().redo().run(),!1,!o.can().redo()),a.jsx(Nc,{}),l("Bold (⌘B)",a.jsx(Zj,{className:c}),()=>o.chain().focus().toggleBold().run(),o.isActive("bold")),l("Italic (⌘I)",a.jsx(o1,{className:c}),()=>o.chain().focus().toggleItalic().run(),o.isActive("italic")),l("Underline (⌘U)",a.jsx($E,{className:c}),()=>o.chain().focus().toggleUnderline().run(),o.isActive("underline")),l("Strikethrough",a.jsx(m1,{className:c}),()=>o.chain().focus().toggleStrike().run(),o.isActive("strike")),l("Inline code",a.jsx(n1,{className:c}),()=>o.chain().focus().toggleCode().run(),o.isActive("code")),a.jsx(Nc,{}),l("Heading 1",a.jsx(gE,{className:c}),()=>o.chain().focus().toggleHeading({level:1}).run(),o.isActive("heading",{level:1})),l("Heading 2",a.jsx(xE,{className:c}),()=>o.chain().focus().toggleHeading({level:2}).run(),o.isActive("heading",{level:2})),l("Heading 3",a.jsx(vE,{className:c}),()=>o.chain().focus().toggleHeading({level:3}).run(),o.isActive("heading",{level:3})),a.jsx(Nc,{}),l("Bullet list",a.jsx(c1,{className:c}),()=>o.chain().focus().toggleBulletList().run(),o.isActive("bulletList")),l("Ordered list",a.jsx(l1,{className:c}),()=>o.chain().focus().toggleOrderedList().run(),o.isActive("orderedList")),l("Task list",a.jsx(bE,{className:c}),()=>o.chain().focus().toggleTaskList().run(),o.isActive("taskList")),a.jsx(Nc,{}),l("Blockquote",a.jsx(SE,{className:c}),()=>o.chain().focus().toggleBlockquote().run(),o.isActive("blockquote")),l("Code block",a.jsx(r1,{className:c}),()=>o.chain().focus().toggleCodeBlock().run(),o.isActive("codeBlock")),l("Divider line",a.jsx(Hi,{className:c}),()=>o.chain().focus().setHorizontalRule().run())]}),a.jsx(Tj,{editor:o,className:T("flex-1 px-5 py-4",i)})]})}function og({html:e,className:t}){return e?a.jsx("div",{className:T("meridian-editor",t),dangerouslySetInnerHTML:{__html:UR.sanitize(e)}}):null}const sy=[{bg:"bg-indigo-100 dark:bg-indigo-900/50",text:"text-indigo-700 dark:text-indigo-300"},{bg:"bg-violet-100 dark:bg-violet-900/50",text:"text-violet-700 dark:text-violet-300"},{bg:"bg-emerald-100 dark:bg-emerald-900/50",text:"text-emerald-700 dark:text-emerald-300"},{bg:"bg-amber-100 dark:bg-amber-900/50",text:"text-amber-700 dark:text-amber-300"},{bg:"bg-rose-100 dark:bg-rose-900/50",text:"text-rose-700 dark:text-rose-300"},{bg:"bg-sky-100 dark:bg-sky-900/50",text:"text-sky-700 dark:text-sky-300"},{bg:"bg-teal-100 dark:bg-teal-900/50",text:"text-teal-700 dark:text-teal-300"},{bg:"bg-orange-100 dark:bg-orange-900/50",text:"text-orange-700 dark:text-orange-300"}];function KN(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)&65535;return sy[t%sy.length]}function HR({body:e}){const t=e.trim();return t?/^<[a-z][\s\S]*>/i.test(t)?a.jsx(og,{html:t,className:"text-xs"}):a.jsx("p",{className:"text-xs text-foreground leading-relaxed whitespace-pre-wrap",children:t}):null}const iy={created:{icon:it,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40"},status_changed:{icon:Cp,color:"text-indigo-500",bg:"bg-indigo-50 dark:bg-indigo-950/40"},assigned:{icon:Ki,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40"},unassigned:{icon:h1,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800"},updated:{icon:Ds,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40"}};function KR(e,t){var s,i,o,l;const{action:r,changes:n}=e;if(r==="created")return"created this issue";if(r==="status_changed"){const c=(s=n==null?void 0:n.status)==null?void 0:s.from,d=(i=n==null?void 0:n.status)==null?void 0:i.to;return a.jsxs(a.Fragment,{children:["changed status",c&&a.jsxs(a.Fragment,{children:[" from ",a.jsx("strong",{className:"font-medium text-foreground",children:$s[c]??c})]}),d&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:$s[d]??d})]})]})}if(r==="assigned"||r==="unassigned"){const c=((o=n==null?void 0:n.assignee_ids)==null?void 0:o.to)??[],d=((l=n==null?void 0:n.assignee_ids)==null?void 0:l.from)??[],u=c.filter(h=>!d.includes(h)),f=d.filter(h=>!c.includes(h)),m=h=>{var g;return((g=t==null?void 0:t.get(h))==null?void 0:g.name)??h.slice(0,8)+"…"};return u.length>0&&f.length>0?a.jsx(a.Fragment,{children:"updated assignees"}):u.length>0?a.jsxs(a.Fragment,{children:["assigned ",a.jsx("strong",{className:"font-medium text-foreground",children:u.map(m).join(", ")})]}):f.length>0?a.jsxs(a.Fragment,{children:["unassigned ",a.jsx("strong",{className:"font-medium text-foreground",children:f.map(m).join(", ")})]}):"updated assignees"}if(r==="updated"&&n){const c=[];for(const[d,u]of Object.entries(n)){const{from:f,to:m}=u;d==="title"||d==="description"?c.push(a.jsxs("span",{children:["updated ",a.jsx("strong",{className:"font-medium text-foreground",children:d})]},d)):d==="priority"?c.push(a.jsxs("span",{children:["changed ",a.jsx("strong",{className:"font-medium text-foreground",children:"priority"}),f!=null&&a.jsxs(a.Fragment,{children:[" from ",a.jsx("strong",{className:"font-medium text-foreground",children:wn[f]??String(f)})]}),m!=null&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:wn[m]??String(m)})]})]},d)):d==="type"?c.push(a.jsxs("span",{children:["changed ",a.jsx("strong",{className:"font-medium text-foreground",children:"type"}),f!=null&&a.jsxs(a.Fragment,{children:[" from ",a.jsx("strong",{className:"font-medium text-foreground",children:Ja[f]??String(f)})]}),m!=null&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:Ja[m]??String(m)})]})]},d)):c.push(a.jsxs("span",{children:["updated ",a.jsx("strong",{className:"font-medium text-foreground",children:d.replace(/_/g," ")})]},d))}return c.length===0?"made changes":a.jsx(a.Fragment,{children:c.reduce((d,u,f)=>f===0?[u]:[...d,a.jsx("span",{children:" and "},`sep-${f}`),u],[])})}return r.replace(/_/g," ")}function YN({issueId:e,className:t,compact:r,onViewMore:n,onTabChange:s,hideCommentInput:i}){const[o,l]=p.useState("comments"),c=y=>{l(y),s==null||s(y)},{user:d}=De(),{data:u}=Js(),{data:f,isLoading:m}=eE(e),{data:h,isLoading:g}=tE(e),{data:x}=zN(e),v=y=>{var j;if(d&&y===d.id){const b=d.first_name??"",N=d.last_name??"",k=`${b} ${N}`.trim()||d.email,w=(b[0]??N[0]??((j=d.email)==null?void 0:j[0])??"U").toUpperCase();return{name:k,initials:w}}return(u==null?void 0:u.get(y))??{name:"Unknown",initials:"?"}};return a.jsxs("div",{className:t,children:[a.jsx("div",{className:"flex items-center gap-0 px-6 pt-3 border-b border-zinc-100 dark:border-zinc-800",children:["comments","activity","attachments","time"].map(y=>{const j=y==="comments"?(f==null?void 0:f.length)??0:y==="activity"?(h==null?void 0:h.length)??0:void 0,b=y==="comments"?"Comments":y==="activity"?"Activity":y==="attachments"?"Attachments":"Time",N=o===y;return a.jsxs("button",{onClick:()=>c(y),className:T("pb-2.5 mr-5 text-xs font-medium transition-colors border-b-2 -mb-px",N?"text-indigo-700 dark:text-indigo-300 border-indigo-500 dark:border-indigo-400":"border-transparent text-zinc-500 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200"),children:[b,j!=null&&j>0&&a.jsx("span",{className:T("ml-1.5 text-[10px] tabular-nums font-normal",N?"text-indigo-700 dark:text-indigo-500":"text-zinc-400"),children:j})]},y)})}),o==="comments"&&a.jsxs("div",{className:"px-6 pb-5 pt-4",children:[a.jsx("div",{className:"space-y-5 mb-5",children:m?a.jsxs("div",{className:"flex gap-3",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsx(le,{className:"h-16 flex-1"})]}):f&&f.length>0?(r?f.slice(-5):f).map(y=>{const j=v(y.author_id),b=KN(j.name),N=(x??[]).filter(k=>k.comment_id===y.id);return a.jsxs("div",{className:"flex gap-3",children:[a.jsx(Bt,{className:"h-7 w-7 mt-0.5 shrink-0",children:a.jsx(Wt,{className:T("text-[11px] font-semibold",b.bg,b.text),children:j.initials})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-baseline gap-2 mb-1.5",children:[a.jsx("span",{className:"text-xs font-semibold text-zinc-900 dark:text-zinc-100",children:j.name}),a.jsx("span",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:ue(new Date(y.created_at),"MMM d, h:mm a")})]}),a.jsx("div",{className:"rounded-lg bg-zinc-50 dark:bg-zinc-900 border border-zinc-100 dark:border-zinc-800 px-3 py-2.5",children:a.jsx(HR,{body:y.body})}),N.length>0&&a.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:N.map(k=>a.jsx(oR,{attachment:k},k.id))})]})]},y.id)}):a.jsxs("div",{className:"flex flex-col items-center py-6 gap-2",children:[a.jsx("div",{className:"h-9 w-9 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center",children:a.jsx(d1,{className:"h-4 w-4 text-zinc-400 dark:text-zinc-500"})}),a.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:"No comments yet"})]})}),r&&f&&f.length>5&&n&&a.jsxs("button",{onClick:n,className:"text-xs text-indigo-700 hover:text-indigo-900 dark:text-indigo-300 dark:hover:text-indigo-100 mb-4 font-medium transition-colors",children:["View all ",f.length," comments →"]}),!i&&a.jsx(BN,{issueId:e})]}),o==="activity"&&a.jsx("div",{className:"px-6 pb-6 pt-4",children:g?a.jsx("div",{className:"space-y-4",children:[1,2,3].map(y=>a.jsxs("div",{className:"flex gap-3",children:[a.jsx(le,{className:"h-6 w-6 rounded-full shrink-0 mt-0.5"}),a.jsx(le,{className:"h-4 flex-1 mt-1"})]},y))}):h&&h.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute left-[11px] top-2 bottom-2 w-px bg-zinc-100 dark:bg-zinc-800"}),a.jsx("div",{className:"space-y-0",children:(r?h.slice(-5):h).map((y,j,b)=>{var C;const N=iy[y.action]??iy.updated,k=N.icon,w=((C=u==null?void 0:u.get(y.actor_id))==null?void 0:C.name)??"System",S=j===b.length-1;return a.jsxs("div",{className:T("relative flex gap-3",S?"pb-0":"pb-4"),children:[a.jsx("div",{className:T("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full mt-0.5",N.bg),children:a.jsx(k,{className:T("h-3 w-3",N.color)})}),a.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[a.jsxs("p",{className:"text-xs text-foreground leading-relaxed",children:[a.jsx("span",{className:"font-semibold text-zinc-900 dark:text-zinc-100",children:w})," ",a.jsx("span",{className:"text-zinc-500 dark:text-zinc-400",children:KR(y,u)})]}),a.jsx("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:ue(new Date(y.created_at),"MMM d, yyyy · h:mm a")})]})]},y.id)})})]}),r&&h.length>5&&n&&a.jsxs("button",{onClick:n,className:"text-xs text-indigo-700 hover:text-indigo-900 dark:text-indigo-300 dark:hover:text-indigo-100 mt-3 font-medium transition-colors",children:["View all ",h.length," events →"]})]}):a.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 py-4",children:"No activity yet."})}),o==="attachments"&&a.jsx(dR,{issueId:e}),o==="time"&&a.jsx(wR,{issueId:e})]})}const GN=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(jj,{ref:n,className:T("relative overflow-hidden",e),...r,children:[a.jsx(eM,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(VN,{}),a.jsx(tM,{})]}));GN.displayName=jj.displayName;const VN=p.forwardRef(({className:e,orientation:t="vertical",...r},n)=>a.jsx(Nj,{ref:n,orientation:t,className:T("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-1.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-1.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:a.jsx(rM,{className:"relative flex-1 rounded-full bg-border"})}));VN.displayName=Nj.displayName;function YR(e,t){let r=0,n=e;for(;n!=null&&n.parent_id;)n=t.find(s=>s.id===n.parent_id),r++;return r}function GR(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?ue(new Date(e.start_date),"MMM d"):"—",r=e.end_date?ue(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}const VR={urgent:"bg-red-500",high:"bg-orange-500",medium:"bg-amber-500",low:"bg-sky-500",no_priority:"bg-zinc-400"};function XR(e,t){return e==="completed"?"bg-emerald-500":e==="in_progress"?"bg-indigo-500":e==="cancelled"?"bg-red-400":t!=null&&t.includes("block")?"bg-red-500":"bg-zinc-400"}const Mn=({children:e})=>a.jsx("p",{className:"text-[10px] font-semibold tracking-[0.08em] uppercase text-zinc-900 dark:text-zinc-100 mb-1.5",children:e}),Oo=()=>a.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800"});function XN({issue:e,projectId:t,open:r,onClose:n}){const s=kt(),{workspace:i,projectKey:o}=qt(),{data:l}=Vj((e==null?void 0:e.id)??""),c=l??e,[d,u]=p.useState(!1),[f,m]=p.useState(""),[h,g]=p.useState(""),[x,v]=p.useState("comments"),[y,j]=p.useState(!1),[b,N]=p.useState(new Set),k=lu((c==null?void 0:c.id)??"",t),{data:w}=Ji(t),{data:S}=eo(t||void 0),{data:C}=$l(t||void 0),{data:P}=Nl(t||void 0),{data:M}=Xp(),{data:A=[]}=Qp(new Date().getFullYear()),_=(S??[]).filter(q=>q.status!=="completed"),{data:D}=oI(),O=(D==null?void 0:D.maxChildIssueDepth)??1,F=(c?YR(c,P??[]):0)<O,H=c!=null&&c.parent_id?P==null?void 0:P.find(q=>q.id===c.parent_id):null,ne=(P==null?void 0:P.filter(q=>q.parent_id===(c==null?void 0:c.id)))??[],G=c!=null&&c.task_list_id?C==null?void 0:C.find(q=>q.id===c.task_list_id):null,oe=w&&w.length>0?Object.fromEntries(w.map(q=>[q.key,q.name])):$s;if(p.useEffect(()=>{c&&(m(c.title),g(c.description??"")),u(!1)},[c==null?void 0:c.id]),!c)return null;const ce=()=>{f.trim()&&k.mutate({title:f.trim(),description:h.trim()||void 0},{onSuccess:()=>{u(!1),z.success("Issue updated")},onError:()=>z.error("Failed to update issue")})},B=()=>{m(c.title),g(c.description??""),u(!1)},Y=q=>{k.mutate({status:q},{onSuccess:()=>z.success("Status updated"),onError:()=>z.error("Failed to update status")})},U=q=>{k.mutate({priority:q},{onSuccess:()=>z.success("Priority updated"),onError:()=>z.error("Failed to update priority")})},X=q=>{k.mutate({type:q},{onSuccess:()=>z.success("Type updated"),onError:()=>z.error("Failed to update type")})},$=q=>{k.mutate({assignee_ids:q},{onSuccess:()=>z.success("Assignees updated"),onError:()=>z.error("Failed to update assignees")})},K=q=>{k.mutate({sprint_id:q},{onSuccess:()=>z.success(q?"Sprint assigned":"Removed from sprint"),onError:()=>z.error("Failed to update sprint")})},V=q=>{k.mutate({task_list_id:q},{onSuccess:()=>z.success(q?"Moved to list":"Removed from list"),onError:()=>z.error("Failed to update list")})},L=q=>{k.mutate({start_date:q?ue(q,"yyyy-MM-dd"):null},{onSuccess:()=>z.success(q?"Start date set":"Start date cleared"),onError:()=>z.error("Failed to update start date")})},se=q=>{k.mutate({due_date:q?ue(q,"yyyy-MM-dd"):null},{onSuccess:()=>z.success(q?"Due date set":"Due date cleared"),onError:()=>z.error("Failed to update due date")})},he=q=>{if(q){const ve=c.start_date?new Date(c.start_date):new Date,Me=new Date(ve);Me.setDate(Me.getDate()+7),k.mutate({recurrence_frequency:"weekly",next_occurrence_date:ue(Me,"yyyy-MM-dd"),recurrence_end_date:null},{onSuccess:()=>z.success("Recurrence enabled"),onError:()=>z.error("Failed to enable recurrence")})}else k.mutate({recurrence_frequency:null,next_occurrence_date:null,recurrence_end_date:null},{onSuccess:()=>z.success("Recurrence stopped"),onError:()=>z.error("Failed to stop recurrence")})},Q=q=>{const ve=c.start_date?new Date(c.start_date):new Date,Me=new Date(ve);q==="weekly"?Me.setDate(Me.getDate()+7):Me.setMonth(Me.getMonth()+1),k.mutate({recurrence_frequency:q,next_occurrence_date:ue(Me,"yyyy-MM-dd")},{onSuccess:()=>z.success("Frequency updated"),onError:()=>z.error("Failed to update frequency")})},Pe=q=>{k.mutate({recurrence_end_date:q?ue(q,"yyyy-MM-dd"):null},{onSuccess:()=>z.success(q?"End date set":"End date cleared"),onError:()=>z.error("Failed to update end date")})},re=w==null?void 0:w.find(q=>q.category==="completed"),Oe=!!re&&c.status===re.key,Ce=(q,ve,Me)=>{const We=q;return a.jsx("button",{title:ve,onClick:Me,className:"h-8 w-8 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:a.jsx(We,{className:"h-4 w-4"})},ve)};return a.jsxs(a.Fragment,{children:[a.jsx(Qs,{open:r,onOpenChange:q=>!q&&n(),children:a.jsxs(Zs,{className:"flex flex-col p-0 w-full max-w-2xl overflow-hidden bg-white dark:bg-zinc-950",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border shrink-0",children:[a.jsxs("button",{onClick:()=>{var q;re&&Y(Oe?((q=w==null?void 0:w.find(ve=>ve.category==="unstarted"||ve.category==="backlog"))==null?void 0:q.key)??c.status:re.key)},className:T("flex items-center gap-1.5 px-3 py-1.5 rounded-md border text-xs font-medium transition-colors",Oe?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950/30":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/40"),children:[a.jsx(lr,{className:"h-3.5 w-3.5"}),Oe?"Completed":"Mark complete"]}),a.jsxs("div",{className:"flex items-center",children:[Ce(TE,"Upvote"),Ce(Ep,"Attachments"),F&&Ce(ua,"Add sub-issue",()=>j(!0)),Ce(uu,"Copy link",()=>{navigator.clipboard.writeText(`${window.location.origin}/${i}/projects/${o}/issues/${c.id}`),z.success("Link copied")}),Ce(wE,"Open full page",()=>{n(),s(`/${i}/projects/${o}/issues/${c.id}`)}),d?a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[a.jsx(Z,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:B,children:"Cancel"}),a.jsxs(Z,{size:"sm",className:"h-7 text-xs",onClick:ce,disabled:!f.trim()||k.isPending,children:[a.jsx(lr,{className:"h-3.5 w-3.5 mr-1"}),"Save"]})]}):a.jsxs(ln,{children:[a.jsx(cn,{asChild:!0,children:Ce(Ys,"More options")}),a.jsx(Kr,{align:"end",className:"w-40",children:a.jsxs(ht,{onClick:()=>u(!0),children:[a.jsx(Ds,{className:"h-3.5 w-3.5 mr-2"}),"Edit"]})})]}),Ce(kE,"Open in full page",()=>{n(),s(`/${i}/projects/${o}/issues/${c.id}`)})]})]}),a.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:d?a.jsx(Ee,{value:f,onChange:q=>m(q.target.value),className:"text-sm font-medium h-8",autoFocus:!0}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[a.jsx("span",{className:"text-[11px] font-mono font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/60 px-1.5 py-0.5 rounded",children:c.identifier}),a.jsx("span",{className:"text-[10px] font-semibold tracking-widest uppercase text-violet-500 dark:text-violet-400",children:Ja[c.type]??c.type}),c.recurrence_frequency&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium text-emerald-700 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950/50 border border-emerald-200 dark:border-emerald-800 px-1.5 py-0.5 rounded",children:[a.jsx(Go,{className:"h-2.5 w-2.5"}),"Repeats ",c.recurrence_frequency==="weekly"?"Weekly":"Monthly"]}),c.recurrence_source_id&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 px-1.5 py-0.5 rounded",children:[a.jsx(Go,{className:"h-2.5 w-2.5"}),"Recurring instance"]})]}),a.jsx("h2",{className:"text-[17px] font-semibold leading-snug text-zinc-900 dark:text-zinc-50",children:c.title})]})}),a.jsxs(GN,{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"px-6 pb-4 space-y-5 min-w-0",children:[a.jsx(yr,{zone:"issue.details.before",props:{issue:c}}),a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx(Mn,{children:"Status"}),a.jsxs(Fe,{value:c.status,onValueChange:Y,children:[a.jsx(Re,{className:"h-8 text-xs min-w-0",children:a.jsx(Ye,{})}),a.jsx($e,{children:Object.entries(oe).map(([q,ve])=>{const Me=w==null?void 0:w.find(We=>We.key===q);return a.jsx(be,{value:q,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:T("h-2 w-2 rounded-full shrink-0 flex-none",XR(Me==null?void 0:Me.category,q))}),a.jsx("span",{children:ve})]})},q)})})]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx(Mn,{children:"Priority"}),a.jsxs(Fe,{value:c.priority,onValueChange:U,children:[a.jsx(Re,{className:"h-8 text-xs min-w-0",children:a.jsx(Ye,{})}),a.jsx($e,{children:Object.entries(wn).map(([q,ve])=>a.jsx(be,{value:q,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:T("h-2 w-2 rounded-full shrink-0 flex-none",VR[q]??"bg-zinc-400")}),a.jsx("span",{children:ve})]})},q))})]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx(Mn,{children:"Type"}),a.jsxs(Fe,{value:c.type,onValueChange:X,children:[a.jsx(Re,{className:"h-8 text-xs min-w-0",children:a.jsx(Ye,{})}),a.jsx($e,{children:Object.entries(Ja).map(([q,ve])=>a.jsx(be,{value:q,className:"text-xs",children:ve},q))})]})]})]}),a.jsx(Oo,{}),a.jsxs("div",{children:[a.jsx(Mn,{children:"Assignees"}),a.jsx(zl,{value:c.assignee_ids??[],onChange:$,disabled:k.isPending})]}),a.jsx(Oo,{}),a.jsxs("div",{className:"flex gap-3 items-start min-w-0",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Mn,{children:"Sprint"}),a.jsxs(Fe,{value:c.sprint_id??"none",onValueChange:q=>K(q==="none"?null:q),children:[a.jsx(Re,{className:"h-8 text-xs min-w-0",children:a.jsxs("div",{className:"flex items-center gap-1 min-w-0 overflow-hidden",children:[a.jsx(Er,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No sprint"})]})}),a.jsxs($e,{children:[a.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),_.map(q=>{const ve=GR(q);return a.jsx(be,{value:q.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:q.name}),ve&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:ve})]})},q.id)})]})]})]}),(C??[]).length>0&&a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Mn,{children:"List"}),a.jsxs(Fe,{value:c.task_list_id??"none",onValueChange:q=>V(q==="none"?null:q),children:[a.jsx(Re,{className:"h-8 text-xs min-w-0",children:a.jsxs("div",{className:"flex items-center gap-1 min-w-0 overflow-hidden",children:[a.jsx(Ap,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No list",children:G?G.name:"No list"})]})}),a.jsxs($e,{children:[a.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(C??[]).map(q=>a.jsx(be,{value:q.id,className:"text-xs",children:q.name},q.id))]})]})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Mn,{children:"Start Date"}),a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1 h-8 w-full min-w-0 px-2 rounded border border-input text-xs hover:bg-accent transition-colors overflow-hidden",children:[a.jsx(cr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:`truncate ${c.start_date?"text-foreground":"text-muted-foreground"}`,children:c.start_date?ue(new Date(c.start_date),"MMM d, yyyy"):"No date"})]})}),a.jsxs(yt,{className:"w-auto p-0",align:"start",children:[a.jsx(dr,{mode:"single",selected:c.start_date?new Date(c.start_date):void 0,onSelect:L,initialFocus:!0}),c.start_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>L(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(nt,{className:"h-3 w-3"}),"Clear date"]})})]})]})]}),(c==null?void 0:c.start_date)&&(c==null?void 0:c.due_date)&&(M==null?void 0:M.working_days)&&(()=>{const q=uN(new Date(c.start_date),new Date(c.due_date),M.working_days,A);return a.jsxs("div",{className:"shrink-0 self-end pb-1 text-[11px] text-muted-foreground whitespace-nowrap",children:[q," biz day",q!==1?"s":""]})})(),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Mn,{children:"Due Date"}),a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1 h-8 w-full min-w-0 px-2 rounded border border-input text-xs hover:bg-accent transition-colors overflow-hidden",children:[a.jsx(cr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:`truncate ${c.due_date?"text-foreground":"text-muted-foreground"}`,children:c.due_date?ue(new Date(c.due_date),"MMM d, yyyy"):"No date"})]})}),a.jsxs(yt,{className:"w-auto p-0",align:"start",children:[a.jsx(dr,{mode:"single",selected:c.due_date?new Date(c.due_date):void 0,onSelect:se,initialFocus:!0}),c.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>se(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(nt,{className:"h-3 w-3"}),"Clear date"]})})]})]})]})]}),a.jsx(Oo,{}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Mn,{children:"Recurring"}),a.jsx(to,{checked:!!c.recurrence_frequency,onCheckedChange:he,disabled:k.isPending})]}),c.recurrence_frequency&&a.jsxs("div",{className:"space-y-2 pl-3 border-l-2 border-indigo-200 dark:border-indigo-800",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] font-medium text-muted-foreground mb-1",children:"Frequency"}),a.jsxs(Fe,{value:c.recurrence_frequency,onValueChange:q=>Q(q),children:[a.jsx(Re,{className:"h-7 text-xs",children:a.jsx(Ye,{})}),a.jsxs($e,{children:[a.jsx(be,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(be,{value:"monthly",className:"text-xs",children:"Monthly"})]})]})]}),a.jsxs("div",{children:[a.jsxs("p",{className:"text-[10px] font-medium text-muted-foreground mb-1",children:["Until ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1 h-7 w-full px-2 rounded border border-input text-xs hover:bg-accent transition-colors text-left",children:[a.jsx(cr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:c.recurrence_end_date?"text-foreground":"text-muted-foreground",children:c.recurrence_end_date?ue(new Date(c.recurrence_end_date),"MMM d, yyyy"):"No end date"})]})}),a.jsxs(yt,{className:"w-auto p-0",align:"start",children:[a.jsx(dr,{mode:"single",selected:c.recurrence_end_date?new Date(c.recurrence_end_date):void 0,onSelect:Pe,initialFocus:!0}),c.recurrence_end_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>Pe(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(nt,{className:"h-3 w-3"}),"Clear end date"]})})]})]})]})]})]}),a.jsx(Oo,{}),F&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px] font-semibold tracking-[0.08em] uppercase text-zinc-900 dark:text-zinc-100",children:"Child Issues"}),a.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-1 px-2 py-0.5 rounded-md bg-indigo-50 dark:bg-indigo-950/50 text-indigo-700 dark:text-indigo-300 text-[11px] font-medium hover:bg-indigo-100 dark:hover:bg-indigo-900/60 transition-colors",children:[a.jsx(it,{className:"h-3 w-3"}),"Add"]})]}),H&&a.jsxs("button",{onClick:()=>s(`/${i}/projects/${o}/issues/${H.id}`),className:"flex items-center gap-2 w-full px-3 py-1.5 rounded-md bg-zinc-100 dark:bg-zinc-800/60 border border-zinc-200 dark:border-zinc-700 hover:border-indigo-300 dark:hover:border-indigo-700 transition-colors text-left",children:[a.jsx(_p,{className:"h-3.5 w-3.5 text-zinc-400 shrink-0"}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-400 shrink-0",children:"Parent:"}),a.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-700 dark:text-indigo-300 shrink-0",children:H.identifier}),a.jsx("span",{className:"text-xs text-zinc-600 dark:text-zinc-300 truncate",children:H.title})]}),ne.length===0?a.jsxs("button",{onClick:()=>j(!0),className:"w-full flex items-center justify-center gap-2 py-3.5 rounded-lg border-2 border-dashed border-zinc-200 dark:border-zinc-800 text-xs text-zinc-400 dark:text-zinc-500 hover:border-indigo-300 hover:text-indigo-500 dark:hover:border-indigo-700 dark:hover:text-indigo-400 transition-all",children:[a.jsx(it,{className:"h-3.5 w-3.5"}),"Create child issue"]}):a.jsx("div",{className:"space-y-1",children:ne.map(q=>{const ve=(P??[]).filter(Ue=>Ue.parent_id===q.id),Me=ve.length>0,We=b.has(q.id);return a.jsxs("div",{children:[a.jsxs("div",{className:"w-full flex items-center gap-2.5 px-3 py-2 rounded-lg bg-indigo-50/40 dark:bg-indigo-950/30 border border-indigo-200 dark:border-indigo-800 hover:bg-indigo-100/70 hover:border-indigo-400 dark:hover:bg-indigo-950/50 dark:hover:border-indigo-600 hover:shadow-sm transition-all group",children:[Me?a.jsx("button",{onClick:()=>N(Ue=>{const Ct=new Set(Ue);return Ct.has(q.id)?Ct.delete(q.id):Ct.add(q.id),Ct}),className:"shrink-0 text-indigo-400 dark:text-indigo-500 hover:text-indigo-600 dark:hover:text-indigo-300 transition-colors",children:We?a.jsx(Kn,{className:"h-3.5 w-3.5"}):a.jsx(kn,{className:"h-3.5 w-3.5"})}):a.jsx(yn,{className:"h-3.5 w-3.5 text-indigo-400 dark:text-indigo-500 shrink-0"}),a.jsxs("button",{onClick:()=>{n(),s(`/${i}/projects/${o}/issues/${q.id}`)},className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:[a.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-700 dark:text-indigo-300 shrink-0",children:q.identifier}),a.jsx("span",{className:"text-xs text-zinc-700 dark:text-zinc-300 truncate group-hover:text-zinc-900 dark:group-hover:text-zinc-100 transition-colors",children:q.title}),Me&&a.jsxs("span",{className:"ml-auto shrink-0 flex items-center gap-0.5 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded",children:[a.jsx(yn,{className:"h-2.5 w-2.5"}),ve.length]})]})]}),Me&&We&&a.jsx("div",{className:"mt-1 ml-6 space-y-1",children:ve.map(Ue=>a.jsxs("button",{onClick:()=>{n(),s(`/${i}/projects/${o}/issues/${Ue.id}`)},className:"w-full flex items-center gap-2.5 px-3 py-2 rounded-lg bg-indigo-50/20 dark:bg-indigo-950/20 border border-indigo-100 dark:border-indigo-900 hover:bg-indigo-100/70 hover:border-indigo-400 dark:hover:bg-indigo-950/50 dark:hover:border-indigo-600 hover:shadow-sm transition-all text-left group",children:[a.jsx(yn,{className:"h-3.5 w-3.5 text-indigo-300 dark:text-indigo-600 shrink-0"}),a.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-600 dark:text-indigo-400 shrink-0",children:Ue.identifier}),a.jsx("span",{className:"text-xs text-zinc-600 dark:text-zinc-400 truncate group-hover:text-zinc-900 dark:group-hover:text-zinc-100 transition-colors",children:Ue.title})]},Ue.id))})]},q.id)})})]}),a.jsx(Oo,{}),a.jsxs("div",{children:[a.jsx(Mn,{children:"Description"}),d?a.jsx(ig,{content:h,onChange:g,placeholder:"Add a description…",className:"min-h-[160px] rounded-md border border-input"},`${c.id}-edit`):c.description?a.jsx("div",{className:"rounded-lg bg-zinc-50 dark:bg-zinc-900/60 border border-zinc-100 dark:border-zinc-800 px-3.5 py-3",children:a.jsx(og,{html:c.description,className:"text-sm"})}):a.jsxs("button",{onClick:()=>u(!0),className:"w-full flex items-center justify-center gap-2 py-3.5 rounded-lg border-2 border-dashed border-zinc-200 dark:border-zinc-800 text-xs text-zinc-400 dark:text-zinc-500 hover:border-indigo-300 hover:text-indigo-500 dark:hover:border-indigo-700 dark:hover:text-indigo-400 transition-all",children:[a.jsx(Ds,{className:"h-3.5 w-3.5"}),"Add description"]})]})]}),a.jsx("div",{className:"px-6 py-4",children:a.jsx(yr,{zone:"issue.details.after",props:{issue:c}})}),a.jsx(YN,{issueId:c.id,className:"border-t border-border",compact:!0,hideCommentInput:!0,onTabChange:v,onViewMore:()=>{n(),s(`/${i}/projects/${o}/issues/${c.id}`)}})]}),x==="comments"&&a.jsx("div",{className:"border-t border-border px-6 py-3 shrink-0",children:a.jsx(BN,{issueId:c.id,compact:!0})})]})}),a.jsx(zu,{open:y,onClose:()=>j(!1),projectId:t,defaultParentId:c.id,defaultTaskListId:c.task_list_id})]})}function QR(){const{projectKey:e}=qt(),[t,r]=p.useState(null),[n,s]=p.useState(!1),[i,o]=p.useState({}),{data:l}=ka(e??""),c=(l==null?void 0:l.id)??"",{data:d,isLoading:u}=Nl(c||void 0,i),{data:f,isLoading:m}=Ji(c||void 0),{data:h}=_u(c),{data:g}=Js(),x=q3(c);if(!e)return null;const v=u||m||!l,y=b=>{x.mutate(b)},j=p.useMemo(()=>!(h!=null&&h.members)||!g?[]:h.members.map(b=>{const N=g.get(b.user_id);return N?{userId:b.user_id,name:N.name,initials:N.initials}:null}).filter(b=>b!==null),[h,g]);return a.jsxs("div",{className:"flex flex-col h-full gap-0",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-h-0 bg-white dark:bg-card",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border shrink-0",children:[a.jsx(tI,{statuses:f??[],members:j,filters:i,onChange:o}),a.jsxs(Z,{size:"sm",onClick:()=>s(!0),children:[a.jsx(it,{className:"h-4 w-4"}),"Create"]})]}),a.jsx(yr,{zone:"project.board.before",props:{projectId:c}}),a.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:v?a.jsx("div",{className:"flex gap-4 px-6 py-6",children:[1,2,3,4].map(b=>a.jsxs("div",{className:"min-w-[260px]",children:[a.jsx(le,{className:"h-5 w-24 mb-3 rounded"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(le,{className:"h-[82px] w-full rounded-lg"}),a.jsx(le,{className:"h-[82px] w-full rounded-lg"})]})]},b))}):a.jsx(dN,{issues:d??[],projectId:c,statuses:f??[],onIssueClick:r,onColumnsReorder:y,filters:i})})]}),a.jsx(yr,{zone:"project.board.after",props:{projectId:c}}),a.jsx(XN,{issue:t,projectId:c,open:!!t,onClose:()=>r(null)}),a.jsx(zu,{open:n,onClose:()=>s(!1),projectId:c})]})}const oy=({priority:e,className:t})=>{const r=T("h-3.5 w-3.5 shrink-0",Vp[e],t);switch(e){case"urgent":return a.jsx(ns,{className:r});case"high":return a.jsx(Cl,{className:r});case"medium":return a.jsx(Hi,{className:r});case"low":return a.jsx(Sl,{className:r});default:return a.jsx(rn,{className:T("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}},dh="grid-cols-[70px_250px_150px_120px_130px_140px_130px_32px]";function QN({issue:e,projectId:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,workspace:o,projectKey:l,onOpen:c,isChild:d=!1,children:u=[],childrenMap:f,onAddChild:m}){const h=kt(),[g,x]=p.useState(null),[v,y]=p.useState(!1),j=lu(e.id,t);function b(S){j.mutate(S),x(null)}const N=(s==null?void 0:s[e.status])??"#94a3b8",k=i.find(S=>S.id===e.sprint_id),w=u.length>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{onClick:()=>c(e),className:T(`group grid ${dh} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",d&&"bg-muted/10",j.isPending&&"opacity-70"),children:[a.jsx("span",{className:T("text-xs font-mono text-muted-foreground truncate","sticky left-0 z-10 pl-6 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",d&&"text-muted-foreground/60"),children:e.identifier}),a.jsxs("div",{className:T("flex items-center gap-1 min-w-0 pr-3","sticky left-[70px] z-10 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",d&&"bg-[#f8f9fa] dark:bg-muted/20"),children:[w?a.jsxs(qa,{children:[a.jsx(Ha,{asChild:!0,children:a.jsx("button",{onClick:S=>{S.stopPropagation(),y(!v)},className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:v?a.jsx(Kn,{className:"h-3.5 w-3.5"}):a.jsx(kn,{className:"h-3.5 w-3.5"})})}),a.jsx(da,{side:"top",children:v?"Collapse":"Expand"})]}):d?a.jsx(yn,{className:"h-3 w-3 text-muted-foreground/40 shrink-0"}):a.jsx("span",{className:"w-4 shrink-0"}),a.jsx("span",{className:T("text-sm text-foreground truncate",d&&"text-muted-foreground"),children:e.title}),w&&a.jsxs("span",{className:"shrink-0 flex items-center gap-0.5 ml-1 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded",children:[a.jsx(yn,{className:"h-2.5 w-2.5"}),u.length]})]}),a.jsx("div",{onClick:S=>S.stopPropagation(),children:a.jsxs(jt,{open:g==="status",onOpenChange:S=>x(S?"status":null),children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 max-w-full px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:N}}),a.jsx("span",{className:"text-xs text-muted-foreground truncate",children:n[e.status]??e.status})]})}),a.jsx(yt,{className:"w-52 p-1",align:"start",onClick:S=>S.stopPropagation(),children:a.jsx(Os,{children:a.jsx(Ps,{children:a.jsx(Ka,{children:r.map(S=>a.jsxs(en,{value:S.name,onSelect:()=>b({status:S.key}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:S.color}}),a.jsx("span",{className:"text-xs flex-1",children:S.name}),e.status===S.key&&a.jsx(lr,{className:"h-3.5 w-3.5 text-indigo-500"})]},S.key))})})})})]})}),a.jsx("div",{onClick:S=>S.stopPropagation(),children:a.jsxs(jt,{open:g==="priority",onOpenChange:S=>x(S?"priority":null),children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[a.jsx(oy,{priority:e.priority}),a.jsx("span",{className:"text-xs text-muted-foreground",children:wn[e.priority]??e.priority})]})}),a.jsx(yt,{className:"w-44 p-1",align:"start",onClick:S=>S.stopPropagation(),children:a.jsx(Os,{children:a.jsx(Ps,{children:a.jsx(Ka,{children:Object.entries(wn).map(([S,C])=>a.jsxs(en,{value:C,onSelect:()=>b({priority:S}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(oy,{priority:S}),a.jsx("span",{className:"text-xs flex-1",children:C}),e.priority===S&&a.jsx(lr,{className:"h-3.5 w-3.5 text-indigo-500"})]},S))})})})})]})}),a.jsx("div",{onClick:S=>S.stopPropagation(),children:a.jsxs(jt,{open:g==="sprint",onOpenChange:S=>x(S?"sprint":null),children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring max-w-full",children:[a.jsx(Er,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:T("text-xs truncate",k?"text-foreground":"text-muted-foreground"),children:(k==null?void 0:k.name)??"No sprint"})]})}),a.jsx(yt,{className:"w-56 p-1",align:"start",onClick:S=>S.stopPropagation(),children:a.jsx(Os,{children:a.jsx(Ps,{children:a.jsxs(Ka,{children:[a.jsxs(en,{value:"no-sprint",onSelect:()=>b({sprint_id:null}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(nt,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs flex-1 text-muted-foreground",children:"No sprint"}),!e.sprint_id&&a.jsx(lr,{className:"h-3.5 w-3.5 text-indigo-500"})]}),i.filter(S=>S.status!=="completed").map(S=>a.jsxs(en,{value:S.name,onSelect:()=>b({sprint_id:S.id}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(Er,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-xs truncate",children:S.name}),(S.start_date||S.end_date)&&a.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[S.start_date?ue(new Date(S.start_date),"MMM d"):"—"," → ",S.end_date?ue(new Date(S.end_date),"MMM d"):"—"]})]}),e.sprint_id===S.id&&a.jsx(lr,{className:"h-3.5 w-3.5 text-indigo-500 shrink-0"})]},S.id))]})})})})]})}),a.jsx("div",{onClick:S=>S.stopPropagation(),children:a.jsxs(jt,{open:g==="due",onOpenChange:S=>x(S?"due":null),children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[a.jsx(cr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:T("text-xs",e.due_date?"text-foreground":"text-muted-foreground"),children:e.due_date?ue(new Date(e.due_date),"MMM d, yyyy"):"No due date"})]})}),a.jsxs(yt,{className:"w-auto p-0",align:"start",onClick:S=>S.stopPropagation(),children:[a.jsx(dr,{mode:"single",selected:e.due_date?new Date(e.due_date):void 0,onSelect:S=>b({due_date:S?ue(S,"yyyy-MM-dd"):null}),initialFocus:!0}),e.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>b({due_date:null}),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(nt,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),a.jsx("div",{onClick:S=>S.stopPropagation(),children:a.jsx(zl,{value:e.assignee_ids??[],onChange:S=>j.mutate({assignee_ids:S})})}),a.jsxs("div",{className:"flex items-center gap-1 pr-6",onClick:S=>S.stopPropagation(),children:[!d&&m&&a.jsxs(qa,{children:[a.jsx(Ha,{asChild:!0,children:a.jsx("button",{onClick:()=>m(e.id),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:a.jsx(yn,{className:"h-3.5 w-3.5"})})}),a.jsx(da,{side:"top",children:"Add child issue"})]}),a.jsxs(qa,{children:[a.jsx(Ha,{asChild:!0,children:a.jsx("button",{onClick:()=>h(`/${o}/projects/${l}/issues/${e.id}`),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:a.jsx(s1,{className:"h-3.5 w-3.5"})})}),a.jsx(da,{side:"top",children:"Open full page"})]})]})]}),v&&u.map(S=>a.jsx(QN,{issue:S,projectId:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,workspace:o,projectKey:l,onOpen:c,isChild:!0,children:(f==null?void 0:f[S.id])??[],childrenMap:f,onAddChild:m},S.id))]})}function ly({taskList:e,issues:t,childrenMap:r,projectId:n,statuses:s,statusLabels:i,statusColorMap:o,sprints:l,workspace:c,projectKey:d,onOpen:u,onAddIssue:f,onAddChild:m,onRenameList:h,onDeleteList:g}){const[x,v]=p.useState(!1),[y,j]=p.useState(!1),[b,N]=p.useState((e==null?void 0:e.name)??""),k=t.reduce((C,P)=>{var M;return C+(((M=r[P.id])==null?void 0:M.length)??0)},0),w=t.length+k,S=()=>{e&&b.trim()&&h&&h(e.id,b.trim()),j(!1)};return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-2 bg-muted/20 border-b border-border group/header",children:[a.jsxs(qa,{children:[a.jsx(Ha,{asChild:!0,children:a.jsx("button",{onClick:()=>v(!x),className:"text-muted-foreground hover:text-foreground transition-colors",children:x?a.jsx(kn,{className:"h-3.5 w-3.5"}):a.jsx(Kn,{className:"h-3.5 w-3.5"})})}),a.jsx(da,{side:"right",children:x?"Expand":"Collapse"})]}),e?y?a.jsx("input",{autoFocus:!0,value:b,onChange:C=>N(C.target.value),onBlur:S,onKeyDown:C=>{C.key==="Enter"&&S(),C.key==="Escape"&&(j(!1),N(e.name))},className:"text-xs font-semibold text-foreground bg-transparent border-b border-indigo-400 outline-none px-0.5"}):a.jsx("span",{className:"text-xs font-semibold text-foreground",children:e.name}):a.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"No List"}),a.jsx("span",{className:"text-[11px] text-muted-foreground/60 font-mono",children:w}),a.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[a.jsxs("button",{onClick:()=>f((e==null?void 0:e.id)??null),className:"flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors px-1.5 py-0.5 rounded hover:bg-muted",children:[a.jsx(it,{className:"h-3 w-3"}),"Add issue"]}),e&&a.jsxs(ln,{children:[a.jsxs(qa,{children:[a.jsx(Ha,{asChild:!0,children:a.jsx(cn,{asChild:!0,children:a.jsx("button",{className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(Ys,{className:"h-3.5 w-3.5"})})})}),a.jsx(da,{side:"top",children:"More options"})]}),a.jsxs(Kr,{align:"end",className:"w-36",children:[a.jsxs(ht,{className:"text-xs gap-2 cursor-pointer",onClick:()=>{j(!0),N(e.name)},children:[a.jsx(Ds,{className:"h-3.5 w-3.5"}),"Rename"]}),a.jsxs(ht,{className:"text-xs gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>g==null?void 0:g(e.id),children:[a.jsx(Hr,{className:"h-3.5 w-3.5"}),"Delete list"]})]})]})]})]}),!x&&a.jsx("div",{className:"divide-y divide-border/60",children:t.length===0?a.jsx("div",{className:"px-14 py-3 text-xs text-muted-foreground/50 italic",children:"No issues in this list"}):t.map(C=>a.jsx(QN,{issue:C,projectId:n,statuses:s,statusLabels:i,statusColorMap:o,sprints:l,workspace:c,projectKey:d,onOpen:u,children:r[C.id]??[],childrenMap:r,onAddChild:m},C.id))})]})}function ZR(){var X;const{workspace:e,projectKey:t}=qt(),[r,n]=p.useState(null),[s,i]=p.useState({open:!1}),[o,l]=p.useState(""),[c,d]=p.useState(!1),[u,f]=p.useState(""),[m,h]=p.useState("all"),[g,x]=p.useState("all"),[v,y]=p.useState("all"),{data:j}=ka(t??""),b=(j==null?void 0:j.id)??"",{data:N,isLoading:k}=Nl(b||void 0),{data:w}=Ji(b||void 0),{data:S}=eo(b||void 0),{data:C}=$l(b||void 0),P=mI(b),M=hI(b),A=pI(b),_=w&&w.length>0?w:Object.entries($s).map(([$,K],V)=>({id:$,project_id:b,key:$,name:K,color:{backlog:"#94a3b8",todo:"#64748b",in_progress:"#6366f1",in_review:"#f59e0b",done:"#10b981",cancelled:"#9ca3af"}[$]??"#94a3b8",category:{backlog:"backlog",todo:"unstarted",in_progress:"started",in_review:"started",done:"completed",cancelled:"cancelled"}[$]??"backlog",position:V})),D=Object.fromEntries(_.map($=>[$.key,$.name])),O=Object.fromEntries(_.map($=>[$.key,$.color])),R=S??[];if(!t||!e)return null;const F=(N??[]).filter($=>{const K=!u||$.title.toLowerCase().includes(u.toLowerCase())||$.identifier.toLowerCase().includes(u.toLowerCase()),V=m==="all"||$.status===m,L=g==="all"||$.priority===g,se=v==="all"||(v==="none"?!$.sprint_id:$.sprint_id===v);return K&&V&&L&&se}).sort(($,K)=>{const V=parseInt($.identifier.split("-")[1]??"0",10),L=parseInt(K.identifier.split("-")[1]??"0",10);return V-L}),H={};for(const $ of N??[])$.parent_id&&(H[$.parent_id]||(H[$.parent_id]=[]),H[$.parent_id].push($));const ne=F.filter($=>!$.parent_id),G=F.length,oe=new Set((C??[]).map($=>$.id)),ce={__none__:[]};for(const $ of C??[])ce[$.id]=[];for(const $ of ne){const K=$.task_list_id&&oe.has($.task_list_id)?$.task_list_id:"__none__";ce[K].push($)}function B(){o.trim()&&P.mutate({name:o.trim()},{onSuccess:()=>{l(""),d(!1),z.success("List created")},onError:()=>z.error("Failed to create list")})}function Y($,K){M.mutate({id:$,name:K},{onError:()=>z.error("Failed to rename list")})}function U($){const K=C==null?void 0:C.find(V=>V.id===$);confirm(`Delete list "${K==null?void 0:K.name}"? Issues in this list will be moved to No List.`)&&A.mutate($,{onSuccess:()=>z.success("List deleted"),onError:()=>z.error("Failed to delete list")})}return a.jsxs("div",{className:"p-2",children:[a.jsx(yr,{zone:"project.issues.before",props:{projectId:b}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsx("div",{className:"flex items-center justify-end px-6 py-3 border-b border-border",children:a.jsxs("div",{className:"flex items-center gap-2",children:[c?a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Ee,{autoFocus:!0,placeholder:"List name...",value:o,onChange:$=>l($.target.value),onKeyDown:$=>{$.key==="Enter"&&B(),$.key==="Escape"&&(d(!1),l(""))},className:"h-8 text-xs w-36"}),a.jsx(Z,{size:"sm",variant:"outline",className:"h-8 text-xs",onClick:B,disabled:!o.trim()||P.isPending,children:"Add"}),a.jsx(Z,{size:"sm",variant:"ghost",className:"h-8 text-xs",onClick:()=>{d(!1),l("")},children:"Cancel"})]}):a.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>d(!0),children:[a.jsx(it,{className:"h-4 w-4"}),"New List"]}),a.jsxs(Z,{size:"sm",onClick:()=>i({open:!0}),children:[a.jsx(it,{className:"h-4 w-4"}),"Create"]})]})}),a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(Fe,{value:v,onValueChange:y,children:[a.jsx(Re,{className:"h-8 text-xs w-[140px] bg-transparent",children:a.jsx(Ye,{placeholder:"Sprint"})}),a.jsxs($e,{children:[a.jsx(be,{value:"all",className:"text-xs",children:"All sprints"}),a.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),R.map($=>a.jsx(be,{value:$.id,className:"text-xs",children:$.name},$.id))]})]}),a.jsxs(Fe,{value:m,onValueChange:h,children:[a.jsx(Re,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Ye,{placeholder:"Status"})}),a.jsxs($e,{children:[a.jsx(be,{value:"all",className:"text-xs",children:"All statuses"}),_.map(({key:$,name:K})=>a.jsx(be,{value:$,className:"text-xs",children:K},$))]})]}),a.jsxs(Fe,{value:g,onValueChange:x,children:[a.jsx(Re,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Ye,{placeholder:"Priority"})}),a.jsxs($e,{children:[a.jsx(be,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(wn).map(([$,K])=>a.jsx(be,{value:$,className:"text-xs",children:K},$))]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx(Ol,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Ee,{placeholder:"Search...",value:u,onChange:$=>f($.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("div",{className:"min-w-[1025px]",children:[a.jsxs("div",{className:T("grid items-center py-2.5 border-b border-border",dh),children:[a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-0 z-10 bg-white dark:bg-card pl-6",children:"ID"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-[70px] z-10 bg-white dark:bg-card",children:"Title"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Priority"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Sprint"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Due Date"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Assignees"}),a.jsx("span",{className:"pr-6"})]}),k?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map($=>a.jsxs("div",{className:T("grid items-center px-6 py-3 gap-4",dh),children:[a.jsx(le,{className:"h-4 w-14"}),a.jsx(le,{className:"h-4 w-56"}),a.jsx(le,{className:"h-5 w-20"}),a.jsx(le,{className:"h-4 w-16"}),a.jsx(le,{className:"h-4 w-20"}),a.jsx(le,{className:"h-4 w-24"}),a.jsx(le,{className:"h-6 w-16"}),a.jsx("span",{})]},$))}):G===0&&(N??[]).length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("p",{className:"text-sm font-medium mb-1",children:"No issues yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create your first issue to start tracking work."}),a.jsxs(Z,{size:"sm",onClick:()=>i({open:!0}),children:[a.jsx(it,{className:"h-4 w-4"}),"Create issue"]})]}):ne.length===0&&(N??[]).length>0?a.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"No issues match your filters."})}):a.jsx(ou,{delayDuration:200,children:a.jsxs("div",{className:"divide-y divide-border",children:[(C??[]).map($=>a.jsx(ly,{taskList:$,issues:ce[$.id]??[],childrenMap:H,projectId:b,statuses:_,statusLabels:D,statusColorMap:O,sprints:R,workspace:e,projectKey:t,onOpen:n,onAddIssue:K=>i({open:!0,defaultTaskListId:K}),onAddChild:K=>i({open:!0,defaultParentId:K}),onRenameList:Y,onDeleteList:U},$.id)),(((X=ce.__none__)==null?void 0:X.length)>0||(C??[]).length===0)&&a.jsx(ly,{taskList:null,issues:ce.__none__??[],childrenMap:H,projectId:b,statuses:_,statusLabels:D,statusColorMap:O,sprints:R,workspace:e,projectKey:t,onOpen:n,onAddIssue:$=>i({open:!0,defaultTaskListId:$}),onAddChild:$=>i({open:!0,defaultParentId:$})})]})})]})}),!k&&G>0&&a.jsx("div",{className:"flex items-center px-6 py-3 border-t border-border",children:a.jsxs("span",{className:"text-xs text-muted-foreground",children:[G," issue",G!==1?"s":""]})})]}),a.jsx(yr,{zone:"project.issues.after",props:{projectId:b}}),a.jsx(XN,{issue:r,projectId:b,open:!!r,onClose:()=>n(null)}),a.jsx(zu,{open:s.open,onClose:()=>i({open:!1}),projectId:b,defaultTaskListId:s.defaultTaskListId,defaultParentId:s.defaultParentId})]})}function JR(e,t=[]){let r=[];function n(i,o){const l=p.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:h,...g}=f,x=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(x.Provider,{value:v,children:h})};d.displayName=i+"Provider";function u(f,m){var x;const h=((x=m==null?void 0:m[e])==null?void 0:x[c])||l,g=p.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=r.map(o=>p.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,e$(s,...t)]}function e$(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var t$=Symbol("radix.slottable");function r$(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=t$,t}var ZN="AlertDialog",[n$]=JR(ZN,[kj]),Ca=kj(),JN=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ca(t);return a.jsx(jl,{...n,...r,modal:!0})};JN.displayName=ZN;var a$="AlertDialogTrigger",s$=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ca(r);return a.jsx(aM,{...s,...n,ref:t})});s$.displayName=a$;var i$="AlertDialogPortal",ek=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ca(t);return a.jsx(wl,{...n,...r})};ek.displayName=i$;var o$="AlertDialogOverlay",tk=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ca(r);return a.jsx(Hs,{...s,...n,ref:t})});tk.displayName=o$;var bi="AlertDialogContent",[l$,c$]=n$(bi),d$=r$("AlertDialogContent"),rk=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=Ca(r),o=p.useRef(null),l=iu(t,o),c=p.useRef(null);return a.jsx(nM,{contentName:bi,titleName:nk,docsSlug:"alert-dialog",children:a.jsx(l$,{scope:r,cancelRef:c,children:a.jsxs(Ks,{role:"alertdialog",...i,...s,ref:l,onOpenAutoFocus:xs(s.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[a.jsx(d$,{children:n}),a.jsx(f$,{contentRef:o})]})})})});rk.displayName=bi;var nk="AlertDialogTitle",ak=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ca(r);return a.jsx(Li,{...s,...n,ref:t})});ak.displayName=nk;var sk="AlertDialogDescription",ik=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ca(r);return a.jsx(Fi,{...s,...n,ref:t})});ik.displayName=sk;var u$="AlertDialogAction",ok=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ca(r);return a.jsx(su,{...s,...n,ref:t})});ok.displayName=u$;var lk="AlertDialogCancel",ck=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=c$(lk,r),i=Ca(r),o=iu(t,s);return a.jsx(su,{...i,...n,ref:o})});ck.displayName=lk;var f$=({contentRef:e})=>{const t=`\`${bi}\` requires a description for the component to be accessible for screen reader users.
|
|
537
|
-
|
|
538
|
-
You can add a description to the \`${bi}\` by passing a \`${sk}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
539
|
-
|
|
540
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${bi}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
541
|
-
|
|
542
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},m$=JN,h$=ek,dk=tk,uk=rk,fk=ok,mk=ck,hk=ak,pk=ik;const Wu=m$,p$=h$,gk=p.forwardRef(({className:e,...t},r)=>a.jsx(dk,{className:T("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));gk.displayName=dk.displayName;const Bl=p.forwardRef(({className:e,...t},r)=>a.jsxs(p$,{children:[a.jsx(gk,{}),a.jsx(uk,{ref:r,className:T("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 bg-background border border-border 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 rounded-lg",e),...t})]}));Bl.displayName=uk.displayName;const Wl=({className:e,...t})=>a.jsx("div",{className:T("flex flex-col space-y-2 text-center sm:text-left",e),...t});Wl.displayName="AlertDialogHeader";const Ul=({className:e,...t})=>a.jsx("div",{className:T("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ul.displayName="AlertDialogFooter";const ql=p.forwardRef(({className:e,...t},r)=>a.jsx(hk,{ref:r,className:T("text-base font-semibold",e),...t}));ql.displayName=hk.displayName;const Hl=p.forwardRef(({className:e,...t},r)=>a.jsx(pk,{ref:r,className:T("text-sm text-muted-foreground",e),...t}));Hl.displayName=pk.displayName;const Kl=p.forwardRef(({className:e,...t},r)=>a.jsx(fk,{ref:r,className:T(yi(),e),...t}));Kl.displayName=fk.displayName;const Yl=p.forwardRef(({className:e,...t},r)=>a.jsx(mk,{ref:r,className:T(yi({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Yl.displayName=mk.displayName;function g$({member:e,onRequestRemove:t}){var l;const r=e.user,n=(r==null?void 0:r.first_name)??"",s=(r==null?void 0:r.last_name)??"",i=`${n} ${s}`.trim()||(r==null?void 0:r.email)||"Unknown",o=(n[0]??s[0]??((l=r==null?void 0:r.email)==null?void 0:l[0])??"U").toUpperCase();return a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[a.jsx(Bt,{className:"h-8 w-8 shrink-0",children:a.jsx(Wt,{className:"text-xs font-medium",children:o})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:i}),(r==null?void 0:r.email)&&a.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:r.email})]}),a.jsx(Bu,{className:T("shrink-0 text-[11px] border-0 w-20 justify-center",e.role==="manager"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400":"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400"),children:e.role}),a.jsx(Z,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>t(e.user_id,i),children:a.jsx(nt,{className:"h-3.5 w-3.5"})})]})}function x$({teamEntry:e,onRemove:t}){const r=e.team;return a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[a.jsx("div",{className:"h-8 w-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(Ts,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:(r==null?void 0:r.name)??"Unknown team"}),r&&a.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[r.member_count," ",r.member_count===1?"member":"members"]})]}),a.jsx(Z,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>t(e.team_id),children:a.jsx(nt,{className:"h-3.5 w-3.5"})})]})}function v$(){const{projectKey:e}=qt(),{workspace:t}=De(),r=(t==null?void 0:t.id)??"",{data:n}=ka(e??""),s=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=_u(s),{data:l}=Pl(r),{data:c}=xu(r),d=w1(s),u=j1(s),f=N1(s),m=k1(s),[h,g]=p.useState(""),[x,v]=p.useState(""),[y,j]=p.useState(null),b=new Set((i==null?void 0:i.members.map(M=>M.user_id))??[]),N=new Set((i==null?void 0:i.teams.map(M=>M.team_id))??[]),k=(l??[]).filter(M=>!b.has(M.user_id)),w=(c??[]).filter(M=>!N.has(M.id)),S=(i==null?void 0:i.members.length)??0,C=(i==null?void 0:i.teams.length)??0;function P(){y&&u.mutate(y.userId,{onSuccess:()=>{z.success("Access removed"),j(null)},onError:()=>z.error("Failed to remove")})}return a.jsxs("div",{className:"p-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold",children:"Access"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Manage who has access to this project."})]}),!o&&a.jsxs("p",{className:"text-xs text-muted-foreground shrink-0",children:[S," member",S!==1?"s":""," • ",C," team",C!==1?"s":""]})]}),o?a.jsxs("div",{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"})}),a.jsx("div",{className:"divide-y divide-border",children:[1,2].map(M=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-8 w-8 rounded-full"}),a.jsx(le,{className:"h-4 w-44"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-5 w-20"})]},M))}),a.jsx("div",{className:"px-6 py-2 border-y border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"})}),a.jsx("div",{className:"divide-y divide-border",children:[1].map(M=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-8 w-8 rounded-lg"}),a.jsx(le,{className:"h-4 w-32"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-4 w-20"})]},M))})]}):a.jsxs("div",{children:[a.jsxs("div",{children:[a.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"}),k.length>0&&a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsxs(Fe,{value:h,onValueChange:g,children:[a.jsx(Re,{className:"h-8 text-xs w-full sm:w-56",children:a.jsx(Ye,{placeholder:"Add person…"})}),a.jsx($e,{children:k.map(M=>{const A=M.user,_=(A==null?void 0:A.first_name)??"",D=(A==null?void 0:A.last_name)??"",O=`${_} ${D}`.trim()||(A==null?void 0:A.email)||"Unknown";return a.jsx(be,{value:M.user_id,children:O},M.user_id)})})]}),a.jsxs(Z,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:!h||d.isPending,onClick:()=>d.mutate({userId:h},{onSuccess:()=>{z.success("Access granted"),g("")},onError:()=>z.error("Failed to grant access")}),children:[a.jsx(Ki,{className:"h-3.5 w-3.5"}),"Add"]})]})]}),S===0?a.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No individual members."}):a.jsx("div",{className:"divide-y divide-border",children:i==null?void 0:i.members.map(M=>a.jsx(g$,{member:M,onRequestRemove:(A,_)=>j({userId:A,displayName:_})},M.id))})]}),a.jsxs("div",{className:"border-t border-border",children:[a.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"}),w.length>0&&a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsxs(Fe,{value:x,onValueChange:v,children:[a.jsx(Re,{className:"h-8 text-xs w-full sm:w-56",children:a.jsx(Ye,{placeholder:"Add team…"})}),a.jsx($e,{children:w.map(M=>a.jsx(be,{value:M.id,children:M.name},M.id))})]}),a.jsxs(Z,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:!x||f.isPending,onClick:()=>f.mutate(x,{onSuccess:()=>{z.success("Team access granted"),v("")},onError:()=>z.error("Failed to add team")}),children:[a.jsx(Ts,{className:"h-3.5 w-3.5"}),"Add"]})]})]}),C===0?a.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No teams have access."}):a.jsx("div",{className:"divide-y divide-border",children:i==null?void 0:i.teams.map(M=>a.jsx(x$,{teamEntry:M,onRemove:A=>m.mutate(A,{onSuccess:()=>z.success("Team access removed"),onError:()=>z.error("Failed to remove team")})},M.id))})]}),S===0&&C===0&&k.length===0&&w.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center border-t border-border",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Ts,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No access entries yet"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Add workspace people or teams first to grant project access."})]})]})]}),a.jsx(Wu,{open:!!y,onOpenChange:M=>{M||j(null)},children:a.jsxs(Bl,{className:"sm:max-w-md",children:[a.jsxs(Wl,{children:[a.jsx(ql,{children:"Remove member access?"}),a.jsx(Hl,{children:y?`${y.displayName} will lose access to this project.`:"This member will lose access to this project."})]}),a.jsxs(Ul,{children:[a.jsx(Yl,{disabled:u.isPending,children:"Cancel"}),a.jsx(Kl,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:M=>{M.preventDefault(),P()},disabled:u.isPending,children:u.isPending?"Removing...":"Remove"})]})]})})]})}function cy(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?ue(new Date(e.start_date),"MMM d"):"—",r=e.end_date?ue(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function ta({label:e,children:t}){return a.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-border/60 last:border-0",children:[a.jsx("span",{className:"text-xs text-muted-foreground shrink-0 w-20",children:e}),a.jsx("div",{className:"flex-1 min-w-0",children:t})]})}const y$={backlog:a.jsx(rn,{className:"h-3 w-3 text-zinc-400"}),todo:a.jsx(rn,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:a.jsx(Yn,{className:"h-3 w-3 text-indigo-500"}),in_review:a.jsx(_l,{className:"h-3 w-3 text-amber-500"}),done:a.jsx(rs,{className:"h-3 w-3 text-emerald-500"}),cancelled:a.jsx(Op,{className:"h-3 w-3 text-zinc-400"})},b$={urgent:a.jsx(ns,{className:"h-3 w-3 text-red-500"}),high:a.jsx(Cl,{className:"h-3 w-3 text-orange-500"}),medium:a.jsx(Hi,{className:"h-3 w-3 text-yellow-500"}),low:a.jsx(Sl,{className:"h-3 w-3 text-blue-400"})},w$={bug:a.jsx(Jj,{className:"h-3 w-3 text-red-500"}),feature:a.jsx(u1,{className:"h-3 w-3 text-purple-500"}),task:a.jsx(f1,{className:"h-3 w-3 text-blue-500"}),chore:a.jsx(Cp,{className:"h-3 w-3 text-zinc-500"})};function bm({value:e,onValueChange:t,options:r,icons:n,placeholder:s}){return a.jsxs(Fe,{value:e,onValueChange:t,children:[a.jsx(Re,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[n[e]??a.jsx(t1,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("span",{children:r[e]??s??""})]})}),a.jsx($e,{children:Object.entries(r).map(([i,o])=>a.jsx(be,{value:i,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function j$(){const{workspace:e,projectKey:t,issueId:r}=qt(),n=kt(),[s,i]=p.useState(!1),[o,l]=p.useState(""),[c,d]=p.useState(""),[u,f]=p.useState(!1),{data:m}=ka(t??""),h=(m==null?void 0:m.id)??"",{data:g,isLoading:x}=Vj(r??""),v=lu(r??"",h),{data:y}=Ji(h||void 0),{data:j}=eo(h||void 0),{data:b}=$l(h||void 0),{data:N}=Nl(h||void 0),k=(j??[]).filter(O=>O.status!=="completed"),w=g!=null&&g.parent_id?N==null?void 0:N.find(O=>O.id===g.parent_id):null,S=(N==null?void 0:N.filter(O=>O.parent_id===r))??[],C=g!=null&&g.task_list_id?b==null?void 0:b.find(O=>O.id===g.task_list_id):null,P=y&&y.length>0?Object.fromEntries(y.map(O=>[O.key,O.name])):$s,M=y&&y.length>0?Object.fromEntries(y.map(O=>[O.key,O.category==="completed"?a.jsx(rs,{className:"h-3 w-3",style:{color:O.color}}):O.category==="started"?a.jsx(Yn,{className:"h-3 w-3",style:{color:O.color}}):a.jsx(rn,{className:"h-3 w-3",style:{color:O.color}})])):y$;if(p.useEffect(()=>{g&&(l(g.title),d(g.description??"")),i(!1)},[g==null?void 0:g.id]),!t||!r)return null;const A=()=>{o.trim()&&v.mutate({title:o.trim(),description:c.trim()||void 0},{onSuccess:()=>{i(!1),z.success("Issue updated")},onError:()=>z.error("Failed to update issue")})},_=()=>{g&&(l(g.title),d(g.description??"")),i(!1)},D=(O,R)=>{v.mutate(O,{onSuccess:()=>z.success(`${R} updated`),onError:()=>z.error(`Failed to update ${R.toLowerCase()}`)})};return x||!g?a.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[a.jsx("div",{className:"sticky top-0 z-10 h-[57px] bg-white dark:bg-card border-b border-border"}),a.jsx("div",{className:"px-2 py-2",children:a.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-6 space-y-4 shadow-sm",children:[a.jsx(le,{className:"h-7 w-3/4"}),a.jsx(le,{className:"h-32 w-full"})]}),a.jsx(le,{className:"h-24 w-full rounded-xl"}),a.jsx(le,{className:"h-48 w-full rounded-xl"})]}),a.jsx(le,{className:"h-[280px] w-full rounded-xl"})]})})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[a.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 h-[57px] bg-white dark:bg-card border-b border-border",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsxs(Z,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-muted-foreground hover:text-foreground px-2",onClick:()=>n(`/${e}/projects/${t}/issues`),children:[a.jsx(du,{className:"h-3.5 w-3.5"}),(m==null?void 0:m.name)??"Issues"]}),a.jsx("span",{className:"text-border",children:"/"}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:g.identifier}),a.jsx(Bu,{variant:"muted",className:"text-[10px] ml-1",children:Ja[g.type]??g.type})]}),a.jsx("div",{className:"flex items-center gap-2",children:s?a.jsxs(a.Fragment,{children:[a.jsx(Z,{variant:"ghost",size:"sm",onClick:_,children:"Discard"}),a.jsx(Z,{size:"sm",onClick:A,disabled:!o.trim()||v.isPending,className:"px-4",children:v.isPending?"Saving…":"Save changes"})]}):a.jsxs(Z,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-muted-foreground hover:text-foreground",onClick:()=>i(!0),children:[a.jsx(Ds,{className:"h-3.5 w-3.5"}),"Edit"]})})]}),a.jsx("div",{className:"px-2 py-2",children:a.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5 items-start",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(yr,{zone:"issue.details.before",props:{issue:g}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsx("div",{className:"px-6 pt-6 pb-3",children:s?a.jsx("input",{autoFocus:!0,value:o,onChange:O=>l(O.target.value),onKeyDown:O=>{O.key==="Enter"&&O.preventDefault()},className:T("w-full text-xl font-semibold leading-snug text-foreground","bg-transparent border-0 outline-none resize-none","placeholder:text-muted-foreground/40")}):a.jsx("h1",{className:"text-xl font-semibold text-foreground leading-snug",children:g.title})}),a.jsx("div",{className:"flex items-center gap-2 px-6 pb-2",children:a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground/60 uppercase tracking-widest",children:"Description"})}),s?a.jsx(ig,{content:c,onChange:d,placeholder:"Add a description…",className:"border-t border-border/50 min-h-[280px]"}):g.description?a.jsx("div",{className:"border-t border-border/50",children:a.jsx(og,{html:g.description,className:"px-5 py-4"})}):a.jsx("div",{className:"border-t border-border/50 px-6 py-4",children:a.jsx("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})})]}),!g.parent_id&&a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsxs("div",{className:"px-5 py-3 border-b border-border/60 flex items-center justify-between",children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Child Issues"}),a.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(it,{className:"h-3.5 w-3.5"}),"Add child issue"]})]}),S.length===0?a.jsx("div",{className:"px-5 py-4 text-xs text-muted-foreground/50 italic",children:"No child issues yet"}):a.jsx("div",{className:"px-5 py-2 divide-y divide-border/40",children:S.map(O=>a.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs",children:[a.jsx(yn,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${O.id}`),className:"font-mono text-muted-foreground hover:text-foreground transition-colors shrink-0",children:O.identifier}),a.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${O.id}`),className:"text-foreground hover:text-foreground/70 truncate text-left transition-colors",children:O.title})]},O.id))})]}),a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:a.jsx(YN,{issueId:r})}),a.jsx(yr,{zone:"issue.details.after",props:{issue:g}})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(yr,{zone:"issue.details.sidebar",props:{issue:g}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Properties"})}),a.jsxs("div",{className:"px-4 py-1",children:[a.jsx(ta,{label:"Status",children:a.jsx(bm,{value:g.status,onValueChange:O=>D({status:O},"Status"),options:P,icons:M})}),a.jsx(ta,{label:"Priority",children:a.jsx(bm,{value:g.priority,onValueChange:O=>D({priority:O},"Priority"),options:wn,icons:b$})}),a.jsx(ta,{label:"Type",children:a.jsx(bm,{value:g.type,onValueChange:O=>D({type:O},"Type"),options:Ja,icons:w$})}),a.jsx(ta,{label:"Assignees",children:a.jsx(zl,{value:g.assignee_ids??[],onChange:O=>D({assignee_ids:O},"Assignees"),disabled:v.isPending})}),a.jsx(ta,{label:"Sprint",children:a.jsxs(Fe,{value:g.sprint_id??"none",onValueChange:O=>D({sprint_id:O==="none"?null:O},"Sprint"),children:[a.jsx(Re,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Er,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),g.sprint_id?(()=>{const O=k.find(F=>F.id===g.sprint_id)??(j==null?void 0:j.find(F=>F.id===g.sprint_id));if(!O)return a.jsxs("span",{className:"truncate",children:[g.sprint_id.slice(0,8),"…"]});const R=cy(O);return a.jsxs("span",{className:"truncate",children:[O.name,R&&a.jsxs("span",{className:"text-muted-foreground ml-1",children:["· ",R]})]})})():a.jsx("span",{className:"text-muted-foreground",children:"No sprint"})]})}),a.jsxs($e,{children:[a.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),k.map(O=>{const R=cy(O);return a.jsx(be,{value:O.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:O.name}),R&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:R})]})},O.id)})]})]})}),(b??[]).length>0&&a.jsx(ta,{label:"List",children:a.jsxs(Fe,{value:g.task_list_id??"none",onValueChange:O=>D({task_list_id:O==="none"?null:O},"List"),children:[a.jsx(Re,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Ap,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:C?"truncate":"text-muted-foreground",children:(C==null?void 0:C.name)??"No list"})]})}),a.jsxs($e,{children:[a.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(b??[]).map(O=>a.jsx(be,{value:O.id,className:"text-xs",children:O.name},O.id))]})]})}),a.jsx(ta,{label:"Start Date",children:a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(cr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:g.start_date?"text-foreground":"text-muted-foreground",children:g.start_date?ue(new Date(g.start_date),"MMM d, yyyy"):"No start date"})]})}),a.jsxs(yt,{className:"w-auto p-0",align:"start",children:[a.jsx(dr,{mode:"single",selected:g.start_date?new Date(g.start_date):void 0,onSelect:O=>D({start_date:O?ue(O,"yyyy-MM-dd"):null},"Start date"),initialFocus:!0}),g.start_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>D({start_date:null},"Start date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(nt,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),a.jsx(ta,{label:"Due Date",children:a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(cr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:g.due_date?"text-foreground":"text-muted-foreground",children:g.due_date?ue(new Date(g.due_date),"MMM d, yyyy"):"No due date"})]})}),a.jsxs(yt,{className:"w-auto p-0",align:"start",children:[a.jsx(dr,{mode:"single",selected:g.due_date?new Date(g.due_date):void 0,onSelect:O=>D({due_date:O?ue(O,"yyyy-MM-dd"):null},"Due date"),initialFocus:!0}),g.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>D({due_date:null},"Due date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(nt,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),w&&a.jsx(ta,{label:"Parent",children:a.jsxs("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${w.id}`),className:"flex items-center gap-1.5 text-xs hover:text-foreground transition-colors text-left w-full min-w-0",children:[a.jsx(_p,{className:"h-3 w-3 text-muted-foreground shrink-0"}),a.jsx("span",{className:"font-mono text-muted-foreground shrink-0",children:w.identifier}),a.jsx("span",{className:"text-foreground truncate",children:w.title})]})})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Details"})}),a.jsxs("div",{className:"px-4 pt-3 pb-4 space-y-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-muted-foreground",children:"Created"}),a.jsx("span",{className:"text-foreground",children:ue(new Date(g.created_at),"MMM d, yyyy")})]}),a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-muted-foreground",children:"Updated"}),a.jsx("span",{className:"text-foreground",children:ue(new Date(g.updated_at),"MMM d, yyyy")})]})]})]})]})]})})]}),a.jsx(zu,{open:u,onClose:()=>f(!1),projectId:h,defaultParentId:r,defaultTaskListId:g.task_list_id})]})}function ra({label:e,children:t}){return a.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-border/60 last:border-0",children:[a.jsx("span",{className:"text-xs text-muted-foreground shrink-0 w-20",children:e}),a.jsx("div",{className:"flex-1 min-w-0",children:t})]})}const N$={backlog:a.jsx(rn,{className:"h-3 w-3 text-zinc-400"}),todo:a.jsx(rn,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:a.jsx(Yn,{className:"h-3 w-3 text-indigo-500"}),in_review:a.jsx(_l,{className:"h-3 w-3 text-amber-500"}),done:a.jsx(rs,{className:"h-3 w-3 text-emerald-500"}),cancelled:a.jsx(Op,{className:"h-3 w-3 text-zinc-400"})},k$={urgent:a.jsx(ns,{className:"h-3 w-3 text-red-500"}),high:a.jsx(Cl,{className:"h-3 w-3 text-orange-500"}),medium:a.jsx(Hi,{className:"h-3 w-3 text-yellow-500"}),low:a.jsx(Sl,{className:"h-3 w-3 text-blue-400"})},S$={bug:a.jsx(Jj,{className:"h-3 w-3 text-red-500"}),feature:a.jsx(u1,{className:"h-3 w-3 text-purple-500"}),task:a.jsx(f1,{className:"h-3 w-3 text-blue-500"}),chore:a.jsx(Cp,{className:"h-3 w-3 text-zinc-500"})};function wm({value:e,onValueChange:t,options:r,icons:n,placeholder:s}){return a.jsxs(Fe,{value:e,onValueChange:t,children:[a.jsx(Re,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[n[e]??a.jsx(t1,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("span",{children:r[e]??s??""})]})}),a.jsx($e,{children:Object.entries(r).map(([i,o])=>a.jsx(be,{value:i,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function C$(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?ue(new Date(e.start_date),"MMM d"):"—",r=e.end_date?ue(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function _$(){const{workspace:e,projectKey:t}=qt(),r=kt(),{workspace:n}=De(),[s,i]=p.useState(""),[o,l]=p.useState(""),[c,d]=p.useState("backlog"),[u,f]=p.useState("medium"),[m,h]=p.useState("task"),[g,x]=p.useState([]),[v,y]=p.useState(""),[j,b]=p.useState(""),[N,k]=p.useState(void 0),[w,S]=p.useState(void 0),[C,P]=p.useState(!1),[M,A]=p.useState("weekly"),[_,D]=p.useState(void 0),{data:O}=ka(t??""),R=(O==null?void 0:O.id)??"",F=Xj(),{data:H}=Ji(R||void 0),{data:ne}=eo(R||void 0),{data:G}=$l(R||void 0),oe=(ne??[]).filter(U=>U.status!=="completed"),ce=H&&H.length>0?Object.fromEntries(H.map(U=>[U.key,U.name])):$s,B=H&&H.length>0?Object.fromEntries(H.map(U=>[U.key,U.category==="completed"?a.jsx(rs,{className:"h-3 w-3",style:{color:U.color}}):U.category==="started"?a.jsx(Yn,{className:"h-3 w-3",style:{color:U.color}}):a.jsx(rn,{className:"h-3 w-3",style:{color:U.color}})])):N$;if(!t||!R)return null;const Y=()=>{if(!s.trim()){z.error("Title is required");return}F.mutate({title:s.trim(),description:o||void 0,status:c,priority:u,type:m,project_id:R,workspace_id:n.id,assignee_ids:g.length>0?g:void 0,sprint_id:v||null,task_list_id:j||null,start_date:N?ue(N,"yyyy-MM-dd"):null,due_date:w?ue(w,"yyyy-MM-dd"):null,recurrence_frequency:C?M:void 0,recurrence_end_date:C&&_?ue(_,"yyyy-MM-dd"):void 0},{onSuccess:U=>{z.success("Issue created"),r(`/${e}/projects/${t}/issues/${U.issue.id}`,{replace:!0})},onError:U=>z.error(U.message??"Failed to create issue")})};return a.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[a.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 h-[57px] bg-white dark:bg-card border-b border-border",children:[a.jsxs(Z,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-muted-foreground hover:text-foreground px-2",onClick:()=>r(`/${e}/projects/${t}/issues`),children:[a.jsx(du,{className:"h-3.5 w-3.5"}),(O==null?void 0:O.name)??"Issues"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>r(`/${e}/projects/${t}/issues`),children:"Discard"}),a.jsx(Z,{size:"sm",onClick:Y,disabled:!s.trim()||F.isPending,className:"px-4",children:F.isPending?"Creating…":"Create issue"})]})]}),a.jsx("div",{className:"px-2 py-2",children:a.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5 items-start",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsx("div",{className:"px-6 pt-6 pb-3",children:a.jsx("input",{autoFocus:!0,value:s,onChange:U=>i(U.target.value),onKeyDown:U=>{U.key==="Enter"&&U.preventDefault()},placeholder:"Issue title…",className:T("w-full text-xl font-semibold leading-snug text-foreground","bg-transparent border-0 outline-none resize-none","placeholder:text-muted-foreground/40")})}),a.jsx("div",{className:"flex items-center gap-2 px-6 pb-2",children:a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground/60 uppercase tracking-widest",children:"Description"})}),a.jsx(ig,{content:"",onChange:l,placeholder:"Add steps to reproduce, acceptance criteria, or context…",className:"border-t border-border/50 min-h-[320px]"})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Properties"})}),a.jsxs("div",{className:"px-4 py-1",children:[a.jsx(ra,{label:"Status",children:a.jsx(wm,{value:c,onValueChange:d,options:ce,icons:B})}),a.jsx(ra,{label:"Priority",children:a.jsx(wm,{value:u,onValueChange:f,options:wn,icons:k$})}),a.jsx(ra,{label:"Type",children:a.jsx(wm,{value:m,onValueChange:h,options:Ja,icons:S$})}),a.jsx(ra,{label:"Assignees",children:a.jsx(zl,{value:g,onChange:x})}),oe.length>0&&a.jsx(ra,{label:"Sprint",children:a.jsxs(Fe,{value:v||"none",onValueChange:U=>y(U==="none"?"":U),children:[a.jsx(Re,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Er,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No sprint"})]})}),a.jsxs($e,{children:[a.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),oe.map(U=>{const X=C$(U);return a.jsx(be,{value:U.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:U.name}),X&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:X})]})},U.id)})]})]})}),(G??[]).length>0&&a.jsx(ra,{label:"List",children:a.jsxs(Fe,{value:j||"none",onValueChange:U=>b(U==="none"?"":U),children:[a.jsx(Re,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Ap,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No list"})]})}),a.jsxs($e,{children:[a.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(G??[]).map(U=>a.jsx(be,{value:U.id,className:"text-xs",children:U.name},U.id))]})]})}),a.jsx(ra,{label:"Start Date",children:a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(cr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:N?"text-foreground":"text-muted-foreground",children:N?ue(N,"MMM d, yyyy"):"No start date"}),N&&a.jsx("button",{type:"button",onClick:U=>{U.stopPropagation(),k(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(nt,{className:"h-3 w-3"})})]})}),a.jsx(yt,{className:"w-auto p-0",align:"start",children:a.jsx(dr,{mode:"single",selected:N,onSelect:k,initialFocus:!0})})]})}),a.jsx(ra,{label:"Due Date",children:a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(cr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:w?"text-foreground":"text-muted-foreground",children:w?ue(w,"MMM d, yyyy"):"No due date"}),w&&a.jsx("button",{type:"button",onClick:U=>{U.stopPropagation(),S(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(nt,{className:"h-3 w-3"})})]})}),a.jsx(yt,{className:"w-auto p-0",align:"start",children:a.jsx(dr,{mode:"single",selected:w,onSelect:S,initialFocus:!0})})]})}),a.jsx(ra,{label:"Recurring",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2 pl-1",children:[a.jsx(to,{id:"new-recurring",checked:C,onCheckedChange:P}),a.jsxs(gt,{htmlFor:"new-recurring",className:"cursor-pointer font-normal text-xs flex items-center gap-1.5",children:[a.jsx(Go,{className:"h-3 w-3 text-muted-foreground"}),C?M.charAt(0).toUpperCase()+M.slice(1):"Off"]})]}),C&&a.jsxs("div",{className:"space-y-2 pl-1 border-l-2 border-indigo-200 dark:border-indigo-800",children:[a.jsxs(Fe,{value:M,onValueChange:U=>A(U),children:[a.jsx(Re,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsx(Ye,{})}),a.jsxs($e,{children:[a.jsx(be,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(be,{value:"monthly",className:"text-xs",children:"Monthly"})]})]}),a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(cr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:_?"text-foreground":"text-muted-foreground",children:_?ue(_,"MMM d, yyyy"):"No end date"}),_&&a.jsx("button",{type:"button",onClick:U=>{U.stopPropagation(),D(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(nt,{className:"h-3 w-3"})})]})}),a.jsx(yt,{className:"w-auto p-0",align:"start",children:a.jsx(dr,{mode:"single",selected:_,onSelect:D,initialFocus:!0})})]})]})]})})]}),a.jsx("div",{className:"px-4 pt-2 pb-3 mt-1 border-t border-border/60",children:a.jsxs("p",{className:"text-[11px] text-muted-foreground/50 leading-relaxed",children:["Press ",a.jsx("kbd",{className:"px-1 py-0.5 rounded border border-border bg-muted font-mono text-[10px]",children:"⌘ Enter"})," to submit"]})})]})]})})]})}const O$={issue:{icon:ua,label:"Issue"},project:{icon:Er,label:"Project"},comment:{icon:d1,label:"Comment"},sprint:{icon:ns,label:"Sprint"}};function P$(e){const t=new Date(e);return R3(t)?P3(t,{addSuffix:!0}):$3(t)?`Yesterday ${ue(t,"h:mm a")}`:ue(t,"MMM d, yyyy")}function M$(){const{workspace:e}=qt(),t=kt(),{data:r,isLoading:n}=zD(),{data:s=[]}=Gi(),i=FD(),o=BD(),l=(r==null?void 0:r.filter(u=>!u.read).length)??0,c=Object.fromEntries(s.map(u=>[u.id,u]));function d(u){var f;if(u.entity_type==="issue"&&((f=u.metadata)!=null&&f.project_id)){const m=c[u.metadata.project_id];if(m)return`/${e}/projects/${m.identifier}/issues/${u.entity_id}`}if(u.entity_type==="project"){const m=c[u.entity_id];if(m)return`/${e}/projects/${m.identifier}/board`}return null}return a.jsx("div",{className:"p-2",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("h1",{className:"text-base font-semibold",children:"Notifications"}),l>0&&a.jsxs(Z,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>o.mutate(void 0,{onSuccess:()=>z.success("All marked as read"),onError:()=>z.error("Failed")}),disabled:o.isPending,children:[a.jsx(lE,{className:"h-3.5 w-3.5"}),"Mark all read"]})]}),a.jsxs("div",{className:"grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-2.5 border-b border-border",children:[a.jsx("span",{}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Type"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Message"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Time"}),a.jsx("span",{})]}),n?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(u=>a.jsxs("div",{className:"grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3",children:[a.jsx("div",{}),a.jsx(le,{className:"h-5 w-20 rounded-full"}),a.jsx(le,{className:"h-4 w-3/4"}),a.jsx(le,{className:"h-4 w-20"}),a.jsx("div",{})]},u))}):r!=null&&r.length?a.jsx("div",{className:"divide-y divide-border",children:r.map(u=>{const f=O$[u.entity_type]??{icon:ki,label:u.entity_type},m=f.icon,h=d(u);return a.jsxs("div",{className:T("grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3 transition-colors",!u.read&&"bg-[#eff6ff] dark:bg-indigo-950/20","hover:bg-[#f9fafb] dark:hover:bg-muted/30",h&&"cursor-pointer"),onClick:()=>{h&&(u.read||i.mutate(u.id),t(h))},children:[a.jsx("div",{className:"flex items-center justify-center",children:!u.read&&a.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-indigo-500 shrink-0"})}),a.jsx("div",{children:a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:[a.jsx(m,{className:"h-3 w-3"}),f.label]})}),a.jsx("p",{className:T("text-sm truncate",u.read?"text-muted-foreground":"font-medium text-foreground"),children:u.message}),a.jsx("span",{className:"text-xs text-muted-foreground",children:P$(u.created_at)}),a.jsx("div",{className:"flex justify-end",onClick:g=>g.stopPropagation(),children:!u.read&&a.jsx(Z,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground px-2",onClick:()=>i.mutate(u.id,{onError:()=>z.error("Failed")}),children:"Mark read"})})]},u.id)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(ki,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No notifications"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"You're all caught up."})]}),!n&&!!(r!=null&&r.length)&&a.jsx("div",{className:"px-6 py-3 border-t border-border",children:a.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.length," notification",r.length!==1?"s":"",l>0?` · ${l} unread`:""]})})]})})}function A$({open:e,onClose:t,projectId:r}){const[n,s]=p.useState(""),[i,o]=p.useState(""),[l,c]=p.useState(),[d,u]=p.useState(),[f,m]=p.useState(!1),[h,g]=p.useState(!1),x=dI(r);function v(){s(""),o(""),c(void 0),u(void 0),t()}async function y(j){j.preventDefault(),n.trim()&&x.mutate({name:n.trim(),goal:i.trim()||void 0,start_date:l?ue(l,"yyyy-MM-dd"):null,end_date:d?ue(d,"yyyy-MM-dd"):null},{onSuccess:()=>{z.success("Sprint created"),v()},onError:()=>z.error("Failed to create sprint")})}return a.jsx(Qs,{open:e,onOpenChange:j=>!j&&v(),children:a.jsxs(Zs,{className:"sm:max-w-md",children:[a.jsx(Vi,{children:a.jsx(Qi,{children:"New Sprint"})}),a.jsxs("form",{onSubmit:y,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(Xi,{className:"space-y-4 py-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(gt,{htmlFor:"sprint-name",children:["Name ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Ee,{id:"sprint-name",placeholder:"e.g. Sprint 1",value:n,onChange:j=>s(j.target.value),autoFocus:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(gt,{htmlFor:"sprint-goal",children:["Goal ",a.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),a.jsx(Au,{id:"sprint-goal",placeholder:"What do you want to achieve in this sprint?",value:i,onChange:j=>o(j.target.value),className:"resize-none text-sm",rows:2})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(gt,{children:"Start Date"}),a.jsxs(jt,{open:f,onOpenChange:m,children:[a.jsx(Nt,{asChild:!0,children:a.jsxs(Z,{variant:"outline",className:T("w-full justify-start text-left font-normal text-sm h-9",!l&&"text-muted-foreground"),children:[a.jsx(cr,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),l?ue(l,"MMM d, yyyy"):"Pick date"]})}),a.jsx(yt,{className:"w-auto p-0",align:"start",children:a.jsx(dr,{mode:"single",selected:l,onSelect:j=>{c(j),m(!1)},disabled:j=>d?j>d:!1,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(gt,{children:"End Date"}),a.jsxs(jt,{open:h,onOpenChange:g,children:[a.jsx(Nt,{asChild:!0,children:a.jsxs(Z,{variant:"outline",className:T("w-full justify-start text-left font-normal text-sm h-9",!d&&"text-muted-foreground"),children:[a.jsx(cr,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),d?ue(d,"MMM d, yyyy"):"Pick date"]})}),a.jsx(yt,{className:"w-auto p-0",align:"start",children:a.jsx(dr,{mode:"single",selected:d,onSelect:j=>{u(j),g(!1)},disabled:j=>l?j<l:!1,initialFocus:!0})})]})]})]})]}),a.jsxs(Il,{children:[a.jsx(Z,{type:"button",variant:"ghost",onClick:v,children:"Cancel"}),a.jsx(Z,{type:"submit",disabled:!n.trim()||x.isPending,children:x.isPending?"Creating…":"Create Sprint"})]})]})]})})}const E$={active:{label:"Active",icon:mu,badge:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",section:"Active Sprint"},planned:{label:"Planned",icon:Yn,badge:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",section:"Planned"},completed:{label:"Completed",icon:rs,badge:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",section:"Completed"}};function D$({sprint:e,projectId:t,issueCount:r,workingDays:n,holidays:s=[]}){const i=uI(e.id,t),o=fI(t),l=E$[e.status],c=l.icon;function d(){i.mutate({status:"active"},{onSuccess:()=>z.success(`"${e.name}" started`),onError:()=>z.error("Failed to start sprint")})}function u(){i.mutate({status:"completed"},{onSuccess:()=>z.success(`"${e.name}" completed`),onError:g=>z.error((g==null?void 0:g.message)??"Failed to complete sprint")})}function f(){confirm(`Delete sprint "${e.name}"? This cannot be undone.`)&&o.mutate(e.id,{onSuccess:()=>z.success("Sprint deleted"),onError:()=>z.error("Failed to delete sprint")})}const m=!!e.start_date,h=!!e.end_date;return a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[a.jsx("div",{className:T("flex h-7 w-7 items-center justify-center rounded-full shrink-0",e.status==="active"?"bg-emerald-100 dark:bg-emerald-900/30":e.status==="completed"?"bg-blue-100 dark:bg-blue-900/30":"bg-zinc-100 dark:bg-zinc-800"),children:a.jsx(c,{className:T("h-3.5 w-3.5",e.status==="active"?"text-emerald-600 dark:text-emerald-400":e.status==="completed"?"text-blue-600 dark:text-blue-400":"text-zinc-500")})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:e.name}),e.goal&&a.jsxs("p",{className:"text-xs text-muted-foreground truncate mt-0.5 flex items-center gap-1",children:[a.jsx(DE,{className:"h-3 w-3 shrink-0"}),e.goal]})]})]}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0 w-64",children:[a.jsx(Wi,{className:"h-3.5 w-3.5 shrink-0"}),m||h?a.jsxs("span",{children:[m?ue(new Date(e.start_date),"MMM d"):"—"," → ",h?ue(new Date(e.end_date),"MMM d, yyyy"):"—",m&&h&&n&&(()=>{const g=uN(new Date(e.start_date),new Date(e.end_date),n,s);return a.jsxs("span",{className:"ml-1.5 text-[11px] text-muted-foreground/70",children:["(",g," biz day",g!==1?"s":"",")"]})})()]}):a.jsx("span",{className:"italic",children:"No dates set"})]}),a.jsxs("div",{className:"text-xs text-muted-foreground shrink-0 w-20 text-right",children:[r," issue",r!==1?"s":""]}),a.jsx(Bu,{className:T("shrink-0 text-[11px] border-0 w-20 justify-center",l.badge),children:l.label}),a.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.status==="planned"&&a.jsxs(Z,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:d,disabled:i.isPending,children:[a.jsx(mu,{className:"h-3 w-3"}),"Start"]}),e.status==="active"&&a.jsxs(Z,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:u,disabled:i.isPending,children:[a.jsx(rs,{className:"h-3 w-3"}),"Complete"]}),a.jsx(Z,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:f,disabled:o.isPending,children:a.jsx(Hr,{className:"h-3.5 w-3.5"})})]})]})}function T$(){const{projectKey:e}=qt(),[t,r]=p.useState(!1),{data:n}=ka(e??""),s=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=eo(s||void 0),{data:l}=Nl(s||void 0),{data:c}=Xp(),{data:d=[]}=Qp(new Date().getFullYear()),u=(l??[]).reduce((h,g)=>(g.sprint_id&&(h[g.sprint_id]=(h[g.sprint_id]??0)+1),h),{}),f={active:(i??[]).filter(h=>h.status==="active"),planned:(i??[]).filter(h=>h.status==="planned"),completed:(i??[]).filter(h=>h.status==="completed")},m=[{key:"active",label:"Active Sprint",items:f.active},{key:"planned",label:"Planned",items:f.planned},{key:"completed",label:"Completed",items:f.completed}];return a.jsxs("div",{className:"p-2",children:[a.jsx(yr,{zone:"project.sprints.before",props:{projectId:s}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsx("div",{className:"flex items-center justify-end px-6 py-3 border-b border-border",children:a.jsxs(Z,{size:"sm",onClick:()=>r(!0),children:[a.jsx(it,{className:"h-4 w-4"}),"New Sprint"]})}),o?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(h=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-7 w-7 rounded-full"}),a.jsx(le,{className:"h-4 w-40"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-4 w-32"}),a.jsx(le,{className:"h-5 w-20"})]},h))}):(i??[]).length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Wi,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No sprints yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create a sprint to start planning your work in time-boxed iterations."}),a.jsxs(Z,{size:"sm",onClick:()=>r(!0),children:[a.jsx(it,{className:"h-4 w-4"}),"New Sprint"]})]}):a.jsx("div",{children:m.map(({key:h,label:g,items:x})=>x.length===0?null:a.jsxs("div",{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:g})}),a.jsx("div",{className:"divide-y divide-border",children:x.map(v=>a.jsx(D$,{sprint:v,projectId:s,issueCount:u[v.id]??0,workingDays:c==null?void 0:c.working_days,holidays:d},v.id))})]},h))})]}),a.jsx(yr,{zone:"project.sprints.after",props:{projectId:s}}),a.jsx(A$,{open:t,onClose:()=>r(!1),projectId:s})]})}const Pi={all:["roles"],list:()=>[...Pi.all,"list"],detail:e=>[...Pi.all,e]};function lg(){return Le({queryKey:Pi.list(),queryFn:()=>te.get("/admin/roles"),select:e=>e.roles,staleTime:1e3*60*2})}function I$(){const e=Ne();return we({mutationFn:t=>te.post("/admin/roles",t),onSuccess:()=>{e.invalidateQueries({queryKey:Pi.list()})}})}function R$(e){const t=Ne();return we({mutationFn:r=>te.put(`/admin/roles/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Pi.list()})}})}function $$(){const e=Ne();return we({mutationFn:t=>te.delete(`/admin/roles/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Pi.list()})}})}function z$(){const e=Ne();return we({mutationFn:({userId:t,appRoleId:r})=>te.patch(`/admin/users/${t}/role`,{app_role_id:r}),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]})}})}const rd=[{group:"Members & Invitations",permissions:[{key:"member:invite",label:"Invite members"},{key:"member:remove",label:"Remove members"},{key:"member:update_role",label:"Change member roles"}]},{group:"Workspaces",permissions:[{key:"workspace:create",label:"Create workspaces"},{key:"workspace:update",label:"Update workspace settings"},{key:"workspace:delete",label:"Delete workspaces"}]},{group:"Projects",permissions:[{key:"project:create",label:"Create projects"},{key:"project:update",label:"Update project settings"},{key:"project:delete",label:"Delete projects"},{key:"project:archive",label:"Archive projects"},{key:"project:manage_access",label:"Manage project access"}]},{group:"Issues",permissions:[{key:"issue:create",label:"Create issues"},{key:"issue:update",label:"Update issues"},{key:"issue:delete",label:"Delete issues"},{key:"issue:assign",label:"Assign issues"},{key:"issue:update_status",label:"Update issue status"}]},{group:"Sprints",permissions:[{key:"sprint:create",label:"Create sprints"},{key:"sprint:start",label:"Start sprints"},{key:"sprint:complete",label:"Complete sprints"},{key:"sprint:delete",label:"Delete sprints"}]},{group:"Teams",permissions:[{key:"team:create",label:"Create teams"},{key:"team:update",label:"Update teams"},{key:"team:delete",label:"Delete teams"},{key:"team:manage_members",label:"Manage team members"}]},{group:"Roles",permissions:[{key:"role:create",label:"Create roles"},{key:"role:update",label:"Update roles"},{key:"role:delete",label:"Delete roles"},{key:"role:assign",label:"Assign roles to users"}]}];function Jo({open:e,onClose:t,onConfirm:r,title:n,description:s,confirmLabel:i="Confirm",variant:o="default",loading:l=!1}){return a.jsx(Wu,{open:e,onOpenChange:c=>!c&&t(),children:a.jsxs(Bl,{children:[a.jsxs(Wl,{children:[a.jsx(ql,{children:n}),a.jsx(Hl,{children:s})]}),a.jsxs(Ul,{children:[a.jsx(Yl,{onClick:t,disabled:l,children:"Cancel"}),a.jsx(Kl,{onClick:r,disabled:l,className:T(o==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus:ring-destructive"),children:l?"Please wait…":i})]})]})})}function L$(e){return e==="super-admin"?"Super Admin":e==="admin"?"Admin":"Member"}function dy({value:e,onChange:t}){return a.jsxs(Fe,{value:e,onValueChange:r=>t(r),children:[a.jsx(Re,{className:"h-9",children:a.jsx(Ye,{})}),a.jsxs($e,{children:[a.jsx(be,{value:"super-admin",children:"Super Admin"}),a.jsx(be,{value:"admin",children:"Admin"}),a.jsx(be,{value:"member",children:"Member"})]})]})}function cg({value:e,className:t}){const[r,n]=p.useState(!1),s=()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)};return a.jsx("button",{onClick:s,className:T("text-muted-foreground hover:text-foreground transition-colors",t),title:"Copy",children:r?a.jsx(lr,{className:"h-3.5 w-3.5 text-emerald-500"}):a.jsx(a1,{className:"h-3.5 w-3.5"})})}function uy({value:e,onChange:t,appRoles:r}){return!r||r.length===0?null:a.jsxs(Fe,{value:e||"none",onValueChange:n=>t(n==="none"?"":n),children:[a.jsx(Re,{className:"h-9",children:a.jsx(Ye,{placeholder:"No custom role"})}),a.jsxs($e,{children:[a.jsx(be,{value:"none",children:a.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),r.map(n=>a.jsx(be,{value:n.id,children:a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{children:n.name}),n.description&&a.jsx("span",{className:"text-xs text-muted-foreground",children:n.description})]})},n.id))]})]})}function F$({open:e,onClose:t,workspaceId:r}){const[n,s]=p.useState("existing"),[i,o]=p.useState(""),[l,c]=p.useState(""),[d,u]=p.useState("member"),[f,m]=p.useState(""),[h,g]=p.useState(""),[x,v]=p.useState("member"),[y,j]=p.useState(""),[b,N]=p.useState(null),{data:k=[]}=Du(),{data:w=[]}=Pl(r),S=QE(r),C=VE(r),{data:P}=lg(),M=p.useMemo(()=>new Set(w.map(R=>R.user_id)),[w]),A=p.useMemo(()=>k.filter(R=>!M.has(R.id)),[k,M]),_=p.useMemo(()=>{const R=i.toLowerCase().trim();return R?A.filter(F=>F.email.toLowerCase().includes(R)||`${F.first_name} ${F.last_name}`.toLowerCase().includes(R)):A},[A,i]);p.useEffect(()=>{e&&(o(""),c(""),u("member"),m(""),g(""),v("member"),j(""),N(null),s("existing"))},[e]);const D=()=>{if(!l)return;const R=d==="member"?"member":"admin";S.mutate({user_id:l,role:R,app_role_id:f||null},{onSuccess:()=>{z.success("Member added"),t()},onError:F=>z.error(F.message||"Failed to add member")})},O=R=>{R.preventDefault(),C.mutate({email:h.trim()||void 0,role:x,app_role_id:y||null},{onSuccess:F=>{N(F.invitation),z.success("Invitation created")},onError:F=>z.error(F.message||"Failed to create invitation")})};return a.jsx(Gs,{open:e,onOpenChange:R=>!R&&t(),children:a.jsxs(as,{className:"sm:max-w-[520px]",children:[a.jsx(Vs,{children:a.jsx(Xs,{children:"Add member"})}),!b&&a.jsxs("div",{className:"flex rounded-lg border border-border p-0.5 bg-muted/40 gap-0.5",children:[a.jsx("button",{type:"button",onClick:()=>s("existing"),className:T("flex-1 text-sm py-1.5 rounded-md font-medium transition-colors",n==="existing"?"bg-white dark:bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"Existing user"}),a.jsx("button",{type:"button",onClick:()=>s("invite"),className:T("flex-1 text-sm py-1.5 rounded-md font-medium transition-colors",n==="invite"?"bg-white dark:bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"Send invite"})]}),n==="existing"&&!b&&a.jsxs("div",{className:"space-y-3 pt-1",children:[a.jsx(Ee,{placeholder:"Search by name or email…",value:i,onChange:R=>o(R.target.value),className:"h-9",autoFocus:!0}),a.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:A.length===0?a.jsxs("div",{className:"py-8 text-center px-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"All users are already members."}),a.jsx("button",{className:"mt-2 text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",onClick:()=>s("invite"),children:"Send an invite instead"})]}):_.length===0?a.jsx("div",{className:"py-6 text-center",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:['No users match "',i,'"']})}):a.jsx("div",{className:"max-h-52 overflow-y-auto divide-y divide-border",children:_.map(R=>{const F=R.first_name??"",H=R.last_name??"",ne=`${F} ${H}`.trim()||R.email,G=(F[0]??H[0]??R.email[0]??"U").toUpperCase(),oe=l===R.id;return a.jsxs("button",{type:"button",onClick:()=>c(oe?"":R.id),className:T("w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors",oe?"bg-indigo/5 dark:bg-indigo/10":"hover:bg-muted/40"),children:[a.jsx(Bt,{className:"h-7 w-7 shrink-0",children:a.jsx(Wt,{className:"text-[11px] font-medium",children:G})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:ne}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:R.email})]}),oe&&a.jsx(lr,{className:"h-4 w-4 text-indigo shrink-0"})]},R.id)})})}),A.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Role"}),a.jsx(dy,{value:d,onChange:u})]}),P&&P.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Custom role ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(uy,{value:f,onChange:m,appRoles:P})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(Z,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(Z,{type:"button",size:"sm",disabled:!l||S.isPending,onClick:D,children:S.isPending?"Adding…":"Add to workspace"})]})]})]}),n==="invite"&&!b&&a.jsxs("form",{onSubmit:O,className:"space-y-4 pt-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Email ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(Ee,{type:"email",placeholder:"colleague@example.com",value:h,onChange:R=>g(R.target.value),className:"h-9",autoFocus:!0}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Leave blank to generate a shareable link."})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Role"}),a.jsx(dy,{value:x,onChange:v})]}),P&&P.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Custom role ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(uy,{value:y,onChange:j,appRoles:P})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(Z,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(Z,{type:"submit",size:"sm",disabled:C.isPending,children:C.isPending?"Creating…":"Create invitation"})]})]}),b&&a.jsxs("div",{className:"space-y-4 pt-1",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Share this link with"," ",b.email?a.jsx("span",{className:"font-medium text-foreground",children:b.email}):"anyone you want to invite",". They will join as"," ",a.jsx("span",{className:"font-medium text-foreground",children:L$(x)}),"."]}),a.jsxs("div",{className:"flex items-start gap-2 p-3 bg-muted/50 rounded-lg border border-border",children:[a.jsx(uu,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 mt-0.5"}),a.jsx("span",{className:"text-xs font-mono text-foreground flex-1 min-w-0 break-all",children:`${window.location.origin}/invite/${b.token}`}),a.jsx(cg,{value:`${window.location.origin}/invite/${b.token}`,className:"shrink-0"})]}),a.jsxs("div",{className:"flex items-center justify-between pt-1",children:[a.jsx("button",{className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>N(null),children:"Create another"}),a.jsx(Z,{size:"sm",onClick:t,children:"Done"})]})]})]})})}function B$({invitation:e,workspaceId:t}){const r=XE(t),n=`${window.location.origin}/invite/${e.token}`;return a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5 hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors group",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:a.jsx(uu,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:e.email??"Shareable link"}),a.jsx("span",{className:T("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium",e.role==="super-admin"?"bg-purple-50 text-purple-700 dark:bg-purple-950/30 dark:text-purple-300":e.role==="admin"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:e.role==="super-admin"?"Super Admin":e.role==="admin"?"Admin":"Member"})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[a.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate max-w-[280px]",children:n}),a.jsx(cg,{value:n})]})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[a.jsx("span",{className:"text-xs text-muted-foreground hidden sm:block",children:ue(new Date(e.created_at),"MMM d")}),a.jsx("button",{onClick:()=>r.mutate(e.id,{onSuccess:()=>z.success("Invitation revoked"),onError:()=>z.error("Failed to revoke")}),disabled:r.isPending,className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive disabled:opacity-50",title:"Revoke invitation",children:a.jsx(nt,{className:"h-3.5 w-3.5"})})]})]})}function W$({workspaceId:e}){var v;const{workspace:t,setWorkspace:r}=De(),{data:n,isLoading:s}=pu(),i=n==null?void 0:n.find(y=>y.id===(t==null?void 0:t.id)),o=HE(e),l=KE(e),c=YE(e),d=p.useRef(null),[u,f]=p.useState("");p.useEffect(()=>{i&&f(i.name)},[i==null?void 0:i.name]);const m=i?u.trim()!==i.name:!1,h=()=>{!u.trim()||!i||o.mutate({name:u.trim()},{onSuccess:y=>{r({id:y.workspace.id,name:y.workspace.name,slug:y.workspace.slug,logo_url:y.workspace.logo_url}),z.success("Workspace updated")},onError:()=>z.error("Failed to update workspace")})},g=y=>{var b;const j=(b=y.target.files)==null?void 0:b[0];j&&(l.mutate(j,{onSuccess:N=>{r({id:N.workspace.id,name:N.workspace.name,slug:N.workspace.slug,logo_url:N.workspace.logo_url}),z.success("Logo updated")},onError:()=>z.error("Failed to upload logo")}),d.current&&(d.current.value=""))},x=()=>{c.mutate(void 0,{onSuccess:y=>{r({id:y.workspace.id,name:y.workspace.name,slug:y.workspace.slug,logo_url:null}),z.success("Logo removed")},onError:()=>z.error("Failed to remove logo")})};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Workspace details"})}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Logo"}),s?a.jsx("div",{className:"flex items-center gap-3",children:a.jsx("div",{className:"size-12 rounded-lg bg-muted animate-pulse"})}):a.jsxs("div",{className:"flex items-center gap-3",children:[i!=null&&i.logo_url?a.jsx("img",{src:i.logo_url,alt:"Workspace logo",className:"size-12 rounded-lg object-cover shrink-0 border border-border"}):a.jsx("div",{className:"flex size-12 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx("span",{className:"text-lg font-bold",children:(((v=i==null?void 0:i.name)==null?void 0:v[0])??"M").toUpperCase()})}),a.jsx("input",{ref:d,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:g}),a.jsx(Z,{size:"sm",variant:"outline",className:"h-8",onClick:()=>{var y;return(y=d.current)==null?void 0:y.click()},disabled:l.isPending,children:l.isPending?"Uploading…":"Upload logo"}),(i==null?void 0:i.logo_url)&&a.jsx(Z,{size:"sm",variant:"ghost",className:"h-8 text-muted-foreground",onClick:x,disabled:c.isPending,children:c.isPending?"Removing…":"Remove"})]})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Name"}),s?a.jsx(le,{className:"h-8 w-64"}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Ee,{value:u,onChange:y=>f(y.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"Workspace name"}),m&&a.jsx(Z,{size:"sm",className:"h-8",onClick:h,disabled:!u.trim()||o.isPending,children:o.isPending?"Saving…":"Save"})]})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"URL slug"}),s?a.jsx(le,{className:"h-4 w-40"}):a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("span",{className:"font-mono text-foreground",children:i==null?void 0:i.slug}),a.jsx(cg,{value:(i==null?void 0:i.slug)??""})]})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Plan"}),s?a.jsx(le,{className:"h-4 w-16"}):a.jsx("span",{className:"text-sm capitalize",children:(i==null?void 0:i.plan)??"free"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Created"}),s?a.jsx(le,{className:"h-4 w-28"}):a.jsx("span",{className:"text-sm text-muted-foreground",children:i!=null&&i.created_at?ue(new Date(i.created_at),"MMMM d, yyyy"):"—"})]})]})}function U$({workspaceId:e,onInvite:t}){var v,y;const{data:r,isLoading:n}=Pl(e),{data:s,isLoading:i}=GE(e),o=ZE(e),l=JE(e),c=z$(),{data:d}=lg(),{user:u}=De(),[f,m]=p.useState(null),[h,g]=p.useState(null),x=(s==null?void 0:s.filter(j=>j.status==="pending"))??[];return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex items-center justify-between",children:a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Members",!n&&r&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",r.length]})]})}),n?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(j=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3.5 w-32"}),a.jsx(le,{className:"h-3 w-48"})]})]},j))}):r!=null&&r.length?a.jsx("div",{className:"divide-y divide-border",children:r.map(j=>{var P;const b=j.user,N=(b==null?void 0:b.first_name)??"",k=(b==null?void 0:b.last_name)??"",w=`${N} ${k}`.trim()||(b==null?void 0:b.email)||"Unknown",S=(N[0]??k[0]??((P=b==null?void 0:b.email)==null?void 0:P[0])??"U").toUpperCase(),C=(b==null?void 0:b.id)===(u==null?void 0:u.id);return a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5 hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors group",children:[a.jsx(Bt,{className:"h-7 w-7 shrink-0",children:a.jsx(Wt,{className:"text-[11px] font-medium",children:S})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:w}),C&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:"(you)"})]}),(b==null?void 0:b.email)&&a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.email})]}),a.jsx("span",{className:T("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",j.role==="admin"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:j.role==="admin"?"Admin":"Member"}),d&&d.length>0&&a.jsxs(Fe,{value:j.app_role_id??"none",onValueChange:M=>c.mutate({userId:j.user_id,appRoleId:M==="none"?null:M},{onSuccess:()=>z.success("Custom role updated"),onError:()=>z.error("Failed to update custom role")}),children:[a.jsx(Re,{className:"h-7 text-[11px] w-32 shrink-0",children:a.jsx(Ye,{placeholder:"Custom role"})}),a.jsxs($e,{children:[a.jsx(be,{value:"none",children:a.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),d.map(M=>a.jsx(be,{value:M.id,children:M.name},M.id))]})]}),!C&&a.jsxs(ln,{children:[a.jsx(cn,{asChild:!0,children:a.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:a.jsx(Ys,{className:"h-4 w-4"})})}),a.jsxs(Kr,{align:"end",className:"w-44",children:[a.jsx(ht,{onClick:()=>g({member:j,newRole:j.role==="admin"?"member":"admin"}),children:j.role==="admin"?"Make member":"Make admin"}),a.jsx(ht,{onClick:()=>{fetch(`/admin/users/${j.user_id}/sessions`,{method:"DELETE",headers:{Authorization:`Bearer ${localStorage.getItem("meridian_token")}`}}).then(()=>z.success("Sessions revoked — user will be signed out")).catch(()=>z.error("Failed to revoke sessions"))},children:"Revoke sessions"}),a.jsx(Bn,{}),a.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:()=>m(j),children:[a.jsx(Hr,{className:"h-3.5 w-3.5 mr-2"}),"Remove"]})]})]})]},j.id)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Wa,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No members yet"}),a.jsx("button",{onClick:t,className:"text-sm text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:"Invite someone"})]}),a.jsxs("div",{className:"px-6 py-2 border-t border-b border-border bg-muted/20 flex items-center justify-between",children:[a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Pending invitations",!i&&x.length>0&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",x.length]})]}),a.jsxs("button",{onClick:t,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(it,{className:"h-3 w-3"}),"Invite"]})]}),i?a.jsx("div",{className:"divide-y divide-border",children:[1,2].map(j=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3.5 w-48"}),a.jsx(le,{className:"h-3 w-64"})]})]},j))}):x.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"No pending invitations."}),a.jsx("button",{onClick:t,className:"mt-2 text-sm text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:"Invite someone"})]}):a.jsx("div",{className:"divide-y divide-border",children:x.map(j=>a.jsx(B$,{invitation:j,workspaceId:e},j.id))}),a.jsx(Jo,{open:!!f,onClose:()=>m(null),onConfirm:()=>{f&&l.mutate(f.user_id,{onSuccess:()=>{z.success("Member removed"),m(null)},onError:()=>{z.error("Failed to remove member"),m(null)}})},title:"Remove member",description:`Remove ${((v=f==null?void 0:f.user)==null?void 0:v.email)??"this member"} from the workspace? They will lose access to all projects.`,confirmLabel:"Remove",variant:"destructive",loading:l.isPending}),a.jsx(Jo,{open:!!h,onClose:()=>g(null),onConfirm:()=>{h&&o.mutate({userId:h.member.user_id,role:h.newRole},{onSuccess:()=>{z.success("Role updated"),g(null)},onError:()=>{z.error("Failed to update role"),g(null)}})},title:"Change role",description:`Make ${((y=h==null?void 0:h.member.user)==null?void 0:y.email)??"this member"} a workspace ${(h==null?void 0:h.newRole)==="admin"?"admin":"member"}?`,confirmLabel:"Change role",loading:o.isPending})]})}function q$({workspaceId:e,teamId:t,allMembers:r}){var y,j;const{data:n,isLoading:s}=rD(e,t),i=nD(e,t),o=aD(e,t),[l,c]=p.useState(""),[d,u]=p.useState(null),[f,m]=p.useState(null),h=new Set((n==null?void 0:n.map(b=>b.user_id))??[]),g=r.filter(b=>!h.has(b.user_id)),x=n==null?void 0:n.find(b=>b.user_id===d),v=r.find(b=>b.user_id===f);return a.jsxs("div",{className:"bg-muted/10 border-t border-border",children:[s?a.jsx("div",{className:"px-8 py-3",children:a.jsx(le,{className:"h-3 w-40"})}):(n==null?void 0:n.length)===0?a.jsx("p",{className:"px-8 py-3 text-xs text-muted-foreground",children:"No members in this team yet."}):a.jsx("div",{className:"divide-y divide-border/50",children:n==null?void 0:n.map(b=>{var P;const N=b.user,k=(N==null?void 0:N.first_name)??"",w=(N==null?void 0:N.last_name)??"",S=`${k} ${w}`.trim()||(N==null?void 0:N.email)||"Unknown",C=(k[0]??w[0]??((P=N==null?void 0:N.email)==null?void 0:P[0])??"U").toUpperCase();return a.jsxs("div",{className:"flex items-center gap-3 px-8 py-2.5 group hover:bg-muted/20 transition-colors",children:[a.jsx(Bt,{className:"h-6 w-6 shrink-0",children:a.jsx(Wt,{className:"text-[10px] font-medium",children:C})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:S}),a.jsx("button",{onClick:()=>u(b.user_id),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Remove from team",children:a.jsx(nt,{className:"h-3.5 w-3.5"})})]},b.id)})}),g.length>0&&a.jsxs("div",{className:"px-8 py-2.5 flex items-center gap-2 border-t border-border/50",children:[a.jsx(Ki,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Fe,{value:l,onValueChange:c,children:[a.jsx(Re,{className:"h-7 text-xs flex-1 max-w-[200px]",children:a.jsx(Ye,{placeholder:"Add member…"})}),a.jsx($e,{children:g.map(b=>{const N=b.user,k=(N==null?void 0:N.first_name)??"",w=(N==null?void 0:N.last_name)??"",S=`${k} ${w}`.trim()||(N==null?void 0:N.email)||"Unknown";return a.jsx(be,{value:b.user_id,children:S},b.user_id)})})]}),l&&a.jsx(Z,{size:"sm",className:"h-7 text-xs px-2",disabled:i.isPending,onClick:()=>m(l),children:"Add"})]}),a.jsx(Jo,{open:!!d,onClose:()=>u(null),onConfirm:()=>{d&&o.mutate(d,{onSuccess:()=>{z.success("Removed from team"),u(null)},onError:()=>{z.error("Failed to remove"),u(null)}})},title:"Remove from team",description:`Remove ${((y=x==null?void 0:x.user)==null?void 0:y.email)??"this member"} from the team?`,confirmLabel:"Remove",variant:"destructive",loading:o.isPending}),a.jsx(Jo,{open:!!f,onClose:()=>{m(null),c("")},onConfirm:()=>{f&&i.mutate(f,{onSuccess:()=>{z.success("Added to team"),m(null),c("")},onError:()=>{z.error("Failed to add"),m(null)}})},title:"Add to team",description:`Add ${((j=v==null?void 0:v.user)==null?void 0:j.email)??"this member"} to the team?`,confirmLabel:"Add",loading:i.isPending})]})}function H$({workspaceId:e}){const{data:t,isLoading:r}=xu(e),{data:n}=Pl(e),s=eD(e),i=tD(e),[o,l]=p.useState(new Set),[c,d]=p.useState(!1),[u,f]=p.useState(""),[m,h]=p.useState(null),g=t==null?void 0:t.find(y=>y.id===m),x=y=>{l(j=>{const b=new Set(j);return b.has(y)?b.delete(y):b.add(y),b})},v=y=>{y.preventDefault(),u.trim()&&s.mutate({name:u.trim()},{onSuccess:()=>{z.success("Team created"),f(""),d(!1)},onError:()=>z.error("Failed to create team")})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex items-center justify-between",children:[a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Teams",!r&&t&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",t.length]})]}),a.jsxs("button",{onClick:()=>d(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(it,{className:"h-3 w-3"}),"New team"]})]}),c&&a.jsx("div",{className:"px-6 py-3 border-b border-border bg-muted/5",children:a.jsxs("form",{onSubmit:v,className:"flex items-center gap-2",children:[a.jsx(Ee,{autoFocus:!0,placeholder:"Team name",value:u,onChange:y=>f(y.target.value),className:"h-8 text-sm flex-1 max-w-[240px]"}),a.jsx(Z,{type:"submit",size:"sm",className:"h-8",disabled:!u.trim()||s.isPending,children:s.isPending?"Creating…":"Create"}),a.jsx(Z,{type:"button",variant:"ghost",size:"sm",className:"h-8",onClick:()=>{d(!1),f("")},children:"Cancel"})]})}),r?a.jsx("div",{className:"divide-y divide-border",children:[1,2].map(y=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(le,{className:"h-7 w-7 rounded-lg shrink-0"}),a.jsx(le,{className:"h-3.5 w-32"})]},y))}):t!=null&&t.length?a.jsx("div",{className:"divide-y divide-border",children:t.map(y=>{const j=o.has(y.id);return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5 hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors group",children:[a.jsx("button",{onClick:()=>x(y.id),className:"text-muted-foreground hover:text-foreground shrink-0 transition-colors",children:j?a.jsx(Kn,{className:"h-4 w-4"}):a.jsx(kn,{className:"h-4 w-4"})}),a.jsx("div",{className:"h-7 w-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(Ts,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:y.name}),y.description&&a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.description})]}),a.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[y.member_count," ",y.member_count===1?"member":"members"]}),a.jsxs(ln,{children:[a.jsx(cn,{asChild:!0,children:a.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:a.jsx(Ys,{className:"h-4 w-4"})})}),a.jsx(Kr,{align:"end",className:"w-36",children:a.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:()=>h(y.id),children:[a.jsx(Hr,{className:"h-3.5 w-3.5 mr-2"}),"Delete team"]})})]})]}),j&&a.jsx(q$,{workspaceId:e,teamId:y.id,allMembers:n??[]})]},y.id)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Ts,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No teams yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Teams make it easy to grant project access to groups of people."}),a.jsx(Z,{variant:"outline",size:"sm",onClick:()=>d(!0),children:"Create a team"})]}),a.jsx(Jo,{open:!!m,onClose:()=>h(null),onConfirm:()=>{m&&i.mutate(m,{onSuccess:()=>{z.success("Team deleted"),h(null)},onError:()=>{z.error("Failed to delete team"),h(null)}})},title:"Delete team",description:`Delete "${(g==null?void 0:g.name)??"this team"}"? All members will be removed from the team. Projects will not be affected.`,confirmLabel:"Delete team",variant:"destructive",loading:i.isPending})]})}const K$=["general","members","teams"];function Y$(){const{workspace:e}=De(),t=(e==null?void 0:e.id)??"",[r,n]=gp(),s=r.get("tab"),[i,o]=p.useState(K$.includes(s)?s:"general"),l=u=>{o(u),n({tab:u},{replace:!0})},[c,d]=p.useState(!1);return a.jsxs("div",{className:"p-2",children:[a.jsx(yr,{zone:"workspace.settings.before",props:{workspaceId:t}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border px-2",children:[a.jsx("div",{className:"flex",children:["general","members","teams"].map(u=>a.jsx("button",{onClick:()=>l(u),className:T("h-12 px-4 text-sm font-medium border-b-2 transition-colors capitalize",i===u?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:u},u))}),i==="members"&&a.jsxs(Z,{size:"sm",onClick:()=>d(!0),children:[a.jsx(it,{className:"h-4 w-4"}),"Add member"]})]}),i==="general"&&a.jsx(W$,{workspaceId:t}),i==="members"&&a.jsx(U$,{workspaceId:t,onInvite:()=>d(!0)}),i==="teams"&&a.jsx(H$,{workspaceId:t})]}),a.jsx(yr,{zone:"workspace.settings.after",props:{workspaceId:t}}),a.jsx(F$,{open:c,onClose:()=>d(!1),workspaceId:t})]})}function G$({open:e,onClose:t}){const[r,n]=p.useState(""),[s,i]=p.useState(""),[o,l]=p.useState(new Set),c=I$();p.useEffect(()=>{e&&(n(""),i(""),l(new Set))},[e]);const d=rd.flatMap(x=>x.permissions.map(v=>v.key)),u=d.every(x=>o.has(x)),f=!u&&d.some(x=>o.has(x)),m=()=>{l(u?new Set:new Set(d))},h=x=>{l(v=>{const y=new Set(v);return y.has(x)?y.delete(x):y.add(x),y})},g=x=>{x.preventDefault(),r.trim()&&c.mutate({name:r.trim(),description:s.trim()||void 0,permissions:Array.from(o)},{onSuccess:()=>{z.success("Role created"),t()},onError:v=>z.error(v.message||"Failed to create role")})};return a.jsx(Gs,{open:e,onOpenChange:x=>!x&&t(),children:a.jsxs(as,{className:"sm:max-w-[580px] max-h-[85vh] overflow-y-auto",children:[a.jsxs(Vs,{children:[a.jsx(Xs,{children:"Create role"}),a.jsx(El,{children:"Define a new custom role with a specific permission set."})]}),a.jsxs("form",{onSubmit:g,className:"space-y-5 pt-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),a.jsx(Ee,{value:r,onChange:x=>n(x.target.value),placeholder:"e.g. Developer, PM, Viewer",className:"h-9",autoFocus:!0,required:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Description ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(Ee,{value:s,onChange:x=>i(x.target.value),placeholder:"What is this role for?",className:"h-9"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Permissions"}),a.jsx("button",{type:"button",onClick:m,className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:u?"Deselect all":"Select all"})]}),rd.map(x=>a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:x.group}),a.jsx("div",{className:"space-y-1.5",children:x.permissions.map(v=>a.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[a.jsx("input",{type:"checkbox",checked:o.has(v.key),onChange:()=>h(v.key),className:"h-3.5 w-3.5 rounded border-border accent-foreground cursor-pointer"}),a.jsx("span",{className:"text-sm group-hover:text-foreground text-muted-foreground transition-colors",children:v.label})]},v.key))})]},x.group))]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(Z,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(Z,{type:"submit",size:"sm",disabled:!r.trim()||c.isPending,children:c.isPending?"Creating…":"Create role"})]})]})]})})}function V$({role:e,onDeleted:t}){const[r,n]=p.useState(e.name),[s,i]=p.useState(e.description??""),[o,l]=p.useState(new Set(e.permissions)),[c,d]=p.useState(!1),u=R$(e.id),f=$$();p.useEffect(()=>{n(e.name),i(e.description??""),l(new Set(e.permissions))},[e.id,e.name,e.description,e.permissions]);const m=r!==e.name||s!==(e.description??"")||o.size!==e.permissions.length||Array.from(o).some(N=>!e.permissions.includes(N)),h=rd.flatMap(N=>N.permissions.map(k=>k.key)),g=h.every(N=>o.has(N)),x=!g&&h.some(N=>o.has(N)),v=()=>{l(g?new Set:new Set(h))},y=N=>{l(k=>{const w=new Set(k);return w.has(N)?w.delete(N):w.add(N),w})},j=()=>{u.mutate({name:r.trim(),description:s.trim()||void 0,permissions:Array.from(o)},{onSuccess:()=>z.success("Role saved"),onError:N=>z.error(N.message||"Failed to save role")})},b=()=>{f.mutate(e.id,{onSuccess:()=>{z.success("Role deleted"),t(),d(!1)},onError:N=>z.error(N.message||"Failed to delete role")})};return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold",children:e.name}),e.is_system&&a.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:[a.jsx(qi,{className:"h-3 w-3"}),"System"]})]}),!e.is_system&&a.jsx("button",{onClick:()=>d(!0),className:"text-muted-foreground hover:text-destructive transition-colors",title:"Delete role",children:a.jsx(Hr,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-5",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),a.jsx(Ee,{value:r,onChange:N=>n(N.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Description"}),a.jsx(Ee,{value:s,onChange:N=>i(N.target.value),placeholder:"What is this role for?",className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Permissions"}),a.jsx("button",{type:"button",onClick:v,className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:g?"Deselect all":"Select all"})]}),rd.map(N=>a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:N.group}),a.jsx("div",{className:"space-y-2",children:N.permissions.map(k=>a.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[a.jsx("input",{type:"checkbox",checked:o.has(k.key),onChange:()=>y(k.key),className:"h-3.5 w-3.5 rounded border-border accent-foreground cursor-pointer"}),a.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors",children:k.label})]},k.key))})]},N.group))]}),a.jsx("div",{className:"shrink-0 px-6 py-4 border-t border-border flex justify-end",children:a.jsx(Z,{size:"sm",onClick:j,disabled:!m||!r.trim()||u.isPending,children:u.isPending?"Saving…":"Save changes"})}),a.jsx(Wu,{open:c,onOpenChange:d,children:a.jsxs(Bl,{children:[a.jsxs(Wl,{children:[a.jsxs(ql,{children:['Delete "',e.name,'"?']}),a.jsx(Hl,{children:"This role will be removed from all users assigned to it. This action cannot be undone."})]}),a.jsxs(Ul,{children:[a.jsx(Yl,{children:"Cancel"}),a.jsx(Kl,{onClick:b,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}function X$(){const{data:e,isLoading:t}=lg(),[r,n]=p.useState(null),[s,i]=p.useState(!1),o=(e==null?void 0:e.filter(d=>d.is_system))??[],l=(e==null?void 0:e.filter(d=>!d.is_system))??[];p.useEffect(()=>{e&&e.length>0&&!r&&n(e[0].id)},[e]);const c=(e==null?void 0:e.find(d=>d.id===r))??null;return a.jsx("div",{className:"p-2 h-full",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col h-full",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Jm,{className:"h-5 w-5 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-base font-semibold",children:"Roles & Permissions"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Define what users with each custom role can do across the application."})]})]}),a.jsxs(Z,{size:"sm",onClick:()=>i(!0),children:[a.jsx(it,{className:"h-4 w-4 mr-1.5"}),"Create role"]})]}),a.jsxs("div",{className:"flex flex-1 min-h-0",children:[a.jsx("div",{className:"w-56 shrink-0 border-r border-border flex flex-col overflow-y-auto",children:t?a.jsx("div",{className:"p-4 space-y-2",children:[1,2,3].map(d=>a.jsx(le,{className:"h-8 w-full"},d))}):a.jsxs(a.Fragment,{children:[o.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"px-3 pt-3 pb-1",children:a.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"System Roles"})}),o.map(d=>a.jsxs("button",{onClick:()=>n(d.id),className:T("w-full flex items-center gap-2 px-3 py-2 text-left text-sm transition-colors",r===d.id?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[a.jsx(qi,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"truncate",children:d.name})]},d.id))]}),l.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"px-3 pt-3 pb-1",children:a.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Custom Roles"})}),l.map(d=>a.jsxs("button",{onClick:()=>n(d.id),className:T("w-full flex items-center gap-2 px-3 py-2 text-left text-sm transition-colors",r===d.id?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[a.jsx("div",{className:"h-3 w-3 shrink-0"}),a.jsx("span",{className:"truncate",children:d.name})]},d.id))]}),!t&&(!e||e.length===0)&&a.jsx("div",{className:"flex flex-col items-center justify-center py-10 px-3 text-center",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"No roles yet."})})]})}),a.jsx("div",{className:"flex-1 min-w-0",children:c?a.jsx(V$,{role:c,onDeleted:()=>{var u;const d=(e==null?void 0:e.filter(f=>f.id!==c.id))??[];n(((u=d[0])==null?void 0:u.id)??null)}},c.id):a.jsx("div",{className:"flex items-center justify-center h-full text-center p-8",children:a.jsxs("div",{children:[a.jsx(Jm,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"Select a role to edit"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Or"," ",a.jsx("button",{onClick:()=>i(!0),className:"underline underline-offset-2 hover:text-foreground transition-colors",children:"create a new role"})]})]})})})]}),a.jsx(G$,{open:s,onClose:()=>i(!1)})]})})}function Q$(e){return Le({queryKey:["invite",e],queryFn:()=>te.get(`/auth/invite/${e}`),retry:!1,enabled:!!e})}function Z$(){const{token:e}=qt(),{isAuthenticated:t}=De(),r=kt(),{data:n,isLoading:s,error:i}=Q$(e??""),{data:o}=vu(),l=oD(e??""),[c,d]=p.useState(""),[u,f]=p.useState(""),[m,h]=p.useState(""),[g,x]=p.useState(""),[v,y]=p.useState(!1);if(t&&n)return r(`/${n.workspace.slug}/projects`,{replace:!0}),null;const j=(n==null?void 0:n.invitation.email)??null,b=N=>{N.preventDefault();const k=j??m.trim();if(!k){z.error("Email is required");return}l.mutate({email:k,password:g,first_name:c,last_name:u},{onSuccess:()=>{r(`/${n.workspace.slug}/projects`,{replace:!0})},onError:w=>z.error(w.message??"Registration failed")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[380px]",children:[a.jsx("div",{className:"flex justify-center mb-8",children:a.jsx("div",{className:"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})})}),s?a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"h-2 bg-muted rounded animate-pulse w-48 mx-auto"}),a.jsx("div",{className:"h-2 bg-muted rounded animate-pulse w-32 mx-auto"})]}):i?a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-6 text-center space-y-3",children:[a.jsx("p",{className:"text-sm font-medium",children:"Invalid or expired invitation"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This invite link is no longer valid. Ask for a new one."}),a.jsx(Va,{to:"/login",children:a.jsx(Z,{variant:"outline",size:"sm",className:"mt-2",children:"Go to login"})})]}):n?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"px-5 py-4 border-b border-border",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(iE,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"You've been invited to"})]}),a.jsx("p",{className:"text-base font-semibold",children:n.workspace.name})]}),a.jsxs("div",{className:"px-5 py-3 flex items-center gap-2.5",children:[n.invitation.role==="admin"?a.jsx(PE,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):a.jsx(FE,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:["Joining as"," ",a.jsx("span",{className:"font-medium text-foreground capitalize",children:n.invitation.role}),n.invitation.role==="admin"?" — full access":" — can view and edit"]})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-5",children:[a.jsx("p",{className:"text-sm font-medium mb-4",children:"Create your account"}),a.jsxs("form",{onSubmit:b,className:"space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Ee,{placeholder:"First name",value:c,onChange:N=>d(N.target.value),required:!0,className:"h-9 bg-transparent",autoFocus:!0}),a.jsx(Ee,{placeholder:"Last name",value:u,onChange:N=>f(N.target.value),required:!0,className:"h-9 bg-transparent"})]}),j?a.jsxs("div",{className:"relative",children:[a.jsx(Ee,{type:"email",value:j,readOnly:!0,className:"h-9 bg-muted/50 text-muted-foreground cursor-not-allowed"}),a.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:"locked"})]}):a.jsx(Ee,{type:"email",placeholder:"Email",value:m,onChange:N=>h(N.target.value),required:!0,className:"h-9 bg-transparent",autoComplete:"email"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ee,{type:v?"text":"password",placeholder:"Password (min. 8 characters)",value:g,onChange:N=>x(N.target.value),required:!0,minLength:8,className:"h-9 bg-transparent pr-10",autoComplete:"new-password"}),a.jsx("button",{type:"button",onClick:()=>y(!v),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:v?a.jsx(Mp,{className:"h-4 w-4"}):a.jsx(_l,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(Z,{type:"submit",className:"w-full h-9 font-medium",disabled:l.isPending,children:l.isPending?"Creating account…":"Accept invitation"})})]})]}),(o==null?void 0:o.googleOAuthEnabled)&&a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-border"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),a.jsx("div",{className:"h-px flex-1 bg-border"})]}),a.jsx(Fp,{flow:"invite",inviteToken:e,label:"Accept with Google"})]}),a.jsxs("p",{className:"text-sm text-center text-muted-foreground",children:["Already have an account?"," ",a.jsx(Va,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]}):null]})})}var J$=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function dg(e){if(typeof e!="string")return!1;var t=J$;return t.includes(e)}var ez=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],tz=new Set(ez);function xk(e){return typeof e!="string"?!1:tz.has(e)}function vk(e){return typeof e=="string"&&e.startsWith("data-")}function ha(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(xk(r)||vk(r))&&(t[r]=e[r]);return t}function ug(e){if(e==null)return null;if(p.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return ha(t)}return typeof e=="object"&&!Array.isArray(e)?ha(e):null}function an(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(xk(r)||vk(r)||dg(r))&&(t[r]=e[r]);return t}var rz=["children","width","height","viewBox","className","style","title","desc"];function uh(){return uh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uh.apply(null,arguments)}function nz(e,t){if(e==null)return{};var r,n,s=az(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function az(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var yk=p.forwardRef((e,t)=>{var{children:r,width:n,height:s,viewBox:i,className:o,style:l,title:c,desc:d}=e,u=nz(e,rz),f=i||{width:n,height:s,x:0,y:0},m=Je("recharts-surface",o);return p.createElement("svg",uh({},an(u),{className:m,width:n,height:s,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),p.createElement("title",null,c),p.createElement("desc",null,d),r)}),sz=["children","className"];function fh(){return fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fh.apply(null,arguments)}function iz(e,t){if(e==null)return{};var r,n,s=oz(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function oz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var pa=p.forwardRef((e,t)=>{var{children:r,className:n}=e,s=iz(e,sz),i=Je("recharts-layer",n);return p.createElement("g",fh({className:i},an(s),{ref:t}),r)}),lz=p.createContext(null);function rt(e){return function(){return e}}const bk=Math.cos,nd=Math.sin,Sn=Math.sqrt,ad=Math.PI,Uu=2*ad,mh=Math.PI,hh=2*mh,hs=1e-6,cz=hh-hs;function wk(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function dz(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return wk;const r=10**t;return function(n){this._+=n[0];for(let s=1,i=n.length;s<i;++s)this._+=Math.round(arguments[s]*r)/r+n[s]}}class uz{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?wk:dz(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,s){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+s}`}bezierCurveTo(t,r,n,s,i,o){this._append`C${+t},${+r},${+n},${+s},${this._x1=+i},${this._y1=+o}`}arcTo(t,r,n,s,i){if(t=+t,r=+r,n=+n,s=+s,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=n-t,d=s-r,u=o-t,f=l-r,m=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(m>hs)if(!(Math.abs(f*c-d*u)>hs)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,g=s-l,x=c*c+d*d,v=h*h+g*g,y=Math.sqrt(x),j=Math.sqrt(m),b=i*Math.tan((mh-Math.acos((x+m-v)/(2*y*j)))/2),N=b/j,k=b/y;Math.abs(N-1)>hs&&this._append`L${t+N*u},${r+N*f}`,this._append`A${i},${i},0,0,${+(f*h>u*g)},${this._x1=t+k*c},${this._y1=r+k*d}`}}arc(t,r,n,s,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(s),c=n*Math.sin(s),d=t+l,u=r+c,f=1^o,m=o?s-i:i-s;this._x1===null?this._append`M${d},${u}`:(Math.abs(this._x1-d)>hs||Math.abs(this._y1-u)>hs)&&this._append`L${d},${u}`,n&&(m<0&&(m=m%hh+hh),m>cz?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=d},${this._y1=u}`:m>hs&&this._append`A${n},${n},0,${+(m>=mh)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+s}h${-n}Z`}toString(){return this._}}function fg(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 uz(t)}function mg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jk(e){this._context=e}jk.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 qu(e){return new jk(e)}function Nk(e){return e[0]}function kk(e){return e[1]}function Sk(e,t){var r=rt(!0),n=null,s=qu,i=null,o=fg(l);e=typeof e=="function"?e:e===void 0?Nk:rt(e),t=typeof t=="function"?t:t===void 0?kk:rt(t);function l(c){var d,u=(c=mg(c)).length,f,m=!1,h;for(n==null&&(i=s(h=o())),d=0;d<=u;++d)!(d<u&&r(f=c[d],d,c))===m&&((m=!m)?i.lineStart():i.lineEnd()),m&&i.point(+e(f,d,c),+t(f,d,c));if(h)return i=null,h+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:rt(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:rt(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:rt(!!c),l):r},l.curve=function(c){return arguments.length?(s=c,n!=null&&(i=s(n)),l):s},l.context=function(c){return arguments.length?(c==null?n=i=null:i=s(n=c),l):n},l}function kc(e,t,r){var n=null,s=rt(!0),i=null,o=qu,l=null,c=fg(d);e=typeof e=="function"?e:e===void 0?Nk:rt(+e),t=typeof t=="function"?t:rt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?kk:rt(+r);function d(f){var m,h,g,x=(f=mg(f)).length,v,y=!1,j,b=new Array(x),N=new Array(x);for(i==null&&(l=o(j=c())),m=0;m<=x;++m){if(!(m<x&&s(v=f[m],m,f))===y)if(y=!y)h=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=m-1;g>=h;--g)l.point(b[g],N[g]);l.lineEnd(),l.areaEnd()}y&&(b[m]=+e(v,m,f),N[m]=+t(v,m,f),l.point(n?+n(v,m,f):b[m],r?+r(v,m,f):N[m]))}if(j)return l=null,j+""||null}function u(){return Sk().defined(s).curve(o).context(i)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:rt(+f),n=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:rt(+f),d):e},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:rt(+f),d):n},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:rt(+f),r=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:rt(+f),d):t},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:rt(+f),d):r},d.lineX0=d.lineY0=function(){return u().x(e).y(t)},d.lineY1=function(){return u().x(e).y(r)},d.lineX1=function(){return u().x(n).y(t)},d.defined=function(f){return arguments.length?(s=typeof f=="function"?f:rt(!!f),d):s},d.curve=function(f){return arguments.length?(o=f,i!=null&&(l=o(i)),d):o},d.context=function(f){return arguments.length?(f==null?i=l=null:l=o(i=f),d):i},d}class Ck{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 fz(e){return new Ck(e,!0)}function mz(e){return new Ck(e,!1)}const hg={draw(e,t){const r=Sn(t/ad);e.moveTo(r,0),e.arc(0,0,r,0,Uu)}},hz={draw(e,t){const r=Sn(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()}},_k=Sn(1/3),pz=_k*2,gz={draw(e,t){const r=Sn(t/pz),n=r*_k;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},xz={draw(e,t){const r=Sn(t),n=-r/2;e.rect(n,n,r,r)}},vz=.8908130915292852,Ok=nd(ad/10)/nd(7*ad/10),yz=nd(Uu/10)*Ok,bz=-bk(Uu/10)*Ok,wz={draw(e,t){const r=Sn(t*vz),n=yz*r,s=bz*r;e.moveTo(0,-r),e.lineTo(n,s);for(let i=1;i<5;++i){const o=Uu*i/5,l=bk(o),c=nd(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*s,c*n+l*s)}e.closePath()}},jm=Sn(3),jz={draw(e,t){const r=-Sn(t/(jm*3));e.moveTo(0,r*2),e.lineTo(-jm*r,-r),e.lineTo(jm*r,-r),e.closePath()}},Xr=-.5,Qr=Sn(3)/2,ph=1/Sn(12),Nz=(ph/2+1)*3,kz={draw(e,t){const r=Sn(t/Nz),n=r/2,s=r*ph,i=n,o=r*ph+r,l=-i,c=o;e.moveTo(n,s),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(Xr*n-Qr*s,Qr*n+Xr*s),e.lineTo(Xr*i-Qr*o,Qr*i+Xr*o),e.lineTo(Xr*l-Qr*c,Qr*l+Xr*c),e.lineTo(Xr*n+Qr*s,Xr*s-Qr*n),e.lineTo(Xr*i+Qr*o,Xr*o-Qr*i),e.lineTo(Xr*l+Qr*c,Xr*c-Qr*l),e.closePath()}};function Sz(e,t){let r=null,n=fg(s);e=typeof e=="function"?e:rt(e||hg),t=typeof t=="function"?t:rt(t===void 0?64:+t);function s(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return s.type=function(i){return arguments.length?(e=typeof i=="function"?i:rt(i),s):e},s.size=function(i){return arguments.length?(t=typeof i=="function"?i:rt(+i),s):t},s.context=function(i){return arguments.length?(r=i??null,s):r},s}function sd(){}function id(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 Pk(e){this._context=e}Pk.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:id(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:id(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Cz(e){return new Pk(e)}function Mk(e){this._context=e}Mk.prototype={areaStart:sd,areaEnd:sd,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:id(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _z(e){return new Mk(e)}function Ak(e){this._context=e}Ak.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:id(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Oz(e){return new Ak(e)}function Ek(e){this._context=e}Ek.prototype={areaStart:sd,areaEnd:sd,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 Pz(e){return new Ek(e)}function fy(e){return e<0?-1:1}function my(e,t,r){var n=e._x1-e._x0,s=t-e._x1,i=(e._y1-e._y0)/(n||s<0&&-0),o=(r-e._y1)/(s||n<0&&-0),l=(i*s+o*n)/(n+s);return(fy(i)+fy(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function hy(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Nm(e,t,r){var n=e._x0,s=e._y0,i=e._x1,o=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,s+l*t,i-l,o-l*r,i,o)}function od(e){this._context=e}od.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:Nm(this,this._t0,hy(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,Nm(this,hy(this,r=my(this,e,t)),r);break;default:Nm(this,this._t0,r=my(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Dk(e){this._context=new Tk(e)}(Dk.prototype=Object.create(od.prototype)).point=function(e,t){od.prototype.point.call(this,t,e)};function Tk(e){this._context=e}Tk.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,s,i){this._context.bezierCurveTo(t,e,n,r,i,s)}};function Mz(e){return new od(e)}function Az(e){return new Dk(e)}function Ik(e){this._context=e}Ik.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=py(e),s=py(t),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],s[0][i],n[1][i],s[1][i],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function py(e){var t,r=e.length-1,n,s=new Array(r),i=new Array(r),o=new Array(r);for(s[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,i[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=s[t]/i[t-1],i[t]-=n,o[t]-=n*o[t-1];for(s[r-1]=o[r-1]/i[r-1],t=r-2;t>=0;--t)s[t]=(o[t]-s[t+1])/i[t];for(i[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-s[t+1];return[s,i]}function Ez(e){return new Ik(e)}function Hu(e,t){this._context=e,this._t=t}Hu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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 Dz(e){return new Hu(e,.5)}function Tz(e){return new Hu(e,0)}function Iz(e){return new Hu(e,1)}function zs(e,t){if((o=e.length)>1)for(var r=1,n,s,i=e[t[0]],o,l=i.length;r<o;++r)for(s=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(s[n][1])?s[n][0]:s[n][1]}function gh(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Rz(e,t){return e[t]}function $z(e){const t=[];return t.key=e,t}function zz(){var e=rt([]),t=gh,r=zs,n=Rz;function s(i){var o=Array.from(e.apply(this,arguments),$z),l,c=o.length,d=-1,u;for(const f of i)for(l=0,++d;l<c;++l)(o[l][d]=[0,+n(f,o[l].key,d,i)]).data=f;for(l=0,u=mg(t(o));l<c;++l)o[u[l]].index=l;return r(o,u),o}return s.keys=function(i){return arguments.length?(e=typeof i=="function"?i:rt(Array.from(i)),s):e},s.value=function(i){return arguments.length?(n=typeof i=="function"?i:rt(+i),s):n},s.order=function(i){return arguments.length?(t=i==null?gh:typeof i=="function"?i:rt(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(r=i??zs,s):r},s}function Lz(e,t){if((n=e.length)>0){for(var r,n,s=0,i=e[0].length,o;s<i;++s){for(o=r=0;r<n;++r)o+=e[r][s][1]||0;if(o)for(r=0;r<n;++r)e[r][s][1]/=o}zs(e,t)}}function Fz(e,t){if((s=e.length)>0){for(var r=0,n=e[t[0]],s,i=n.length;r<i;++r){for(var o=0,l=0;o<s;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}zs(e,t)}}function Bz(e,t){if(!(!((o=e.length)>0)||!((i=(s=e[t[0]]).length)>0))){for(var r=0,n=1,s,i,o;n<i;++n){for(var l=0,c=0,d=0;l<o;++l){for(var u=e[t[l]],f=u[n][1]||0,m=u[n-1][1]||0,h=(f-m)/2,g=0;g<l;++g){var x=e[t[g]],v=x[n][1]||0,y=x[n-1][1]||0;h+=v-y}c+=f,d+=h*f}s[n-1][1]+=s[n-1][0]=r,c&&(r-=d/c)}s[n-1][1]+=s[n-1][0]=r,zs(e,t)}}var Ku={},Rk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(Rk);var pg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t})(pg);var Yu={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var n;return typeof r=="string"||typeof r=="symbol"?r:Object.is((n=r==null?void 0:r.valueOf)==null?void 0:n.call(r),-0)?"-0":String(r)}e.toKey=t})(Yu);var Gu={},$k={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(r==null)return"";if(typeof r=="string")return r;if(Array.isArray(r))return r.map(t).join(",");const n=String(r);return n==="0"&&Object.is(Number(r),-0)?"-0":n}e.toString=t})($k);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$k,r=Yu;function n(s){if(Array.isArray(s))return s.map(r.toKey);if(typeof s=="symbol")return[s];s=t.toString(s);const i=[],o=s.length;if(o===0)return i;let l=0,c="",d="",u=!1;for(s.charCodeAt(0)===46&&(i.push(""),l++);l<o;){const f=s[l];d?f==="\\"&&l+1<o?(l++,c+=s[l]):f===d?d="":c+=f:u?f==='"'||f==="'"?d=f:f==="]"?(u=!1,i.push(c),c=""):c+=f:f==="["?(u=!0,c&&(i.push(c),c="")):f==="."?c&&(i.push(c),c=""):c+=f,l++}return c&&i.push(c),i}e.toPath=n})(Gu);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rk,r=pg,n=Yu,s=Gu;function i(l,c,d){if(l==null)return d;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?r.isDeepKey(c)?i(l,s.toPath(c),d):d:u}case"number":case"symbol":{typeof c=="number"&&(c=n.toKey(c));const u=l[c];return u===void 0?d:u}default:{if(Array.isArray(c))return o(l,c,d);if(Object.is(c==null?void 0:c.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?d:u}}}function o(l,c,d){if(c.length===0)return d;let u=l;for(let f=0;f<c.length;f++){if(u==null||t.isUnsafeProperty(c[f]))return d;u=u[c[f]]}return u===void 0?d:u}e.get=i})(Ku);var Wz=Ku.get;const Mi=Na(Wz);var Uz=4;function Ua(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Uz,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function vt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((s,i,o)=>{var l=r[o-1];return typeof l=="string"?s+l+i:l!==void 0?s+Ua(l)+i:s+i},"")}var Or=e=>e===0?0:e>0?1:-1,Wn=e=>typeof e=="number"&&e!=+e,Ls=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,xe=e=>(typeof e=="number"||e instanceof Number)&&!Wn(e),Un=e=>xe(e)||typeof e=="string",qz=0,el=e=>{var t=++qz;return"".concat(e||"").concat(t)},jn=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!xe(t)&&typeof t!="string")return n;var i;if(Ls(t)){if(r==null)return n;var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return Wn(i)&&(i=n),s&&r!=null&&i>r&&(i=r),i},zk=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[String(e[n])])r[String(e[n])]=!0;else return!0;return!1};function er(e,t,r){return xe(e)&&xe(t)?Ua(e+r*(t-e)):t}function Hz(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):Mi(n,t))===r)}var Ut=e=>e===null||typeof e>"u",Gl=e=>Ut(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Pr(e){return e!=null}function ro(){}var Kz=["type","size","sizeType"];function xh(){return xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xh.apply(null,arguments)}function gy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gy(Object(r),!0).forEach(function(n){Yz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Yz(e,t,r){return(t=Gz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gz(e){var t=Vz(e,"string");return typeof t=="symbol"?t:t+""}function Vz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xz(e,t){if(e==null)return{};var r,n,s=Qz(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Qz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Lk={symbolCircle:hg,symbolCross:hz,symbolDiamond:gz,symbolSquare:xz,symbolStar:wz,symbolTriangle:jz,symbolWye:kz},Zz=Math.PI/180,Jz=e=>{var t="symbol".concat(Gl(e));return Lk[t]||hg},e6=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*Zz;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},t6=(e,t)=>{Lk["symbol".concat(Gl(e))]=t},Fk=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,s=Xz(e,Kz),i=xy(xy({},s),{},{type:t,size:r,sizeType:n}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var m=Jz(o),h=Sz().type(m).size(e6(r,n,o)),g=h();if(g!==null)return g},{className:c,cx:d,cy:u}=i,f=an(i);return xe(d)&&xe(u)&&xe(r)?p.createElement("path",xh({},f,{className:Je("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(u,")"),d:l()})):null};Fk.registerSymbol=t6;var Bk=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,r6=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(p.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(s=>{dg(s)&&(n[s]=i=>r[s](r,i))}),n},n6=(e,t,r)=>n=>(e(t,r,n),null),gg=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(s=>{var i=e[s];dg(s)&&typeof i=="function"&&(n||(n={}),n[s]=n6(i,t,r))}),n};function vy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function a6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vy(Object(r),!0).forEach(function(n){s6(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function s6(e,t,r){return(t=i6(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i6(e){var t=o6(e,"string");return typeof t=="symbol"?t:t+""}function o6(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yr(e,t){var r=a6({},e),n=t,s=Object.keys(t),i=s.reduce((o,l)=>(o[l]===void 0&&n[l]!==void 0&&(o[l]=n[l]),o),r);return i}var Wk={},Uk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const s=new Map;for(let i=0;i<r.length;i++){const o=r[i],l=n(o,i,r);s.has(l)||s.set(l,o)}return Array.from(s.values())}e.uniqBy=t})(Uk);var qk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return function(...s){return r.apply(this,s.slice(0,n))}}e.ary=t})(qk);var xg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(xg);var Hk={},Vu={},Kk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(Kk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kk;function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(Vu);var Yk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(Yk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Vu,r=Yk;function n(s){return r.isObjectLike(s)&&t.isArrayLike(s)}e.isArrayLikeObject=n})(Hk);var Gk={},Vk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ku;function r(n){return function(s){return t.get(s,n)}}e.property=r})(Vk);var Xk={},vg={},Qk={},yg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(yg);var bg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(bg);var wg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return r===n||Number.isNaN(r)&&Number.isNaN(n)}e.isEqualsSameValueZero=t})(wg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yg,r=bg,n=wg;function s(u,f,m){return typeof m!="function"?s(u,f,()=>{}):i(u,f,function h(g,x,v,y,j,b){const N=m(g,x,v,y,j,b);return N!==void 0?!!N:i(g,x,h,b)},new Map)}function i(u,f,m,h){if(f===u)return!0;switch(typeof f){case"object":return o(u,f,m,h);case"function":return Object.keys(f).length>0?i(u,{...f},m,h):n.isEqualsSameValueZero(u,f);default:return t.isObject(u)?typeof f=="string"?f==="":!0:n.isEqualsSameValueZero(u,f)}}function o(u,f,m,h){if(f==null)return!0;if(Array.isArray(f))return c(u,f,m,h);if(f instanceof Map)return l(u,f,m,h);if(f instanceof Set)return d(u,f,m,h);const g=Object.keys(f);if(u==null||r.isPrimitive(u))return g.length===0;if(g.length===0)return!0;if(h!=null&&h.has(f))return h.get(f)===u;h==null||h.set(f,u);try{for(let x=0;x<g.length;x++){const v=g[x];if(!r.isPrimitive(u)&&!(v in u)||f[v]===void 0&&u[v]!==void 0||f[v]===null&&u[v]!==null||!m(u[v],f[v],v,u,f,h))return!1}return!0}finally{h==null||h.delete(f)}}function l(u,f,m,h){if(f.size===0)return!0;if(!(u instanceof Map))return!1;for(const[g,x]of f.entries()){const v=u.get(g);if(m(v,x,g,u,f,h)===!1)return!1}return!0}function c(u,f,m,h){if(f.length===0)return!0;if(!Array.isArray(u))return!1;const g=new Set;for(let x=0;x<f.length;x++){const v=f[x];let y=!1;for(let j=0;j<u.length;j++){if(g.has(j))continue;const b=u[j];let N=!1;if(m(b,v,x,u,f,h)&&(N=!0),N){g.add(j),y=!0;break}}if(!y)return!1}return!0}function d(u,f,m,h){return f.size===0?!0:u instanceof Set?c([...u],[...f],m,h):!1}e.isMatchWith=s,e.isSetMatch=d})(Qk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qk;function r(n,s){return t.isMatchWith(n,s,()=>{})}e.isMatch=r})(vg);var Zk={},jg={},Jk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}e.getSymbols=t})(Jk);var Xu={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t})(Xu);var Ng={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",n="[object Number]",s="[object Boolean]",i="[object Arguments]",o="[object Symbol]",l="[object Date]",c="[object Map]",d="[object Set]",u="[object Array]",f="[object Function]",m="[object ArrayBuffer]",h="[object Object]",g="[object Error]",x="[object DataView]",v="[object Uint8Array]",y="[object Uint8ClampedArray]",j="[object Uint16Array]",b="[object Uint32Array]",N="[object BigUint64Array]",k="[object Int8Array]",w="[object Int16Array]",S="[object Int32Array]",C="[object BigInt64Array]",P="[object Float32Array]",M="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=m,e.arrayTag=u,e.bigInt64ArrayTag=C,e.bigUint64ArrayTag=N,e.booleanTag=s,e.dataViewTag=x,e.dateTag=l,e.errorTag=g,e.float32ArrayTag=P,e.float64ArrayTag=M,e.functionTag=f,e.int16ArrayTag=w,e.int32ArrayTag=S,e.int8ArrayTag=k,e.mapTag=c,e.numberTag=n,e.objectTag=h,e.regexpTag=t,e.setTag=d,e.stringTag=r,e.symbolTag=o,e.uint16ArrayTag=j,e.uint32ArrayTag=b,e.uint8ArrayTag=v,e.uint8ClampedArrayTag=y})(Ng);var eS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(eS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Jk,r=Xu,n=Ng,s=bg,i=eS;function o(u,f){return l(u,void 0,u,new Map,f)}function l(u,f,m,h=new Map,g=void 0){const x=g==null?void 0:g(u,f,m,h);if(x!==void 0)return x;if(s.isPrimitive(u))return u;if(h.has(u))return h.get(u);if(Array.isArray(u)){const v=new Array(u.length);h.set(u,v);for(let y=0;y<u.length;y++)v[y]=l(u[y],y,m,h,g);return Object.hasOwn(u,"index")&&(v.index=u.index),Object.hasOwn(u,"input")&&(v.input=u.input),v}if(u instanceof Date)return new Date(u.getTime());if(u instanceof RegExp){const v=new RegExp(u.source,u.flags);return v.lastIndex=u.lastIndex,v}if(u instanceof Map){const v=new Map;h.set(u,v);for(const[y,j]of u)v.set(y,l(j,y,m,h,g));return v}if(u instanceof Set){const v=new Set;h.set(u,v);for(const y of u)v.add(l(y,void 0,m,h,g));return v}if(typeof Buffer<"u"&&Buffer.isBuffer(u))return u.subarray();if(i.isTypedArray(u)){const v=new(Object.getPrototypeOf(u)).constructor(u.length);h.set(u,v);for(let y=0;y<u.length;y++)v[y]=l(u[y],y,m,h,g);return v}if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer)return u.slice(0);if(u instanceof DataView){const v=new DataView(u.buffer.slice(0),u.byteOffset,u.byteLength);return h.set(u,v),c(v,u,m,h,g),v}if(typeof File<"u"&&u instanceof File){const v=new File([u],u.name,{type:u.type});return h.set(u,v),c(v,u,m,h,g),v}if(typeof Blob<"u"&&u instanceof Blob){const v=new Blob([u],{type:u.type});return h.set(u,v),c(v,u,m,h,g),v}if(u instanceof Error){const v=new u.constructor;return h.set(u,v),v.message=u.message,v.name=u.name,v.stack=u.stack,v.cause=u.cause,c(v,u,m,h,g),v}if(u instanceof Boolean){const v=new Boolean(u.valueOf());return h.set(u,v),c(v,u,m,h,g),v}if(u instanceof Number){const v=new Number(u.valueOf());return h.set(u,v),c(v,u,m,h,g),v}if(u instanceof String){const v=new String(u.valueOf());return h.set(u,v),c(v,u,m,h,g),v}if(typeof u=="object"&&d(u)){const v=Object.create(Object.getPrototypeOf(u));return h.set(u,v),c(v,u,m,h,g),v}return u}function c(u,f,m=u,h,g){const x=[...Object.keys(f),...t.getSymbols(f)];for(let v=0;v<x.length;v++){const y=x[v],j=Object.getOwnPropertyDescriptor(u,y);(j==null||j.writable)&&(u[y]=l(f[y],y,m,h,g))}}function d(u){switch(r.getTag(u)){case n.argumentsTag:case n.arrayTag:case n.arrayBufferTag:case n.dataViewTag:case n.booleanTag:case n.dateTag:case n.float32ArrayTag:case n.float64ArrayTag:case n.int8ArrayTag:case n.int16ArrayTag:case n.int32ArrayTag:case n.mapTag:case n.numberTag:case n.objectTag:case n.regexpTag:case n.setTag:case n.stringTag:case n.symbolTag:case n.uint8ArrayTag:case n.uint8ClampedArrayTag:case n.uint16ArrayTag:case n.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=l,e.copyProperties=c})(jg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jg;function r(n){return t.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}e.cloneDeep=r})(Zk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vg,r=Zk;function n(s){return s=r.cloneDeep(s),i=>t.isMatch(i,s)}e.matches=n})(Xk);var tS={},rS={},nS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jg,r=Xu,n=Ng;function s(i,o){return t.cloneDeepWith(i,(l,c,d,u)=>{const f=o==null?void 0:o(l,c,d,u);if(f!==void 0)return f;if(typeof i=="object"){if(r.getTag(i)===n.objectTag&&typeof i.constructor!="function"){const m={};return u.set(i,m),t.copyProperties(m,i,d,u),m}switch(Object.prototype.toString.call(i)){case n.numberTag:case n.stringTag:case n.booleanTag:{const m=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(m,i),m}case n.argumentsTag:{const m={};return t.copyProperties(m,i),m.length=i.length,m[Symbol.iterator]=i[Symbol.iterator],m}default:return}}})}e.cloneDeepWith=s})(nS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nS;function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(rS);var aS={},kg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(n,s=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<s;case"symbol":return!1;case"string":return t.test(n)}}e.isIndex=r})(kg);var sS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Xu;function r(n){return n!==null&&typeof n=="object"&&t.getTag(n)==="[object Arguments]"}e.isArguments=r})(sS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pg,r=kg,n=sS,s=Gu;function i(o,l){let c;if(Array.isArray(l)?c=l:typeof l=="string"&&t.isDeepKey(l)&&(o==null?void 0:o[l])==null?c=s.toPath(l):c=[l],c.length===0)return!1;let d=o;for(let u=0;u<c.length;u++){const f=c[u];if((d==null||!Object.hasOwn(d,f))&&!((Array.isArray(d)||n.isArguments(d))&&r.isIndex(f)&&f<d.length))return!1;d=d[f]}return!0}e.has=i})(aS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vg,r=Yu,n=rS,s=Ku,i=aS;function o(l,c){switch(typeof l){case"object":{Object.is(l==null?void 0:l.valueOf(),-0)&&(l="-0");break}case"number":{l=r.toKey(l);break}}return c=n.cloneDeep(c),function(d){const u=s.get(d,l);return u===void 0?i.has(d,l):c===void 0?u===void 0:t.isMatch(u,c)}}e.matchesProperty=o})(tS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xg,r=Vk,n=Xk,s=tS;function i(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?s.matchesProperty(o[0],o[1]):n.matches(o);case"string":case"symbol":case"number":return r.property(o)}}e.iteratee=i})(Gk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Uk,r=qk,n=xg,s=Hk,i=Gk;function o(l,c=n.identity){return s.isArrayLikeObject(l)?t.uniqBy(Array.from(l),r.ary(i.iteratee(c),1)):[]}e.uniqBy=o})(Wk);var l6=Wk.uniqBy;const yy=Na(l6);function c6(e,t,r){return t===!0?yy(e,r):typeof t=="function"?yy(e,t):e}var Sg=p.createContext(null),d6=e=>e,St=()=>{var e=p.useContext(Sg);return e?e.store.dispatch:d6},Yc=()=>{},u6=()=>Yc,f6=(e,t)=>e===t;function _e(e){var t=p.useContext(Sg),r=p.useMemo(()=>t?n=>{if(n!=null)return e(n)}:Yc,[t,e]);return MM.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:u6,t?t.store.getState:Yc,t?t.store.getState:Yc,r,f6)}function m6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function h6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function p6(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var by=e=>Array.isArray(e)?e:[e];function g6(e){const t=Array.isArray(e[0])?e[0]:e;return p6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function x6(e,t){const r=[],{length:n}=e;for(let s=0;s<n;s++)r.push(e[s].apply(null,t));return r}var v6=class{constructor(e){this.value=e}deref(){return this.value}},y6=typeof WeakRef<"u"?WeakRef:v6,b6=0,wy=1;function Sc(){return{s:b6,v:void 0,o:null,p:null}}function iS(e,t={}){let r=Sc();const{resultEqualityCheck:n}=t;let s,i=0;function o(){var f;let l=r;const{length:c}=arguments;for(let m=0,h=c;m<h;m++){const g=arguments[m];if(typeof g=="function"||typeof g=="object"&&g!==null){let x=l.o;x===null&&(l.o=x=new WeakMap);const v=x.get(g);v===void 0?(l=Sc(),x.set(g,l)):l=v}else{let x=l.p;x===null&&(l.p=x=new Map);const v=x.get(g);v===void 0?(l=Sc(),x.set(g,l)):l=v}}const d=l;let u;if(l.s===wy)u=l.v;else if(u=e.apply(null,arguments),i++,n){const m=((f=s==null?void 0:s.deref)==null?void 0:f.call(s))??s;m!=null&&n(m,u)&&(u=m,i!==0&&i--),s=typeof u=="object"&&u!==null||typeof u=="function"?new y6(u):u}return d.s=wy,d.v=u,u}return o.clearCache=()=>{r=Sc(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function w6(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...s)=>{let i=0,o=0,l,c={},d=s.pop();typeof d=="object"&&(c=d,d=s.pop()),m6(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const u={...r,...c},{memoize:f,memoizeOptions:m=[],argsMemoize:h=iS,argsMemoizeOptions:g=[]}=u,x=by(m),v=by(g),y=g6(s),j=f(function(){return i++,d.apply(null,arguments)},...x),b=h(function(){o++;const k=x6(y,arguments);return l=j.apply(null,k),l},...v);return Object.assign(b,{resultFunc:d,memoizedResultFunc:j,dependencies:y,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var W=w6(iS),j6=Object.assign((e,t=W)=>{h6(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((o,l,c)=>(o[r[c]]=l,o),{}))},{withTypes:()=>j6}),oS={},lS={},cS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const r=(n,s,i)=>{if(n!==s){const o=t(n),l=t(s);if(o===l&&o===0){if(n<s)return i==="desc"?1:-1;if(n>s)return i==="desc"?-1:1}return i==="desc"?l-o:o-l}return 0};e.compareValues=r})(cS);var dS={},Cg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(Cg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Cg,r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function s(i,o){return Array.isArray(i)?!1:typeof i=="number"||typeof i=="boolean"||i==null||t.isSymbol(i)?!0:typeof i=="string"&&(n.test(i)||!r.test(i))||o!=null&&Object.hasOwn(o,i)}e.isKey=s})(dS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cS,r=dS,n=Gu;function s(i,o,l,c){if(i==null)return[];l=c?void 0:l,Array.isArray(i)||(i=Object.values(i)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(h=>String(h));const d=(h,g)=>{let x=h;for(let v=0;v<g.length&&x!=null;++v)x=x[g[v]];return x},u=(h,g)=>g==null||h==null?g:typeof h=="object"&&"key"in h?Object.hasOwn(g,h.key)?g[h.key]:d(g,h.path):typeof h=="function"?h(g):Array.isArray(h)?d(g,h):typeof g=="object"?g[h]:g,f=o.map(h=>(Array.isArray(h)&&h.length===1&&(h=h[0]),h==null||typeof h=="function"||Array.isArray(h)||r.isKey(h)?h:{key:h,path:n.toPath(h)}));return i.map(h=>({original:h,criteria:f.map(g=>u(g,h))})).slice().sort((h,g)=>{for(let x=0;x<f.length;x++){const v=t.compareValues(h.criteria[x],g.criteria[x],l[x]);if(v!==0)return v}return 0}).map(h=>h.original)}e.orderBy=s})(lS);var uS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n=1){const s=[],i=Math.floor(n),o=(l,c)=>{for(let d=0;d<l.length;d++){const u=l[d];Array.isArray(u)&&c<i?o(u,c+1):s.push(u)}};return o(r,0),s}e.flatten=t})(uS);var _g={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kg,r=Vu,n=yg,s=wg;function i(o,l,c){return n.isObject(c)&&(typeof l=="number"&&r.isArrayLike(c)&&t.isIndex(l)&&l<c.length||typeof l=="string"&&l in c)?s.isEqualsSameValueZero(c[l],o):!1}e.isIterateeCall=i})(_g);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lS,r=uS,n=_g;function s(i,...o){const l=o.length;return l>1&&n.isIterateeCall(i,o[0],o[1])?o=[]:l>2&&n.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(i,r.flatten(o),["asc"])}e.sortBy=s})(oS);var N6=oS.sortBy;const Qu=Na(N6);var fS=e=>e.legend.settings,k6=e=>e.legend.size,S6=e=>e.legend.payload;W([S6,fS],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?Qu(n,r):n});var Cc=1;function C6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=p.useState({height:0,left:0,top:0,width:0}),n=p.useCallback(s=>{if(s!=null){var i=s.getBoundingClientRect(),o={height:i.height,left:i.left,top:i.top,width:i.width};(Math.abs(o.height-t.height)>Cc||Math.abs(o.left-t.left)>Cc||Math.abs(o.top-t.top)>Cc||Math.abs(o.width-t.width)>Cc)&&r({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,n]}function Zt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var _6=typeof Symbol=="function"&&Symbol.observable||"@@observable",jy=_6,km=()=>Math.random().toString(36).substring(7).split("").join("."),O6={INIT:`@@redux/INIT${km()}`,REPLACE:`@@redux/REPLACE${km()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${km()}`},ld=O6;function Og(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function mS(e,t,r){if(typeof e!="function")throw new Error(Zt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Zt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Zt(1));return r(mS)(e,t)}let n=e,s=t,i=new Map,o=i,l=0,c=!1;function d(){o===i&&(o=new Map,i.forEach((v,y)=>{o.set(y,v)}))}function u(){if(c)throw new Error(Zt(3));return s}function f(v){if(typeof v!="function")throw new Error(Zt(4));if(c)throw new Error(Zt(5));let y=!0;d();const j=l++;return o.set(j,v),function(){if(y){if(c)throw new Error(Zt(6));y=!1,d(),o.delete(j),i=null}}}function m(v){if(!Og(v))throw new Error(Zt(7));if(typeof v.type>"u")throw new Error(Zt(8));if(typeof v.type!="string")throw new Error(Zt(17));if(c)throw new Error(Zt(9));try{c=!0,s=n(s,v)}finally{c=!1}return(i=o).forEach(j=>{j()}),v}function h(v){if(typeof v!="function")throw new Error(Zt(10));n=v,m({type:ld.REPLACE})}function g(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(Zt(11));function j(){const N=y;N.next&&N.next(u())}return j(),{unsubscribe:v(j)}},[jy](){return this}}}return m({type:ld.INIT}),{dispatch:m,subscribe:f,getState:u,replaceReducer:h,[jy]:g}}function P6(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:ld.INIT})>"u")throw new Error(Zt(12));if(typeof r(void 0,{type:ld.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Zt(13))})}function hS(e){const t=Object.keys(e),r={};for(let i=0;i<t.length;i++){const o=t[i];typeof e[o]=="function"&&(r[o]=e[o])}const n=Object.keys(r);let s;try{P6(r)}catch(i){s=i}return function(o={},l){if(s)throw s;let c=!1;const d={};for(let u=0;u<n.length;u++){const f=n[u],m=r[f],h=o[f],g=m(h,l);if(typeof g>"u")throw l&&l.type,new Error(Zt(14));d[f]=g,c=c||g!==h}return c=c||n.length!==Object.keys(o).length,c?d:o}}function cd(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function M6(...e){return t=>(r,n)=>{const s=t(r,n);let i=()=>{throw new Error(Zt(15))};const o={getState:s.getState,dispatch:(c,...d)=>i(c,...d)},l=e.map(c=>c(o));return i=cd(...l)(s.dispatch),{...s,dispatch:i}}}function pS(e){return Og(e)&&"type"in e&&typeof e.type=="string"}var gS=Symbol.for("immer-nothing"),Ny=Symbol.for("immer-draftable"),jr=Symbol.for("immer-state");function pn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Br=Object,Ai=Br.getPrototypeOf,dd="constructor",Zu="prototype",vh="configurable",ud="enumerable",Gc="writable",tl="value",ga=e=>!!e&&!!e[jr];function Nn(e){var t;return e?xS(e)||ef(e)||!!e[Ny]||!!((t=e[dd])!=null&&t[Ny])||tf(e)||rf(e):!1}var A6=Br[Zu][dd].toString(),ky=new WeakMap;function xS(e){if(!e||!Pg(e))return!1;const t=Ai(e);if(t===null||t===Br[Zu])return!0;const r=Br.hasOwnProperty.call(t,dd)&&t[dd];if(r===Object)return!0;if(!mi(r))return!1;let n=ky.get(r);return n===void 0&&(n=Function.toString.call(r),ky.set(r,n)),n===A6}function Ju(e,t,r=!0){Vl(e)===0?(r?Reflect.ownKeys(e):Br.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((n,s)=>t(s,n,e))}function Vl(e){const t=e[jr];return t?t.type_:ef(e)?1:tf(e)?2:rf(e)?3:0}var Sy=(e,t,r=Vl(e))=>r===2?e.has(t):Br[Zu].hasOwnProperty.call(e,t),yh=(e,t,r=Vl(e))=>r===2?e.get(t):e[t],fd=(e,t,r,n=Vl(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function E6(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ef=Array.isArray,tf=e=>e instanceof Map,rf=e=>e instanceof Set,Pg=e=>typeof e=="object",mi=e=>typeof e=="function",Sm=e=>typeof e=="boolean";function D6(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var aa=e=>e.copy_||e.base_,Mg=e=>e.modified_?e.copy_:e.base_;function bh(e,t){if(tf(e))return new Map(e);if(rf(e))return new Set(e);if(ef(e))return Array[Zu].slice.call(e);const r=xS(e);if(t===!0||t==="class_only"&&!r){const n=Br.getOwnPropertyDescriptors(e);delete n[jr];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){const o=s[i],l=n[o];l[Gc]===!1&&(l[Gc]=!0,l[vh]=!0),(l.get||l.set)&&(n[o]={[vh]:!0,[Gc]:!0,[ud]:l[ud],[tl]:e[o]})}return Br.create(Ai(e),n)}else{const n=Ai(e);if(n!==null&&r)return{...e};const s=Br.create(n);return Br.assign(s,e)}}function Ag(e,t=!1){return nf(e)||ga(e)||!Nn(e)||(Vl(e)>1&&Br.defineProperties(e,{set:_c,add:_c,clear:_c,delete:_c}),Br.freeze(e),t&&Ju(e,(r,n)=>{Ag(n,!0)},!1)),e}function T6(){pn(2)}var _c={[tl]:T6};function nf(e){return e===null||!Pg(e)?!0:Br.isFrozen(e)}var md="MapSet",wh="Patches",Cy="ArrayMethods",vS={};function Fs(e){const t=vS[e];return t||pn(0,e),t}var _y=e=>!!vS[e],rl,yS=()=>rl,I6=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:_y(md)?Fs(md):void 0,arrayMethodsPlugin_:_y(Cy)?Fs(Cy):void 0});function Oy(e,t){t&&(e.patchPlugin_=Fs(wh),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function jh(e){Nh(e),e.drafts_.forEach(R6),e.drafts_=null}function Nh(e){e===rl&&(rl=e.parent_)}var Py=e=>rl=I6(rl,e);function R6(e){const t=e[jr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function My(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[jr].modified_&&(jh(t),pn(4)),Nn(e)&&(e=Ay(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(r[jr].base_,e,t)}else e=Ay(t,r);return $6(t,e,!0),jh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gS?e:void 0}function Ay(e,t){if(nf(t))return t;const r=t[jr];if(!r)return hd(t,e.handledSet_,e);if(!af(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);jS(r,e)}return r.copy_}function $6(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ag(t,r)}function bS(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var af=(e,t)=>e.scope_===t,z6=[];function wS(e,t,r,n){const s=aa(e),i=e.type_;if(n!==void 0&&yh(s,n,i)===t){fd(s,n,r,i);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;Ju(s,(c,d)=>{if(ga(d)){const u=l.get(d)||[];u.push(c),l.set(d,u)}})}const o=e.draftLocations_.get(t)??z6;for(const l of o)fd(s,l,r,i)}function L6(e,t,r){e.callbacks_.push(function(s){var l;const i=t;if(!i||!af(i,s))return;(l=s.mapSetPlugin_)==null||l.fixSetContents(i);const o=Mg(i);wS(e,i.draft_??i,o,r),jS(i,s)})}function jS(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:s}=t;if(s){const i=s.getPath(e);i&&s.generatePatches_(e,i,t)}bS(e)}}function F6(e,t,r){const{scope_:n}=e;if(ga(r)){const s=r[jr];af(s,n)&&s.callbacks_.push(function(){Vc(e);const o=Mg(s);wS(e,r,o,t)})}else Nn(r)&&e.callbacks_.push(function(){const i=aa(e);e.type_===3?i.has(r)&&hd(r,n.handledSet_,n):yh(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&hd(yh(e.copy_,t,e.type_),n.handledSet_,n)})}function hd(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||ga(e)||t.has(e)||!Nn(e)||nf(e)||(t.add(e),Ju(e,(n,s)=>{if(ga(s)){const i=s[jr];if(af(i,r)){const o=Mg(i);fd(e,n,o,e.type_),bS(i)}}else Nn(s)&&hd(s,t,r)})),e}function B6(e,t){const r=ef(e),n={type_:r?1:0,scope_:t?t.scope_:yS(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=n,i=pd;r&&(s=[n],i=nl);const{revoke:o,proxy:l}=Proxy.revocable(s,i);return n.draft_=l,n.revoke_=o,[l,n]}var pd={get(e,t){if(t===jr)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const s=aa(e);if(!Sy(s,t,e.type_))return W6(e,s,t);const i=s[t];if(e.finalized_||!Nn(i)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&D6(t))return i;if(i===Cm(e.base_,t)){Vc(e);const o=e.type_===1?+t:t,l=Sh(e.scope_,i,e,o);return e.copy_[o]=l}return i},has(e,t){return t in aa(e)},ownKeys(e){return Reflect.ownKeys(aa(e))},set(e,t,r){const n=NS(aa(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const s=Cm(aa(e),t),i=s==null?void 0:s[jr];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(E6(r,s)&&(r!==void 0||Sy(e.base_,t,e.type_)))return!0;Vc(e),kh(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),F6(e,t,r)),!0},deleteProperty(e,t){return Vc(e),Cm(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),kh(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=aa(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Gc]:!0,[vh]:e.type_!==1||t!=="length",[ud]:n[ud],[tl]:r[t]}},defineProperty(){pn(11)},getPrototypeOf(e){return Ai(e.base_)},setPrototypeOf(){pn(12)}},nl={};for(let e in pd){let t=pd[e];nl[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}nl.deleteProperty=function(e,t){return nl.set.call(this,e,t,void 0)};nl.set=function(e,t,r){return pd.set.call(this,e[0],t,r,e[0])};function Cm(e,t){const r=e[jr];return(r?aa(r):e)[t]}function W6(e,t,r){var s;const n=NS(t,r);return n?tl in n?n[tl]:(s=n.get)==null?void 0:s.call(e.draft_):void 0}function NS(e,t){if(!(t in e))return;let r=Ai(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ai(r)}}function kh(e){e.modified_||(e.modified_=!0,e.parent_&&kh(e.parent_))}function Vc(e){e.copy_||(e.assigned_=new Map,e.copy_=bh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var U6=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,s)=>{if(mi(r)&&!mi(n)){const o=n;n=r;const l=this;return function(d=o,...u){return l.produce(d,f=>n.call(this,f,...u))}}mi(n)||pn(6),s!==void 0&&!mi(s)&&pn(7);let i;if(Nn(r)){const o=Py(this),l=Sh(o,r,void 0);let c=!0;try{i=n(l),c=!1}finally{c?jh(o):Nh(o)}return Oy(o,s),My(i,o)}else if(!r||!Pg(r)){if(i=n(r),i===void 0&&(i=r),i===gS&&(i=void 0),this.autoFreeze_&&Ag(i,!0),s){const o=[],l=[];Fs(wh).generateReplacementPatches_(r,i,{patches_:o,inversePatches_:l}),s(o,l)}return i}else pn(1,r)},this.produceWithPatches=(r,n)=>{if(mi(r))return(l,...c)=>this.produceWithPatches(l,d=>r(d,...c));let s,i;return[this.produce(r,n,(l,c)=>{s=l,i=c}),s,i]},Sm(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Sm(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Sm(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Nn(t)||pn(8),ga(t)&&(t=bn(t));const r=Py(this),n=Sh(r,t,void 0);return n[jr].isManual_=!0,Nh(r),n}finishDraft(t,r){const n=t&&t[jr];(!n||!n.isManual_)&&pn(9);const{scope_:s}=n;return Oy(s,r),My(void 0,s)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const i=r[n];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}n>-1&&(r=r.slice(n+1));const s=Fs(wh).applyPatches_;return ga(t)?s(t,r):this.produce(t,i=>s(i,r))}};function Sh(e,t,r,n){const[s,i]=tf(t)?Fs(md).proxyMap_(t,r):rf(t)?Fs(md).proxySet_(t,r):B6(t,r);return((r==null?void 0:r.scope_)??yS()).drafts_.push(s),i.callbacks_=(r==null?void 0:r.callbacks_)??[],i.key_=n,r&&n!==void 0?L6(r,i,n):i.callbacks_.push(function(c){var u;(u=c.mapSetPlugin_)==null||u.fixSetContents(i);const{patchPlugin_:d}=c;i.modified_&&d&&d.generatePatches_(i,[],c)}),s}function bn(e){return ga(e)||pn(10,e),kS(e)}function kS(e){if(!Nn(e)||nf(e))return e;const t=e[jr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=bh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=bh(e,!0);return Ju(r,(s,i)=>{fd(r,s,kS(i))},n),t&&(t.finalized_=!1),r}var q6=new U6,SS=q6.produce;function CS(e){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,e):s(i)}var H6=CS(),K6=CS,Y6=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?cd:cd.apply(null,arguments)};function sn(e,t){function r(...n){if(t){let s=t(...n);if(!s)throw new Error(Wr(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>pS(n)&&n.type===e,r}var _S=class Fo extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Fo.prototype)}static get[Symbol.species](){return Fo}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Fo(...t[0].concat(this)):new Fo(...t.concat(this))}};function Ey(e){return Nn(e)?SS(e,()=>{}):e}function Oc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function G6(e){return typeof e=="boolean"}var V6=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{};let o=new _S;return r&&(G6(r)?o.push(H6):o.push(K6(r.extraArgument))),o},OS="RTK_autoBatch",lt=()=>e=>({payload:e,meta:{[OS]:!0}}),Dy=e=>t=>{setTimeout(t,e)},PS=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let s=!0,i=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Dy(10):e.type==="callback"?e.queueNotification:Dy(e.timeout),d=()=>{o=!1,i&&(i=!1,l.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){const f=()=>s&&u(),m=n.subscribe(f);return l.add(u),()=>{m(),l.delete(u)}},dispatch(u){var f;try{return s=!((f=u==null?void 0:u.meta)!=null&&f[OS]),i=!s,i&&(o||(o=!0,c(d))),n.dispatch(u)}finally{s=!0}}})},X6=e=>function(r){const{autoBatch:n=!0}=r??{};let s=new _S(e);return n&&s.push(PS(typeof n=="object"?n:void 0)),s};function Q6(e){const t=V6(),{reducer:r=void 0,middleware:n,devTools:s=!0,preloadedState:i=void 0,enhancers:o=void 0}=e||{};let l;if(typeof r=="function")l=r;else if(Og(r))l=hS(r);else throw new Error(Wr(1));let c;typeof n=="function"?c=n(t):c=t();let d=cd;s&&(d=Y6({trace:!1,...typeof s=="object"&&s}));const u=M6(...c),f=X6(u);let m=typeof o=="function"?o(f):f();const h=d(...m);return mS(l,i,h)}function MS(e){const t={},r=[];let n;const s={addCase(i,o){const l=typeof i=="string"?i:i.type;if(!l)throw new Error(Wr(28));if(l in t)throw new Error(Wr(29));return t[l]=o,s},addAsyncThunk(i,o){return o.pending&&(t[i.pending.type]=o.pending),o.rejected&&(t[i.rejected.type]=o.rejected),o.fulfilled&&(t[i.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:i.settled,reducer:o.settled}),s},addMatcher(i,o){return r.push({matcher:i,reducer:o}),s},addDefaultCase(i){return n=i,s}};return e(s),[t,r,n]}function Z6(e){return typeof e=="function"}function J6(e,t){let[r,n,s]=MS(t),i;if(Z6(e))i=()=>Ey(e());else{const l=Ey(e);i=()=>l}function o(l=i(),c){let d=[r[c.type],...n.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return d.filter(u=>!!u).length===0&&(d=[s]),d.reduce((u,f)=>{if(f)if(ga(u)){const h=f(u,c);return h===void 0?u:h}else{if(Nn(u))return SS(u,m=>f(m,c));{const m=f(u,c);if(m===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}}return u},l)}return o.getInitialState=i,o}var eL="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",tL=(e=21)=>{let t="",r=e;for(;r--;)t+=eL[Math.random()*64|0];return t},rL=Symbol.for("rtk-slice-createasyncthunk");function nL(e,t){return`${e}/${t}`}function aL({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[rL];return function(s){const{name:i,reducerPath:o=i}=s;if(!i)throw new Error(Wr(11));const l=(typeof s.reducers=="function"?s.reducers(iL()):s.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(N,k){const w=typeof N=="string"?N:N.type;if(!w)throw new Error(Wr(12));if(w in d.sliceCaseReducersByType)throw new Error(Wr(13));return d.sliceCaseReducersByType[w]=k,u},addMatcher(N,k){return d.sliceMatchers.push({matcher:N,reducer:k}),u},exposeAction(N,k){return d.actionCreators[N]=k,u},exposeCaseReducer(N,k){return d.sliceCaseReducersByName[N]=k,u}};c.forEach(N=>{const k=l[N],w={reducerName:N,type:nL(i,N),createNotation:typeof s.reducers=="function"};lL(k)?dL(w,k,u,t):oL(w,k,u)});function f(){const[N={},k=[],w=void 0]=typeof s.extraReducers=="function"?MS(s.extraReducers):[s.extraReducers],S={...N,...d.sliceCaseReducersByType};return J6(s.initialState,C=>{for(let P in S)C.addCase(P,S[P]);for(let P of d.sliceMatchers)C.addMatcher(P.matcher,P.reducer);for(let P of k)C.addMatcher(P.matcher,P.reducer);w&&C.addDefaultCase(w)})}const m=N=>N,h=new Map,g=new WeakMap;let x;function v(N,k){return x||(x=f()),x(N,k)}function y(){return x||(x=f()),x.getInitialState()}function j(N,k=!1){function w(C){let P=C[N];return typeof P>"u"&&k&&(P=Oc(g,w,y)),P}function S(C=m){const P=Oc(h,k,()=>new WeakMap);return Oc(P,C,()=>{const M={};for(const[A,_]of Object.entries(s.selectors??{}))M[A]=sL(_,C,()=>Oc(g,C,y),k);return M})}return{reducerPath:N,getSelectors:S,get selectors(){return S(w)},selectSlice:w}}const b={name:i,reducer:v,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:y,...j(o),injectInto(N,{reducerPath:k,...w}={}){const S=k??o;return N.inject({reducerPath:S,reducer:v},w),{...b,...j(S,!0)}}};return b}}function sL(e,t,r,n){function s(i,...o){let l=t(i);return typeof l>"u"&&n&&(l=r()),e(l,...o)}return s.unwrapped=e,s}var Tr=aL();function iL(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function oL({type:e,reducerName:t,createNotation:r},n,s){let i,o;if("reducer"in n){if(r&&!cL(n))throw new Error(Wr(17));i=n.reducer,o=n.prepare}else i=n;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,o?sn(e,o):sn(e))}function lL(e){return e._reducerDefinitionType==="asyncThunk"}function cL(e){return e._reducerDefinitionType==="reducerWithPrepare"}function dL({type:e,reducerName:t},r,n,s){if(!s)throw new Error(Wr(18));const{payloadCreator:i,fulfilled:o,pending:l,rejected:c,settled:d,options:u}=r,f=s(e,i,u);n.exposeAction(t,f),o&&n.addCase(f.fulfilled,o),l&&n.addCase(f.pending,l),c&&n.addCase(f.rejected,c),d&&n.addMatcher(f.settled,d),n.exposeCaseReducer(t,{fulfilled:o||Pc,pending:l||Pc,rejected:c||Pc,settled:d||Pc})}function Pc(){}var uL="task",AS="listener",ES="completed",Eg="cancelled",fL=`task-${Eg}`,mL=`task-${ES}`,Ch=`${AS}-${Eg}`,hL=`${AS}-${ES}`,sf=class{constructor(e){Yf(this,"name","TaskAbortError");Yf(this,"message");this.code=e,this.message=`${uL} ${Eg} (reason: ${e})`}},Dg=(e,t)=>{if(typeof e!="function")throw new TypeError(Wr(32))},gd=()=>{},DS=(e,t=gd)=>(e.catch(t),e),TS=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ms=e=>{if(e.aborted)throw new sf(e.reason)};function IS(e,t){let r=gd;return new Promise((n,s)=>{const i=()=>s(new sf(e.reason));if(e.aborted){i();return}r=TS(e,i),t.finally(()=>r()).then(n,s)}).finally(()=>{r=gd})}var pL=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof sf?"cancelled":"rejected",error:r}}finally{t==null||t()}},xd=e=>t=>DS(IS(e,t).then(r=>(Ms(e),r))),RS=e=>{const t=xd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:wi}=Object,Ty={},of="listenerMiddleware",gL=(e,t)=>{const r=n=>TS(e,()=>n.abort(e.reason));return(n,s)=>{Dg(n);const i=new AbortController;r(i);const o=pL(async()=>{Ms(e),Ms(i.signal);const l=await n({pause:xd(i.signal),delay:RS(i.signal),signal:i.signal});return Ms(i.signal),l},()=>i.abort(mL));return s!=null&&s.autoJoin&&t.push(o.catch(gd)),{result:xd(e)(o),cancel(){i.abort(fL)}}}},xL=(e,t)=>{const r=async(n,s)=>{Ms(t);let i=()=>{};const l=[new Promise((c,d)=>{let u=e({predicate:n,effect:(f,m)=>{m.unsubscribe(),c([f,m.getState(),m.getOriginalState()])}});i=()=>{u(),d()}})];s!=null&&l.push(new Promise(c=>setTimeout(c,s,null)));try{const c=await IS(t,Promise.race(l));return Ms(t),c}finally{i()}};return(n,s)=>DS(r(n,s))},$S=e=>{let{type:t,actionCreator:r,matcher:n,predicate:s,effect:i}=e;if(t)s=sn(t).match;else if(r)t=r.type,s=r.match;else if(n)s=n;else if(!s)throw new Error(Wr(21));return Dg(i),{predicate:s,type:t,effect:i}},zS=wi(e=>{const{type:t,predicate:r,effect:n}=$S(e);return{id:tL(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Wr(22))}}},{withTypes:()=>zS}),Iy=(e,t)=>{const{type:r,effect:n,predicate:s}=$S(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===s)&&i.effect===n)},_h=e=>{e.pending.forEach(t=>{t.abort(Ch)})},vL=(e,t)=>()=>{for(const r of t.keys())_h(r);e.clear()},Ry=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},LS=wi(sn(`${of}/add`),{withTypes:()=>LS}),yL=sn(`${of}/removeAll`),FS=wi(sn(`${of}/remove`),{withTypes:()=>FS}),bL=(...e)=>{console.error(`${of}/error`,...e)},Xl=(e={})=>{const t=new Map,r=new Map,n=h=>{const g=r.get(h)??0;r.set(h,g+1)},s=h=>{const g=r.get(h)??1;g===1?r.delete(h):r.set(h,g-1)},{extra:i,onError:o=bL}=e;Dg(o);const l=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),g=>{h.unsubscribe(),g!=null&&g.cancelActive&&_h(h)}),c=h=>{const g=Iy(t,h)??zS(h);return l(g)};wi(c,{withTypes:()=>c});const d=h=>{const g=Iy(t,h);return g&&(g.unsubscribe(),h.cancelActive&&_h(g)),!!g};wi(d,{withTypes:()=>d});const u=async(h,g,x,v)=>{const y=new AbortController,j=xL(c,y.signal),b=[];try{h.pending.add(y),n(h),await Promise.resolve(h.effect(g,wi({},x,{getOriginalState:v,condition:(N,k)=>j(N,k).then(Boolean),take:j,delay:RS(y.signal),pause:xd(y.signal),extra:i,signal:y.signal,fork:gL(y.signal,b),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((N,k,w)=>{N!==y&&(N.abort(Ch),w.delete(N))})},cancel:()=>{y.abort(Ch),h.pending.delete(y)},throwIfCancelled:()=>{Ms(y.signal)}})))}catch(N){N instanceof sf||Ry(o,N,{raisedBy:"effect"})}finally{await Promise.all(b),y.abort(hL),s(h),h.pending.delete(y)}},f=vL(t,r);return{middleware:h=>g=>x=>{if(!pS(x))return g(x);if(LS.match(x))return c(x.payload);if(yL.match(x)){f();return}if(FS.match(x))return d(x.payload);let v=h.getState();const y=()=>{if(v===Ty)throw new Error(Wr(23));return v};let j;try{if(j=g(x),t.size>0){const b=h.getState(),N=Array.from(t.values());for(const k of N){let w=!1;try{w=k.predicate(x,b,v)}catch(S){w=!1,Ry(o,S,{raisedBy:"predicate"})}w&&u(k,x,h,y)}}}finally{v=Ty}return j},startListening:c,stopListening:d,clearListeners:f}};function Wr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var wL={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},BS=Tr({name:"chartLayout",initialState:wL,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,s,i;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(s=t.payload.bottom)!==null&&s!==void 0?s:0,e.margin.left=(i=t.payload.left)!==null&&i!==void 0?i:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:jL,setLayout:NL,setChartSize:kL,setScale:SL}=BS.actions,CL=BS.reducer;function WS(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function Be(e){return Number.isFinite(e)}function qn(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function $y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$y(Object(r),!0).forEach(function(n){_L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$y(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _L(e,t,r){return(t=OL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OL(e){var t=PL(e,"string");return typeof t=="symbol"?t:t+""}function PL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rr(e,t,r){return Ut(e)||Ut(t)?r:Un(t)?Mi(e,t,r):typeof t=="function"?t(e):r}var ML=(e,t,r)=>{if(t&&r){var{width:n,height:s}=r,{align:i,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&i!=="center"&&xe(e[i]))return pi(pi({},e),{},{[i]:e[i]+(n||0)});if((l==="horizontal"||l==="vertical"&&i==="center")&&o!=="middle"&&xe(e[o]))return pi(pi({},e),{},{[o]:e[o]+(s||0)})}return e},ss=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",US=(e,t,r,n)=>{if(n)return e.map(l=>l.coordinate);var s,i,o=e.map(l=>(l.coordinate===t&&(s=!0),l.coordinate===r&&(i=!0),l.coordinate));return s||o.push(t),i||o.push(r),o},qS=(e,t,r)=>{if(!e)return null;var{duplicateDomain:n,type:s,range:i,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:d,tickCount:u,ticks:f,niceTicks:m,axisType:h}=e;if(!o)return null;var g=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,x=s==="category"&&o.bandwidth?o.bandwidth()/g:0;if(x=h==="angleAxis"&&i&&i.length>=2?Or(i[0]-i[1])*2*x:x,f||m){var v=(f||m||[]).map((y,j)=>{var b=n?n.indexOf(y):y,N=o.map(b);return Be(N)?{coordinate:N+x,value:y,offset:x,index:j}:null}).filter(Pr);return v}return c&&d?d.map((y,j)=>{var b=o.map(y);return Be(b)?{coordinate:b+x,value:y,index:j,offset:x}:null}).filter(Pr):o.ticks&&u!=null?o.ticks(u).map((y,j)=>{var b=o.map(y);return Be(b)?{coordinate:b+x,value:y,index:j,offset:x}:null}).filter(Pr):o.domain().map((y,j)=>{var b=o.map(y);return Be(b)?{coordinate:b+x,value:n?n[y]:y,index:j,offset:x}:null}).filter(Pr)},AL=(e,t)=>{if(!t||t.length!==2||!xe(t[0])||!xe(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),s=[e[0],e[1]];return(!xe(e[0])||e[0]<r)&&(s[0]=r),(!xe(e[1])||e[1]>n)&&(s[1]=n),s[0]>n&&(s[0]=n),s[1]<r&&(s[1]=r),s},EL=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var s=0;s<n;++s)for(var i=0,o=0,l=0;l<r;++l){var c=e[l],d=c==null?void 0:c[s];if(d!=null){var u=d[1],f=d[0],m=Wn(u)?f:u;m>=0?(d[0]=i,i+=m,d[1]=i):(d[0]=o,o+=m,d[1]=o)}}}},DL=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var s=0;s<n;++s)for(var i=0,o=0;o<r;++o){var l=e[o],c=l==null?void 0:l[s];if(c!=null){var d=Wn(c[1])?c[0]:c[1];d>=0?(c[0]=i,i+=d,c[1]=i):(c[0]=0,c[1]=0)}}}},TL={sign:EL,expand:Lz,none:zs,silhouette:Fz,wiggle:Bz,positive:DL},IL=(e,t,r)=>{var n,s=(n=TL[r])!==null&&n!==void 0?n:zs,i=zz().keys(t).value((l,c)=>Number(rr(l,c,0))).order(gh).offset(s),o=i(e);return o.forEach((l,c)=>{l.forEach((d,u)=>{var f=rr(e[u],t[c],0);Array.isArray(f)&&f.length===2&&xe(f[0])&&xe(f[1])&&(d[0]=f[0],d[1]=f[1])})}),o};function RL(e){return e==null?void 0:String(e)}var zy=e=>{var{axis:t,ticks:r,offset:n,bandSize:s,entry:i,index:o}=e;if(t.type==="category")return r[o]?r[o].coordinate+n:null;var l=rr(i,t.dataKey,t.scale.domain()[o]);if(Ut(l))return null;var c=t.scale.map(l);return xe(c)?c-s/2+n:null},$L=e=>{var{numericAxis:t}=e,r=t.scale.domain();if(t.type==="number"){var n=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return n<=0&&s>=0?0:s<0?s:n}return r[0]},zL=e=>{var t=e.flat(2).filter(xe);return[Math.min(...t),Math.max(...t)]},LL=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],FL=(e,t,r)=>{if(e!=null)return LL(Object.keys(e).reduce((n,s)=>{var i=e[s];if(!i)return n;var{stackedData:o}=i,l=o.reduce((c,d)=>{var u=WS(d,t,r),f=zL(u);return!Be(f[0])||!Be(f[1])?c:[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],n[0]),Math.max(l[1],n[1])]},[1/0,-1/0]))},Ly=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Fy=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vd=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var s=Qu(t,u=>u.coordinate),i=1/0,o=1,l=s.length;o<l;o++){var c=s[o],d=s[o-1];i=Math.min(((c==null?void 0:c.coordinate)||0)-((d==null?void 0:d.coordinate)||0),i)}return i===1/0?0:i}return r?void 0:0};function By(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:s,name:i}=e;return pi(pi({},t),{},{dataKey:r,payload:n,value:s,name:i})}function HS(e,t){if(e)return String(e);if(typeof t=="string")return t}var BL=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},WL=(e,t)=>t==="centric"?e.angle:e.radius,_a=e=>e.layout.width,Oa=e=>e.layout.height,UL=e=>e.layout.scale,KS=e=>e.layout.margin,lf=W(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),cf=W(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),qL="data-recharts-item-index",HL="data-recharts-item-id",Ql=60;function Wy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Mc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wy(Object(r),!0).forEach(function(n){KL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KL(e,t,r){return(t=YL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YL(e){var t=GL(e,"string");return typeof t=="symbol"?t:t+""}function GL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var VL=e=>e.brush.height;function XL(e){var t=cf(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var s=typeof n.width=="number"?n.width:Ql;return r+s}return r},0)}function QL(e){var t=cf(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var s=typeof n.width=="number"?n.width:Ql;return r+s}return r},0)}function ZL(e){var t=lf(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function JL(e){var t=lf(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Ht=W([_a,Oa,KS,VL,XL,QL,ZL,JL,fS,k6],(e,t,r,n,s,i,o,l,c,d)=>{var u={left:(r.left||0)+s,right:(r.right||0)+i},f={top:(r.top||0)+o,bottom:(r.bottom||0)+l},m=Mc(Mc({},f),u),h=m.bottom;m.bottom+=n,m=ML(m,c,d);var g=e-m.left-m.right,x=t-m.top-m.bottom;return Mc(Mc({brushBottom:h},m),{},{width:Math.max(g,0),height:Math.max(x,0)})}),eF=W(Ht,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Tg=W(_a,Oa,(e,t)=>({x:0,y:0,width:e,height:t})),tF=p.createContext(null),Ir=()=>p.useContext(tF)!=null,df=e=>e.brush,uf=W([df,Ht,KS],(e,t,r)=>({height:e.height,x:xe(e.x)?e.x:t.left,y:xe(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:xe(e.width)?e.width:t.width})),YS={},GS={},VS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n,{signal:s,edges:i}={}){let o,l=null;const c=i!=null&&i.includes("leading"),d=i==null||i.includes("trailing"),u=()=>{l!==null&&(r.apply(o,l),o=void 0,l=null)},f=()=>{d&&u(),x()};let m=null;const h=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,f()},n)},g=()=>{m!==null&&(clearTimeout(m),m=null)},x=()=>{g(),o=void 0,l=null},v=()=>{u()},y=function(...j){if(s!=null&&s.aborted)return;o=this,l=j;const b=m==null;h(),c&&b&&u()};return y.schedule=h,y.cancel=x,y.flush=v,s==null||s.addEventListener("abort",x,{once:!0}),y}e.debounce=t})(VS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VS;function r(n,s=0,i={}){typeof i!="object"&&(i={});const{leading:o=!1,trailing:l=!0,maxWait:c}=i,d=Array(2);o&&(d[0]="leading"),l&&(d[1]="trailing");let u,f=null;const m=t.debounce(function(...x){u=n.apply(this,x),f=null},s,{edges:d}),h=function(...x){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(u=n.apply(this,x),f=Date.now(),m.cancel(),m.schedule(),u):(m.apply(this,x),u)},g=()=>(m.flush(),u);return h.cancel=m.cancel,h.flush=g,h}e.debounce=r})(GS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=GS;function r(n,s=0,i={}){const{leading:o=!0,trailing:l=!0}=i;return t.debounce(n,s,{leading:o,maxWait:s,trailing:l})}e.throttle=r})(YS);var rF=YS.throttle;const nF=Na(rF);var yd=function(t,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(r.replace(/%s/g,()=>s[o++]))}},zn={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},XS=(e,t,r)=>{var{width:n=zn.width,height:s=zn.height,aspect:i,maxHeight:o}=r,l=Ls(n)?e:Number(n),c=Ls(s)?t:Number(s);return i&&i>0&&(l?c=l/i:c&&(l=c*i),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},aF={width:0,height:0,overflow:"visible"},sF={width:0,overflowX:"visible"},iF={height:0,overflowY:"visible"},oF={},lF=e=>{var{width:t,height:r}=e,n=Ls(t),s=Ls(r);return n&&s?aF:n?sF:s?iF:oF};function cF(e){var{width:t,height:r,aspect:n}=e,s=t,i=r;return s===void 0&&i===void 0?(s=zn.width,i=zn.height):s===void 0?s=n&&n>0?void 0:zn.width:i===void 0&&(i=n&&n>0?void 0:zn.height),{width:s,height:i}}function Oh(){return Oh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Oh.apply(null,arguments)}function Uy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Uy(Object(r),!0).forEach(function(n){dF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dF(e,t,r){return(t=uF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uF(e){var t=fF(e,"string");return typeof t=="symbol"?t:t+""}function fF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QS=p.createContext(zn.initialDimension);function mF(e){return qn(e.width)&&qn(e.height)}function ZS(e){var{children:t,width:r,height:n}=e,s=p.useMemo(()=>({width:r,height:n}),[r,n]);return mF(s)?p.createElement(QS.Provider,{value:s},t):null}var Ig=()=>p.useContext(QS),hF=p.forwardRef((e,t)=>{var{aspect:r,initialDimension:n=zn.initialDimension,width:s,height:i,minWidth:o=zn.minWidth,minHeight:l,maxHeight:c,children:d,debounce:u=zn.debounce,id:f,className:m,onResize:h,style:g={}}=e,x=p.useRef(null),v=p.useRef();v.current=h,p.useImperativeHandle(t,()=>x.current);var[y,j]=p.useState({containerWidth:n.width,containerHeight:n.height}),b=p.useCallback((C,P)=>{j(M=>{var A=Math.round(C),_=Math.round(P);return M.containerWidth===A&&M.containerHeight===_?M:{containerWidth:A,containerHeight:_}})},[]);p.useEffect(()=>{if(x.current==null||typeof ResizeObserver>"u")return ro;var C=_=>{var D,O=_[0];if(O!=null){var{width:R,height:F}=O.contentRect;b(R,F),(D=v.current)===null||D===void 0||D.call(v,R,F)}};u>0&&(C=nF(C,u,{trailing:!0,leading:!1}));var P=new ResizeObserver(C),{width:M,height:A}=x.current.getBoundingClientRect();return b(M,A),P.observe(x.current),()=>{P.disconnect()}},[b,u]);var{containerWidth:N,containerHeight:k}=y;yd(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:w,calculatedHeight:S}=XS(N,k,{width:s,height:i,aspect:r,maxHeight:c});return yd(w!=null&&w>0||S!=null&&S>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
543
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
544
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
545
|
-
height and width.`,w,S,s,i,o,l,r),p.createElement("div",{id:f?"".concat(f):void 0,className:Je("recharts-responsive-container",m),style:qy(qy({},g),{},{width:s,height:i,minWidth:o,minHeight:l,maxHeight:c}),ref:x},p.createElement("div",{style:lF({width:s,height:i})},p.createElement(ZS,{width:w,height:S},d)))}),bd=p.forwardRef((e,t)=>{var r=Ig();if(qn(r.width)&&qn(r.height))return e.children;var{width:n,height:s}=cF({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:o}=XS(void 0,void 0,{width:n,height:s,aspect:e.aspect,maxHeight:e.maxHeight});return xe(i)&&xe(o)?p.createElement(ZS,{width:i,height:o},e.children):p.createElement(hF,Oh({},e,{width:n,height:s,ref:t}))});function Rg(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var ff=()=>{var e,t=Ir(),r=_e(eF),n=_e(uf),s=(e=_e(df))===null||e===void 0?void 0:e.padding;return!t||!n||!s?r:{width:n.width-s.left-s.right,height:n.height-s.top-s.bottom,x:s.left,y:s.top}},pF={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},JS=()=>{var e;return(e=_e(Ht))!==null&&e!==void 0?e:pF},e2=()=>_e(_a),t2=()=>_e(Oa),et=e=>e.layout.layoutType,no=()=>_e(et),r2=()=>{var e=no();if(e==="horizontal"||e==="vertical")return e},n2=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},gF=()=>{var e=no();return e!==void 0},Zl=e=>{var t=St(),r=Ir(),{width:n,height:s}=e,i=Ig(),o=n,l=s;return i&&(o=i.width>0?i.width:n,l=i.height>0?i.height:s),p.useEffect(()=>{!r&&qn(o)&&qn(l)&&t(kL({width:o,height:l}))},[t,r,o,l]),null},a2=Symbol.for("immer-nothing"),Hy=Symbol.for("immer-draftable"),qr=Symbol.for("immer-state");function gn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var al=Object.getPrototypeOf;function Ei(e){return!!e&&!!e[qr]}function Bs(e){var t;return e?s2(e)||Array.isArray(e)||!!e[Hy]||!!((t=e.constructor)!=null&&t[Hy])||Jl(e)||hf(e):!1}var xF=Object.prototype.constructor.toString(),Ky=new WeakMap;function s2(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Ky.get(r);return n===void 0&&(n=Function.toString.call(r),Ky.set(r,n)),n===xF}function wd(e,t,r=!0){mf(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((n,s)=>t(s,n,e))}function mf(e){const t=e[qr];return t?t.type_:Array.isArray(e)?1:Jl(e)?2:hf(e)?3:0}function Ph(e,t){return mf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function i2(e,t,r){const n=mf(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function vF(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Jl(e){return e instanceof Map}function hf(e){return e instanceof Set}function ps(e){return e.copy_||e.base_}function Mh(e,t){if(Jl(e))return new Map(e);if(hf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=s2(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[qr];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){const o=s[i],l=n[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(n[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(al(e),n)}else{const n=al(e);if(n!==null&&r)return{...e};const s=Object.create(n);return Object.assign(s,e)}}function $g(e,t=!1){return pf(e)||Ei(e)||!Bs(e)||(mf(e)>1&&Object.defineProperties(e,{set:Ac,add:Ac,clear:Ac,delete:Ac}),Object.freeze(e),t&&Object.values(e).forEach(r=>$g(r,!0))),e}function yF(){gn(2)}var Ac={value:yF};function pf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var bF={};function Ws(e){const t=bF[e];return t||gn(0,e),t}var sl;function o2(){return sl}function wF(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Yy(e,t){t&&(Ws("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ah(e){Eh(e),e.drafts_.forEach(jF),e.drafts_=null}function Eh(e){e===sl&&(sl=e.parent_)}function Gy(e){return sl=wF(sl,e)}function jF(e){const t=e[qr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Vy(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[qr].modified_&&(Ah(t),gn(4)),Bs(e)&&(e=jd(t,e),t.parent_||Nd(t,e)),t.patches_&&Ws("Patches").generateReplacementPatches_(r[qr].base_,e,t.patches_,t.inversePatches_)):e=jd(t,r,[]),Ah(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==a2?e:void 0}function jd(e,t,r){if(pf(t))return t;const n=e.immer_.shouldUseStrictIteration(),s=t[qr];if(!s)return wd(t,(i,o)=>Xy(e,s,t,i,o,r),n),t;if(s.scope_!==e)return t;if(!s.modified_)return Nd(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const i=s.copy_;let o=i,l=!1;s.type_===3&&(o=new Set(i),i.clear(),l=!0),wd(o,(c,d)=>Xy(e,s,i,c,d,r,l),n),Nd(e,i,!1),r&&e.patches_&&Ws("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function Xy(e,t,r,n,s,i,o){if(s==null||typeof s!="object"&&!o)return;const l=pf(s);if(!(l&&!o)){if(Ei(s)){const c=i&&t&&t.type_!==3&&!Ph(t.assigned_,n)?i.concat(n):void 0,d=jd(e,s,c);if(i2(r,n,d),Ei(d))e.canAutoFreeze_=!1;else return}else o&&r.add(s);if(Bs(s)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===s&&l)return;jd(e,s),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Jl(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Nd(e,s)}}}function Nd(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&$g(t,r)}function NF(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:o2(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=n,i=zg;r&&(s=[n],i=il);const{revoke:o,proxy:l}=Proxy.revocable(s,i);return n.draft_=l,n.revoke_=o,l}var zg={get(e,t){if(t===qr)return e;const r=ps(e);if(!Ph(r,t))return kF(e,r,t);const n=r[t];return e.finalized_||!Bs(n)?n:n===_m(e.base_,t)?(Om(e),e.copy_[t]=Th(n,e)):n},has(e,t){return t in ps(e)},ownKeys(e){return Reflect.ownKeys(ps(e))},set(e,t,r){const n=l2(ps(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const s=_m(ps(e),t),i=s==null?void 0:s[qr];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(vF(r,s)&&(r!==void 0||Ph(e.base_,t)))return!0;Om(e),Dh(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return _m(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Om(e),Dh(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ps(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){gn(11)},getPrototypeOf(e){return al(e.base_)},setPrototypeOf(){gn(12)}},il={};wd(zg,(e,t)=>{il[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});il.deleteProperty=function(e,t){return il.set.call(this,e,t,void 0)};il.set=function(e,t,r){return zg.set.call(this,e[0],t,r,e[0])};function _m(e,t){const r=e[qr];return(r?ps(r):e)[t]}function kF(e,t,r){var s;const n=l2(t,r);return n?"value"in n?n.value:(s=n.get)==null?void 0:s.call(e.draft_):void 0}function l2(e,t){if(!(t in e))return;let r=al(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=al(r)}}function Dh(e){e.modified_||(e.modified_=!0,e.parent_&&Dh(e.parent_))}function Om(e){e.copy_||(e.copy_=Mh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var SF=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const i=r;r=t;const o=this;return function(c=i,...d){return o.produce(c,u=>r.call(this,u,...d))}}typeof r!="function"&&gn(6),n!==void 0&&typeof n!="function"&&gn(7);let s;if(Bs(t)){const i=Gy(this),o=Th(t,void 0);let l=!0;try{s=r(o),l=!1}finally{l?Ah(i):Eh(i)}return Yy(i,n),Vy(s,i)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===a2&&(s=void 0),this.autoFreeze_&&$g(s,!0),n){const i=[],o=[];Ws("Patches").generateReplacementPatches_(t,s,i,o),n(i,o)}return s}else gn(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...l));let n,s;return[this.produce(t,r,(o,l)=>{n=o,s=l}),n,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Bs(e)||gn(8),Ei(e)&&(e=CF(e));const t=Gy(this),r=Th(e,void 0);return r[qr].isManual_=!0,Eh(t),r}finishDraft(e,t){const r=e&&e[qr];(!r||!r.isManual_)&&gn(9);const{scope_:n}=r;return Yy(n,t),Vy(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));const n=Ws("Patches").applyPatches_;return Ei(e)?n(e,t):this.produce(e,s=>n(s,t))}};function Th(e,t){const r=Jl(e)?Ws("MapSet").proxyMap_(e,t):hf(e)?Ws("MapSet").proxySet_(e,t):NF(e,t);return(t?t.scope_:o2()).drafts_.push(r),r}function CF(e){return Ei(e)||gn(10,e),c2(e)}function c2(e){if(!Bs(e)||pf(e))return e;const t=e[qr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Mh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Mh(e,!0);return wd(r,(s,i)=>{i2(r,s,c2(i))},n),t&&(t.finalized_=!1),r}var _F=new SF;_F.produce;var OF={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},d2=Tr({name:"legend",initialState:OF,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:lt()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,s=bn(e).payload.indexOf(r);s>-1&&(e.payload[s]=n)},prepare:lt()},removeLegendPayload:{reducer(e,t){var r=bn(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:lt()}}}),{setLegendSize:LJ,setLegendSettings:FJ,addLegendPayload:PF,replaceLegendPayload:MF,removeLegendPayload:AF}=d2.actions,EF=d2.reducer;function Ih(){return Ih=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ih.apply(null,arguments)}function Qy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Po(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qy(Object(r),!0).forEach(function(n){DF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DF(e,t,r){return(t=TF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TF(e){var t=IF(e,"string");return typeof t=="symbol"?t:t+""}function IF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RF(e){return Array.isArray(e)&&Un(e[0])&&Un(e[1])?e.join(" ~ "):e}var oi={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1},$F=e=>{var{separator:t=oi.separator,contentStyle:r,itemStyle:n,labelStyle:s=oi.labelStyle,payload:i,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:d,label:u,labelFormatter:f,accessibilityLayer:m=oi.accessibilityLayer}=e,h=()=>{if(i&&i.length){var k={padding:0,margin:0},w=(l?Qu(i,l):i).map((S,C)=>{if(S.type==="none")return null;var P=S.formatter||o||RF,{value:M,name:A}=S,_=M,D=A;if(P){var O=P(M,A,S,C,i);if(Array.isArray(O))[_,D]=O;else if(O!=null)_=O;else return null}var R=Po(Po({},oi.itemStyle),{},{color:S.color||oi.itemStyle.color},n);return p.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(C),style:R},Un(D)?p.createElement("span",{className:"recharts-tooltip-item-name"},D):null,Un(D)?p.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,p.createElement("span",{className:"recharts-tooltip-item-value"},_),p.createElement("span",{className:"recharts-tooltip-item-unit"},S.unit||""))});return p.createElement("ul",{className:"recharts-tooltip-item-list",style:k},w)}return null},g=Po(Po({},oi.contentStyle),r),x=Po({margin:0},s),v=!Ut(u),y=v?u:"",j=Je("recharts-default-tooltip",c),b=Je("recharts-tooltip-label",d);v&&f&&i!==void 0&&i!==null&&(y=f(u,i));var N=m?{role:"status","aria-live":"assertive"}:{};return p.createElement("div",Ih({className:j,style:g},N),p.createElement("p",{className:b,style:x},p.isValidElement(y)?y:"".concat(y)),h())},Mo="recharts-tooltip-wrapper",zF={visibility:"hidden"};function LF(e){var{coordinate:t,translateX:r,translateY:n}=e;return Je(Mo,{["".concat(Mo,"-right")]:xe(r)&&t&&xe(t.x)&&r>=t.x,["".concat(Mo,"-left")]:xe(r)&&t&&xe(t.x)&&r<t.x,["".concat(Mo,"-bottom")]:xe(n)&&t&&xe(t.y)&&n>=t.y,["".concat(Mo,"-top")]:xe(n)&&t&&xe(t.y)&&n<t.y})}function Zy(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offset:s,position:i,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:d}=e;if(i&&xe(i[n]))return i[n];var u=r[n]-l-(s>0?s:0),f=r[n]+s;if(t[n])return o[n]?u:f;var m=c[n];if(m==null)return 0;if(o[n]){var h=u,g=m;return h<g?Math.max(f,m):Math.max(u,m)}if(d==null)return 0;var x=f+l,v=m+d;return x>v?Math.max(u,m):Math.max(f,m)}function FF(e){var{translateX:t,translateY:r,useTranslate3d:n}=e;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function BF(e){var{allowEscapeViewBox:t,coordinate:r,offsetTop:n,offsetLeft:s,position:i,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:d}=e,u,f,m;return l.height>0&&l.width>0&&r?(f=Zy({allowEscapeViewBox:t,coordinate:r,key:"x",offset:s,position:i,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),m=Zy({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:i,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),u=FF({translateX:f,translateY:m,useTranslate3d:c})):u=zF,{cssProperties:u,cssClasses:LF({translateX:f,translateY:m,coordinate:r})}}function Jy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ec(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jy(Object(r),!0).forEach(function(n){Rh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rh(e,t,r){return(t=WF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WF(e){var t=UF(e,"string");return typeof t=="symbol"?t:t+""}function UF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class qF extends p.PureComponent{constructor(){super(...arguments),Rh(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),Rh(this,"handleKeyDown",t=>{if(t.key==="Escape"){var r,n,s,i;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(r=(n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==null&&r!==void 0?r:0,y:(s=(i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==null&&s!==void 0?s:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,r;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:r,animationDuration:n,animationEasing:s,children:i,coordinate:o,hasPayload:l,isAnimationActive:c,offset:d,position:u,reverseDirection:f,useTranslate3d:m,viewBox:h,wrapperStyle:g,lastBoundingBox:x,innerRef:v,hasPortalFromProps:y}=this.props,j=typeof d=="number"?d:d.x,b=typeof d=="number"?d:d.y,{cssClasses:N,cssProperties:k}=BF({allowEscapeViewBox:r,coordinate:o,offsetLeft:j,offsetTop:b,position:u,reverseDirection:f,tooltipBox:{height:x.height,width:x.width},useTranslate3d:m,viewBox:h}),w=y?{}:Ec(Ec({transition:c&&t?"transform ".concat(n,"ms ").concat(s):void 0},k),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&l?"visible":"hidden",position:"absolute",top:0,left:0}),S=Ec(Ec({},w),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},g);return p.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:N,style:S,ref:v},i)}}var u2=()=>{var e;return(e=_e(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function $h(){return $h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$h.apply(null,arguments)}function eb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function tb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eb(Object(r),!0).forEach(function(n){HF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HF(e,t,r){return(t=KF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KF(e){var t=YF(e,"string");return typeof t=="symbol"?t:t+""}function YF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rb={curveBasisClosed:_z,curveBasisOpen:Oz,curveBasis:Cz,curveBumpX:fz,curveBumpY:mz,curveLinearClosed:Pz,curveLinear:qu,curveMonotoneX:Mz,curveMonotoneY:Az,curveNatural:Ez,curveStep:Dz,curveStepAfter:Iz,curveStepBefore:Tz},kd=e=>Be(e.x)&&Be(e.y),nb=e=>e.base!=null&&kd(e.base)&&kd(e),Ao=e=>e.x,Eo=e=>e.y,GF=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(Gl(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=rb["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return rb[r]||qu},ab={connectNulls:!1,type:"linear"},VF=e=>{var{type:t=ab.type,points:r=[],baseLine:n,layout:s,connectNulls:i=ab.connectNulls}=e,o=GF(t,s),l=i?r.filter(kd):r;if(Array.isArray(n)){var c,d=r.map((g,x)=>tb(tb({},g),{},{base:n[x]}));s==="vertical"?c=kc().y(Eo).x1(Ao).x0(g=>g.base.x):c=kc().x(Ao).y1(Eo).y0(g=>g.base.y);var u=c.defined(nb).curve(o),f=i?d.filter(nb):d;return u(f)}var m;s==="vertical"&&xe(n)?m=kc().y(Eo).x1(Ao).x0(n):xe(n)?m=kc().x(Ao).y1(Eo).y0(n):m=Sk().x(Ao).y(Eo);var h=m.defined(kd).curve(o);return h(l)},f2=e=>{var{className:t,points:r,path:n,pathRef:s}=e,i=no();if((!r||!r.length)&&!n)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||i,connectNulls:e.connectNulls},l=r&&r.length?VF(o):n;return p.createElement("path",$h({},ha(e),r6(e),{className:Je("recharts-curve",t),d:l===null?void 0:l,ref:s}))},XF=["x","y","top","left","width","height","className"];function zh(){return zh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zh.apply(null,arguments)}function sb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function QF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sb(Object(r),!0).forEach(function(n){ZF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZF(e,t,r){return(t=JF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JF(e){var t=e8(e,"string");return typeof t=="symbol"?t:t+""}function e8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function t8(e,t){if(e==null)return{};var r,n,s=r8(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function r8(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var n8=(e,t,r,n,s,i)=>"M".concat(e,",").concat(s,"v").concat(n,"M").concat(i,",").concat(t,"h").concat(r),a8=e=>{var{x:t=0,y:r=0,top:n=0,left:s=0,width:i=0,height:o=0,className:l}=e,c=t8(e,XF),d=QF({x:t,y:r,top:n,left:s,width:i,height:o},c);return!xe(t)||!xe(r)||!xe(i)||!xe(o)||!xe(n)||!xe(s)?null:p.createElement("path",zh({},an(d),{className:Je("recharts-cross",l),d:n8(t,r,i,o,n,s)}))};function s8(e,t,r,n){var s=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-s,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function ib(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ob(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ib(Object(r),!0).forEach(function(n){i8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ib(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function i8(e,t,r){return(t=o8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o8(e){var t=l8(e,"string");return typeof t=="symbol"?t:t+""}function l8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var c8=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),m2=(e,t,r)=>e.map(n=>"".concat(c8(n)," ").concat(t,"ms ").concat(r)).join(","),d8=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,n)=>r.filter(s=>n.includes(s))),ol=(e,t)=>Object.keys(t).reduce((r,n)=>ob(ob({},r),{},{[n]:e(n,t[n])}),{});function lb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lb(Object(r),!0).forEach(function(n){u8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function u8(e,t,r){return(t=f8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f8(e){var t=m8(e,"string");return typeof t=="symbol"?t:t+""}function m8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sd=(e,t,r)=>e+(t-e)*r,Lh=e=>{var{from:t,to:r}=e;return t!==r},h2=(e,t,r)=>{var n=ol((s,i)=>{if(Lh(i)){var[o,l]=e(i.from,i.to,i.velocity);return Tt(Tt({},i),{},{from:o,velocity:l})}return i},t);return r<1?ol((s,i)=>Lh(i)&&n[s]!=null?Tt(Tt({},i),{},{velocity:Sd(i.velocity,n[s].velocity,r),from:Sd(i.from,n[s].from,r)}):i,t):h2(e,n,r-1)};function h8(e,t,r,n,s,i){var o,l=n.reduce((m,h)=>Tt(Tt({},m),{},{[h]:{from:e[h],velocity:0,to:t[h]}}),{}),c=()=>ol((m,h)=>h.from,l),d=()=>!Object.values(l).filter(Lh).length,u=null,f=m=>{o||(o=m);var h=m-o,g=h/r.dt;l=h2(r,l,g),s(Tt(Tt(Tt({},e),t),c())),o=m,d()||(u=i.setTimeout(f))};return()=>(u=i.setTimeout(f),()=>{var m;(m=u)===null||m===void 0||m()})}function p8(e,t,r,n,s,i,o){var l=null,c=s.reduce((f,m)=>{var h=e[m],g=t[m];return h==null||g==null?f:Tt(Tt({},f),{},{[m]:[h,g]})},{}),d,u=f=>{d||(d=f);var m=(f-d)/n,h=ol((x,v)=>Sd(...v,r(m)),c);if(i(Tt(Tt(Tt({},e),t),h)),m<1)l=o.setTimeout(u);else{var g=ol((x,v)=>Sd(...v,r(1)),c);i(Tt(Tt(Tt({},e),t),g))}};return()=>(l=o.setTimeout(u),()=>{var f;(f=l)===null||f===void 0||f()})}const g8=(e,t,r,n,s,i)=>{var o=d8(e,t);return r==null?()=>(s(Tt(Tt({},e),t)),()=>{}):r.isStepper===!0?h8(e,t,r,o,s,i):p8(e,t,r,n,o,s,i)};var Cd=1e-4,p2=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],g2=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),cb=(e,t)=>r=>{var n=p2(e,t);return g2(n,r)},x8=(e,t)=>r=>{var n=p2(e,t),s=[...n.map((i,o)=>i*o).slice(1),0];return g2(s,r)},v8=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var s=n.map(i=>parseFloat(i));return[s[0],s[1],s[2],s[3]]},y8=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length===1)switch(r[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var s=v8(r[0]);if(s)return s}}return r.length===4?r:[0,0,1,1]},b8=(e,t,r,n)=>{var s=cb(e,r),i=cb(t,n),o=x8(e,r),l=d=>d>1?1:d<0?0:d,c=d=>{for(var u=d>1?1:d,f=u,m=0;m<8;++m){var h=s(f)-u,g=o(f);if(Math.abs(h-u)<Cd||g<Cd)return i(f);f=l(f-h/g)}return i(f)};return c.isStepper=!1,c},db=function(){return b8(...y8(...arguments))},w8=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:n=8,dt:s=17}=t,i=(o,l,c)=>{var d=-(o-l)*r,u=c*n,f=c+(d-u)*s/1e3,m=c*s/1e3+o;return Math.abs(m-l)<Cd&&Math.abs(f)<Cd?[l,0]:[m,f]};return i.isStepper=!0,i.dt=s,i},j8=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return db(e);case"spring":return w8();default:if(e.split("(")[0]==="cubic-bezier")return db(e)}return typeof e=="function"?e:null};function N8(e){var t,r=()=>null,n=!1,s=null,i=o=>{if(!n){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...d]=l;if(typeof c=="number"){s=e.setTimeout(i.bind(null,d),c);return}i(c),s=e.setTimeout(i.bind(null,d));return}typeof o=="string"&&(t=o,r(t)),typeof o=="object"&&(t=o,r(t)),typeof o=="function"&&o()}};return{stop:()=>{n=!0},start:o=>{n=!1,s&&(s(),s=null),i(o)},subscribe:o=>(r=o,()=>{r=()=>null}),getTimeoutController:()=>e}}class k8{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),s=null,i=o=>{o-n>=r?t(o):typeof requestAnimationFrame=="function"&&(s=requestAnimationFrame(i))};return s=requestAnimationFrame(i),()=>{s!=null&&cancelAnimationFrame(s)}}}function S8(){return N8(new k8)}var C8=p.createContext(S8);function _8(e,t){var r=p.useContext(C8);return p.useMemo(()=>t??r(e),[e,t,r])}var O8=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),gf={isSsr:O8()},P8={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},ub={t:0},Pm={t:1};function Lg(e){var t=Yr(e,P8),{isActive:r,canBegin:n,duration:s,easing:i,begin:o,onAnimationEnd:l,onAnimationStart:c,children:d}=t,u=r==="auto"?!gf.isSsr:r,f=_8(t.animationId,t.animationManager),[m,h]=p.useState(u?ub:Pm),g=p.useRef(null);return p.useEffect(()=>{u||h(Pm)},[u]),p.useEffect(()=>{if(!u||!n)return ro;var x=g8(ub,Pm,j8(i),s,h,f.getTimeoutController()),v=()=>{g.current=x()};return f.start([c,o,v,s,l]),()=>{f.stop(),g.current&&g.current(),l()}},[u,n,s,i,o,c,l,f]),d(m.t)}function Fg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=p.useRef(el(t)),n=p.useRef(e);return n.current!==e&&(r.current=el(t),n.current=e),r.current}var M8=["radius"],A8=["radius"],fb,mb,hb,pb,gb,xb,vb,yb,bb,wb;function jb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Nb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jb(Object(r),!0).forEach(function(n){E8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function E8(e,t,r){return(t=D8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D8(e){var t=T8(e,"string");return typeof t=="symbol"?t:t+""}function T8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _d(){return _d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_d.apply(null,arguments)}function kb(e,t){if(e==null)return{};var r,n,s=I8(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function I8(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function An(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Sb=(e,t,r,n,s)=>{var i=Ua(r),o=Ua(n),l=Math.min(Math.abs(i)/2,Math.abs(o)/2),c=o>=0?1:-1,d=i>=0?1:-1,u=o>=0&&i>=0||o<0&&i<0?1:0,f;if(l>0&&Array.isArray(s)){for(var m=[0,0,0,0],h=0,g=4;h<g;h++){var x,v=(x=s[h])!==null&&x!==void 0?x:0;m[h]=v>l?l:v}f=vt(fb||(fb=An(["M",",",""])),e,t+c*m[0]),m[0]>0&&(f+=vt(mb||(mb=An(["A ",",",",0,0,",",",",",""])),m[0],m[0],u,e+d*m[0],t)),f+=vt(hb||(hb=An(["L ",",",""])),e+r-d*m[1],t),m[1]>0&&(f+=vt(pb||(pb=An(["A ",",",",0,0,",`,
|
|
546
|
-
`,",",""])),m[1],m[1],u,e+r,t+c*m[1])),f+=vt(gb||(gb=An(["L ",",",""])),e+r,t+n-c*m[2]),m[2]>0&&(f+=vt(xb||(xb=An(["A ",",",",0,0,",`,
|
|
547
|
-
`,",",""])),m[2],m[2],u,e+r-d*m[2],t+n)),f+=vt(vb||(vb=An(["L ",",",""])),e+d*m[3],t+n),m[3]>0&&(f+=vt(yb||(yb=An(["A ",",",",0,0,",`,
|
|
548
|
-
`,",",""])),m[3],m[3],u,e,t+n-c*m[3])),f+="Z"}else if(l>0&&s===+s&&s>0){var y=Math.min(l,s);f=vt(bb||(bb=An(["M ",",",`
|
|
549
|
-
A `,",",",0,0,",",",",",`
|
|
550
|
-
L `,",",`
|
|
551
|
-
A `,",",",0,0,",",",",",`
|
|
552
|
-
L `,",",`
|
|
553
|
-
A `,",",",0,0,",",",",",`
|
|
554
|
-
L `,",",`
|
|
555
|
-
A `,",",",0,0,",",",","," Z"])),e,t+c*y,y,y,u,e+d*y,t,e+r-d*y,t,y,y,u,e+r,t+c*y,e+r,t+n-c*y,y,y,u,e+r-d*y,t+n,e+d*y,t+n,y,y,u,e,t+n-c*y)}else f=vt(wb||(wb=An(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return f},Cb={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},x2=e=>{var t=Yr(e,Cb),r=p.useRef(null),[n,s]=p.useState(-1);p.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var H=r.current.getTotalLength();H&&s(H)}catch{}},[]);var{x:i,y:o,width:l,height:c,radius:d,className:u}=t,{animationEasing:f,animationDuration:m,animationBegin:h,isAnimationActive:g,isUpdateAnimationActive:x}=t,v=p.useRef(l),y=p.useRef(c),j=p.useRef(i),b=p.useRef(o),N=p.useMemo(()=>({x:i,y:o,width:l,height:c,radius:d}),[i,o,l,c,d]),k=Fg(N,"rectangle-");if(i!==+i||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var w=Je("recharts-rectangle",u);if(!x){var S=an(t),{radius:C}=S,P=kb(S,M8);return p.createElement("path",_d({},P,{x:Ua(i),y:Ua(o),width:Ua(l),height:Ua(c),radius:typeof d=="number"?d:void 0,className:w,d:Sb(i,o,l,c,d)}))}var M=v.current,A=y.current,_=j.current,D=b.current,O="0px ".concat(n===-1?1:n,"px"),R="".concat(n,"px 0px"),F=m2(["strokeDasharray"],m,typeof f=="string"?f:Cb.animationEasing);return p.createElement(Lg,{animationId:k,key:k,canBegin:n>0,duration:m,easing:f,isActive:x,begin:h},H=>{var ne=er(M,l,H),G=er(A,c,H),oe=er(_,i,H),ce=er(D,o,H);r.current&&(v.current=ne,y.current=G,j.current=oe,b.current=ce);var B;g?H>0?B={transition:F,strokeDasharray:R}:B={strokeDasharray:O}:B={strokeDasharray:R};var Y=an(t),{radius:U}=Y,X=kb(Y,A8);return p.createElement("path",_d({},X,{radius:typeof d=="number"?d:void 0,className:w,d:Sb(oe,ce,ne,G,d),ref:r,style:Nb(Nb({},B),t.style)}))})};function _b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ob(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_b(Object(r),!0).forEach(function(n){R8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_b(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function R8(e,t,r){return(t=$8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $8(e){var t=z8(e,"string");return typeof t=="symbol"?t:t+""}function z8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Od=Math.PI/180,L8=e=>e*180/Math.PI,tr=(e,t,r,n)=>({x:e+Math.cos(-Od*n)*r,y:t+Math.sin(-Od*n)*r}),F8=function(t,r){var n=arguments.length>2&&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},B8=(e,t)=>{var{x:r,y:n}=e,{x:s,y:i}=t;return Math.sqrt((r-s)**2+(n-i)**2)},W8=(e,t)=>{var{x:r,y:n}=e,{cx:s,cy:i}=t,o=B8({x:r,y:n},{x:s,y:i});if(o<=0)return{radius:o,angle:0};var l=(r-s)/o,c=Math.acos(l);return n>i&&(c=2*Math.PI-c),{radius:o,angle:L8(c),angleInRadian:c}},U8=e=>{var{startAngle:t,endAngle:r}=e,n=Math.floor(t/360),s=Math.floor(r/360),i=Math.min(n,s);return{startAngle:t-i*360,endAngle:r-i*360}},q8=(e,t)=>{var{startAngle:r,endAngle:n}=t,s=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(s,i);return e+o*360},H8=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:s,angle:i}=W8({x:r,y:n},t),{innerRadius:o,outerRadius:l}=t;if(s<o||s>l||s===0)return null;var{startAngle:c,endAngle:d}=U8(t),u=i,f;if(c<=d){for(;u>d;)u-=360;for(;u<c;)u+=360;f=u>=c&&u<=d}else{for(;u>c;)u-=360;for(;u<d;)u+=360;f=u>=d&&u<=c}return f?Ob(Ob({},t),{},{radius:s,angle:q8(u,t)}):null};function v2(e){var{cx:t,cy:r,radius:n,startAngle:s,endAngle:i}=e,o=tr(t,r,n,s),l=tr(t,r,n,i);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:s,endAngle:i}}var Pb,Mb,Ab,Eb,Db,Tb,Ib;function Fh(){return Fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fh.apply(null,arguments)}function Ns(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var K8=(e,t)=>{var r=Or(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},Dc=e=>{var{cx:t,cy:r,radius:n,angle:s,sign:i,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,d=l*(o?1:-1)+n,u=Math.asin(l/d)/Od,f=c?s:s+i*u,m=tr(t,r,d,f),h=tr(t,r,n,f),g=c?s-i*u:s,x=tr(t,r,d*Math.cos(u*Od),g);return{center:m,circleTangency:h,lineTangency:x,theta:u}},y2=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:s,startAngle:i,endAngle:o}=e,l=K8(i,o),c=i+l,d=tr(t,r,s,i),u=tr(t,r,s,c),f=vt(Pb||(Pb=Ns(["M ",",",`
|
|
556
|
-
A `,",",`,0,
|
|
557
|
-
`,",",`,
|
|
558
|
-
`,",",`
|
|
559
|
-
`])),d.x,d.y,s,s,+(Math.abs(l)>180),+(i>c),u.x,u.y);if(n>0){var m=tr(t,r,n,i),h=tr(t,r,n,c);f+=vt(Mb||(Mb=Ns(["L ",",",`
|
|
560
|
-
A `,",",`,0,
|
|
561
|
-
`,",",`,
|
|
562
|
-
`,","," Z"])),h.x,h.y,n,n,+(Math.abs(l)>180),+(i<=c),m.x,m.y)}else f+=vt(Ab||(Ab=Ns(["L ",","," Z"])),t,r);return f},Y8=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:s,cornerRadius:i,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=e,u=Or(d-c),{circleTangency:f,lineTangency:m,theta:h}=Dc({cx:t,cy:r,radius:s,angle:c,sign:u,cornerRadius:i,cornerIsExternal:l}),{circleTangency:g,lineTangency:x,theta:v}=Dc({cx:t,cy:r,radius:s,angle:d,sign:-u,cornerRadius:i,cornerIsExternal:l}),y=l?Math.abs(c-d):Math.abs(c-d)-h-v;if(y<0)return o?vt(Eb||(Eb=Ns(["M ",",",`
|
|
563
|
-
a`,",",",0,0,1,",`,0
|
|
564
|
-
a`,",",",0,0,1,",`,0
|
|
565
|
-
`])),m.x,m.y,i,i,i*2,i,i,-i*2):y2({cx:t,cy:r,innerRadius:n,outerRadius:s,startAngle:c,endAngle:d});var j=vt(Db||(Db=Ns(["M ",",",`
|
|
566
|
-
A`,",",",0,0,",",",",",`
|
|
567
|
-
A`,",",",0,",",",",",",",`
|
|
568
|
-
A`,",",",0,0,",",",",",`
|
|
569
|
-
`])),m.x,m.y,i,i,+(u<0),f.x,f.y,s,s,+(y>180),+(u<0),g.x,g.y,i,i,+(u<0),x.x,x.y);if(n>0){var{circleTangency:b,lineTangency:N,theta:k}=Dc({cx:t,cy:r,radius:n,angle:c,sign:u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),{circleTangency:w,lineTangency:S,theta:C}=Dc({cx:t,cy:r,radius:n,angle:d,sign:-u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),P=l?Math.abs(c-d):Math.abs(c-d)-k-C;if(P<0&&i===0)return"".concat(j,"L").concat(t,",").concat(r,"Z");j+=vt(Tb||(Tb=Ns(["L",",",`
|
|
570
|
-
A`,",",",0,0,",",",",",`
|
|
571
|
-
A`,",",",0,",",",",",",",`
|
|
572
|
-
A`,",",",0,0,",",",",","Z"])),S.x,S.y,i,i,+(u<0),w.x,w.y,n,n,+(P>180),+(u>0),b.x,b.y,i,i,+(u<0),N.x,N.y)}else j+=vt(Ib||(Ib=Ns(["L",",","Z"])),t,r);return j},G8={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},b2=e=>{var t=Yr(e,G8),{cx:r,cy:n,innerRadius:s,outerRadius:i,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u,className:f}=t;if(i<s||d===u)return null;var m=Je("recharts-sector",f),h=i-s,g=jn(o,h,0,!0),x;return g>0&&Math.abs(d-u)<360?x=Y8({cx:r,cy:n,innerRadius:s,outerRadius:i,cornerRadius:Math.min(g,h/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u}):x=y2({cx:r,cy:n,innerRadius:s,outerRadius:i,startAngle:d,endAngle:u}),p.createElement("path",Fh({},an(t),{className:m,d:x}))};function V8(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(Bk(t)){if(e==="centric"){var{cx:n,cy:s,innerRadius:i,outerRadius:o,angle:l}=t,c=tr(n,s,i,l),d=tr(n,s,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return v2(t)}}var w2={},j2={},N2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Cg;function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(N2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=N2;function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(j2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_g,r=j2;function n(s,i,o){o&&typeof o!="number"&&t.isIterateeCall(s,i,o)&&(i=o=void 0),s=r.toFinite(s),i===void 0?(i=s,s=0):i=r.toFinite(i),o=o===void 0?s<i?1:-1:r.toFinite(o);const l=Math.max(Math.ceil((i-s)/(o||1)),0),c=new Array(l);for(let d=0;d<l;d++)c[d]=s,s+=o;return c}e.range=n})(w2);var X8=w2.range;const k2=Na(X8);function Ya(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Q8(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Bg(e){let t,r,n;e.length!==2?(t=Ya,r=(l,c)=>Ya(e(l),c),n=(l,c)=>e(l)-c):(t=e===Ya||e===Q8?e:Z8,r=e,n=e);function s(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<0?d=f+1:u=f}while(d<u)}return d}function i(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<=0?d=f+1:u=f}while(d<u)}return d}function o(l,c,d=0,u=l.length){const f=s(l,c,d,u-1);return f>d&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:s,center:o,right:i}}function Z8(){return 0}function S2(e){return e===null?NaN:+e}function*J8(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const eB=Bg(Ya),ec=eB.right;Bg(S2).center;class Rb extends Map{constructor(t,r=nB){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,s]of t)this.set(n,s)}get(t){return super.get($b(this,t))}has(t){return super.has($b(this,t))}set(t,r){return super.set(tB(this,t),r)}delete(t){return super.delete(rB(this,t))}}function $b({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function tB({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function rB({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function nB(e){return e!==null&&typeof e=="object"?e.valueOf():e}function aB(e=Ya){if(e===Ya)return C2;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 C2(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const sB=Math.sqrt(50),iB=Math.sqrt(10),oB=Math.sqrt(2);function Pd(e,t,r){const n=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(n)),i=n/Math.pow(10,s),o=i>=sB?10:i>=iB?5:i>=oB?2:1;let l,c,d;return s<0?(d=Math.pow(10,-s)/o,l=Math.round(e*d),c=Math.round(t*d),l/d<e&&++l,c/d>t&&--c,d=-d):(d=Math.pow(10,s)*o,l=Math.round(e/d),c=Math.round(t/d),l*d<e&&++l,c*d>t&&--c),c<l&&.5<=r&&r<2?Pd(e,t,r*2):[l,c,d]}function Bh(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[s,i,o]=n?Pd(t,e,r):Pd(e,t,r);if(!(i>=s))return[];const l=i-s+1,c=new Array(l);if(n)if(o<0)for(let d=0;d<l;++d)c[d]=(i-d)/-o;else for(let d=0;d<l;++d)c[d]=(i-d)*o;else if(o<0)for(let d=0;d<l;++d)c[d]=(s+d)/-o;else for(let d=0;d<l;++d)c[d]=(s+d)*o;return c}function Wh(e,t,r){return t=+t,e=+e,r=+r,Pd(e,t,r)[2]}function Uh(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?Wh(t,e,r):Wh(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function zb(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function Lb(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function _2(e,t,r=0,n=1/0,s){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(s=s===void 0?C2:aB(s);n>r;){if(n-r>600){const c=n-r+1,d=t-r+1,u=Math.log(c),f=.5*Math.exp(2*u/3),m=.5*Math.sqrt(u*f*(c-f)/c)*(d-c/2<0?-1:1),h=Math.max(r,Math.floor(t-d*f/c+m)),g=Math.min(n,Math.floor(t+(c-d)*f/c+m));_2(e,t,h,g,s)}const i=e[t];let o=r,l=n;for(Do(e,r,t),s(e[n],i)>0&&Do(e,r,n);o<l;){for(Do(e,o,l),++o,--l;s(e[o],i)<0;)++o;for(;s(e[l],i)>0;)--l}s(e[r],i)===0?Do(e,r,l):(++l,Do(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Do(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function lB(e,t,r){if(e=Float64Array.from(J8(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Lb(e);if(t>=1)return zb(e);var n,s=(n-1)*t,i=Math.floor(s),o=zb(_2(e,i).subarray(0,i+1)),l=Lb(e.subarray(i+1));return o+(l-o)*(s-i)}}function cB(e,t,r=S2){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,s=(n-1)*t,i=Math.floor(s),o=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return o+(l-o)*(s-i)}}function dB(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var n=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(s);++n<s;)i[n]=e+n*r;return i}function dn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Pa(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const qh=Symbol("implicit");function Wg(){var e=new Rb,t=[],r=[],n=qh;function s(i){let o=e.get(i);if(o===void 0){if(n!==qh)return n;e.set(i,o=t.push(i)-1)}return r[o%r.length]}return s.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new Rb;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(i){return arguments.length?(r=Array.from(i),s):r.slice()},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return Wg(t,r).unknown(n)},dn.apply(s,arguments),s}function Ug(){var e=Wg().unknown(void 0),t=e.domain,r=e.range,n=0,s=1,i,o,l=!1,c=0,d=0,u=.5;delete e.unknown;function f(){var m=t().length,h=s<n,g=h?s:n,x=h?n:s;i=(x-g)/Math.max(1,m-c+d*2),l&&(i=Math.floor(i)),g+=(x-g-i*(m-c))*u,o=i*(1-c),l&&(g=Math.round(g),o=Math.round(o));var v=dB(m).map(function(y){return g+i*y});return r(h?v.reverse():v)}return e.domain=function(m){return arguments.length?(t(m),f()):t()},e.range=function(m){return arguments.length?([n,s]=m,n=+n,s=+s,f()):[n,s]},e.rangeRound=function(m){return[n,s]=m,n=+n,s=+s,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(m){return arguments.length?(l=!!m,f()):l},e.padding=function(m){return arguments.length?(c=Math.min(1,d=+m),f()):c},e.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),f()):c},e.paddingOuter=function(m){return arguments.length?(d=+m,f()):d},e.align=function(m){return arguments.length?(u=Math.max(0,Math.min(1,m)),f()):u},e.copy=function(){return Ug(t(),[n,s]).round(l).paddingInner(c).paddingOuter(d).align(u)},dn.apply(f(),arguments)}function O2(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return O2(t())},e}function uB(){return O2(Ug.apply(null,arguments).paddingInner(1))}function qg(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function P2(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function tc(){}var ll=.7,Md=1/ll,ji="\\s*([+-]?\\d+)\\s*",cl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fB=/^#([0-9a-f]{3,8})$/,mB=new RegExp(`^rgb\\(${ji},${ji},${ji}\\)$`),hB=new RegExp(`^rgb\\(${Fn},${Fn},${Fn}\\)$`),pB=new RegExp(`^rgba\\(${ji},${ji},${ji},${cl}\\)$`),gB=new RegExp(`^rgba\\(${Fn},${Fn},${Fn},${cl}\\)$`),xB=new RegExp(`^hsl\\(${cl},${Fn},${Fn}\\)$`),vB=new RegExp(`^hsla\\(${cl},${Fn},${Fn},${cl}\\)$`),Fb={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};qg(tc,dl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Bb,formatHex:Bb,formatHex8:yB,formatHsl:bB,formatRgb:Wb,toString:Wb});function Bb(){return this.rgb().formatHex()}function yB(){return this.rgb().formatHex8()}function bB(){return M2(this).formatHsl()}function Wb(){return this.rgb().formatRgb()}function dl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=fB.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Ub(t):r===3?new Mr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Tc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Tc(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=mB.exec(e))?new Mr(t[1],t[2],t[3],1):(t=hB.exec(e))?new Mr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pB.exec(e))?Tc(t[1],t[2],t[3],t[4]):(t=gB.exec(e))?Tc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xB.exec(e))?Kb(t[1],t[2]/100,t[3]/100,1):(t=vB.exec(e))?Kb(t[1],t[2]/100,t[3]/100,t[4]):Fb.hasOwnProperty(e)?Ub(Fb[e]):e==="transparent"?new Mr(NaN,NaN,NaN,0):null}function Ub(e){return new Mr(e>>16&255,e>>8&255,e&255,1)}function Tc(e,t,r,n){return n<=0&&(e=t=r=NaN),new Mr(e,t,r,n)}function wB(e){return e instanceof tc||(e=dl(e)),e?(e=e.rgb(),new Mr(e.r,e.g,e.b,e.opacity)):new Mr}function Hh(e,t,r,n){return arguments.length===1?wB(e):new Mr(e,t,r,n??1)}function Mr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}qg(Mr,Hh,P2(tc,{brighter(e){return e=e==null?Md:Math.pow(Md,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ll:Math.pow(ll,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mr(As(this.r),As(this.g),As(this.b),Ad(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:qb,formatHex:qb,formatHex8:jB,formatRgb:Hb,toString:Hb}));function qb(){return`#${ks(this.r)}${ks(this.g)}${ks(this.b)}`}function jB(){return`#${ks(this.r)}${ks(this.g)}${ks(this.b)}${ks((isNaN(this.opacity)?1:this.opacity)*255)}`}function Hb(){const e=Ad(this.opacity);return`${e===1?"rgb(":"rgba("}${As(this.r)}, ${As(this.g)}, ${As(this.b)}${e===1?")":`, ${e})`}`}function Ad(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function As(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ks(e){return e=As(e),(e<16?"0":"")+e.toString(16)}function Kb(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new xn(e,t,r,n)}function M2(e){if(e instanceof xn)return new xn(e.h,e.s,e.l,e.opacity);if(e instanceof tc||(e=dl(e)),!e)return new xn;if(e instanceof xn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,s=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,l=i-s,c=(i+s)/2;return l?(t===i?o=(r-n)/l+(r<n)*6:r===i?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?i+s:2-i-s,o*=60):l=c>0&&c<1?0:o,new xn(o,l,c,e.opacity)}function NB(e,t,r,n){return arguments.length===1?M2(e):new xn(e,t,r,n??1)}function xn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}qg(xn,NB,P2(tc,{brighter(e){return e=e==null?Md:Math.pow(Md,e),new xn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ll:Math.pow(ll,e),new xn(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,s=2*r-n;return new Mr(Mm(e>=240?e-240:e+120,s,n),Mm(e,s,n),Mm(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new xn(Yb(this.h),Ic(this.s),Ic(this.l),Ad(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=Ad(this.opacity);return`${e===1?"hsl(":"hsla("}${Yb(this.h)}, ${Ic(this.s)*100}%, ${Ic(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Yb(e){return e=(e||0)%360,e<0?e+360:e}function Ic(e){return Math.max(0,Math.min(1,e||0))}function Mm(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 Hg=e=>()=>e;function kB(e,t){return function(r){return e+r*t}}function SB(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 CB(e){return(e=+e)==1?A2:function(t,r){return r-t?SB(t,r,e):Hg(isNaN(t)?r:t)}}function A2(e,t){var r=t-e;return r?kB(e,r):Hg(isNaN(e)?t:e)}const Gb=function e(t){var r=CB(t);function n(s,i){var o=r((s=Hh(s)).r,(i=Hh(i)).r),l=r(s.g,i.g),c=r(s.b,i.b),d=A2(s.opacity,i.opacity);return function(u){return s.r=o(u),s.g=l(u),s.b=c(u),s.opacity=d(u),s+""}}return n.gamma=e,n}(1);function _B(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),s;return function(i){for(s=0;s<r;++s)n[s]=e[s]*(1-i)+t[s]*i;return n}}function OB(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function PB(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,s=new Array(n),i=new Array(r),o;for(o=0;o<n;++o)s[o]=ao(e[o],t[o]);for(;o<r;++o)i[o]=t[o];return function(l){for(o=0;o<n;++o)i[o]=s[o](l);return i}}function MB(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Ed(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function AB(e,t){var r={},n={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=ao(e[s],t[s]):n[s]=t[s];return function(i){for(s in r)n[s]=r[s](i);return n}}var Kh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Am=new RegExp(Kh.source,"g");function EB(e){return function(){return e}}function DB(e){return function(t){return e(t)+""}}function TB(e,t){var r=Kh.lastIndex=Am.lastIndex=0,n,s,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=Kh.exec(e))&&(s=Am.exec(t));)(i=s.index)>r&&(i=t.slice(r,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:Ed(n,s)})),r=Am.lastIndex;return r<t.length&&(i=t.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?DB(c[0].x):EB(t):(t=c.length,function(d){for(var u=0,f;u<t;++u)l[(f=c[u]).i]=f.x(d);return l.join("")})}function ao(e,t){var r=typeof t,n;return t==null||r==="boolean"?Hg(t):(r==="number"?Ed:r==="string"?(n=dl(t))?(t=n,Gb):TB:t instanceof dl?Gb:t instanceof Date?MB:OB(t)?_B:Array.isArray(t)?PB:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?AB:Ed)(e,t)}function Kg(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function IB(e,t){t===void 0&&(t=e,e=ao);for(var r=0,n=t.length-1,s=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(s,s=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return i[l](o-l)}}function RB(e){return function(){return e}}function Dd(e){return+e}var Vb=[0,1];function xr(e){return e}function Yh(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:RB(isNaN(t)?NaN:.5)}function $B(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function zB(e,t,r){var n=e[0],s=e[1],i=t[0],o=t[1];return s<n?(n=Yh(s,n),i=r(o,i)):(n=Yh(n,s),i=r(i,o)),function(l){return i(n(l))}}function LB(e,t,r){var n=Math.min(e.length,t.length)-1,s=new Array(n),i=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)s[o]=Yh(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(l){var c=ec(e,l,1,n)-1;return i[c](s[c](l))}}function rc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function xf(){var e=Vb,t=Vb,r=ao,n,s,i,o=xr,l,c,d;function u(){var m=Math.min(e.length,t.length);return o!==xr&&(o=$B(e[0],e[m-1])),l=m>2?LB:zB,c=d=null,f}function f(m){return m==null||isNaN(m=+m)?i:(c||(c=l(e.map(n),t,r)))(n(o(m)))}return f.invert=function(m){return o(s((d||(d=l(t,e.map(n),Ed)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,Dd),u()):e.slice()},f.range=function(m){return arguments.length?(t=Array.from(m),u()):t.slice()},f.rangeRound=function(m){return t=Array.from(m),r=Kg,u()},f.clamp=function(m){return arguments.length?(o=m?!0:xr,u()):o!==xr},f.interpolate=function(m){return arguments.length?(r=m,u()):r},f.unknown=function(m){return arguments.length?(i=m,f):i},function(m,h){return n=m,s=h,u()}}function Yg(){return xf()(xr,xr)}function FB(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Td(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Di(e){return e=Td(Math.abs(e)),e?e[1]:NaN}function BB(e,t){return function(r,n){for(var s=r.length,i=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(s-=l,s+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function WB(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var UB=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ul(e){if(!(t=UB.exec(e)))throw new Error("invalid format: "+e);var t;return new Gg({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]})}ul.prototype=Gg.prototype;function Gg(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+""}Gg.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 qB(e){e:for(var t=e.length,r=1,n=-1,s;r<t;++r)switch(e[r]){case".":n=s=r;break;case"0":n===0&&(n=r),s=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(s+1):e}var Id;function HB(e,t){var r=Td(e,t);if(!r)return Id=void 0,e.toPrecision(t);var n=r[0],s=r[1],i=s-(Id=Math.max(-8,Math.min(8,Math.floor(s/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")+Td(e,Math.max(0,t+i-1))[0]}function Xb(e,t){var r=Td(e,t);if(!r)return e+"";var n=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+n:n.length>s+1?n.slice(0,s+1)+"."+n.slice(s+1):n+new Array(s-n.length+2).join("0")}const Qb={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:FB,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)=>Xb(e*100,t),r:Xb,s:HB,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Zb(e){return e}var Jb=Array.prototype.map,e0=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function KB(e){var t=e.grouping===void 0||e.thousands===void 0?Zb:BB(Jb.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?Zb:WB(Jb.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(f,m){f=ul(f);var h=f.fill,g=f.align,x=f.sign,v=f.symbol,y=f.zero,j=f.width,b=f.comma,N=f.precision,k=f.trim,w=f.type;w==="n"?(b=!0,w="g"):Qb[w]||(N===void 0&&(N=12),k=!0,w="g"),(y||h==="0"&&g==="=")&&(y=!0,h="0",g="=");var S=(m&&m.prefix!==void 0?m.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),C=(v==="$"?n:/[%p]/.test(w)?o:"")+(m&&m.suffix!==void 0?m.suffix:""),P=Qb[w],M=/[defgprs%]/.test(w);N=N===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function A(_){var D=S,O=C,R,F,H;if(w==="c")O=P(_)+O,_="";else{_=+_;var ne=_<0||1/_<0;if(_=isNaN(_)?c:P(Math.abs(_),N),k&&(_=qB(_)),ne&&+_==0&&x!=="+"&&(ne=!1),D=(ne?x==="("?x:l:x==="-"||x==="("?"":x)+D,O=(w==="s"&&!isNaN(_)&&Id!==void 0?e0[8+Id/3]:"")+O+(ne&&x==="("?")":""),M){for(R=-1,F=_.length;++R<F;)if(H=_.charCodeAt(R),48>H||H>57){O=(H===46?s+_.slice(R+1):_.slice(R))+O,_=_.slice(0,R);break}}}b&&!y&&(_=t(_,1/0));var G=D.length+_.length+O.length,oe=G<j?new Array(j-G+1).join(h):"";switch(b&&y&&(_=t(oe+_,oe.length?j-O.length:1/0),oe=""),g){case"<":_=D+_+O+oe;break;case"=":_=D+oe+_+O;break;case"^":_=oe.slice(0,G=oe.length>>1)+D+_+O+oe.slice(G);break;default:_=oe+D+_+O;break}return i(_)}return A.toString=function(){return f+""},A}function u(f,m){var h=Math.max(-8,Math.min(8,Math.floor(Di(m)/3)))*3,g=Math.pow(10,-h),x=d((f=ul(f),f.type="f",f),{suffix:e0[8+h/3]});return function(v){return x(g*v)}}return{format:d,formatPrefix:u}}var Rc,Vg,E2;YB({thousands:",",grouping:[3],currency:["$",""]});function YB(e){return Rc=KB(e),Vg=Rc.format,E2=Rc.formatPrefix,Rc}function GB(e){return Math.max(0,-Di(Math.abs(e)))}function VB(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Di(t)/3)))*3-Di(Math.abs(e)))}function XB(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Di(t)-Di(e))+1}function D2(e,t,r,n){var s=Uh(e,t,r),i;switch(n=ul(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=VB(s,o))&&(n.precision=i),E2(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=XB(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=GB(s))&&(n.precision=i-(n.type==="%")*2);break}}return Vg(n)}function is(e){var t=e.domain;return e.ticks=function(r){var n=t();return Bh(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return D2(s[0],s[s.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),s=0,i=n.length-1,o=n[s],l=n[i],c,d,u=10;for(l<o&&(d=o,o=l,l=d,d=s,s=i,i=d);u-- >0;){if(d=Wh(o,l,r),d===c)return n[s]=o,n[i]=l,t(n);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;c=d}return e},e}function T2(){var e=Yg();return e.copy=function(){return rc(e,T2())},dn.apply(e,arguments),is(e)}function I2(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,Dd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return I2(e).unknown(t)},e=arguments.length?Array.from(e,Dd):[0,1],is(r)}function R2(e,t){e=e.slice();var r=0,n=e.length-1,s=e[r],i=e[n],o;return i<s&&(o=r,r=n,n=o,o=s,s=i,i=o),e[r]=t.floor(s),e[n]=t.ceil(i),e}function t0(e){return Math.log(e)}function r0(e){return Math.exp(e)}function QB(e){return-Math.log(-e)}function ZB(e){return-Math.exp(-e)}function JB(e){return isFinite(e)?+("1e"+e):e<0?0:e}function eW(e){return e===10?JB:e===Math.E?Math.exp:t=>Math.pow(e,t)}function tW(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 n0(e){return(t,r)=>-e(-t,r)}function Xg(e){const t=e(t0,r0),r=t.domain;let n=10,s,i;function o(){return s=tW(n),i=eW(n),r()[0]<0?(s=n0(s),i=n0(i),e(QB,ZB)):e(t0,r0),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let d=c[0],u=c[c.length-1];const f=u<d;f&&([d,u]=[u,d]);let m=s(d),h=s(u),g,x;const v=l==null?10:+l;let y=[];if(!(n%1)&&h-m<v){if(m=Math.floor(m),h=Math.ceil(h),d>0){for(;m<=h;++m)for(g=1;g<n;++g)if(x=m<0?g/i(-m):g*i(m),!(x<d)){if(x>u)break;y.push(x)}}else for(;m<=h;++m)for(g=n-1;g>=1;--g)if(x=m>0?g/i(-m):g*i(m),!(x<d)){if(x>u)break;y.push(x)}y.length*2<v&&(y=Bh(d,u,v))}else y=Bh(m,h,Math.min(h-m,v)).map(i);return f?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=ul(c)).precision==null&&(c.trim=!0),c=Vg(c)),l===1/0)return c;const d=Math.max(1,n*l/t.ticks().length);return u=>{let f=u/i(Math.round(s(u)));return f*n<n-.5&&(f*=n),f<=d?c(u):""}},t.nice=()=>r(R2(r(),{floor:l=>i(Math.floor(s(l))),ceil:l=>i(Math.ceil(s(l)))})),t}function $2(){const e=Xg(xf()).domain([1,10]);return e.copy=()=>rc(e,$2()).base(e.base()),dn.apply(e,arguments),e}function a0(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function s0(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Qg(e){var t=1,r=e(a0(t),s0(t));return r.constant=function(n){return arguments.length?e(a0(t=+n),s0(t)):t},is(r)}function z2(){var e=Qg(xf());return e.copy=function(){return rc(e,z2()).constant(e.constant())},dn.apply(e,arguments)}function i0(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function rW(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function nW(e){return e<0?-e*e:e*e}function Zg(e){var t=e(xr,xr),r=1;function n(){return r===1?e(xr,xr):r===.5?e(rW,nW):e(i0(r),i0(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},is(t)}function Jg(){var e=Zg(xf());return e.copy=function(){return rc(e,Jg()).exponent(e.exponent())},dn.apply(e,arguments),e}function aW(){return Jg.apply(null,arguments).exponent(.5)}function o0(e){return Math.sign(e)*e*e}function sW(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function L2(){var e=Yg(),t=[0,1],r=!1,n;function s(i){var o=sW(e(i));return isNaN(o)?n:r?Math.round(o):o}return s.invert=function(i){return e.invert(o0(i))},s.domain=function(i){return arguments.length?(e.domain(i),s):e.domain()},s.range=function(i){return arguments.length?(e.range((t=Array.from(i,Dd)).map(o0)),s):t.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(r=!!i,s):r},s.clamp=function(i){return arguments.length?(e.clamp(i),s):e.clamp()},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return L2(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},dn.apply(s,arguments),is(s)}function F2(){var e=[],t=[],r=[],n;function s(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=cB(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:t[ec(r,o)]}return i.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Ya),s()},i.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return F2().domain(e).range(t).unknown(n)},dn.apply(i,arguments)}function B2(){var e=0,t=1,r=1,n=[.5],s=[0,1],i;function o(c){return c!=null&&c<=c?s[ec(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(r=(s=Array.from(c)).length-1,l()):s.slice()},o.invertExtent=function(c){var d=s.indexOf(c);return d<0?[NaN,NaN]:d<1?[e,n[0]]:d>=r?[n[r-1],t]:[n[d-1],n[d]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return B2().domain([e,t]).range(s).unknown(i)},dn.apply(is(o),arguments)}function W2(){var e=[.5],t=[0,1],r,n=1;function s(i){return i!=null&&i<=i?t[ec(e,i,0,n)]:r}return s.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return W2().domain(e).range(t).unknown(r)},dn.apply(s,arguments)}const Em=new Date,Dm=new Date;function Rt(e,t,r,n){function s(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(e(i=new Date(+i)),i),s.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),s.round=i=>{const o=s(i),l=s.ceil(i);return i-o<l-i?o:l},s.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),s.range=(i,o,l)=>{const c=[];if(i=s.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let d;do c.push(d=new Date(+i)),t(i,l),e(i);while(d<i&&i<o);return c},s.filter=i=>Rt(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),r&&(s.count=(i,o)=>(Em.setTime(+i),Dm.setTime(+o),e(Em),e(Dm),Math.floor(r(Em,Dm))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(n?o=>n(o)%i===0:o=>s.count(0,o)%i===0):s)),s}const Rd=Rt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Rd.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Rt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Rd);Rd.range;const la=1e3,tn=la*60,ca=tn*60,xa=ca*24,ex=xa*7,l0=xa*30,Tm=xa*365,Ss=Rt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getUTCSeconds());Ss.range;const tx=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*la)},(e,t)=>{e.setTime(+e+t*tn)},(e,t)=>(t-e)/tn,e=>e.getMinutes());tx.range;const rx=Rt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*tn)},(e,t)=>(t-e)/tn,e=>e.getUTCMinutes());rx.range;const nx=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*la-e.getMinutes()*tn)},(e,t)=>{e.setTime(+e+t*ca)},(e,t)=>(t-e)/ca,e=>e.getHours());nx.range;const ax=Rt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ca)},(e,t)=>(t-e)/ca,e=>e.getUTCHours());ax.range;const nc=Rt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*tn)/xa,e=>e.getDate()-1);nc.range;const vf=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xa,e=>e.getUTCDate()-1);vf.range;const U2=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xa,e=>Math.floor(e/xa));U2.range;function ei(e){return Rt(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())*tn)/ex)}const yf=ei(0),$d=ei(1),iW=ei(2),oW=ei(3),Ti=ei(4),lW=ei(5),cW=ei(6);yf.range;$d.range;iW.range;oW.range;Ti.range;lW.range;cW.range;function ti(e){return Rt(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)/ex)}const bf=ti(0),zd=ti(1),dW=ti(2),uW=ti(3),Ii=ti(4),fW=ti(5),mW=ti(6);bf.range;zd.range;dW.range;uW.range;Ii.range;fW.range;mW.range;const sx=Rt(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());sx.range;const ix=Rt(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());ix.range;const va=Rt(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());va.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(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)});va.range;const ya=Rt(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());ya.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(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)});ya.range;function q2(e,t,r,n,s,i){const o=[[Ss,1,la],[Ss,5,5*la],[Ss,15,15*la],[Ss,30,30*la],[i,1,tn],[i,5,5*tn],[i,15,15*tn],[i,30,30*tn],[s,1,ca],[s,3,3*ca],[s,6,6*ca],[s,12,12*ca],[n,1,xa],[n,2,2*xa],[r,1,ex],[t,1,l0],[t,3,3*l0],[e,1,Tm]];function l(d,u,f){const m=u<d;m&&([d,u]=[u,d]);const h=f&&typeof f.range=="function"?f:c(d,u,f),g=h?h.range(d,+u+1):[];return m?g.reverse():g}function c(d,u,f){const m=Math.abs(u-d)/f,h=Bg(([,,v])=>v).right(o,m);if(h===o.length)return e.every(Uh(d/Tm,u/Tm,f));if(h===0)return Rd.every(Math.max(Uh(d,u,f),1));const[g,x]=o[m/o[h-1][2]<o[h][2]/m?h-1:h];return g.every(x)}return[l,c]}const[hW,pW]=q2(ya,ix,bf,U2,ax,rx),[gW,xW]=q2(va,sx,yf,nc,nx,tx);function Im(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Rm(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function To(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function vW(e){var t=e.dateTime,r=e.date,n=e.time,s=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,d=Io(s),u=Ro(s),f=Io(i),m=Ro(i),h=Io(o),g=Ro(o),x=Io(l),v=Ro(l),y=Io(c),j=Ro(c),b={a:H,A:ne,b:G,B:oe,c:null,d:h0,e:h0,f:BW,g:QW,G:JW,H:zW,I:LW,j:FW,L:H2,m:WW,M:UW,p:ce,q:B,Q:x0,s:v0,S:qW,u:HW,U:KW,V:YW,w:GW,W:VW,x:null,X:null,y:XW,Y:ZW,Z:e7,"%":g0},N={a:Y,A:U,b:X,B:$,c:null,d:p0,e:p0,f:a7,g:h7,G:g7,H:t7,I:r7,j:n7,L:Y2,m:s7,M:i7,p:K,q:V,Q:x0,s:v0,S:o7,u:l7,U:c7,V:d7,w:u7,W:f7,x:null,X:null,y:m7,Y:p7,Z:x7,"%":g0},k={a:M,A,b:_,B:D,c:O,d:f0,e:f0,f:TW,g:u0,G:d0,H:m0,I:m0,j:MW,L:DW,m:PW,M:AW,p:P,q:OW,Q:RW,s:$W,S:EW,u:NW,U:kW,V:SW,w:jW,W:CW,x:R,X:F,y:u0,Y:d0,Z:_W,"%":IW};b.x=w(r,b),b.X=w(n,b),b.c=w(t,b),N.x=w(r,N),N.X=w(n,N),N.c=w(t,N);function w(L,se){return function(he){var Q=[],Pe=-1,re=0,Oe=L.length,Ce,q,ve;for(he instanceof Date||(he=new Date(+he));++Pe<Oe;)L.charCodeAt(Pe)===37&&(Q.push(L.slice(re,Pe)),(q=c0[Ce=L.charAt(++Pe)])!=null?Ce=L.charAt(++Pe):q=Ce==="e"?" ":"0",(ve=se[Ce])&&(Ce=ve(he,q)),Q.push(Ce),re=Pe+1);return Q.push(L.slice(re,Pe)),Q.join("")}}function S(L,se){return function(he){var Q=To(1900,void 0,1),Pe=C(Q,L,he+="",0),re,Oe;if(Pe!=he.length)return null;if("Q"in Q)return new Date(Q.Q);if("s"in Q)return new Date(Q.s*1e3+("L"in Q?Q.L:0));if(se&&!("Z"in Q)&&(Q.Z=0),"p"in Q&&(Q.H=Q.H%12+Q.p*12),Q.m===void 0&&(Q.m="q"in Q?Q.q:0),"V"in Q){if(Q.V<1||Q.V>53)return null;"w"in Q||(Q.w=1),"Z"in Q?(re=Rm(To(Q.y,0,1)),Oe=re.getUTCDay(),re=Oe>4||Oe===0?zd.ceil(re):zd(re),re=vf.offset(re,(Q.V-1)*7),Q.y=re.getUTCFullYear(),Q.m=re.getUTCMonth(),Q.d=re.getUTCDate()+(Q.w+6)%7):(re=Im(To(Q.y,0,1)),Oe=re.getDay(),re=Oe>4||Oe===0?$d.ceil(re):$d(re),re=nc.offset(re,(Q.V-1)*7),Q.y=re.getFullYear(),Q.m=re.getMonth(),Q.d=re.getDate()+(Q.w+6)%7)}else("W"in Q||"U"in Q)&&("w"in Q||(Q.w="u"in Q?Q.u%7:"W"in Q?1:0),Oe="Z"in Q?Rm(To(Q.y,0,1)).getUTCDay():Im(To(Q.y,0,1)).getDay(),Q.m=0,Q.d="W"in Q?(Q.w+6)%7+Q.W*7-(Oe+5)%7:Q.w+Q.U*7-(Oe+6)%7);return"Z"in Q?(Q.H+=Q.Z/100|0,Q.M+=Q.Z%100,Rm(Q)):Im(Q)}}function C(L,se,he,Q){for(var Pe=0,re=se.length,Oe=he.length,Ce,q;Pe<re;){if(Q>=Oe)return-1;if(Ce=se.charCodeAt(Pe++),Ce===37){if(Ce=se.charAt(Pe++),q=k[Ce in c0?se.charAt(Pe++):Ce],!q||(Q=q(L,he,Q))<0)return-1}else if(Ce!=he.charCodeAt(Q++))return-1}return Q}function P(L,se,he){var Q=d.exec(se.slice(he));return Q?(L.p=u.get(Q[0].toLowerCase()),he+Q[0].length):-1}function M(L,se,he){var Q=h.exec(se.slice(he));return Q?(L.w=g.get(Q[0].toLowerCase()),he+Q[0].length):-1}function A(L,se,he){var Q=f.exec(se.slice(he));return Q?(L.w=m.get(Q[0].toLowerCase()),he+Q[0].length):-1}function _(L,se,he){var Q=y.exec(se.slice(he));return Q?(L.m=j.get(Q[0].toLowerCase()),he+Q[0].length):-1}function D(L,se,he){var Q=x.exec(se.slice(he));return Q?(L.m=v.get(Q[0].toLowerCase()),he+Q[0].length):-1}function O(L,se,he){return C(L,t,se,he)}function R(L,se,he){return C(L,r,se,he)}function F(L,se,he){return C(L,n,se,he)}function H(L){return o[L.getDay()]}function ne(L){return i[L.getDay()]}function G(L){return c[L.getMonth()]}function oe(L){return l[L.getMonth()]}function ce(L){return s[+(L.getHours()>=12)]}function B(L){return 1+~~(L.getMonth()/3)}function Y(L){return o[L.getUTCDay()]}function U(L){return i[L.getUTCDay()]}function X(L){return c[L.getUTCMonth()]}function $(L){return l[L.getUTCMonth()]}function K(L){return s[+(L.getUTCHours()>=12)]}function V(L){return 1+~~(L.getUTCMonth()/3)}return{format:function(L){var se=w(L+="",b);return se.toString=function(){return L},se},parse:function(L){var se=S(L+="",!1);return se.toString=function(){return L},se},utcFormat:function(L){var se=w(L+="",N);return se.toString=function(){return L},se},utcParse:function(L){var se=S(L+="",!0);return se.toString=function(){return L},se}}}var c0={"-":"",_:" ",0:"0"},Kt=/^\s*\d+/,yW=/^%/,bW=/[\\^$*+?|[\]().{}]/g;function He(e,t,r){var n=e<0?"-":"",s=(n?-e:e)+"",i=s.length;return n+(i<r?new Array(r-i+1).join(t)+s:s)}function wW(e){return e.replace(bW,"\\$&")}function Io(e){return new RegExp("^(?:"+e.map(wW).join("|")+")","i")}function Ro(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function jW(e,t,r){var n=Kt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function NW(e,t,r){var n=Kt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function kW(e,t,r){var n=Kt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function SW(e,t,r){var n=Kt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function CW(e,t,r){var n=Kt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function d0(e,t,r){var n=Kt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function u0(e,t,r){var n=Kt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function _W(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 OW(e,t,r){var n=Kt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function PW(e,t,r){var n=Kt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function f0(e,t,r){var n=Kt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function MW(e,t,r){var n=Kt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function m0(e,t,r){var n=Kt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function AW(e,t,r){var n=Kt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function EW(e,t,r){var n=Kt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function DW(e,t,r){var n=Kt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function TW(e,t,r){var n=Kt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function IW(e,t,r){var n=yW.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function RW(e,t,r){var n=Kt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function $W(e,t,r){var n=Kt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function h0(e,t){return He(e.getDate(),t,2)}function zW(e,t){return He(e.getHours(),t,2)}function LW(e,t){return He(e.getHours()%12||12,t,2)}function FW(e,t){return He(1+nc.count(va(e),e),t,3)}function H2(e,t){return He(e.getMilliseconds(),t,3)}function BW(e,t){return H2(e,t)+"000"}function WW(e,t){return He(e.getMonth()+1,t,2)}function UW(e,t){return He(e.getMinutes(),t,2)}function qW(e,t){return He(e.getSeconds(),t,2)}function HW(e){var t=e.getDay();return t===0?7:t}function KW(e,t){return He(yf.count(va(e)-1,e),t,2)}function K2(e){var t=e.getDay();return t>=4||t===0?Ti(e):Ti.ceil(e)}function YW(e,t){return e=K2(e),He(Ti.count(va(e),e)+(va(e).getDay()===4),t,2)}function GW(e){return e.getDay()}function VW(e,t){return He($d.count(va(e)-1,e),t,2)}function XW(e,t){return He(e.getFullYear()%100,t,2)}function QW(e,t){return e=K2(e),He(e.getFullYear()%100,t,2)}function ZW(e,t){return He(e.getFullYear()%1e4,t,4)}function JW(e,t){var r=e.getDay();return e=r>=4||r===0?Ti(e):Ti.ceil(e),He(e.getFullYear()%1e4,t,4)}function e7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+He(t/60|0,"0",2)+He(t%60,"0",2)}function p0(e,t){return He(e.getUTCDate(),t,2)}function t7(e,t){return He(e.getUTCHours(),t,2)}function r7(e,t){return He(e.getUTCHours()%12||12,t,2)}function n7(e,t){return He(1+vf.count(ya(e),e),t,3)}function Y2(e,t){return He(e.getUTCMilliseconds(),t,3)}function a7(e,t){return Y2(e,t)+"000"}function s7(e,t){return He(e.getUTCMonth()+1,t,2)}function i7(e,t){return He(e.getUTCMinutes(),t,2)}function o7(e,t){return He(e.getUTCSeconds(),t,2)}function l7(e){var t=e.getUTCDay();return t===0?7:t}function c7(e,t){return He(bf.count(ya(e)-1,e),t,2)}function G2(e){var t=e.getUTCDay();return t>=4||t===0?Ii(e):Ii.ceil(e)}function d7(e,t){return e=G2(e),He(Ii.count(ya(e),e)+(ya(e).getUTCDay()===4),t,2)}function u7(e){return e.getUTCDay()}function f7(e,t){return He(zd.count(ya(e)-1,e),t,2)}function m7(e,t){return He(e.getUTCFullYear()%100,t,2)}function h7(e,t){return e=G2(e),He(e.getUTCFullYear()%100,t,2)}function p7(e,t){return He(e.getUTCFullYear()%1e4,t,4)}function g7(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ii(e):Ii.ceil(e),He(e.getUTCFullYear()%1e4,t,4)}function x7(){return"+0000"}function g0(){return"%"}function x0(e){return+e}function v0(e){return Math.floor(+e/1e3)}var li,V2,X2;v7({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 v7(e){return li=vW(e),V2=li.format,li.parse,X2=li.utcFormat,li.utcParse,li}function y7(e){return new Date(e)}function b7(e){return e instanceof Date?+e:+new Date(+e)}function ox(e,t,r,n,s,i,o,l,c,d){var u=Yg(),f=u.invert,m=u.domain,h=d(".%L"),g=d(":%S"),x=d("%I:%M"),v=d("%I %p"),y=d("%a %d"),j=d("%b %d"),b=d("%B"),N=d("%Y");function k(w){return(c(w)<w?h:l(w)<w?g:o(w)<w?x:i(w)<w?v:n(w)<w?s(w)<w?y:j:r(w)<w?b:N)(w)}return u.invert=function(w){return new Date(f(w))},u.domain=function(w){return arguments.length?m(Array.from(w,b7)):m().map(y7)},u.ticks=function(w){var S=m();return e(S[0],S[S.length-1],w??10)},u.tickFormat=function(w,S){return S==null?k:d(S)},u.nice=function(w){var S=m();return(!w||typeof w.range!="function")&&(w=t(S[0],S[S.length-1],w??10)),w?m(R2(S,w)):u},u.copy=function(){return rc(u,ox(e,t,r,n,s,i,o,l,c,d))},u}function w7(){return dn.apply(ox(gW,xW,va,sx,yf,nc,nx,tx,Ss,V2).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function j7(){return dn.apply(ox(hW,pW,ya,ix,bf,vf,ax,rx,Ss,X2).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function wf(){var e=0,t=1,r,n,s,i,o=xr,l=!1,c;function d(f){return f==null||isNaN(f=+f)?c:o(s===0?.5:(f=(i(f)-r)*s,l?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([e,t]=f,r=i(e=+e),n=i(t=+t),s=r===n?0:1/(n-r),d):[e,t]},d.clamp=function(f){return arguments.length?(l=!!f,d):l},d.interpolator=function(f){return arguments.length?(o=f,d):o};function u(f){return function(m){var h,g;return arguments.length?([h,g]=m,o=f(h,g),d):[o(0),o(1)]}}return d.range=u(ao),d.rangeRound=u(Kg),d.unknown=function(f){return arguments.length?(c=f,d):c},function(f){return i=f,r=f(e),n=f(t),s=r===n?0:1/(n-r),d}}function os(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Q2(){var e=is(wf()(xr));return e.copy=function(){return os(e,Q2())},Pa.apply(e,arguments)}function Z2(){var e=Xg(wf()).domain([1,10]);return e.copy=function(){return os(e,Z2()).base(e.base())},Pa.apply(e,arguments)}function J2(){var e=Qg(wf());return e.copy=function(){return os(e,J2()).constant(e.constant())},Pa.apply(e,arguments)}function lx(){var e=Zg(wf());return e.copy=function(){return os(e,lx()).exponent(e.exponent())},Pa.apply(e,arguments)}function N7(){return lx.apply(null,arguments).exponent(.5)}function eC(){var e=[],t=xr;function r(n){if(n!=null&&!isNaN(n=+n))return t((ec(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let s of n)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Ya),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,s)=>t(s/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(s,i)=>lB(e,i/n))},r.copy=function(){return eC(t).domain(e)},Pa.apply(r,arguments)}function jf(){var e=0,t=.5,r=1,n=1,s,i,o,l,c,d=xr,u,f=!1,m;function h(x){return isNaN(x=+x)?m:(x=.5+((x=+u(x))-i)*(n*x<n*i?l:c),d(f?Math.max(0,Math.min(1,x)):x))}h.domain=function(x){return arguments.length?([e,t,r]=x,s=u(e=+e),i=u(t=+t),o=u(r=+r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,h):[e,t,r]},h.clamp=function(x){return arguments.length?(f=!!x,h):f},h.interpolator=function(x){return arguments.length?(d=x,h):d};function g(x){return function(v){var y,j,b;return arguments.length?([y,j,b]=v,d=IB(x,[y,j,b]),h):[d(0),d(.5),d(1)]}}return h.range=g(ao),h.rangeRound=g(Kg),h.unknown=function(x){return arguments.length?(m=x,h):m},function(x){return u=x,s=x(e),i=x(t),o=x(r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,h}}function tC(){var e=is(jf()(xr));return e.copy=function(){return os(e,tC())},Pa.apply(e,arguments)}function rC(){var e=Xg(jf()).domain([.1,1,10]);return e.copy=function(){return os(e,rC()).base(e.base())},Pa.apply(e,arguments)}function nC(){var e=Qg(jf());return e.copy=function(){return os(e,nC()).constant(e.constant())},Pa.apply(e,arguments)}function cx(){var e=Zg(jf());return e.copy=function(){return os(e,cx()).exponent(e.exponent())},Pa.apply(e,arguments)}function k7(){return cx.apply(null,arguments).exponent(.5)}const Bo=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Ug,scaleDiverging:tC,scaleDivergingLog:rC,scaleDivergingPow:cx,scaleDivergingSqrt:k7,scaleDivergingSymlog:nC,scaleIdentity:I2,scaleImplicit:qh,scaleLinear:T2,scaleLog:$2,scaleOrdinal:Wg,scalePoint:uB,scalePow:Jg,scaleQuantile:F2,scaleQuantize:B2,scaleRadial:L2,scaleSequential:Q2,scaleSequentialLog:Z2,scaleSequentialPow:lx,scaleSequentialQuantile:eC,scaleSequentialSqrt:N7,scaleSequentialSymlog:J2,scaleSqrt:aW,scaleSymlog:z2,scaleThreshold:W2,scaleTime:w7,scaleUtc:j7,tickFormat:D2},Symbol.toStringTag,{value:"Module"}));var Ma=e=>e.chartData,aC=W([Ma],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),sC=(e,t,r,n)=>n?aC(e):Ma(e),S7=(e,t,r)=>r?aC(e):Ma(e);function ba(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(Be(t)&&Be(r))return!0}return!1}function y0(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function iC(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,s,i;if(Be(r))s=r;else if(typeof r=="function")return;if(Be(n))i=n;else if(typeof n=="function")return;var o=[s,i];if(ba(o))return o}}function C7(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(ba(n))return y0(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[s,i]=e,o,l;if(s==="auto")t!=null&&(o=Math.min(...t));else if(xe(s))o=s;else if(typeof s=="function")try{t!=null&&(o=s(t==null?void 0:t[0]))}catch{}else if(typeof s=="string"&&Ly.test(s)){var c=Ly.exec(s);if(c==null||c[1]==null||t==null)o=void 0;else{var d=+c[1];o=t[0]-d}}else o=t==null?void 0:t[0];if(i==="auto")t!=null&&(l=Math.max(...t));else if(xe(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t==null?void 0:t[1]))}catch{}else if(typeof i=="string"&&Fy.test(i)){var u=Fy.exec(i);if(u==null||u[1]==null||t==null)l=void 0;else{var f=+u[1];l=t[1]+f}}else l=t==null?void 0:t[1];var m=[o,l];if(ba(m))return t==null?m:y0(m,t,r)}}}var so=1e9,_7={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},ux,ct=!0,on="[DecimalError] ",Es=on+"Invalid argument: ",dx=on+"Exponent out of range: ",io=Math.floor,gs=Math.pow,O7=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Lr,Ft=1e7,st=7,oC=9007199254740991,Ld=io(oC/st),me={};me.absoluteValue=me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};me.comparedTo=me.cmp=function(e){var t,r,n,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===s?0:n>s^i.s<0?1:-1};me.decimalPlaces=me.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*st;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};me.dividedBy=me.div=function(e){return fa(this,new this.constructor(e))};me.dividedToIntegerBy=me.idiv=function(e){var t=this,r=t.constructor;return Ze(fa(t,new r(e),0,1),r.precision)};me.equals=me.eq=function(e){return!this.cmp(e)};me.exponent=function(){return Et(this)};me.greaterThan=me.gt=function(e){return this.cmp(e)>0};me.greaterThanOrEqualTo=me.gte=function(e){return this.cmp(e)>=0};me.isInteger=me.isint=function(){return this.e>this.d.length-2};me.isNegative=me.isneg=function(){return this.s<0};me.isPositive=me.ispos=function(){return this.s>0};me.isZero=function(){return this.s===0};me.lessThan=me.lt=function(e){return this.cmp(e)<0};me.lessThanOrEqualTo=me.lte=function(e){return this.cmp(e)<1};me.logarithm=me.log=function(e){var t,r=this,n=r.constructor,s=n.precision,i=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Lr))throw Error(on+"NaN");if(r.s<1)throw Error(on+(r.s?"NaN":"-Infinity"));return r.eq(Lr)?new n(0):(ct=!1,t=fa(fl(r,i),fl(e,i),i),ct=!0,Ze(t,s))};me.minus=me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?dC(t,e):lC(t,(e.s=-e.s,e))};me.modulo=me.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(on+"NaN");return r.s?(ct=!1,t=fa(r,e,0,1).times(e),ct=!0,r.minus(t)):Ze(new n(r),s)};me.naturalExponential=me.exp=function(){return cC(this)};me.naturalLogarithm=me.ln=function(){return fl(this)};me.negated=me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};me.plus=me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?lC(t,e):dC(t,(e.s=-e.s,e))};me.precision=me.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Es+e);if(t=Et(s)+1,n=s.d.length-1,r=n*st+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};me.squareRoot=me.sqrt=function(){var e,t,r,n,s,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(on+"NaN")}for(e=Et(l),ct=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Ln(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=io((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(s.toString()),r=c.precision,s=o=r+3;;)if(i=n,n=i.plus(fa(l,i,o+2)).times(.5),Ln(i.d).slice(0,o)===(t=Ln(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(Ze(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;o+=4}return ct=!0,Ze(n,r)};me.times=me.mul=function(e){var t,r,n,s,i,o,l,c,d,u=this,f=u.constructor,m=u.d,h=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,r=u.e+e.e,c=m.length,d=h.length,c<d&&(i=m,m=h,h=i,o=c,c=d,d=o),i=[],o=c+d,n=o;n--;)i.push(0);for(n=d;--n>=0;){for(t=0,s=c+n;s>n;)l=i[s]+h[n]*m[s-n-1]+t,i[s--]=l%Ft|0,t=l/Ft|0;i[s]=(i[s]+t)%Ft|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,ct?Ze(e,f.precision):e};me.toDecimalPlaces=me.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Hn(e,0,so),t===void 0?t=n.rounding:Hn(t,0,8),Ze(r,e+Et(r)+1,t))};me.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=Us(n,!0):(Hn(e,0,so),t===void 0?t=s.rounding:Hn(t,0,8),n=Ze(new s(n),e+1,t),r=Us(n,!0,e+1)),r};me.toFixed=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?Us(s):(Hn(e,0,so),t===void 0?t=i.rounding:Hn(t,0,8),n=Ze(new i(s),e+Et(s)+1,t),r=Us(n.abs(),!1,e+Et(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};me.toInteger=me.toint=function(){var e=this,t=e.constructor;return Ze(new t(e),Et(e)+1,t.rounding)};me.toNumber=function(){return+this};me.toPower=me.pow=function(e){var t,r,n,s,i,o,l=this,c=l.constructor,d=12,u=+(e=new c(e));if(!e.s)return new c(Lr);if(l=new c(l),!l.s){if(e.s<1)throw Error(on+"Infinity");return l}if(l.eq(Lr))return l;if(n=c.precision,e.eq(Lr))return Ze(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=l.s,o){if((r=u<0?-u:u)<=oC){for(s=new c(Lr),t=Math.ceil(n/st+4),ct=!1;r%2&&(s=s.times(l),w0(s.d,t)),r=io(r/2),r!==0;)l=l.times(l),w0(l.d,t);return ct=!0,e.s<0?new c(Lr).div(s):Ze(s,n)}}else if(i<0)throw Error(on+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,ct=!1,s=e.times(fl(l,n+d)),ct=!0,s=cC(s),s.s=i,s};me.toPrecision=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?(r=Et(s),n=Us(s,r<=i.toExpNeg||r>=i.toExpPos)):(Hn(e,1,so),t===void 0?t=i.rounding:Hn(t,0,8),s=Ze(new i(s),e,t),r=Et(s),n=Us(s,e<=r||r<=i.toExpNeg,e)),n};me.toSignificantDigits=me.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Hn(e,1,so),t===void 0?t=n.rounding:Hn(t,0,8)),Ze(new n(r),e,t)};me.toString=me.valueOf=me.val=me.toJSON=me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Et(e),r=e.constructor;return Us(e,t<=r.toExpNeg||t>=r.toExpPos)};function lC(e,t){var r,n,s,i,o,l,c,d,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),ct?Ze(t,f):t;if(c=e.d,d=t.d,o=e.e,s=t.e,c=c.slice(),i=o-s,i){for(i<0?(n=c,i=-i,l=d.length):(n=d,s=o,l=c.length),o=Math.ceil(f/st),l=o>l?o+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=d.length,l-i<0&&(i=l,n=d,d=c,c=n),r=0;i;)r=(c[--i]=c[i]+d[i]+r)/Ft|0,c[i]%=Ft;for(r&&(c.unshift(r),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,ct?Ze(t,f):t}function Hn(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Es+e)}function Ln(e){var t,r,n,s=e.length-1,i="",o=e[0];if(s>0){for(i+=o,t=1;t<s;t++)n=e[t]+"",r=st-n.length,r&&(i+=La(r)),i+=n;o=e[t],n=o+"",r=st-n.length,r&&(i+=La(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var fa=function(){function e(n,s){var i,o=0,l=n.length;for(n=n.slice();l--;)i=n[l]*s+o,n[l]=i%Ft|0,o=i/Ft|0;return o&&n.unshift(o),n}function t(n,s,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=s[l]){c=n[l]>s[l]?1:-1;break}return c}function r(n,s,i){for(var o=0;i--;)n[i]-=o,o=n[i]<s[i]?1:0,n[i]=o*Ft+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,o){var l,c,d,u,f,m,h,g,x,v,y,j,b,N,k,w,S,C,P=n.constructor,M=n.s==s.s?1:-1,A=n.d,_=s.d;if(!n.s)return new P(n);if(!s.s)throw Error(on+"Division by zero");for(c=n.e-s.e,S=_.length,k=A.length,h=new P(M),g=h.d=[],d=0;_[d]==(A[d]||0);)++d;if(_[d]>(A[d]||0)&&--c,i==null?j=i=P.precision:o?j=i+(Et(n)-Et(s))+1:j=i,j<0)return new P(0);if(j=j/st+2|0,d=0,S==1)for(u=0,_=_[0],j++;(d<k||u)&&j--;d++)b=u*Ft+(A[d]||0),g[d]=b/_|0,u=b%_|0;else{for(u=Ft/(_[0]+1)|0,u>1&&(_=e(_,u),A=e(A,u),S=_.length,k=A.length),N=S,x=A.slice(0,S),v=x.length;v<S;)x[v++]=0;C=_.slice(),C.unshift(0),w=_[0],_[1]>=Ft/2&&++w;do u=0,l=t(_,x,S,v),l<0?(y=x[0],S!=v&&(y=y*Ft+(x[1]||0)),u=y/w|0,u>1?(u>=Ft&&(u=Ft-1),f=e(_,u),m=f.length,v=x.length,l=t(f,x,m,v),l==1&&(u--,r(f,S<m?C:_,m))):(u==0&&(l=u=1),f=_.slice()),m=f.length,m<v&&f.unshift(0),r(x,f,v),l==-1&&(v=x.length,l=t(_,x,S,v),l<1&&(u++,r(x,S<v?C:_,v))),v=x.length):l===0&&(u++,x=[0]),g[d++]=u,l&&x[0]?x[v++]=A[N]||0:(x=[A[N]],v=1);while((N++<k||x[0]!==void 0)&&j--)}return g[0]||g.shift(),h.e=c,Ze(h,o?i+Et(h)+1:i)}}();function cC(e,t){var r,n,s,i,o,l,c=0,d=0,u=e.constructor,f=u.precision;if(Et(e)>16)throw Error(dx+Et(e));if(!e.s)return new u(Lr);for(ct=!1,l=f,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(n=Math.log(gs(2,d))/Math.LN10*2+5|0,l+=n,r=s=i=new u(Lr),u.precision=l;;){if(s=Ze(s.times(e),l),r=r.times(++c),o=i.plus(fa(s,r,l)),Ln(o.d).slice(0,l)===Ln(i.d).slice(0,l)){for(;d--;)i=Ze(i.times(i),l);return u.precision=f,t==null?(ct=!0,Ze(i,f)):i}i=o}}function Et(e){for(var t=e.e*st,r=e.d[0];r>=10;r/=10)t++;return t}function $m(e,t,r){if(t>e.LN10.sd())throw ct=!0,r&&(e.precision=r),Error(on+"LN10 precision limit exceeded");return Ze(new e(e.LN10),t)}function La(e){for(var t="";e--;)t+="0";return t}function fl(e,t){var r,n,s,i,o,l,c,d,u,f=1,m=10,h=e,g=h.d,x=h.constructor,v=x.precision;if(h.s<1)throw Error(on+(h.s?"NaN":"-Infinity"));if(h.eq(Lr))return new x(0);if(t==null?(ct=!1,d=v):d=t,h.eq(10))return t==null&&(ct=!0),$m(x,d);if(d+=m,x.precision=d,r=Ln(g),n=r.charAt(0),i=Et(h),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Ln(h.d),n=r.charAt(0),f++;i=Et(h),n>1?(h=new x("0."+r),i++):h=new x(n+"."+r.slice(1))}else return c=$m(x,d+2,v).times(i+""),h=fl(new x(n+"."+r.slice(1)),d-m).plus(c),x.precision=v,t==null?(ct=!0,Ze(h,v)):h;for(l=o=h=fa(h.minus(Lr),h.plus(Lr),d),u=Ze(h.times(h),d),s=3;;){if(o=Ze(o.times(u),d),c=l.plus(fa(o,new x(s),d)),Ln(c.d).slice(0,d)===Ln(l.d).slice(0,d))return l=l.times(2),i!==0&&(l=l.plus($m(x,d+2,v).times(i+""))),l=fa(l,new x(f),d),x.precision=v,t==null?(ct=!0,Ze(l,v)):l;l=c,s+=2}}function b0(e,t){var r,n,s;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(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(n,s),t){if(s-=n,r=r-n-1,e.e=io(r/st),e.d=[],n=(r+1)%st,r<0&&(n+=st),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=st;n<s;)e.d.push(+t.slice(n,n+=st));t=t.slice(n),n=st-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),ct&&(e.e>Ld||e.e<-Ld))throw Error(dx+r)}else e.s=0,e.e=0,e.d=[0];return e}function Ze(e,t,r){var n,s,i,o,l,c,d,u,f=e.d;for(o=1,i=f[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=st,s=t,d=f[u=0];else{if(u=Math.ceil((n+1)/st),i=f.length,u>=i)return e;for(d=i=f[u],o=1;i>=10;i/=10)o++;n%=st,s=n-st+o}if(r!==void 0&&(i=gs(10,o-s-1),l=d/i%10|0,c=t<0||f[u+1]!==void 0||d%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?s>0?d/gs(10,o-s):0:f[u-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(i=Et(e),f.length=1,t=t-i-1,f[0]=gs(10,(st-t%st)%st),e.e=io(-t/st)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=u,i=1,u--):(f.length=u+1,i=gs(10,st-n),f[u]=s>0?(d/gs(10,o-s)%gs(10,s)|0)*i:0),c)for(;;)if(u==0){(f[0]+=i)==Ft&&(f[0]=1,++e.e);break}else{if(f[u]+=i,f[u]!=Ft)break;f[u--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(ct&&(e.e>Ld||e.e<-Ld))throw Error(dx+Et(e));return e}function dC(e,t){var r,n,s,i,o,l,c,d,u,f,m=e.constructor,h=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),ct?Ze(t,h):t;if(c=e.d,f=t.d,n=t.e,d=e.e,c=c.slice(),o=d-n,o){for(u=o<0,u?(r=c,o=-o,l=f.length):(r=f,n=d,l=c.length),s=Math.max(Math.ceil(h/st),l)+2,o>s&&(o=s,r.length=1),r.reverse(),s=o;s--;)r.push(0);r.reverse()}else{for(s=c.length,l=f.length,u=s<l,u&&(l=s),s=0;s<l;s++)if(c[s]!=f[s]){u=c[s]<f[s];break}o=0}for(u&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,s=f.length-l;s>0;--s)c[l++]=0;for(s=f.length;s>o;){if(c[--s]<f[s]){for(i=s;i&&c[--i]===0;)c[i]=Ft-1;--c[i],c[s]+=Ft}c[s]-=f[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,ct?Ze(t,h):t):new m(0)}function Us(e,t,r){var n,s=Et(e),i=Ln(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+La(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+La(-s-1)+i,r&&(n=r-o)>0&&(i+=La(n))):s>=o?(i+=La(s+1-o),r&&(n=r-s-1)>0&&(i=i+"."+La(n))):((n=s+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(s+1===o&&(i+="."),i+=La(n))),e.s<0?"-"+i:i}function w0(e,t){if(e.length>t)return e.length=t,!0}function uC(e){var t,r,n;function s(i){var o=this;if(!(o instanceof s))return new s(i);if(o.constructor=s,i instanceof s){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(Es+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 b0(o,i.toString())}else if(typeof i!="string")throw Error(Es+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,O7.test(i))b0(o,i);else throw Error(Es+i)}if(s.prototype=me,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=uC,s.config=s.set=P7,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return s.config(e),s}function P7(e){if(!e||typeof e!="object")throw Error(on+"Object expected");var t,r,n,s=["precision",1,so,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((n=e[r=s[t]])!==void 0)if(io(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Es+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Es+r+": "+n);return this}var ux=uC(_7);Lr=new ux(1);const Ve=ux;function fC(e){var t;return e===0?t=1:t=Math.floor(new Ve(e).abs().log(10).toNumber())+1,t}function mC(e,t,r){for(var n=new Ve(e),s=0,i=[];n.lt(t)&&s<1e5;)i.push(n.toNumber()),n=n.add(r),s++;return i}var hC=e=>{var[t,r]=e,[n,s]=[t,r];return t>r&&([n,s]=[r,t]),[n,s]},pC=(e,t,r)=>{if(e.lte(0))return new Ve(0);var n=fC(e.toNumber()),s=new Ve(10).pow(n),i=e.div(s),o=n!==1?.05:.1,l=new Ve(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(s);return t?new Ve(c.toNumber()):new Ve(Math.ceil(c.toNumber()))},M7=(e,t,r)=>{var n=new Ve(1),s=new Ve(e);if(!s.isint()&&r){var i=Math.abs(e);i<1?(n=new Ve(10).pow(fC(e)-1),s=new Ve(Math.floor(s.div(n).toNumber())).mul(n)):i>1&&(s=new Ve(Math.floor(e)))}else e===0?s=new Ve(Math.floor((t-1)/2)):r||(s=new Ve(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(s.add(new Ve(c-o).mul(n)).toNumber());return l},gC=function(t,r,n,s){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(n-1)))return{step:new Ve(0),tickMin:new Ve(0),tickMax:new Ve(0)};var o=pC(new Ve(r).sub(t).div(n-1),s,i),l;t<=0&&r>=0?l=new Ve(0):(l=new Ve(t).add(r).div(2),l=l.sub(new Ve(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),d=Math.ceil(new Ve(r).sub(l).div(o).toNumber()),u=c+d+1;return u>n?gC(t,r,n,s,i+1):(u<n&&(d=r>0?d+(n-u):d,c=r>0?c:c+(n-u)),{step:o,tickMin:l.sub(new Ve(c).mul(o)),tickMax:l.add(new Ve(d).mul(o))})},A7=function(t){var[r,n]=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),[l,c]=hC([r,n]);if(l===-1/0||c===1/0){var d=c===1/0?[l,...Array(s-1).fill(1/0)]:[...Array(s-1).fill(-1/0),c];return r>n?d.reverse():d}if(l===c)return M7(l,s,i);var{step:u,tickMin:f,tickMax:m}=gC(l,c,o,i,0),h=mC(f,m.add(new Ve(.1).mul(u)),u);return r>n?h.reverse():h},E7=function(t,r){var[n,s]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,l]=hC([n,s]);if(o===-1/0||l===1/0)return[n,s];if(o===l)return[o];var c=Math.max(r,2),d=pC(new Ve(l).sub(o).div(c-1),i,0),u=[...mC(new Ve(o),new Ve(l),d),l];return i===!1&&(u=u.map(f=>Math.round(f))),n>s?u.reverse():u},xC=e=>e.rootProps.maxBarSize,D7=e=>e.rootProps.barGap,vC=e=>e.rootProps.barCategoryGap,T7=e=>e.rootProps.barSize,Nf=e=>e.rootProps.stackOffset,yC=e=>e.rootProps.reverseStackOrder,fx=e=>e.options.chartName,mx=e=>e.rootProps.syncId,bC=e=>e.rootProps.syncMethod,hx=e=>e.options.eventEmitter,vr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},fs={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},En={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},kf=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Sf(e,t,r){if(r!=="auto")return r;if(e!=null)return ss(e,t)?"category":"number"}function j0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Fd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j0(Object(r),!0).forEach(function(n){I7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function I7(e,t,r){return(t=R7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R7(e){var t=$7(e,"string");return typeof t=="symbol"?t:t+""}function $7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var N0={allowDataOverflow:fs.allowDataOverflow,allowDecimals:fs.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:fs.angleAxisId,includeHidden:!1,name:void 0,reversed:fs.reversed,scale:fs.scale,tick:fs.tick,tickCount:void 0,ticks:void 0,type:fs.type,unit:void 0},k0={allowDataOverflow:En.allowDataOverflow,allowDecimals:En.allowDecimals,allowDuplicatedCategory:En.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:En.radiusAxisId,includeHidden:En.includeHidden,name:void 0,reversed:En.reversed,scale:En.scale,tick:En.tick,tickCount:En.tickCount,ticks:void 0,type:En.type,unit:void 0},z7=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},px=W([z7,n2],(e,t)=>{var r;if(e!=null)return e;var n=(r=Sf(t,"angleAxis",N0.type))!==null&&r!==void 0?r:"category";return Fd(Fd({},N0),{},{type:n})}),L7=(e,t)=>e.polarAxis.radiusAxis[t],gx=W([L7,n2],(e,t)=>{var r;if(e!=null)return e;var n=(r=Sf(t,"radiusAxis",k0.type))!==null&&r!==void 0?r:"category";return Fd(Fd({},k0),{},{type:n})}),Cf=e=>e.polarOptions,xx=W([_a,Oa,Ht],F8),wC=W([Cf,xx],(e,t)=>{if(e!=null)return jn(e.innerRadius,t,0)}),jC=W([Cf,xx],(e,t)=>{if(e!=null)return jn(e.outerRadius,t,t*.8)}),F7=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},NC=W([Cf],F7);W([px,NC],kf);var kC=W([xx,wC,jC],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});W([gx,kC],kf);var SC=W([et,Cf,wC,jC,_a,Oa],(e,t,r,n,s,i)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:o,cy:l,startAngle:c,endAngle:d}=t;return{cx:jn(o,s,s/2),cy:jn(l,i,i/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:d,clockWise:!1}}}),Yt=(e,t)=>t,_f=(e,t,r)=>r;function vx(e){return e==null?void 0:e.id}function CC(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:s,dataKey:i}=r,o=new Map;return e.forEach(l=>{var c,d=(c=l.data)!==null&&c!==void 0?c:n;if(!(d==null||d.length===0)){var u=vx(l);d.forEach((f,m)=>{var h=i==null||s?m:String(rr(f,i,null)),g=rr(f,l.dataKey,0),x;o.has(h)?x=o.get(h):x={},Object.assign(x,{[u]:g}),o.set(h,x)})}}),Array.from(o.values())}function Of(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Pf=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Mf(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function B7(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var Gt=e=>{var t=et(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},oo=e=>e.tooltip.settings.axisId;function W7(e){if(e in Bo)return Bo[e]();var t="scale".concat(Gl(e));if(t in Bo)return Bo[t]()}function S0(e){var t=e.ticks,r=e.bandwidth,n=e.range(),s=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:function(i){function o(){return i.apply(this,arguments)}return o.toString=function(){return i.toString()},o}(()=>s),rangeMin:()=>s[0],rangeMax:()=>s[1],isInRange(i){var o=s[0],l=s[1];return o<=l?i>=o&&i<=l:i>=l&&i<=o},bandwidth:r?()=>r.call(e):void 0,ticks:t?i=>t.call(e,i):void 0,map:(i,o)=>{var l=e(i);if(l!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var c=e.bandwidth();switch(o.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}function C0(e,t,r){if(typeof e=="function")return S0(e.copy().domain(t).range(r));if(e!=null){var n=W7(e);if(n!=null)return n.domain(t).range(r),S0(n)}}var U7=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!ba(t)){for(var r,n,s=0;s<t.length;s++){var i=t[s];Be(i)&&((r===void 0||i<r)&&(r=i),(n===void 0||i>n)&&(n=i))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function _0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Bd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_0(Object(r),!0).forEach(function(n){q7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function q7(e,t,r){return(t=H7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H7(e){var t=K7(e,"string");return typeof t=="symbol"?t:t+""}function K7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gh=[0,"auto"],zt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},_C=(e,t)=>e.cartesianAxis.xAxis[t],Aa=(e,t)=>{var r=_C(e,t);return r??zt},Lt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Gh,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:Ql},OC=(e,t)=>e.cartesianAxis.yAxis[t],Ea=(e,t)=>{var r=OC(e,t);return r??Lt},Y7={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},yx=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??Y7},Nr=(e,t,r)=>{switch(t){case"xAxis":return Aa(e,r);case"yAxis":return Ea(e,r);case"zAxis":return yx(e,r);case"angleAxis":return px(e,r);case"radiusAxis":return gx(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},G7=(e,t,r)=>{switch(t){case"xAxis":return Aa(e,r);case"yAxis":return Ea(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},ac=(e,t,r)=>{switch(t){case"xAxis":return Aa(e,r);case"yAxis":return Ea(e,r);case"angleAxis":return px(e,r);case"radiusAxis":return gx(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},PC=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function MC(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var bx=e=>e.graphicalItems.cartesianItems,V7=W([Yt,_f],MC),AC=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),sc=W([bx,Nr,V7],AC,{memoizeOptions:{resultEqualityCheck:Mf}}),EC=W([sc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Of)),DC=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),X7=W([sc],DC),TC=e=>e.map(t=>t.data).filter(Boolean).flat(1),Q7=W([sc],TC,{memoizeOptions:{resultEqualityCheck:Mf}}),IC=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:s}=t;return e.length>0?e:r.slice(n,s+1)},wx=W([Q7,sC],IC),RC=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:rr(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(s=>({value:rr(s,n)}))):e.map(n=>({value:n})),Af=W([wx,Nr,sc],RC);function $C(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Xc(e){if(Un(e)||e instanceof Date){var t=Number(e);if(Be(t))return t}}function O0(e){if(Array.isArray(e)){var t=[Xc(e[0]),Xc(e[1])];return ba(t)?t:void 0}var r=Xc(e);if(r!=null)return[r,r]}function wa(e){return e.map(Xc).filter(Pr)}function Z7(e,t,r){return!r||typeof t!="number"||Wn(t)?[]:r.length?wa(r.flatMap(n=>{var s=rr(e,n.dataKey),i,o;if(Array.isArray(s)?[i,o]=s:i=o=s,!(!Be(i)||!Be(o)))return[t-i,t+o]})):[]}var $t=e=>{var t=Gt(e),r=oo(e);return ac(e,t,r)},ic=W([$t],e=>e==null?void 0:e.dataKey),J7=W([EC,sC,$t],CC),zC=(e,t,r,n)=>{var s={},i=t.reduce((o,l)=>{if(l.stackId==null)return o;var c=o[l.stackId];return c==null&&(c=[]),c.push(l),o[l.stackId]=c,o},s);return Object.fromEntries(Object.entries(i).map(o=>{var[l,c]=o,d=n?[...c].reverse():c,u=d.map(vx);return[l,{stackedData:IL(e,u,r),graphicalItems:d}]}))},Vh=W([J7,EC,Nf,yC],zC),LC=(e,t,r,n)=>{var{dataStartIndex:s,dataEndIndex:i}=t;if(n==null&&r!=="zAxis"){var o=FL(e,s,i);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},e9=W([Nr],e=>e.allowDataOverflow),jx=e=>{var t;if(e==null||!("domain"in e))return Gh;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=wa(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:Gh},FC=W([Nr],jx),BC=W([FC,e9],iC),t9=W([Vh,Ma,Yt,BC],LC,{memoizeOptions:{resultEqualityCheck:Pf}}),Nx=e=>e.errorBars,r9=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>$C(r,n)),Wd=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var s=r.filter(Boolean);if(s.length!==0){var i=s.flat(),o=Math.min(...i),l=Math.max(...i);return[o,l]}},WC=(e,t,r,n,s)=>{var i,o;if(r.length>0&&e.forEach(l=>{r.forEach(c=>{var d,u,f=(d=n[c.id])===null||d===void 0?void 0:d.filter(y=>$C(s,y)),m=rr(l,(u=t.dataKey)!==null&&u!==void 0?u:c.dataKey),h=Z7(l,m,f);if(h.length>=2){var g=Math.min(...h),x=Math.max(...h);(i==null||g<i)&&(i=g),(o==null||x>o)&&(o=x)}var v=O0(m);v!=null&&(i=i==null?v[0]:Math.min(i,v[0]),o=o==null?v[1]:Math.max(o,v[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var c=O0(rr(l,t.dataKey));c!=null&&(i=i==null?c[0]:Math.min(i,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),Be(i)&&Be(o))return[i,o]},n9=W([wx,Nr,X7,Nx,Yt],WC,{memoizeOptions:{resultEqualityCheck:Pf}});function a9(e){var{value:t}=e;if(Un(t)||t instanceof Date)return t}var s9=(e,t,r)=>{var n=e.map(a9).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&zk(n))?k2(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},UC=e=>e.referenceElements.dots,lo=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),i9=W([UC,Yt,_f],lo),qC=e=>e.referenceElements.areas,o9=W([qC,Yt,_f],lo),HC=e=>e.referenceElements.lines,l9=W([HC,Yt,_f],lo),KC=(e,t)=>{if(e!=null){var r=wa(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},c9=W(i9,Yt,KC),YC=(e,t)=>{if(e!=null){var r=wa(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},d9=W([o9,Yt],YC);function u9(e){var t;if(e.x!=null)return wa([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:wa(r)}function f9(e){var t;if(e.y!=null)return wa([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:wa(r)}var GC=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?u9(n):f9(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},m9=W([l9,Yt],GC),h9=W(c9,m9,d9,(e,t,r)=>Wd(e,r,t)),VC=(e,t,r,n,s,i,o,l)=>{if(r!=null)return r;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",d=c?Wd(n,i,s):Wd(i,s);return C7(t,d,e.allowDataOverflow)},p9=W([Nr,FC,BC,t9,n9,h9,et,Yt],VC,{memoizeOptions:{resultEqualityCheck:Pf}}),g9=[0,1],XC=(e,t,r,n,s,i,o)=>{if(!((e==null||r==null||r.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,d=ss(t,i);if(d&&l==null){var u;return k2(0,(u=r==null?void 0:r.length)!==null&&u!==void 0?u:0)}return c==="category"?s9(n,e,d):s==="expand"?g9:o}},kx=W([Nr,et,wx,Af,Nf,Yt,p9],XC);function x9(e){return e in Bo}var QC=(e,t,r)=>{if(e!=null){var{scale:n,type:s}=e;if(n==="auto")return s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":s==="category"?"band":"linear";if(typeof n=="string"){var i="scale".concat(Gl(n));return x9(i)?i:"point"}}},co=W([Nr,PC,fx],QC);function Sx(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?C0(e.scale,r,n):C0(t,r,n)}var ZC=(e,t,r)=>{var n=jx(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&ba(e))return A7(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&ba(e))return E7(e,t.tickCount,t.allowDecimals)}},Cx=W([kx,ac,co],ZC),JC=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&ba(t)&&Array.isArray(r)&&r.length>0){var s,i,o=t[0],l=(s=r[0])!==null&&s!==void 0?s:0,c=t[1],d=(i=r[r.length-1])!==null&&i!==void 0?i:0;return[Math.min(o,l),Math.max(c,d)]}return t},v9=W([Nr,kx,Cx,Yt],JC),y9=W(Af,Nr,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(wa(e.map(f=>f.value))).sort((f,m)=>f-m),s=n[0],i=n[n.length-1];if(s==null||i==null)return 1/0;var o=i-s;if(o===0)return 1/0;for(var l=0;l<n.length-1;l++){var c=n[l],d=n[l+1];if(!(c==null||d==null)){var u=d-c;r=Math.min(r,u)}}return r/o}}),e_=W(y9,et,vC,Ht,(e,t,r,n,s)=>s,(e,t,r,n,s)=>{if(!Be(e))return 0;var i=t==="vertical"?n.height:n.width;if(s==="gap")return e*i/2;if(s==="no-gap"){var o=jn(r,e*i),l=e*i/2;return l-o-(l-o)/i*o}return 0}),b9=(e,t,r)=>{var n=Aa(e,t);return n==null||typeof n.padding!="string"?0:e_(e,"xAxis",t,r,n.padding)},w9=(e,t,r)=>{var n=Ea(e,t);return n==null||typeof n.padding!="string"?0:e_(e,"yAxis",t,r,n.padding)},j9=W(Aa,b9,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:s}=e;return typeof s=="string"?{left:t,right:t}:{left:((r=s.left)!==null&&r!==void 0?r:0)+t,right:((n=s.right)!==null&&n!==void 0?n:0)+t}}),N9=W(Ea,w9,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:s}=e;return typeof s=="string"?{top:t,bottom:t}:{top:((r=s.top)!==null&&r!==void 0?r:0)+t,bottom:((n=s.bottom)!==null&&n!==void 0?n:0)+t}}),k9=W([Ht,j9,uf,df,(e,t,r)=>r],(e,t,r,n,s)=>{var{padding:i}=n;return s?[i.left,r.width-i.right]:[e.left+t.left,e.left+e.width-t.right]}),S9=W([Ht,et,N9,uf,df,(e,t,r)=>r],(e,t,r,n,s,i)=>{var{padding:o}=s;return i?[n.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),oc=(e,t,r,n)=>{var s;switch(t){case"xAxis":return k9(e,r,n);case"yAxis":return S9(e,r,n);case"zAxis":return(s=yx(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return NC(e);case"radiusAxis":return kC(e,r);default:return}},t_=W([Nr,oc],kf),C9=W([co,v9],U7),Ef=W([Nr,co,C9,t_],Sx);W([sc,Nx,Yt],r9);function r_(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Df=(e,t)=>t,Tf=(e,t,r)=>r,_9=W(lf,Df,Tf,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(r_)),O9=W(cf,Df,Tf,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(r_)),n_=(e,t)=>({width:e.width,height:t.height}),P9=(e,t)=>{var r=typeof t.width=="number"?t.width:Ql;return{width:r,height:e.height}},a_=W(Ht,Aa,n_),M9=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},A9=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},E9=W(Oa,Ht,_9,Df,Tf,(e,t,r,n,s)=>{var i={},o;return r.forEach(l=>{var c=n_(t,l);o==null&&(o=M9(t,n,e));var d=n==="top"&&!s||n==="bottom"&&s;i[l.id]=o-Number(d)*c.height,o+=(d?-1:1)*c.height}),i}),D9=W(_a,Ht,O9,Df,Tf,(e,t,r,n,s)=>{var i={},o;return r.forEach(l=>{var c=P9(t,l);o==null&&(o=A9(t,n,e));var d=n==="left"&&!s||n==="right"&&s;i[l.id]=o-Number(d)*c.width,o+=(d?-1:1)*c.width}),i}),T9=(e,t)=>{var r=Aa(e,t);if(r!=null)return E9(e,r.orientation,r.mirror)},I9=W([Ht,Aa,T9,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r==null?void 0:r[n];return s==null?{x:e.left,y:0}:{x:e.left,y:s}}}),R9=(e,t)=>{var r=Ea(e,t);if(r!=null)return D9(e,r.orientation,r.mirror)},$9=W([Ht,Ea,R9,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r==null?void 0:r[n];return s==null?{x:0,y:e.top}:{x:s,y:e.top}}}),s_=W(Ht,Ea,(e,t)=>{var r=typeof t.width=="number"?t.width:Ql;return{width:r,height:e.height}}),P0=(e,t,r)=>{switch(t){case"xAxis":return a_(e,r).width;case"yAxis":return s_(e,r).height;default:return}},i_=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:s,type:i,dataKey:o}=r,l=ss(e,n),c=t.map(d=>d.value);if(o&&l&&i==="category"&&s&&zk(c))return c}},_x=W([et,Af,Nr,Yt],i_),o_=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:i}=r,o=ss(e,n);if(o&&(s==="number"||i!=="auto"))return t.map(l=>l.value)}},Ox=W([et,Af,ac,Yt],o_),M0=W([et,G7,co,Ef,_x,Ox,oc,Cx,Yt],(e,t,r,n,s,i,o,l,c)=>{if(t!=null){var d=ss(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:i,duplicateDomain:s,isCategorical:d,niceTicks:l,range:o,realScaleType:r,scale:n}}}),z9=(e,t,r,n,s,i,o,l,c)=>{if(!(t==null||n==null)){var d=ss(e,c),{type:u,ticks:f,tickCount:m}=t,h=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,g=u==="category"&&n.bandwidth?n.bandwidth()/h:0;g=c==="angleAxis"&&i!=null&&i.length>=2?Or(i[0]-i[1])*2*g:g;var x=f||s;return x?x.map((v,y)=>{var j=o?o.indexOf(v):v,b=n.map(j);return Be(b)?{index:y,coordinate:b+g,value:v,offset:g}:null}).filter(Pr):d&&l?l.map((v,y)=>{var j=n.map(v);return Be(j)?{coordinate:j+g,value:v,index:y,offset:g}:null}).filter(Pr):n.ticks?n.ticks(m).map((v,y)=>{var j=n.map(v);return Be(j)?{coordinate:j+g,value:v,index:y,offset:g}:null}).filter(Pr):n.domain().map((v,y)=>{var j=n.map(v);return Be(j)?{coordinate:j+g,value:o?o[v]:v,index:y,offset:g}:null}).filter(Pr)}},l_=W([et,ac,co,Ef,Cx,oc,_x,Ox,Yt],z9),L9=(e,t,r,n,s,i,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=ss(e,o),{tickCount:c}=t,d=0;return d=o==="angleAxis"&&(n==null?void 0:n.length)>=2?Or(n[0]-n[1])*2*d:d,l&&i?i.map((u,f)=>{var m=r.map(u);return Be(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter(Pr):r.ticks?r.ticks(c).map((u,f)=>{var m=r.map(u);return Be(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter(Pr):r.domain().map((u,f)=>{var m=r.map(u);return Be(m)?{coordinate:m+d,value:s?s[u]:u,index:f,offset:d}:null}).filter(Pr)}},Ri=W([et,ac,Ef,oc,_x,Ox,Yt],L9),$i=W(Nr,Ef,(e,t)=>{if(!(e==null||t==null))return Bd(Bd({},e),{},{scale:t})}),F9=W([Nr,co,kx,t_],Sx);W((e,t,r)=>yx(e,r),F9,(e,t)=>{if(!(e==null||t==null))return Bd(Bd({},e),{},{scale:t})});var B9=W([et,lf,cf],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),c_=e=>e.options.defaultTooltipEventType,d_=e=>e.options.validateTooltipEventTypes;function u_(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function Px(e,t){var r=c_(e),n=d_(e);return u_(t,r,n)}function W9(e){return _e(t=>Px(t,e))}var f_=(e,t)=>{var r,n=Number(t);if(!(Wn(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},U9=e=>e.tooltip.settings,Ba={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},q9={itemInteraction:{click:Ba,hover:Ba},axisInteraction:{click:Ba,hover:Ba},keyboardInteraction:Ba,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},m_=Tr({name:"tooltip",initialState:q9,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:lt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,s=bn(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=n)},prepare:lt()},removeTooltipEntrySettings:{reducer(e,t){var r=bn(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:lt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:H9,replaceTooltipEntrySettings:K9,removeTooltipEntrySettings:Y9,setTooltipSettingsState:G9,setActiveMouseOverItemIndex:h_,mouseLeaveItem:V9,mouseLeaveChart:p_,setActiveClickItemIndex:X9,setMouseOverAxisIndex:g_,setMouseClickAxisIndex:Q9,setSyncInteraction:Xh,setKeyboardInteraction:Qh}=m_.actions,Z9=m_.reducer;function A0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function $c(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?A0(Object(r),!0).forEach(function(n){J9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function J9(e,t,r){return(t=eU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eU(e){var t=tU(e,"string");return typeof t=="symbol"?t:t+""}function tU(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rU(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function nU(e){return e.index!=null}var x_=(e,t,r,n)=>{if(t==null)return Ba;var s=rU(e,t,r);if(s==null)return Ba;if(s.active)return s;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var i=e.settings.active===!0;if(nU(s)){if(i)return $c($c({},s),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return $c($c({},Ba),{},{coordinate:s.coordinate})};function aU(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function sU(e,t){var r=aU(e),n=t[0],s=t[1];if(r===void 0)return!1;var i=Math.min(n,s),o=Math.max(n,s);return r>=i&&r<=o}function iU(e,t,r){if(r==null||t==null)return!0;var n=rr(e,t);return n==null||!ba(r)?!0:sU(n,r)}var Mx=(e,t,r,n)=>{var s=e==null?void 0:e.index;if(s==null)return null;var i=Number(s);if(!Be(i))return s;var o=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(o,Math.min(i,l)),d=t[c];return d==null||iU(d,r,n)?String(c):null},v_=(e,t,r,n,s,i,o)=>{if(i!=null){var l=o[0],c=l==null?void 0:l.getPosition(i);if(c!=null)return c;var d=s==null?void 0:s[Number(i)];if(d)switch(r){case"horizontal":return{x:d.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:d.coordinate}}}},y_=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var s;if(r==="hover"?s=e.itemInteraction.hover.graphicalItemId:s=e.itemInteraction.click.graphicalItemId,s==null&&n!=null){var i=e.tooltipItemPayloads[0];return i!=null?[i]:[]}return e.tooltipItemPayloads.filter(o=>{var l;return((l=o.settings)===null||l===void 0?void 0:l.graphicalItemId)===s})},b_=e=>e.options.tooltipPayloadSearcher,uo=e=>e.tooltip;function E0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function D0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E0(Object(r),!0).forEach(function(n){oU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oU(e,t,r){return(t=lU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lU(e){var t=cU(e,"string");return typeof t=="symbol"?t:t+""}function cU(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dU(e,t){return e??t}var w_=(e,t,r,n,s,i,o)=>{if(!(t==null||i==null)){var{chartData:l,computedData:c,dataStartIndex:d,dataEndIndex:u}=r,f=[];return e.reduce((m,h)=>{var g,{dataDefinedOnItem:x,settings:v}=h,y=dU(x,l),j=Array.isArray(y)?WS(y,d,u):y,b=(g=v==null?void 0:v.dataKey)!==null&&g!==void 0?g:n,N=v==null?void 0:v.nameKey,k;if(n&&Array.isArray(j)&&!Array.isArray(j[0])&&o==="axis"?k=Hz(j,n,s):k=i(j,t,c,N),Array.isArray(k))k.forEach(S=>{var C=D0(D0({},v),{},{name:S.name,unit:S.unit,color:void 0,fill:void 0});m.push(By({tooltipEntrySettings:C,dataKey:S.dataKey,payload:S.payload,value:rr(S.payload,S.dataKey),name:S.name}))});else{var w;m.push(By({tooltipEntrySettings:v,dataKey:b,payload:k,value:rr(k,b),name:(w=rr(k,N))!==null&&w!==void 0?w:v==null?void 0:v.name}))}return m},f)}},Ax=W([$t,PC,fx],QC),uU=W([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),fU=W([Gt,oo],MC),fo=W([uU,$t,fU],AC,{memoizeOptions:{resultEqualityCheck:Mf}}),mU=W([fo],e=>e.filter(Of)),hU=W([fo],TC,{memoizeOptions:{resultEqualityCheck:Mf}}),mo=W([hU,Ma],IC),pU=W([mU,Ma,$t],CC),Ex=W([mo,$t,fo],RC),j_=W([$t],jx),gU=W([$t],e=>e.allowDataOverflow),N_=W([j_,gU],iC),xU=W([fo],e=>e.filter(Of)),vU=W([pU,xU,Nf,yC],zC),yU=W([vU,Ma,Gt,N_],LC),bU=W([fo],DC),wU=W([mo,$t,bU,Nx,Gt],WC,{memoizeOptions:{resultEqualityCheck:Pf}}),jU=W([UC,Gt,oo],lo),NU=W([jU,Gt],KC),kU=W([qC,Gt,oo],lo),SU=W([kU,Gt],YC),CU=W([HC,Gt,oo],lo),_U=W([CU,Gt],GC),OU=W([NU,_U,SU],Wd),PU=W([$t,j_,N_,yU,wU,OU,et,Gt],VC),lc=W([$t,et,mo,Ex,Nf,Gt,PU],XC),MU=W([lc,$t,Ax],ZC),AU=W([$t,lc,MU,Gt],JC),k_=e=>{var t=Gt(e),r=oo(e),n=!1;return oc(e,t,r,n)},S_=W([$t,k_],kf),C_=W([$t,Ax,AU,S_],Sx),EU=W([et,Ex,$t,Gt],i_),DU=W([et,Ex,$t,Gt],o_),TU=(e,t,r,n,s,i,o,l)=>{if(t){var{type:c}=t,d=ss(e,l);if(n){var u=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=c==="category"&&n.bandwidth?n.bandwidth()/u:0;return f=l==="angleAxis"&&s!=null&&(s==null?void 0:s.length)>=2?Or(s[0]-s[1])*2*f:f,d&&o?o.map((m,h)=>{var g=n.map(m);return Be(g)?{coordinate:g+f,value:m,index:h,offset:f}:null}).filter(Pr):n.domain().map((m,h)=>{var g=n.map(m);return Be(g)?{coordinate:g+f,value:i?i[m]:m,index:h,offset:f}:null}).filter(Pr)}}},Da=W([et,$t,Ax,C_,k_,EU,DU,Gt],TU),Dx=W([c_,d_,U9],(e,t,r)=>u_(r.shared,e,t)),__=e=>e.tooltip.settings.trigger,Tx=e=>e.tooltip.settings.defaultIndex,cc=W([uo,Dx,__,Tx],x_),zi=W([cc,mo,ic,lc],Mx),O_=W([Da,zi],f_),P_=W([cc],e=>{if(e)return e.dataKey});W([cc],e=>{if(e)return e.graphicalItemId});var M_=W([uo,Dx,__,Tx],y_),IU=W([_a,Oa,et,Ht,Da,Tx,M_],v_),RU=W([cc,IU],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),$U=W([cc],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),zU=W([M_,zi,Ma,ic,O_,b_,Dx],w_);W([zU],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function T0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function I0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T0(Object(r),!0).forEach(function(n){LU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LU(e,t,r){return(t=FU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FU(e){var t=BU(e,"string");return typeof t=="symbol"?t:t+""}function BU(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WU=()=>_e($t),UU=()=>{var e=WU(),t=_e(Da),r=_e(C_);return vd(!e||!r?void 0:I0(I0({},e),{},{scale:r}),t)};function R0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ci(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?R0(Object(r),!0).forEach(function(n){qU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qU(e,t,r){return(t=HU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HU(e){var t=KU(e,"string");return typeof t=="symbol"?t:t+""}function KU(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var YU=(e,t,r,n)=>{var s=t.find(i=>i&&i.index===r);if(s){if(e==="horizontal")return{x:s.coordinate,y:n.chartY};if(e==="vertical")return{x:n.chartX,y:s.coordinate}}return{x:0,y:0}},GU=(e,t,r,n)=>{var s=t.find(d=>d&&d.index===r);if(s){if(e==="centric"){var i=s.coordinate,{radius:o}=n;return ci(ci(ci({},n),tr(n.cx,n.cy,o,i)),{},{angle:i,radius:o})}var l=s.coordinate,{angle:c}=n;return ci(ci(ci({},n),tr(n.cx,n.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function VU(e,t){var{chartX:r,chartY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var A_=(e,t,r,n,s)=>{var i,o=(i=t==null?void 0:t.length)!==null&&i!==void 0?i:0;if(o<=1||e==null)return 0;if(n==="angleAxis"&&s!=null&&Math.abs(Math.abs(s[1]-s[0])-360)<=1e-6)for(var l=0;l<o;l++){var c,d,u,f,m,h=l>0?(c=r[l-1])===null||c===void 0?void 0:c.coordinate:(d=r[o-1])===null||d===void 0?void 0:d.coordinate,g=(u=r[l])===null||u===void 0?void 0:u.coordinate,x=l>=o-1?(f=r[0])===null||f===void 0?void 0:f.coordinate:(m=r[l+1])===null||m===void 0?void 0:m.coordinate,v=void 0;if(!(h==null||g==null||x==null))if(Or(g-h)!==Or(x-g)){var y=[];if(Or(x-g)===Or(s[1]-s[0])){v=x;var j=g+s[1]-s[0];y[0]=Math.min(j,(j+h)/2),y[1]=Math.max(j,(j+h)/2)}else{v=h;var b=x+s[1]-s[0];y[0]=Math.min(g,(b+g)/2),y[1]=Math.max(g,(b+g)/2)}var N=[Math.min(g,(v+g)/2),Math.max(g,(v+g)/2)];if(e>N[0]&&e<=N[1]||e>=y[0]&&e<=y[1]){var k;return(k=r[l])===null||k===void 0?void 0:k.index}}else{var w=Math.min(h,x),S=Math.max(h,x);if(e>(w+g)/2&&e<=(S+g)/2){var C;return(C=r[l])===null||C===void 0?void 0:C.index}}}else if(t)for(var P=0;P<o;P++){var M=t[P];if(M!=null){var A=t[P+1],_=t[P-1];if(P===0&&A!=null&&e<=(M.coordinate+A.coordinate)/2||P===o-1&&_!=null&&e>(M.coordinate+_.coordinate)/2||P>0&&P<o-1&&_!=null&&A!=null&&e>(M.coordinate+_.coordinate)/2&&e<=(M.coordinate+A.coordinate)/2)return M.index}}return-1},XU=()=>_e(fx),Ix=(e,t)=>t,E_=(e,t,r)=>r,Rx=(e,t,r,n)=>n,QU=W(Da,e=>Qu(e,t=>t.coordinate)),$x=W([uo,Ix,E_,Rx],x_),zx=W([$x,mo,ic,lc],Mx),ZU=(e,t,r)=>{if(t!=null){var n=uo(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},D_=W([uo,Ix,E_,Rx],y_),Ud=W([_a,Oa,et,Ht,Da,Rx,D_],v_),JU=W([$x,Ud],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),T_=W([Da,zx],f_),eq=W([D_,zx,Ma,ic,T_,b_,Ix],w_),tq=W([$x,zx],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),rq=(e,t,r,n,s,i,o)=>{if(!(!e||!r||!n||!s)&&VU(e,o)){var l=BL(e,t),c=A_(l,i,s,r,n),d=YU(t,s,c,e);return{activeIndex:String(c),activeCoordinate:d}}},nq=(e,t,r,n,s,i,o)=>{if(!(!e||!n||!s||!i||!r)){var l=H8(e,r);if(l){var c=WL(l,t),d=A_(c,o,i,n,s),u=GU(t,i,d,l);return{activeIndex:String(d),activeCoordinate:u}}}},aq=(e,t,r,n,s,i,o,l)=>{if(!(!e||!t||!n||!s||!i))return t==="horizontal"||t==="vertical"?rq(e,t,n,s,i,o,l):nq(e,t,r,n,s,i,o)},sq=W(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),iq=W(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(vr)),r=Array.from(new Set(t));return r.sort((n,s)=>n-s)},{memoizeOptions:{resultEqualityCheck:B7}});function $0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function z0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$0(Object(r),!0).forEach(function(n){oq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oq(e,t,r){return(t=lq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lq(e){var t=cq(e,"string");return typeof t=="symbol"?t:t+""}function cq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dq={},uq={zIndexMap:Object.values(vr).reduce((e,t)=>z0(z0({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),dq)},fq=new Set(Object.values(vr));function mq(e){return fq.has(e)}var I_=Tr({name:"zIndex",initialState:uq,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:lt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!mq(r)&&delete e.zIndexMap[r])},prepare:lt()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:s}=t.payload;e.zIndexMap[r]?s?e.zIndexMap[r].panoramaElement=n:e.zIndexMap[r].element=n:e.zIndexMap[r]={consumers:0,element:s?void 0:n,panoramaElement:s?n:void 0}},prepare:lt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:lt()}}}),{registerZIndexPortal:hq,unregisterZIndexPortal:pq,registerZIndexPortalElement:gq,unregisterZIndexPortalElement:xq}=I_.actions,vq=I_.reducer;function Ta(e){var{zIndex:t,children:r}=e,n=gF(),s=n&&t!==void 0&&t!==0,i=Ir(),o=St();p.useLayoutEffect(()=>s?(o(hq({zIndex:t})),()=>{o(pq({zIndex:t}))}):ro,[o,t,s]);var l=_e(c=>sq(c,t,i));return s?l?pp.createPortal(r,l):null:r}function Zh(){return Zh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zh.apply(null,arguments)}function L0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function zc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L0(Object(r),!0).forEach(function(n){yq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yq(e,t,r){return(t=bq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bq(e){var t=wq(e,"string");return typeof t=="symbol"?t:t+""}function wq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jq(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return p.isValidElement(t)?p.cloneElement(t,n):p.createElement(r,n)}function Nq(e){var t,{coordinate:r,payload:n,index:s,offset:i,tooltipAxisBandSize:o,layout:l,cursor:c,tooltipEventType:d,chartName:u}=e,f=r,m=n,h=s;if(!c||!f||u!=="ScatterChart"&&d!=="axis")return null;var g,x,v;if(u==="ScatterChart")g=f,x=a8,v=vr.cursorLine;else if(u==="BarChart")g=s8(l,f,i,o),x=x2,v=vr.cursorRectangle;else if(l==="radial"&&Bk(f)){var{cx:y,cy:j,radius:b,startAngle:N,endAngle:k}=v2(f);g={cx:y,cy:j,startAngle:N,endAngle:k,innerRadius:b,outerRadius:b},x=b2,v=vr.cursorLine}else g={points:V8(l,f,i)},x=f2,v=vr.cursorLine;var w=typeof c=="object"&&"className"in c?c.className:void 0,S=zc(zc(zc(zc({stroke:"#ccc",pointerEvents:"none"},i),g),ug(c)),{},{payload:m,payloadIndex:h,className:Je("recharts-tooltip-cursor",w)});return p.createElement(Ta,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:v},p.createElement(jq,{cursor:c,cursorComp:x,cursorProps:S}))}function kq(e){var t=UU(),r=JS(),n=no(),s=XU();return t==null||r==null||n==null||s==null?null:p.createElement(Nq,Zh({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:s}))}var R_=p.createContext(null),Sq=()=>p.useContext(R_),$_={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(c,d,u){this.fn=c,this.context=d,this.once=u||!1}function i(c,d,u,f,m){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new s(u,f||c,m),g=r?r+d:d;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],h]:c._events[g].push(h):(c._events[g]=h,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new n:delete c._events[d]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],u,f;if(this._eventsCount===0)return d;for(f in u=this._events)t.call(u,f)&&d.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(u)):d},l.prototype.listeners=function(d){var u=r?r+d:d,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var m=0,h=f.length,g=new Array(h);m<h;m++)g[m]=f[m].fn;return g},l.prototype.listenerCount=function(d){var u=r?r+d:d,f=this._events[u];return f?f.fn?1:f.length:0},l.prototype.emit=function(d,u,f,m,h,g){var x=r?r+d:d;if(!this._events[x])return!1;var v=this._events[x],y=arguments.length,j,b;if(v.fn){switch(v.once&&this.removeListener(d,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,u),!0;case 3:return v.fn.call(v.context,u,f),!0;case 4:return v.fn.call(v.context,u,f,m),!0;case 5:return v.fn.call(v.context,u,f,m,h),!0;case 6:return v.fn.call(v.context,u,f,m,h,g),!0}for(b=1,j=new Array(y-1);b<y;b++)j[b-1]=arguments[b];v.fn.apply(v.context,j)}else{var N=v.length,k;for(b=0;b<N;b++)switch(v[b].once&&this.removeListener(d,v[b].fn,void 0,!0),y){case 1:v[b].fn.call(v[b].context);break;case 2:v[b].fn.call(v[b].context,u);break;case 3:v[b].fn.call(v[b].context,u,f);break;case 4:v[b].fn.call(v[b].context,u,f,m);break;default:if(!j)for(k=1,j=new Array(y-1);k<y;k++)j[k-1]=arguments[k];v[b].fn.apply(v[b].context,j)}}return!0},l.prototype.on=function(d,u,f){return i(this,d,u,f,!1)},l.prototype.once=function(d,u,f){return i(this,d,u,f,!0)},l.prototype.removeListener=function(d,u,f,m){var h=r?r+d:d;if(!this._events[h])return this;if(!u)return o(this,h),this;var g=this._events[h];if(g.fn)g.fn===u&&(!m||g.once)&&(!f||g.context===f)&&o(this,h);else{for(var x=0,v=[],y=g.length;x<y;x++)(g[x].fn!==u||m&&!g[x].once||f&&g[x].context!==f)&&v.push(g[x]);v.length?this._events[h]=v.length===1?v[0]:v:o(this,h)}return this},l.prototype.removeAllListeners=function(d){var u;return d?(u=r?r+d:d,this._events[u]&&o(this,u)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})($_);var Cq=$_.exports;const _q=Na(Cq);var ml=new _q,Jh="recharts.syncEvent.tooltip",F0="recharts.syncEvent.brush",Oq=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Wn(r))return e[r]}},Pq={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},z_=Tr({name:"options",initialState:Pq,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Mq=z_.reducer,{createEventEmitter:Aq}=z_.actions;function Eq(e){return e.tooltip.syncInteraction}var Dq={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},L_=Tr({name:"chartData",initialState:Dq,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:B0,setDataStartEndIndexes:Tq,setComputedData:BJ}=L_.actions,Iq=L_.reducer,Rq=["x","y"];function W0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function di(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W0(Object(r),!0).forEach(function(n){$q(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $q(e,t,r){return(t=zq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zq(e){var t=Lq(e,"string");return typeof t=="symbol"?t:t+""}function Lq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fq(e,t){if(e==null)return{};var r,n,s=Bq(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Bq(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Wq(){var e=_e(mx),t=_e(hx),r=St(),n=_e(bC),s=_e(Da),i=no(),o=ff(),l=_e(c=>c.rootProps.className);p.useEffect(()=>{if(e==null)return ro;var c=(d,u,f)=>{if(t!==f&&e===d){if(n==="index"){var m;if(o&&u!==null&&u!==void 0&&(m=u.payload)!==null&&m!==void 0&&m.coordinate&&u.payload.sourceViewBox){var h=u.payload.coordinate,{x:g,y:x}=h,v=Fq(h,Rq),{x:y,y:j,width:b,height:N}=u.payload.sourceViewBox,k=di(di({},v),{},{x:o.x+(b?(g-y)/b:0)*o.width,y:o.y+(N?(x-j)/N:0)*o.height});r(di(di({},u),{},{payload:di(di({},u.payload),{},{coordinate:k})}))}else r(u);return}if(s!=null){var w;if(typeof n=="function"){var S={activeTooltipIndex:u.payload.index==null?void 0:Number(u.payload.index),isTooltipActive:u.payload.active,activeIndex:u.payload.index==null?void 0:Number(u.payload.index),activeLabel:u.payload.label,activeDataKey:u.payload.dataKey,activeCoordinate:u.payload.coordinate},C=n(s,S);w=s[C]}else n==="value"&&(w=s.find(F=>String(F.value)===u.payload.label));var{coordinate:P}=u.payload;if(w==null||u.payload.active===!1||P==null||o==null){r(Xh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:M,y:A}=P,_=Math.min(M,o.x+o.width),D=Math.min(A,o.y+o.height),O={x:i==="horizontal"?w.coordinate:_,y:i==="horizontal"?D:w.coordinate},R=Xh({active:u.payload.active,coordinate:O,dataKey:u.payload.dataKey,index:String(w.index),label:u.payload.label,sourceViewBox:u.payload.sourceViewBox,graphicalItemId:u.payload.graphicalItemId});r(R)}}};return ml.on(Jh,c),()=>{ml.off(Jh,c)}},[l,r,t,e,n,s,i,o])}function Uq(){var e=_e(mx),t=_e(hx),r=St();p.useEffect(()=>{if(e==null)return ro;var n=(s,i,o)=>{t!==o&&e===s&&r(Tq(i))};return ml.on(F0,n),()=>{ml.off(F0,n)}},[r,t,e])}function qq(){var e=St();p.useEffect(()=>{e(Aq())},[e]),Wq(),Uq()}function Hq(e,t,r,n,s,i){var o=_e(h=>ZU(h,e,t)),l=_e(hx),c=_e(mx),d=_e(bC),u=_e(Eq),f=u==null?void 0:u.active,m=ff();p.useEffect(()=>{if(!f&&c!=null&&l!=null){var h=Xh({active:i,coordinate:r,dataKey:o,index:s,label:typeof n=="number"?String(n):n,sourceViewBox:m,graphicalItemId:void 0});ml.emit(Jh,c,h,l)}},[f,r,o,s,n,l,c,d,i,m])}function U0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function q0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?U0(Object(r),!0).forEach(function(n){Kq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kq(e,t,r){return(t=Yq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yq(e){var t=Gq(e,"string");return typeof t=="symbol"?t:t+""}function Gq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vq(e){return e.dataKey}function Xq(e,t){return p.isValidElement(e)?p.cloneElement(e,t):typeof e=="function"?p.createElement(e,t):p.createElement($F,t)}var H0=[],Qq={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function qd(e){var t,r,n=Yr(e,Qq),{active:s,allowEscapeViewBox:i,animationDuration:o,animationEasing:l,content:c,filterNull:d,isAnimationActive:u,offset:f,payloadUniqBy:m,position:h,reverseDirection:g,useTranslate3d:x,wrapperStyle:v,cursor:y,shared:j,trigger:b,defaultIndex:N,portal:k,axisId:w}=n,S=St(),C=typeof N=="number"?String(N):N;p.useEffect(()=>{S(G9({shared:j,trigger:b,axisId:w,active:s,defaultIndex:C}))},[S,j,b,w,s,C]);var P=ff(),M=u2(),A=W9(j),{activeIndex:_,isActive:D}=(t=_e(K=>tq(K,A,b,C)))!==null&&t!==void 0?t:{},O=_e(K=>eq(K,A,b,C)),R=_e(K=>T_(K,A,b,C)),F=_e(K=>JU(K,A,b,C)),H=O,ne=Sq(),G=(r=s??D)!==null&&r!==void 0?r:!1,[oe,ce]=C6([H,G]),B=A==="axis"?R:void 0;Hq(A,b,F,B,_,G);var Y=k??ne;if(Y==null||P==null||A==null)return null;var U=H??H0;G||(U=H0),d&&U.length&&(U=c6(U.filter(K=>K.value!=null&&(K.hide!==!0||n.includeHidden)),m,Vq));var X=U.length>0,$=p.createElement(qF,{allowEscapeViewBox:i,animationDuration:o,animationEasing:l,isAnimationActive:u,active:G,coordinate:F,hasPayload:X,offset:f,position:h,reverseDirection:g,useTranslate3d:x,viewBox:P,wrapperStyle:v,lastBoundingBox:oe,innerRef:ce,hasPortalFromProps:!!k},Xq(c,q0(q0({},n),{},{payload:U,label:B,active:G,activeIndex:_,coordinate:F,accessibilityLayer:M})));return p.createElement(p.Fragment,null,pp.createPortal($,Y),G&&p.createElement(kq,{cursor:y,tooltipEventType:A,coordinate:F,payload:U,index:_}))}var F_=e=>null;F_.displayName="Cell";function Zq(e,t,r){return(t=Jq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jq(e){var t=eH(e,"string");return typeof t=="symbol"?t:t+""}function eH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class tH{constructor(t){Zq(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function K0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function rH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?K0(Object(r),!0).forEach(function(n){nH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nH(e,t,r){return(t=aH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aH(e){var t=sH(e,"string");return typeof t=="symbol"?t:t+""}function sH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iH={cacheSize:2e3,enableCache:!0},B_=rH({},iH),Y0=new tH(B_.cacheSize),oH={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},G0="recharts_measurement_span";function lH(e,t){var r=t.fontSize||"",n=t.fontFamily||"",s=t.fontWeight||"",i=t.fontStyle||"",o=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(s,"|").concat(i,"|").concat(o,"|").concat(l)}var V0=(e,t)=>{try{var r=document.getElementById(G0);r||(r=document.createElement("span"),r.setAttribute("id",G0),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,oH,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},Yo=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||gf.isSsr)return{width:0,height:0};if(!B_.enableCache)return V0(t,r);var n=lH(t,r),s=Y0.get(n);if(s)return s;var i=V0(t,r);return Y0.set(n,i),i},W_;function cH(e,t,r){return(t=dH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dH(e){var t=uH(e,"string");return typeof t=="symbol"?t:t+""}function uH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var X0=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Q0=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,fH=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,mH=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,hH={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},pH=["cm","mm","pt","pc","in","Q","px"];function gH(e){return pH.includes(e)}var gi="NaN";function xH(e,t){return e*hH[t]}class Jt{static parse(t){var r,[,n,s]=(r=mH.exec(t))!==null&&r!==void 0?r:[];return n==null?Jt.NaN:new Jt(parseFloat(n),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Wn(t)&&(this.unit=""),r!==""&&!fH.test(r)&&(this.num=NaN,this.unit=""),gH(r)&&(this.num=xH(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Wn(this.num)}}W_=Jt;cH(Jt,"NaN",new W_(NaN,""));function U_(e){if(e==null||e.includes(gi))return gi;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,s,i]=(r=X0.exec(t))!==null&&r!==void 0?r:[],o=Jt.parse(n??""),l=Jt.parse(i??""),c=s==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return gi;t=t.replace(X0,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,u,f,m]=(d=Q0.exec(t))!==null&&d!==void 0?d:[],h=Jt.parse(u??""),g=Jt.parse(m??""),x=f==="+"?h.add(g):h.subtract(g);if(x.isNaN())return gi;t=t.replace(Q0,x.toString())}return t}var Z0=/\(([^()]*)\)/;function vH(e){for(var t=e,r;(r=Z0.exec(t))!=null;){var[,n]=r;t=t.replace(Z0,U_(n))}return t}function yH(e){var t=e.replace(/\s+/g,"");return t=vH(t),t=U_(t),t}function bH(e){try{return yH(e)}catch{return gi}}function zm(e){var t=bH(e.slice(5,-1));return t===gi?"":t}var wH=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],jH=["dx","dy","angle","className","breakAll"];function ep(){return ep=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ep.apply(null,arguments)}function J0(e,t){if(e==null)return{};var r,n,s=NH(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function NH(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var q_=/[ \f\n\r\t\v\u2028\u2029]+/,H_=e=>{var{children:t,breakAll:r,style:n}=e;try{var s=[];Ut(t)||(r?s=t.toString().split(""):s=t.toString().split(q_));var i=s.map(l=>({word:l,width:Yo(l,n).width})),o=r?0:Yo(" ",n).width;return{wordsWithComputedWidth:i,spaceWidth:o}}catch{return null}};function kH(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var K_=(e,t,r,n)=>e.reduce((s,i)=>{var{word:o,width:l}=i,c=s[s.length-1];if(c&&l!=null&&(t==null||n||c.width+l+r<Number(t)))c.words.push(o),c.width+=l+r;else{var d={words:[o],width:l};s.push(d)}return s},[]),Y_=e=>e.reduce((t,r)=>t.width>r.width?t:r),SH="…",ew=(e,t,r,n,s,i,o,l)=>{var c=e.slice(0,t),d=H_({breakAll:r,style:n,children:c+SH});if(!d)return[!1,[]];var u=K_(d.wordsWithComputedWidth,i,o,l),f=u.length>s||Y_(u).width>Number(i);return[f,u]},CH=(e,t,r,n,s)=>{var{maxLines:i,children:o,style:l,breakAll:c}=e,d=xe(i),u=String(o),f=K_(t,n,r,s);if(!d||s)return f;var m=f.length>i||Y_(f).width>Number(n);if(!m)return f;for(var h=0,g=u.length-1,x=0,v;h<=g&&x<=u.length-1;){var y=Math.floor((h+g)/2),j=y-1,[b,N]=ew(u,j,c,l,i,n,r,s),[k]=ew(u,y,c,l,i,n,r,s);if(!b&&!k&&(h=y+1),b&&k&&(g=y-1),!b&&k){v=N;break}x++}return v||f},tw=e=>{var t=Ut(e)?[]:e.toString().split(q_);return[{words:t,width:void 0}]},_H=e=>{var{width:t,scaleToFit:r,children:n,style:s,breakAll:i,maxLines:o}=e;if((t||r)&&!gf.isSsr){var l,c,d=H_({breakAll:i,children:n,style:s});if(d){var{wordsWithComputedWidth:u,spaceWidth:f}=d;l=u,c=f}else return tw(n);return CH({breakAll:i,children:n,maxLines:o,style:s},l,c,t,!!r)}return tw(n)},G_="#808080",OH={angle:0,breakAll:!1,capHeight:"0.71em",fill:G_,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Lx=p.forwardRef((e,t)=>{var r=Yr(e,OH),{x:n,y:s,lineHeight:i,capHeight:o,fill:l,scaleToFit:c,textAnchor:d,verticalAnchor:u}=r,f=J0(r,wH),m=p.useMemo(()=>_H({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:h,dy:g,angle:x,className:v,breakAll:y}=f,j=J0(f,jH);if(!Un(n)||!Un(s)||m.length===0)return null;var b=Number(n)+(xe(h)?h:0),N=Number(s)+(xe(g)?g:0);if(!Be(b)||!Be(N))return null;var k;switch(u){case"start":k=zm("calc(".concat(o,")"));break;case"middle":k=zm("calc(".concat((m.length-1)/2," * -").concat(i," + (").concat(o," / 2))"));break;default:k=zm("calc(".concat(m.length-1," * -").concat(i,")"));break}var w=[],S=m[0];if(c&&S!=null){var C=S.width,{width:P}=f;w.push("scale(".concat(xe(P)&&xe(C)?P/C:1,")"))}return x&&w.push("rotate(".concat(x,", ").concat(b,", ").concat(N,")")),w.length&&(j.transform=w.join(" ")),p.createElement("text",ep({},an(j),{ref:t,x:b,y:N,className:Je("recharts-text",v),textAnchor:d,fill:l.includes("url")?G_:l}),m.map((M,A)=>{var _=M.words.join(y?"":" ");return p.createElement("tspan",{x:b,dy:A===0?k:i,key:"".concat(_,"-").concat(A)},_)}))});Lx.displayName="Text";function rw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Dn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rw(Object(r),!0).forEach(function(n){PH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PH(e,t,r){return(t=MH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MH(e){var t=AH(e,"string");return typeof t=="symbol"?t:t+""}function AH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EH=e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:s}=e,{x:i,y:o,height:l,upperWidth:c,lowerWidth:d}=Rg(t),u=i,f=i+(c-d)/2,m=(u+f)/2,h=(c+d)/2,g=u+c/2,x=l>=0?1:-1,v=x*n,y=x>0?"end":"start",j=x>0?"start":"end",b=c>=0?1:-1,N=b*n,k=b>0?"end":"start",w=b>0?"start":"end",S=s;if(r==="top"){var C={x:u+c/2,y:o-v,horizontalAnchor:"middle",verticalAnchor:y};return S&&(C.height=Math.max(o-S.y,0),C.width=c),C}if(r==="bottom"){var P={x:f+d/2,y:o+l+v,horizontalAnchor:"middle",verticalAnchor:j};return S&&(P.height=Math.max(S.y+S.height-(o+l),0),P.width=d),P}if(r==="left"){var M={x:m-N,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"};return S&&(M.width=Math.max(M.x-S.x,0),M.height=l),M}if(r==="right"){var A={x:m+h+N,y:o+l/2,horizontalAnchor:w,verticalAnchor:"middle"};return S&&(A.width=Math.max(S.x+S.width-A.x,0),A.height=l),A}var _=S?{width:h,height:l}:{};return r==="insideLeft"?Dn({x:m+N,y:o+l/2,horizontalAnchor:w,verticalAnchor:"middle"},_):r==="insideRight"?Dn({x:m+h-N,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"},_):r==="insideTop"?Dn({x:u+c/2,y:o+v,horizontalAnchor:"middle",verticalAnchor:j},_):r==="insideBottom"?Dn({x:f+d/2,y:o+l-v,horizontalAnchor:"middle",verticalAnchor:y},_):r==="insideTopLeft"?Dn({x:u+N,y:o+v,horizontalAnchor:w,verticalAnchor:j},_):r==="insideTopRight"?Dn({x:u+c-N,y:o+v,horizontalAnchor:k,verticalAnchor:j},_):r==="insideBottomLeft"?Dn({x:f+N,y:o+l-v,horizontalAnchor:w,verticalAnchor:y},_):r==="insideBottomRight"?Dn({x:f+d-N,y:o+l-v,horizontalAnchor:k,verticalAnchor:y},_):r&&typeof r=="object"&&(xe(r.x)||Ls(r.x))&&(xe(r.y)||Ls(r.y))?Dn({x:i+jn(r.x,h),y:o+jn(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},_):Dn({x:g,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},_)},DH=["labelRef"],TH=["content"];function nw(e,t){if(e==null)return{};var r,n,s=IH(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function IH(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function aw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Wo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aw(Object(r),!0).forEach(function(n){RH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RH(e,t,r){return(t=$H(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $H(e){var t=zH(e,"string");return typeof t=="symbol"?t:t+""}function zH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sa(){return sa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sa.apply(null,arguments)}var V_=p.createContext(null),LH=e=>{var{x:t,y:r,upperWidth:n,lowerWidth:s,width:i,height:o,children:l}=e,c=p.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:s,width:i,height:o}),[t,r,n,s,i,o]);return p.createElement(V_.Provider,{value:c},l)},X_=()=>{var e=p.useContext(V_),t=ff();return e||(t?Rg(t):void 0)},FH=p.createContext(null),BH=()=>{var e=p.useContext(FH),t=_e(SC);return e||t},WH=e=>{var{value:t,formatter:r}=e,n=Ut(e.children)?t:e.children;return typeof r=="function"?r(n):n},Fx=e=>e!=null&&typeof e=="function",UH=(e,t)=>{var r=Or(t-e),n=Math.min(Math.abs(t-e),360);return r*n},qH=(e,t,r,n,s)=>{var{offset:i,className:o}=e,{cx:l,cy:c,innerRadius:d,outerRadius:u,startAngle:f,endAngle:m,clockWise:h}=s,g=(d+u)/2,x=UH(f,m),v=x>=0?1:-1,y,j;switch(t){case"insideStart":y=f+v*i,j=h;break;case"insideEnd":y=m-v*i,j=!h;break;case"end":y=m+v*i,j=h;break;default:throw new Error("Unsupported position ".concat(t))}j=x<=0?j:!j;var b=tr(l,c,g,y),N=tr(l,c,g,y+(j?1:-1)*359),k="M".concat(b.x,",").concat(b.y,`
|
|
573
|
-
A`).concat(g,",").concat(g,",0,1,").concat(j?0:1,`,
|
|
574
|
-
`).concat(N.x,",").concat(N.y),w=Ut(e.id)?el("recharts-radial-line-"):e.id;return p.createElement("text",sa({},n,{dominantBaseline:"central",className:Je("recharts-radial-bar-label",o)}),p.createElement("defs",null,p.createElement("path",{id:w,d:k})),p.createElement("textPath",{xlinkHref:"#".concat(w)},r))},HH=(e,t,r)=>{var{cx:n,cy:s,innerRadius:i,outerRadius:o,startAngle:l,endAngle:c}=e,d=(l+c)/2;if(r==="outside"){var{x:u,y:f}=tr(n,s,o+t,d);return{x:u,y:f,textAnchor:u>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"end"};var m=(i+o)/2,{x:h,y:g}=tr(n,s,m,d);return{x:h,y:g,textAnchor:"middle",verticalAnchor:"middle"}},Qc=e=>e!=null&&"cx"in e&&xe(e.cx),KH={angle:0,offset:5,zIndex:vr.label,position:"middle",textBreakAll:!1};function YH(e){if(!Qc(e))return e;var{cx:t,cy:r,outerRadius:n}=e,s=n*2;return{x:t-n,y:r-n,width:s,upperWidth:s,lowerWidth:s,height:s}}function Fa(e){var t=Yr(e,KH),{viewBox:r,parentViewBox:n,position:s,value:i,children:o,content:l,className:c="",textBreakAll:d,labelRef:u}=t,f=BH(),m=X_(),h=s==="center"?m:f??m,g,x,v;r==null?g=h:Qc(r)?g=r:g=Rg(r);var y=YH(g);if(!g||Ut(i)&&Ut(o)&&!p.isValidElement(l)&&typeof l!="function")return null;var j=Wo(Wo({},t),{},{viewBox:g});if(p.isValidElement(l)){var{labelRef:b}=j,N=nw(j,DH);return p.cloneElement(l,N)}if(typeof l=="function"){var{content:k}=j,w=nw(j,TH);if(x=p.createElement(l,w),p.isValidElement(x))return x}else x=WH(t);var S=an(t);if(Qc(g)){if(s==="insideStart"||s==="insideEnd"||s==="end")return qH(t,s,x,S,g);v=HH(g,t.offset,t.position)}else{if(!y)return null;var C=EH({viewBox:y,position:s,offset:t.offset,parentViewBox:Qc(n)?void 0:n});v=Wo(Wo({x:C.x,y:C.y,textAnchor:C.horizontalAnchor,verticalAnchor:C.verticalAnchor},C.width!==void 0?{width:C.width}:{}),C.height!==void 0?{height:C.height}:{})}return p.createElement(Ta,{zIndex:t.zIndex},p.createElement(Lx,sa({ref:u,className:Je("recharts-label",c)},S,v,{textAnchor:kH(S.textAnchor)?S.textAnchor:v.textAnchor,breakAll:d}),x))}Fa.displayName="Label";var GH=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?p.createElement(Fa,sa({key:"label-implicit"},n)):Un(e)?p.createElement(Fa,sa({key:"label-implicit",value:e},n)):p.isValidElement(e)?e.type===Fa?p.cloneElement(e,Wo({key:"label-implicit"},n)):p.createElement(Fa,sa({key:"label-implicit",content:e},n)):Fx(e)?p.createElement(Fa,sa({key:"label-implicit",content:e},n)):e&&typeof e=="object"?p.createElement(Fa,sa({},e,{key:"label-implicit"},n)):null};function VH(e){var{label:t,labelRef:r}=e,n=X_();return GH(t,n,r)||null}var Q_={},Z_={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(Z_);var J_={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(J_);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Z_,r=J_,n=Vu;function s(i){if(n.isArrayLike(i))return t.last(r.toArray(i))}e.last=s})(Q_);var XH=Q_.last;const QH=Na(XH);var ZH=["valueAccessor"],JH=["dataKey","clockWise","id","textBreakAll","zIndex"];function Hd(){return Hd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hd.apply(null,arguments)}function sw(e,t){if(e==null)return{};var r,n,s=eK(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function eK(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var tK=e=>Array.isArray(e.value)?QH(e.value):e.value,eO=p.createContext(void 0),rK=eO.Provider,tO=p.createContext(void 0);tO.Provider;function nK(){return p.useContext(eO)}function aK(){return p.useContext(tO)}function Zc(e){var{valueAccessor:t=tK}=e,r=sw(e,ZH),{dataKey:n,clockWise:s,id:i,textBreakAll:o,zIndex:l}=r,c=sw(r,JH),d=nK(),u=aK(),f=d||u;return!f||!f.length?null:p.createElement(Ta,{zIndex:l??vr.label},p.createElement(pa,{className:"recharts-label-list"},f.map((m,h)=>{var g,x=Ut(n)?t(m,h):rr(m.payload,n),v=Ut(i)?{}:{id:"".concat(i,"-").concat(h)};return p.createElement(Fa,Hd({key:"label-".concat(h)},an(m),c,v,{fill:(g=r.fill)!==null&&g!==void 0?g:m.fill,parentViewBox:m.parentViewBox,value:x,textBreakAll:o,viewBox:m.viewBox,index:h,zIndex:0}))})))}Zc.displayName="LabelList";function sK(e){var{label:t}=e;return t?t===!0?p.createElement(Zc,{key:"labelList-implicit"}):p.isValidElement(t)||Fx(t)?p.createElement(Zc,{key:"labelList-implicit",content:t}):typeof t=="object"?p.createElement(Zc,Hd({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var iK={radiusAxis:{},angleAxis:{}},rO=Tr({name:"polarAxis",initialState:iK,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:WJ,removeRadiusAxis:UJ,addAngleAxis:qJ,removeAngleAxis:HJ}=rO.actions,oK=rO.reducer;function lK(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var nO={exports:{}},tt={};/**
|
|
575
|
-
* @license React
|
|
576
|
-
* react-is.production.js
|
|
577
|
-
*
|
|
578
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
579
|
-
*
|
|
580
|
-
* This source code is licensed under the MIT license found in the
|
|
581
|
-
* LICENSE file in the root directory of this source tree.
|
|
582
|
-
*/var Bx=Symbol.for("react.transitional.element"),Wx=Symbol.for("react.portal"),If=Symbol.for("react.fragment"),Rf=Symbol.for("react.strict_mode"),$f=Symbol.for("react.profiler"),zf=Symbol.for("react.consumer"),Lf=Symbol.for("react.context"),Ff=Symbol.for("react.forward_ref"),Bf=Symbol.for("react.suspense"),Wf=Symbol.for("react.suspense_list"),Uf=Symbol.for("react.memo"),qf=Symbol.for("react.lazy"),cK=Symbol.for("react.view_transition"),dK=Symbol.for("react.client.reference");function un(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Bx:switch(e=e.type,e){case If:case $f:case Rf:case Bf:case Wf:case cK:return e;default:switch(e=e&&e.$$typeof,e){case Lf:case Ff:case qf:case Uf:return e;case zf:return e;default:return t}}case Wx:return t}}}tt.ContextConsumer=zf;tt.ContextProvider=Lf;tt.Element=Bx;tt.ForwardRef=Ff;tt.Fragment=If;tt.Lazy=qf;tt.Memo=Uf;tt.Portal=Wx;tt.Profiler=$f;tt.StrictMode=Rf;tt.Suspense=Bf;tt.SuspenseList=Wf;tt.isContextConsumer=function(e){return un(e)===zf};tt.isContextProvider=function(e){return un(e)===Lf};tt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Bx};tt.isForwardRef=function(e){return un(e)===Ff};tt.isFragment=function(e){return un(e)===If};tt.isLazy=function(e){return un(e)===qf};tt.isMemo=function(e){return un(e)===Uf};tt.isPortal=function(e){return un(e)===Wx};tt.isProfiler=function(e){return un(e)===$f};tt.isStrictMode=function(e){return un(e)===Rf};tt.isSuspense=function(e){return un(e)===Bf};tt.isSuspenseList=function(e){return un(e)===Wf};tt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===If||e===$f||e===Rf||e===Bf||e===Wf||typeof e=="object"&&e!==null&&(e.$$typeof===qf||e.$$typeof===Uf||e.$$typeof===Lf||e.$$typeof===zf||e.$$typeof===Ff||e.$$typeof===dK||e.getModuleId!==void 0)};tt.typeOf=un;nO.exports=tt;var uK=nO.exports,iw=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",ow=null,Lm=null,aO=e=>{if(e===ow&&Array.isArray(Lm))return Lm;var t=[];return p.Children.forEach(e,r=>{Ut(r)||(uK.isFragment(r)?t=t.concat(aO(r.props.children)):t.push(r))}),Lm=t,ow=e,t};function fK(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(s=>iw(s)):n=[iw(t)],aO(e).forEach(s=>{var i=Mi(s,"type.displayName")||Mi(s,"type.name");i&&n.indexOf(i)!==-1&&r.push(s)}),r}var sO={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var s;if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const i=r[Symbol.toStringTag];return i==null||!((s=Object.getOwnPropertyDescriptor(r,Symbol.toStringTag))!=null&&s.writable)?!1:r.toString()===`[object ${i}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(sO);var mK=sO.isPlainObject;const hK=Na(mK);var lw,cw,dw,uw,fw;function mw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function hw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mw(Object(r),!0).forEach(function(n){pK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pK(e,t,r){return(t=gK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gK(e){var t=xK(e,"string");return typeof t=="symbol"?t:t+""}function xK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kd.apply(null,arguments)}function $o(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var pw=(e,t,r,n,s)=>{var i=r-n,o;return o=vt(lw||(lw=$o(["M ",",",""])),e,t),o+=vt(cw||(cw=$o(["L ",",",""])),e+r,t),o+=vt(dw||(dw=$o(["L ",",",""])),e+r-i/2,t+s),o+=vt(uw||(uw=$o(["L ",",",""])),e+r-i/2-n,t+s),o+=vt(fw||(fw=$o(["L ",","," Z"])),e,t),o},vK={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},yK=e=>{var t=Yr(e,vK),{x:r,y:n,upperWidth:s,lowerWidth:i,height:o,className:l}=t,{animationEasing:c,animationDuration:d,animationBegin:u,isUpdateAnimationActive:f}=t,m=p.useRef(null),[h,g]=p.useState(-1),x=p.useRef(s),v=p.useRef(i),y=p.useRef(o),j=p.useRef(r),b=p.useRef(n),N=Fg(e,"trapezoid-");if(p.useEffect(()=>{if(m.current&&m.current.getTotalLength)try{var O=m.current.getTotalLength();O&&g(O)}catch{}},[]),r!==+r||n!==+n||s!==+s||i!==+i||o!==+o||s===0&&i===0||o===0)return null;var k=Je("recharts-trapezoid",l);if(!f)return p.createElement("g",null,p.createElement("path",Kd({},an(t),{className:k,d:pw(r,n,s,i,o)})));var w=x.current,S=v.current,C=y.current,P=j.current,M=b.current,A="0px ".concat(h===-1?1:h,"px"),_="".concat(h,"px 0px"),D=m2(["strokeDasharray"],d,c);return p.createElement(Lg,{animationId:N,key:N,canBegin:h>0,duration:d,easing:c,isActive:f,begin:u},O=>{var R=er(w,s,O),F=er(S,i,O),H=er(C,o,O),ne=er(P,r,O),G=er(M,n,O);m.current&&(x.current=R,v.current=F,y.current=H,j.current=ne,b.current=G);var oe=O>0?{transition:D,strokeDasharray:_}:{strokeDasharray:A};return p.createElement("path",Kd({},an(t),{className:k,d:pw(ne,G,R,F,H),ref:m,style:hw(hw({},oe),t.style)}))})},bK=["option","shapeType","activeClassName"];function wK(e,t){if(e==null)return{};var r,n,s=jK(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function jK(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function gw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Yd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gw(Object(r),!0).forEach(function(n){NK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NK(e,t,r){return(t=kK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kK(e){var t=SK(e,"string");return typeof t=="symbol"?t:t+""}function SK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CK(e,t){return Yd(Yd({},t),e)}function _K(e,t){return e==="symbols"}function xw(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return p.createElement(x2,r);case"trapezoid":return p.createElement(yK,r);case"sector":return p.createElement(b2,r);case"symbols":if(_K(t))return p.createElement(Fk,r);break;case"curve":return p.createElement(f2,r);default:return null}}function OK(e){return p.isValidElement(e)?e.props:e}function PK(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape"}=e,s=wK(e,bK),i;if(p.isValidElement(t))i=p.cloneElement(t,Yd(Yd({},s),OK(t)));else if(typeof t=="function")i=t(s,s.index);else if(hK(t)&&typeof t!="boolean"){var o=CK(t,s);i=p.createElement(xw,{shapeType:r,elementProps:o})}else{var l=s;i=p.createElement(xw,{shapeType:r,elementProps:l})}return s.isActive?p.createElement(pa,{className:n},i):i}var iO=(e,t,r)=>{var n=St();return(s,i)=>o=>{e==null||e(s,i,o),n(h_({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}},oO=e=>{var t=St();return(r,n)=>s=>{e==null||e(r,n,s),t(V9())}},lO=(e,t,r)=>{var n=St();return(s,i)=>o=>{e==null||e(s,i,o),n(X9({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}};function MK(e){var{tooltipEntrySettings:t}=e,r=St(),n=Ir(),s=p.useRef(null);return p.useLayoutEffect(()=>{n||(s.current===null?r(H9(t)):s.current!==t&&r(K9({prev:s.current,next:t})),s.current=t)},[t,r,n]),p.useLayoutEffect(()=>()=>{s.current&&(r(Y9(s.current)),s.current=null)},[r]),null}function AK(e){var{legendPayload:t}=e,r=St(),n=Ir(),s=p.useRef(null);return p.useLayoutEffect(()=>{n||(s.current===null?r(PF(t)):s.current!==t&&r(MF({prev:s.current,next:t})),s.current=t)},[r,n,t]),p.useLayoutEffect(()=>()=>{s.current&&(r(AF(s.current)),s.current=null)},[r]),null}var Fm,EK=()=>{var[e]=p.useState(()=>el("uid-"));return e},DK=(Fm=AP.useId)!==null&&Fm!==void 0?Fm:EK;function TK(e,t){var r=DK();return t||(e?"".concat(e,"-").concat(r):r)}var IK=p.createContext(void 0),RK=e=>{var{id:t,type:r,children:n}=e,s=TK("recharts-".concat(r),t);return p.createElement(IK.Provider,{value:s},n(s))},$K={cartesianItems:[],polarItems:[]},cO=Tr({name:"graphicalItems",initialState:$K,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:lt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=bn(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:lt()},removeCartesianGraphicalItem:{reducer(e,t){var r=bn(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:lt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:lt()},removePolarGraphicalItem:{reducer(e,t){var r=bn(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:lt()}}}),{addCartesianGraphicalItem:zK,replaceCartesianGraphicalItem:LK,removeCartesianGraphicalItem:FK,addPolarGraphicalItem:KJ,removePolarGraphicalItem:YJ}=cO.actions,BK=cO.reducer,WK=e=>{var t=St(),r=p.useRef(null);return p.useLayoutEffect(()=>{r.current===null?t(zK(e)):r.current!==e&&t(LK({prev:r.current,next:e})),r.current=e},[t,e]),p.useLayoutEffect(()=>()=>{r.current&&(t(FK(r.current)),r.current=null)},[t]),null},UK=p.memo(WK);function vw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function yw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vw(Object(r),!0).forEach(function(n){qK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qK(e,t,r){return(t=HK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HK(e){var t=KK(e,"string");return typeof t=="symbol"?t:t+""}function KK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dO=0,YK={xAxis:{},yAxis:{},zAxis:{}},uO=Tr({name:"cartesianAxis",initialState:YK,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:lt()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:lt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:lt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:lt()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:lt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:lt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:lt()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:lt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:lt()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,s=e.yAxis[r];if(s){var i,o=s.widthHistory||[];if(o.length===3&&o[0]===o[2]&&n===o[1]&&n!==s.width&&Math.abs(n-((i=o[0])!==null&&i!==void 0?i:0))<=1)return;var l=[...o,n].slice(-3);e.yAxis[r]=yw(yw({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:GK,replaceXAxis:VK,removeXAxis:XK,addYAxis:QK,replaceYAxis:ZK,removeYAxis:JK,addZAxis:GJ,replaceZAxis:VJ,removeZAxis:XJ,updateYAxisWidth:eY}=uO.actions,tY=uO.reducer,rY=W([Ht],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),nY=W([rY,_a,Oa],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),fO=()=>_e(nY),bw=(e,t,r)=>{var n=r??e;if(!Ut(n))return jn(n,t,0)},aY=(e,t,r)=>{var n={},s=e.filter(Of),i=e.filter(d=>d.stackId==null),o=s.reduce((d,u)=>{var f=d[u.stackId];return f==null&&(f=[]),f.push(u),d[u.stackId]=f,d},n),l=Object.entries(o).map(d=>{var u,[f,m]=d,h=m.map(x=>x.dataKey),g=bw(t,r,(u=m[0])===null||u===void 0?void 0:u.barSize);return{stackId:f,dataKeys:h,barSize:g}}),c=i.map(d=>{var u=[d.dataKey].filter(m=>m!=null),f=bw(t,r,d.barSize);return{stackId:void 0,dataKeys:u,barSize:f}});return[...l,...c]};function ww(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Lc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ww(Object(r),!0).forEach(function(n){sY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ww(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sY(e,t,r){return(t=iY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iY(e){var t=oY(e,"string");return typeof t=="symbol"?t:t+""}function oY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lY(e,t,r,n,s){var i,o=n.length;if(!(o<1)){var l=jn(e,r,0,!0),c,d=[];if(Be((i=n[0])===null||i===void 0?void 0:i.barSize)){var u=!1,f=r/o,m=n.reduce((j,b)=>j+(b.barSize||0),0);m+=(o-1)*l,m>=r&&(m-=(o-1)*l,l=0),m>=r&&f>0&&(u=!0,f*=.9,m=o*f);var h=(r-m)/2>>0,g={offset:h-l,size:0};c=n.reduce((j,b)=>{var N,k={stackId:b.stackId,dataKeys:b.dataKeys,position:{offset:g.offset+g.size+l,size:u?f:(N=b.barSize)!==null&&N!==void 0?N:0}},w=[...j,k];return g=k.position,w},d)}else{var x=jn(t,r,0,!0);r-2*x-(o-1)*l<=0&&(l=0);var v=(r-2*x-(o-1)*l)/o;v>1&&(v>>=0);var y=Be(s)?Math.min(v,s):v;c=n.reduce((j,b,N)=>[...j,{stackId:b.stackId,dataKeys:b.dataKeys,position:{offset:x+(v+l)*N+(v-y)/2,size:y}}],d)}return c}}var cY=(e,t,r,n,s,i,o)=>{var l=Ut(o)?t:o,c=lY(r,n,s!==i?s:i,e,l);return s!==i&&c!=null&&(c=c.map(d=>Lc(Lc({},d),{},{position:Lc(Lc({},d.position),{},{offset:d.position.offset-s/2})}))),c},dY=(e,t)=>{var r=vx(t);if(!(!e||r==null||t==null)){var{stackId:n}=t;if(n!=null){var s=e[n];if(s){var{stackedData:i}=s;if(i)return i.find(o=>o.key===r)}}}},uY=(e,t)=>{if(!(e==null||t==null)){var r=e.find(n=>n.stackId===t.stackId&&t.dataKey!=null&&n.dataKeys.includes(t.dataKey));if(r!=null)return r.position}};function fY(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Be(e.zIndex)?e.zIndex:t}var mY=e=>{var{chartData:t}=e,r=St(),n=Ir();return p.useEffect(()=>n?()=>{}:(r(B0(t)),()=>{r(B0(void 0))}),[t,r,n]),null},jw={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},mO=Tr({name:"brush",initialState:jw,reducers:{setBrushSettings(e,t){return t.payload==null?jw:t.payload}}}),{setBrushSettings:QJ}=mO.actions,hY=mO.reducer;function pY(e){return(e%180+180)%180}var gY=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=pY(s),o=i*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},xY={dots:[],areas:[],lines:[]},hO=Tr({name:"referenceElements",initialState:xY,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=bn(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=bn(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=bn(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:ZJ,removeDot:JJ,addArea:eee,removeArea:tee,addLine:ree,removeLine:nee}=hO.actions,vY=hO.reducer,yY=p.createContext(void 0),bY=e=>{var{children:t}=e,[r]=p.useState("".concat(el("recharts"),"-clip")),n=fO();if(n==null)return null;var{x:s,y:i,width:o,height:l}=n;return p.createElement(yY.Provider,{value:r},p.createElement("defs",null,p.createElement("clipPath",{id:r},p.createElement("rect",{x:s,y:i,height:l,width:o}))),t)};function pO(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t){var s=e[n];s!==void 0&&r.push(s)}return r}function wY(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return gY(n,r)}function jY(e,t,r){var n=r==="width",{x:s,y:i,width:o,height:l}=e;return t===1?{start:n?s:i,end:n?s+o:i+l}:{start:n?s+o:i+l,end:n?s:i}}function hl(e,t,r,n,s){if(e*t<e*n||e*t>e*s)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-s)<=0}function NY(e,t){return pO(e,t+1)}function kY(e,t,r,n,s){for(var i=(n||[]).slice(),{start:o,end:l}=t,c=0,d=1,u=o,f=function(){var g=n==null?void 0:n[c];if(g===void 0)return{v:pO(n,d)};var x=c,v,y=()=>(v===void 0&&(v=r(g,x)),v),j=g.coordinate,b=c===0||hl(e,j,y,u,l);b||(c=0,u=o,d+=1),b&&(u=j+e*(y()/2+s),c+=d)},m;d<=i.length;)if(m=f(),m)return m.v;return[]}function SY(e,t,r,n,s){var i=(n||[]).slice(),o=i.length;if(o===0)return[];for(var{start:l,end:c}=t,d=1;d<=o;d++){for(var u=(o-1)%d,f=l,m=!0,h=function(){var N=n[x];if(N==null)return 0;var k=x,w,S=()=>(w===void 0&&(w=r(N,k)),w),C=N.coordinate,P=x===u||hl(e,C,S,f,c);if(!P)return m=!1,1;P&&(f=C+e*(S()/2+s))},g,x=u;x<o&&(g=h(),!(g!==0&&g===1));x+=d);if(m){for(var v=[],y=u;y<o;y+=d){var j=n[y];j!=null&&v.push(j)}return v}}return[]}function Nw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function sr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nw(Object(r),!0).forEach(function(n){CY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function CY(e,t,r){return(t=_Y(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _Y(e){var t=OY(e,"string");return typeof t=="symbol"?t:t+""}function OY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PY(e,t,r,n,s){for(var i=(n||[]).slice(),o=i.length,{start:l}=t,{end:c}=t,d=function(m){var h=i[m];if(h==null)return 1;var g=h,x,v=()=>(x===void 0&&(x=r(h,m)),x);if(m===o-1){var y=e*(g.coordinate+e*v()/2-c);i[m]=g=sr(sr({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else i[m]=g=sr(sr({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var j=hl(e,g.tickCoord,v,l,c);j&&(c=g.tickCoord-e*(v()/2+s),i[m]=sr(sr({},g),{},{isShow:!0}))}},u=o-1;u>=0;u--)d(u);return i}function MY(e,t,r,n,s,i){var o=(n||[]).slice(),l=o.length,{start:c,end:d}=t;if(i){var u=n[l-1];if(u!=null){var f=r(u,l-1),m=e*(u.coordinate+e*f/2-d);if(o[l-1]=u=sr(sr({},u),{},{tickCoord:m>0?u.coordinate-m*e:u.coordinate}),u.tickCoord!=null){var h=hl(e,u.tickCoord,()=>f,c,d);h&&(d=u.tickCoord-e*(f/2+s),o[l-1]=sr(sr({},u),{},{isShow:!0}))}}}for(var g=i?l-1:l,x=function(j){var b=o[j];if(b==null)return 1;var N=b,k,w=()=>(k===void 0&&(k=r(b,j)),k);if(j===0){var S=e*(N.coordinate-e*w()/2-c);o[j]=N=sr(sr({},N),{},{tickCoord:S<0?N.coordinate-S*e:N.coordinate})}else o[j]=N=sr(sr({},N),{},{tickCoord:N.coordinate});if(N.tickCoord!=null){var C=hl(e,N.tickCoord,w,c,d);C&&(c=N.tickCoord+e*(w()/2+s),o[j]=sr(sr({},N),{},{isShow:!0}))}},v=0;v<g;v++)x(v);return o}function Ux(e,t,r){var{tick:n,ticks:s,viewBox:i,minTickGap:o,orientation:l,interval:c,tickFormatter:d,unit:u,angle:f}=e;if(!s||!s.length||!n)return[];if(xe(c)||gf.isSsr){var m;return(m=NY(s,xe(c)?c:0))!==null&&m!==void 0?m:[]}var h=[],g=l==="top"||l==="bottom"?"width":"height",x=u&&g==="width"?Yo(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},v=(k,w)=>{var S=typeof d=="function"?d(k.value,w):k.value;return g==="width"?wY(Yo(S,{fontSize:t,letterSpacing:r}),x,f):Yo(S,{fontSize:t,letterSpacing:r})[g]},y=s[0],j=s[1],b=s.length>=2&&y!=null&&j!=null?Or(j.coordinate-y.coordinate):1,N=jY(i,b,g);return c==="equidistantPreserveStart"?kY(b,N,v,s,o):c==="equidistantPreserveEnd"?SY(b,N,v,s,o):(c==="preserveStart"||c==="preserveStartEnd"?h=MY(b,N,v,s,o,c==="preserveStartEnd"):h=PY(b,N,v,s,o),h.filter(k=>k.isShow))}var AY=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:i=0}=e,o=0;if(t){Array.from(t).forEach(u=>{if(u){var f=u.getBoundingClientRect();f.width>o&&(o=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=s+i,d=o+c+l+(r?n:0);return Math.round(d)}return 0},EY=["axisLine","width","height","className","hide","ticks","axisType"];function DY(e,t){if(e==null)return{};var r,n,s=TY(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function TY(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function qs(){return qs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qs.apply(null,arguments)}function kw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kw(Object(r),!0).forEach(function(n){IY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IY(e,t,r){return(t=RY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RY(e){var t=$Y(e,"string");return typeof t=="symbol"?t:t+""}function $Y(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ma={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",zIndex:vr.axis};function zY(e){var{x:t,y:r,width:n,height:s,orientation:i,mirror:o,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var d=xt(xt(xt({},c),ha(l)),{},{fill:"none"});if(i==="top"||i==="bottom"){var u=+(i==="top"&&!o||i==="bottom"&&o);d=xt(xt({},d),{},{x1:t,y1:r+u*s,x2:t+n,y2:r+u*s})}else{var f=+(i==="left"&&!o||i==="right"&&o);d=xt(xt({},d),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+s})}return p.createElement("line",qs({},d,{className:Je("recharts-cartesian-axis-line",Mi(l,"className"))}))}function LY(e,t,r,n,s,i,o,l,c){var d,u,f,m,h,g,x=l?-1:1,v=e.tickSize||o,y=xe(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":d=u=e.coordinate,m=r+ +!l*s,f=m-x*v,g=f-x*c,h=y;break;case"left":f=m=e.coordinate,u=t+ +!l*n,d=u-x*v,h=d-x*c,g=y;break;case"right":f=m=e.coordinate,u=t+ +l*n,d=u+x*v,h=d+x*c,g=y;break;default:d=u=e.coordinate,m=r+ +l*s,f=m+x*v,g=f+x*c,h=y;break}return{line:{x1:d,y1:f,x2:u,y2:m},tick:{x:h,y:g}}}function FY(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function BY(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function WY(e){var{option:t,tickProps:r,value:n}=e,s,i=Je(r.className,"recharts-cartesian-axis-tick-value");if(p.isValidElement(t))s=p.cloneElement(t,xt(xt({},r),{},{className:i}));else if(typeof t=="function")s=t(xt(xt({},r),{},{className:i}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Je(o,lK(t))),s=p.createElement(Lx,qs({},r,{className:o}),n)}return s}var UY=p.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:i,tickFormatter:o,unit:l,padding:c,tickTextProps:d,orientation:u,mirror:f,x:m,y:h,width:g,height:x,tickSize:v,tickMargin:y,fontSize:j,letterSpacing:b,getTicksConfig:N,events:k,axisType:w}=e,S=Ux(xt(xt({},N),{},{ticks:r}),j,b),C=FY(u,f),P=BY(u,f),M=ha(N),A=ug(n),_={};typeof s=="object"&&(_=s);var D=xt(xt({},M),{},{fill:"none"},_),O=S.map(H=>xt({entry:H},LY(H,m,h,g,x,u,v,f,y))),R=O.map(H=>{var{entry:ne,line:G}=H;return p.createElement(pa,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(ne.value,"-").concat(ne.coordinate,"-").concat(ne.tickCoord)},s&&p.createElement("line",qs({},D,G,{className:Je("recharts-cartesian-axis-tick-line",Mi(s,"className"))})))}),F=O.map((H,ne)=>{var G,oe,{entry:ce,tick:B}=H,Y=xt(xt(xt(xt({verticalAnchor:P},M),{},{textAnchor:C,stroke:"none",fill:i},B),{},{index:ne,payload:ce,visibleTicksCount:S.length,tickFormatter:o,padding:c},d),{},{angle:(G=(oe=d==null?void 0:d.angle)!==null&&oe!==void 0?oe:M.angle)!==null&&G!==void 0?G:0}),U=xt(xt({},Y),A);return p.createElement(pa,qs({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(ce.value,"-").concat(ce.coordinate,"-").concat(ce.tickCoord)},gg(k,ce,ne)),n&&p.createElement(WY,{option:n,tickProps:U,value:"".concat(typeof o=="function"?o(ce.value,ne):ce.value).concat(l||"")}))});return p.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(w,"-ticks")},F.length>0&&p.createElement(Ta,{zIndex:vr.label},p.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(w,"-tick-labels"),ref:t},F)),R.length>0&&p.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(w,"-tick-lines")},R))}),qY=p.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:i,hide:o,ticks:l,axisType:c}=e,d=DY(e,EY),[u,f]=p.useState(""),[m,h]=p.useState(""),g=p.useRef(null);p.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var v;return AY({ticks:g.current,label:(v=e.labelRef)===null||v===void 0?void 0:v.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var x=p.useCallback(v=>{if(v){var y=v.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=y;var j=y[0];if(j){var b=window.getComputedStyle(j),N=b.fontSize,k=b.letterSpacing;(N!==u||k!==m)&&(f(N),h(k))}}},[u,m]);return o||n!=null&&n<=0||s!=null&&s<=0?null:p.createElement(Ta,{zIndex:e.zIndex},p.createElement(pa,{className:Je("recharts-cartesian-axis",i)},p.createElement(zY,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:ha(e)}),p.createElement(UY,{ref:x,axisType:c,events:d,fontSize:u,getTicksConfig:e,height:e.height,letterSpacing:m,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y}),p.createElement(LH,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},p.createElement(VH,{label:e.label,labelRef:e.labelRef}),e.children)))}),qx=p.forwardRef((e,t)=>{var r=Yr(e,ma);return p.createElement(qY,qs({},r,{ref:t}))});qx.displayName="CartesianAxis";var HY=["x1","y1","x2","y2","key"],KY=["offset"],YY=["xAxisId","yAxisId"],GY=["xAxisId","yAxisId"];function Sw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function or(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sw(Object(r),!0).forEach(function(n){VY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VY(e,t,r){return(t=XY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XY(e){var t=QY(e,"string");return typeof t=="symbol"?t:t+""}function QY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cs(){return Cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cs.apply(null,arguments)}function Gd(e,t){if(e==null)return{};var r,n,s=ZY(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function ZY(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var JY=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:s,width:i,height:o,ry:l}=e;return p.createElement("rect",{x:n,y:s,ry:l,width:i,height:o,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function gO(e){var{option:t,lineItemProps:r}=e,n;if(p.isValidElement(t))n=p.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var s,{x1:i,y1:o,x2:l,y2:c,key:d}=r,u=Gd(r,HY),f=(s=ha(u))!==null&&s!==void 0?s:{},{offset:m}=f,h=Gd(f,KY);n=p.createElement("line",Cs({},h,{x1:i,y1:o,x2:l,y2:c,fill:"none",key:d}))}return n}function eG(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:i,yAxisId:o}=e,l=Gd(e,YY),c=s.map((d,u)=>{var f=or(or({},l),{},{x1:t,y1:d,x2:t+r,y2:d,key:"line-".concat(u),index:u});return p.createElement(gO,{key:"line-".concat(u),option:n,lineItemProps:f})});return p.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function tG(e){var{y:t,height:r,vertical:n=!0,verticalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:i,yAxisId:o}=e,l=Gd(e,GY),c=s.map((d,u)=>{var f=or(or({},l),{},{x1:d,y1:t,x2:d,y2:t+r,key:"line-".concat(u),index:u});return p.createElement(gO,{option:n,lineItemProps:f,key:"line-".concat(u)})});return p.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function rG(e){var{horizontalFill:t,fillOpacity:r,x:n,y:s,width:i,height:o,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var d=l.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var u=d.map((f,m)=>{var h=d[m+1],g=h==null,x=g?s+o-f:h-f;if(x<=0)return null;var v=m%t.length;return p.createElement("rect",{key:"react-".concat(m),y:f,x:n,height:x,width:i,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return p.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},u)}function nG(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:s,y:i,width:o,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var d=c.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var u=d.map((f,m)=>{var h=d[m+1],g=h==null,x=g?s+o-f:h-f;if(x<=0)return null;var v=m%r.length;return p.createElement("rect",{key:"react-".concat(m),x:f,y:i,width:x,height:l,stroke:"none",fill:r[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return p.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},u)}var aG=(e,t)=>{var{xAxis:r,width:n,height:s,offset:i}=e;return US(Ux(or(or(or({},ma),r),{},{ticks:qS(r),viewBox:{x:0,y:0,width:n,height:s}})),i.left,i.left+i.width,t)},sG=(e,t)=>{var{yAxis:r,width:n,height:s,offset:i}=e;return US(Ux(or(or(or({},ma),r),{},{ticks:qS(r),viewBox:{x:0,y:0,width:n,height:s}})),i.top,i.top+i.height,t)},iG={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:vr.grid};function pl(e){var t=e2(),r=t2(),n=JS(),s=or(or({},Yr(e,iG)),{},{x:xe(e.x)?e.x:n.left,y:xe(e.y)?e.y:n.top,width:xe(e.width)?e.width:n.width,height:xe(e.height)?e.height:n.height}),{xAxisId:i,yAxisId:o,x:l,y:c,width:d,height:u,syncWithTicks:f,horizontalValues:m,verticalValues:h}=s,g=Ir(),x=_e(P=>M0(P,"xAxis",i,g)),v=_e(P=>M0(P,"yAxis",o,g));if(!qn(d)||!qn(u)||!xe(l)||!xe(c))return null;var y=s.verticalCoordinatesGenerator||aG,j=s.horizontalCoordinatesGenerator||sG,{horizontalPoints:b,verticalPoints:N}=s;if((!b||!b.length)&&typeof j=="function"){var k=m&&m.length,w=j({yAxis:v?or(or({},v),{},{ticks:k?m:v.ticks}):void 0,width:t??d,height:r??u,offset:n},k?!0:f);yd(Array.isArray(w),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof w,"]")),Array.isArray(w)&&(b=w)}if((!N||!N.length)&&typeof y=="function"){var S=h&&h.length,C=y({xAxis:x?or(or({},x),{},{ticks:S?h:x.ticks}):void 0,width:t??d,height:r??u,offset:n},S?!0:f);yd(Array.isArray(C),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof C,"]")),Array.isArray(C)&&(N=C)}return p.createElement(Ta,{zIndex:s.zIndex},p.createElement("g",{className:"recharts-cartesian-grid"},p.createElement(JY,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),p.createElement(rG,Cs({},s,{horizontalPoints:b})),p.createElement(nG,Cs({},s,{verticalPoints:N})),p.createElement(eG,Cs({},s,{offset:n,horizontalPoints:b,xAxis:x,yAxis:v})),p.createElement(tG,Cs({},s,{offset:n,verticalPoints:N,xAxis:x,yAxis:v}))))}pl.displayName="CartesianGrid";var oG={},xO=Tr({name:"errorBars",initialState:oG,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:s}=t.payload;e[r]&&(e[r]=e[r].map(i=>i.dataKey===n.dataKey&&i.direction===n.direction?s:i))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==n.dataKey||s.direction!==n.direction))}}}),{addErrorBar:aee,replaceErrorBar:see,removeErrorBar:iee}=xO.actions,lG=xO.reducer,cG=["children"];function dG(e,t){if(e==null)return{};var r,n,s=uG(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function uG(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var fG={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},mG=p.createContext(fG);function hG(e){var{children:t}=e,r=dG(e,cG);return p.createElement(mG.Provider,{value:r},t)}function vO(e,t){var r,n,s=_e(d=>Aa(d,e)),i=_e(d=>Ea(d,t)),o=(r=s==null?void 0:s.allowDataOverflow)!==null&&r!==void 0?r:zt.allowDataOverflow,l=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:Lt.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function pG(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=fO(),{needClipX:i,needClipY:o,needClip:l}=vO(t,r);if(!l||!s)return null;var{x:c,y:d,width:u,height:f}=s;return p.createElement("clipPath",{id:"clipPath-".concat(n)},p.createElement("rect",{x:i?c:c-u/2,y:o?d:d-f/2,width:i?u:u*2,height:o?f:f*2}))}var gG={};/**
|
|
583
|
-
* @license React
|
|
584
|
-
* use-sync-external-store-with-selector.production.js
|
|
585
|
-
*
|
|
586
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
587
|
-
*
|
|
588
|
-
* This source code is licensed under the MIT license found in the
|
|
589
|
-
* LICENSE file in the root directory of this source tree.
|
|
590
|
-
*/var dc=p;function xG(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vG=typeof Object.is=="function"?Object.is:xG,yG=dc.useSyncExternalStore,bG=dc.useRef,wG=dc.useEffect,jG=dc.useMemo,NG=dc.useDebugValue;gG.useSyncExternalStoreWithSelector=function(e,t,r,n,s){var i=bG(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=jG(function(){function c(h){if(!d){if(d=!0,u=h,h=n(h),s!==void 0&&o.hasValue){var g=o.value;if(s(g,h))return f=g}return f=h}if(g=f,vG(u,h))return g;var x=n(h);return s!==void 0&&s(g,x)?(u=h,g):(u=h,f=x)}var d=!1,u,f,m=r===void 0?null:r;return[function(){return c(t())},m===null?void 0:function(){return c(m())}]},[t,r,n,s]);var l=yG(e,i[0],i[1]);return wG(function(){o.hasValue=!0,o.value=l},[l]),NG(l),l};function kG(e){e()}function SG(){let e=null,t=null;return{clear(){e=null,t=null},notify(){kG(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const s=t={callback:r,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){!n||e===null||(n=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var Cw={notify(){},get:()=>[]};function CG(e,t){let r,n=Cw,s=0,i=!1;function o(x){u();const v=n.subscribe(x);let y=!1;return()=>{y||(y=!0,v(),f())}}function l(){n.notify()}function c(){g.onStateChange&&g.onStateChange()}function d(){return i}function u(){s++,r||(r=e.subscribe(c),n=SG())}function f(){s--,r&&s===0&&(r(),r=void 0,n.clear(),n=Cw)}function m(){i||(i=!0,u())}function h(){i&&(i=!1,f())}const g={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:m,tryUnsubscribe:h,getListeners:()=>n};return g}var _G=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",OG=_G(),PG=()=>typeof navigator<"u"&&navigator.product==="ReactNative",MG=PG(),AG=()=>OG||MG?p.useLayoutEffect:p.useEffect,EG=AG();function _w(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function DG(e,t){if(_w(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++)if(!Object.prototype.hasOwnProperty.call(t,r[s])||!_w(e[r[s]],t[r[s]]))return!1;return!0}var Bm=Symbol.for("react-redux-context"),Wm=typeof globalThis<"u"?globalThis:{};function TG(){if(!p.createContext)return{};const e=Wm[Bm]??(Wm[Bm]=new Map);let t=e.get(p.createContext);return t||(t=p.createContext(null),e.set(p.createContext,t)),t}var IG=TG();function RG(e){const{children:t,context:r,serverState:n,store:s}=e,i=p.useMemo(()=>{const c=CG(s);return{store:s,subscription:c,getServerState:n?()=>n:void 0}},[s,n]),o=p.useMemo(()=>s.getState(),[s]);EG(()=>{const{subscription:c}=i;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==s.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[i,o]);const l=r||IG;return p.createElement(l.Provider,{value:i},t)}var $G=RG,zG=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function LG(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Hx(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(zG.has(n)){if(e[n]==null&&t[n]==null)continue;if(!DG(e[n],t[n]))return!1}else if(!LG(e[n],t[n]))return!1;return!0}function ri(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:dO}function ni(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:dO}var FG="Invariant failed";function BG(e,t){throw new Error(FG)}function tp(){return tp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tp.apply(null,arguments)}function Vd(e){return p.createElement(PK,tp({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var WG=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,s)=>{if(xe(t))return t;var i=xe(n)||Ut(n);return i?t(n,s):(i||BG(),r)}},UG=(e,t,r)=>r,qG=(e,t)=>t,uc=W([bx,qG],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),HG=W([uc],e=>e==null?void 0:e.maxBarSize),KG=(e,t,r,n)=>n,YG=W([et,bx,ri,ni,UG],(e,t,r,n,s)=>t.filter(i=>e==="horizontal"?i.xAxisId===r:i.yAxisId===n).filter(i=>i.isPanorama===s).filter(i=>i.hide===!1).filter(i=>i.type==="bar")),GG=(e,t,r)=>{var n=et(e),s=ri(e,t),i=ni(e,t);if(!(s==null||i==null))return n==="horizontal"?Vh(e,"yAxis",i,r):Vh(e,"xAxis",s,r)},VG=(e,t)=>{var r=et(e),n=ri(e,t),s=ni(e,t);if(!(n==null||s==null))return r==="horizontal"?P0(e,"xAxis",n):P0(e,"yAxis",s)},XG=W([YG,T7,VG],aY),QG=(e,t,r)=>{var n,s,i=uc(e,t);if(i==null)return 0;var o=ri(e,t),l=ni(e,t);if(o==null||l==null)return 0;var c=et(e),d=xC(e),{maxBarSize:u}=i,f=Ut(u)?d:u,m,h;return c==="horizontal"?(m=$i(e,"xAxis",o,r),h=Ri(e,"xAxis",o,r)):(m=$i(e,"yAxis",l,r),h=Ri(e,"yAxis",l,r)),(n=(s=vd(m,h,!0))!==null&&s!==void 0?s:f)!==null&&n!==void 0?n:0},yO=(e,t,r)=>{var n=et(e),s=ri(e,t),i=ni(e,t);if(!(s==null||i==null)){var o,l;return n==="horizontal"?(o=$i(e,"xAxis",s,r),l=Ri(e,"xAxis",s,r)):(o=$i(e,"yAxis",i,r),l=Ri(e,"yAxis",i,r)),vd(o,l)}},ZG=W([XG,xC,D7,vC,QG,yO,HG],cY),JG=(e,t,r)=>{var n=ri(e,t);if(n!=null)return $i(e,"xAxis",n,r)},eV=(e,t,r)=>{var n=ni(e,t);if(n!=null)return $i(e,"yAxis",n,r)},tV=(e,t,r)=>{var n=ri(e,t);if(n!=null)return Ri(e,"xAxis",n,r)},rV=(e,t,r)=>{var n=ni(e,t);if(n!=null)return Ri(e,"yAxis",n,r)},nV=W([ZG,uc],uY),aV=W([GG,uc],dY),sV=W([Ht,Tg,JG,eV,tV,rV,nV,et,S7,yO,aV,uc,KG],(e,t,r,n,s,i,o,l,c,d,u,f,m)=>{var{chartData:h,dataStartIndex:g,dataEndIndex:x}=c;if(!(f==null||o==null||t==null||l!=="horizontal"&&l!=="vertical"||r==null||n==null||s==null||i==null||d==null)){var{data:v}=f,y;if(v!=null&&v.length>0?y=v:y=h==null?void 0:h.slice(g,x+1),y!=null)return DV({layout:l,barSettings:f,pos:o,parentViewBox:t,bandSize:d,xAxis:r,yAxis:n,xAxisTicks:s,yAxisTicks:i,stackedData:u,displayedData:y,offset:e,cells:m,dataStartIndex:g})}}),iV=["index"];function rp(){return rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rp.apply(null,arguments)}function oV(e,t){if(e==null)return{};var r,n,s=lV(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function lV(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var bO=p.createContext(void 0),cV=e=>{var t=p.useContext(bO);if(t!=null)return t.stackId;if(e!=null)return RL(e)},dV=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),uV=e=>{var t=p.useContext(bO);if(t!=null){var{stackId:r}=t;return"url(#".concat(dV(r,e),")")}},wO=e=>{var{index:t}=e,r=oV(e,iV),n=uV(t);return p.createElement(pa,rp({className:"recharts-bar-stack-layer",clipPath:n},r))},fV=["onMouseEnter","onMouseLeave","onClick"],mV=["value","background","tooltipPosition"],hV=["id"],pV=["onMouseEnter","onClick","onMouseLeave"];function ja(){return ja=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ja.apply(null,arguments)}function Ow(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ow(Object(r),!0).forEach(function(n){gV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ow(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gV(e,t,r){return(t=xV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xV(e){var t=vV(e,"string");return typeof t=="symbol"?t:t+""}function vV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xd(e,t){if(e==null)return{};var r,n,s=yV(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function yV(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var bV=e=>{var{dataKey:t,name:r,fill:n,legendType:s,hide:i}=e;return[{inactive:i,dataKey:t,type:s,color:n,value:HS(r,t),payload:e}]},wV=p.memo(e=>{var{dataKey:t,stroke:r,strokeWidth:n,fill:s,name:i,hide:o,unit:l,tooltipType:c,id:d}=e,u={dataDefinedOnItem:void 0,getPosition:ro,settings:{stroke:r,strokeWidth:n,fill:s,dataKey:t,nameKey:void 0,name:HS(i,t),hide:o,type:c,color:s,unit:l,graphicalItemId:d}};return p.createElement(MK,{tooltipEntrySettings:u})});function jV(e){var t=_e(zi),{data:r,dataKey:n,background:s,allOtherBarProps:i}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=i,d=Xd(i,fV),u=iO(o,n,i.id),f=oO(l),m=lO(c,n,i.id);if(!s||r==null)return null;var h=ug(s);return p.createElement(Ta,{zIndex:fY(s,vr.barBackground)},r.map((g,x)=>{var{value:v,background:y,tooltipPosition:j}=g,b=Xd(g,mV);if(!y)return null;var N=u(g,x),k=f(g,x),w=m(g,x),S=pr(pr(pr(pr(pr({option:s,isActive:String(x)===t},b),{},{fill:"#eee"},y),h),gg(d,g,x)),{},{onMouseEnter:N,onMouseLeave:k,onClick:w,dataKey:n,index:x,className:"recharts-bar-background-rectangle"});return p.createElement(Vd,ja({key:"background-bar-".concat(x)},S))}))}function NV(e){var{showLabels:t,children:r,rects:n}=e,s=n==null?void 0:n.map(i=>{var o={x:i.x,y:i.y,width:i.width,lowerWidth:i.width,upperWidth:i.width,height:i.height};return pr(pr({},o),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:o,fill:i.fill})});return p.createElement(rK,{value:t?s:void 0},r)}function kV(e){var{shape:t,activeBar:r,baseProps:n,entry:s,index:i,dataKey:o}=e,l=_e(zi),c=_e(P_),d=r&&String(i)===l&&(c==null||o===c),u=d?r:t;return d?p.createElement(Ta,{zIndex:vr.activeBar},p.createElement(wO,{index:i},p.createElement(Vd,ja({},n,{name:String(n.name)},s,{isActive:d,option:u,index:i,dataKey:o})))):p.createElement(Vd,ja({},n,{name:String(n.name)},s,{isActive:d,option:u,index:i,dataKey:o}))}function SV(e){var{shape:t,baseProps:r,entry:n,index:s,dataKey:i}=e;return p.createElement(Vd,ja({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:s,dataKey:i}))}function CV(e){var t,{data:r,props:n}=e,s=(t=ha(n))!==null&&t!==void 0?t:{},{id:i}=s,o=Xd(s,hV),{shape:l,dataKey:c,activeBar:d}=n,{onMouseEnter:u,onClick:f,onMouseLeave:m}=n,h=Xd(n,pV),g=iO(u,c,i),x=oO(m),v=lO(f,c,i);return r?p.createElement(p.Fragment,null,r.map((y,j)=>p.createElement(wO,ja({index:j,key:"rectangle-".concat(y==null?void 0:y.x,"-").concat(y==null?void 0:y.y,"-").concat(y==null?void 0:y.value,"-").concat(j),className:"recharts-bar-rectangle"},gg(h,y,j),{onMouseEnter:g(y,j),onMouseLeave:x(y,j),onClick:v(y,j)}),d?p.createElement(kV,{shape:l,activeBar:d,baseProps:o,entry:y,index:j,dataKey:c}):p.createElement(SV,{shape:l,baseProps:o,entry:y,index:j,dataKey:c})))):null}function _V(e){var{props:t,previousRectanglesRef:r}=e,{data:n,layout:s,isAnimationActive:i,animationBegin:o,animationDuration:l,animationEasing:c,onAnimationEnd:d,onAnimationStart:u}=t,f=r.current,m=Fg(t,"recharts-bar-"),[h,g]=p.useState(!1),x=!h,v=p.useCallback(()=>{typeof d=="function"&&d(),g(!1)},[d]),y=p.useCallback(()=>{typeof u=="function"&&u(),g(!0)},[u]);return p.createElement(NV,{showLabels:x,rects:n},p.createElement(Lg,{animationId:m,begin:o,duration:l,isActive:i,easing:c,onAnimationEnd:v,onAnimationStart:y,key:m},j=>{var b=j===1?n:n==null?void 0:n.map((N,k)=>{var w=f&&f[k];if(w)return pr(pr({},N),{},{x:er(w.x,N.x,j),y:er(w.y,N.y,j),width:er(w.width,N.width,j),height:er(w.height,N.height,j)});if(s==="horizontal"){var S=er(0,N.height,j),C=er(N.stackedBarStart,N.y,j);return pr(pr({},N),{},{y:C,height:S})}var P=er(0,N.width,j),M=er(N.stackedBarStart,N.x,j);return pr(pr({},N),{},{width:P,x:M})});return j>0&&(r.current=b??null),b==null?null:p.createElement(pa,null,p.createElement(CV,{props:t,data:b}))}),p.createElement(sK,{label:t.label}),t.children)}function OV(e){var t=p.useRef(null);return p.createElement(_V,{previousRectanglesRef:t,props:e})}var jO=0,PV=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:rr(e,t)}};class MV extends p.PureComponent{render(){var{hide:t,data:r,dataKey:n,className:s,xAxisId:i,yAxisId:o,needClip:l,background:c,id:d}=this.props;if(t||r==null)return null;var u=Je("recharts-bar",s),f=d;return p.createElement(pa,{className:u,id:d},l&&p.createElement("defs",null,p.createElement(pG,{clipPathId:f,xAxisId:i,yAxisId:o})),p.createElement(pa,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(f,")"):void 0},p.createElement(jV,{data:r,dataKey:n,background:c,allOtherBarProps:this.props}),p.createElement(OV,this.props)))}}var AV={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:jO,xAxisId:0,yAxisId:0,zIndex:vr.bar};function EV(e){var{xAxisId:t,yAxisId:r,hide:n,legendType:s,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u}=e,{needClip:f}=vO(t,r),m=no(),h=Ir(),g=fK(e.children,F_),x=_e(j=>sV(j,e.id,h,g));if(m!=="vertical"&&m!=="horizontal")return null;var v,y=x==null?void 0:x[0];return y==null||y.height==null||y.width==null?v=0:v=m==="vertical"?y.height/2:y.width/2,p.createElement(hG,{xAxisId:t,yAxisId:r,data:x,dataPointFormatter:PV,errorBarOffset:v},p.createElement(MV,ja({},e,{layout:m,needClip:f,data:x,xAxisId:t,yAxisId:r,hide:n,legendType:s,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u})))}function DV(e){var{layout:t,barSettings:{dataKey:r,minPointSize:n},pos:s,bandSize:i,xAxis:o,yAxis:l,xAxisTicks:c,yAxisTicks:d,stackedData:u,displayedData:f,offset:m,cells:h,parentViewBox:g,dataStartIndex:x}=e,v=t==="horizontal"?l:o,y=u?v.scale.domain():null,j=$L({numericAxis:v}),b=v.scale.map(j);return f.map((N,k)=>{var w,S,C,P,M,A;if(u){var _=u[k+x];if(_==null)return null;w=AL(_,y)}else w=rr(N,r),Array.isArray(w)||(w=[j,w]);var D=WG(n,jO)(w[1],k);if(t==="horizontal"){var O,R=l.scale.map(w[0]),F=l.scale.map(w[1]);if(R==null||F==null)return null;S=zy({axis:o,ticks:c,bandSize:i,offset:s.offset,entry:N,index:k}),C=(O=F??R)!==null&&O!==void 0?O:void 0,P=s.size;var H=R-F;if(M=Wn(H)?0:H,A={x:S,y:m.top,width:P,height:m.height},Math.abs(D)>0&&Math.abs(M)<Math.abs(D)){var ne=Or(M||D)*(Math.abs(D)-Math.abs(M));C-=ne,M+=ne}}else{var G=o.scale.map(w[0]),oe=o.scale.map(w[1]);if(G==null||oe==null)return null;if(S=G,C=zy({axis:l,ticks:d,bandSize:i,offset:s.offset,entry:N,index:k}),P=oe-G,M=s.size,A={x:m.left,y:C,width:m.width,height:M},Math.abs(D)>0&&Math.abs(P)<Math.abs(D)){var ce=Or(P||D)*(Math.abs(D)-Math.abs(P));P+=ce}}if(S==null||C==null||P==null||M==null)return null;var B=pr(pr({},N),{},{stackedBarStart:b,x:S,y:C,width:P,height:M,value:u?w:w[1],payload:N,background:A,tooltipPosition:{x:S+P/2,y:C+M/2},parentViewBox:g},h&&h[k]&&h[k].props);return B}).filter(Boolean)}function TV(e){var t=Yr(e,AV),r=cV(t.stackId),n=Ir();return p.createElement(RK,{id:t.id,type:"bar"},s=>p.createElement(p.Fragment,null,p.createElement(AK,{legendPayload:bV(t)}),p.createElement(wV,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:s}),p.createElement(UK,{type:"bar",id:s,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:r,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:n}),p.createElement(Ta,{zIndex:t.zIndex},p.createElement(EV,ja({},t,{id:s})))))}var gl=p.memo(TV,Hx);gl.displayName="Bar";var IV=["domain","range"],RV=["domain","range"];function Pw(e,t){if(e==null)return{};var r,n,s=$V(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function $V(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Mw(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function NO(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=Pw(e,IV),{domain:i,range:o}=t,l=Pw(t,RV);return!Mw(r,i)||!Mw(n,o)?!1:Hx(s,l)}var zV=["type"],LV=["dangerouslySetInnerHTML","ticks","scale"],FV=["id","scale"];function np(){return np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},np.apply(null,arguments)}function Aw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ew(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Aw(Object(r),!0).forEach(function(n){BV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Aw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BV(e,t,r){return(t=WV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WV(e){var t=UV(e,"string");return typeof t=="symbol"?t:t+""}function UV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ap(e,t){if(e==null)return{};var r,n,s=qV(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function qV(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function HV(e){var t=St(),r=p.useRef(null),n=r2(),{type:s}=e,i=ap(e,zV),o=Sf(n,"xAxis",s),l=p.useMemo(()=>{if(o!=null)return Ew(Ew({},i),{},{type:o})},[i,o]);return p.useLayoutEffect(()=>{l!=null&&(r.current===null?t(GK(l)):r.current!==l&&t(VK({prev:r.current,next:l})),r.current=l)},[l,t]),p.useLayoutEffect(()=>()=>{r.current&&(t(XK(r.current)),r.current=null)},[t]),null}var KV=e=>{var{xAxisId:t,className:r}=e,n=_e(Tg),s=Ir(),i="xAxis",o=_e(y=>l_(y,i,t,s)),l=_e(y=>a_(y,t)),c=_e(y=>I9(y,t)),d=_e(y=>_C(y,t));if(l==null||c==null||d==null)return null;var{dangerouslySetInnerHTML:u,ticks:f,scale:m}=e,h=ap(e,LV),{id:g,scale:x}=d,v=ap(d,FV);return p.createElement(qx,np({},h,v,{x:c.x,y:c.y,width:l.width,height:l.height,className:Je("recharts-".concat(i," ").concat(i),r),viewBox:n,ticks:o,axisType:i}))},YV={allowDataOverflow:zt.allowDataOverflow,allowDecimals:zt.allowDecimals,allowDuplicatedCategory:zt.allowDuplicatedCategory,angle:zt.angle,axisLine:ma.axisLine,height:zt.height,hide:!1,includeHidden:zt.includeHidden,interval:zt.interval,label:!1,minTickGap:zt.minTickGap,mirror:zt.mirror,orientation:zt.orientation,padding:zt.padding,reversed:zt.reversed,scale:zt.scale,tick:zt.tick,tickCount:zt.tickCount,tickLine:ma.tickLine,tickSize:ma.tickSize,type:zt.type,xAxisId:0},GV=e=>{var t=Yr(e,YV);return p.createElement(p.Fragment,null,p.createElement(HV,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit}),p.createElement(KV,t))},xl=p.memo(GV,NO);xl.displayName="XAxis";var VV=["type"],XV=["dangerouslySetInnerHTML","ticks","scale"],QV=["id","scale"];function sp(){return sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sp.apply(null,arguments)}function Dw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Tw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Dw(Object(r),!0).forEach(function(n){ZV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZV(e,t,r){return(t=JV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JV(e){var t=eX(e,"string");return typeof t=="symbol"?t:t+""}function eX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ip(e,t){if(e==null)return{};var r,n,s=tX(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function tX(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function rX(e){var t=St(),r=p.useRef(null),n=r2(),{type:s}=e,i=ip(e,VV),o=Sf(n,"yAxis",s),l=p.useMemo(()=>{if(o!=null)return Tw(Tw({},i),{},{type:o})},[o,i]);return p.useLayoutEffect(()=>{l!=null&&(r.current===null?t(QK(l)):r.current!==l&&t(ZK({prev:r.current,next:l})),r.current=l)},[l,t]),p.useLayoutEffect(()=>()=>{r.current&&(t(JK(r.current)),r.current=null)},[t]),null}function nX(e){var{yAxisId:t,className:r,width:n,label:s}=e,i=p.useRef(null),o=p.useRef(null),l=_e(Tg),c=Ir(),d=St(),u="yAxis",f=_e(w=>s_(w,t)),m=_e(w=>$9(w,t)),h=_e(w=>l_(w,u,t,c)),g=_e(w=>OC(w,t));if(p.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Fx(s)||p.isValidElement(s)||g==null)){var w=i.current;if(w){var S=w.getCalculatedWidth();Math.round(f.width)!==Math.round(S)&&d(eY({id:t,width:S}))}}},[h,f,d,s,t,n,g]),f==null||m==null||g==null)return null;var{dangerouslySetInnerHTML:x,ticks:v,scale:y}=e,j=ip(e,XV),{id:b,scale:N}=g,k=ip(g,QV);return p.createElement(qx,sp({},j,k,{ref:i,labelRef:o,x:m.x,y:m.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:Je("recharts-".concat(u," ").concat(u),r),viewBox:l,ticks:h,axisType:u}))}var aX={allowDataOverflow:Lt.allowDataOverflow,allowDecimals:Lt.allowDecimals,allowDuplicatedCategory:Lt.allowDuplicatedCategory,angle:Lt.angle,axisLine:ma.axisLine,hide:!1,includeHidden:Lt.includeHidden,interval:Lt.interval,label:!1,minTickGap:Lt.minTickGap,mirror:Lt.mirror,orientation:Lt.orientation,padding:Lt.padding,reversed:Lt.reversed,scale:Lt.scale,tick:Lt.tick,tickCount:Lt.tickCount,tickLine:ma.tickLine,tickSize:ma.tickSize,type:Lt.type,width:Lt.width,yAxisId:0},sX=e=>{var t=Yr(e,aX);return p.createElement(p.Fragment,null,p.createElement(rX,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter}),p.createElement(nX,t))},vl=p.memo(sX,NO);vl.displayName="YAxis";var iX=(e,t)=>t,Kx=W([iX,et,SC,Gt,S_,Da,QU,Ht],aq),Yx=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},kO=sn("mouseClick"),SO=Xl();SO.startListening({actionCreator:kO,effect:(e,t)=>{var r=e.payload,n=Kx(t.getState(),Yx(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(Q9({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var op=sn("mouseMove"),CO=Xl(),Fc=null;CO.startListening({actionCreator:op,effect:(e,t)=>{var r=e.payload;Fc!==null&&cancelAnimationFrame(Fc);var n=Yx(r);Fc=requestAnimationFrame(()=>{var s=t.getState(),i=Px(s,s.tooltip.settings.shared);if(i==="axis"){var o=Kx(s,n);(o==null?void 0:o.activeIndex)!=null?t.dispatch(g_({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):t.dispatch(p_())}Fc=null})}});function oX(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var Iw={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},_O=Tr({name:"rootProps",initialState:Iw,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:Iw.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),lX=_O.reducer,{updateOptions:cX}=_O.actions,dX=null,uX={updatePolarOptions:(e,t)=>t.payload},OO=Tr({name:"polarOptions",initialState:dX,reducers:uX}),{updatePolarOptions:oee}=OO.actions,fX=OO.reducer,PO=sn("keyDown"),MO=sn("focus"),Gx=Xl();Gx.startListening({actionCreator:PO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip,i=e.payload;if(!(i!=="ArrowRight"&&i!=="ArrowLeft"&&i!=="Enter")){var o=Mx(s,mo(r),ic(r),lc(r)),l=o==null?-1:Number(o);if(!(!Number.isFinite(l)||l<0)){var c=Da(r);if(i==="Enter"){var d=Ud(r,"axis","hover",String(s.index));t.dispatch(Qh({active:!s.active,activeIndex:s.index,activeCoordinate:d}));return}var u=B9(r),f=u==="left-to-right"?1:-1,m=i==="ArrowRight"?1:-1,h=l+m*f;if(!(c==null||h>=c.length||h<0)){var g=Ud(r,"axis","hover",String(h));t.dispatch(Qh({active:!0,activeIndex:h.toString(),activeCoordinate:g}))}}}}}});Gx.startListening({actionCreator:MO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var i="0",o=Ud(r,"axis","hover",String(i));t.dispatch(Qh({active:!0,activeIndex:i,activeCoordinate:o}))}}}});var Zr=sn("externalEvent"),AO=Xl(),Um=new Map;AO.startListening({actionCreator:Zr,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){n.persist();var s=n.type,i=Um.get(s);i!==void 0&&cancelAnimationFrame(i);var o=requestAnimationFrame(()=>{try{var l=t.getState(),c={activeCoordinate:RU(l),activeDataKey:P_(l),activeIndex:zi(l),activeLabel:O_(l),activeTooltipIndex:zi(l),isTooltipActive:$U(l)};r(c,n)}finally{Um.delete(s)}});Um.set(s,o)}}});var mX=W([uo],e=>e.tooltipItemPayloads),hX=W([mX,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(i=>i.settings.graphicalItemId===r);if(n!=null){var{getPosition:s}=n;if(s!=null)return s(t)}}}),EO=sn("touchMove"),DO=Xl();DO.startListening({actionCreator:EO,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var n=t.getState(),s=Px(n,n.tooltip.settings.shared);if(s==="axis"){var i=r.touches[0];if(i==null)return;var o=Kx(n,Yx({clientX:i.clientX,clientY:i.clientY,currentTarget:r.currentTarget}));(o==null?void 0:o.activeIndex)!=null&&t.dispatch(g_({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate}))}else if(s==="item"){var l,c=r.touches[0];if(document.elementFromPoint==null||c==null)return;var d=document.elementFromPoint(c.clientX,c.clientY);if(!d||!d.getAttribute)return;var u=d.getAttribute(qL),f=(l=d.getAttribute(HL))!==null&&l!==void 0?l:void 0,m=fo(n).find(x=>x.id===f);if(u==null||m==null||f==null)return;var{dataKey:h}=m,g=hX(n,u,f);t.dispatch(h_({activeDataKey:h,activeIndex:u,activeCoordinate:g,activeGraphicalItemId:f}))}}}});var pX=hS({brush:hY,cartesianAxis:tY,chartData:Iq,errorBars:lG,graphicalItems:BK,layout:CL,legend:EF,options:Mq,polarAxis:oK,polarOptions:fX,referenceElements:vY,rootProps:lX,tooltip:Z9,zIndex:vq}),gX=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Q6({reducer:pX,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([SO.middleware,CO.middleware,Gx.middleware,AO.middleware,DO.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(PS({type:"raf"}))},devTools:{serialize:{replacer:oX},name:"recharts-".concat(r)}})};function xX(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=Ir(),i=p.useRef(null);if(s)return r;i.current==null&&(i.current=gX(t,n));var o=Sg;return p.createElement($G,{context:o,store:i.current},r)}function vX(e){var{layout:t,margin:r}=e,n=St(),s=Ir();return p.useEffect(()=>{s||(n(NL(t)),n(jL(r)))},[n,s,t,r]),null}var yX=p.memo(vX,Hx);function bX(e){var t=St();return p.useEffect(()=>{t(cX(e))},[t,e]),null}function Rw(e){var{zIndex:t,isPanorama:r}=e,n=p.useRef(null),s=St();return p.useLayoutEffect(()=>(n.current&&s(gq({zIndex:t,element:n.current,isPanorama:r})),()=>{s(xq({zIndex:t,isPanorama:r}))}),[s,t,r]),p.createElement("g",{tabIndex:-1,ref:n})}function $w(e){var{children:t,isPanorama:r}=e,n=_e(iq);if(!n||n.length===0)return t;var s=n.filter(o=>o<0),i=n.filter(o=>o>0);return p.createElement(p.Fragment,null,s.map(o=>p.createElement(Rw,{key:o,zIndex:o,isPanorama:r})),t,i.map(o=>p.createElement(Rw,{key:o,zIndex:o,isPanorama:r})))}var wX=["children"];function jX(e,t){if(e==null)return{};var r,n,s=NX(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function NX(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Qd(){return Qd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qd.apply(null,arguments)}var kX={width:"100%",height:"100%",display:"block"},SX=p.forwardRef((e,t)=>{var r=e2(),n=t2(),s=u2();if(!qn(r)||!qn(n))return null;var{children:i,otherAttributes:o,title:l,desc:c}=e,d,u;return o!=null&&(typeof o.tabIndex=="number"?d=o.tabIndex:d=s?0:void 0,typeof o.role=="string"?u=o.role:u=s?"application":void 0),p.createElement(yk,Qd({},o,{title:l,desc:c,role:u,tabIndex:d,width:r,height:n,style:kX,ref:t}),i)}),CX=e=>{var{children:t}=e,r=_e(uf);if(!r)return null;var{width:n,height:s,y:i,x:o}=r;return p.createElement(yk,{width:n,height:s,x:o,y:i},t)},zw=p.forwardRef((e,t)=>{var{children:r}=e,n=jX(e,wX),s=Ir();return s?p.createElement(CX,null,p.createElement($w,{isPanorama:!0},r)):p.createElement(SX,Qd({ref:t},n),p.createElement($w,{isPanorama:!1},r))});function _X(){var e=St(),[t,r]=p.useState(null),n=_e(UL);return p.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),i=s.width/t.offsetWidth;Be(i)&&i!==n&&e(SL(i))}},[t,e,n]),r}function Lw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function OX(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lw(Object(r),!0).forEach(function(n){PX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PX(e,t,r){return(t=MX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MX(e){var t=AX(e,"string");return typeof t=="symbol"?t:t+""}function AX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ga(){return Ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ga.apply(null,arguments)}var EX=()=>(qq(),null);function Zd(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var DX=p.forwardRef((e,t)=>{var r,n,s=p.useRef(null),[i,o]=p.useState({containerWidth:Zd((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Zd((n=e.style)===null||n===void 0?void 0:n.height)}),l=p.useCallback((d,u)=>{o(f=>{var m=Math.round(d),h=Math.round(u);return f.containerWidth===m&&f.containerHeight===h?f:{containerWidth:m,containerHeight:h}})},[]),c=p.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null&&typeof ResizeObserver<"u"){var{width:u,height:f}=d.getBoundingClientRect();l(u,f);var m=g=>{var x=g[0];if(x!=null){var{width:v,height:y}=x.contentRect;l(v,y)}},h=new ResizeObserver(m);h.observe(d),s.current=h}},[t,l]);return p.useEffect(()=>()=>{var d=s.current;d!=null&&d.disconnect()},[l]),p.createElement(p.Fragment,null,p.createElement(Zl,{width:i.containerWidth,height:i.containerHeight}),p.createElement("div",Ga({ref:c},e)))}),TX=p.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,i]=p.useState({containerWidth:Zd(r),containerHeight:Zd(n)}),o=p.useCallback((c,d)=>{i(u=>{var f=Math.round(c),m=Math.round(d);return u.containerWidth===f&&u.containerHeight===m?u:{containerWidth:f,containerHeight:m}})},[]),l=p.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:d,height:u}=c.getBoundingClientRect();o(d,u)}},[t,o]);return p.createElement(p.Fragment,null,p.createElement(Zl,{width:s.containerWidth,height:s.containerHeight}),p.createElement("div",Ga({ref:l},e)))}),IX=p.forwardRef((e,t)=>{var{width:r,height:n}=e;return p.createElement(p.Fragment,null,p.createElement(Zl,{width:r,height:n}),p.createElement("div",Ga({ref:t},e)))}),RX=p.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?p.createElement(TX,Ga({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?p.createElement(IX,Ga({},e,{width:r,height:n,ref:t})):p.createElement(p.Fragment,null,p.createElement(Zl,{width:r,height:n}),p.createElement("div",Ga({ref:t},e)))});function $X(e){return e?DX:RX}var zX=p.forwardRef((e,t)=>{var{children:r,className:n,height:s,onClick:i,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:d,onMouseLeave:u,onMouseMove:f,onMouseUp:m,onTouchEnd:h,onTouchMove:g,onTouchStart:x,style:v,width:y,responsive:j,dispatchTouchEvents:b=!0}=e,N=p.useRef(null),k=St(),[w,S]=p.useState(null),[C,P]=p.useState(null),M=_X(),A=Ig(),_=(A==null?void 0:A.width)>0?A.width:y,D=(A==null?void 0:A.height)>0?A.height:s,O=p.useCallback(L=>{M(L),typeof t=="function"&&t(L),S(L),P(L),L!=null&&(N.current=L)},[M,t,S,P]),R=p.useCallback(L=>{k(kO(L)),k(Zr({handler:i,reactEvent:L}))},[k,i]),F=p.useCallback(L=>{k(op(L)),k(Zr({handler:d,reactEvent:L}))},[k,d]),H=p.useCallback(L=>{k(p_()),k(Zr({handler:u,reactEvent:L}))},[k,u]),ne=p.useCallback(L=>{k(op(L)),k(Zr({handler:f,reactEvent:L}))},[k,f]),G=p.useCallback(()=>{k(MO())},[k]),oe=p.useCallback(L=>{k(PO(L.key))},[k]),ce=p.useCallback(L=>{k(Zr({handler:o,reactEvent:L}))},[k,o]),B=p.useCallback(L=>{k(Zr({handler:l,reactEvent:L}))},[k,l]),Y=p.useCallback(L=>{k(Zr({handler:c,reactEvent:L}))},[k,c]),U=p.useCallback(L=>{k(Zr({handler:m,reactEvent:L}))},[k,m]),X=p.useCallback(L=>{k(Zr({handler:x,reactEvent:L}))},[k,x]),$=p.useCallback(L=>{b&&k(EO(L)),k(Zr({handler:g,reactEvent:L}))},[k,b,g]),K=p.useCallback(L=>{k(Zr({handler:h,reactEvent:L}))},[k,h]),V=$X(j);return p.createElement(R_.Provider,{value:w},p.createElement(lz.Provider,{value:C},p.createElement(V,{width:_??(v==null?void 0:v.width),height:D??(v==null?void 0:v.height),className:Je("recharts-wrapper",n),style:OX({position:"relative",cursor:"default",width:_,height:D},v),onClick:R,onContextMenu:ce,onDoubleClick:B,onFocus:G,onKeyDown:oe,onMouseDown:Y,onMouseEnter:F,onMouseLeave:H,onMouseMove:ne,onMouseUp:U,onTouchEnd:K,onTouchMove:$,onTouchStart:X,ref:O},p.createElement(EX,null),r)))}),LX=["width","height","responsive","children","className","style","compact","title","desc"];function FX(e,t){if(e==null)return{};var r,n,s=BX(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function BX(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var WX=p.forwardRef((e,t)=>{var{width:r,height:n,responsive:s,children:i,className:o,style:l,compact:c,title:d,desc:u}=e,f=FX(e,LX),m=ha(f);return c?p.createElement(p.Fragment,null,p.createElement(Zl,{width:r,height:n}),p.createElement(zw,{otherAttributes:m,title:d,desc:u},i)):p.createElement(zX,{className:o,style:l,width:r,height:n,responsive:s??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},p.createElement(zw,{otherAttributes:m,title:d,desc:u,ref:t},p.createElement(bY,null,i)))});function lp(){return lp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lp.apply(null,arguments)}var UX={top:5,right:5,bottom:5,left:5},qX={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:UX,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},HX=p.forwardRef(function(t,r){var n,s=Yr(t.categoricalChartProps,qX),{chartName:i,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:d}=t,u={chartName:i,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return p.createElement(xX,{preloadedState:{options:u},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:i},p.createElement(mY,{chartData:d.data}),p.createElement(yX,{layout:s.layout,margin:s.margin}),p.createElement(bX,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),p.createElement(WX,lp({},s,{ref:r})))}),KX=["axis","item"],Jd=p.forwardRef((e,t)=>p.createElement(HX,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:KX,tooltipPayloadSearcher:Oq,categoricalChartProps:e,ref:t}));const TO={all:["reporting"],timeLogs:e=>[...TO.all,"time-logs",e]};function IO(e,t){return Le({queryKey:TO.timeLogs(e),queryFn:()=>{const r=new URLSearchParams;return Object.entries(e).forEach(([n,s])=>{s&&r.set(n,s)}),te.get(`/admin/reporting/time-logs?${r}`)},enabled:(t==null?void 0:t.enabled)??(Object.values(e).some(Boolean)||!!e.workspace_id)})}function eu({value:e,onChange:t,placeholder:r="Pick a date",className:n}){return a.jsxs(jt,{children:[a.jsx(Nt,{asChild:!0,children:a.jsxs(Z,{variant:"outline",className:T("h-8 w-36 justify-start text-left font-normal text-xs gap-1.5",!e&&"text-muted-foreground",n),children:[a.jsx(cr,{className:"h-3.5 w-3.5 shrink-0"}),e?ue(e,"MMM d, yyyy"):a.jsx("span",{children:r}),e&&a.jsx("span",{role:"button",className:"ml-auto hover:text-foreground",onClick:s=>{s.stopPropagation(),t(void 0)},children:a.jsx(nt,{className:"h-3 w-3"})})]})}),a.jsx(yt,{className:"w-auto p-0",align:"start",children:a.jsx(dr,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]})}function cp({options:e,selected:t,onSelectionChange:r,placeholder:n="Select…",className:s}){var d;const[i,o]=p.useState(!1);function l(u){t.includes(u)?r(t.filter(f=>f!==u)):r([...t,u])}const c=t.length===0?null:t.length===1?(d=e.find(u=>u.value===t[0]))==null?void 0:d.label:`${t.length} selected`;return a.jsxs(jt,{open:i,onOpenChange:o,children:[a.jsx(Nt,{asChild:!0,children:a.jsxs(Z,{variant:"outline",role:"combobox","aria-expanded":i,className:T("h-8 justify-between text-xs font-normal min-w-36",!c&&"text-muted-foreground",s),children:[a.jsx("span",{className:"truncate",children:c??n}),a.jsx(Ui,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),a.jsxs(yt,{className:"w-56 p-0",align:"start",children:[a.jsxs(Os,{children:[a.jsx(Pu,{placeholder:"Search…",className:"h-8 text-xs"}),a.jsxs(Ps,{children:[a.jsx(Mu,{className:"text-xs py-4 text-center text-muted-foreground",children:"No results."}),a.jsx(Ka,{children:e.map(u=>a.jsxs(en,{value:u.label,onSelect:()=>l(u.value),className:"text-xs cursor-pointer",children:[a.jsx(lr,{className:T("mr-2 h-3.5 w-3.5",t.includes(u.value)?"opacity-100":"opacity-0")}),u.label]},u.value))})]})]}),t.length>0&&a.jsx("div",{className:"border-t p-2",children:a.jsxs(Z,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs text-muted-foreground",onClick:()=>r([]),children:[a.jsx(nt,{className:"h-3 w-3 mr-1"}),"Clear all"]})})]})]})}function Uo(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function Fw({active:e,payload:t,label:r}){var n;return!e||!(t!=null&&t.length)?null:a.jsxs("div",{className:"bg-popover border border-border rounded-lg px-3 py-2 text-xs shadow-lg",children:[a.jsx("p",{className:"font-medium mb-0.5",children:r}),a.jsx("p",{className:"text-muted-foreground",children:Uo(((n=t[0])==null?void 0:n.value)??0)})]})}function YX({workspaceId:e}){const[t,r]=p.useState(void 0),[n,s]=p.useState(void 0),[i,o]=p.useState([]),[l,c]=p.useState([]),{workspace:d}=De(),u=(d==null?void 0:d.slug)??"",{data:f=[],isLoading:m}=Du(),{data:h=[],isLoading:g}=Gi(),{data:x}=Js(),v=t?ue(t,"yyyy-MM-dd"):void 0,y=n?ue(n,"yyyy-MM-dd"):void 0,j=p.useMemo(()=>new Map(h.map(O=>[O.id,O])),[h]),{data:b,isLoading:N}=IO({from:v,to:y,workspace_id:e},{enabled:!0}),k=(b==null?void 0:b.time_logs)??[],w=p.useMemo(()=>{let O=k;return i.length>0&&(O=O.filter(R=>i.includes(R.user_id))),l.length>0&&(O=O.filter(R=>R.project_id&&l.includes(R.project_id))),O},[k,i,l]),S=w.reduce((O,R)=>O+(R.duration_minutes??0),0),C=p.useMemo(()=>new Set(w.map(O=>O.user_id)).size,[w]),P=p.useMemo(()=>new Set(w.map(O=>O.project_id).filter(Boolean)).size,[w]),M=p.useMemo(()=>{const O=new Map;for(const R of w)O.set(R.user_id,(O.get(R.user_id)??0)+(R.duration_minutes??0));return Array.from(O.entries()).map(([R,F])=>{var H;return{name:((H=x==null?void 0:x.get(R))==null?void 0:H.name)??"Unknown",minutes:F}}).sort((R,F)=>F.minutes-R.minutes).slice(0,8)},[w,x]),A=p.useMemo(()=>{const O=new Map;for(const R of w){const F=R.project_id??"__none__";O.set(F,(O.get(F)??0)+(R.duration_minutes??0))}return Array.from(O.entries()).map(([R,F])=>{var H;return{name:R==="__none__"?"No project":((H=j.get(R))==null?void 0:H.name)??"Unknown",minutes:F}}).sort((R,F)=>F.minutes-R.minutes).slice(0,8)},[w,j]),_=p.useMemo(()=>f.map(O=>({value:O.id,label:[O.first_name,O.last_name].filter(Boolean).join(" ")||O.email})),[f]),D=p.useMemo(()=>h.map(O=>({value:O.id,label:O.name})),[h]);return a.jsxs("div",{className:"p-2 space-y-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-6 py-4 flex items-center gap-3",children:[a.jsx("div",{className:"h-9 w-9 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(Xa,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold",children:"Time Logs"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Filter by date range, employees, and projects to analyze time across the organization."})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-4 py-3 flex items-center gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Wi,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Date range"})]}),a.jsx(eu,{value:t,onChange:r,placeholder:"From"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"→"}),a.jsx(eu,{value:n,onChange:s,placeholder:"To"}),a.jsx("div",{className:"w-px h-5 bg-border mx-1 shrink-0"}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Wa,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Employees"})]}),m?a.jsx(le,{className:"h-8 w-40"}):a.jsx(cp,{options:_,selected:i,onSelectionChange:o,placeholder:"All employees",className:"w-44"}),a.jsx("div",{className:"w-px h-5 bg-border mx-1 shrink-0"}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Er,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Projects"})]}),g?a.jsx(le,{className:"h-8 w-40"}):a.jsx(cp,{options:D,selected:l,onSelectionChange:c,placeholder:"All projects",className:"w-44"})]}),N?a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden divide-y divide-border",children:[1,2,3,4].map(O=>a.jsxs("div",{className:"px-6 py-4 flex items-center gap-4",children:[a.jsx(le,{className:"h-4 w-24"}),a.jsx(le,{className:"h-4 w-32"}),a.jsx(le,{className:"h-4 w-48"})]},O))}):w.length===0?a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Yn,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No time logs found"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:v||y||i.length>0||l.length>0?"Try adjusting your filters.":"No time has been logged yet."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Total time"}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:Uo(S)})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Employees"}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:C})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Projects"}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:P})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[M.length>0&&a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(Wa,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by employee"})]}),a.jsx(bd,{width:"100%",height:Math.max(80,M.length*36),children:a.jsxs(Jd,{data:M,layout:"vertical",margin:{left:0,right:40,top:0,bottom:0},children:[a.jsx(pl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(xl,{type:"number",tickFormatter:O=>Uo(O),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(vl,{type:"category",dataKey:"name",width:100,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(qd,{content:a.jsx(Fw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(gl,{dataKey:"minutes",fill:"#6366f1",radius:[0,4,4,0]})]})})]}),A.length>0&&a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(Er,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by project"})]}),a.jsx(bd,{width:"100%",height:Math.max(80,A.length*36),children:a.jsxs(Jd,{data:A,layout:"vertical",margin:{left:0,right:40,top:0,bottom:0},children:[a.jsx(pl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(xl,{type:"number",tickFormatter:O=>Uo(O),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(vl,{type:"category",dataKey:"name",width:100,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(qd,{content:a.jsx(Fw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(gl,{dataKey:"minutes",fill:"#6366f1",radius:[0,4,4,0]})]})})]})]}),a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Employee"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Project"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issue"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Date"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Description"}),a.jsx("th",{className:"text-right px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Duration"})]})}),a.jsx("tbody",{className:"divide-y divide-border",children:w.map(O=>{var H;const R=O.project_id?j.get(O.project_id):void 0,F=((H=x==null?void 0:x.get(O.user_id))==null?void 0:H.name)??O.user_id.slice(0,8)+"…";return a.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[a.jsx("td",{className:"px-6 py-3 text-xs font-medium",children:F}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:(R==null?void 0:R.name)??(O.project_id?"Unknown":"—")}),a.jsx("td",{className:"px-6 py-3",children:O.issue_identifier?a.jsx(Va,{to:`/${u}/projects/${R==null?void 0:R.identifier}/issues/${O.issue_id}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline",children:O.issue_identifier}):a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[O.issue_id.slice(0,8),"…"]})}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground tabular-nums whitespace-nowrap",children:O.logged_date?ue(new Date(O.logged_date),"MMM d, yyyy"):"—"}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground truncate max-w-xs",children:O.description??a.jsx("span",{className:"italic",children:"—"})}),a.jsx("td",{className:"px-6 py-3 text-xs text-right tabular-nums font-semibold",children:O.duration_minutes!=null?Uo(O.duration_minutes):"Running…"})]},O.id)})})]})})]})]})}function hi(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function Bw({active:e,payload:t,label:r}){var n;return!e||!(t!=null&&t.length)?null:a.jsxs("div",{className:"bg-popover border border-border rounded-lg px-3 py-2 text-xs shadow-lg",children:[a.jsx("p",{className:"font-medium mb-0.5",children:r}),a.jsx("p",{className:"text-muted-foreground",children:hi(((n=t[0])==null?void 0:n.value)??0)})]})}function GX(){const{projectKey:e,workspace:t}=qt(),[r,n]=p.useState(void 0),[s,i]=p.useState(void 0),[o,l]=p.useState([]),{data:c}=ka(e??""),{data:d}=Js(),{data:u=[]}=Du(),f=r?ue(r,"yyyy-MM-dd"):void 0,m=s?ue(s,"yyyy-MM-dd"):void 0,{data:h,isLoading:g}=IO({project_id:c==null?void 0:c.id,from:f,to:m}),x=(h==null?void 0:h.time_logs)??[],v=p.useMemo(()=>o.length>0?x.filter(C=>o.includes(C.user_id)):x,[x,o]),y=p.useMemo(()=>v.reduce((C,P)=>C+(P.duration_minutes??0),0),[v]),j=p.useMemo(()=>{const C=new Map;for(const P of v){C.has(P.user_id)||C.set(P.user_id,{logs:[],totalMinutes:0});const M=C.get(P.user_id);M.logs.push(P),M.totalMinutes+=P.duration_minutes??0}return C},[v]),b=p.useMemo(()=>{const C=new Map;for(const P of v){C.has(P.issue_id)||C.set(P.issue_id,{logs:[],totalMinutes:0});const M=C.get(P.issue_id);M.logs.push(P),M.totalMinutes+=P.duration_minutes??0}return C},[v]),N=Array.from(j.entries()).sort((C,P)=>P[1].totalMinutes-C[1].totalMinutes).slice(0,8).map(([C,{totalMinutes:P}])=>{var M;return{name:((M=d==null?void 0:d.get(C))==null?void 0:M.name)??"Unknown",minutes:P}}),k=Array.from(b.entries()).sort((C,P)=>P[1].totalMinutes-C[1].totalMinutes).slice(0,8).map(([C,{totalMinutes:P,logs:M}])=>{var A;return{name:((A=M[0])==null?void 0:A.issue_identifier)??C.slice(0,8),minutes:P}}),w=p.useMemo(()=>u.map(C=>({value:C.id,label:[C.first_name,C.last_name].filter(Boolean).join(" ")||C.email})),[u]),S=v.length>0;return a.jsxs("div",{className:"p-2 space-y-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-4 py-3 flex items-center gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Wi,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Date range"})]}),a.jsx(eu,{value:r,onChange:n,placeholder:"From"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"→"}),a.jsx(eu,{value:s,onChange:i,placeholder:"To"}),a.jsx("div",{className:"w-px h-4 bg-border"}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Wa,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Employee"})]}),a.jsx(cp,{options:w,selected:o,onSelectionChange:l,placeholder:"All employees",className:"w-44"})]}),a.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{label:"Total logged",value:y>0?hi(y):"—",icon:Yn},{label:"Contributors",value:j.size>0?String(j.size):"—",icon:Wa},{label:"Issues tracked",value:b.size>0?String(b.size):"—",icon:ua}].map(({label:C,value:P,icon:M})=>a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[a.jsx(M,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider font-medium",children:C})]}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:P})]},C))}),g?a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(C=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-7 w-7 rounded-full"}),a.jsx(le,{className:"h-4 w-40"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-4 w-20"})]},C))})}):c!=null&&c.id?S?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[j.size>0&&a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(Wa,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by user"})]}),a.jsx(bd,{width:"100%",height:Math.max(100,N.length*36),children:a.jsxs(Jd,{data:N,layout:"vertical",margin:{left:0,right:32,top:0,bottom:0},children:[a.jsx(pl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(xl,{type:"number",tickFormatter:C=>hi(C),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(vl,{type:"category",dataKey:"name",width:88,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(qd,{content:a.jsx(Bw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(gl,{dataKey:"minutes",fill:"#6366f1",radius:[0,4,4,0]})]})})]}),b.size>0&&a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(ua,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by issue"})]}),a.jsx(bd,{width:"100%",height:Math.max(100,k.length*36),children:a.jsxs(Jd,{data:k,layout:"vertical",margin:{left:0,right:32,top:0,bottom:0},children:[a.jsx(pl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(xl,{type:"number",tickFormatter:C=>hi(C),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(vl,{type:"category",dataKey:"name",width:64,tick:{fontSize:11,fill:"hsl(var(--foreground))",fontFamily:"monospace"},axisLine:!1,tickLine:!1}),a.jsx(qd,{content:a.jsx(Bw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(gl,{dataKey:"minutes",fill:"#818cf8",radius:[0,4,4,0]})]})})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 border-b border-border",children:[a.jsx(Wa,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by user"})]}),a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[a.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"User"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issues"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Total"})]})}),a.jsx("tbody",{className:"divide-y divide-border",children:Array.from(j.entries()).sort((C,P)=>P[1].totalMinutes-C[1].totalMinutes).map(([C,{logs:P,totalMinutes:M}])=>{const A=d==null?void 0:d.get(C),_=new Set(P.map(D=>D.issue_id)).size;return a.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[a.jsx("td",{className:"px-6 py-3 text-sm font-medium",children:(A==null?void 0:A.name)??C.slice(0,8)+"…"}),a.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:_}),a.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:hi(M)})]},C)})})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 border-b border-border",children:[a.jsx(ua,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by issue"})]}),a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[a.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issue"}),a.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Last logged"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Contributors"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Total"})]})}),a.jsx("tbody",{className:"divide-y divide-border",children:Array.from(b.entries()).sort((C,P)=>P[1].totalMinutes-C[1].totalMinutes).map(([C,{logs:P,totalMinutes:M}])=>{var R,F;const A=new Set(P.map(H=>H.user_id)).size,_=P.reduce((H,ne)=>ne.logged_date&&(!H||new Date(ne.logged_date)>new Date(H))?ne.logged_date:H,null),D=(R=P[0])==null?void 0:R.issue_identifier,O=(F=P[0])==null?void 0:F.issue_title;return a.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[a.jsx("td",{className:"px-6 py-3",children:a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[D?a.jsx(Va,{to:`/${t}/projects/${e}/issues/${C}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline shrink-0",children:D}):a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[C.slice(0,8),"…"]}),O&&a.jsx("span",{className:"text-xs text-muted-foreground truncate",children:O})]})}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:_?ue(new Date(_),"MMM d, yyyy"):"—"}),a.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:A}),a.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:hi(M)})]},C)})})]})]})]}):a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Xa,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No time logged"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:f||m||o.length>0?"No entries match the current filters.":"Start logging time on issues to see reports here."})]}):a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl flex items-center justify-center py-12",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading project…"})})]})}const VX={share_enabled:{icon:Zm,color:"text-green-600",bg:"bg-green-50 dark:bg-green-950/40",label:()=>"Enabled public link"},share_revoked:{icon:yE,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:()=>"Revoked public link"},member_added:{icon:Ki,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40",label:(e,t)=>{var i,o,l;const r=(i=e==null?void 0:e.user_id)==null?void 0:i.to,n=(o=e==null?void 0:e.role)==null?void 0:o.to,s=r?((l=t.get(r))==null?void 0:l.name)??r:"a user";return n?`Added ${s} as ${n}`:`Added ${s}`}},member_removed:{icon:h1,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:(e,t)=>{var s,i;const r=(s=e==null?void 0:e.user_id)==null?void 0:s.from;return`Removed ${r?((i=t.get(r))==null?void 0:i.name)??r:"a user"}`}},team_added:{icon:Wa,color:"text-indigo-500",bg:"bg-indigo-50 dark:bg-indigo-950/40",label:(e,t,r)=>{var i;const n=(i=e==null?void 0:e.team_id)==null?void 0:i.to;return`Added team ${n?r.get(n)??n:"a team"}`}},team_removed:{icon:BE,color:"text-orange-500",bg:"bg-orange-50 dark:bg-orange-950/40",label:(e,t,r)=>{var i;const n=(i=e==null?void 0:e.team_id)==null?void 0:i.from;return`Removed team ${n?r.get(n)??n:"a team"}`}},status_updated:{icon:EE,color:"text-violet-500",bg:"bg-violet-50 dark:bg-violet-950/40",label:e=>{var n,s;const t=(n=e==null?void 0:e.name)==null?void 0:n.from,r=(s=e==null?void 0:e.name)==null?void 0:s.to;return t&&r?`Renamed status "${t}" to "${r}"`:"Updated status"}},status_deleted:{icon:Hr,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:e=>{var r;const t=(r=e==null?void 0:e.name)==null?void 0:r.from;return t?`Deleted status "${t}"`:"Deleted status"}},updated:{icon:Ds,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40",label:()=>"Updated project"},created:{icon:it,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40",label:()=>"Created project"}},XX={icon:cu,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800",label:()=>"Activity"};function QX({activity:e,userMap:t,teamMap:r}){const n=VX[e.action]??XX,s=n.icon,i=t.get(e.actor_id),o=(i==null?void 0:i.name)??"System",l=(i==null?void 0:i.initials)??"S",c=n.label(e.changes,t,r),d=(()=>{var u,f;if(e.action==="share_enabled"){const m=(f=(u=e.changes)==null?void 0:u.share_url)==null?void 0:f.to;return m?a.jsx("span",{className:"text-xs text-muted-foreground/60 font-mono break-all",children:m}):null}return null})();return a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors",children:[a.jsx("div",{className:T("h-8 w-8 rounded-full flex items-center justify-center shrink-0",n.bg),children:a.jsx(s,{className:T("h-4 w-4",n.color)})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Bt,{className:"h-5 w-5 shrink-0",children:a.jsx(Wt,{className:"text-[10px] font-medium",children:l})}),a.jsx("span",{className:"text-sm font-medium truncate",children:o}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:c})]}),d&&a.jsx("div",{className:"mt-0.5 pl-7",children:d})]}),a.jsx("time",{className:"text-xs text-muted-foreground shrink-0",children:ue(new Date(e.created_at),"MMM d, yyyy · h:mm a")})]})}function ZX(){const{projectKey:e}=qt(),{workspace:t}=De(),{data:r}=ka(e??""),{data:n,isLoading:s}=MD((r==null?void 0:r.id)??""),{data:i=new Map}=Js(),{data:o=[]}=xu((t==null?void 0:t.id)??""),l=new Map(o.map(d=>[d.id,d.name])),c=(n==null?void 0:n.length)??0;return a.jsx("div",{className:"p-2",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold",children:"Activity"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"A log of share access changes, member updates, and project edits."})]}),!s&&c>0&&a.jsxs("p",{className:"text-xs text-muted-foreground shrink-0",children:[c," event",c!==1?"s":""]})]}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Log"})}),s?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(d=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-8 w-8 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-4 w-48"}),a.jsx(le,{className:"h-3 w-64"})]}),a.jsx(le,{className:"h-3 w-32 shrink-0"})]},d))}):!n||n.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx(cu,{className:"h-8 w-8 text-muted-foreground/20 mb-3"}),a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"No activity yet"}),a.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Actions like sharing the project or adding members will appear here."})]}):a.jsx("div",{className:"divide-y divide-border",children:n.map(d=>a.jsx(QX,{activity:d,userMap:i,teamMap:l},d.id))})]})})}const JX=[{key:"mon",label:"Monday",short:"Mon"},{key:"tue",label:"Tuesday",short:"Tue"},{key:"wed",label:"Wednesday",short:"Wed"},{key:"thu",label:"Thursday",short:"Thu"},{key:"fri",label:"Friday",short:"Fri"},{key:"sat",label:"Saturday",short:"Sat"},{key:"sun",label:"Sunday",short:"Sun"}],eQ={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function tQ({open:e,onClose:t,holiday:r}){const[n,s]=p.useState((r==null?void 0:r.name)??""),[i,o]=p.useState(r!=null&&r.date?r.date.split("T")[0]:""),[l,c]=p.useState((r==null?void 0:r.recurring)??!1);p.useEffect(()=>{e&&(s((r==null?void 0:r.name)??""),o(r!=null&&r.date?r.date.split("T")[0]:""),c((r==null?void 0:r.recurring)??!1))},[e,r==null?void 0:r.id]);const d=aI(),u=sI(),f=d.isPending||u.isPending,m=h=>{if(h.preventDefault(),!n.trim()){z.error("Holiday name is required");return}if(!i){z.error("Date is required");return}r?u.mutate({id:r.id,name:n.trim(),date:i,recurring:l},{onSuccess:()=>{z.success("Holiday updated"),t()},onError:()=>z.error("Failed to update holiday")}):d.mutate({name:n.trim(),date:i,recurring:l},{onSuccess:()=>{z.success("Holiday added"),t()},onError:()=>z.error("Failed to add holiday")})};return a.jsx(Gs,{open:e,onOpenChange:h=>!h&&t(),children:a.jsxs(as,{className:"sm:max-w-md",children:[a.jsxs(Vs,{children:[a.jsx(Xs,{children:r?"Edit holiday":"Add holiday"}),a.jsx(El,{children:"Holidays are excluded from business day calculations across the app."})]}),a.jsxs("form",{onSubmit:m,className:"space-y-4 pt-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),a.jsx(Ee,{value:n,onChange:h=>s(h.target.value),placeholder:"e.g. New Year's Day",className:"h-9",autoFocus:!0,required:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Date"}),a.jsx(Ee,{type:"date",value:i,onChange:h=>o(h.target.value),className:"h-9",required:!0})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(to,{checked:l,onCheckedChange:h=>c(h)}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Recurring annually (applies every year on the same date)"})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(Z,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(Z,{type:"submit",size:"sm",disabled:f,children:f?r?"Saving…":"Adding…":r?"Save changes":"Add holiday"})]})]})]})})}function rQ(){const{data:e,isLoading:t}=Xp(),r=nI(),n=(e==null?void 0:e.working_days)??eQ,s=(i,o)=>{const l={...n,[i]:o};r.mutate({working_days:l},{onSuccess:()=>z.success("Working days updated"),onError:()=>z.error("Failed to update working days")})};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Working days"})}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure which days count as business days. This affects duration calculations across the app."})}),t?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3,4,5,6,7].map(i=>a.jsx(le,{className:"h-8 w-full"},i))}):JX.map(({key:i,label:o})=>{const l=n[i];return a.jsxs("div",{className:"grid grid-cols-[180px_1fr_auto] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:o}),a.jsx("span",{className:T("text-xs font-medium",l?"text-foreground":"text-muted-foreground/60"),children:l?"Working day":"Not a working day"}),a.jsx(to,{checked:l,onCheckedChange:c=>s(i,c),disabled:r.isPending})]},i)})]})}function nQ(){const[e,t]=p.useState(new Date().getFullYear()),[r,n]=p.useState(!1),[s,i]=p.useState(null),[o,l]=p.useState(null),{data:c=[],isLoading:d}=Qp(e),u=iI(),f=()=>{o&&u.mutate(o.id,{onSuccess:()=>{z.success("Holiday removed"),l(null)},onError:()=>z.error("Failed to remove holiday")})},m=[...c].sort((h,g)=>{const x=new Date(h.date).getMonth()*100+new Date(h.date).getDate(),v=new Date(g.date).getMonth()*100+new Date(g.date).getDate();return x-v});return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-2 border-b border-border bg-muted/20",children:[a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Holidays"}),a.jsxs(Z,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[a.jsx(it,{className:"h-3.5 w-3.5"}),"Add holiday"]})]}),a.jsxs("div",{className:"flex items-center gap-1 px-6 py-3 border-b border-border bg-muted/10",children:[a.jsxs("p",{className:"text-xs text-muted-foreground flex-1",children:["Showing holidays for"," ",a.jsx("span",{className:"font-medium text-foreground",children:e}),". Recurring holidays appear every year."]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>t(h=>h-1),className:"h-6 w-6 flex items-center justify-center rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(du,{className:"h-3.5 w-3.5"})}),a.jsx("span",{className:"text-xs font-medium tabular-nums w-10 text-center",children:e}),a.jsx("button",{onClick:()=>t(h=>h+1),className:"h-6 w-6 flex items-center justify-center rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(kn,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"grid grid-cols-[160px_1fr_120px_40px] gap-4 px-6 py-2 border-b border-border bg-muted/20",children:[a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Date"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Name"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Recurrence"}),a.jsx("span",{})]}),d?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(h=>a.jsx(le,{className:"h-8 w-full"},h))}):m.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-6 text-center",children:[a.jsx(e1,{className:"h-8 w-8 text-muted-foreground/40 mb-3"}),a.jsxs("p",{className:"text-sm font-medium mb-1",children:["No holidays for ",e]}),a.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Add a holiday or use the year navigation to view other years."}),a.jsxs(Z,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[a.jsx(it,{className:"h-3.5 w-3.5"}),"Add holiday"]})]}):m.map(h=>{const g=new Date(h.date);return a.jsxs("div",{className:"grid grid-cols-[160px_1fr_120px_40px] gap-4 items-center px-6 py-3.5 border-b border-border hover:bg-muted/20 transition-colors",children:[a.jsx("span",{className:"text-sm tabular-nums text-muted-foreground",children:ue(g,"MMM d, yyyy")}),a.jsx("span",{className:"text-sm font-medium truncate",children:h.name}),a.jsx("span",{className:"text-sm",children:h.recurring?a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(Go,{className:"h-3 w-3"}),"Every year"]}):a.jsx("span",{className:"text-xs text-muted-foreground/60",children:"One-time"})}),a.jsx("div",{className:"flex justify-end",children:a.jsxs(ln,{children:[a.jsx(cn,{asChild:!0,children:a.jsx("button",{className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:a.jsx(Ys,{className:"h-3.5 w-3.5"})})}),a.jsxs(Kr,{align:"end",className:"w-36",children:[a.jsxs(ht,{className:"gap-2 cursor-pointer",onClick:()=>{i(h),n(!0)},children:[a.jsx(Ds,{className:"h-3.5 w-3.5"}),"Edit"]}),a.jsxs(ht,{className:"gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>l(h),children:[a.jsx(Hr,{className:"h-3.5 w-3.5"}),"Remove"]})]})]})})]},h.id)}),a.jsx(tQ,{open:r,onClose:()=>{n(!1),i(null)},holiday:s}),a.jsx(Wu,{open:!!o,onOpenChange:h=>!h&&l(null),children:a.jsxs(Bl,{children:[a.jsxs(Wl,{children:[a.jsxs(ql,{children:['Remove "',o==null?void 0:o.name,'"?']}),a.jsx(Hl,{children:"This holiday will no longer be excluded from business day calculations."})]}),a.jsxs(Ul,{children:[a.jsx(Yl,{children:"Cancel"}),a.jsx(Kl,{onClick:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]})})]})}function aQ(){const[e,t]=p.useState("working-days"),r=[{id:"working-days",label:"Working Days"},{id:"holidays",label:"Holidays"}];return a.jsx("div",{className:"p-2 h-full",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col h-full",children:[a.jsx("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(e1,{className:"h-5 w-5 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-base font-semibold",children:"Organization Settings"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Global configuration that applies across the entire Meridian deployment."})]})]})}),a.jsx("div",{className:"flex border-b border-border shrink-0 px-6",children:r.map(n=>a.jsx("button",{onClick:()=>t(n.id),className:T("px-1 py-3 mr-6 text-sm font-medium border-b-2 transition-colors",e===n.id?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:n.label},n.id))}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="working-days"&&a.jsx(rQ,{}),e==="holidays"&&a.jsx(nQ,{})]})]})})}const qm=e=>{let{transform:t}=e;return{...t,y:0}};function Vx(){const[e,t]=p.useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0}),r=p.useRef(null);return p.useLayoutEffect(()=>{const n=s=>{var o;let i={x:s.pageX,y:s.pageY};if(((o=r.current)==null?void 0:o.nodeType)===Node.ELEMENT_NODE){const{left:l,top:c}=r.current.getBoundingClientRect(),d=l+window.scrollX,u=c+window.scrollY,f=s.pageX-d,m=s.pageY-u;i.elementX=f,i.elementY=m,i.elementPositionX=d,i.elementPositionY=u}t(l=>({...l,...i}))};return document.addEventListener("mousemove",n),()=>{document.removeEventListener("mousemove",n)}},[]),[e,r]}function sQ(e,t=500){const[r,n]=p.useState(e),s=p.useRef(null);return p.useEffect(()=>{const i=Date.now();if(s.current&&i>=s.current+t)s.current=i,n(e);else{const o=window.setTimeout(()=>{s.current=i,n(e)},t);return()=>window.clearTimeout(o)}},[e,t]),r}function iQ(){const[e,t]=p.useState({x:null,y:null}),r=p.useCallback((...n)=>{if(typeof n[0]=="object")window.scrollTo(n[0]);else if(typeof n[0]=="number"&&typeof n[1]=="number")window.scrollTo(n[0],n[1]);else throw new Error("Invalid arguments passed to scrollTo. See here for more info. https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo")},[]);return p.useLayoutEffect(()=>{const n=()=>{t({x:window.scrollX,y:window.scrollY})};return n(),window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}},[]),[e,r]}const Rn={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function RO(e){return"init"in e}function dp(e){return!!e.write}function Ww(e){return"v"in e||"e"in e}function tu(e){if("e"in e)throw e.e;if((Rn?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function ru(e){return typeof(e==null?void 0:e.then)=="function"}function $O(e,t,r){if(!r.p.has(e)){r.p.add(e);const n=()=>r.p.delete(e);t.then(n,n)}}function zO(e,t,r){var n;const s=new Set;for(const i of((n=r.get(e))==null?void 0:n.t)||[])s.add(i);for(const i of t.p)s.add(i);return s}const oQ=(e,t,...r)=>t.read(...r),lQ=(e,t,...r)=>t.write(...r),cQ=(e,t)=>{var r;return(r=t.INTERNAL_onInit)==null?void 0:r.call(t,e)},dQ=(e,t,r)=>{var n;return(n=t.onMount)==null?void 0:n.call(t,r)},uQ=(e,t)=>{var r;const n=It(e),s=n[0],i=n[6],o=n[9];if((Rn?"production":void 0)!=="production"&&!t)throw new Error("Atom is undefined or null");let l=s.get(t);return l||(l={d:new Map,p:new Set,n:0},s.set(t,l),(r=i.i)==null||r.call(i,t),o==null||o(e,t)),l},fQ=e=>{const t=It(e),r=t[1],n=t[3],s=t[4],i=t[5],o=t[6],l=t[13],c=[],d=u=>{try{u()}catch(f){c.push(f)}};do{o.f&&d(o.f);const u=new Set,f=u.add.bind(u);n.forEach(m=>{var h;return(h=r.get(m))==null?void 0:h.l.forEach(f)}),n.clear(),i.forEach(f),i.clear(),s.forEach(f),s.clear(),u.forEach(d),n.size&&l(e)}while(n.size||i.size||s.size);if(c.length)throw new AggregateError(c)},mQ=e=>{const t=It(e),r=t[1],n=t[2],s=t[3],i=t[11],o=t[14],l=t[17],c=[],d=new WeakSet,u=new WeakSet,f=Array.from(s);for(;f.length;){const m=f[f.length-1],h=i(e,m);if(u.has(m)){f.pop();continue}if(d.has(m)){if(n.get(m)===h.n)c.push([m,h]);else if((Rn?"production":void 0)!=="production"&&n.has(m))throw new Error("[Bug] invalidated atom exists");u.add(m),f.pop();continue}d.add(m);for(const g of zO(m,h,r))d.has(g)||f.push(g)}for(let m=c.length-1;m>=0;--m){const[h,g]=c[m];let x=!1;for(const v of g.d.keys())if(v!==h&&s.has(v)){x=!0;break}x&&(o(e,h),l(e,h)),n.delete(h)}},up=new WeakSet,hQ=(e,t)=>{var r,n;const s=It(e),i=s[1],o=s[2],l=s[3],c=s[6],d=s[7],u=s[11],f=s[12],m=s[13],h=s[14],g=s[16],x=s[17],v=s[20],y=s[26],j=u(e,t);if(Ww(j)){if(i.has(t)&&o.get(t)!==j.n)return j;let D=!1;for(const[O,R]of j.d)if(h(e,O).n!==R){D=!0;break}if(!D)return j}let b=!0;const N=new Set(j.d.keys()),k=new Map,w=()=>{for(const D of N)k.has(D)||j.d.delete(D)},S=()=>{if(i.has(t)){const D=!l.size;x(e,t),D&&(m(e),f(e))}},C=D=>{var O;if(D===t){const F=u(e,D);if(!Ww(F))if(RO(D))v(e,D,D.init);else throw new Error("no atom init");return tu(F)}const R=h(e,D);try{return tu(R)}finally{k.set(D,R.n),j.d.set(D,R.n),ru(j.v)&&$O(t,j.v,R),i.has(t)&&((O=i.get(D))==null||O.t.add(t)),b||S()}};let P,M;const A={get signal(){return P||(P=new AbortController),P.signal},get setSelf(){return(Rn?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Rn?"production":void 0)!=="production"&&!dp(t)&&console.warn("setSelf function cannot be used with read-only atom"),!M&&dp(t)&&(M=(...D)=>{if((Rn?"production":void 0)!=="production"&&b&&console.warn("setSelf function cannot be called in sync"),!b)try{return g(e,t,...D)}finally{m(e),f(e)}}),M}},_=j.n;try{(Rn?"production":void 0)!=="production"&&up.delete(e);const D=d(e,t,C,A);if((Rn?"production":void 0)!=="production"&&up.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),v(e,t,D),ru(D)){y(e,D,()=>P==null?void 0:P.abort());const O=()=>{w(),S()};D.then(O,O)}else w();return(r=c.r)==null||r.call(c,t),j}catch(D){return delete j.v,j.e=D,++j.n,j}finally{b=!1,_!==j.n&&o.get(t)===_&&(o.set(t,j.n),l.add(t),(n=c.c)==null||n.call(c,t))}},pQ=(e,t)=>{const r=It(e),n=r[1],s=r[2],i=r[11],o=[t];for(;o.length;){const l=o.pop(),c=i(e,l);for(const d of zO(l,c,n)){const u=i(e,d);s.get(d)!==u.n&&(s.set(d,u.n),o.push(d))}}},gQ=(e,t,...r)=>{const n=It(e),s=n[3],i=n[6],o=n[8],l=n[11],c=n[12],d=n[13],u=n[14],f=n[15],m=n[16],h=n[17],g=n[20];let x=!0;const v=j=>tu(u(e,j)),y=(j,...b)=>{var N;const k=l(e,j);try{if(j===t){if(!RO(j))throw new Error("atom not writable");(Rn?"production":void 0)!=="production"&&up.add(e);const w=k.n,S=b[0];g(e,j,S),h(e,j),w!==k.n&&(s.add(j),f(e,j),(N=i.c)==null||N.call(i,j));return}else return m(e,j,...b)}finally{x||(d(e),c(e))}};try{return o(e,t,v,y,...r)}finally{x=!1}},xQ=(e,t)=>{var r;const n=It(e),s=n[1],i=n[3],o=n[6],l=n[11],c=n[15],d=n[18],u=n[19],f=l(e,t),m=s.get(t);if(m){for(const[h,g]of f.d)if(!m.d.has(h)){const x=l(e,h);d(e,h).t.add(t),m.d.add(h),g!==x.n&&(i.add(h),c(e,h),(r=o.c)==null||r.call(o,h))}for(const h of m.d)if(!f.d.has(h)){m.d.delete(h);const g=u(e,h);g==null||g.t.delete(t)}}},vQ=(e,t)=>{var r;const n=It(e),s=n[1],i=n[4],o=n[6],l=n[10],c=n[11],d=n[12],u=n[13],f=n[14],m=n[16],h=n[18],g=c(e,t);let x=s.get(t);if(!x){f(e,t);for(const v of g.d.keys())h(e,v).t.add(t);if(x={l:new Set,d:new Set(g.d.keys()),t:new Set},s.set(t,x),dp(t)){const v=()=>{let y=!0;const j=(...b)=>{try{return m(e,t,...b)}finally{y||(u(e),d(e))}};try{const b=l(e,t,j);b&&(x.u=()=>{y=!0;try{b()}finally{y=!1}})}finally{y=!1}};i.add(v)}(r=o.m)==null||r.call(o,t)}return x},yQ=(e,t)=>{var r,n;const s=It(e),i=s[1],o=s[5],l=s[6],c=s[11],d=s[19],u=c(e,t);let f=i.get(t);if(!f||f.l.size)return f;let m=!1;for(const h of f.t)if((r=i.get(h))!=null&&r.d.has(t)){m=!0;break}if(!m){f.u&&o.add(f.u),f=void 0,i.delete(t);for(const h of u.d.keys()){const g=d(e,h);g==null||g.t.delete(t)}(n=l.u)==null||n.call(l,t);return}return f},bQ=(e,t,r)=>{const n=It(e),s=n[11],i=n[27],o=s(e,t),l="v"in o,c=o.v;if(ru(r))for(const d of o.d.keys())$O(t,r,s(e,d));o.v=r,delete o.e,(!l||!Object.is(c,o.v))&&(++o.n,ru(c)&&i(e,c))},wQ=(e,t)=>{const r=It(e)[14];return tu(r(e,t))},jQ=(e,t,...r)=>{const n=It(e),s=n[12],i=n[13],o=n[16];try{return o(e,t,...r)}finally{i(e),s(e)}},NQ=(e,t,r)=>{const n=It(e),s=n[12],i=n[18],o=n[19],c=i(e,t).l;return c.add(r),s(e),()=>{c.delete(r),o(e,t),s(e)}},kQ=(e,t,r)=>{const s=It(e)[25];let i=s.get(t);if(!i){i=new Set,s.set(t,i);const o=()=>s.delete(t);t.then(o,o)}i.add(r)},SQ=(e,t)=>{const s=It(e)[25].get(t);s==null||s.forEach(i=>i())},LO=new WeakMap,It=e=>{const t=LO.get(e);if((Rn?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};function CQ(e){const t=It(e),r=t[24];return r?r(t):t}function _Q(...e){const t={get(n){const s=It(t)[21];return s(t,n)},set(n,...s){const i=It(t)[22];return i(t,n,...s)},sub(n,s){const i=It(t)[23];return i(t,n,s)}},r=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},oQ,lQ,cQ,dQ,uQ,fQ,mQ,hQ,pQ,gQ,xQ,vQ,yQ,bQ,wQ,jQ,NQ,void 0,new WeakMap,kQ,SQ].map((n,s)=>e[s]||n);return LO.set(t,Object.freeze(r)),t}const FO={};let OQ=0;function BO(e,t){const r=`atom${++OQ}`,n={toString(){return(FO?"production":void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof e=="function"?n.read=e:(n.init=e,n.read=PQ,n.write=MQ),n}function PQ(e){return e(this)}function MQ(e,t,r){return t(this,typeof r=="function"?r(e(this)):r)}function AQ(){return _Q()}let zo;function EQ(){return zo||(zo=AQ(),(FO?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=zo),globalThis.__JOTAI_DEFAULT_STORE__!==zo&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),zo}const DQ={},TQ=p.createContext(void 0);function WO(e){return p.useContext(TQ)||EQ()}const fp=e=>typeof(e==null?void 0:e.then)=="function",mp=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},IQ=E.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(mp(e),e)}),Hm=new WeakMap,Uw=(e,t,r)=>{const s=CQ(e)[26];let i=Hm.get(t);return i||(i=new Promise((o,l)=>{let c=t;const d=m=>h=>{c===m&&o(h)},u=m=>h=>{c===m&&l(h)},f=()=>{try{const m=r();fp(m)?(Hm.set(m,i),c=m,m.then(d(m),u(m)),s(e,m,f)):o(m)}catch(m){l(m)}};t.then(d(t),u(t)),s(e,t,f)}),Hm.set(t,i)),i};function RQ(e,t){const{delay:r,unstable_promiseStatus:n=!E.use}={},s=WO(),[[i,o,l],c]=p.useReducer(u=>{const f=s.get(e);return Object.is(u[0],f)&&u[1]===s&&u[2]===e?u:[f,s,e]},void 0,()=>[s.get(e),s,e]);let d=i;if((o!==s||l!==e)&&(c(),d=s.get(e)),p.useEffect(()=>{const u=s.sub(e,()=>{if(n)try{const f=s.get(e);fp(f)&&mp(Uw(s,f,()=>s.get(e)))}catch{}if(typeof r=="number"){setTimeout(c,r);return}c()});return c(),u},[s,e,r,n]),p.useDebugValue(d),fp(d)){const u=Uw(s,d,()=>s.get(e));return n&&mp(u),IQ(u)}return d}function $Q(e,t){const r=WO();return p.useCallback((...s)=>{if((DQ?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return r.set(e,...s)},[r,e])}function UO(e,t){return[RQ(e),$Q(e)]}var qO="Expected a function",qw=NaN,zQ="[object Symbol]",LQ=/^\s+|\s+$/g,FQ=/^[-+]0x[0-9a-f]+$/i,BQ=/^0b[01]+$/i,WQ=/^0o[0-7]+$/i,UQ=parseInt,qQ=typeof mc=="object"&&mc&&mc.Object===Object&&mc,HQ=typeof self=="object"&&self&&self.Object===Object&&self,KQ=qQ||HQ||Function("return this")(),YQ=Object.prototype,GQ=YQ.toString,VQ=Math.max,XQ=Math.min,Km=function(){return KQ.Date.now()};function QQ(e,t,r){var n,s,i,o,l,c,d=0,u=!1,f=!1,m=!0;if(typeof e!="function")throw new TypeError(qO);t=Hw(t)||0,nu(r)&&(u=!!r.leading,f="maxWait"in r,i=f?VQ(Hw(r.maxWait)||0,t):i,m="trailing"in r?!!r.trailing:m);function h(w){var S=n,C=s;return n=s=void 0,d=w,o=e.apply(C,S),o}function g(w){return d=w,l=setTimeout(y,t),u?h(w):o}function x(w){var S=w-c,C=w-d,P=t-S;return f?XQ(P,i-C):P}function v(w){var S=w-c,C=w-d;return c===void 0||S>=t||S<0||f&&C>=i}function y(){var w=Km();if(v(w))return j(w);l=setTimeout(y,x(w))}function j(w){return l=void 0,m&&n?h(w):(n=s=void 0,o)}function b(){l!==void 0&&clearTimeout(l),d=0,n=c=s=l=void 0}function N(){return l===void 0?o:j(Km())}function k(){var w=Km(),S=v(w);if(n=arguments,s=this,c=w,S){if(l===void 0)return g(c);if(f)return l=setTimeout(y,t),h(c)}return l===void 0&&(l=setTimeout(y,t)),o}return k.cancel=b,k.flush=N,k}function ZQ(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(qO);return nu(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),QQ(e,t,{leading:n,maxWait:t,trailing:s})}function nu(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function JQ(e){return!!e&&typeof e=="object"}function eZ(e){return typeof e=="symbol"||JQ(e)&&GQ.call(e)==zQ}function Hw(e){if(typeof e=="number")return e;if(eZ(e))return qw;if(nu(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=nu(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(LQ,"");var r=BQ.test(e);return r||WQ.test(e)?UQ(e.slice(2),r?2:8):FQ.test(e)?qw:+e}var tZ=ZQ;const rZ=Na(tZ),HO=p.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:T("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));HO.displayName="Card";const nZ=p.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:T("flex flex-col space-y-1.5 p-6",e),...t}));nZ.displayName="CardHeader";const aZ=p.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:T("text-2xl font-semibold leading-none tracking-tight",e),...t}));aZ.displayName="CardTitle";const sZ=p.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:T("text-sm text-muted-foreground",e),...t}));sZ.displayName="CardDescription";const iZ=p.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:T("p-6 pt-0",e),...t}));iZ.displayName="CardContent";const oZ=p.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:T("flex items-center p-6 pt-0",e),...t}));oZ.displayName="CardFooter";function lZ(e,t=[]){let r=[];function n(i,o){const l=p.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:h,...g}=f,x=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(x.Provider,{value:v,children:h})};d.displayName=i+"Provider";function u(f,m){var x;const h=((x=m==null?void 0:m[e])==null?void 0:x[c])||l,g=p.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=r.map(o=>p.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,cZ(s,...t)]}function cZ(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function dZ(e){const t=uZ(e),r=p.forwardRef((n,s)=>{const{children:i,...o}=n,l=p.Children.toArray(i),c=l.find(mZ);if(c){const d=c.props.children,u=l.map(f=>f===c?p.Children.count(d)>1?p.Children.only(null):p.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...o,ref:s,children:p.isValidElement(d)?p.cloneElement(d,void 0,u):null})}return a.jsx(t,{...o,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function uZ(e){const t=p.forwardRef((r,n)=>{const{children:s,...i}=r;if(p.isValidElement(s)){const o=pZ(s),l=hZ(i,s.props);return s.type!==p.Fragment&&(l.ref=n?wj(n,o):o),p.cloneElement(s,l)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fZ=Symbol("radix.slottable");function mZ(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fZ}function hZ(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function pZ(e){var n,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var gZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xZ=gZ.reduce((e,t)=>{const r=dZ(`Primitive.${t}`),n=p.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Xx="ContextMenu",[vZ]=lZ(Xx,[Sj]),kr=Sj(),[yZ,KO]=vZ(Xx),YO=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:s,modal:i=!0}=e,[o,l]=p.useState(!1),c=kr(t),d=pM(n),u=p.useCallback(f=>{l(f),d(f)},[d]);return a.jsx(yZ,{scope:t,open:o,onOpenChange:u,modal:i,children:a.jsx(gM,{...c,dir:s,open:o,onOpenChange:u,modal:i,children:r})})};YO.displayName=Xx;var GO="ContextMenuTrigger",VO=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...s}=e,i=KO(GO,r),o=kr(r),l=p.useRef({x:0,y:0}),c=p.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=p.useRef(0),u=p.useCallback(()=>window.clearTimeout(d.current),[]),f=m=>{l.current={x:m.clientX,y:m.clientY},i.onOpenChange(!0)};return p.useEffect(()=>u,[u]),p.useEffect(()=>void(n&&u()),[n,u]),a.jsxs(a.Fragment,{children:[a.jsx(xM,{...o,virtualRef:c}),a.jsx(xZ.span,{"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:xs(e.onContextMenu,m=>{u(),f(m),m.preventDefault()}),onPointerDown:n?e.onPointerDown:xs(e.onPointerDown,Bc(m=>{u(),d.current=window.setTimeout(()=>f(m),700)})),onPointerMove:n?e.onPointerMove:xs(e.onPointerMove,Bc(u)),onPointerCancel:n?e.onPointerCancel:xs(e.onPointerCancel,Bc(u)),onPointerUp:n?e.onPointerUp:xs(e.onPointerUp,Bc(u))})]})});VO.displayName=GO;var bZ="ContextMenuPortal",XO=e=>{const{__scopeContextMenu:t,...r}=e,n=kr(t);return a.jsx(oM,{...n,...r})};XO.displayName=bZ;var QO="ContextMenuContent",ZO=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=KO(QO,r),i=kr(r),o=p.useRef(!1);return a.jsx(lM,{...i,...n,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{var c;(c=e.onCloseAutoFocus)==null||c.call(e,l),!l.defaultPrevented&&o.current&&l.preventDefault(),o.current=!1},onInteractOutside:l=>{var c;(c=e.onInteractOutside)==null||c.call(e,l),!l.defaultPrevented&&!s.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ZO.displayName=QO;var wZ="ContextMenuGroup",jZ=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(vM,{...s,...n,ref:t})});jZ.displayName=wZ;var NZ="ContextMenuLabel",JO=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(mM,{...s,...n,ref:t})});JO.displayName=NZ;var kZ="ContextMenuItem",eP=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(cM,{...s,...n,ref:t})});eP.displayName=kZ;var SZ="ContextMenuCheckboxItem",tP=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(dM,{...s,...n,ref:t})});tP.displayName=SZ;var CZ="ContextMenuRadioGroup",_Z=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(yM,{...s,...n,ref:t})});_Z.displayName=CZ;var OZ="ContextMenuRadioItem",rP=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(fM,{...s,...n,ref:t})});rP.displayName=OZ;var PZ="ContextMenuItemIndicator",nP=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(uM,{...s,...n,ref:t})});nP.displayName=PZ;var MZ="ContextMenuSeparator",aP=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(hM,{...s,...n,ref:t})});aP.displayName=MZ;var AZ="ContextMenuArrow",EZ=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(bM,{...s,...n,ref:t})});EZ.displayName=AZ;var DZ="ContextMenuSubTrigger",sP=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(sM,{...s,...n,ref:t})});sP.displayName=DZ;var TZ="ContextMenuSubContent",iP=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(iM,{...s,...n,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});iP.displayName=TZ;function Bc(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var IZ=YO,RZ=VO,$Z=XO,oP=ZO,lP=JO,cP=eP,dP=tP,uP=rP,fP=nP,mP=aP,hP=sP,pP=iP;const zZ=IZ,LZ=RZ,FZ=p.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(hP,{ref:s,className:T("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[r,a.jsx(kn,{className:"ml-auto h-4 w-4"})]}));FZ.displayName=hP.displayName;const BZ=p.forwardRef(({className:e,...t},r)=>a.jsx(pP,{ref:r,className:T("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",e),...t}));BZ.displayName=pP.displayName;const gP=p.forwardRef(({className:e,...t},r)=>a.jsx($Z,{children:a.jsx(oP,{ref:r,className:T("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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),...t})}));gP.displayName=oP.displayName;const xP=p.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(cP,{ref:n,className:T("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));xP.displayName=cP.displayName;const WZ=p.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(dP,{ref:s,className:T("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(fP,{children:a.jsx(lr,{className:"h-4 w-4"})})}),t]}));WZ.displayName=dP.displayName;const UZ=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(uP,{ref:n,className:T("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(fP,{children:a.jsx(rn,{className:"h-2 w-2 fill-current"})})}),t]}));UZ.displayName=uP.displayName;const qZ=p.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(lP,{ref:n,className:T("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r}));qZ.displayName=lP.displayName;const HZ=p.forwardRef(({className:e,...t},r)=>a.jsx(mP,{ref:r,className:T("-mx-1 my-1 h-px bg-border",e),...t}));HZ.displayName=mP.displayName;const KZ=BO(!1),YZ=BO(0),Qx=()=>UO(KZ),Zx=()=>UO(YZ),GZ=e=>{let t=r=>1;return(e==="monthly"||e==="quarterly")&&(t=Za),t},fc=e=>{let t=Z1;return(e==="monthly"||e==="quarterly")&&(t=tN),t},Jx=e=>{let t=C5;return(e==="monthly"||e==="quarterly")&&(t=Z1),t},yl=e=>{let t=Ci;return(e==="monthly"||e==="quarterly")&&(t=nN),t},VZ=e=>{let t=eN;return(e==="monthly"||e==="quarterly")&&(t=Hp),t},vP=e=>{let t=Ar;return(e==="monthly"||e==="quarterly")&&(t=Wp),t},qo=(e,t)=>{const r=new Date(e.timelineData[0].year,0,1),n=e.columnWidth*e.zoom/100,s=Math.floor(t/n),i=GZ(e.range),l=vP(e.range)(r,s),c=i(l),d=Math.round(n/c),u=Math.floor(t%n/d);return Ar(l,u)},XZ=e=>{const t=[];t.push({year:e.getFullYear()-1,quarters:new Array(4).fill(null)},{year:e.getFullYear(),quarters:new Array(4).fill(null)},{year:e.getFullYear()+1,quarters:new Array(4).fill(null)});for(const r of t)r.quarters=new Array(4).fill(null).map((n,s)=>({months:new Array(3).fill(null).map((i,o)=>{const l=s*3+o;return{days:Za(new Date(r.year,l,1))}})}));return t},yP=(e,t,r)=>{const n=r.columnWidth*r.zoom/100,s=fc(r.range),i=yl(r.range),o=s(i(e),t);if(r.range==="daily")return n*o;const l=e.getDate(),c=Za(e),d=n/c;return o*n+l*d},QZ=(e,t,r)=>{const n=r.columnWidth*r.zoom/100;if(!t)return n*2;const s=fc(r.range);if(r.range==="daily"){const g=s(t,e);return n*(g||1)}const i=Za(e),o=n/i;if(_i(e,t))return o;const l=Jx(r.range),c=yl(r.range);if(_i(c(e),c(t)))return l(t,e)*o;const d=i-Ko(e),u=Ko(t),f=s(c(t),c(e)),m=Za(t),h=n/m;return(f-1)*n+d*o+u*h},bP=(e,t,r)=>{const n=yl(t),s=VZ(t),i=Jx(t),o=n(e),l=s(e),c=i(l,o);return e.getDate()/c*r},Cn=p.createContext({zoom:100,range:"monthly",columnWidth:50,headerHeight:60,sidebarWidth:300,rowHeight:36,onAddItem:void 0,placeholderLength:2,timelineData:[],ref:null,scrollToFeature:void 0}),ev=({title:e,columns:t,renderHeaderItem:r})=>{const n=p.useId();return a.jsxs("div",{className:"sticky top-0 z-20 grid w-full shrink-0 bg-backdrop/90 backdrop-blur-sm",style:{height:"var(--gantt-header-height)"},children:[a.jsx("div",{children:a.jsx("div",{className:"sticky inline-flex whitespace-nowrap px-3 py-2 text-muted-foreground text-xs",style:{left:"var(--gantt-sidebar-width)"},children:a.jsx("p",{children:e})})}),a.jsx("div",{className:"grid w-full",style:{gridTemplateColumns:`repeat(${t}, var(--gantt-column-width))`},children:Array.from({length:t}).map((s,i)=>a.jsx("div",{className:"shrink-0 border-border/50 border-b py-1 text-center text-xs",children:r(i)},`${n}-${i}`))})]})},ZZ=()=>p.useContext(Cn).timelineData.map(t=>t.quarters.flatMap(r=>r.months).map((r,n)=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(ev,{columns:r.days,renderHeaderItem:s=>a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx("p",{children:ue(Ar(new Date(t.year,n,1),s),"d")}),a.jsx("p",{className:"text-muted-foreground",children:ue(Ar(new Date(t.year,n,1),s),"EEEEE")})]}),title:ue(new Date(t.year,n,1),"MMMM yyyy")}),a.jsx(tv,{columns:r.days,isColumnSecondary:s=>[0,6].includes(Ar(new Date(t.year,n,1),s).getDay())})]},`${t.year}-${n}`))),JZ=()=>p.useContext(Cn).timelineData.map(t=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(ev,{columns:t.quarters.flatMap(r=>r.months).length,renderHeaderItem:r=>a.jsx("p",{children:ue(new Date(t.year,r,1),"MMM")}),title:`${t.year}`}),a.jsx(tv,{columns:t.quarters.flatMap(r=>r.months).length})]},t.year)),eJ=()=>p.useContext(Cn).timelineData.map(t=>t.quarters.map((r,n)=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(ev,{columns:r.months.length,renderHeaderItem:s=>a.jsx("p",{children:ue(new Date(t.year,n*3+s,1),"MMM")}),title:`Q${n+1} ${t.year}`}),a.jsx(tv,{columns:r.months.length})]},`${t.year}-${n}`))),tJ={daily:ZZ,monthly:JZ,quarterly:eJ},rJ=({className:e})=>{const t=p.useContext(Cn),r=tJ[t.range];return a.jsx("div",{className:T("-space-x-px flex h-full w-max divide-x divide-border/50",e),children:a.jsx(r,{})})},Ym=({feature:e,onSelectItem:t,className:r,duration:n})=>{const s=p.useContext(Cn),i=e.endAt&&_i(e.startAt,e.endAt)?Ar(e.endAt,1):e.endAt,o=n??(i?ah(e.startAt,i):`${ah(e.startAt,new Date)} so far`),l=d=>{var u;d.target===d.currentTarget&&((u=s.scrollToFeature)==null||u.call(s,e),t==null||t(e.id))},c=d=>{var u;d.key==="Enter"&&((u=s.scrollToFeature)==null||u.call(s,e),t==null||t(e.id))};return a.jsxs("div",{className:T("relative flex items-center gap-2.5 p-2.5 text-xs hover:bg-secondary",r),onClick:l,onKeyDown:c,role:"button",style:{height:"var(--gantt-row-height)"},tabIndex:0,children:[a.jsx("div",{className:"pointer-events-none h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:e.status.color}}),a.jsx("p",{className:"pointer-events-none flex-1 truncate text-left font-medium",children:e.name}),a.jsx("p",{className:"pointer-events-none text-muted-foreground",children:o})]},e.id)},nJ=()=>a.jsxs("div",{className:"sticky top-0 z-10 flex shrink-0 items-end justify-between gap-2.5 border-border/50 border-b bg-backdrop/90 p-2.5 font-medium text-muted-foreground text-xs backdrop-blur-sm",style:{height:"var(--gantt-header-height)"},children:[a.jsx("p",{className:"flex-1 truncate text-left",children:"Issues"}),a.jsx("p",{className:"shrink-0",children:"Duration"})]}),Gm=({children:e,name:t,className:r})=>a.jsxs("div",{className:r,children:[a.jsx("p",{className:"w-full truncate p-2.5 text-left font-medium text-muted-foreground text-xs",style:{height:"var(--gantt-row-height)"},children:t}),a.jsx("div",{className:"divide-y divide-border/50",children:e})]}),aJ=({children:e,className:t})=>a.jsxs("div",{className:T("sticky left-0 z-30 h-max min-h-full overflow-clip border-border/50 border-r bg-white dark:bg-zinc-950 backdrop-blur-md",t),"data-roadmap-ui":"gantt-sidebar",children:[a.jsx(nJ,{}),a.jsx("div",{className:"space-y-4",children:e})]}),sJ=({top:e,className:t})=>{const[r]=Zx(),n=p.useContext(Cn),[s,i]=Vx(),o=()=>{var u,f,m;const l=(f=(u=n.ref)==null?void 0:u.current)==null?void 0:f.getBoundingClientRect(),c=s.x-((l==null?void 0:l.left)??0)+r-n.sidebarWidth,d=qo(n,c);(m=n.onAddItem)==null||m.call(n,d)};return a.jsx("div",{className:T("absolute top-0 w-full px-0.5",t),ref:i,style:{marginTop:-n.rowHeight/2,transform:`translateY(${e}px)`},children:a.jsx("button",{className:"flex h-full w-full items-center justify-center rounded-md border border-dashed p-2",onClick:o,type:"button",children:a.jsx(it,{className:"pointer-events-none select-none text-muted-foreground",size:16})})})},iJ=({index:e,isColumnSecondary:t})=>{var m;const r=p.useContext(Cn),[n]=Qx(),[s,i]=Vx(),[o,l]=p.useState(!1),[c]=iQ(),d=()=>l(!0),u=()=>l(!1),f=sQ(s.y-(((m=i.current)==null?void 0:m.getBoundingClientRect().y)??0)-(c.y??0),10);return a.jsx("div",{className:T("group relative h-full overflow-hidden",t!=null&&t(e)?"bg-[#f59e0b]/5 dark:bg-[#f59e0b]/5":""),onMouseEnter:d,onMouseLeave:u,ref:i,children:!n&&o&&r.onAddItem?a.jsx(sJ,{top:f}):null})},tv=({columns:e,isColumnSecondary:t})=>{const r=p.useId();return a.jsx("div",{className:"divide grid h-full w-full divide-x divide-border/50",style:{gridTemplateColumns:`repeat(${e}, var(--gantt-column-width))`},children:Array.from({length:e}).map((n,s)=>a.jsx(iJ,{index:s,isColumnSecondary:t},`${r}-${s}`))})},Kw=({direction:e,featureId:t,date:r})=>{const[,n]=Qx(),{attributes:s,listeners:i,setNodeRef:o}=Pj({id:`feature-drag-helper-${t}`}),l=!!s["aria-pressed"];return p.useEffect(()=>n(l),[l,n]),a.jsxs("div",{className:T("group -translate-y-1/2 !cursor-col-resize absolute top-1/2 z-[3] h-full w-6 rounded-md outline-none",e==="left"?"-left-2.5":"-right-2.5"),ref:o,...s,...i,children:[a.jsx("div",{className:T("-translate-y-1/2 absolute top-1/2 h-[80%] w-1 rounded-sm bg-muted-foreground opacity-0 transition-all",e==="left"?"left-2.5":"right-2.5",e==="left"?"group-hover:left-0":"group-hover:right-0",l&&(e==="left"?"left-0":"right-0"),"group-hover:opacity-100",l&&"opacity-100")}),r&&a.jsx("div",{className:T("-translate-x-1/2 absolute top-10 hidden whitespace-nowrap rounded-lg border border-border/50 bg-background/90 px-2 py-1 text-foreground text-xs backdrop-blur-lg group-hover:block",l&&"block"),children:ue(r,"MMM dd, yyyy")})]})},oJ=({id:e,children:t})=>{const[,r]=Qx(),{attributes:n,listeners:s,setNodeRef:i}=Pj({id:e}),o=!!n["aria-pressed"];return p.useEffect(()=>r(o),[o,r]),a.jsx(HO,{className:"h-full w-full rounded-md bg-background p-2 text-xs shadow-sm",children:a.jsx("div",{className:T("flex h-full w-full items-center justify-between gap-2 text-left",o&&"cursor-grabbing"),...n,...s,ref:i,children:t})})},Yw=({onMove:e,children:t,className:r,...n})=>{const[s]=Zx(),i=p.useContext(Cn),o=p.useMemo(()=>{var A;return new Date(((A=i.timelineData.at(0))==null?void 0:A.year)??0,0,1)},[i.timelineData]),[l,c]=p.useState(n.startAt),[d,u]=p.useState(n.endAt),f=p.useMemo(()=>QZ(l,d,i),[l,d,i]),m=p.useMemo(()=>yP(l,o,i),[l,o,i]),h=p.useMemo(()=>vP(i.range),[i.range]),[g]=Vx(),[x,v]=p.useState(0),[y,j]=p.useState(l),[b,N]=p.useState(d),k=vp(CM,{activationConstraint:{distance:10}}),w=p.useCallback(()=>{v(g.x),j(l),N(d)},[g.x,l,d]),S=p.useCallback(()=>{const A=qo(i,g.x),_=qo(i,x),D=i.range==="daily"?fc(i.range)(A,_):Jx(i.range)(A,_),O=Ar(y,D),R=b?Ar(b,D):null;c(O),u(R)},[i,g.x,x,y,b]),C=p.useCallback(()=>e==null?void 0:e(n.id,l,d),[e,n.id,l,d]),P=p.useCallback(()=>{var R,F;const A=(F=(R=i.ref)==null?void 0:R.current)==null?void 0:F.getBoundingClientRect(),_=g.x-((A==null?void 0:A.left)??0)+s-i.sidebarWidth,O=yl(i.range)(qo(i,_));c(O)},[i,g.x,s]),M=p.useCallback(()=>{var R,F;const A=(F=(R=i.ref)==null?void 0:R.current)==null?void 0:F.getBoundingClientRect(),_=g.x-((A==null?void 0:A.left)??0)+s-i.sidebarWidth,O=yl(i.range)(qo(i,_));u(O)},[i,g.x,s]);return a.jsx("div",{className:T("relative flex w-max min-w-full py-0.5",r),style:{height:"var(--gantt-row-height)"},children:a.jsxs("div",{className:"pointer-events-auto absolute top-0.5",style:{height:"calc(var(--gantt-row-height) - 4px)",width:Math.round(f),left:Math.round(m)},children:[e&&a.jsx(Ho,{modifiers:[qm],onDragEnd:C,onDragMove:P,sensors:[k],children:a.jsx(Kw,{date:l,direction:"left",featureId:n.id})}),a.jsx(Ho,{modifiers:[qm],onDragEnd:C,onDragMove:S,onDragStart:w,sensors:[k],children:a.jsx(oJ,{id:n.id,children:t??a.jsx("p",{className:"flex-1 truncate text-xs",children:n.name})})}),e&&a.jsx(Ho,{modifiers:[qm],onDragEnd:C,onDragMove:M,sensors:[k],children:a.jsx(Kw,{date:d?lN(d):h(l,1),direction:"right",featureId:n.id})})]})})},Vm=({children:e,className:t})=>a.jsx("div",{className:t,style:{paddingTop:"var(--gantt-row-height)"},children:e}),lJ=({className:e,children:t})=>a.jsx("div",{className:T("absolute top-0 left-0 h-full w-max space-y-4",e),style:{marginTop:"var(--gantt-header-height)"},children:t}),wP=p.memo(({label:e,date:t,id:r,onRemove:n,className:s})=>{const i=p.useContext(Cn),o=p.useMemo(()=>fc(i.range),[i.range]),l=p.useMemo(()=>{var f;return new Date(((f=i.timelineData.at(0))==null?void 0:f.year)??0,0,1)},[i.timelineData]),c=p.useMemo(()=>o(t,l),[o,t,l]),d=p.useMemo(()=>bP(t,i.range,i.columnWidth*i.zoom/100),[t,i.range,i.columnWidth,i.zoom]),u=p.useCallback(()=>n==null?void 0:n(r),[n,r]);return a.jsxs("div",{className:"pointer-events-none absolute top-0 left-0 z-20 flex h-full select-none flex-col items-center justify-center overflow-visible",style:{width:0,transform:`translateX(calc(var(--gantt-column-width) * ${c} + ${d}px))`},children:[a.jsxs(zZ,{children:[a.jsx(LZ,{asChild:!0,children:a.jsxs("div",{className:T("group pointer-events-auto sticky top-0 flex select-auto flex-col flex-nowrap items-center justify-center whitespace-nowrap rounded-b-md bg-card px-2 py-1 text-foreground text-xs",s),children:[e,a.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:ue(t,"MMM dd, yyyy")})]})}),a.jsx(gP,{children:n?a.jsxs(xP,{className:"flex items-center gap-2 text-destructive",onClick:u,children:[a.jsx(RE,{size:16}),"Remove marker"]}):null})]}),a.jsx("div",{className:T("h-full w-px bg-card",s)})]})});wP.displayName="GanttMarker";const cJ=({zoom:e=100,range:t="monthly",onAddItem:r,children:n,className:s})=>{const i=p.useRef(null),[o,l]=p.useState(XZ(new Date)),[,c]=Zx(),[d,u]=p.useState(0),f=60,m=36;let h=50;t==="monthly"?h=150:t==="quarterly"&&(h=100);const g=p.useMemo(()=>({"--gantt-zoom":`${e}`,"--gantt-column-width":`${e/100*h}px`,"--gantt-header-height":`${f}px`,"--gantt-row-height":`${m}px`,"--gantt-sidebar-width":`${d}px`}),[e,h,d]);p.useEffect(()=>{i.current&&(i.current.scrollLeft=i.current.scrollWidth/2-i.current.clientWidth/2,c(i.current.scrollLeft))},[c]),p.useEffect(()=>{const y=()=>{var k;const N=((k=i.current)==null?void 0:k.querySelector('[data-roadmap-ui="gantt-sidebar"]'))?300:0;u(N)};y();const j=new MutationObserver(y);return i.current&&j.observe(i.current,{childList:!0,subtree:!0}),()=>{j.disconnect()}},[]);const x=p.useCallback(rZ(()=>{var k,w;const y=i.current;if(!y)return;const{scrollLeft:j,scrollWidth:b,clientWidth:N}=y;if(c(j),j===0){const S=(k=o[0])==null?void 0:k.year;if(!S)return;const C=[...o];C.unshift({year:S-1,quarters:new Array(4).fill(null).map((P,M)=>({months:new Array(3).fill(null).map((A,_)=>{const D=M*3+_;return{days:Za(new Date(S,D,1))}})}))}),l(C),y.scrollLeft=y.clientWidth,c(y.scrollLeft)}else if(j+N>=b){const S=(w=o.at(-1))==null?void 0:w.year;if(!S)return;const C=[...o];C.push({year:S+1,quarters:new Array(4).fill(null).map((P,M)=>({months:new Array(3).fill(null).map((A,_)=>{const D=M*3+_;return{days:Za(new Date(S,D,1))}})}))}),l(C),y.scrollLeft=y.scrollWidth-y.clientWidth,c(y.scrollLeft)}},100),[]);p.useEffect(()=>{const y=i.current;return y&&y.addEventListener("scroll",x),()=>{y&&y.removeEventListener("scroll",x)}},[x]);const v=p.useCallback(y=>{const j=i.current;if(!j)return;const b=new Date(o[0].year,0,1),N=yP(y.startAt,b,{zoom:e,range:t,columnWidth:h}),k=Math.max(0,N);j.scrollTo({left:k,behavior:"smooth"})},[o,e,t,h,d,r]);return a.jsx(Cn.Provider,{value:{zoom:e,range:t,headerHeight:f,columnWidth:h,sidebarWidth:d,rowHeight:m,onAddItem:r,timelineData:o,placeholderLength:2,ref:i,scrollToFeature:v},children:a.jsx("div",{className:T("gantt relative isolate grid h-full w-full flex-none select-none overflow-auto rounded-sm bg-secondary",t,s),ref:i,style:{...g,gridTemplateColumns:"var(--gantt-sidebar-width) 1fr"},children:n})})},dJ=({children:e,className:t})=>a.jsx("div",{className:T("relative flex h-full w-max flex-none overflow-clip",t),children:e}),uJ=({className:e})=>{const t="Today",r=p.useMemo(()=>new Date,[]),n=p.useContext(Cn),s=p.useMemo(()=>fc(n.range),[n.range]),i=p.useMemo(()=>{var c;return new Date(((c=n.timelineData.at(0))==null?void 0:c.year)??0,0,1)},[n.timelineData]),o=p.useMemo(()=>s(r,i),[s,r,i]),l=p.useMemo(()=>bP(r,n.range,n.columnWidth*n.zoom/100),[r,n.range,n.columnWidth,n.zoom]);return a.jsxs("div",{className:"pointer-events-none absolute top-0 left-0 z-20 flex h-full select-none flex-col items-center justify-center overflow-visible",style:{width:0,transform:`translateX(calc(var(--gantt-column-width) * ${o} + ${l}px))`},children:[a.jsxs("div",{className:T("group pointer-events-auto sticky top-0 flex select-auto flex-col flex-nowrap items-center justify-center whitespace-nowrap rounded-b-md bg-card px-2 py-1 text-foreground text-xs",e),children:[t,a.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:ue(r,"MMM dd, yyyy")})]}),a.jsx("div",{className:T("h-full w-px bg-card",e)})]})};function fJ(e){return Le({queryKey:["public","share",e],queryFn:()=>te.get(`/public/share/${e}`),select:t=>t.project,enabled:!!e,retry:!1})}function rv(e,t={}){const r=new URLSearchParams;t.status&&r.set("status",t.status),t.priority&&r.set("priority",t.priority),t.search&&r.set("search",t.search);const n=r.toString()?`?${r.toString()}`:"";return Le({queryKey:["public","share",e,"issues",t],queryFn:()=>te.get(`/public/share/${e}/issues${n}`),select:s=>s.issues,enabled:!!e,retry:!1})}function jP(e){return Le({queryKey:["public","share",e,"sprints"],queryFn:()=>te.get(`/public/share/${e}/sprints`),select:t=>t.sprints,enabled:!!e,retry:!1})}function mJ({priority:e,className:t}){const r=T("h-3.5 w-3.5 shrink-0",Vp[e],t);switch(e){case"urgent":return a.jsx(ns,{className:r});case"high":return a.jsx(Cl,{className:r});case"medium":return a.jsx(Hi,{className:r});case"low":return a.jsx(Sl,{className:r});default:return a.jsx(rn,{className:T("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}}const hp="grid-cols-[70px_250px_150px_120px_130px_140px_130px]";function NP({issue:e,statuses:t,statusLabels:r,statusColorMap:n,sprints:s,isChild:i=!1,children:o=[],childrenMap:l}){const[c,d]=p.useState(!1),u=o.length>0,f=n[e.status]??"#94a3b8",m=s.find(h=>h.id===e.sprint_id);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:T(`group grid ${hp} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors",i&&"bg-muted/10"),children:[a.jsx("span",{className:T("text-xs font-mono text-muted-foreground truncate","sticky left-0 z-10 pl-6 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",i&&"text-muted-foreground/60"),children:e.identifier}),a.jsxs("div",{className:T("flex items-center gap-1 min-w-0 pr-3","sticky left-[70px] z-10 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",i&&"bg-[#f8f9fa] dark:bg-muted/20"),children:[u?a.jsxs(qa,{children:[a.jsx(Ha,{asChild:!0,children:a.jsx("button",{onClick:()=>d(!c),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:c?a.jsx(Kn,{className:"h-3.5 w-3.5"}):a.jsx(kn,{className:"h-3.5 w-3.5"})})}),a.jsx(da,{side:"top",children:c?"Collapse":"Expand"})]}):i?a.jsx(yn,{className:"h-3 w-3 text-muted-foreground/40 shrink-0"}):a.jsx("span",{className:"w-4 shrink-0"}),a.jsx("span",{className:T("text-sm text-foreground truncate",i&&"text-muted-foreground"),children:e.title}),u&&a.jsxs("span",{className:"shrink-0 flex items-center gap-0.5 ml-1 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded",children:[a.jsx(yn,{className:"h-2.5 w-2.5"}),o.length]})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 max-w-full",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:f}}),a.jsx("span",{className:"text-xs text-muted-foreground truncate",children:r[e.status]??e.status})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1",children:[a.jsx(mJ,{priority:e.priority}),a.jsx("span",{className:"text-xs text-muted-foreground",children:wn[e.priority]??e.priority})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 max-w-full",children:[a.jsx(Er,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),a.jsx("span",{className:T("text-xs truncate",m?"text-foreground":"text-muted-foreground/50"),children:(m==null?void 0:m.name)??"—"})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1",children:[a.jsx(cr,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),a.jsx("span",{className:T("text-xs",e.due_date?"text-foreground":"text-muted-foreground/50"),children:e.due_date?ue(new Date(e.due_date),"MMM d, yyyy"):"—"})]}),a.jsx("div",{className:"flex items-center px-1.5",children:a.jsx("div",{className:"flex -space-x-1.5",children:(e.assignees??[]).slice(0,3).map(h=>a.jsx("div",{title:h.name,className:"h-5 w-5 rounded-full bg-indigo-100 dark:bg-indigo-900 border border-white dark:border-card flex items-center justify-center text-[10px] font-medium text-indigo-700 dark:text-indigo-300",children:h.initials},h.id))})})]}),c&&o.map(h=>a.jsx(NP,{issue:h,statuses:t,statusLabels:r,statusColorMap:n,sprints:s,isChild:!0,children:(l==null?void 0:l[h.id])??[],childrenMap:l},h.id))]})}function hJ({issues:e,childrenMap:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,totalCount:o}){const[l,c]=p.useState(!1);return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-2 bg-muted/20 border-b border-border",children:[a.jsx("button",{onClick:()=>c(!l),className:"text-muted-foreground hover:text-foreground transition-colors",children:l?a.jsx(kn,{className:"h-3.5 w-3.5"}):a.jsx(Kn,{className:"h-3.5 w-3.5"})}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"Issues"}),a.jsx("span",{className:"text-[11px] text-muted-foreground/60 font-mono",children:o})]}),!l&&a.jsx("div",{className:"divide-y divide-border/60",children:e.length===0?a.jsx("div",{className:"px-14 py-5 text-xs text-muted-foreground/50 italic",children:"No issues match your filters"}):e.map(d=>a.jsx(NP,{issue:d,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,children:t[d.id]??[],childrenMap:t},d.id))})]})}function pJ({token:e,statuses:t}){const[r,n]=p.useState("all"),[s,i]=p.useState("all"),[o,l]=p.useState("all"),[c,d]=p.useState(""),{data:u=[],isLoading:f}=rv(e),{data:m=[]}=jP(e),h=Object.fromEntries(t.map(b=>[b.key,b.name])),g=Object.fromEntries(t.map(b=>[b.key,b.color])),x={};for(const b of u)b.parent_id&&(x[b.parent_id]||(x[b.parent_id]=[]),x[b.parent_id].push(b));const v=u.filter(b=>!b.parent_id).filter(b=>{const N=c.toLowerCase(),k=!c||b.title.toLowerCase().includes(N)||b.identifier.toLowerCase().includes(N),w=r==="all"||b.status===r,S=s==="all"||b.priority===s,C=o==="all"?!0:o==="none"?!b.sprint_id:b.sprint_id===o;return k&&w&&S&&C}).sort((b,N)=>{const k=parseInt(b.identifier.split("-")[1]??"0",10),w=parseInt(N.identifier.split("-")[1]??"0",10);return k-w}),y=v.reduce((b,N)=>{var k;return b+(((k=x[N.id])==null?void 0:k.length)??0)},0),j=v.length+y;return a.jsx("div",{className:"p-2",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(Fe,{value:o,onValueChange:l,children:[a.jsx(Re,{className:"h-8 text-xs w-[140px] bg-transparent",children:a.jsx(Ye,{placeholder:"Sprint"})}),a.jsxs($e,{children:[a.jsx(be,{value:"all",className:"text-xs",children:"All sprints"}),a.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),m.map(b=>a.jsx(be,{value:b.id,className:"text-xs",children:b.name},b.id))]})]}),a.jsxs(Fe,{value:r,onValueChange:n,children:[a.jsx(Re,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Ye,{placeholder:"Status"})}),a.jsxs($e,{children:[a.jsx(be,{value:"all",className:"text-xs",children:"All statuses"}),t.map(({key:b,name:N})=>a.jsx(be,{value:b,className:"text-xs",children:N},b))]})]}),a.jsxs(Fe,{value:s,onValueChange:i,children:[a.jsx(Re,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Ye,{placeholder:"Priority"})}),a.jsxs($e,{children:[a.jsx(be,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(wn).map(([b,N])=>a.jsx(be,{value:b,className:"text-xs",children:N},b))]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx(Ol,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none"}),a.jsx(Ee,{placeholder:"Search...",value:c,onChange:b=>d(b.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("div",{className:"min-w-[900px]",children:[a.jsxs("div",{className:T("grid items-center py-2.5 border-b border-border",hp),children:[a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-0 z-10 bg-white dark:bg-card pl-6",children:"ID"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-[70px] z-10 bg-white dark:bg-card",children:"Title"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Priority"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Sprint"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Due Date"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Assignees"})]}),f?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(b=>a.jsxs("div",{className:T("grid items-center px-6 py-3 gap-4",hp),children:[a.jsx(le,{className:"h-4 w-14"}),a.jsx(le,{className:"h-4 w-56"}),a.jsx(le,{className:"h-5 w-20"}),a.jsx(le,{className:"h-4 w-16"}),a.jsx(le,{className:"h-4 w-20"}),a.jsx(le,{className:"h-4 w-24"}),a.jsx(le,{className:"h-6 w-16"})]},b))}):u.length===0?a.jsx("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:a.jsx("p",{className:"text-sm font-medium mb-1",children:"No issues yet"})}):a.jsx(ou,{delayDuration:200,children:a.jsx(hJ,{issues:v,childrenMap:x,statuses:t,statusLabels:h,statusColorMap:g,sprints:m,totalCount:j})})]})}),!f&&j>0&&a.jsx("div",{className:"flex items-center px-6 py-3 border-t border-border",children:a.jsxs("span",{className:"text-xs text-muted-foreground",children:[j," issue",j!==1?"s":""]})})]})})}function Wc(e,t){const r=e.start_date?new Date(e.start_date):new Date(e.due_date),n=e.due_date?Ar(new Date(e.due_date),1):Ar(r,1);return{id:e.id,name:`${e.identifier} ${e.title}`,startAt:r,endAt:n,status:{id:e.status,name:e.status,color:t}}}function gJ({token:e,statuses:t}){const[r,n]=p.useState("monthly"),s=p.useRef(null),{data:i=[]}=rv(e),{data:o=[]}=jP(e);p.useEffect(()=>{const m=requestAnimationFrame(()=>{var j;const h=(j=s.current)==null?void 0:j.querySelector(".gantt");if(!h)return;const g=new Date,x=g.getFullYear()-1,v=300;let y;if(r==="daily")y=Math.floor((g.getTime()-new Date(x,0,1).getTime())/864e5)*50;else{const b=r==="monthly"?150:100,N=(g.getFullYear()-x)*12+g.getMonth(),k=new Date(g.getFullYear(),g.getMonth()+1,0).getDate();y=N*b+(g.getDate()-1)/k*b}h.scrollLeft=Math.max(0,y-(h.clientWidth-v)/2)});return()=>cancelAnimationFrame(m)},[r]);const l=Object.fromEntries(t.map(m=>[m.key,m.color])),c=i.filter(m=>m.due_date),d=i.filter(m=>!m.due_date),u={},f=[];for(const m of c)m.sprint_id?(u[m.sprint_id]||(u[m.sprint_id]=[]),u[m.sprint_id].push(m)):f.push(m);return a.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[a.jsx("div",{className:"flex items-center px-6 py-3 border-b border-border shrink-0 bg-white dark:bg-zinc-950",children:a.jsx("div",{className:"flex items-center gap-1 bg-muted rounded-md p-0.5",children:["daily","monthly","quarterly"].map(m=>a.jsx("button",{onClick:()=>n(m),className:`px-3 py-1 rounded text-xs font-medium transition-colors capitalize ${r===m?"bg-white dark:bg-zinc-900 text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:m},m))})}),a.jsx("div",{ref:s,className:"flex-1 min-h-0 overflow-hidden",children:a.jsxs(cJ,{range:r,zoom:100,className:"h-full bg-white dark:bg-zinc-950",children:[a.jsxs(aJ,{children:[o.map(m=>{const h=u[m.id]??[];return a.jsx(Gm,{name:m.name,children:h.map(g=>a.jsx(Ym,{feature:Wc(g,l[g.status]??"#94a3b8")},g.id))},m.id)}),f.length>0&&a.jsx(Gm,{name:"No Sprint",children:f.map(m=>a.jsx(Ym,{feature:Wc(m,l[m.status]??"#94a3b8")},m.id))}),d.length>0&&a.jsx(Gm,{name:"Unscheduled",children:d.map(m=>a.jsx(Ym,{feature:{id:m.id,name:`${m.identifier} ${m.title}`,startAt:new Date,endAt:new Date,status:{id:m.status,name:m.status,color:l[m.status]??"#94a3b8"}}},m.id))})]}),a.jsxs(dJ,{children:[a.jsx(rJ,{}),a.jsxs(lJ,{children:[o.map(m=>a.jsx(Vm,{children:(u[m.id]??[]).map(h=>a.jsx("div",{className:"flex",children:a.jsx(Yw,{...Wc(h,l[h.status]??"#94a3b8")})},h.id))},m.id)),f.length>0&&a.jsx(Vm,{children:f.map(m=>a.jsx("div",{className:"flex",children:a.jsx(Yw,{...Wc(m,l[m.status]??"#94a3b8")})},m.id))}),d.length>0&&a.jsx(Vm,{children:d.map(m=>a.jsx("div",{style:{height:"var(--gantt-row-height)"}},m.id))})]}),o.filter(m=>m.end_date).map(m=>a.jsx(wP,{id:m.id,date:new Date(m.end_date),label:`${m.name} end`},m.id)),a.jsx(uJ,{})]})]})})]})}function xJ(){const{token:e}=qt(),[t,r]=p.useState("board"),{data:n,isLoading:s,isError:i}=fJ(e??""),{data:o}=rv(e??"");if(!e)return null;if(s)return a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading…"})});if(i||!n)return a.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-3",children:[a.jsx("p",{className:"text-lg font-semibold",children:"Link not found"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This share link is invalid or has been revoked."})]});const l=[{key:"board",label:"Board"},{key:"issues",label:"Issues"},{key:"timeline",label:"Timeline"}];return a.jsxs("div",{className:"h-screen flex flex-col bg-background overflow-hidden",children:[a.jsx("header",{className:"border-b border-border px-6 py-3 bg-white dark:bg-card shrink-0",children:a.jsxs("div",{className:"flex items-center gap-3",children:[n.icon&&a.jsx("span",{className:"text-xl",children:n.icon}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 border border-indigo-200 dark:border-indigo-800 px-2 py-0.5 rounded",children:n.identifier}),a.jsx("h1",{className:"text-sm font-semibold",children:n.name})]}),a.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"Read-only view"})]})}),a.jsx("div",{className:"border-b border-border bg-white dark:bg-card px-6 shrink-0",children:a.jsx("div",{className:"flex -mb-px",children:l.map(({key:c,label:d})=>a.jsx("button",{onClick:()=>r(c),className:`px-3 py-2 text-sm border-b-2 transition-colors ${t===c?"border-foreground text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:d},c))})}),a.jsxs("div",{className:`flex-1 min-h-0 ${t==="timeline"?"overflow-hidden":"overflow-auto"}`,children:[t==="board"&&a.jsx(dN,{issues:o??[],projectId:n.id,statuses:n.statuses,readOnly:!0}),t==="issues"&&a.jsx(pJ,{token:e,statuses:n.statuses}),t==="timeline"&&a.jsx(gJ,{token:e,statuses:n.statuses})]})]})}function vJ(){const[e,t]=p.useState(null),r=kt(),n=De();return p.useEffect(()=>{const s=new URLSearchParams(window.location.search);if(history.replaceState(null,"",window.location.pathname),s.get("linked")==="true"){r("/profile?linked=true",{replace:!0});return}const o=s.get("error");if(o){t(decodeURIComponent(o));return}const l=s.get("code");if(!l){t("No authorization code received from Google sign-in");return}(async()=>{const d=await fetch(`${Ni}/auth/google/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:l})});if(!d.ok)throw new Error(`Code exchange failed (${d.status}). Please try signing in again.`);const{token:u}=await d.json(),f=await fetch(`${Ni}/admin/users/me`,{headers:{Authorization:`Bearer ${u}`}});if(!f.ok)throw new Error(`Failed to load user profile (${f.status})`);const m=await f.json();n.login({id:m.id,email:m.email,first_name:m.first_name??"",last_name:m.last_name??""},u),r("/",{replace:!0})})().catch(d=>t(d.message??"Failed to complete sign-in"))},[]),e?a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px] bg-white dark:bg-card border border-border rounded-xl p-6 text-center space-y-4",children:[a.jsx("p",{className:"text-sm font-medium",children:"Sign-in failed"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:e}),a.jsx(Va,{to:"/login",children:a.jsx(Z,{variant:"outline",size:"sm",children:"Back to login"})})]})}):a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Completing sign-in..."})})}function yJ(){return Le({queryKey:["me"],queryFn:()=>te.get("/admin/users/me")})}function bJ(){const e=Ne(),{updateLocalUser:t}=De();return we({mutationFn:r=>te.patch("/admin/users/me",r),onSuccess:({user:r})=>{t({first_name:r.first_name??"",last_name:r.last_name??"",designation:r.designation,phone_number:r.phone_number}),e.invalidateQueries({queryKey:["me"]})}})}function wJ(){const e=Ne(),{updateLocalUser:t}=De();return we({mutationFn:r=>{const n=new FormData;return n.append("avatar",r),te.upload("/admin/users/me/avatar",n)},onSuccess:({user:r})=>{t({avatar_url:r.avatar_url}),e.invalidateQueries({queryKey:["me"]})}})}function jJ(){const e=Ne(),{updateLocalUser:t}=De();return we({mutationFn:()=>te.delete("/admin/users/me/avatar"),onSuccess:()=>{t({avatar_url:null}),e.invalidateQueries({queryKey:["me"]})}})}function NJ(){const e=Ne();return we({mutationFn:()=>te.delete("/admin/users/me/google"),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]})}})}function Gw({className:e}){return a.jsxs("svg",{className:e??"size-4",viewBox:"0 0 24 24","aria-hidden":"true",children:[a.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),a.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),a.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z",fill:"#FBBC05"}),a.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})}function kJ(){var C,P,M,A;const[e,t]=gp(),{user:r}=De(),{data:n,isLoading:s}=yJ(),i=bJ(),o=wJ(),l=jJ(),c=NJ(),d=p.useRef(null),[u,f]=p.useState(""),[m,h]=p.useState(""),[g,x]=p.useState(""),[v,y]=p.useState("");p.useEffect(()=>{n&&(f(n.first_name??""),h(n.last_name??""),x(n.designation??""),y(n.phone_number??""))},[n]),p.useEffect(()=>{e.get("linked")==="true"&&(z.success("Google account connected successfully"),t(_=>(_.delete("linked"),_),{replace:!0}))},[e,t]);const j=r&&(`${((C=r.first_name)==null?void 0:C[0])??""}${((P=r.last_name)==null?void 0:P[0])??""}`.toUpperCase()||((A=(M=r.email)==null?void 0:M[0])==null?void 0:A.toUpperCase()))||"?",b=_=>{var O;const D=(O=_.target.files)==null?void 0:O[0];D&&(o.mutate(D,{onSuccess:()=>z.success("Avatar updated"),onError:R=>z.error(R.message??"Failed to upload avatar")}),_.target.value="")},N=()=>{l.mutate(void 0,{onSuccess:()=>z.success("Avatar removed"),onError:_=>z.error(_.message??"Failed to remove avatar")})},k=()=>{i.mutate({first_name:u,last_name:m,designation:g||null,phone_number:v||null},{onSuccess:()=>z.success("Profile updated"),onError:_=>z.error(_.message??"Failed to update profile")})},w=()=>{const _=localStorage.getItem("meridian_token");if(!_){z.error("You must be logged in to connect Google");return}window.location.href=`${Ni}/auth/google/link?token=${encodeURIComponent(_)}`},S=()=>{c.mutate(void 0,{onSuccess:()=>z.success("Google account disconnected"),onError:_=>z.error(_.message??"Failed to unlink Google account")})};return a.jsx("div",{className:"p-2 h-full",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col h-full",children:[a.jsx("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(hu,{className:"h-5 w-5 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-base font-semibold",children:"Profile"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Manage your personal details and account connections."})]})]})}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground w-44 shrink-0",children:"Profile photo"}),a.jsxs("div",{className:"flex flex-1 items-center gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsxs(Bt,{className:"h-14 w-14 rounded-xl",children:[n!=null&&n.avatar_url?a.jsx(Vo,{src:n.avatar_url,alt:"Avatar",className:"object-cover"}):null,a.jsx(Wt,{className:"rounded-xl bg-foreground text-background text-base font-medium",children:j})]}),o.isPending&&a.jsx("div",{className:"absolute inset-0 rounded-xl bg-black/40 flex items-center justify-center",children:a.jsx("span",{className:"text-white text-[10px]",children:"…"})})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(Z,{variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{var _;return(_=d.current)==null?void 0:_.click()},disabled:o.isPending,children:[a.jsx(oE,{className:"size-3.5"}),"Change photo"]}),(n==null?void 0:n.avatar_url)&&a.jsxs(Z,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-destructive",onClick:N,disabled:l.isPending,children:[a.jsx(Hr,{className:"size-3.5"}),"Remove"]})]}),a.jsx("input",{ref:d,type:"file",accept:"image/*",className:"hidden",onChange:b})]})]}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"Personal information"})}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"First name"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Ee,{value:u,onChange:_=>f(_.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"First name"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Last name"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Ee,{value:m,onChange:_=>h(_.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"Last name"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Email"}),s?a.jsx(le,{className:"h-4 w-48"}):a.jsx("span",{className:"text-sm text-muted-foreground",children:(n==null?void 0:n.email)??"—"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Designation"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Ee,{value:g,onChange:_=>x(_.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"e.g. Software Engineer"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Phone number"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Ee,{value:v,onChange:_=>y(_.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"+1 555 000 0000"})]}),a.jsx("div",{className:"flex justify-end px-6 py-4 border-b border-border",children:a.jsx(Z,{size:"sm",onClick:k,disabled:i.isPending,children:i.isPending?"Saving…":"Save changes"})}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"Connections"})}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(Gw,{className:"size-3.5 shrink-0"}),"Google"]}),s?a.jsx(le,{className:"h-8 w-48"}):n!=null&&n.google_id?a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[a.jsx(rs,{className:"size-3.5 text-emerald-500 shrink-0"}),a.jsx("span",{className:"text-foreground font-medium",children:"Connected"}),a.jsxs("span",{className:"text-muted-foreground",children:["· ",n.email]})]}),a.jsxs(Z,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-muted-foreground hover:text-destructive ml-auto",onClick:S,disabled:c.isPending,children:[a.jsx(Op,{className:"size-3.5"}),"Disconnect"]})]}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Not connected"}),a.jsxs(Z,{variant:"outline",size:"sm",className:"h-7 gap-1.5",onClick:w,children:[a.jsx(Gw,{className:"size-3.5"}),"Connect"]})]})]})]})]})})}const SJ=p.lazy(()=>Rj(()=>import("./ProjectTimelinePage-NmU5j1-P.js"),__vite__mapDeps([0,1,2,3,4,5])).then(e=>({default:e.ProjectTimelinePage}))),CJ=p.lazy(()=>Rj(()=>import("./WorkspaceReportingPage-DDKH1sld.js"),__vite__mapDeps([6,1,2,3,4,5])).then(e=>({default:e.WorkspaceReportingPage})));function ui({children:e}){const{isAuthenticated:t}=De();return t?a.jsx(a.Fragment,{children:e}):a.jsx(_s,{to:"/login",replace:!0})}function _J({children:e}){var r;const{user:t}=De();return(r=t==null?void 0:t.roles)!=null&&r.includes("super-admin")?a.jsx(a.Fragment,{children:e}):a.jsx(_s,{to:"/",replace:!0})}function Vw({children:e}){const{isAuthenticated:t}=De(),{data:r}=vu(),n=au();return t?a.jsx(_s,{to:"/",replace:!0}):r!=null&&r.needsSetup&&n.pathname==="/login"?a.jsx(_s,{to:"/register",replace:!0}):r&&!r.needsSetup&&n.pathname==="/register"?a.jsx(_s,{to:"/login",replace:!0}):a.jsx(a.Fragment,{children:e})}function OJ(){const{workspace:e,setWorkspace:t}=De(),r=kt(),{data:n,isLoading:s}=pu(!e);return p.useEffect(()=>{if(e){r(`/${e.slug}/projects`,{replace:!0});return}if(!s&&n!==void 0)if(n.length>0){const i=n[0];t({id:i.id,name:i.name,slug:i.slug}),r(`/${i.slug}/projects`,{replace:!0})}else r("/setup",{replace:!0})},[e,n,s,r,t]),a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading..."})})}function PJ(){const{workspace:e}=qt(),{workspace:t,setWorkspace:r}=De();dD();const n=kt(),{data:s,isLoading:i,isFetching:o}=pu();return p.useEffect(()=>{if(i||!s)return;const l=s.find(c=>c.slug===e);l?l.id!==(t==null?void 0:t.id)&&r({id:l.id,name:l.name,slug:l.slug}):s.length>0?n(`/${s[0].slug}/projects`,{replace:!0}):!t&&!o&&n("/setup",{replace:!0})},[s,e,i,o,t==null?void 0:t.id,n,r]),i||!t||t.slug!==e?a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading..."})}):a.jsxs(a.Fragment,{children:[a.jsx(HD,{}),a.jsx(PT,{})]})}function MJ(){return a.jsxs(EP,{children:[a.jsx(Ke,{path:"/login",element:a.jsx(Vw,{children:a.jsx(MT,{})})}),a.jsx(Ke,{path:"/register",element:a.jsx(Vw,{children:a.jsx(AT,{})})}),a.jsx(Ke,{path:"/invite/:token",element:a.jsx(Z$,{})}),a.jsx(Ke,{path:"/oauth/google/callback",element:a.jsx(vJ,{})}),a.jsx(Ke,{path:"/share/:token",element:a.jsx(xJ,{})}),a.jsx(Ke,{path:"/reporting",element:a.jsx(ui,{children:a.jsx(QD,{})}),children:a.jsx(Ke,{index:!0,element:a.jsx(YX,{})})}),a.jsx(Ke,{path:"/org/settings",element:a.jsx(ui,{children:a.jsx(eT,{})}),children:a.jsx(Ke,{index:!0,element:a.jsx(aQ,{})})}),a.jsx(Ke,{path:"/profile",element:a.jsx(ui,{children:a.jsx(nT,{})}),children:a.jsx(Ke,{index:!0,element:a.jsx(kJ,{})})}),a.jsx(Ke,{path:"/setup",element:a.jsx(ui,{children:a.jsx(ET,{})})}),a.jsx(Ke,{index:!0,element:a.jsx(ui,{children:a.jsx(OJ,{})})}),a.jsxs(Ke,{path:"/:workspace",element:a.jsx(ui,{children:a.jsx(PJ,{})}),children:[a.jsx(Ke,{index:!0,element:a.jsx(_s,{to:"projects",replace:!0})}),a.jsx(Ke,{path:"projects",element:a.jsx(F3,{})}),a.jsxs(Ke,{path:"projects/:projectKey",element:a.jsx(GD,{}),children:[a.jsx(Ke,{path:"board",element:a.jsx(QR,{})}),a.jsx(Ke,{path:"issues",element:a.jsx(ZR,{})}),a.jsx(Ke,{path:"issues/new",element:a.jsx(_$,{})}),a.jsx(Ke,{path:"issues/:issueId",element:a.jsx(j$,{})}),a.jsx(Ke,{path:"sprints",element:a.jsx(T$,{})}),a.jsx(Ke,{path:"timeline",element:a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:a.jsx(SJ,{})})}),a.jsx(Ke,{path:"access",element:a.jsx(v$,{})}),a.jsx(Ke,{path:"reports",element:a.jsx(GX,{})}),a.jsx(Ke,{path:"activity",element:a.jsx(ZX,{})})]}),a.jsx(Ke,{path:"notifications",element:a.jsx(M$,{})}),a.jsx(Ke,{path:"reporting",element:a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:a.jsx(CJ,{})})}),a.jsx(Ke,{path:"settings",element:a.jsx(Y$,{})}),a.jsx(Ke,{path:"roles",element:a.jsx(_J,{children:a.jsx(X$,{})})})]}),a.jsx(Ke,{path:"*",element:a.jsx(_s,{to:"/",replace:!0})})]})}window.__React=E;window.__ReactJsxRuntime=_P;const AJ=new OP({defaultOptions:{queries:{staleTime:1e3*30,retry:1}}});(async()=>{let e=[];try{const r=await import("/admin-extensions.js");Array.isArray(r==null?void 0:r.default)&&(e=r.default)}catch{}Ij(document.getElementById("root")).render(a.jsx(p.StrictMode,{children:a.jsx(ZA,{widgets:[...UE,...e],children:a.jsx(xA,{children:a.jsxs(PP,{client:AJ,children:[a.jsx(vA,{children:a.jsx(yA,{children:a.jsx(DP,{children:a.jsxs(ou,{delayDuration:300,children:[a.jsx(MJ,{}),a.jsx(iA,{position:"bottom-right",toastOptions:{classNames:{toast:"bg-white dark:bg-card border border-border text-foreground text-sm rounded-lg shadow-sm",description:"text-muted-foreground"}}})]})})})}),a.jsx(DM,{initialIsOpen:!1})]})})})}))})();export{Z as B,zu as C,cJ as G,XN as I,it as P,YX as R,yr as W,Nl as a,Ji as b,eo as c,Xp as d,Qp as e,aJ as f,Gm as g,Ym as h,dJ as i,rJ as j,lJ as k,Vm as l,Yw as m,wP as n,uJ as o,uN as p,Ar as q,ue as r,lN as s,z as t,ka as u,At as v,te as w,De as x};
|