@meridianjs/admin-dashboard 0.1.41 → 0.1.42
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-t37bNlU4.js +3 -0
- package/dist/assets/{WorkspaceReportingPage-JQfr6bSh.js → WorkspaceReportingPage-C5UxrMV5.js} +1 -1
- package/dist/assets/exceljs.min-BhVFTGw4.js +57 -0
- package/dist/assets/index-DZZadRww.css +1 -0
- package/dist/assets/index-DtZ73_T2.js +629 -0
- package/dist/index.html +2 -2
- package/package.json +2 -1
- package/dist/assets/ProjectTimelinePage-CpMsZyRM.js +0 -1
- package/dist/assets/index-CpG8Mt5c.css +0 -1
- package/dist/assets/index-PJTvPCLS.js +0 -619
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectTimelinePage-t37bNlU4.js","assets/vendor-query-CaIGp3JB.js","assets/vendor-react-Lycsri1F.js","assets/vendor-radix-CeigSZIw.js","assets/vendor-dnd-B31T8w2X.js","assets/vendor-editor-BoEtjgAn.js","assets/WorkspaceReportingPage-C5UxrMV5.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var sM=Object.defineProperty;var iM=(e,t,r)=>t in e?sM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var lm=(e,t,r)=>iM(e,typeof t!="symbol"?t+"":t,r);import{j as a,u as We,a as Ne,b as ge,R as oM,Q as lM,c as cM}from"./vendor-query-CaIGp3JB.js";import{a as Ip,c as z,r as h,b as dM,u as Wt,d as Bl,N as Bn,e as jt,L as Fr,O as Wl,f as Ul,h as Yn,g as Ta,R as uM,i as Ec,j as fM,k as Ke,B as mM}from"./vendor-react-Lycsri1F.js";import{C as jj,R as hM,T as pM,P as xM,S as Rp,a as Nj,O as mi,b as ql,c as hi,d as Cu,e as ao,D as so,f as Hl,g as kj,h as Sj,i as gM,j as Cj,I as _j,k as Oj,l as Pj,m as Mj,L as Ej,n as Aj,o as vM,p as yM,q as Dj,r as Tj,F as Ij,u as Ri,t as vs,s as bM,v as Rj,w as $j,x as wM,y as zj,z as Lj,A as jM,B as Fj,V as NM,E as Bj,G as Wj,H as kM,J as SM,K as Uj,M as CM,N as _M,Q as OM,U as qj,W as PM,X as MM,Y as Hj,Z as _u,_ as EM,$ as Rs,a0 as AM,a1 as DM,a2 as Kj,a3 as TM,a4 as IM,a5 as Yj,a6 as RM,a7 as $M,a8 as Gj,a9 as zM,aa as LM,ab as FM,ac as BM,ad as WM,ae as UM,af as qM,ag as HM,ah as KM,ai as YM,aj as GM,ak as Vj,al as VM,am as XM,an as QM,ao as ZM,ap as JM,aq as eE}from"./vendor-radix-CeigSZIw.js";import{u as Xj,a as $p,P as Qj,D as ul,S as zp,h as Zj,b as dd,c as Lp,C as Fp,d as tE,v as rE,r as nE,e as aE,f as sE,M as iE,g as Jj}from"./vendor-dnd-B31T8w2X.js";import{P as e1,a as oE,D as lE,b as cE,e as dE,N as uE,c as fE,d as mE,m as Ac,E as hE,u as t1,i as r1,f as n1,g as a1,h as s1,j as pE,k as xE,w as gE}from"./vendor-editor-BoEtjgAn.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 i1,Ev=Ip;i1=Ev.createRoot,Ev.hydrateRoot;const vE="modulepreload",yE=function(e){return"/"+e},Av={},o1=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=yE(c),c in Av)return;Av[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":vE,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((m,p)=>{f.addEventListener("load",m),f.addEventListener("error",()=>p(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 bE=function(){return null},wE=e=>{switch(e){case"success":return kE;case"info":return CE;case"warning":return SE;case"error":return _E;default:return null}},jE=Array(12).fill(0),NE=({visible:e,className:t})=>z.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},z.createElement("div",{className:"sonner-spinner"},jE.map((r,n)=>z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),kE=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.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"})),SE=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},z.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"})),CE=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.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"})),_E=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.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"})),OE=z.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"},z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),PE=()=>{let[e,t]=z.useState(document.hidden);return z.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},mh=1,ME=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:mh++,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],z.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(AE(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)||mh++;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}},Ir=new ME,EE=(e,t)=>{let r=(t==null?void 0:t.id)||mh++;return Ir.addToast({title:e,...t,id:r}),r},AE=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",DE=EE,TE=()=>Ir.toasts,IE=()=>Ir.getActiveToasts(),B=Object.assign(DE,{success:Ir.success,info:Ir.info,warning:Ir.warning,error:Ir.error,custom:Ir.custom,message:Ir.message,promise:Ir.promise,dismiss:Ir.dismiss,loading:Ir.loading},{getHistory:TE,getToasts:IE});function RE(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))}RE(`: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 Dc(e){return e.label!==void 0}var $E=3,zE="32px",LE="16px",Dv=4e3,FE=356,BE=14,WE=20,UE=200;function gn(...e){return e.filter(Boolean).join(" ")}function qE(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var HE=e=>{var t,r,n,s,i,o,l,c,d,u,f;let{invert:m,toast:p,unstyled:x,interacting:g,setHeights:v,visibleToasts:y,heights:j,index:N,toasts:w,expanded:k,removeToast:b,defaultRichColors:S,closeButton:_,style:C,cancelButtonStyle:T,actionButtonStyle:M,className:O="",descriptionClassName:R="",duration:E,position:A,gap:P,loadingIcon:U,expandByDefault:Q,classNames:K,icons:se,closeButtonAriaLabel:ae="Close toast",pauseWhenPageIsHidden:W}=e,[Y,te]=z.useState(null),[X,I]=z.useState(null),[D,Z]=z.useState(!1),[F,q]=z.useState(!1),[ce,ee]=z.useState(!1),[ue,V]=z.useState(!1),[le,pe]=z.useState(!1),[we,_e]=z.useState(0),[H,ye]=z.useState(0),De=z.useRef(p.duration||E||Dv),He=z.useRef(null),Fe=z.useRef(null),Qe=N===0,gt=N+1<=y,Ge=p.type,Ze=p.dismissible!==!1,pr=p.className||"",pn=p.descriptionClassName||"",Ar=z.useMemo(()=>j.findIndex(ie=>ie.toastId===p.id)||0,[j,p.id]),xn=z.useMemo(()=>{var ie;return(ie=p.closeButton)!=null?ie:_},[p.closeButton,_]),xr=z.useMemo(()=>p.duration||E||Dv,[p.duration,E]),Ct=z.useRef(0),Rt=z.useRef(0),Ht=z.useRef(0),er=z.useRef(null),[Dn,la]=A.split("-"),Pe=z.useMemo(()=>j.reduce((ie,Ce,Te)=>Te>=Ar?ie:ie+Ce.height,0),[j,Ar]),he=PE(),be=p.invert||m,fe=Ge==="loading";Rt.current=z.useMemo(()=>Ar*P+Pe,[Ar,Pe]),z.useEffect(()=>{De.current=xr},[xr]),z.useEffect(()=>{Z(!0)},[]),z.useEffect(()=>{let ie=Fe.current;if(ie){let Ce=ie.getBoundingClientRect().height;return ye(Ce),v(Te=>[{toastId:p.id,height:Ce,position:p.position},...Te]),()=>v(Te=>Te.filter(vt=>vt.toastId!==p.id))}},[v,p.id]),z.useLayoutEffect(()=>{if(!D)return;let ie=Fe.current,Ce=ie.style.height;ie.style.height="auto";let Te=ie.getBoundingClientRect().height;ie.style.height=Ce,ye(Te),v(vt=>vt.find(tt=>tt.toastId===p.id)?vt.map(tt=>tt.toastId===p.id?{...tt,height:Te}:tt):[{toastId:p.id,height:Te,position:p.position},...vt])},[D,p.title,p.description,v,p.id]);let xe=z.useCallback(()=>{q(!0),_e(Rt.current),v(ie=>ie.filter(Ce=>Ce.toastId!==p.id)),setTimeout(()=>{b(p)},UE)},[p,b,v,Rt]);z.useEffect(()=>{if(p.promise&&Ge==="loading"||p.duration===1/0||p.type==="loading")return;let ie;return k||g||W&&he?(()=>{if(Ht.current<Ct.current){let Ce=new Date().getTime()-Ct.current;De.current=De.current-Ce}Ht.current=new Date().getTime()})():De.current!==1/0&&(Ct.current=new Date().getTime(),ie=setTimeout(()=>{var Ce;(Ce=p.onAutoClose)==null||Ce.call(p,p),xe()},De.current)),()=>clearTimeout(ie)},[k,g,p,Ge,W,he,xe]),z.useEffect(()=>{p.delete&&xe()},[xe,p.delete]);function Ve(){var ie,Ce,Te;return se!=null&&se.loading?z.createElement("div",{className:gn(K==null?void 0:K.loader,(ie=p==null?void 0:p.classNames)==null?void 0:ie.loader,"sonner-loader"),"data-visible":Ge==="loading"},se.loading):U?z.createElement("div",{className:gn(K==null?void 0:K.loader,(Ce=p==null?void 0:p.classNames)==null?void 0:Ce.loader,"sonner-loader"),"data-visible":Ge==="loading"},U):z.createElement(NE,{className:gn(K==null?void 0:K.loader,(Te=p==null?void 0:p.classNames)==null?void 0:Te.loader),visible:Ge==="loading"})}return z.createElement("li",{tabIndex:0,ref:Fe,className:gn(O,pr,K==null?void 0:K.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[Ge],(r=p==null?void 0:p.classNames)==null?void 0:r[Ge]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:S,"data-styled":!(p.jsx||p.unstyled||x),"data-mounted":D,"data-promise":!!p.promise,"data-swiped":le,"data-removed":F,"data-visible":gt,"data-y-position":Dn,"data-x-position":la,"data-index":N,"data-front":Qe,"data-swiping":ce,"data-dismissible":Ze,"data-type":Ge,"data-invert":be,"data-swipe-out":ue,"data-swipe-direction":X,"data-expanded":!!(k||Q&&D),style:{"--index":N,"--toasts-before":N,"--z-index":w.length-N,"--offset":`${F?we:Rt.current}px`,"--initial-height":Q?"auto":`${H}px`,...C,...p.style},onDragEnd:()=>{ee(!1),te(null),er.current=null},onPointerDown:ie=>{fe||!Ze||(He.current=new Date,_e(Rt.current),ie.target.setPointerCapture(ie.pointerId),ie.target.tagName!=="BUTTON"&&(ee(!0),er.current={x:ie.clientX,y:ie.clientY}))},onPointerUp:()=>{var ie,Ce,Te,vt;if(ue||!Ze)return;er.current=null;let tt=Number(((ie=Fe.current)==null?void 0:ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),rt=Number(((Ce=Fe.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),gr=new Date().getTime()-((Te=He.current)==null?void 0:Te.getTime()),tr=Y==="x"?tt:rt,Tn=Math.abs(tr)/gr;if(Math.abs(tr)>=WE||Tn>.11){_e(Rt.current),(vt=p.onDismiss)==null||vt.call(p,p),I(Y==="x"?tt>0?"right":"left":rt>0?"down":"up"),xe(),V(!0),pe(!1);return}ee(!1),te(null)},onPointerMove:ie=>{var Ce,Te,vt,tt;if(!er.current||!Ze||((Ce=window.getSelection())==null?void 0:Ce.toString().length)>0)return;let rt=ie.clientY-er.current.y,gr=ie.clientX-er.current.x,tr=(Te=e.swipeDirections)!=null?Te:qE(A);!Y&&(Math.abs(gr)>1||Math.abs(rt)>1)&&te(Math.abs(gr)>Math.abs(rt)?"x":"y");let Tn={x:0,y:0};Y==="y"?(tr.includes("top")||tr.includes("bottom"))&&(tr.includes("top")&&rt<0||tr.includes("bottom")&&rt>0)&&(Tn.y=rt):Y==="x"&&(tr.includes("left")||tr.includes("right"))&&(tr.includes("left")&&gr<0||tr.includes("right")&&gr>0)&&(Tn.x=gr),(Math.abs(Tn.x)>0||Math.abs(Tn.y)>0)&&pe(!0),(vt=Fe.current)==null||vt.style.setProperty("--swipe-amount-x",`${Tn.x}px`),(tt=Fe.current)==null||tt.style.setProperty("--swipe-amount-y",`${Tn.y}px`)}},xn&&!p.jsx?z.createElement("button",{"aria-label":ae,"data-disabled":fe,"data-close-button":!0,onClick:fe||!Ze?()=>{}:()=>{var ie;xe(),(ie=p.onDismiss)==null||ie.call(p,p)},className:gn(K==null?void 0:K.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(i=se==null?void 0:se.close)!=null?i:OE):null,p.jsx||h.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:z.createElement(z.Fragment,null,Ge||p.icon||p.promise?z.createElement("div",{"data-icon":"",className:gn(K==null?void 0:K.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Ve():null,p.type!=="loading"?p.icon||(se==null?void 0:se[Ge])||wE(Ge):null):null,z.createElement("div",{"data-content":"",className:gn(K==null?void 0:K.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},z.createElement("div",{"data-title":"",className:gn(K==null?void 0:K.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?z.createElement("div",{"data-description":"",className:gn(R,pn,K==null?void 0:K.description,(d=p==null?void 0:p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),h.isValidElement(p.cancel)?p.cancel:p.cancel&&Dc(p.cancel)?z.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||T,onClick:ie=>{var Ce,Te;Dc(p.cancel)&&Ze&&((Te=(Ce=p.cancel).onClick)==null||Te.call(Ce,ie),xe())},className:gn(K==null?void 0:K.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,h.isValidElement(p.action)?p.action:p.action&&Dc(p.action)?z.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||M,onClick:ie=>{var Ce,Te;Dc(p.action)&&((Te=(Ce=p.action).onClick)==null||Te.call(Ce,ie),!ie.defaultPrevented&&xe())},className:gn(K==null?void 0:K.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function Tv(){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 KE(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",l=i?LE:zE;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 YE=h.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:p,visibleToasts:x=$E,toastOptions:g,dir:v=Tv(),gap:y=BE,loadingIcon:j,icons:N,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:k}=e,[b,S]=z.useState([]),_=z.useMemo(()=>Array.from(new Set([n].concat(b.filter(W=>W.position).map(W=>W.position)))),[b,n]),[C,T]=z.useState([]),[M,O]=z.useState(!1),[R,E]=z.useState(!1),[A,P]=z.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=z.useRef(null),Q=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=z.useRef(null),se=z.useRef(!1),ae=z.useCallback(W=>{S(Y=>{var te;return(te=Y.find(X=>X.id===W.id))!=null&&te.delete||Ir.dismiss(W.id),Y.filter(({id:X})=>X!==W.id)})},[]);return z.useEffect(()=>Ir.subscribe(W=>{if(W.dismiss){S(Y=>Y.map(te=>te.id===W.id?{...te,delete:!0}:te));return}setTimeout(()=>{dM.flushSync(()=>{S(Y=>{let te=Y.findIndex(X=>X.id===W.id);return te!==-1?[...Y.slice(0,te),{...Y[te],...W},...Y.slice(te+1)]:[W,...Y]})})})}),[]),z.useEffect(()=>{if(u!=="system"){P(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;let W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:Y})=>{P(Y?"dark":"light")})}catch{W.addListener(({matches:te})=>{try{P(te?"dark":"light")}catch(X){console.error(X)}})}},[u]),z.useEffect(()=>{b.length<=1&&O(!1)},[b]),z.useEffect(()=>{let W=Y=>{var te,X;s.every(I=>Y[I]||Y.code===I)&&(O(!0),(te=U.current)==null||te.focus()),Y.code==="Escape"&&(document.activeElement===U.current||(X=U.current)!=null&&X.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[s]),z.useEffect(()=>{if(U.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,se.current=!1)}},[U.current]),z.createElement("section",{ref:t,"aria-label":`${w} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map((W,Y)=>{var te;let[X,I]=W.split("-");return b.length?z.createElement("ol",{key:W,dir:v==="auto"?Tv():v,tabIndex:-1,ref:U,className:l,"data-sonner-toaster":!0,"data-theme":A,"data-y-position":X,"data-lifted":M&&b.length>1&&!i,"data-x-position":I,style:{"--front-toast-height":`${((te=C[0])==null?void 0:te.height)||0}px`,"--width":`${FE}px`,"--gap":`${y}px`,...p,...KE(c,d)},onBlur:D=>{se.current&&!D.currentTarget.contains(D.relatedTarget)&&(se.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:D=>{D.target instanceof HTMLElement&&D.target.dataset.dismissible==="false"||se.current||(se.current=!0,K.current=D.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{R||O(!1)},onDragEnd:()=>O(!1),onPointerDown:D=>{D.target instanceof HTMLElement&&D.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},b.filter(D=>!D.position&&Y===0||D.position===W).map((D,Z)=>{var F,q;return z.createElement(HE,{key:D.id,icons:N,index:Z,toast:D,defaultRichColors:f,duration:(F=g==null?void 0:g.duration)!=null?F:m,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:x,closeButton:(q=g==null?void 0:g.closeButton)!=null?q:o,interacting:R,position:W,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:ae,toasts:b.filter(ce=>ce.position==D.position),heights:C.filter(ce=>ce.position==D.position),setHeights:T,expandByDefault:i,gap:y,loadingIcon:j,expanded:M,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))}),GE=(e,t,r,n,s,i,o,l)=>{let c=document.documentElement,d=["light","dark"];function u(p){(Array.isArray(e)?e:[e]).forEach(x=>{let g=x==="class",v=g&&i?s.map(y=>i[y]||y):s;g?(c.classList.remove(...v),c.classList.add(i&&i[p]?i[p]:p)):c.setAttribute(x,p)}),f(p)}function f(p){l&&d.includes(p)&&(c.style.colorScheme=p)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(n)u(n);else try{let p=localStorage.getItem(t)||r,x=o&&p==="system"?m():p;u(x)}catch{}},Iv=["light","dark"],l1="(prefers-color-scheme: dark)",VE=typeof window>"u",Bp=h.createContext(void 0),XE={setTheme:e=>{},themes:[]},QE=()=>{var e;return(e=h.useContext(Bp))!=null?e:XE},ZE=e=>h.useContext(Bp)?h.createElement(h.Fragment,null,e.children):h.createElement(eA,{...e}),JE=["light","dark"],eA=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:n=!0,storageKey:s="theme",themes:i=JE,defaultTheme:o=r?"system":"light",attribute:l="data-theme",value:c,children:d,nonce:u,scriptProps:f})=>{let[m,p]=h.useState(()=>rA(s,o)),[x,g]=h.useState(()=>m==="system"?cm():m),v=c?Object.values(c):i,y=h.useCallback(k=>{let b=k;if(!b)return;k==="system"&&r&&(b=cm());let S=c?c[b]:b,_=t?nA(u):null,C=document.documentElement,T=M=>{M==="class"?(C.classList.remove(...v),S&&C.classList.add(S)):M.startsWith("data-")&&(S?C.setAttribute(M,S):C.removeAttribute(M))};if(Array.isArray(l)?l.forEach(T):T(l),n){let M=Iv.includes(o)?o:null,O=Iv.includes(b)?b:M;C.style.colorScheme=O}_==null||_()},[u]),j=h.useCallback(k=>{let b=typeof k=="function"?k(m):k;p(b);try{localStorage.setItem(s,b)}catch{}},[m]),N=h.useCallback(k=>{let b=cm(k);g(b),m==="system"&&r&&!e&&y("system")},[m,e]);h.useEffect(()=>{let k=window.matchMedia(l1);return k.addListener(N),N(k),()=>k.removeListener(N)},[N]),h.useEffect(()=>{let k=b=>{b.key===s&&(b.newValue?p(b.newValue):j(o))};return window.addEventListener("storage",k),()=>window.removeEventListener("storage",k)},[j]),h.useEffect(()=>{y(e??m)},[e,m]);let w=h.useMemo(()=>({theme:m,setTheme:j,forcedTheme:e,resolvedTheme:m==="system"?x:m,themes:r?[...i,"system"]:i,systemTheme:r?x:void 0}),[m,j,e,x,r,i]);return h.createElement(Bp.Provider,{value:w},h.createElement(tA,{forcedTheme:e,storageKey:s,attribute:l,enableSystem:r,enableColorScheme:n,defaultTheme:o,value:c,themes:i,nonce:u,scriptProps:f}),d)},tA=h.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 h.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${GE.toString()})(${u})`}})}),rA=(e,t)=>{if(VE)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},nA=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)}},cm=e=>(e||(e=window.matchMedia(l1)),e.matches?"dark":"light");function aA({children:e}){return a.jsx(ZE,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:e})}const c1=h.createContext(null),ks="meridian_token",Do="meridian_user",Tc="meridian_workspace";function Rv(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{roles:Array.isArray(n.roles)?n.roles:[],permissions:Array.isArray(n.permissions)?n.permissions:[]}}catch{return{roles:[],permissions:[]}}}function sA({children:e}){const[t,r]=h.useState(()=>{try{const f=localStorage.getItem(Do),m=localStorage.getItem(ks);if(!f)return null;const p=JSON.parse(f),{roles:x,permissions:g}=m?Rv(m):{roles:[],permissions:[]};return p.roles=x,p.permissions=g,p}catch{return null}}),[n,s]=h.useState(()=>{const f=localStorage.getItem(ks),m=localStorage.getItem(Do);return f&&!m?(localStorage.removeItem(ks),null):f}),[i,o]=h.useState(()=>{try{const f=localStorage.getItem(Tc);return f?JSON.parse(f):null}catch{return null}}),l=(f,m)=>{const{roles:p,permissions:x}=Rv(m),g={...f,roles:p,permissions:x};r(g),s(m),localStorage.setItem(ks,m),localStorage.setItem(Do,JSON.stringify(g))},c=()=>{const f=localStorage.getItem(ks);f&&fetch("/auth/logout",{method:"POST",headers:{Authorization:`Bearer ${f}`,"Content-Type":"application/json"}}).catch(()=>{}),r(null),s(null),o(null),localStorage.removeItem(ks),localStorage.removeItem(Do),localStorage.removeItem(Tc)};h.useEffect(()=>{const f=()=>{localStorage.getItem(ks)&&c()};return window.addEventListener("meridian:unauthorized",f),()=>window.removeEventListener("meridian:unauthorized",f)},[]);const d=f=>{o(f),f?localStorage.setItem(Tc,JSON.stringify(f)):localStorage.removeItem(Tc)},u=f=>{r(m=>{if(!m)return m;const p={...m,...f};return localStorage.setItem(Do,JSON.stringify(p)),p})};return a.jsx(c1.Provider,{value:{user:t,token:n,workspace:i,isAuthenticated:!!n&&!!t,login:l,logout:c,setWorkspace:d,updateLocalUser:u},children:e})}function Ie(){const e=h.useContext(c1);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const d1=h.createContext(null);function iA({children:e}){const[t,r]=h.useState(!1);return h.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(d1.Provider,{value:{open:t,setOpen:r,toggle:()=>r(n=>!n)},children:e})}function Wp(){const e=h.useContext(d1);if(!e)throw new Error("useCommandPalette must be used within CommandPaletteProvider");return e}function u1(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=u1(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function it(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=u1(e))&&(n&&(n+=" "),n+=t);return n}const Up="-",oA=e=>{const t=cA(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Up);return l[0]===""&&l.length!==1&&l.shift(),f1(l,t)||lA(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},f1=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?f1(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Up);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},$v=/^\[(.+)\]$/,lA=e=>{if($v.test(e)){const t=$v.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},cA=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return uA(Object.entries(e.classGroups),r).forEach(([i,o])=>{hh(o,n,i,t)}),n},hh=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:zv(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(dA(s)){hh(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{hh(o,zv(t,i),r,n)})})},zv=(e,t)=>{let r=e;return t.split(Up).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},dA=e=>e.isThemeGetter,uA=(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,fA=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)}}},m1="!",mA=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),p=m.startsWith(m1),x=p?m.substring(1):m,g=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:g}};return r?l=>r({className:l,parseClassName:o}):o},hA=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},pA=e=>({cache:fA(e.cacheSize),parseClassName:mA(e),...oA(e)}),xA=/\s+/,gA=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(xA);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}=r(d);let x=!!p,g=n(x?m.substring(0,p):m);if(!g){if(!x){l=d+(l.length>0?" "+l:l);continue}if(g=n(m),!g){l=d+(l.length>0?" "+l:l);continue}x=!1}const v=hA(u).join(":"),y=f?v+m1:v,j=y+g;if(i.includes(j))continue;i.push(j);const N=s(g,x);for(let w=0;w<N.length;++w){const k=N[w];i.push(y+k)}l=d+(l.length>0?" "+l:l)}return l};function vA(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=h1(t))&&(n&&(n+=" "),n+=r);return n}const h1=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=h1(e[n]))&&(r&&(r+=" "),r+=t);return r};function yA(e,...t){let r,n,s,i=o;function o(c){const d=t.reduce((u,f)=>f(u),e());return r=pA(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=gA(c,r);return s(c,u),u}return function(){return i(vA.apply(null,arguments))}}const ut=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},p1=/^\[(?:([a-z-]+):)?(.+)\]$/i,bA=/^\d+\/\d+$/,wA=new Set(["px","full","screen"]),jA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NA=/\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$/,kA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ua=e=>$i(e)||wA.has(e)||bA.test(e),Va=e=>io(e,"length",TA),$i=e=>!!e&&!Number.isNaN(Number(e)),dm=e=>io(e,"number",$i),To=e=>!!e&&Number.isInteger(Number(e)),_A=e=>e.endsWith("%")&&$i(e.slice(0,-1)),Re=e=>p1.test(e),Xa=e=>jA.test(e),OA=new Set(["length","size","percentage"]),PA=e=>io(e,OA,x1),MA=e=>io(e,"position",x1),EA=new Set(["image","url"]),AA=e=>io(e,EA,RA),DA=e=>io(e,"",IA),Io=()=>!0,io=(e,t,r)=>{const n=p1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},TA=e=>NA.test(e)&&!kA.test(e),x1=()=>!1,IA=e=>SA.test(e),RA=e=>CA.test(e),$A=()=>{const e=ut("colors"),t=ut("spacing"),r=ut("blur"),n=ut("brightness"),s=ut("borderColor"),i=ut("borderRadius"),o=ut("borderSpacing"),l=ut("borderWidth"),c=ut("contrast"),d=ut("grayscale"),u=ut("hueRotate"),f=ut("invert"),m=ut("gap"),p=ut("gradientColorStops"),x=ut("gradientColorStopPositions"),g=ut("inset"),v=ut("margin"),y=ut("opacity"),j=ut("padding"),N=ut("saturate"),w=ut("scale"),k=ut("sepia"),b=ut("skew"),S=ut("space"),_=ut("translate"),C=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Re,t],O=()=>[Re,t],R=()=>["",ua,Va],E=()=>["auto",$i,Re],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",Re],se=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ae=()=>[$i,Re];return{cacheSize:500,separator:":",theme:{colors:[Io],spacing:[ua,Va],blur:["none","",Xa,Re],brightness:ae(),borderColor:[e],borderRadius:["none","","full",Xa,Re],borderSpacing:O(),borderWidth:R(),contrast:ae(),grayscale:K(),hueRotate:ae(),invert:K(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[_A,Va],inset:M(),margin:M(),opacity:ae(),padding:O(),saturate:ae(),scale:ae(),sepia:K(),skew:ae(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",Re]}],container:["container"],columns:[{columns:[Xa]}],"break-after":[{"break-after":se()}],"break-before":[{"break-before":se()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...A(),Re]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",To,Re]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Re]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",To,Re]}],"grid-cols":[{"grid-cols":[Io]}],"col-start-end":[{col:["auto",{span:["full",To,Re]},Re]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[Io]}],"row-start-end":[{row:["auto",{span:[To,Re]},Re]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Re]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"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",Re,t]}],"min-w":[{"min-w":[Re,t,"min","max","fit"]}],"max-w":[{"max-w":[Re,t,"none","full","min","max","fit","prose",{screen:[Xa]},Xa]}],h:[{h:[Re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Xa,Va]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",dm]}],"font-family":[{font:[Io]}],"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",Re]}],"line-clamp":[{"line-clamp":["none",$i,dm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ua,Re]}],"list-image":[{"list-image":["none",Re]}],"list-style-type":[{list:["none","disc","decimal",Re]}],"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:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ua,Va]}],"underline-offset":[{"underline-offset":["auto",ua,Re]}],"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:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re]}],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",Re]}],"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:[...A(),MA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",PA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},AA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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:[...P(),"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:P()}],"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:["",...P()]}],"outline-offset":[{"outline-offset":[ua,Re]}],"outline-w":[{outline:[ua,Va]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ua,Va]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Xa,DA]}],"shadow-color":[{shadow:[Io]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Xa,Re]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[N]}],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":[N]}],"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",Re]}],duration:[{duration:ae()}],ease:[{ease:["linear","in","out","in-out",Re]}],delay:[{delay:ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",Re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[To,Re]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Re]}],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",Re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",Re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ua,Va,dm]}],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"]}}},zA=yA($A);function $(...e){return zA(it(e))}const Ou=xM,Gn=hM,Vn=pM,kn=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(jj,{ref:n,sideOffset:t,className:$("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}));kn.displayName=jj.displayName;const g1=h.createContext([]);function LA({widgets:e,children:t}){return z.createElement(g1.Provider,{value:e},t)}function FA(e){return h.useContext(g1).filter(r=>r.zone===e).map(r=>r.component)}var bj;const Wi=((bj=window.__MERIDIAN_CONFIG__)==null?void 0:bj.apiUrl)??void 0??"";class qp extends Error{constructor(t,r,n){super(r),this.status=t,this.data=n,this.name="ApiError"}}function v1(){return localStorage.getItem("meridian_token")}async function Ro(e,t={}){var i;const r=v1(),n={"Content-Type":"application/json",...t.headers};r&&(n.Authorization=`Bearer ${r}`);const s=await fetch(`${Wi}${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 qp(s.status,l,o)}if(s.status!==204)return s.json()}const re={get:e=>Ro(e,{method:"GET"}),post:(e,t)=>Ro(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Ro(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Ro(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Ro(e,{method:"DELETE"}),upload:async(e,t)=>{var i;const r=v1(),n={};r&&(n.Authorization=`Bearer ${r}`);const s=await fetch(`${Wi}${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 qp(s.status,l,o)}if(s.status!==204)return s.json()}},Tt={all:["issues"],byProject:(e,t)=>[...Tt.all,"project",e,...t?[t]:[]],detail:e=>[...Tt.all,e],comments:e=>[...Tt.all,e,"comments"],activities:e=>[...Tt.all,e,"activities"]};function Kl(e,t){return We({queryKey:e?Tt.byProject(e,t):Tt.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(",")),re.get(`/admin/issues?${r}`)},select:r=>r.issues,enabled:e!==void 0?!!e:!0})}function y1(e){return We({queryKey:Tt.detail(e),queryFn:()=>re.get(`/admin/issues/${e}`),select:t=>t.issue,enabled:!!e})}function BA(e){return We({queryKey:Tt.comments(e),queryFn:()=>re.get(`/admin/issues/${e}/comments`),select:t=>t.comments,enabled:!!e})}function b1(){const e=Ne();return ge({mutationFn:t=>re.post("/admin/issues",t),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:Tt.byProject(r.project_id)})}})}function Pu(e,t){const r=Ne();return ge({mutationFn:n=>re.put(`/admin/issues/${e}`,n),onMutate:async n=>{await r.cancelQueries({queryKey:Tt.byProject(t)});const s=r.getQueryData(Tt.byProject(t));return r.setQueryData(Tt.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(Tt.byProject(t),i.previous)},onSettled:()=>{r.invalidateQueries({queryKey:Tt.byProject(t)}),r.invalidateQueries({queryKey:Tt.detail(e)})}})}function WA(e){return We({queryKey:Tt.activities(e),queryFn:()=>re.get(`/admin/issues/${e}/activities`),select:t=>t.activities,enabled:!!e})}function UA(e){const t=Ne();return ge({mutationFn:({body:r,metadata:n})=>re.post(`/admin/issues/${e}/comments`,{body:r,metadata:n}),onSuccess:()=>{t.invalidateQueries({queryKey:Tt.comments(e)})}})}const Lv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Fv=it,Yl=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Fv(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=Lv(u)||Lv(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,...p}=u;return Object.entries(p).every(x=>{let[g,v]=x;return Array.isArray(v)?v.includes({...i,...l}[g]):{...i,...l}[g]===v})?[...d,f,m]:d},[]);return Fv(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)},zi=Yl("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"}}),J=h.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const o=n?Rp:"button";return a.jsx(o,{className:$(zi({variant:t,size:r,className:e})),ref:i,...s})});J.displayName="Button";const Ae=h.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:$("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}));Ae.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 qA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),w1=(...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 HA={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 KA=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...l},c)=>h.createElement("svg",{ref:c,...HA,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:w1("lucide",s),...l},[...o.map(([d,u])=>h.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 ne=(e,t)=>{const r=h.forwardRef(({className:n,...s},i)=>h.createElement(KA,{ref:i,iconNode:t,className:w1(`lucide-${qA(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 Mu=ne("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 Gl=ne("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 Vl=ne("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 Hp=ne("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 Xl=ne("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 Zs=ne("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 j1=ne("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 N1=ne("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 YA=ne("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 k1=ne("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 Js=ne("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 mr=ne("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 GA=ne("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 fs=ne("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 Bv=ne("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 ir=ne("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 ra=ne("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 ms=ne("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 kr=ne("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 Kp=ne("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 oo=ne("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 Na=ne("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 S1=ne("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 Yp=ne("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 ln=ne("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 VA=ne("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 na=ne("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 C1=ne("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 _1=ne("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 Gp=ne("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 XA=ne("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 Vp=ne("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 ka=ne("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 O1=ne("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 Ql=ne("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 pi=ne("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 QA=ne("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 ZA=ne("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 JA=ne("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 eD=ne("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 tD=ne("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 Xp=ne("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 Xn=ne("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 ph=ne("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 P1=ne("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 rD=ne("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 nD=ne("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 aD=ne("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 M1=ne("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 sD=ne("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
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 Br=ne("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"}]]);/**
|
|
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 bd=ne("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"}]]);/**
|
|
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 iD=ne("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
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 oD=ne("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"}]]);/**
|
|
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 Zl=ne("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"}]]);/**
|
|
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 lD=ne("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"}]]);/**
|
|
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 E1=ne("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"}]]);/**
|
|
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 Sn=ne("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"}]]);/**
|
|
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 A1=ne("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"}]]);/**
|
|
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 ei=ne("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"}]]);/**
|
|
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 Eu=ne("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"}]]);/**
|
|
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 cD=ne("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"}]]);/**
|
|
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 D1=ne("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"}]]);/**
|
|
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 xi=ne("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
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 dD=ne("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 uD=ne("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
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 fD=ne("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
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 Qp=ne("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"}]]);/**
|
|
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 ti=ne("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"}]]);/**
|
|
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 hl=ne("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 dt=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 mD=ne("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"}]]);/**
|
|
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 hD=ne("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"}]]);/**
|
|
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 Ui=ne("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"}]]);/**
|
|
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 T1=ne("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
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 lo=ne("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 pD=ne("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"}]]);/**
|
|
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 Zp=ne("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"}]]);/**
|
|
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 Au=ne("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"}]]);/**
|
|
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 xD=ne("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"}]]);/**
|
|
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 gD=ne("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"}]]);/**
|
|
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 xh=ne("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"}]]);/**
|
|
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 I1=ne("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"}]]);/**
|
|
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 R1=ne("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"}]]);/**
|
|
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 vD=ne("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 $1=ne("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"}]]);/**
|
|
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 yD=ne("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"}]]);/**
|
|
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 bD=ne("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"}]]);/**
|
|
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 Wv=ne("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"}]]);/**
|
|
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 wD=ne("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"}]]);/**
|
|
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 jD=ne("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"}]]);/**
|
|
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 Sr=ne("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"}]]);/**
|
|
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 ND=ne("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"}]]);/**
|
|
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 kD=ne("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
|
|
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 SD=ne("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"}]]);/**
|
|
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 CD=ne("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"}]]);/**
|
|
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 _D=ne("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
|
|
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 z1=ne("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"}]]);/**
|
|
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 co=ne("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"}]]);/**
|
|
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 OD=ne("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
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 L1=ne("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"}]]);/**
|
|
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 Jl=ne("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"}]]);/**
|
|
534
|
+
* @license lucide-react v0.468.0 - ISC
|
|
535
|
+
*
|
|
536
|
+
* This source code is licensed under the ISC license.
|
|
537
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
538
|
+
*/const ri=ne("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"}]]);/**
|
|
539
|
+
* @license lucide-react v0.468.0 - ISC
|
|
540
|
+
*
|
|
541
|
+
* This source code is licensed under the ISC license.
|
|
542
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
543
|
+
*/const xa=ne("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"}]]);/**
|
|
544
|
+
* @license lucide-react v0.468.0 - ISC
|
|
545
|
+
*
|
|
546
|
+
* This source code is licensed under the ISC license.
|
|
547
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
548
|
+
*/const st=ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
549
|
+
* @license lucide-react v0.468.0 - ISC
|
|
550
|
+
*
|
|
551
|
+
* This source code is licensed under the ISC license.
|
|
552
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
553
|
+
*/const ys=ne("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 PD({issue:e}){const t=Pu(e.id,e.project_id),[r,n]=h.useState(""),[s,i]=h.useState(""),[o,l]=h.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:()=>{B.success("Metadata saved"),n(""),i(""),l(!1)},onError:()=>B.error("Failed to save metadata")})},f=m=>{const p={...c};delete p[m],t.mutate({metadata:Object.keys(p).length?p:null},{onSuccess:()=>B.success("Entry removed"),onError:()=>B.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(XA,{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(dt,{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,p])=>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(p)}),a.jsx("button",{onClick:()=>f(m),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(Sr,{className:"h-3 w-3"})})]},m)),o&&a.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[a.jsx(Ae,{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(Ae,{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(J,{size:"sm",className:"h-7 px-2 text-xs",onClick:u,disabled:!r.trim()||t.isPending,children:"Save"}),a.jsx(J,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>{l(!1),n(""),i("")},children:"Cancel"})]})]})]})}const MD=[{zone:"issue.details.after",component:PD}];function Du(e=!0){return We({queryKey:["workspaces"],queryFn:()=>re.get("/admin/workspaces"),select:t=>t.workspaces,enabled:e})}function ED(){const e=Ne();return ge({mutationFn:t=>re.post("/admin/workspaces",t),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]})}})}function AD(e){const t=Ne();return ge({mutationFn:r=>re.put(`/admin/workspaces/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:["workspaces"]})}})}function DD(e){const t=Ne();return ge({mutationFn:r=>{const n=new FormData;return n.append("logo",r),re.upload(`/admin/workspaces/${e}/logo`,n)},onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}function TD(e){const t=Ne();return ge({mutationFn:()=>re.delete(`/admin/workspaces/${e}/logo`),onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}const Jp={list:e=>["workspaces",e,"invitations"]};function ID(e){return We({queryKey:Jp.list(e),queryFn:()=>re.get(`/admin/workspaces/${e}/invitations`),select:t=>t.invitations,enabled:!!e})}function RD(e){const t=Ne();return ge({mutationFn:r=>re.post(`/admin/workspaces/${e}/invitations`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Jp.list(e)})}})}function $D(e){const t=Ne();return ge({mutationFn:r=>re.delete(`/admin/workspaces/${e}/invitations/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Jp.list(e)})}})}function zD(e){return ge({mutationFn:t=>re.post(`/admin/workspaces/${e}/invitations/${t}/resend`)})}const ex={list:e=>["workspaces",e,"members"]};function ec(e){return We({queryKey:ex.list(e),queryFn:()=>re.get(`/admin/workspaces/${e}/members`),select:t=>t.members,enabled:!!e})}function LD(e){const t=Ne();return ge({mutationFn:r=>re.post(`/admin/workspaces/${e}/members`,r),onSuccess:()=>{t.invalidateQueries({queryKey:ex.list(e)})}})}function FD(e){const t=Ne();return ge({mutationFn:r=>re.delete(`/admin/workspaces/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:ex.list(e)})}})}const hs={list:e=>["workspaces",e,"teams"],members:(e,t)=>["workspaces",e,"teams",t,"members"]};function Tu(e){return We({queryKey:hs.list(e),queryFn:()=>re.get(`/admin/workspaces/${e}/teams`),select:t=>t.teams,enabled:!!e})}function BD(e){const t=Ne();return ge({mutationFn:r=>re.post(`/admin/workspaces/${e}/teams`,r),onSuccess:()=>{t.invalidateQueries({queryKey:hs.list(e)})}})}function WD(e){const t=Ne();return ge({mutationFn:r=>re.delete(`/admin/workspaces/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:hs.list(e)})}})}function UD(e,t){return We({queryKey:hs.members(e,t),queryFn:()=>re.get(`/admin/workspaces/${e}/teams/${t}/members`),select:r=>r.members,enabled:!!(e&&t)})}function qD(e,t){const r=Ne();return ge({mutationFn:n=>re.post(`/admin/workspaces/${e}/teams/${t}/members`,{user_id:n}),onSuccess:()=>{r.invalidateQueries({queryKey:hs.members(e,t)}),r.invalidateQueries({queryKey:hs.list(e)})}})}function HD(e,t){const r=Ne();return ge({mutationFn:n=>re.delete(`/admin/workspaces/${e}/teams/${t}/members/${n}`),onSuccess:()=>{r.invalidateQueries({queryKey:hs.members(e,t)}),r.invalidateQueries({queryKey:hs.list(e)})}})}function Iu(){return We({queryKey:["setup-status"],queryFn:()=>re.get("/auth/setup"),staleTime:6e4,retry:!1})}function KD(){const{login:e}=Ie();return ge({mutationFn:t=>re.post("/auth/login",t),onSuccess:t=>{e(t.user,t.token)}})}function YD(){const{login:e}=Ie();return ge({mutationFn:t=>re.post("/auth/register",t),onSuccess:t=>{e(t.user,t.token)}})}function GD(){return ge({mutationFn:e=>re.post("/auth/forgot-password",e)})}function VD(){return ge({mutationFn:e=>re.post("/auth/reset-password",e)})}function XD(e){const{login:t}=Ie();return ge({mutationFn:r=>re.post(`/auth/invite/${e}`,r),onSuccess:r=>{t(r.user,r.token)}})}var wj;const QD=((wj=window.__MERIDIAN_CONFIG__)==null?void 0:wj.apiUrl)??void 0??"";function ZD(e,t){const r=`${QD}/admin/events?token=${encodeURIComponent(e)}&workspaceId=${encodeURIComponent(t)}`;return new EventSource(r)}function JD(){const{token:e,workspace:t}=Ie(),r=Ne(),n=h.useRef(null);h.useEffect(()=>{if(!e||!t)return;const s=ZD(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.addEventListener("project.member_added",()=>{i([["notifications"]])}),s.onerror=()=>{},()=>{s.close(),n.current=null}},[e,t==null?void 0:t.id,r])}const um=768;function e5(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const r=window.matchMedia(`(max-width: ${um-1}px)`),n=()=>{t(window.innerWidth<um)};return r.addEventListener("change",n),t(window.innerWidth<um),()=>r.removeEventListener("change",n)},[]),!!e}const uo=h.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>a.jsx(Nj,{ref:s,decorative:r,orientation:t,className:$("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...n}));uo.displayName=Nj.displayName;const t5=Hl,r5=ql,F1=h.forwardRef(({className:e,...t},r)=>a.jsx(mi,{className:$("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}));F1.displayName=mi.displayName;const n5=Yl("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"}}),B1=h.forwardRef(({side:e="right",className:t,children:r,...n},s)=>a.jsxs(r5,{children:[a.jsx(F1,{}),a.jsxs(hi,{ref:s,className:$(n5({side:e}),t),...n,children:[r,a.jsxs(Cu,{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(st,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));B1.displayName=hi.displayName;const W1=({className:e,...t})=>a.jsx("div",{className:$("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border",e),...t});W1.displayName="SheetHeader";const U1=h.forwardRef(({className:e,...t},r)=>a.jsx(ao,{ref:r,className:$("text-base font-semibold text-foreground",e),...t}));U1.displayName=ao.displayName;const q1=h.forwardRef(({className:e,...t},r)=>a.jsx(so,{ref:r,className:$("text-sm text-muted-foreground",e),...t}));q1.displayName=so.displayName;function oe({className:e,...t}){return a.jsx("div",{className:$("animate-pulse rounded-md bg-muted",e),...t})}const a5="sidebar_state",s5=60*60*24*7,i5="16rem",o5="18rem",l5="3rem",c5="b",H1=h.createContext(null);function tx(){const e=h.useContext(H1);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Ru({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:s,children:i,...o}){const l=e5(),[c,d]=h.useState(!1),[u,f]=h.useState(e),m=t??u,p=h.useCallback(y=>{const j=typeof y=="function"?y(m):y;r?r(j):f(j),document.cookie=`${a5}=${j}; path=/; max-age=${s5}`},[r,m]),x=h.useCallback(()=>l?d(y=>!y):p(y=>!y),[l,p,d]);h.useEffect(()=>{const y=j=>{j.key===c5&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),x())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x]);const g=m?"expanded":"collapsed",v=h.useMemo(()=>({state:g,open:m,setOpen:p,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:x}),[g,m,p,l,c,d,x]);return a.jsx(H1.Provider,{value:v,children:a.jsx(Ou,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":i5,"--sidebar-width-icon":l5,...s},className:$("group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex h-svh w-full",n),...o,children:i})})})}function $u({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...i}){const{isMobile:o,state:l,openMobile:c,setOpenMobile:d}=tx();return r==="none"?a.jsx("div",{"data-slot":"sidebar",className:$("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",n),...i,children:s}):o?a.jsx(t5,{open:c,onOpenChange:d,...i,children:a.jsxs(B1,{"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":o5},side:e,children:[a.jsxs(W1,{className:"sr-only",children:[a.jsx(U1,{children:"Sidebar"}),a.jsx(q1,{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:$("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:$("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 zu({className:e,onClick:t,...r}){const{toggleSidebar:n}=tx();return a.jsxs(J,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:$("size-7",e),onClick:s=>{t==null||t(s),n()},...r,children:[a.jsx(uD,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Lu({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:$("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 Fu({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:$("flex flex-col gap-2 p-2",e),...t})}function Bu({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:$("flex flex-col gap-2 p-2",e),...t})}function Uv({className:e,...t}){return a.jsx(uo,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:$("bg-sidebar-border mx-2 w-auto",e),...t})}function Wu({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:$("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Ls({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:$("relative flex w-full min-w-0 flex-col p-2",e),...t})}function qv({className:e,asChild:t=!1,...r}){const n=t?Rp:"div";return a.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:$("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 Fs({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:$("w-full text-sm",e),...t})}function br({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:$("flex w-full min-w-0 flex-col gap-1",e),...t})}function Dt({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:$("group/menu-item relative",e),...t})}const d5=Yl("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"}}),_t=h.forwardRef(function({asChild:t=!1,isActive:r=!1,variant:n="default",size:s="default",tooltip:i,className:o,...l},c){const d=t?Rp:"button",{isMobile:u,state:f}=tx(),m=a.jsx(d,{ref:c,"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":r,className:$(d5({variant:n,size:s}),o),...l});return i?(typeof i=="string"&&(i={children:i}),a.jsxs(Gn,{children:[a.jsx(Vn,{asChild:!0,children:m}),a.jsx(kn,{side:"right",align:"center",hidden:f!=="collapsed"||u,...i})]})):m});_t.displayName="SidebarMenuButton";const u5=250,f5=300,Vr={all:["projects"],list:()=>[...Vr.all,"list"],detail:e=>[...Vr.all,e],byKey:e=>[...Vr.all,"key",e],activities:e=>[...Vr.all,e,"activities"]};function fo(){const{workspace:e}=Ie();return We({queryKey:[...Vr.list(),e==null?void 0:e.id],queryFn:()=>{const t=e!=null&&e.id?`?workspace_id=${e.id}`:"";return re.get(`/admin/projects${t}`)},select:t=>t.projects,enabled:!!(e!=null&&e.id)})}function Ia(e){return We({queryKey:Vr.byKey(e),queryFn:()=>re.get(`/admin/projects/by-identifier/${encodeURIComponent(e)}`),select:t=>t.project,enabled:!!e})}function m5(e,t={}){const[r,n]=h.useState(e),s=t.enabled!==!1;return h.useEffect(()=>{if(!s)return;const l=setTimeout(()=>n(e),u5);return()=>clearTimeout(l)},[e,s]),{...We({queryKey:["projects","suggest-identifier",r],queryFn:()=>re.get(`/admin/projects/suggest-identifier?name=${encodeURIComponent(r)}`),select:l=>l.identifier,enabled:s&&r.trim().length>0}),flush:()=>n(e)}}function h5(e,t={}){const r=e.toUpperCase().replace(/[^A-Z0-9]/g,""),[n,s]=h.useState(r),i=t.enabled!==!1&&r.length>=3;h.useEffect(()=>{if(!r){s("");return}const l=setTimeout(()=>s(r),f5);return()=>clearTimeout(l)},[r]);const o=We({queryKey:["projects","check-identifier",n],queryFn:()=>re.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 p5(){const e=Ne();return ge({mutationFn:t=>re.post("/admin/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Vr.list()})}})}function x5(){const e=Ne();return ge({mutationFn:t=>re.delete(`/admin/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Vr.list()})}})}function g5(e){const t=Ne();return ge({mutationFn:()=>re.post(`/admin/projects/${e}/share`,{}),onSuccess:()=>{t.invalidateQueries({queryKey:Vr.detail(e)}),t.invalidateQueries({queryKey:Vr.list()})}})}function v5(e){const t=Ne();return ge({mutationFn:()=>re.delete(`/admin/projects/${e}/share`),onSuccess:()=>{t.invalidateQueries({queryKey:Vr.detail(e)}),t.invalidateQueries({queryKey:Vr.list()})}})}function y5(e){return We({queryKey:Vr.activities(e),queryFn:()=>re.get(`/admin/projects/${e}/activities`),select:t=>t.activities,enabled:!!e})}const Wr=vM,Ur=yM,b5=h.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(kj,{ref:s,className:$("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(kr,{className:"ml-auto"})]}));b5.displayName=kj.displayName;const w5=h.forwardRef(({className:e,...t},r)=>a.jsx(Sj,{ref:r,className:$("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}));w5.displayName=Sj.displayName;const Cr=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(gM,{children:a.jsx(Cj,{ref:n,sideOffset:t,className:$("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})}));Cr.displayName=Cj.displayName;const nt=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(_j,{ref:n,className:$("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}));nt.displayName=_j.displayName;const j5=h.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(Oj,{ref:s,className:$("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(Pj,{children:a.jsx(ir,{className:"h-4 w-4"})})}),t]}));j5.displayName=Oj.displayName;const N5=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Mj,{ref:n,className:$("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(Pj,{children:a.jsx(ln,{className:"h-2 w-2 fill-current"})})}),t]}));N5.displayName=Mj.displayName;const rx=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(Ej,{ref:n,className:$("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...r}));rx.displayName=Ej.displayName;const _n=h.forwardRef(({className:e,...t},r)=>a.jsx(Aj,{ref:r,className:$("-mx-1 my-1 h-px bg-border",e),...t}));_n.displayName=Aj.displayName;const Ft=h.forwardRef(({className:e,...t},r)=>a.jsx(Dj,{ref:r,className:$("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));Ft.displayName=Dj.displayName;const pl=h.forwardRef(({className:e,...t},r)=>a.jsx(Tj,{ref:r,className:$("aspect-square h-full w-full",e),...t}));pl.displayName=Tj.displayName;const Bt=h.forwardRef(({className:e,...t},r)=>a.jsx(Ij,{ref:r,className:$("flex h-full w-full items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground",e),...t}));Bt.displayName=Ij.displayName;function k5(){var s;const{workspace:e,setWorkspace:t}=Ie(),{data:r}=Du(),n=jt();return a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(Wr,{children:[a.jsx(Ur,{asChild:!0,children:a.jsxs(_t,{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(oo,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Cr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"bottom",align:"start",sideOffset:4,children:[a.jsx(rx,{className:"text-xs text-muted-foreground font-normal",children:"Workspaces"}),r==null?void 0:r.map(i=>a.jsxs(nt,{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(ir,{className:"size-3.5 text-muted-foreground shrink-0"})]},i.id)),a.jsx(_n,{}),a.jsxs(nt,{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 S5(){var i,o,l,c;const{user:e,logout:t}=Ie(),r=jt(),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(br,{children:a.jsx(Dt,{children:a.jsxs(Wr,{children:[a.jsx(Ur,{asChild:!0,children:a.jsxs(_t,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsxs(Ft,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&a.jsx(pl,{src:e.avatar_url,alt:s??"",className:"object-cover"}),a.jsx(Bt,{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(oo,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Cr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(rx,{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(Ft,{className:"h-8 w-8 rounded-lg",children:[(e==null?void 0:e.avatar_url)&&a.jsx(pl,{src:e.avatar_url,alt:s??"",className:"object-cover"}),a.jsx(Bt,{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(_n,{}),a.jsxs(nt,{className:"cursor-pointer gap-2",onClick:()=>r("/profile"),children:[a.jsx(Jl,{className:"size-4"}),"Profile"]}),a.jsx(_n,{}),a.jsxs(nt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Eu,{className:"size-4"}),"Sign out"]})]})]})})})}function C5({...e}){var N,w,k;const{workspace:t,projectKey:r}=Wt(),{data:n}=fo(),{toggle:s}=Wp(),{user:i}=Ie(),o=Bl(),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`,p=o.pathname.startsWith("/reporting"),x=o.pathname.startsWith("/org/settings"),g=((N=i==null?void 0:i.roles)==null?void 0:N.includes("super-admin"))??!1,v=g||(((w=i==null?void 0:i.roles)==null?void 0:w.includes("admin"))??!1),y=((k=i==null?void 0:i.permissions)==null?void 0:k.includes("workspace:admin"))??!1,j=v||y;return a.jsxs($u,{collapsible:"offcanvas",...e,children:[a.jsx(Fu,{children:a.jsx(k5,{})}),a.jsxs(Wu,{children:[a.jsx(Ls,{children:a.jsx(Fs,{children:a.jsxs(br,{children:[a.jsx(Dt,{children:a.jsxs(_t,{onClick:s,tooltip:"Search",children:[a.jsx(lo,{}),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(Dt,{children:a.jsx(_t,{asChild:!0,isActive:c,tooltip:"Projects",children:a.jsxs(Bn,{to:`/${l}/projects`,end:!0,children:[a.jsx(Br,{}),a.jsx("span",{children:"Projects"})]})})}),a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:d,tooltip:"Notifications",children:a.jsxs(Bn,{to:`/${l}/notifications`,children:[a.jsx(Zs,{}),a.jsx("span",{children:"Notifications"})]})})}),a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:m,tooltip:"Reports",children:a.jsxs(Bn,{to:`/${l}/reporting`,children:[a.jsx(fs,{}),a.jsx("span",{children:"Reports"})]})})}),a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:u,tooltip:"Settings",children:a.jsxs(Bn,{to:`/${l}/settings`,children:[a.jsx(Au,{}),a.jsx("span",{children:"Workspace settings"})]})})})]})})}),n&&n.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Uv,{}),a.jsxs(Ls,{children:[a.jsx(qv,{children:"Recent"}),a.jsx(Fs,{children:a.jsx(br,{children:n.slice(0,5).map(b=>a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:b.identifier===r,tooltip:b.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(Bn,{to:`/${l}/projects/${b.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:b.identifier}),a.jsx("span",{className:"truncate",children:b.name})]})})},b.id))})})]})]}),j&&a.jsxs(a.Fragment,{children:[a.jsx(Uv,{}),a.jsxs(Ls,{children:[a.jsx(qv,{children:"Global"}),a.jsx(Fs,{children:a.jsxs(br,{children:[a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:p,tooltip:"Global Reports",children:a.jsxs(Bn,{to:"/reporting",children:[a.jsx(fs,{}),a.jsx("span",{children:"Global Reports"})]})})}),a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:x,tooltip:"Org Settings",children:a.jsxs(Bn,{to:"/org/settings",children:[a.jsx(Zp,{}),a.jsx("span",{children:"Org Settings"})]})})})]})})]})]}),a.jsx(Ls,{className:"mt-auto",children:a.jsx(Fs,{children:a.jsx(br,{children:g&&a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:f,tooltip:"Roles & Permissions",children:a.jsxs(Bn,{to:`/${l}/roles`,children:[a.jsx(xh,{}),a.jsx("span",{children:"Custom Roles"})]})})})})})})]}),a.jsx(Bu,{children:a.jsx(S5,{})})]})}function Uu(){const{theme:e,setTheme:t}=QE();return a.jsxs(Gn,{children:[a.jsx(Vn,{asChild:!0,children:a.jsxs(J,{variant:"ghost",size:"icon-sm",onClick:()=>t(e==="dark"?"light":"dark"),className:"text-muted-foreground hover:text-foreground",children:[a.jsx(yD,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),a.jsx(dD,{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(kn,{children:"Toggle theme"})]})}const tc={all:["notifications"],list:()=>[...tc.all,"list"]};function _5(){return We({queryKey:tc.list(),queryFn:()=>re.get("/admin/notifications"),select:e=>e.notifications})}function K1(){return We({queryKey:[...tc.list(),"unread"],queryFn:()=>re.get("/admin/notifications?unread=true"),select:e=>e.count,refetchInterval:3e4})}function O5(){const e=Ne();return ge({mutationFn:t=>re.post(`/admin/notifications/${t}/read`),onSuccess:()=>{e.invalidateQueries({queryKey:tc.all})}})}function P5(){const e=Ne();return ge({mutationFn:()=>re.post("/admin/notifications/read-all"),onSuccess:()=>{e.invalidateQueries({queryKey:tc.all})}})}function M5(){const e=Bl(),{projectKey:t}=Wt(),{data:r}=fo(),n=r==null?void 0:r.find(i=>i.identifier===t),s=e.pathname;return s.includes("/board")?{icon:Br,label:n?`${n.name} / Board`:"Board"}:s.includes("/issues")?{icon:Xn,label:n?`${n.name} / Issues`:"Issues"}:s.includes("/sprints")?{icon:ys,label:n?`${n.name} / Sprints`:"Sprints"}:s.includes("/timeline")?{icon:Js,label:n?`${n.name} / Timeline`:"Timeline"}:s.includes("/access")?{icon:ei,label:n?`${n.name} / Access`:"Access"}:s.includes("/reports")?{icon:fs,label:n?`${n.name} / Reports`:"Reports"}:s.includes("/activity")?{icon:Mu,label:n?`${n.name} / Activity`:"Activity"}:s.endsWith("/projects")?{icon:bd,label:"Projects"}:s.includes("/notifications")?{icon:Zs,label:"Notifications"}:s.includes("/settings")?{icon:Au,label:"Settings"}:{icon:bd,label:"Meridian"}}function E5(){const{data:e=0}=K1(),{icon:t,label:r}=M5(),{workspace:n}=Ie(),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(zu,{className:"-ml-1"}),a.jsx(uo,{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("span",{className:"hidden md:flex",children:a.jsx(Uu,{})}),a.jsx(J,{variant:"ghost",size:"icon",asChild:!0,className:"relative size-8 text-muted-foreground hover:text-foreground",children:a.jsxs(Fr,{to:`/${s}/notifications`,children:[a.jsx(Zs,{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 A5(){const e=Bl(),{workspace:t}=Wt(),r=t??"",{data:n=0}=K1(),{toggle:s}=Wp(),i=[{key:"projects",label:"Projects",icon:iD,to:`/${r}/projects`,match:/\/projects($|\/)/},{key:"notifications",label:"Notifications",icon:Zs,to:`/${r}/notifications`,match:/\/notifications/,badge:n>0?n>9?"9+":String(n):null},{key:"settings",label:"Settings",icon:Au,to:`/${r}/settings`,match:/\/settings/},{key:"profile",label:"Profile",icon:Jl,to:"/profile",match:/^\/profile/}];return a.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-50 bg-background border-t border-border md:hidden",children:a.jsxs("div",{className:"flex items-stretch h-16 pb-safe",children:[i.map(({key:o,label:l,icon:c,to:d,match:u,badge:f})=>{const m=u.test(e.pathname);return a.jsxs(Fr,{to:d,className:$("flex flex-col items-center justify-center flex-1 gap-1 text-[10px] font-medium transition-colors relative",m?"text-indigo-600 dark:text-indigo-400":"text-muted-foreground hover:text-foreground"),children:[a.jsxs("div",{className:"relative",children:[a.jsx(c,{className:"h-5 w-5",strokeWidth:m?2:1.5}),f&&a.jsx("span",{className:"absolute -top-1 -right-1.5 h-3.5 w-3.5 rounded-full bg-indigo-600 text-[9px] font-bold text-white flex items-center justify-center leading-none",children:f})]}),a.jsx("span",{children:l})]},o)}),a.jsxs("button",{onClick:s,className:"flex flex-col items-center justify-center flex-1 gap-1 text-[10px] font-medium text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(lo,{className:"h-5 w-5",strokeWidth:1.5}),a.jsx("span",{children:"Search"})]})]})})}function D5(){const{user:e,token:t,login:r}=Ie();h.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??"",avatar_url:n.avatar_url??null},t)}).catch(()=>{})},[e==null?void 0:e.id])}function T5(){return D5(),a.jsxs(Ru,{children:[a.jsx(C5,{variant:"inset"}),a.jsxs(Lu,{className:"flex flex-col min-w-0",children:[a.jsx(E5,{}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden pb-16 md:pb-0",children:a.jsx(Wl,{})})]}),a.jsx(A5,{})]})}const rc={project:e=>["projects",e,"access"]};function aa(e){return We({queryKey:rc.project(e),queryFn:()=>re.get(`/admin/projects/${e}/access`),enabled:!!e})}function Y1(e){const t=Ne();return ge({mutationFn:({userId:r,role:n})=>re.post(`/admin/projects/${e}/members`,{user_id:r,role:n}),onSuccess:()=>{t.invalidateQueries({queryKey:rc.project(e)})}})}function G1(e){const t=Ne();return ge({mutationFn:r=>re.delete(`/admin/projects/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:rc.project(e)})}})}function V1(e){const t=Ne();return ge({mutationFn:r=>re.post(`/admin/projects/${e}/teams`,{team_id:r}),onSuccess:()=>{t.invalidateQueries({queryKey:rc.project(e)})}})}function X1(e){const t=Ne();return ge({mutationFn:r=>re.delete(`/admin/projects/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:rc.project(e)})}})}const Ra=Hl,I5=ql,Q1=h.forwardRef(({className:e,...t},r)=>a.jsx(mi,{ref:r,className:$("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}));Q1.displayName=mi.displayName;const sa=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(I5,{children:[a.jsx(Q1,{}),a.jsxs(hi,{ref:n,className:$("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(Cu,{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(st,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));sa.displayName=hi.displayName;const $a=({className:e,...t})=>a.jsx("div",{className:$("flex flex-col space-y-1.5",e),...t});$a.displayName="DialogHeader";const nx=({className:e,...t})=>a.jsx("div",{className:$("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});nx.displayName="DialogFooter";const za=h.forwardRef(({className:e,...t},r)=>a.jsx(ao,{ref:r,className:$("text-base font-semibold leading-none tracking-tight",e),...t}));za.displayName=ao.displayName;const mo=h.forwardRef(({className:e,...t},r)=>a.jsx(so,{ref:r,className:$("text-sm text-muted-foreground",e),...t}));mo.displayName=so.displayName;function R5({open:e,onClose:t,project:r}){const[n,s]=h.useState(null),i=g5(r.id),o=v5(r.id),l=r.share_token,c=n??(l?`${window.location.origin}/share/${l}`:null),d=()=>{i.mutate(void 0,{onSuccess:p=>{const x=`${window.location.origin}/share/${p.project.share_token}`;s(x),B.success("Public link enabled")},onError:()=>B.error("Failed to enable public link")})},u=()=>{o.mutate(void 0,{onSuccess:()=>{s(null),B.success("Public link revoked")},onError:()=>B.error("Failed to revoke link")})},f=()=>{c&&navigator.clipboard.writeText(c).then(()=>{B.success("Link copied to clipboard")})},m=!!c;return a.jsx(Ra,{open:e,onOpenChange:p=>!p&&t(),children:a.jsxs(sa,{className:"sm:max-w-md overflow-hidden",children:[a.jsxs($a,{children:[a.jsxs(za,{className:"flex items-center gap-2",children:[a.jsx(Zl,{className:"h-4 w-4"}),"Share project"]}),a.jsx(mo,{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(ph,{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(J,{variant:"outline",size:"sm",className:"flex-1",onClick:f,children:[a.jsx(Gp,{className:"h-3.5 w-3.5 mr-1.5"}),"Copy link"]}),a.jsxs(J,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:u,disabled:o.isPending,children:[a.jsx(Sr,{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(ei,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"This project is private"})]}),a.jsxs(J,{className:"w-full",onClick:d,disabled:i.isPending,children:[a.jsx(ph,{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."})]})})]})})}function Z1(e=768){const[t,r]=h.useState(()=>typeof window<"u"?window.innerWidth<e:!1);return h.useEffect(()=>{const n=window.matchMedia(`(max-width: ${e-1}px)`),s=i=>r(i.matches);return r(n.matches),n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[e]),t}const Hv=["board","issues","sprints","timeline","access","reports","activity"];function $5(){const{projectKey:e,workspace:t}=Wt(),{data:r,error:n}=Ia(e??""),{user:s}=Ie(),{data:i}=aa((r==null?void 0:r.id)??""),[o,l]=h.useState(!1),c=jt(),d=Bl(),[u]=Ul(),f=Z1(),m=(s==null?void 0:s.roles)??[],p=m.includes("super-admin")||m.includes("admin"),x=i==null?void 0:i.members.some(k=>k.user_id===(s==null?void 0:s.id)&&k.role==="manager"),g=p||x;h.useEffect(()=>{n&&n instanceof qp&&(n.status===403||n.status===404)&&c(`/${t}/projects`,{replace:!0})},[n,t,c]),h.useEffect(()=>{const k=u.get("tab");if(!k||!Hv.includes(k))return;Hv.every(S=>!d.pathname.endsWith(`/${S}`))&&c(`/${t}/projects/${e}/${k}`,{replace:!0})},[]);const v=`/${t}/projects/${e}`,y=[{to:`${v}/board`,label:"Board",icon:bd,end:!0,desktopOnly:!0},{to:`${v}/issues`,label:"Issues",icon:Xn,end:!1},{to:`${v}/sprints`,label:"Sprints",icon:ys,end:!0},{to:`${v}/timeline`,label:"Timeline",icon:Js,end:!0,desktopOnly:!0},{to:`${v}/access`,label:"Access",icon:ei,end:!0},{to:`${v}/reports`,label:"Reports",icon:fs,end:!0},{to:`${v}/activity`,label:"Activity",icon:Mu,end:!0}],j=y,N=y.filter(k=>!k.desktopOnly),w=d.pathname.endsWith("/board")||d.pathname.endsWith("/timeline");return f&&w?a.jsx(Yn,{to:`${v}/issues`,replace:!0}):a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"border-b border-border bg-white dark:bg-card shrink-0 px-4 pt-4 md:px-6 md:pt-5",children:[a.jsxs("div",{className:"flex items-center gap-2.5 mb-3 md: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:"hidden md:flex items-center -mb-px",children:[a.jsx("div",{className:"flex flex-1",children:j.map(({to:k,label:b,icon:S,end:_})=>a.jsxs(Bn,{to:k,end:_,className:({isActive:C})=>`flex items-center gap-1.5 px-3 py-2 text-sm border-b-2 transition-colors ${C?"border-foreground text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[a.jsx(S,{className:"h-3.5 w-3.5",strokeWidth:1.5}),b]},k))}),g&&r&&a.jsx("div",{className:"pb-px pr-1",children:a.jsxs(J,{variant:"ghost",size:"sm",onClick:()=>l(!0),className:"h-7 px-2 text-xs text-muted-foreground",children:[a.jsx(xD,{className:"h-3.5 w-3.5 mr-1"}),"Share"]})})]}),a.jsx("div",{className:"flex md:hidden overflow-x-auto -mb-px scrollbar-none",children:N.map(({to:k,label:b,icon:S,end:_})=>a.jsxs(Bn,{to:k,end:_,className:({isActive:C})=>`flex items-center gap-1.5 px-3 py-2 text-sm border-b-2 whitespace-nowrap transition-colors shrink-0 ${C?"border-indigo-600 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400 font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[a.jsx(S,{className:"h-3.5 w-3.5",strokeWidth:1.5}),b]},k))})]}),a.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:a.jsx(Wl,{})}),r&&a.jsx(R5,{open:o,onClose:()=>l(!1),project:r})]})}function z5(){var s,i;const{user:e,logout:t}=Ie(),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(br,{children:a.jsx(Dt,{children:a.jsxs(Wr,{children:[a.jsx(Ur,{asChild:!0,children:a.jsxs(_t,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsx(Ft,{className:"h-8 w-8 rounded-lg shrink-0",children:a.jsx(Bt,{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(oo,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Cr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(_n,{}),a.jsxs(nt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Eu,{className:"size-4"}),"Sign out"]})]})]})})})}function L5(){const{workspace:e}=Ie(),t=jt(),r=(e==null?void 0:e.slug)??"";return a.jsxs($u,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Fu,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{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(fs,{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(Wu,{children:a.jsx(Ls,{children:a.jsx(Fs,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Vl,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Bu,{children:a.jsx(z5,{})})]})}function F5(){return a.jsxs(Ru,{children:[a.jsx(L5,{}),a.jsxs(Lu,{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(zu,{className:"-ml-1"}),a.jsx(uo,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(fs,{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(Uu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(Wl,{})})]})]})}function B5(){var s,i;const{user:e,logout:t}=Ie(),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(br,{children:a.jsx(Dt,{children:a.jsxs(Wr,{children:[a.jsx(Ur,{asChild:!0,children:a.jsxs(_t,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsx(Ft,{className:"h-8 w-8 rounded-lg shrink-0",children:a.jsx(Bt,{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(oo,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Cr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(_n,{}),a.jsxs(nt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Eu,{className:"size-4"}),"Sign out"]})]})]})})})}function W5(){const{workspace:e}=Ie(),t=jt(),r=(e==null?void 0:e.slug)??"";return a.jsxs($u,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Fu,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{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(Zp,{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(Wu,{children:a.jsx(Ls,{children:a.jsx(Fs,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Vl,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Bu,{children:a.jsx(B5,{})})]})}function U5(){return a.jsxs(Ru,{children:[a.jsx(W5,{}),a.jsxs(Lu,{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(zu,{className:"-ml-1"}),a.jsx(uo,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Zp,{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(Uu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(Wl,{})})]})]})}function q5(){var s,i;const{user:e,logout:t}=Ie(),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(br,{children:a.jsx(Dt,{children:a.jsxs(Wr,{children:[a.jsx(Ur,{asChild:!0,children:a.jsxs(_t,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsxs(Ft,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&a.jsx(pl,{src:e.avatar_url,alt:n??"",className:"object-cover"}),a.jsx(Bt,{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(oo,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Cr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(_n,{}),a.jsxs(nt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Eu,{className:"size-4"}),"Sign out"]})]})]})})})}function H5(){const{workspace:e}=Ie(),t=jt(),r=(e==null?void 0:e.slug)??"";return a.jsxs($u,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Fu,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{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(Jl,{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(Wu,{children:a.jsx(Ls,{children:a.jsx(Fs,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Vl,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Bu,{children:a.jsx(q5,{})})]})}function K5(){return a.jsxs(Ru,{children:[a.jsx(H5,{}),a.jsxs(Lu,{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(zu,{className:"-ml-1"}),a.jsx(uo,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Jl,{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(Uu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(Wl,{})})]})]})}var Kv=1,Y5=.9,G5=.8,V5=.17,fm=.1,mm=.999,X5=.9999,Q5=.99,Z5=/[\\\/_+.#"@\[\(\{&]/,J5=/[\\\/_+.#"@\[\(\{&]/g,eT=/[\s-]/,J1=/[\s-]/g;function gh(e,t,r,n,s,i,o){if(i===t.length)return s===e.length?Kv:Q5;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,p,x;d>=0;)f=gh(e,t,r,n,d+1,i+1,o),f>u&&(d===s?f*=Kv:Z5.test(e.charAt(d-1))?(f*=G5,p=e.slice(s,d-1).match(J5),p&&s>0&&(f*=Math.pow(mm,p.length))):eT.test(e.charAt(d-1))?(f*=Y5,x=e.slice(s,d-1).match(J1),x&&s>0&&(f*=Math.pow(mm,x.length))):(f*=V5,s>0&&(f*=Math.pow(mm,d-s))),e.charAt(d)!==t.charAt(i)&&(f*=X5)),(f<fm&&r.charAt(d-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(d-1)!==n.charAt(i))&&(m=gh(e,t,r,n,d+1,i+2,o),m*fm>f&&(f=m*fm)),f>u&&(u=f),d=r.indexOf(c,d+1);return o[l]=u,u}function Yv(e){return e.toLowerCase().replace(J1," ")}function tT(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,gh(e,t,Yv(e),Yv(t),0,0,{})}var $o='[cmdk-group=""]',hm='[cmdk-group-items=""]',rT='[cmdk-group-heading=""]',ax='[cmdk-item=""]',Gv=`${ax}:not([aria-disabled="true"])`,vh="cmdk-item-select",$s="data-value",nT=(e,t,r)=>tT(e,t,r),eN=h.createContext(void 0),nc=()=>h.useContext(eN),tN=h.createContext(void 0),sx=()=>h.useContext(tN),rN=h.createContext(void 0),nN=h.forwardRef((e,t)=>{let r=Ei(()=>{var W,Y;return{search:"",value:(Y=(W=e.value)!=null?W:e.defaultValue)!=null?Y:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=Ei(()=>new Set),s=Ei(()=>new Map),i=Ei(()=>new Map),o=Ei(()=>new Set),l=aN(e),{label:c,children:d,value:u,onValueChange:f,filter:m,shouldFilter:p,loop:x,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,j=Ri(),N=Ri(),w=Ri(),k=h.useRef(null),b=hT();ni(()=>{if(u!==void 0){let W=u.trim();r.current.value=W,S.emit()}},[u]),ni(()=>{b(6,R)},[]);let S=h.useMemo(()=>({subscribe:W=>(o.current.add(W),()=>o.current.delete(W)),snapshot:()=>r.current,setState:(W,Y,te)=>{var X,I,D;if(!Object.is(r.current[W],Y)){if(r.current[W]=Y,W==="search")O(),T(),b(1,M);else if(W==="value"&&(te||b(5,R),((X=l.current)==null?void 0:X.value)!==void 0)){let Z=Y??"";(D=(I=l.current).onValueChange)==null||D.call(I,Z);return}S.emit()}},emit:()=>{o.current.forEach(W=>W())}}),[]),_=h.useMemo(()=>({value:(W,Y,te)=>{var X;Y!==((X=i.current.get(W))==null?void 0:X.value)&&(i.current.set(W,{value:Y,keywords:te}),r.current.filtered.items.set(W,C(Y,te)),b(2,()=>{T(),S.emit()}))},item:(W,Y)=>(n.current.add(W),Y&&(s.current.has(Y)?s.current.get(Y).add(W):s.current.set(Y,new Set([W]))),b(3,()=>{O(),T(),r.current.value||M(),S.emit()}),()=>{i.current.delete(W),n.current.delete(W),r.current.filtered.items.delete(W);let te=E();b(4,()=>{O(),(te==null?void 0:te.getAttribute("id"))===W&&M(),S.emit()})}),group:W=>(s.current.has(W)||s.current.set(W,new Set),()=>{i.current.delete(W),s.current.delete(W)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:j,inputId:w,labelId:N,listInnerRef:k}),[]);function C(W,Y){var te,X;let I=(X=(te=l.current)==null?void 0:te.filter)!=null?X:nT;return W?I(W,r.current.search,Y):0}function T(){if(!r.current.search||l.current.shouldFilter===!1)return;let W=r.current.filtered.items,Y=[];r.current.filtered.groups.forEach(X=>{let I=s.current.get(X),D=0;I.forEach(Z=>{let F=W.get(Z);D=Math.max(F,D)}),Y.push([X,D])});let te=k.current;A().sort((X,I)=>{var D,Z;let F=X.getAttribute("id"),q=I.getAttribute("id");return((D=W.get(q))!=null?D:0)-((Z=W.get(F))!=null?Z:0)}).forEach(X=>{let I=X.closest(hm);I?I.appendChild(X.parentElement===I?X:X.closest(`${hm} > *`)):te.appendChild(X.parentElement===te?X:X.closest(`${hm} > *`))}),Y.sort((X,I)=>I[1]-X[1]).forEach(X=>{var I;let D=(I=k.current)==null?void 0:I.querySelector(`${$o}[${$s}="${encodeURIComponent(X[0])}"]`);D==null||D.parentElement.appendChild(D)})}function M(){let W=A().find(te=>te.getAttribute("aria-disabled")!=="true"),Y=W==null?void 0:W.getAttribute($s);S.setState("value",Y||void 0)}function O(){var W,Y,te,X;if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let I=0;for(let D of n.current){let Z=(Y=(W=i.current.get(D))==null?void 0:W.value)!=null?Y:"",F=(X=(te=i.current.get(D))==null?void 0:te.keywords)!=null?X:[],q=C(Z,F);r.current.filtered.items.set(D,q),q>0&&I++}for(let[D,Z]of s.current)for(let F of Z)if(r.current.filtered.items.get(F)>0){r.current.filtered.groups.add(D);break}r.current.filtered.count=I}function R(){var W,Y,te;let X=E();X&&(((W=X.parentElement)==null?void 0:W.firstChild)===X&&((te=(Y=X.closest($o))==null?void 0:Y.querySelector(rT))==null||te.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function E(){var W;return(W=k.current)==null?void 0:W.querySelector(`${ax}[aria-selected="true"]`)}function A(){var W;return Array.from(((W=k.current)==null?void 0:W.querySelectorAll(Gv))||[])}function P(W){let Y=A()[W];Y&&S.setState("value",Y.getAttribute($s))}function U(W){var Y;let te=E(),X=A(),I=X.findIndex(Z=>Z===te),D=X[I+W];(Y=l.current)!=null&&Y.loop&&(D=I+W<0?X[X.length-1]:I+W===X.length?X[0]:X[I+W]),D&&S.setState("value",D.getAttribute($s))}function Q(W){let Y=E(),te=Y==null?void 0:Y.closest($o),X;for(;te&&!X;)te=W>0?fT(te,$o):mT(te,$o),X=te==null?void 0:te.querySelector(Gv);X?S.setState("value",X.getAttribute($s)):U(W)}let K=()=>P(A().length-1),se=W=>{W.preventDefault(),W.metaKey?K():W.altKey?Q(1):U(1)},ae=W=>{W.preventDefault(),W.metaKey?P(0):W.altKey?Q(-1):U(-1)};return h.createElement(vs.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:W=>{var Y;if((Y=y.onKeyDown)==null||Y.call(y,W),!W.defaultPrevented)switch(W.key){case"n":case"j":{v&&W.ctrlKey&&se(W);break}case"ArrowDown":{se(W);break}case"p":case"k":{v&&W.ctrlKey&&ae(W);break}case"ArrowUp":{ae(W);break}case"Home":{W.preventDefault(),P(0);break}case"End":{W.preventDefault(),K();break}case"Enter":if(!W.nativeEvent.isComposing&&W.keyCode!==229){W.preventDefault();let te=E();if(te){let X=new Event(vh);te.dispatchEvent(X)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:_.inputId,id:_.labelId,style:xT},c),qu(e,W=>h.createElement(tN.Provider,{value:S},h.createElement(eN.Provider,{value:_},W))))}),aT=h.forwardRef((e,t)=>{var r,n;let s=Ri(),i=h.useRef(null),o=h.useContext(rN),l=nc(),c=aN(e),d=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:o==null?void 0:o.forceMount;ni(()=>{if(!d)return l.item(s,o==null?void 0:o.id)},[d]);let u=sN(s,i,[e.value,e.children,i],e.keywords),f=sx(),m=ai(b=>b.value&&b.value===u.current),p=ai(b=>d||l.filter()===!1?!0:b.search?b.filtered.items.get(s)>0:!0);h.useEffect(()=>{let b=i.current;if(!(!b||e.disabled))return b.addEventListener(vh,x),()=>b.removeEventListener(vh,x)},[p,e.onSelect,e.disabled]);function x(){var b,S;g(),(S=(b=c.current).onSelect)==null||S.call(b,u.current)}function g(){f.setState("value",u.current,!0)}if(!p)return null;let{disabled:v,value:y,onSelect:j,forceMount:N,keywords:w,...k}=e;return h.createElement(vs.div,{ref:xl([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:g,onClick:v?void 0:x},e.children)}),sT=h.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=Ri(),l=h.useRef(null),c=h.useRef(null),d=Ri(),u=nc(),f=ai(p=>s||u.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);ni(()=>u.group(o),[]),sN(o,l,[e.value,e.heading,c]);let m=h.useMemo(()=>({id:o,forceMount:s}),[s]);return h.createElement(vs.div,{ref:xl([l,t]),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},r&&h.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),qu(e,p=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},h.createElement(rN.Provider,{value:m},p))))}),iT=h.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=h.useRef(null),i=ai(o=>!o.search);return!r&&!i?null:h.createElement(vs.div,{ref:xl([s,t]),...n,"cmdk-separator":"",role:"separator"})}),oT=h.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,i=sx(),o=ai(u=>u.search),l=ai(u=>u.value),c=nc(),d=h.useMemo(()=>{var u;let f=(u=c.listInnerRef.current)==null?void 0:u.querySelector(`${ax}[${$s}="${encodeURIComponent(l)}"]`);return f==null?void 0:f.getAttribute("id")},[]);return h.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),h.createElement(vs.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)}})}),lT=h.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=h.useRef(null),o=h.useRef(null),l=nc();return h.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)}}},[]),h.createElement(vs.div,{ref:xl([i,t]),...s,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},qu(e,c=>h.createElement("div",{ref:xl([o,l.listInnerRef]),"cmdk-list-sizer":""},c)))}),cT=h.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...l}=e;return h.createElement(Hl,{open:r,onOpenChange:n},h.createElement(ql,{container:o},h.createElement(mi,{"cmdk-overlay":"",className:s}),h.createElement(hi,{"aria-label":e.label,"cmdk-dialog":"",className:i},h.createElement(nN,{ref:t,...l}))))}),dT=h.forwardRef((e,t)=>ai(r=>r.filtered.count===0)?h.createElement(vs.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),uT=h.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return h.createElement(vs.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},qu(e,o=>h.createElement("div",{"aria-hidden":!0},o)))}),qr=Object.assign(nN,{List:lT,Item:aT,Input:oT,Group:sT,Separator:iT,Dialog:cT,Empty:dT,Loading:uT});function fT(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function mT(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function aN(e){let t=h.useRef(e);return ni(()=>{t.current=e}),t}var ni=typeof window>"u"?h.useEffect:h.useLayoutEffect;function Ei(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function xl(e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}function ai(e){let t=sx(),r=()=>e(t.snapshot());return bM.useSyncExternalStore(t.subscribe,r,r)}function sN(e,t,r,n=[]){let s=h.useRef(),i=nc();return ni(()=>{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($s,l),s.current=l}),s}var hT=()=>{let[e,t]=h.useState(),r=Ei(()=>new Map);return ni(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function pT(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function qu({asChild:e,children:t},r){return e&&h.isValidElement(t)?h.cloneElement(pT(t),{ref:t.ref},r(t.props.children)):r(t)}var xT={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ks=h.forwardRef(({className:e,...t},r)=>a.jsx(qr,{ref:r,className:$("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Ks.displayName=qr.displayName;const gT=({children:e,open:t,onOpenChange:r})=>a.jsx(Ra,{open:t,onOpenChange:r,children:a.jsx(sa,{className:"overflow-hidden p-0 shadow-lg max-w-[560px]",children:a.jsx(Ks,{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})})}),Hu=h.forwardRef(({className:e,...t},r)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(lo,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(qr.Input,{ref:r,className:$("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})]}));Hu.displayName=qr.Input.displayName;const Ys=h.forwardRef(({className:e,...t},r)=>a.jsx(qr.List,{ref:r,className:$("max-h-[320px] overflow-y-auto overflow-x-hidden",e),...t}));Ys.displayName=qr.List.displayName;const Ku=h.forwardRef((e,t)=>a.jsx(qr.Empty,{ref:t,className:"py-6 text-center text-sm text-muted-foreground",...e}));Ku.displayName=qr.Empty.displayName;const rs=h.forwardRef(({className:e,...t},r)=>a.jsx(qr.Group,{ref:r,className:$("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}));rs.displayName=qr.Group.displayName;const iN=h.forwardRef(({className:e,...t},r)=>a.jsx(qr.Separator,{ref:r,className:$("-mx-1 h-px bg-border",e),...t}));iN.displayName=qr.Separator.displayName;const sn=h.forwardRef(({className:e,...t},r)=>a.jsx(qr.Item,{ref:r,className:$("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}));sn.displayName=qr.Item.displayName;function vT(){const{open:e,setOpen:t}=Wp(),r=jt(),{data:n}=fo(),{workspace:s}=Ie(),i=(s==null?void 0:s.slug)??"",o=l=>{t(!1),l()};return a.jsxs(gT,{open:e,onOpenChange:t,children:[a.jsx(Hu,{placeholder:"Search or jump to..."}),a.jsxs(Ys,{children:[a.jsx(Ku,{children:"No results found."}),a.jsxs(rs,{heading:"Navigation",children:[a.jsxs(sn,{onSelect:()=>o(()=>r(`/${i}/projects`)),children:[a.jsx(bd,{className:"text-muted-foreground"}),a.jsx("span",{children:"Projects"})]}),a.jsxs(sn,{onSelect:()=>o(()=>r(`/${i}/notifications`)),children:[a.jsx(Zs,{className:"text-muted-foreground"}),a.jsx("span",{children:"Notifications"})]}),a.jsxs(sn,{onSelect:()=>o(()=>r(`/${i}/settings`)),children:[a.jsx(Au,{className:"text-muted-foreground"}),a.jsx("span",{children:"Settings"})]})]}),n&&n.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(iN,{}),a.jsxs(rs,{heading:"Projects",children:[n.map(l=>a.jsxs(sn,{value:`${l.name} board`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/board`)),children:[a.jsx(Br,{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(sn,{value:`${l.name} issues`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/issues`)),children:[a.jsx(Xn,{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 Nr({zone:e,props:t}){const r=FA(e);return r.length?a.jsx(a.Fragment,{children:r.map((n,s)=>a.jsx(n,{...t},n.displayName??n.name??s))}):null}function ix({flow:e,inviteToken:t,label:r,disabled:n}){const s=()=>{const i=`${Wi}/auth/google?flow=${e}${t?`&invite_token=${encodeURIComponent(t)}`:""}`;window.location.href=i};return a.jsxs(J,{type:"button",variant:"outline",className:"w-full gap-2 bg-white dark:bg-black text-black dark:text-white",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 yT(){const[e,t]=h.useState(""),[r,n]=h.useState(""),[s,i]=h.useState(!1),o=jt(),l=KD(),{data:c}=Iu(),d=u=>{u.preventDefault(),l.mutate({email:e,password:r},{onSuccess:()=>o("/"),onError:f=>B.error(f.message??"Invalid email or password")})};return a.jsx("div",{className:"min-h-screen bg-white dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px]",children:[a.jsx(Nr,{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(Ae,{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(Ae,{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(Ql,{className:"h-4 w-4"}):a.jsx(pi,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx(Fr,{to:"/forgot-password",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})}),a.jsx("div",{className:"pt-1",children:a.jsx(J,{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(ix,{flow:"login"})]}),a.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Don't have an account?"," ",a.jsx(Fr,{to:"/register",className:"text-indigo hover:opacity-80 transition-opacity",children:"Create one"})]}),a.jsx(Nr,{zone:"login.after",props:{}})]})})}function bT(){const[e,t]=h.useState(""),[r,n]=h.useState(""),[s,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),u=jt(),f=YD(),{data:m}=Iu(),p=(m==null?void 0:m.needsSetup)===!0,x=g=>{g.preventDefault(),f.mutate({email:s,password:o,first_name:e,last_name:r},{onSuccess:()=>u("/"),onError:v=>B.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:p?"Set up your account":"Create your account"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:p?"You're the first user — you'll be the super admin.":"Get started with Meridian"})]})]}),a.jsxs("form",{onSubmit:x,className:"space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Ae,{placeholder:"First name",value:e,onChange:g=>t(g.target.value),required:!0,className:"bg-white dark:bg-card h-10"}),a.jsx(Ae,{placeholder:"Last name",value:r,onChange:g=>n(g.target.value),required:!0,className:"bg-white dark:bg-card h-10"})]}),a.jsx(Ae,{type:"email",placeholder:"Email",value:s,onChange:g=>i(g.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{type:c?"text":"password",placeholder:"Password",value:o,onChange:g=>l(g.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(Ql,{className:"h-4 w-4"}):a.jsx(pi,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(J,{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(ix,{flow:"register",label:p?"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(Fr,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]})})}function wT(){const[e,t]=h.useState(""),r=jt(),{setWorkspace:n}=Ie(),s=ED(),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=>B.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(Ae,{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(J,{type:"submit",className:"w-full h-10 font-medium",disabled:!e.trim()||s.isPending,children:s.isPending?"Creating workspace...":"Create workspace"})]})]})})}function jT(){const{logout:e}=Ie();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:"Waiting for access"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"You've been added to the system, but haven't been assigned to a workspace yet. An admin will add you shortly."})]})]}),a.jsx(J,{variant:"outline",className:"w-full",onClick:e,children:"Sign out"})]})})}function NT(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 oN=z.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}),ac=()=>{const e=z.useContext(oN);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};NT(`[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(
|
|
554
|
+
[data-state=closed]
|
|
555
|
+
){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 kT(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function ST(){return ox(/^Mac/)}function CT(){return ox(/^iPhone/)}function Vv(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function _T(){return ox(/^iPad/)||ST()&&navigator.maxTouchPoints>1}function lN(){return CT()||_T()}function ox(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const OT=24,PT=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Xv(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const pm=typeof document<"u"&&window.visualViewport;function Qv(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function cN(e){for(Qv(e)&&(e=e.parentElement);e&&!Qv(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const MT=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Ic=0,xm;function ET(e={}){let{isDisabled:t}=e;PT(()=>{if(!t)return Ic++,Ic===1&&lN()&&(xm=AT()),()=>{Ic--,Ic===0&&(xm==null||xm())}},[t])}function AT(){let e,t=0,r=f=>{e=cN(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,p=e.scrollTop,x=e.scrollHeight-e.clientHeight;x!==0&&((p<=0&&m>t||p>=x&&m<t)&&f.preventDefault(),t=m)},s=f=>{let m=f.target;yh(m)&&m!==document.activeElement&&(f.preventDefault(),m.style.transform="translateY(-2000px)",m.focus(),requestAnimationFrame(()=>{m.style.transform=""}))},i=f=>{let m=f.target;yh(m)&&(m.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{m.style.transform="",pm&&(pm.height<window.innerHeight?requestAnimationFrame(()=>{Zv(m)}):pm.addEventListener("resize",()=>Zv(m),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},l=window.pageXOffset,c=window.pageYOffset,d=Xv(DT(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=Xv(zo(document,"touchstart",r,{passive:!1,capture:!0}),zo(document,"touchmove",n,{passive:!1,capture:!0}),zo(document,"touchend",s,{passive:!1,capture:!0}),zo(document,"focus",i,!0),zo(window,"scroll",o));return()=>{d(),u(),window.scrollTo(l,c)}}function DT(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function zo(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function Zv(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let r=cN(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+OT;i>o&&(r.scrollTop+=s-n)}e=r.parentElement}}function yh(e){return e instanceof HTMLInputElement&&!MT.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function TT(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function IT(...e){return t=>e.forEach(r=>TT(r,t))}function dN(...e){return h.useCallback(IT(...e),e)}const uN=new WeakMap;function $t(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&&uN.set(e,n)}function RT(e,t){if(!e||!(e instanceof HTMLElement))return;let r=uN.get(e);r&&(e.style[t]=r[t])}const At=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Rc(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(", ")[At(t)?13:12]):(s=n.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[At(t)?5:4]):null)}function $T(e){return 8*(Math.log(e+1)-2)}function gm(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}function zT(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}const yt={DURATION:.5,EASE:[.32,.72,0,1]},fN=.4,LT=.25,FT=100,mN=8,Ss=16,bh=26,vm="vaul-dragging";function hN(e){const t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>(...r)=>t.current==null?void 0:t.current.call(t,...r),[])}function BT({defaultProp:e,onChange:t}){const r=z.useState(e),[n]=r,s=z.useRef(n),i=hN(t);return z.useEffect(()=>{s.current!==n&&(i(n),s.current=n)},[n,s,i]),r}function pN({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=BT({defaultProp:t,onChange:r}),i=e!==void 0,o=i?e:n,l=hN(r),c=z.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 WT({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:s,fadeFromIndex:i,onSnapPointChange:o,direction:l="bottom",container:c,snapToSequentialPoint:d}){const[u,f]=pN({prop:e,defaultProp:r==null?void 0:r[0],onChange:t}),[m,p]=z.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);z.useEffect(()=>{function S(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const x=z.useMemo(()=>u===(r==null?void 0:r[r.length-1])||null,[r,u]),g=z.useMemo(()=>{var S;return(S=r==null?void 0:r.findIndex(_=>_===u))!=null?S:null},[r,u]),v=r&&r.length>0&&(i||i===0)&&!Number.isNaN(i)&&r[i]===u||!r,y=z.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 _;return(_=r==null?void 0:r.map(C=>{const T=typeof C=="string";let M=0;if(T&&(M=parseInt(C,10)),At(l)){const R=T?M:m?C*S.height:0;return m?l==="bottom"?S.height-R:-S.height+R:R}const O=T?M:m?C*S.width:0;return m?l==="right"?S.width-O:-S.width+O:O}))!=null?_:[]},[r,m,c]),j=z.useMemo(()=>g!==null?y==null?void 0:y[g]:null,[y,g]),N=z.useCallback(S=>{var _;const C=(_=y==null?void 0:y.findIndex(T=>T===S))!=null?_:null;o(C),$t(n.current,{transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,transform:At(l)?`translate3d(0, ${S}px, 0)`:`translate3d(${S}px, 0, 0)`}),y&&C!==y.length-1&&i!==void 0&&C!==i&&C<i?$t(s.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,opacity:"0"}):$t(s.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,opacity:"1"}),f(r==null?void 0:r[Math.max(C,0)])},[n.current,r,y,i,s,f]);z.useEffect(()=>{if(u||e){var S;const _=(S=r==null?void 0:r.findIndex(C=>C===e||C===u))!=null?S:-1;y&&_!==-1&&typeof y[_]=="number"&&N(y[_])}},[u,e,r,y,N]);function w({draggedDistance:S,closeDrawer:_,velocity:C,dismissible:T}){if(i===void 0)return;const M=l==="bottom"||l==="right"?(j??0)-S:(j??0)+S,O=g===i-1,R=g===0,E=S>0;if(O&&$t(s.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`}),!d&&C>2&&!E){T?_():N(y[0]);return}if(!d&&C>2&&E&&y&&r){N(y[r.length-1]);return}const A=y==null?void 0:y.reduce((U,Q)=>typeof U!="number"||typeof Q!="number"?U:Math.abs(Q-M)<Math.abs(U-M)?Q:U),P=At(l)?window.innerHeight:window.innerWidth;if(C>fN&&Math.abs(S)<P*.4){const U=E?1:-1;if(U>0&&x&&r){N(y[r.length-1]);return}if(R&&U<0&&T&&_(),g===null)return;N(y[g+U]);return}N(A)}function k({draggedDistance:S}){if(j===null)return;const _=l==="bottom"||l==="right"?j-S:j+S;(l==="bottom"||l==="right")&&_<y[y.length-1]||(l==="top"||l==="left")&&_>y[y.length-1]||$t(n.current,{transform:At(l)?`translate3d(0, ${_}px, 0)`:`translate3d(${_}px, 0, 0)`})}function b(S,_){if(!r||typeof g!="number"||!y||i===void 0)return null;const C=g===i-1;if(g>=i&&_)return 0;if(C&&!_)return 1;if(!v&&!C)return null;const M=C?g+1:g-1,O=C?y[M]-y[M-1]:y[M+1]-y[M],R=S/Math.abs(O);return C?1-R:R}return{isLastSnapPoint:x,activeSnapPoint:u,shouldFade:v,getPercentageDragged:b,setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:w,onDrag:k,snapPointsOffset:y}}const UT=()=>()=>{};function qT(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:s}=ac(),i=z.useRef(null),o=h.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-bh)/window.innerWidth}z.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;zT(n&&!s?gm(document.body,{background:"black"}):UT,gm(c,{transformOrigin:At(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${yt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${yt.EASE.join(",")})`}));const d=gm(c,{borderRadius:`${mN}px`,overflow:"hidden",...At(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")},yt.DURATION*1e3)}}},[t,r,o])}let Lo=null;function HT({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:s,noBodyStyles:i}){const[o,l]=z.useState(()=>typeof window<"u"?window.location.href:""),c=z.useRef(0),d=z.useCallback(()=>{if(Vv()&&Lo===null&&e&&!i){Lo={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 p=m-window.innerHeight;p&&c.current>=m&&(document.body.style.top=`${-(c.current+p)}px`)}),300)}},[e]),u=z.useCallback(()=>{if(Vv()&&Lo!==null&&!i){const f=-parseInt(document.body.style.top,10),m=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Lo),window.requestAnimationFrame(()=>{if(s&&o!==window.location.href){l(window.location.href);return}window.scrollTo(m,f)}),Lo=null}},[o]);return z.useEffect(()=>{function f(){c.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),z.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),z.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 KT({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:s,snapPoints:i,shouldScaleBackground:o=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=LT,scrollLockTimeout:d=FT,dismissible:u=!0,handleOnly:f=!1,fadeFromIndex:m=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:x,fixed:g,modal:v=!0,onClose:y,nested:j,noBodyStyles:N=!1,direction:w="bottom",defaultOpen:k=!1,disablePreventScroll:b=!0,snapToSequentialPoint:S=!1,preventScrollRestoration:_=!1,repositionInputs:C=!0,onAnimationEnd:T,container:M,autoFocus:O=!1}){var R,E;const[A=!1,P]=pN({defaultProp:k,prop:e,onChange:Pe=>{t==null||t(Pe),!Pe&&!j&&Ze(),setTimeout(()=>{T==null||T(Pe)},yt.DURATION*1e3),Pe&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Pe||(document.body.style.pointerEvents="auto")}}),[U,Q]=z.useState(!1),[K,se]=z.useState(!1),[ae,W]=z.useState(!1),Y=z.useRef(null),te=z.useRef(null),X=z.useRef(null),I=z.useRef(null),D=z.useRef(null),Z=z.useRef(!1),F=z.useRef(null),q=z.useRef(0),ce=z.useRef(!1),ee=z.useRef(!k),ue=z.useRef(0),V=z.useRef(null),le=z.useRef(((R=V.current)==null?void 0:R.getBoundingClientRect().height)||0),pe=z.useRef(((E=V.current)==null?void 0:E.getBoundingClientRect().width)||0),we=z.useRef(0),_e=z.useCallback(Pe=>{i&&Pe===Fe.length-1&&(te.current=new Date)},[]),{activeSnapPoint:H,activeSnapPointIndex:ye,setActiveSnapPoint:De,onRelease:He,snapPointsOffset:Fe,onDrag:Qe,shouldFade:gt,getPercentageDragged:Ge}=WT({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:x,drawerRef:V,fadeFromIndex:m,overlayRef:Y,onSnapPointChange:_e,direction:w,container:M,snapToSequentialPoint:S});ET({isDisabled:!A||K||!v||ae||!U||!C||!b});const{restorePositionSetting:Ze}=HT({isOpen:A,modal:v,nested:j??!1,hasBeenOpened:U,preventScrollRestoration:_,noBodyStyles:N});function pr(){return(window.innerWidth-bh)/window.innerWidth}function pn(Pe){var he,be;!u&&!i||V.current&&!V.current.contains(Pe.target)||(le.current=((he=V.current)==null?void 0:he.getBoundingClientRect().height)||0,pe.current=((be=V.current)==null?void 0:be.getBoundingClientRect().width)||0,se(!0),X.current=new Date,lN()&&window.addEventListener("touchend",()=>Z.current=!1,{once:!0}),Pe.target.setPointerCapture(Pe.pointerId),q.current=At(w)?Pe.pageY:Pe.pageX)}function Ar(Pe,he){var be;let fe=Pe;const xe=(be=window.getSelection())==null?void 0:be.toString(),Ve=V.current?Rc(V.current,w):null,ie=new Date;if(fe.tagName==="SELECT"||fe.hasAttribute("data-vaul-no-drag")||fe.closest("[data-vaul-no-drag]"))return!1;if(w==="right"||w==="left")return!0;if(te.current&&ie.getTime()-te.current.getTime()<500)return!1;if(Ve!==null&&(w==="bottom"?Ve>0:Ve<0))return!0;if(xe&&xe.length>0)return!1;if(D.current&&ie.getTime()-D.current.getTime()<d&&Ve===0||he)return D.current=ie,!1;for(;fe;){if(fe.scrollHeight>fe.clientHeight){if(fe.scrollTop!==0)return D.current=new Date,!1;if(fe.getAttribute("role")==="dialog")return!0}fe=fe.parentNode}return!0}function xn(Pe){if(V.current&&K){const he=w==="bottom"||w==="right"?1:-1,be=(q.current-(At(w)?Pe.pageY:Pe.pageX))*he,fe=be>0,xe=i&&!u&&!fe;if(xe&&ye===0)return;const Ve=Math.abs(be),ie=document.querySelector("[data-vaul-drawer-wrapper]"),Ce=w==="bottom"||w==="top"?le.current:pe.current;let Te=Ve/Ce;const vt=Ge(Ve,fe);if(vt!==null&&(Te=vt),xe&&Te>=1||!Z.current&&!Ar(Pe.target,fe))return;if(V.current.classList.add(vm),Z.current=!0,$t(V.current,{transition:"none"}),$t(Y.current,{transition:"none"}),i&&Qe({draggedDistance:be}),fe&&!i){const rt=$T(be),gr=Math.min(rt*-1,0)*he;$t(V.current,{transform:At(w)?`translate3d(0, ${gr}px, 0)`:`translate3d(${gr}px, 0, 0)`});return}const tt=1-Te;if((gt||m&&ye===m-1)&&(n==null||n(Pe,Te),$t(Y.current,{opacity:`${tt}`,transition:"none"},!0)),ie&&Y.current&&o){const rt=Math.min(pr()+Te*(1-pr()),1),gr=8-Te*8,tr=Math.max(0,14-Te*14);$t(ie,{borderRadius:`${gr}px`,transform:At(w)?`scale(${rt}) translate3d(0, ${tr}px, 0)`:`scale(${rt}) translate3d(${tr}px, 0, 0)`,transition:"none"},!0)}if(!i){const rt=Ve*he;$t(V.current,{transform:At(w)?`translate3d(0, ${rt}px, 0)`:`translate3d(${rt}px, 0, 0)`})}}}z.useEffect(()=>{window.requestAnimationFrame(()=>{ee.current=!0})},[]),z.useEffect(()=>{var Pe;function he(){if(!V.current||!C)return;const be=document.activeElement;if(yh(be)||ce.current){var fe;const xe=((fe=window.visualViewport)==null?void 0:fe.height)||0,Ve=window.innerHeight;let ie=Ve-xe;const Ce=V.current.getBoundingClientRect().height||0,Te=Ce>Ve*.8;we.current||(we.current=Ce);const vt=V.current.getBoundingClientRect().top;if(Math.abs(ue.current-ie)>60&&(ce.current=!ce.current),i&&i.length>0&&Fe&&ye){const tt=Fe[ye]||0;ie+=tt}if(ue.current=ie,Ce>xe||ce.current){const tt=V.current.getBoundingClientRect().height;let rt=tt;tt>xe&&(rt=xe-(Te?vt:bh)),g?V.current.style.height=`${tt-Math.max(ie,0)}px`:V.current.style.height=`${Math.max(rt,xe-vt)}px`}else kT()||(V.current.style.height=`${we.current}px`);i&&i.length>0&&!ce.current?V.current.style.bottom="0px":V.current.style.bottom=`${Math.max(ie,0)}px`}}return(Pe=window.visualViewport)==null||Pe.addEventListener("resize",he),()=>{var be;return(be=window.visualViewport)==null?void 0:be.removeEventListener("resize",he)}},[ye,i,Fe]);function xr(Pe){Rt(),y==null||y(),Pe||P(!1),setTimeout(()=>{i&&De(i[0])},yt.DURATION*1e3)}function Ct(){if(!V.current)return;const Pe=document.querySelector("[data-vaul-drawer-wrapper]"),he=Rc(V.current,w);$t(V.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`}),$t(Y.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,opacity:"1"}),o&&he&&he>0&&A&&$t(Pe,{borderRadius:`${mN}px`,overflow:"hidden",...At(w)?{transform:`scale(${pr()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${pr()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${yt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${yt.EASE.join(",")})`},!0)}function Rt(){!K||!V.current||(V.current.classList.remove(vm),Z.current=!1,se(!1),I.current=new Date)}function Ht(Pe){if(!K||!V.current)return;V.current.classList.remove(vm),Z.current=!1,se(!1),I.current=new Date;const he=Rc(V.current,w);if(!Pe||!Ar(Pe.target,!1)||!he||Number.isNaN(he)||X.current===null)return;const be=I.current.getTime()-X.current.getTime(),fe=q.current-(At(w)?Pe.pageY:Pe.pageX),xe=Math.abs(fe)/be;if(xe>.05&&(W(!0),setTimeout(()=>{W(!1)},200)),i){He({draggedDistance:fe*(w==="bottom"||w==="right"?1:-1),closeDrawer:xr,velocity:xe,dismissible:u}),s==null||s(Pe,!0);return}if(w==="bottom"||w==="right"?fe>0:fe<0){Ct(),s==null||s(Pe,!0);return}if(xe>fN){xr(),s==null||s(Pe,!1);return}var Ve;const ie=Math.min((Ve=V.current.getBoundingClientRect().height)!=null?Ve:0,window.innerHeight);var Ce;const Te=Math.min((Ce=V.current.getBoundingClientRect().width)!=null?Ce:0,window.innerWidth),vt=w==="left"||w==="right";if(Math.abs(he)>=(vt?Te:ie)*c){xr(),s==null||s(Pe,!1);return}s==null||s(Pe,!0),Ct()}z.useEffect(()=>(A&&($t(document.documentElement,{scrollBehavior:"auto"}),te.current=new Date),()=>{RT(document.documentElement,"scrollBehavior")}),[A]);function er(Pe){const he=Pe?(window.innerWidth-Ss)/window.innerWidth:1,be=Pe?-Ss:0;F.current&&window.clearTimeout(F.current),$t(V.current,{transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,transform:At(w)?`scale(${he}) translate3d(0, ${be}px, 0)`:`scale(${he}) translate3d(${be}px, 0, 0)`}),!Pe&&V.current&&(F.current=setTimeout(()=>{const fe=Rc(V.current,w);$t(V.current,{transition:"none",transform:At(w)?`translate3d(0, ${fe}px, 0)`:`translate3d(${fe}px, 0, 0)`})},500))}function Dn(Pe,he){if(he<0)return;const be=(window.innerWidth-Ss)/window.innerWidth,fe=be+he*(1-be),xe=-Ss+he*Ss;$t(V.current,{transform:At(w)?`scale(${fe}) translate3d(0, ${xe}px, 0)`:`scale(${fe}) translate3d(${xe}px, 0, 0)`,transition:"none"})}function la(Pe,he){const be=At(w)?window.innerHeight:window.innerWidth,fe=he?(be-Ss)/be:1,xe=he?-Ss:0;he&&$t(V.current,{transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,transform:At(w)?`scale(${fe}) translate3d(0, ${xe}px, 0)`:`scale(${fe}) translate3d(${xe}px, 0, 0)`})}return z.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),z.createElement(Hl,{defaultOpen:k,onOpenChange:Pe=>{!u&&!Pe||(Pe?Q(!0):xr(!0),P(Pe))},open:A},z.createElement(oN.Provider,{value:{activeSnapPoint:H,snapPoints:i,setActiveSnapPoint:De,drawerRef:V,overlayRef:Y,onOpenChange:t,onPress:pn,onRelease:Ht,onDrag:xn,dismissible:u,shouldAnimate:ee,handleOnly:f,isOpen:A,isDragging:K,shouldFade:gt,closeDrawer:xr,onNestedDrag:Dn,onNestedOpenChange:er,onNestedRelease:la,keyboardIsOpen:ce,modal:v,snapPointsOffset:Fe,activeSnapPointIndex:ye,direction:w,shouldScaleBackground:o,setBackgroundColorOnScale:l,noBodyStyles:N,container:M,autoFocus:O}},r))}const xN=z.forwardRef(function({...e},t){const{overlayRef:r,snapPoints:n,onRelease:s,shouldFade:i,isOpen:o,modal:l,shouldAnimate:c}=ac(),d=dN(t,r),u=n&&n.length>0;if(!l)return null;const f=z.useCallback(m=>s(m),[s]);return z.createElement(mi,{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})});xN.displayName="Drawer.Overlay";const gN=z.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:p,direction:x,snapPoints:g,container:v,handleOnly:y,shouldAnimate:j,autoFocus:N}=ac(),[w,k]=z.useState(!1),b=dN(s,i),S=z.useRef(null),_=z.useRef(null),C=z.useRef(!1),T=g&&g.length>0;qT();const M=(R,E,A=0)=>{if(C.current)return!0;const P=Math.abs(R.y),U=Math.abs(R.x),Q=U>P,K=["bottom","right"].includes(E)?1:-1;if(E==="left"||E==="right"){if(!(R.x*K<0)&&U>=0&&U<=A)return Q}else if(!(R.y*K<0)&&P>=0&&P<=A)return!Q;return C.current=!0,!0};z.useEffect(()=>{T&&window.requestAnimationFrame(()=>{k(!0)})},[]);function O(R){S.current=null,C.current=!1,l(R)}return z.createElement(hi,{"data-vaul-drawer-direction":x,"data-vaul-drawer":"","data-vaul-delayed-snap-points":w?"true":"false","data-vaul-snap-points":p&&T?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":j!=null&&j.current?"true":"false",...n,ref:b,style:u&&u.length>0?{"--snap-point-height":`${u[f??0]}px`,...t}:t,onPointerDown:R=>{y||(n.onPointerDown==null||n.onPointerDown.call(n,R),S.current={x:R.pageX,y:R.pageY},o(R))},onOpenAutoFocus:R=>{r==null||r(R),N||R.preventDefault()},onPointerDownOutside:R=>{if(e==null||e(R),!m||R.defaultPrevented){R.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:R=>{if(!m){R.preventDefault();return}},onPointerMove:R=>{if(_.current=R,y||(n.onPointerMove==null||n.onPointerMove.call(n,R),!S.current))return;const E=R.pageY-S.current.y,A=R.pageX-S.current.x,P=R.pointerType==="touch"?10:2;M({x:A,y:E},x,P)?c(R):(Math.abs(A)>P||Math.abs(E)>P)&&(S.current=null)},onPointerUp:R=>{n.onPointerUp==null||n.onPointerUp.call(n,R),S.current=null,C.current=!1,l(R)},onPointerOut:R=>{n.onPointerOut==null||n.onPointerOut.call(n,R),O(_.current)},onContextMenu:R=>{n.onContextMenu==null||n.onContextMenu.call(n,R),_.current&&O(_.current)}})});gN.displayName="Drawer.Content";const YT=250,GT=120,VT=z.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:p}=ac(),x=z.useRef(null),g=z.useRef(!1);function v(){if(g.current){N();return}window.setTimeout(()=>{y()},GT)}function y(){if(i||e||g.current){N();return}if(N(),!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 b=o[k+1];c(b)}function j(){x.current=window.setTimeout(()=>{g.current=!0},YT)}function N(){x.current&&window.clearTimeout(x.current),g.current=!1}return z.createElement("div",{onClick:v,onPointerCancel:N,onPointerDown:w=>{u&&m(w),j()},onPointerMove:w=>{u&&p(w)},ref:n,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},z.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});VT.displayName="Drawer.Handle";function XT(e){const t=ac(),{container:r=t.container,...n}=e;return z.createElement(ql,{container:r,...n})}const La={Root:KT,Content:gN,Overlay:xN,Portal:XT,Title:ao,Description:so},gi=({shouldScaleBackground:e=!1,direction:t="right",...r})=>a.jsx(La.Root,{shouldScaleBackground:e,direction:t,...r});gi.displayName="Drawer";const QT=La.Portal,vN=h.forwardRef(({className:e,...t},r)=>a.jsx(La.Overlay,{ref:r,className:$("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}));vN.displayName=La.Overlay.displayName;const vi=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(QT,{children:[a.jsx(vN,{}),a.jsx(La.Content,{ref:n,className:$("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})]}));vi.displayName="DrawerContent";const ho=({className:e,...t})=>a.jsx("div",{className:$("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border shrink-0",e),...t});ho.displayName="DrawerHeader";const po=({className:e,...t})=>a.jsx("div",{className:$("flex-1 overflow-y-auto px-6 py-4",e),...t});po.displayName="DrawerBody";const sc=({className:e,...t})=>a.jsx("div",{className:$("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});sc.displayName="DrawerFooter";const xo=h.forwardRef(({className:e,...t},r)=>a.jsx(La.Title,{ref:r,className:$("text-base font-semibold text-foreground",e),...t}));xo.displayName=La.Title.displayName;const ZT=h.forwardRef(({className:e,...t},r)=>a.jsx(La.Description,{ref:r,className:$("text-sm text-muted-foreground",e),...t}));ZT.displayName=La.Description.displayName;const JT=Yl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ft=h.forwardRef(({className:e,...t},r)=>a.jsx(Rj,{ref:r,className:$(JT(),e),...t}));ft.displayName=Rj.displayName;const Yu=h.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:$("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}));Yu.displayName="Textarea";const Jv=[{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}],ym=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"];function e3(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function t3({chip:e,onRemove:t}){const{attributes:r,listeners:n,setNodeRef:s,transform:i,transition:o,isDragging:l}=Lp({id:e.key});return a.jsxs("div",{ref:s,style:{transform:Fp.Transform.toString(i),transition:o},className:$("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(P1,{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(st,{className:"h-3 w-3"})})]})}const r3=3;function n3({open:e,onClose:t}){var A;const[r,n]=h.useState(""),[s,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),[u,f]=h.useState(!1),[m,p]=h.useState(Jv),[x,g]=h.useState(""),[v,y]=h.useState(ym[2]),{workspace:j}=Ie(),N=p5(),w=m5(r,{enabled:e}),k=h5(s,{enabled:e});h.useEffect(()=>{e&&w.data&&!c&&i(w.data)},[e,w.data,c]);const b=k.available===!1||N.isError&&((A=N.error)==null?void 0:A.status)===409,S=s.trim().length>=r3&&/^[A-Z0-9]+$/i.test(s.trim()),_=Xj($p(Qj,{activationConstraint:{distance:5}})),C=P=>{n(P)},T=()=>{r.trim()&&!c&&w.flush()},M=()=>{n(""),i(""),l(""),d(!1),f(!1),p(Jv),g(""),y(ym[2]),N.reset(),t()},O=()=>{if(!x.trim())return;const P=e3(x.trim());if(m.some(U=>U.key===P)){B.error("A status with this name already exists");return}p(U=>[...U,{name:x.trim(),key:P,color:v,category:"started",position:U.length}]),g("")},R=P=>{const{active:U,over:Q}=P;!Q||U.id===Q.id||p(K=>{const se=K.findIndex(W=>W.key===U.id),ae=K.findIndex(W=>W.key===Q.id);return dd(K,se,ae).map((W,Y)=>({...W,position:Y}))})},E=P=>{P.preventDefault(),!(!r.trim()||!s.trim()||!S||b)&&N.mutate({name:r.trim(),identifier:s.trim().toUpperCase(),description:o.trim()||void 0,workspace_id:j.id,initial_statuses:m},{onSuccess:()=>{B.success("Project created"),M()},onError:U=>{(U==null?void 0:U.status)===409?B.error("This project key is already in use."):B.error(U.message??"Failed to create project")}})};return a.jsx(gi,{open:e,onOpenChange:P=>!P&&M(),dismissible:!1,children:a.jsxs(vi,{className:"max-w-md",children:[a.jsx(ho,{children:a.jsx(xo,{children:"New project"})}),a.jsxs("form",{onSubmit:E,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(po,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ft,{htmlFor:"project-name",children:"Name"}),a.jsx(Ae,{id:"project-name",placeholder:"My Project",value:r,onChange:P=>C(P.target.value),onBlur:T,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(ft,{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(Ae,{id:"project-id",placeholder:"PROJ",value:s,onChange:P=>{i(P.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"")),d(!0)},maxLength:5,className:$("font-mono",b&&"border-destructive"),"aria-invalid":b}),b&&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(ft,{htmlFor:"project-desc",children:["Description",a.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(Yu,{id:"project-desc",placeholder:"What is this project about?",value:o,onChange:P=>l(P.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(ra,{className:"h-3.5 w-3.5"}):a.jsx(kr,{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(ul,{sensors:_,onDragEnd:R,children:a.jsx(zp,{items:m.map(P=>P.key),strategy:Zj,children:a.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.map(P=>a.jsx(t3,{chip:P,onRemove:()=>p(U=>U.filter(Q=>Q.key!==P.key).map((Q,K)=>({...Q,position:K})))},P.key))})})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:ym.map(P=>a.jsx("button",{type:"button",onClick:()=>y(P),className:$("h-4 w-4 rounded-full border-2 transition-transform hover:scale-110",v===P?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:P}},P))}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[a.jsx(Ae,{placeholder:"Status name…",value:x,onChange:P=>g(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),O())},className:"h-7 text-xs flex-1"}),a.jsx(J,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 shrink-0",onClick:O,disabled:!x.trim(),children:a.jsx(dt,{className:"h-3.5 w-3.5"})})]})]})]})]})]}),a.jsxs(sc,{children:[a.jsx(J,{type:"button",variant:"ghost",onClick:M,children:"Cancel"}),a.jsx(J,{type:"submit",disabled:!r.trim()||!s.trim()||!S||b||N.isPending,children:N.isPending?"Creating...":"Create project"})]})]})]})})}const Be=CM,Ye=_M,ze=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs($j,{ref:n,className:$("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(wM,{asChild:!0,children:a.jsx(ra,{className:"h-4 w-4 opacity-50"})})]}));ze.displayName=$j.displayName;const yN=h.forwardRef(({className:e,...t},r)=>a.jsx(zj,{ref:r,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Kp,{className:"h-4 w-4"})}));yN.displayName=zj.displayName;const bN=h.forwardRef(({className:e,...t},r)=>a.jsx(Lj,{ref:r,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(ra,{className:"h-4 w-4"})}));bN.displayName=Lj.displayName;const Le=h.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>a.jsx(jM,{children:a.jsxs(Fj,{ref:s,className:$("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(yN,{}),a.jsx(NM,{className:$("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(bN,{})]})}));Le.displayName=Fj.displayName;const a3=h.forwardRef(({className:e,...t},r)=>a.jsx(Bj,{ref:r,className:$("px-2 py-1.5 text-xs font-medium text-muted-foreground",e),...t}));a3.displayName=Bj.displayName;const ke=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Wj,{ref:n,className:$("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(kM,{children:a.jsx(ir,{className:"h-4 w-4"})})}),a.jsx(SM,{children:t})]}));ke.displayName=Wj.displayName;const s3=h.forwardRef(({className:e,...t},r)=>a.jsx(Uj,{ref:r,className:$("-mx-1 my-1 h-px bg-border",e),...t}));s3.displayName=Uj.displayName;function i3({open:e,onClose:t,projectId:r,projectName:n}){const{workspace:s}=Ie(),i=(s==null?void 0:s.id)??"",{data:o,isLoading:l}=aa(r),{data:c}=ec(i),{data:d}=Tu(i),u=Y1(r),f=G1(r),m=V1(r),p=X1(r),[x,g]=h.useState(""),[v,y]=h.useState(""),j=new Set((o==null?void 0:o.members.map(b=>b.user_id))??[]),N=new Set((o==null?void 0:o.teams.map(b=>b.team_id))??[]),w=(c??[]).filter(b=>!j.has(b.user_id)),k=(d??[]).filter(b=>!N.has(b.id));return a.jsx(Ra,{open:e,onOpenChange:b=>!b&&t(),children:a.jsxs(sa,{className:"sm:max-w-[480px]",children:[a.jsx($a,{children:a.jsxs(za,{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(b=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(oe,{className:"h-7 w-7 rounded-full"}),a.jsx(oe,{className:"h-3.5 w-32"})]},b))}):(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(b=>{var O;const S=b.user,_=(S==null?void 0:S.first_name)??"",C=(S==null?void 0:S.last_name)??"",T=`${_} ${C}`.trim()||(S==null?void 0:S.email)||"Unknown",M=(_[0]??C[0]??((O=S==null?void 0:S.email)==null?void 0:O[0])??"U").toUpperCase();return a.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[a.jsx(Ft,{className:"h-7 w-7 shrink-0",children:a.jsx(Bt,{className:"text-[11px] font-medium",children:M})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:T}),a.jsx("span",{className:$("text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",b.role==="manager"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:b.role}),a.jsx("button",{onClick:()=>f.mutate(b.user_id,{onSuccess:()=>B.success("Access removed"),onError:()=>B.error("Failed to remove")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(st,{className:"h-3.5 w-3.5"})})]},b.id)})}),w.length>0&&a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx(co,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Be,{value:x,onValueChange:g,children:[a.jsx(ze,{className:"h-8 text-xs flex-1",children:a.jsx(Ye,{placeholder:"Add person…"})}),a.jsx(Le,{children:w.map(b=>{const S=b.user,_=(S==null?void 0:S.first_name)??"",C=(S==null?void 0:S.last_name)??"",T=`${_} ${C}`.trim()||(S==null?void 0:S.email)||"Unknown";return a.jsx(ke,{value:b.user_id,children:T},b.user_id)})})]}),x&&a.jsx(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:u.isPending,onClick:()=>u.mutate({userId:x},{onSuccess:()=>{B.success("Access granted"),g("")},onError:()=>B.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(b=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(oe,{className:"h-7 w-7 rounded-lg"}),a.jsx(oe,{className:"h-3.5 w-28"})]},b))}):(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(b=>{const S=b.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(ri,{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:()=>p.mutate(b.team_id,{onSuccess:()=>B.success("Team access removed"),onError:()=>B.error("Failed to remove team")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(st,{className:"h-3.5 w-3.5"})})]},b.id)})}),k.length>0&&a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx(ri,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Be,{value:v,onValueChange:y,children:[a.jsx(ze,{className:"h-8 text-xs flex-1",children:a.jsx(Ye,{placeholder:"Add team…"})}),a.jsx(Le,{children:k.map(b=>a.jsx(ke,{value:b.id,children:b.name},b.id))})]}),v&&a.jsx(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:m.isPending,onClick:()=>m.mutate(v,{onSuccess:()=>{B.success("Team access granted"),y("")},onError:()=>B.error("Failed to add team")}),children:"Add"})]})]}),a.jsx("div",{className:"flex justify-end pt-1",children:a.jsx(J,{variant:"outline",size:"sm",onClick:t,children:"Close"})})]})]})})}const wN=6048e5,o3=864e5,l3=36e5,$c=43200,ey=1440,ty=Symbol.for("constructDateFrom");function wt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ty in e?e[ty](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ue(e,t){return wt(t||e,e)}function Lr(e,t,r){const n=Ue(e,r==null?void 0:r.in);return isNaN(t)?wt((r==null?void 0:r.in)||e,NaN):(t&&n.setDate(n.getDate()+t),n)}function lx(e,t,r){const n=Ue(e,r==null?void 0:r.in);if(isNaN(t))return wt((r==null?void 0:r.in)||e,NaN);if(!t)return n;const s=n.getDate(),i=wt((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 c3={};function go(){return c3}function qi(e,t){var l,c,d,u;const r=go(),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=Ue(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 gl(e,t){return qi(e,{...t,weekStartsOn:1})}function jN(e,t){const r=Ue(e,t==null?void 0:t.in),n=r.getFullYear(),s=wt(r,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const i=gl(s),o=wt(r,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const l=gl(o);return r.getTime()>=i.getTime()?n+1:r.getTime()>=l.getTime()?n:n-1}function wd(e){const t=Ue(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 ia(e,...t){const r=wt.bind(null,e||t.find(n=>typeof n=="object"));return t.map(r)}function Hi(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function Gu(e,t,r){const[n,s]=ia(r==null?void 0:r.in,e,t),i=Hi(n),o=Hi(s),l=+i-wd(i),c=+o-wd(o);return Math.round((l-c)/o3)}function d3(e,t){const r=jN(e,t),n=wt(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),gl(n)}function u3(e,t,r){return Lr(e,t*7,r)}function f3(e,t,r){return lx(e,t*12,r)}function m3(e,t){let r,n=t==null?void 0:t.in;return e.forEach(s=>{!n&&typeof s=="object"&&(n=wt.bind(null,s));const i=Ue(s,n);(!r||r<i||isNaN(+i))&&(r=i)}),wt(n,r||NaN)}function h3(e,t){let r,n=t==null?void 0:t.in;return e.forEach(s=>{!n&&typeof s=="object"&&(n=wt.bind(null,s));const i=Ue(s,n);(!r||r>i||isNaN(+i))&&(r=i)}),wt(n,r||NaN)}function ud(e,t){const r=+Ue(e)-+Ue(t);return r<0?-1:r>0?1:r}function cx(e){return wt(e,Date.now())}function Ki(e,t,r){const[n,s]=ia(r==null?void 0:r.in,e,t);return+Hi(n)==+Hi(s)}function NN(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function p3(e){return!(!NN(e)&&typeof e!="number"||isNaN(+Ue(e)))}function dx(e,t,r){const[n,s]=ia(r==null?void 0:r.in,e,t),i=n.getFullYear()-s.getFullYear(),o=n.getMonth()-s.getMonth();return i*12+o}function kN(e,t,r){const[n,s]=ia(r==null?void 0:r.in,e,t),i=ry(n,s),o=Math.abs(Gu(n,s));n.setDate(n.getDate()-i*o);const l=+(ry(n,s)===-i),c=i*(o-l);return c===0?0:c}function ry(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 SN(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function x3(e,t,r){const[n,s]=ia(r==null?void 0:r.in,e,t),i=(+n-+s)/l3;return SN(r==null?void 0:r.roundingMethod)(i)}function g3(e,t){return+Ue(e)-+Ue(t)}function CN(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function ux(e,t){const r=Ue(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 v3(e,t){const r=Ue(e,t==null?void 0:t.in);return+CN(r,t)==+ux(r,t)}function _N(e,t,r){const[n,s,i]=ia(r==null?void 0:r.in,e,e,t),o=ud(s,i),l=Math.abs(dx(s,i));if(l<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*l);let c=ud(s,i)===-o;v3(n)&&l===1&&ud(n,i)===1&&(c=!1);const d=o*(l-+c);return d===0?0:d}function y3(e,t,r){const n=g3(e,t)/1e3;return SN(r==null?void 0:r.roundingMethod)(n)}function ON(e,t){const[r,n]=ia(e,t.start,t.end);return{start:r,end:n}}function b3(e,t){const{start:r,end:n}=ON(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(wt(r,o)),o.setMonth(o.getMonth()+l);return s?c.reverse():c}function PN(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function w3(e,t){const r=Ue(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 MN(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function j3(e,t){const{start:r,end:n}=ON(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(wt(r,o)),o.setFullYear(o.getFullYear()+l);return s?c.reverse():c}function EN(e,t){var l,c,d,u;const r=go(),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=Ue(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 N3(e,t){return EN(e,{...t,weekStartsOn:1})}const k3={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"}},S3=(e,t,r)=>{let n;const s=k3[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 bm(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const C3={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_3={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},O3={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},P3={date:bm({formats:C3,defaultWidth:"full"}),time:bm({formats:_3,defaultWidth:"full"}),dateTime:bm({formats:O3,defaultWidth:"full"})},M3={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},E3=(e,t,r,n)=>M3[e];function Fo(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 A3={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},D3={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},T3={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"]},I3={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"]},R3={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"}},$3={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"}},z3=(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"},L3={ordinalNumber:z3,era:Fo({values:A3,defaultWidth:"wide"}),quarter:Fo({values:D3,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Fo({values:T3,defaultWidth:"wide"}),day:Fo({values:I3,defaultWidth:"wide"}),dayPeriod:Fo({values:R3,defaultWidth:"wide",formattingValues:$3,defaultFormattingWidth:"wide"})};function Bo(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)?B3(l,f=>f.test(o)):F3(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 F3(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function B3(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function W3(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 U3=/^(\d+)(th|st|nd|rd)?/i,q3=/\d+/i,H3={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},K3={any:[/^b/i,/^(a|c)/i]},Y3={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},G3={any:[/1/i,/2/i,/3/i,/4/i]},V3={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},X3={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]},Q3={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},Z3={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]},J3={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},eI={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}},tI={ordinalNumber:W3({matchPattern:U3,parsePattern:q3,valueCallback:e=>parseInt(e,10)}),era:Bo({matchPatterns:H3,defaultMatchWidth:"wide",parsePatterns:K3,defaultParseWidth:"any"}),quarter:Bo({matchPatterns:Y3,defaultMatchWidth:"wide",parsePatterns:G3,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Bo({matchPatterns:V3,defaultMatchWidth:"wide",parsePatterns:X3,defaultParseWidth:"any"}),day:Bo({matchPatterns:Q3,defaultMatchWidth:"wide",parsePatterns:Z3,defaultParseWidth:"any"}),dayPeriod:Bo({matchPatterns:J3,defaultMatchWidth:"any",parsePatterns:eI,defaultParseWidth:"any"})},zs={code:"en-US",formatDistance:S3,formatLong:P3,formatRelative:E3,localize:L3,match:tI,options:{weekStartsOn:0,firstWeekContainsDate:1}};function rI(e,t){const r=Ue(e,t==null?void 0:t.in);return Gu(r,MN(r))+1}function fx(e,t){const r=Ue(e,t==null?void 0:t.in),n=+gl(r)-+d3(r);return Math.round(n/wN)+1}function AN(e,t){var u,f,m,p;const r=Ue(e,t==null?void 0:t.in),n=r.getFullYear(),s=go(),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??((p=(m=s.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,o=wt((t==null?void 0:t.in)||e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=qi(o,t),c=wt((t==null?void 0:t.in)||e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const d=qi(c,t);return+r>=+l?n+1:+r>=+d?n:n-1}function nI(e,t){var l,c,d,u;const r=go(),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=AN(e,t),i=wt((t==null?void 0:t.in)||e,0);return i.setFullYear(s,0,n),i.setHours(0,0,0,0),qi(i,t)}function mx(e,t){const r=Ue(e,t==null?void 0:t.in),n=+qi(r,t)-+nI(r,t);return Math.round(n/wN)+1}function Je(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Qa={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Je(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Je(r+1,2)},d(e,t){return Je(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 Je(e.getHours()%12||12,t.length)},H(e,t){return Je(e.getHours(),t.length)},m(e,t){return Je(e.getMinutes(),t.length)},s(e,t){return Je(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return Je(s,t.length)}},Si={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ny={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 Qa.y(e,t)},Y:function(e,t,r,n){const s=AN(e,n),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return Je(o,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):Je(i,t.length)},R:function(e,t){const r=jN(e);return Je(r,t.length)},u:function(e,t){const r=e.getFullYear();return Je(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 Je(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 Je(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 Qa.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 Je(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=mx(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):Je(s,t.length)},I:function(e,t,r){const n=fx(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Je(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Qa.d(e,t)},D:function(e,t,r){const n=rI(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Je(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 Je(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 Je(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 Je(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 Qa.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Qa.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Je(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Je(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Qa.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Qa.s(e,t)},S:function(e,t){return Qa.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return sy(n);case"XXXX":case"XX":return Es(n);case"XXXXX":case"XXX":default:return Es(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return sy(n);case"xxxx":case"xx":return Es(n);case"xxxxx":case"xxx":default:return Es(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ay(n,":");case"OOOO":default:return"GMT"+Es(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ay(n,":");case"zzzz":default:return"GMT"+Es(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return Je(n,t.length)},T:function(e,t,r){return Je(+e,t.length)}};function ay(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+Je(i,2)}function sy(e,t){return e%60===0?(e>0?"-":"+")+Je(Math.abs(e)/60,2):Es(e,t)}function Es(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Je(Math.trunc(n/60),2),i=Je(n%60,2);return r+s+t+i}const iy=(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"})}},DN=(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"})}},aI=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return iy(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}}",iy(n,t)).replace("{{time}}",DN(s,t))},sI={p:DN,P:aI},iI=/^D+$/,oI=/^Y+$/,lI=["D","DD","YY","YYYY"];function cI(e){return iI.test(e)}function dI(e){return oI.test(e)}function uI(e,t,r){const n=fI(e,t,r);if(console.warn(n),lI.includes(e))throw new RangeError(n)}function fI(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 mI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,hI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pI=/^'([^]*?)'?$/,xI=/''/g,gI=/[a-zA-Z]/;function me(e,t,r){var u,f,m,p,x,g,v,y;const n=go(),s=(r==null?void 0:r.locale)??n.locale??zs,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??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((g=(x=r==null?void 0:r.locale)==null?void 0:x.options)==null?void 0:g.weekStartsOn)??n.weekStartsOn??((y=(v=n.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??0,l=Ue(e,r==null?void 0:r.in);if(!p3(l))throw new RangeError("Invalid time value");let c=t.match(hI).map(j=>{const N=j[0];if(N==="p"||N==="P"){const w=sI[N];return w(j,s.formatLong)}return j}).join("").match(mI).map(j=>{if(j==="''")return{isToken:!1,value:"'"};const N=j[0];if(N==="'")return{isToken:!1,value:vI(j)};if(ny[N])return{isToken:!0,value:j};if(N.match(gI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+N+"`");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 N=j.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&dI(N)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&cI(N))&&uI(N,t,String(e));const w=ny[N[0]];return w(l,N,s.localize,d)}).join("")}function vI(e){const t=e.match(pI);return t?t[1].replace(xI,"'"):e}function wh(e,t,r){const n=go(),s=(r==null?void 0:r.locale)??n.locale??zs,i=2520,o=ud(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]=ia(r==null?void 0:r.in,...o>0?[t,e]:[e,t]),u=y3(d,c),f=(wd(d)-wd(c))/1e3,m=Math.round((u-f)/60);let p;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<ey){const x=Math.round(m/60);return s.formatDistance("aboutXHours",x,l)}else{if(m<i)return s.formatDistance("xDays",1,l);if(m<$c){const x=Math.round(m/ey);return s.formatDistance("xDays",x,l)}else if(m<$c*2)return p=Math.round(m/$c),s.formatDistance("aboutXMonths",p,l)}if(p=_N(d,c),p<12){const x=Math.round(m/$c);return s.formatDistance("xMonths",x,l)}else{const x=p%12,g=Math.trunc(p/12);return x<3?s.formatDistance("aboutXYears",g,l):x<9?s.formatDistance("overXYears",g,l):s.formatDistance("almostXYears",g+1,l)}}function yI(e,t){return wh(e,cx(e),t)}function fl(e,t){return Ue(e,t==null?void 0:t.in).getDate()}function bI(e,t){return Ue(e,t==null?void 0:t.in).getDay()}function ps(e,t){const r=Ue(e,t==null?void 0:t.in),n=r.getFullYear(),s=r.getMonth(),i=wt(r,0);return i.setFullYear(n,s+1,0),i.setHours(0,0,0,0),i.getDate()}function fd(e,t){return Ue(e,t==null?void 0:t.in).getMonth()}function wI(e,t){return Ue(e,t==null?void 0:t.in).getFullYear()}function jI(e,t){return+Ue(e)>+Ue(t)}function NI(e,t){return+Ue(e)<+Ue(t)}function kI(e,t,r){const[n,s]=ia(r==null?void 0:r.in,e,t);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()}function SI(e,t,r){const[n,s]=ia(r==null?void 0:r.in,e,t);return n.getFullYear()===s.getFullYear()}function CI(e,t){return Ki(wt(e,e),cx(e))}function TN(e,t,r){return Lr(e,-t,r)}function _I(e,t){return Ki(wt(e,e),TN(cx(e),1))}function OI(e,t,r){const n=Ue(e,r==null?void 0:r.in),s=n.getFullYear(),i=n.getDate(),o=wt(e,0);o.setFullYear(s,t,15),o.setHours(0,0,0,0);const l=ps(o);return n.setMonth(t,Math.min(i,l)),n}function PI(e,t,r){const n=Ue(e,r==null?void 0:r.in);return isNaN(+n)?wt(e,NaN):(n.setFullYear(t),n)}function MI(){const[e,t]=h.useState(!1),[r,n]=h.useState(null),[s,i]=h.useState(""),[o,l]=h.useState("all"),{workspace:c}=Wt(),{data:d,isLoading:u}=fo(),f=x5(),m=jt(),p=(d??[]).filter(x=>(o==="all"||x.status===o)&&(!s||x.name.toLowerCase().includes(s.toLowerCase())||x.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(J,{size:"sm",onClick:()=>t(!0),children:[a.jsx(dt,{className:"h-4 w-4"}),"Create"]})]}),a.jsxs("div",{className:"flex flex-col gap-2 px-4 md:px-6 py-3 md:py-4 border-b border-border md:flex-row md:items-center md:justify-between",children:[a.jsx("div",{className:"flex items-center gap-1 overflow-x-auto scrollbar-none",children:["all","active","paused","archived"].map(x=>a.jsx("button",{onClick:()=>l(x),className:$("px-3 h-7 rounded-md text-xs font-medium transition-colors whitespace-nowrap shrink-0",o===x?"bg-foreground text-background":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:x==="all"?"All":x.charAt(0).toUpperCase()+x.slice(1)},x))}),a.jsxs("div",{className:"relative",children:[a.jsx(lo,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Ae,{placeholder:"Search...",value:s,onChange:x=>i(x.target.value),className:"pl-8 h-8 w-full md:w-[200px] text-xs bg-transparent"})]})]}),a.jsxs("div",{className:"hidden md: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(x=>a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden md:grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3",children:[a.jsx(oe,{className:"h-4 w-48"}),a.jsx(oe,{className:"h-4 w-12"}),a.jsx(oe,{className:"h-5 w-16 rounded-full"}),a.jsx(oe,{className:"h-4 w-24"}),a.jsx("div",{})]},`d-${x}`),a.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3",children:[a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(oe,{className:"h-4 w-40"}),a.jsx(oe,{className:"h-3 w-24"})]}),a.jsx(oe,{className:"h-6 w-6 rounded-full"})]},`m-${x}`)]}))}):p.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(Br,{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(J,{size:"sm",onClick:()=>t(!0),children:[a.jsx(dt,{className:"h-4 w-4"}),"Create project"]})]}):a.jsx("div",{className:"divide-y divide-border",children:p.map(x=>a.jsxs("div",{children:[a.jsxs("div",{className:"hidden md: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/${x.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:x.name}),x.description&&a.jsx("span",{className:"text-xs text-muted-foreground truncate hidden xl:block",children:x.description})]}),a.jsx("span",{className:"text-sm text-muted-foreground font-mono",children:x.identifier}),a.jsx("div",{children:a.jsxs("span",{className:$("inline-flex items-center gap-1.5 text-xs",x.status==="active"&&"text-emerald-600",x.status==="paused"&&"text-amber-600",x.status==="archived"&&"text-muted-foreground"),children:[a.jsx("span",{className:$("h-1.5 w-1.5 rounded-full shrink-0",x.status==="active"&&"bg-emerald-500",x.status==="paused"&&"bg-amber-500",x.status==="archived"&&"bg-zinc-400")}),x.status.charAt(0).toUpperCase()+x.status.slice(1)]})}),a.jsx("span",{className:"text-sm text-muted-foreground",children:me(new Date(x.created_at),"MMM d, yyyy")}),a.jsx("div",{className:"flex justify-end",onClick:g=>g.stopPropagation(),children:a.jsxs(Wr,{children:[a.jsx(Ur,{asChild:!0,children:a.jsx(J,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(ka,{className:"h-4 w-4"})})}),a.jsxs(Cr,{align:"end",children:[a.jsxs(nt,{onClick:()=>m(`/${c}/projects/${x.identifier}/board`),children:[a.jsx(Br,{className:"h-4 w-4"}),"Open board"]}),a.jsxs(nt,{onClick:()=>m(`/${c}/projects/${x.identifier}/issues`),children:[a.jsx(Xn,{className:"h-4 w-4"}),"View issues"]}),a.jsxs(nt,{onClick:()=>n({id:x.id,name:x.name}),children:[a.jsx(ei,{className:"h-4 w-4"}),"Manage access"]}),a.jsx(_n,{}),a.jsxs(nt,{className:"text-destructive focus:text-destructive",onClick:()=>{confirm(`Delete "${x.name}"? This cannot be undone.`)&&f.mutate(x.id,{onSuccess:()=>B.success("Project deleted"),onError:()=>B.error("Failed to delete project")})},children:[a.jsx(Sr,{className:"h-4 w-4"}),"Delete"]})]})]})})]}),a.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3 hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>m(`/${c}/projects/${x.identifier}/issues`),children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[a.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:x.name}),a.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:x.identifier})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:$("h-1.5 w-1.5 rounded-full shrink-0",x.status==="active"&&"bg-emerald-500",x.status==="paused"&&"bg-amber-500",x.status==="archived"&&"bg-zinc-400")}),a.jsx("span",{className:$("text-xs",x.status==="active"&&"text-emerald-600",x.status==="paused"&&"text-amber-600",x.status==="archived"&&"text-muted-foreground"),children:x.status.charAt(0).toUpperCase()+x.status.slice(1)}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:me(new Date(x.created_at),"MMM d, yyyy")})]})]}),a.jsx("div",{onClick:g=>g.stopPropagation(),children:a.jsxs(Wr,{children:[a.jsx(Ur,{asChild:!0,children:a.jsx(J,{variant:"ghost",size:"icon-sm",className:"h-8 w-8 text-muted-foreground",children:a.jsx(ka,{className:"h-4 w-4"})})}),a.jsxs(Cr,{align:"end",children:[a.jsxs(nt,{onClick:()=>m(`/${c}/projects/${x.identifier}/issues`),children:[a.jsx(Xn,{className:"h-4 w-4"}),"View issues"]}),a.jsxs(nt,{onClick:()=>n({id:x.id,name:x.name}),children:[a.jsx(ei,{className:"h-4 w-4"}),"Manage access"]}),a.jsx(_n,{}),a.jsxs(nt,{className:"text-destructive focus:text-destructive",onClick:()=>{confirm(`Delete "${x.name}"? This cannot be undone.`)&&f.mutate(x.id,{onSuccess:()=>B.success("Project deleted"),onError:()=>B.error("Failed to delete project")})},children:[a.jsx(Sr,{className:"h-4 w-4"}),"Delete"]})]})]})})]})]},x.id))}),!u&&p.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 — ",p.length," of ",p.length," result",p.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(J,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Prev"}),a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Next"})]})]})]}),a.jsx(n3,{open:e,onClose:()=>t(!1)}),r&&a.jsx(i3,{open:!!r,onClose:()=>n(null),projectId:r.id,projectName:r.name})]})}const ic={byProject:e=>["projects",e,"statuses"]};function vo(e){return We({queryKey:ic.byProject(e??""),queryFn:()=>re.get(`/admin/projects/${e}/statuses`),select:t=>t.statuses,enabled:!!e})}function EI(e){const t=Ne();return ge({mutationFn:r=>re.post(`/admin/projects/${e}/statuses`,r),onSuccess:()=>{t.invalidateQueries({queryKey:ic.byProject(e)})}})}function AI(e,t){const r=Ne();return ge({mutationFn:n=>re.put(`/admin/projects/${e}/statuses/${t}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:ic.byProject(e)})}})}function DI(e){const t=Ne();return ge({mutationFn:r=>re.delete(`/admin/projects/${e}/statuses/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:ic.byProject(e)})}})}function TI(e){const t=Ne();return ge({mutationFn:r=>re.post(`/admin/projects/${e}/statuses/reorder`,{orderedIds:r}),onSuccess:()=>{t.invalidateQueries({queryKey:ic.byProject(e)})}})}const yo={all:["users"],list:()=>[...yo.all,"list"]};function oc(){return We({queryKey:yo.list(),queryFn:()=>re.get("/admin/users"),select:e=>e.users,staleTime:1e3*60*5})}const Vu={all:["org-invitations"],list:()=>[...Vu.all,"list"]};function II(){return We({queryKey:Vu.list(),queryFn:()=>re.get("/admin/users/invitations"),select:e=>e.invitations,staleTime:1e3*30})}function RI(){const e=Ne();return ge({mutationFn:t=>re.delete(`/admin/users/invitations/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:Vu.list()})})}function $I(){return ge({mutationFn:e=>re.post(`/admin/users/invitations/${e}/resend`)})}function zI(){const e=Ne();return ge({mutationFn:({email:t,role:r})=>re.post("/admin/users/invite",{email:t,role:r}),onSuccess:()=>e.invalidateQueries({queryKey:Vu.list()})})}function LI(){const e=Ne();return ge({mutationFn:({userId:t,role:r})=>re.patch(`/admin/users/${t}`,{role:r}),onSuccess:()=>e.invalidateQueries({queryKey:yo.list()})})}function FI(){const e=Ne();return ge({mutationFn:t=>re.delete(`/admin/users/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:yo.list()})})}function BI(){const e=Ne();return ge({mutationFn:t=>re.post(`/admin/users/${t}/reactivate`),onSuccess:()=>e.invalidateQueries({queryKey:yo.list()})})}function yi(){return We({queryKey:[...yo.list(),"map"],queryFn:()=>re.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 si={backlog:"Backlog",todo:"Todo",in_progress:"In Progress",in_review:"In Review",done:"Done",cancelled:"Cancelled"},On={urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"None"},hx={urgent:"text-red-500",high:"text-orange-500",medium:"text-yellow-500",low:"text-blue-400",none:"text-zinc-400"},xs={task:"Task",bug:"Bug",feature:"Feature",improvement:"Improvement",epic:"Epic"},WI=({priority:e})=>{const t=$("h-3 w-3 shrink-0",hx[e]);switch(e){case"urgent":return a.jsx(ys,{className:t});case"high":return a.jsx(Xl,{className:t});case"medium":return a.jsx(xi,{className:t});case"low":return a.jsx(Gl,{className:t});default:return a.jsx(ln,{className:"h-3 w-3 shrink-0 text-zinc-300"})}};function IN({issue:e,childCount:t=0,onClick:r}){var f,m;const{data:n}=yi(),{attributes:s,listeners:i,setNodeRef:o,transform:l,transition:c,isDragging:d}=Lp({id:e.id}),u={transform:Fp.Transform.toString(l),transition:c};return a.jsxs("div",{ref:o,style:u,...s,...i,onClick:r,className:$("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(Sn,{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(Sn,{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(p=>{const x=n==null?void 0:n.get(p);return a.jsx(Ft,{className:"h-4 w-4 border border-background",children:a.jsx(Bt,{className:"text-[8px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:(x==null?void 0:x.initials)??"?"})},p)}),(((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(WI,{priority:e.priority})]})]})]})}function zc(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 UI=({category:e,color:t})=>{const r="h-3.5 w-3.5 shrink-0",n={color:t};switch(e){case"completed":return a.jsx(Na,{className:r,style:n});case"started":return a.jsx(na,{className:r,style:n});default:return a.jsx(ln,{className:r,style:n})}};function qI({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:p,onRenameCancel:x}){const{setNodeRef:g,isOver:v}=tE({id:e}),{attributes:y,listeners:j,setNodeRef:N,transform:w,transition:k,isDragging:b}=Lp({id:e,disabled:!o}),S=h.useRef(null),_=h.useRef(!1);h.useEffect(()=>{u&&(_.current=!1,setTimeout(()=>{var E;return(E=S.current)==null?void 0:E.focus()},0))},[u]);const C=o?{transform:Fp.Transform.toString(w),transition:k}:void 0,T=zc(r,.08),M=zc(r,.16),O=zc(r,.35),R=!!(c||d);return a.jsxs("div",{ref:N,style:C,className:$("flex flex-col min-w-[260px] max-w-[280px] w-full group/col",b&&"opacity-50"),children:[a.jsxs("div",{className:$("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(P1,{className:"h-3.5 w-3.5"})}),a.jsx(UI,{category:n,color:r}),u?a.jsx("input",{ref:S,value:f??"",onChange:E=>m==null?void 0:m(E.target.value),onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),p==null||p()),E.key==="Escape"&&(E.preventDefault(),_.current=!0,x==null||x())},onBlur:()=>{_.current||p==null||p()},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:zc(r,.12),color:r},children:s.length}),R&&!u&&a.jsxs(Wr,{children:[a.jsx(Ur,{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:E=>E.stopPropagation(),children:a.jsx(ka,{className:"h-3.5 w-3.5"})})}),a.jsxs(Cr,{align:"end",className:"w-40",children:[c&&a.jsx(nt,{onClick:c,children:"Rename"}),c&&d&&a.jsx(_n,{}),d&&a.jsx(nt,{className:"text-destructive focus:text-destructive",onClick:d,children:"Delete status"})]})]})]}),a.jsxs("div",{ref:g,className:$("flex-1 flex flex-col gap-2 min-h-[200px] p-2 rounded-xl transition-colors"),style:{backgroundColor:v?M:T,boxShadow:v?`inset 0 0 0 1px ${O}`:void 0},children:[a.jsx(zp,{items:s.map(E=>E.id),strategy:rE,children:s.map(E=>a.jsx(IN,{issue:E,childCount:(i==null?void 0:i.get(E.id))??0,onClick:()=>l==null?void 0:l(E)},E.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 wm=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"],HI=[{value:"backlog",label:"Backlog"},{value:"unstarted",label:"Not Started"},{value:"started",label:"In Progress"},{value:"completed",label:"Done"},{value:"cancelled",label:"Cancelled"}];function KI({open:e,onClose:t,projectId:r}){const[n,s]=h.useState(""),[i,o]=h.useState(wm[0]),[l,c]=h.useState(""),[d,u]=h.useState("started"),f=EI(r),m=l||i,p=()=>{n.trim()&&f.mutate({name:n.trim(),color:m,category:d},{onSuccess:()=>{B.success("Status created"),s(""),o(wm[0]),c(""),u("started"),t()},onError:()=>B.error("Failed to create status")})};return a.jsx(gi,{open:e,onOpenChange:x=>!x&&t(),children:a.jsxs(vi,{className:"sm:max-w-sm",children:[a.jsx(ho,{children:a.jsx(xo,{className:"text-sm font-medium",children:"New Status"})}),a.jsx(po,{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(Ae,{placeholder:"e.g. In Review",value:n,onChange:x=>s(x.target.value),onKeyDown:x=>x.key==="Enter"&&p(),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:[wm.map(x=>a.jsx("button",{onClick:()=>{o(x),c("")},className:$("h-6 w-6 rounded-full border-2 transition-transform hover:scale-110",i===x&&!l?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:x}},x)),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(Ae,{placeholder:"#hex",value:l,onChange:x=>c(x.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(Be,{value:d,onValueChange:x=>u(x),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx(Le,{children:HI.map(x=>a.jsx(ke,{value:x.value,className:"text-xs",children:x.label},x.value))})]})]})]})}),a.jsxs(sc,{className:"mt-2",children:[a.jsx(J,{variant:"ghost",size:"sm",onClick:t,className:"text-xs",children:"Cancel"}),a.jsx(J,{size:"sm",onClick:p,disabled:!n.trim()||f.isPending,className:"text-xs",children:"Create"})]})]})})}function YI({projectId:e}){const[t,r]=h.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(dt,{className:"h-3.5 w-3.5"}),"Add status"]})}),a.jsx(KI,{open:t,onClose:()=>r(!1),projectId:e})]})}function GI({open:e,statusName:t,issueCount:r,otherStatuses:n,onConfirm:s,onCancel:i,isLoading:o}){const[l,c]=h.useState(""),d=()=>{r>0&&!l||s(r>0?l:null)};return a.jsx(Ra,{open:e,onOpenChange:u=>{u||i()},children:a.jsxs(sa,{className:"sm:max-w-md",children:[a.jsxs($a,{children:[a.jsx(za,{children:"Delete status"}),a.jsx(mo,{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(Be,{value:l,onValueChange:c,children:[a.jsx(ze,{children:a.jsx(Ye,{placeholder:"Select a status..."})}),a.jsx(Le,{children:n.map(u=>a.jsx(ke,{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(nx,{children:[a.jsx(J,{variant:"outline",onClick:i,disabled:o,children:"Cancel"}),a.jsx(J,{variant:"destructive",onClick:d,disabled:r>0&&!l||o,children:o?"Deleting…":"Delete status"})]})]})})}function jm(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 VI(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 RN({issues:e,projectId:t,statuses:r,onIssueClick:n,onColumnsReorder:s,readOnly:i=!1,filters:o}){var X;const[l,c]=h.useState(()=>r.map(I=>I.id)),[d,u]=h.useState(()=>jm(e,r)),[f,m]=h.useState(null),[p,x]=h.useState(null),[g,v]=h.useState(null),[y,j]=h.useState(null),[N,w]=h.useState(""),k=h.useRef(null),b=h.useRef(!1),S=Ne(),_=Tt.byProject(t,o),C=DI(t),T=AI(t,y??""),M=h.useMemo(()=>{const I=new Map;for(const D of e)D.parent_id&&I.set(D.parent_id,(I.get(D.parent_id)??0)+1);return I},[e]);h.useEffect(()=>{c(I=>{const D=new Set(r.map(q=>q.id)),Z=I.filter(q=>D.has(q)),F=r.map(q=>q.id).filter(q=>!I.includes(q));return Z.length===I.length&&F.length===0?I:[...Z,...F]})},[r]),h.useEffect(()=>{b.current||u(I=>VI(I,e,r))},[e,r]);const O=[...r].sort((I,D)=>{const Z=l.indexOf(I.id),F=l.indexOf(D.id);return Z===-1&&F===-1?I.position-D.position:Z===-1?1:F===-1?-1:Z-F}),R=Xj($p(Qj,i?{activationConstraint:{distance:1/0}}:{activationConstraint:{distance:5}})),E=h.useCallback(I=>{if(p){const D=I.droppableContainers.filter(Z=>l.includes(Z.id));return nE({...I,droppableContainers:D})}return aE(I)},[p,l]),A=h.useCallback(I=>{for(const[D,Z]of Object.entries(d))if(Z.some(F=>F.id===I))return D;return null},[d]),P=h.useCallback(I=>r.some(D=>D.id===I),[r]),U=I=>{const D=I.active.id;if(b.current=!0,P(D)){x(D);return}for(const[Z,F]of Object.entries(d)){const q=F.find(ce=>ce.id===D);if(q){m(q),k.current=Z;return}}},Q=I=>{const{active:D,over:Z}=I;if(!Z||p)return;const F=D.id,q=Z.id;if(P(F))return;const ce=A(F),ee=r.find(V=>V.key===q||V.id===q),ue=(ee==null?void 0:ee.key)??A(q);!ce||!ue||ce===ue||u(V=>{const le=[...V[ce]??[]],pe=[...V[ue]??[]],we=le.findIndex(ye=>ye.id===F);if(we===-1)return V;const[_e]=le.splice(we,1),H={..._e,status:ue};if(ee)pe.push(H);else{const ye=pe.findIndex(De=>De.id===q);if(ye===-1)pe.push(H);else{const De=D.rect.current.translated!=null&&D.rect.current.translated.top>Z.rect.top+Z.rect.height/2;pe.splice(De?ye+1:ye,0,H)}}return{...V,[ce]:le,[ue]:pe}})},K=I=>{var V;const{active:D,over:Z}=I;if(m(null),b.current=!1,p){if(x(null),!Z||D.id===Z.id)return;const le=l.indexOf(D.id),pe=l.indexOf(Z.id);if(le===-1||pe===-1||le===pe)return;const we=dd(l,le,pe);c(we),s==null||s(we);return}if(!Z){const le=k.current;k.current=null,le&&u(jm(e,r));return}const F=D.id,q=Z.id,ce=k.current;k.current=null;const ee=r.find(le=>le.key===q||le.id===q),ue=(ee==null?void 0:ee.key)??A(q);if(!(!ce||!ue))if(ce===ue)u(le=>{const pe=le[ce]??[],we=pe.findIndex(H=>H.id===F),_e=pe.findIndex(H=>H.id===q);return we===-1||_e===-1||we===_e?le:{...le,[ce]:dd(pe,we,_e)}});else{if(!r.find(we=>we.key===q||we.id===q))u(we=>{const _e=[...we[ue]??[]],H=_e.findIndex(Qe=>Qe.id===F);if(H===-1)return we;const ye=I.active.rect.current.translated!=null&&I.active.rect.current.translated.top>I.over.rect.top+I.over.rect.height/2,[De]=_e.splice(H,1),He=_e.findIndex(Qe=>Qe.id===q);if(He===-1)return _e.splice(H,0,De),we;const Fe=ye?He+1:He;return _e.splice(Fe,0,De),{...we,[ue]:_e}});else{const we=((V=I.active.rect.current.translated)==null?void 0:V.top)??1/0,_e=I.over.rect.top+I.over.rect.height/2;we<_e&&u(H=>{const ye=H[ue]??[],De=ye.findIndex(He=>He.id===F);return De<=0?H:{...H,[ue]:dd(ye,De,0)}})}const pe=S.getQueryData(_);S.setQueryData(_,we=>we&&{...we,issues:we.issues.map(_e=>_e.id===F?{..._e,status:ue}:_e)}),re.put(`/admin/issues/${F}`,{status:ue}).then(()=>{S.invalidateQueries({queryKey:_})}).catch(()=>{pe&&S.setQueryData(_,pe),u(jm((pe==null?void 0:pe.issues)??e,r)),B.error("Failed to update issue status")})}},se=I=>{v(I)},ae=async I=>{if(!g)return;const D=d[g.key]??[];if(D.length>0){const Z=r.find(F=>F.id===I);if(!Z)return;try{await Promise.all(D.map(F=>re.put(`/admin/issues/${F.id}`,{status:Z.key}))),S.invalidateQueries({queryKey:Tt.byProject(t)})}catch{B.error("Failed to move issues");return}}C.mutate(g.id,{onSuccess:()=>{B.success(`Status "${g.name}" deleted`),v(null)},onError:()=>B.error("Failed to delete status")})},W=()=>{const I=N.trim();!I||!y||T.mutate({name:I},{onSuccess:()=>{B.success("Status renamed"),j(null)},onError:()=>B.error("Failed to rename status")})},Y=()=>{j(null)},te=p?r.find(I=>I.id===p):null;return a.jsxs(ul,{sensors:R,collisionDetection:E,onDragStart:U,onDragOver:Q,onDragEnd:K,children:[a.jsxs("div",{className:"flex gap-4 min-h-full overflow-x-auto px-6 py-4 pb-6",children:[a.jsx(zp,{items:l,strategy:Zj,children:O.map(I=>a.jsx(qI,{id:I.id,label:I.name,color:I.color,category:I.category,issues:d[I.key]??[],childCounts:M,sortable:!0,onIssueClick:n,onRename:i?void 0:()=>{j(I.id),w(I.name)},onDelete:i?void 0:()=>se(I),isRenaming:y===I.id,renameValue:y===I.id?N:"",onRenameChange:w,onRenameSubmit:W,onRenameCancel:Y},I.id))}),!i&&a.jsx(YI,{projectId:t})]}),a.jsxs(sE,{children:[f&&a.jsx(IN,{issue:f}),te&&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:te.color}}),te.name]})})]}),g&&a.jsx(GI,{open:!!g,statusName:g.name,issueCount:((X=d[g.key])==null?void 0:X.length)??0,otherStatuses:r.filter(I=>I.id!==g.id),onConfirm:ae,onCancel:()=>v(null),isLoading:C.isPending})]})}const Ot=PM,Pt=MM,St=h.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>a.jsx(OM,{children:a.jsx(qj,{ref:s,align:t,sideOffset:r,className:$("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})}));St.displayName=qj.displayName;const XI=[{value:"urgent",label:"Urgent"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"},{value:"none",label:"None"}],QI=[{value:"bug",label:"Bug"},{value:"feature",label:"Feature"},{value:"task",label:"Task"},{value:"epic",label:"Epic"},{value:"story",label:"Story"}];function Lc({label:e,activeCount:t,children:r}){const[n,s]=h.useState(!1);return a.jsxs(Ot,{open:n,onOpenChange:s,children:[a.jsx(Pt,{asChild:!0,children:a.jsxs("button",{className:$("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(ra,{className:"h-3 w-3 opacity-60"})]})}),a.jsx(St,{className:"w-48 p-1",align:"start",children:r})]})}function Nm({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:$("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(ir,{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 ZI({statuses:e,members:t,filters:r,onChange:n}){var c,d,u,f,m,p,x;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=(g,v)=>{const y=r[g]??[],j=y.includes(v)?y.filter(N=>N!==v):[...y,v];n({...r,[g]:j.length?j:void 0})},o=g=>{n({...r,assignee_id:r.assignee_id===g?void 0:g})},l=r.assignee_id?((f=t.find(g=>g.userId===r.assignee_id))==null?void 0:f.name)??"Assignee":"Assignee";return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Lc,{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(g=>{const v=r.assignee_id===g.userId;return a.jsxs("button",{onClick:()=>o(g.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:$("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(ir,{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:g.initials}),a.jsx("span",{className:"truncate",children:g.name})]},g.userId)})]})}),a.jsx(Lc,{label:"Priority",activeCount:((m=r.priority)==null?void 0:m.length)??0,children:a.jsx(Nm,{options:XI,selected:r.priority??[],onToggle:g=>i("priority",g)})}),a.jsx(Lc,{label:"Type",activeCount:((p=r.type)==null?void 0:p.length)??0,children:a.jsx(Nm,{options:QI,selected:r.type??[],onToggle:g=>i("type",g)})}),a.jsx(Lc,{label:"Status",activeCount:((x=r.status)==null?void 0:x.length)??0,children:a.jsx(Nm,{options:e.map(g=>({value:g.key,label:g.name,color:g.color})),selected:r.status??[],onToggle:g=>i("status",g)})}),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(st,{className:"h-3 w-3"}),"Clear"]})]})}const JI={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function px(){return We({queryKey:["org","calendar"],queryFn:()=>re.get("/admin/org/calendar"),select:e=>({working_days:e.working_days??JI,timezone:e.timezone})})}function e4(){const e=Ne();return ge({mutationFn:t=>re.put("/admin/org/calendar",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","calendar"]})}})}function xx(e){const t=e??new Date().getFullYear();return We({queryKey:["org","holidays",t],queryFn:()=>re.get(`/admin/org/holidays?year=${t}`),select:r=>r.holidays})}function t4(){const e=Ne();return ge({mutationFn:t=>re.post("/admin/org/holidays",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function r4(){const e=Ne();return ge({mutationFn:({id:t,...r})=>re.put(`/admin/org/holidays/${t}`,r),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function n4(){const e=Ne();return ge({mutationFn:t=>re.delete(`/admin/org/holidays/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function a4(){return We({queryKey:["app-config"],queryFn:()=>re.get("/admin/config"),staleTime:1/0})}const s4=["sun","mon","tue","wed","thu","fri","sat"];function i4(e,t,r){const n=s4[bI(e)];if(!t[n])return!1;const s=fd(e),i=fl(e);for(const o of r){const l=new Date(o.date);if(o.recurring){if(fd(l)===s&&fl(l)===i)return!1}else if(l.getFullYear()===e.getFullYear()&&fd(l)===s&&fl(l)===i)return!1}return!0}function jh(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;)i4(i,r,n)&&s++,i=Lr(i,1);return s}const Yi={all:["sprints"],byProject:e=>["sprints","project",e],detail:e=>["sprints",e]};function bo(e){return We({queryKey:e?Yi.byProject(e):Yi.all,queryFn:()=>{const t=e?`/admin/sprints?project_id=${e}`:"/admin/sprints";return re.get(t)},select:t=>t.sprints,enabled:!!e})}function o4(e){const t=Ne();return ge({mutationFn:r=>re.post("/admin/sprints",{...r,project_id:e}),onSuccess:()=>{t.invalidateQueries({queryKey:Yi.byProject(e)})}})}function l4(e,t){const r=Ne();return ge({mutationFn:n=>re.put(`/admin/sprints/${e}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:Yi.byProject(t)}),r.invalidateQueries({queryKey:Yi.detail(e)})}})}function c4(e){const t=Ne();return ge({mutationFn:r=>re.delete(`/admin/sprints/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Yi.byProject(e)})}})}const Xu={byProject:e=>["task-lists","project",e]};function lc(e){return We({queryKey:e?Xu.byProject(e):["task-lists"],queryFn:()=>re.get(`/admin/projects/${e}/task-lists`),select:t=>t.task_lists,enabled:!!e})}function d4(e){const t=Ne();return ge({mutationFn:r=>re.post(`/admin/projects/${e}/task-lists`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Xu.byProject(e)})}})}function u4(e){const t=Ne();return ge({mutationFn:({id:r,...n})=>re.put(`/admin/task-lists/${r}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Xu.byProject(e)})}})}function f4(e){const t=Ne();return ge({mutationFn:r=>re.delete(`/admin/task-lists/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Xu.byProject(e)}),t.invalidateQueries({queryKey:Tt.byProject(e)})}})}function oy(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 ly(e,t,r){return`${e??""} ${t??""}`.trim()||r}function cc({value:e,onChange:t,disabled:r,users:n}){const[s,i]=h.useState(!1),[o,l]=h.useState(e),{data:c}=oc(),d=n??c??[],u=e.slice().sort().join(",");h.useEffect(()=>{l(e)},[u]);const f=p=>{const x=o.includes(p)?o.filter(g=>g!==p):[...o,p];l(x),t(x)},m=d.filter(p=>o.includes(p.id));return a.jsxs(Ot,{open:s,onOpenChange:i,children:[a.jsx(Pt,{asChild:!0,disabled:r,children:a.jsx("button",{type:"button",className:$("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:m.length===0?a.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[a.jsx(co,{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:m.slice(0,3).map(p=>a.jsx(Ft,{className:"h-5 w-5 border border-background ring-0",children:a.jsx(Bt,{className:"text-[9px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:oy(p.first_name,p.last_name,p.email)})},p.id))}),m.length>3&&a.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",m.length-3]}),a.jsx("span",{className:"text-xs text-foreground ml-1 hidden sm:inline",children:m.length===1?ly(m[0].first_name,m[0].last_name,m[0].email):`${m.length} assignees`})]})})}),a.jsx(St,{className:"w-60 p-0",align:"start",children:a.jsxs(Ks,{children:[a.jsx(Hu,{placeholder:"Search users...",className:"h-8 text-xs"}),a.jsxs(Ys,{children:[a.jsx(Ku,{className:"text-xs py-4",children:"No users found."}),a.jsx(rs,{children:d.map(p=>{const x=o.includes(p.id),g=ly(p.first_name,p.last_name,p.email),v=oy(p.first_name,p.last_name,p.email);return a.jsxs(sn,{value:g,onSelect:()=>f(p.id),className:"gap-2 py-1.5",children:[a.jsx(Ft,{className:"h-5 w-5 shrink-0",children:a.jsx(Bt,{className:"text-[9px] bg-muted text-muted-foreground",children:v})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-xs font-medium truncate",children:g}),a.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:p.email})]}),a.jsx(ir,{className:$("h-3.5 w-3.5 shrink-0",x?"opacity-100 text-indigo-500":"opacity-0")})]},p.id)})})]})]})})]})}function m4(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 km={},sl={};function Bs(e,t){try{const n=(km[e]||(km[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return n in sl?sl[n]:cy(n,n.split(":"))}catch{if(e in sl)return sl[e];const r=e==null?void 0:e.match(h4);return r?cy(e,r.slice(1)):NaN}}const h4=/([+-]\d\d):?(\d\d)?/;function cy(e,t){const r=+(t[0]||0),n=+(t[1]||0),s=+(t[2]||0)/60;return sl[e]=r*60+n>0?r*60+n+s:r*60-n-s}class qn extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Bs(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)),$N(this),Nh(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new qn(...r,t):new qn(Date.now(),t)}withTimeZone(t){return new qn(+this,t)}getTimezoneOffset(){const t=-Bs(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Nh(this),+this}[Symbol.for("constructDateFrom")](t){return new qn(+new Date(t),this.timeZone)}}const dy=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!dy.test(e))return;const t=e.replace(dy,"$1UTC");qn.prototype[t]&&(e.startsWith("get")?qn.prototype[e]=function(){return this.internal[t]()}:(qn.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),p4(this),+this},qn.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Nh(this),+this}))});function Nh(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Bs(e.timeZone,e)*60))}function p4(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()),$N(e)}function $N(e){const t=Bs(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(-(Bs(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=Bs(e.timeZone,e),p=m>0?Math.floor(m):Math.ceil(m),g=-new Date(+e).getTimezoneOffset()-p,v=p!==r,y=g-c;if(v&&y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y);const j=Bs(e.timeZone,e),N=j>0?Math.floor(j):Math.ceil(j),w=p-N;w&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+w),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+w))}}class ur extends qn{static tz(t,...r){return r.length?new ur(...r,t):new ur(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} (${m4(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 ur(+this,t)}[Symbol.for("constructDateFrom")](t){return new ur(+new Date(t),this.timeZone)}}const uy=5,x4=4;function g4(e,t){const r=t.startOfMonth(e),n=r.getDay()>0?r.getDay():7,s=t.addDays(e,-n+1),i=t.addDays(s,uy*7-1);return t.getMonth(e)===t.getMonth(i)?uy:x4}function zN(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 v4(e,t){const r=zN(e,t),n=g4(e,t);return t.addDays(r,n*7-1)}const LN={...zs,labels:{labelDayButton:(e,t,r,n)=>{let s;n&&typeof n.format=="function"?s=n.format.bind(n):s=(o,l)=>me(o,l,{locale:zs,...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)=>me(s,i,{locale:zs,...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)=>me(o,l,{locale:zs,...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)=>me(s,i,{locale:zs,...t}),n(e,"cccc")}}};class Zr{constructor(t,r){this.Date=Date,this.today=()=>{var n;return(n=this.overrides)!=null&&n.today?this.overrides.today():this.options.timeZone?ur.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 ur(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):Lr(n,s)},this.addMonths=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(n,s):lx(n,s)},this.addWeeks=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(n,s):u3(n,s)},this.addYears=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(n,s):f3(n,s)},this.differenceInCalendarDays=(n,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(n,s):Gu(n,s)},this.differenceInCalendarMonths=(n,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(n,s):dx(n,s)},this.eachMonthOfInterval=n=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(n):b3(n)},this.eachYearOfInterval=n=>{var l;const s=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(n):j3(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):v4(n,this)},this.endOfISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(n):N3(n)},this.endOfMonth=n=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(n):ux(n)},this.endOfWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(n,s):EN(n,this.options)},this.endOfYear=n=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(n):w3(n)},this.format=(n,s,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(n,s,this.options):me(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):fx(n)},this.getMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(n,this.options):fd(n,this.options)},this.getYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(n,this.options):wI(n,this.options)},this.getWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(n,this.options):mx(n,this.options)},this.isAfter=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(n,s):jI(n,s)},this.isBefore=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(n,s):NI(n,s)},this.isDate=n=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(n):NN(n)},this.isSameDay=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(n,s):Ki(n,s)},this.isSameMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(n,s):kI(n,s)},this.isSameYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(n,s):SI(n,s)},this.max=n=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(n):m3(n)},this.min=n=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(n):h3(n)},this.setMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(n,s):OI(n,s)},this.setYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(n,s):PI(n,s)},this.startOfBroadcastWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(n,this):zN(n,this)},this.startOfDay=n=>{var s;return(s=this.overrides)!=null&&s.startOfDay?this.overrides.startOfDay(n):Hi(n)},this.startOfISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.startOfISOWeek?this.overrides.startOfISOWeek(n):gl(n)},this.startOfMonth=n=>{var s;return(s=this.overrides)!=null&&s.startOfMonth?this.overrides.startOfMonth(n):PN(n)},this.startOfWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(n,this.options):qi(n,this.options)},this.startOfYear=n=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(n):MN(n)},this.options={locale:LN,...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&&Zr.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&&Zr.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)}}Zr.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 oa=new Zr;class FN{constructor(t,r,n=oa){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 y4{constructor(t,r){this.date=t,this.weeks=r}}class b4{constructor(t,r){this.days=r,this.weekNumber=t}}function w4(e){return z.createElement("button",{...e})}function j4(e){return z.createElement("span",{...e})}function N4(e){const{size:t=24,orientation:r="left",className:n}=e;return z.createElement("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24"},r==="up"&&z.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),r==="down"&&z.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),r==="left"&&z.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),r==="right"&&z.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function k4(e){const{day:t,modifiers:r,...n}=e;return z.createElement("td",{...n})}function S4(e){const{day:t,modifiers:r,...n}=e,s=z.useRef(null);return z.useEffect(()=>{var i;r.focused&&((i=s.current)==null||i.focus())},[r.focused]),z.createElement("button",{ref:s,...n})}var Oe;(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"})(Oe||(Oe={}));var bt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(bt||(bt={}));var Nn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Nn||(Nn={}));var Yr;(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"})(Yr||(Yr={}));function C4(e){const{options:t,className:r,components:n,classNames:s,...i}=e,o=[s[Oe.Dropdown],r].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return z.createElement("span",{"data-disabled":i.disabled,className:s[Oe.DropdownRoot]},z.createElement(n.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:u})=>z.createElement(n.Option,{key:c,value:c,disabled:u},d))),z.createElement("span",{className:s[Oe.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,z.createElement(n.Chevron,{orientation:"down",size:18,className:s[Oe.Chevron]})))}function _4(e){return z.createElement("div",{...e})}function O4(e){return z.createElement("div",{...e})}function P4(e){const{calendarMonth:t,displayIndex:r,...n}=e;return z.createElement("div",{...n},e.children)}function M4(e){const{calendarMonth:t,displayIndex:r,...n}=e;return z.createElement("div",{...n})}function E4(e){return z.createElement("table",{...e})}function A4(e){return z.createElement("div",{...e})}const BN=h.createContext(void 0);function dc(){const e=h.useContext(BN);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function D4(e){const{components:t}=dc();return z.createElement(t.Dropdown,{...e})}function T4(e){const{onPreviousClick:t,onNextClick:r,previousMonth:n,nextMonth:s,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=dc(),u=h.useCallback(m=>{s&&(r==null||r(m))},[s,r]),f=h.useCallback(m=>{n&&(t==null||t(m))},[n,t]);return z.createElement("nav",{...i},z.createElement(o.PreviousMonthButton,{type:"button",className:l[Oe.PreviousMonthButton],tabIndex:n?void 0:-1,"aria-disabled":n?void 0:!0,"aria-label":c(n),onClick:f},z.createElement(o.Chevron,{disabled:n?void 0:!0,className:l[Oe.Chevron],orientation:"left"})),z.createElement(o.NextMonthButton,{type:"button",className:l[Oe.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":d(s),onClick:u},z.createElement(o.Chevron,{disabled:s?void 0:!0,orientation:"right",className:l[Oe.Chevron]})))}function I4(e){const{components:t}=dc();return z.createElement(t.Button,{...e})}function R4(e){return z.createElement("option",{...e})}function $4(e){const{components:t}=dc();return z.createElement(t.Button,{...e})}function z4(e){const{rootRef:t,...r}=e;return z.createElement("div",{...r,ref:t})}function L4(e){return z.createElement("select",{...e})}function F4(e){const{week:t,...r}=e;return z.createElement("tr",{...r})}function B4(e){return z.createElement("th",{...e})}function W4(e){return z.createElement("thead",{"aria-hidden":!0},z.createElement("tr",{...e}))}function U4(e){const{week:t,...r}=e;return z.createElement("th",{...r})}function q4(e){return z.createElement("th",{...e})}function H4(e){return z.createElement("tbody",{...e})}function K4(e){const{components:t}=dc();return z.createElement(t.Dropdown,{...e})}const Y4=Object.freeze(Object.defineProperty({__proto__:null,Button:w4,CaptionLabel:j4,Chevron:N4,Day:k4,DayButton:S4,Dropdown:C4,DropdownNav:_4,Footer:O4,Month:P4,MonthCaption:M4,MonthGrid:E4,Months:A4,MonthsDropdown:D4,Nav:T4,NextMonthButton:I4,Option:R4,PreviousMonthButton:$4,Root:z4,Select:L4,Week:F4,WeekNumber:U4,WeekNumberHeader:q4,Weekday:B4,Weekdays:W4,Weeks:H4,YearsDropdown:K4},Symbol.toStringTag,{value:"Module"}));function ga(e,t,r=!1,n=oa){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 gx(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Qu(e){return!!(e&&typeof e=="object"&&"from"in e)}function vx(e){return!!(e&&typeof e=="object"&&"after"in e)}function yx(e){return!!(e&&typeof e=="object"&&"before"in e)}function WN(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function UN(e,t){return Array.isArray(e)&&e.every(t.isDate)}function va(e,t,r=oa){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(UN(l,r))return l.some(c=>s(e,c));if(Qu(l))return ga(l,e,!1,r);if(WN(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(gx(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 vx(l)?i(e,l.after)>0:yx(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function G4(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:p,isBefore:x,endOfMonth:g,isAfter:v}=s,y=r&&p(r),j=n&&g(n),N={[bt.focused]:[],[bt.outside]:[],[bt.disabled]:[],[bt.hidden]:[],[bt.today]:[]},w={};for(const k of e){const{date:b,displayMonth:S}=k,_=!!(S&&!m(b,S)),C=!!(y&&x(b,y)),T=!!(j&&v(b,j)),M=!!(i&&va(b,i,s)),O=!!(o&&va(b,o,s))||C||T||!d&&!c&&_||d&&c===!1&&_,R=f(b,u);_&&N.outside.push(k),M&&N.disabled.push(k),O&&N.hidden.push(k),R&&N.today.push(k),l&&Object.keys(l).forEach(E=>{const A=l==null?void 0:l[E];A&&va(b,A,s)&&(w[E]?w[E].push(k):w[E]=[k])})}return k=>{const b={[bt.focused]:!1,[bt.disabled]:!1,[bt.hidden]:!1,[bt.outside]:!1,[bt.today]:!1},S={};for(const _ in N){const C=N[_];b[_]=C.some(T=>T===k)}for(const _ in w)S[_]=w[_].some(C=>C===k);return{...b,...S}}}function V4(e,t,r={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[i])=>(r[i]?s.push(r[i]):t[bt[i]]?s.push(t[bt[i]]):t[Nn[i]]&&s.push(t[Nn[i]]),s),[t[Oe.Day]])}function X4(e){return{...Y4,...e}}function Q4(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 Z4(){const e={};for(const t in Oe)e[Oe[t]]=`rdp-${Oe[t]}`;for(const t in bt)e[bt[t]]=`rdp-${bt[t]}`;for(const t in Nn)e[Nn[t]]=`rdp-${Nn[t]}`;for(const t in Yr)e[Yr[t]]=`rdp-${Yr[t]}`;return e}function qN(e,t,r){return(r??new Zr(t)).formatMonthYear(e)}const J4=qN;function eR(e,t,r){return(r??new Zr(t)).format(e,"d")}function tR(e,t=oa){return t.format(e,"LLLL")}function rR(e,t,r){return(r??new Zr(t)).format(e,"cccccc")}function nR(e,t=oa){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function aR(){return""}function HN(e,t=oa){return t.format(e,"yyyy")}const sR=HN,iR=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:qN,formatDay:eR,formatMonthCaption:J4,formatMonthDropdown:tR,formatWeekNumber:nR,formatWeekNumberHeader:aR,formatWeekdayName:rR,formatYearCaption:sR,formatYearDropdown:HN},Symbol.toStringTag,{value:"Module"}));function oR(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...iR,...e}}function bx(e,t,r,n){let s=(n??new Zr(r)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const lR=bx;function wx(e,t,r){return(r??new Zr(t)).formatMonthYear(e)}const cR=wx;function KN(e,t,r,n){let s=(n??new Zr(r)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function YN(e){return"Choose the Month"}function GN(){return""}const dR="Go to the Next Month";function VN(e,t){return dR}function XN(e){return"Go to the Previous Month"}function QN(e,t,r){return(r??new Zr(t)).format(e,"cccc")}function ZN(e,t){return`Week ${e}`}function JN(e){return"Week Number"}function ek(e){return"Choose the Year"}const uR=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:cR,labelDay:lR,labelDayButton:bx,labelGrid:wx,labelGridcell:KN,labelMonthDropdown:YN,labelNav:GN,labelNext:VN,labelPrevious:XN,labelWeekNumber:ZN,labelWeekNumberHeader:JN,labelWeekday:QN,labelYearDropdown:ek},Symbol.toStringTag,{value:"Module"})),vn=(e,t,r)=>t||(r?typeof r=="function"?r:(...n)=>r:e);function fR(e,t){var n;const r=((n=t.locale)==null?void 0:n.labels)??{};return{...uR,...e??{},labelDayButton:vn(bx,e==null?void 0:e.labelDayButton,r.labelDayButton),labelMonthDropdown:vn(YN,e==null?void 0:e.labelMonthDropdown,r.labelMonthDropdown),labelNext:vn(VN,e==null?void 0:e.labelNext,r.labelNext),labelPrevious:vn(XN,e==null?void 0:e.labelPrevious,r.labelPrevious),labelWeekNumber:vn(ZN,e==null?void 0:e.labelWeekNumber,r.labelWeekNumber),labelYearDropdown:vn(ek,e==null?void 0:e.labelYearDropdown,r.labelYearDropdown),labelGrid:vn(wx,e==null?void 0:e.labelGrid,r.labelGrid),labelGridcell:vn(KN,e==null?void 0:e.labelGridcell,r.labelGridcell),labelNav:vn(GN,e==null?void 0:e.labelNav,r.labelNav),labelWeekNumberHeader:vn(JN,e==null?void 0:e.labelWeekNumberHeader,r.labelWeekNumberHeader),labelWeekday:vn(QN,e==null?void 0:e.labelWeekday,r.labelWeekday)}}function mR(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 p=n.formatMonthDropdown(m,s),x=d(m),g=t&&m<i(t)||r&&m>i(r)||!1;return{value:x,label:p,disabled:g}})}function hR(e,t={},r={}){let n={...t==null?void 0:t[Oe.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{n={...n,...r==null?void 0:r[s]}}),n}function pR(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 xR(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 p=r.formatYearDropdown(m,n);return{value:c(m),label:p,disabled:!1}})}function gR(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 ur(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(ur.tz(e)),newDate:(c,d,u)=>new ur(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),p=((((d==null?void 0:d.weekStartsOn)??s)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+p),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 ur(d.getFullYear(),d.getMonth(),1,12,0,0,e),p=u.getFullYear()*12+u.getMonth();for(;m.getFullYear()*12+m.getMonth()<=p;)f.push(new ur(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 ur(d.getFullYear(),0,1,12,0,0,e);for(;m.getFullYear()<=u.getFullYear();)f.push(new ur(m,e)),m.setFullYear(m.getFullYear()+1,0,1);return f},getWeek:(c,d)=>{var f;const u=o(c);return mx(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 fx(d)},differenceInCalendarDays:(c,d)=>{const u=o(c),f=o(d);return Gu(u,f)},differenceInCalendarMonths:(c,d)=>{const u=o(c),f=o(d);return dx(u,f)}}}const uc=e=>e instanceof HTMLElement?e:null,Sm=e=>[...e.querySelectorAll("[data-animated-month]")??[]],vR=e=>uc(e.querySelector("[data-animated-month]")),Cm=e=>uc(e.querySelector("[data-animated-caption]")),_m=e=>uc(e.querySelector("[data-animated-weeks]")),yR=e=>uc(e.querySelector("[data-animated-nav]")),bR=e=>uc(e.querySelector("[data-animated-weekdays]"));function wR(e,t,{classNames:r,months:n,focused:s,dateLib:i}){const o=h.useRef(null),l=h.useRef(n),c=h.useRef(!1);h.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[Yr.caption_after_enter]:r[Yr.caption_before_enter],p=f?r[Yr.weeks_after_enter]:r[Yr.weeks_before_enter],x=o.current,g=e.current.cloneNode(!0);if(g instanceof HTMLElement?(Sm(g).forEach(N=>{if(!(N instanceof HTMLElement))return;const w=vR(N);w&&N.contains(w)&&N.removeChild(w);const k=Cm(N);k&&k.classList.remove(m);const b=_m(N);b&&b.classList.remove(p)}),o.current=g):o.current=null,c.current||u||s)return;const v=x instanceof HTMLElement?Sm(x):[],y=Sm(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=yR(e.current);j&&(j.style.zIndex="1"),y.forEach((N,w)=>{const k=v[w];if(!k)return;N.style.position="relative",N.style.overflow="hidden";const b=Cm(N);b&&b.classList.add(m);const S=_m(N);S&&S.classList.add(p);const _=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),j&&(j.style.zIndex=""),b&&b.classList.remove(m),S&&S.classList.remove(p),N.style.position="",N.style.overflow="",N.contains(k)&&N.removeChild(k)};k.style.pointerEvents="none",k.style.position="absolute",k.style.overflow="hidden",k.setAttribute("aria-hidden","true");const C=bR(k);C&&(C.style.opacity="0");const T=Cm(k);T&&(T.classList.add(f?r[Yr.caption_before_exit]:r[Yr.caption_after_exit]),T.addEventListener("animationend",_));const M=_m(k);M&&M.classList.add(f?r[Yr.weeks_before_exit]:r[Yr.weeks_after_exit]),N.insertBefore(k,N.firstChild)})}})}function jR(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:p,endOfMonth:x,endOfWeek:g,isAfter:v,startOfBroadcastWeek:y,startOfISOWeek:j,startOfWeek:N}=n,w=c?y(s,n):o?j(s):N(s),k=c?m(i):o?p(x(i)):g(x(i)),b=t&&(c?m(t):o?p(t):g(t)),S=b&&v(k,b)?b:k,_=u(S,w),C=f(i,s)+1,T=[];for(let R=0;R<=_;R++){const E=d(w,R);T.push(E)}const O=(c?35:42)*C;if(l&&T.length<O){const R=O-T.length;for(let E=0;E<R;E++){const A=d(T[T.length-1],1);T.push(A)}}return T}function NR(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 kR(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 fy(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 SR(e,t,r,n){const{addDays:s,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:u,startOfBroadcastWeek:f,startOfISOWeek:m,startOfWeek:p}=n,x=e.reduce((g,v)=>{const y=r.broadcastCalendar?f(v,n):r.ISOWeek?m(v):p(v),j=r.broadcastCalendar?i(v):r.ISOWeek?o(l(v)):c(l(v)),N=t.filter(S=>S>=y&&S<=j),w=r.broadcastCalendar?35:42;if(r.fixedWeeks&&N.length<w){const S=t.filter(_=>{const C=w-N.length;return _>j&&_<=s(j,C)});N.push(...S)}const k=N.reduce((S,_)=>{const C=r.ISOWeek?d(_):u(_),T=S.find(O=>O.weekNumber===C),M=new FN(_,v,n);return T?T.days.push(M):S.push(new b4(C,[M])),S},[]),b=new y4(v,k);return g.push(b),g},[]);return r.reverseMonths?x.reverse():x}function CR(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:p,fromMonth:x,toMonth:g}=e;!r&&x&&(r=x),!r&&m&&(r=t.newDate(m,0,1)),!n&&g&&(n=g),!n&&p&&(n=u(p,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):p?n=u(p,11,31):!n&&v&&(n=d(e.today??f())),[r&&i(r),n&&i(n)]}function _R(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 OR(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 PR(e){const t=[];return e.reduce((r,n)=>r.concat(n.weeks.slice()),t.slice())}function Zu(e,t){const[r,n]=h.useState(e);return[t===void 0?r:t,n]}function MR(e,t){var w;const[r,n]=CR(e,t),{startOfMonth:s,endOfMonth:i}=t,o=fy(e,r,n,t),[l,c]=Zu(o,e.month?o:void 0);h.useEffect(()=>{const k=fy(e,r,n,t);c(k)},[e.timeZone]);const{months:d,weeks:u,days:f,previousMonth:m,nextMonth:p}=h.useMemo(()=>{const k=kR(l,n,{numberOfMonths:e.numberOfMonths},t),b=jR(k,e.endMonth?i(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),S=SR(k,b,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),_=PR(S),C=NR(S),T=OR(l,r,e,t),M=_R(l,n,e,t);return{months:S,weeks:_,days:C,previousMonth:T,nextMonth:M}},[t,l.getTime(),n==null?void 0:n.getTime(),r==null?void 0:r.getTime(),e.disableNavigation,e.broadcastCalendar,(w=e.endMonth)==null?void 0:w.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:x,onMonthChange:g}=e,v=k=>u.some(b=>b.days.some(S=>S.isEqualTo(k))),y=k=>{if(x)return;let b=s(k);r&&b<s(r)&&(b=s(r)),n&&b>s(n)&&(b=s(n)),c(b),g==null||g(b)};return{months:d,weeks:u,days:f,navStart:r,navEnd:n,previousMonth:m,nextMonth:p,goToMonth:y,goToDay:k=>{v(k)||y(k.date)}}}var Wn;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Wn||(Wn={}));function my(e){return!e[bt.disabled]&&!e[bt.hidden]&&!e[bt.outside]}function ER(e,t,r,n){let s,i=-1;for(const o of e){const l=t(o);my(l)&&(l[bt.focused]&&i<Wn.FocusedModifier?(s=o,i=Wn.FocusedModifier):n!=null&&n.isEqualTo(o)&&i<Wn.LastFocused?(s=o,i=Wn.LastFocused):r(o.date)&&i<Wn.Selected?(s=o,i=Wn.Selected):l[bt.today]&&i<Wn.Today&&(s=o,i=Wn.Today))}return s||(s=e.find(o=>my(t(o)))),s}function AR(e,t,r,n,s,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:u,addWeeks:f,addYears:m,endOfBroadcastWeek:p,endOfISOWeek:x,endOfWeek:g,max:v,min:y,startOfBroadcastWeek:j,startOfISOWeek:N,startOfWeek:w}=o;let b={day:d,week:f,month:u,year:m,startOfWeek:S=>c?j(S,o):l?N(S):w(S),endOfWeek:S=>c?p(S):l?x(S):g(S)}[e](r,t==="after"?1:-1);return t==="before"&&n?b=v([n,b]):t==="after"&&s&&(b=y([s,b])),b}function tk(e,t,r,n,s,i,o,l=0){if(l>365)return;const c=AR(e,t,r.date,n,s,i,o),d=!!(i.disabled&&va(c,i.disabled,o)),u=!!(i.hidden&&va(c,i.hidden,o)),f=c,m=new FN(c,f,o);return!d&&!u?m:tk(e,t,m,n,s,i,o,l+1)}function DR(e,t,r,n,s){const{autoFocus:i}=e,[o,l]=h.useState(),c=ER(t.days,r,n||(()=>!1),o),[d,u]=h.useState(i?c:void 0);return{isFocusTarget:g=>!!(c!=null&&c.isEqualTo(g)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(g,v)=>{if(!d)return;const y=tk(g,v,d,t.navStart,t.navEnd,e,s);y&&(e.disableNavigation&&!t.days.some(N=>N.isEqualTo(y))||(t.goToDay(y),u(y)))}}}function TR(e,t){const{selected:r,required:n,onSelect:s}=e,[i,o]=Zu(r,s?r:void 0),l=s?r:i,{isSameDay:c}=t,d=p=>(l==null?void 0:l.some(x=>c(x,p)))??!1,{min:u,max:f}=e;return{selected:l,select:(p,x,g)=>{let v=[...l??[]];if(d(p)){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,p))}else(l==null?void 0:l.length)===f?v=[p]:v=[...v,p];return s||o(v),s==null||s(v,p,x,g),v},isSelected:d}}function IR(e,t,r=0,n=0,s=!1,i=oa){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 RR(e,t,r=oa){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 hy(e,t,r=oa){return ga(e,t.from,!1,r)||ga(e,t.to,!1,r)||ga(t,e.from,!1,r)||ga(t,e.to,!1,r)}function $R(e,t,r=oa){const n=Array.isArray(t)?t:[t];if(n.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:r.isDate(l)?ga(e,l,!1,r):UN(l,r)?l.some(c=>ga(e,c,!1,r)):Qu(l)?l.from&&l.to?hy(e,{from:l.from,to:l.to},r):!1:WN(l)?RR(e,l.dayOfWeek,r):gx(l)?r.isAfter(l.before,l.after)?hy(e,{from:r.addDays(l.after,1),to:r.addDays(l.before,-1)},r):va(e.from,l,r)||va(e.to,l,r):vx(l)||yx(l)?va(e.from,l,r)||va(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 zR(e,t){const{disabled:r,excludeDisabled:n,selected:s,required:i,onSelect:o}=e,[l,c]=Zu(s,o?s:void 0),d=o?s:l;return{selected:d,select:(m,p,x)=>{const{min:g,max:v}=e,y=m?IR(m,d,g,v,i,t):void 0;return n&&r&&(y!=null&&y.from)&&y.to&&$R({from:y.from,to:y.to},r,t)&&(y.from=m,y.to=void 0),o||c(y),o==null||o(y,m,p,x),y},isSelected:m=>d&&ga(d,m,!1,t)}}function LR(e,t){const{selected:r,required:n,onSelect:s}=e,[i,o]=Zu(r,s?r:void 0),l=s?r:i,{isSameDay:c}=t;return{selected:l,select:(f,m,p)=>{let x=f;return!n&&l&&l&&c(f,l)&&(x=void 0),s||o(x),s==null||s(x,f,m,p),x},isSelected:f=>l?c(l,f):!1}}function FR(e,t){const r=LR(e,t),n=TR(e,t),s=zR(e,t);switch(e.mode){case"single":return r;case"multiple":return n;case"range":return s;default:return}}function an(e,t){return e instanceof ur&&e.timeZone===t?e:new ur(e,t)}function Ci(e,t,r){return an(e,t)}function py(e,t,r){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Ci(e,t):Array.isArray(e)?e.map(n=>n instanceof Date?Ci(n,t):n):Qu(e)?{...e,from:e.from?an(e.from,t):e.from,to:e.to?an(e.to,t):e.to}:gx(e)?{before:Ci(e.before,t),after:Ci(e.after,t)}:vx(e)?{after:Ci(e.after,t)}:yx(e)?{before:Ci(e.before,t)}:e}function Om(e,t,r){return e&&(Array.isArray(e)?e.map(n=>py(n,t)):py(e,t))}function BR(e){var Pe;let t=e;const r=t.timeZone;if(r&&(t={...e,timeZone:r},t.today&&(t.today=an(t.today,r)),t.month&&(t.month=an(t.month,r)),t.defaultMonth&&(t.defaultMonth=an(t.defaultMonth,r)),t.startMonth&&(t.startMonth=an(t.startMonth,r)),t.endMonth&&(t.endMonth=an(t.endMonth,r)),t.mode==="single"&&t.selected?t.selected=an(t.selected,r):t.mode==="multiple"&&t.selected?t.selected=(Pe=t.selected)==null?void 0:Pe.map(he=>an(he,r)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?an(t.selected.from,r):t.selected.from,to:t.selected.to?an(t.selected.to,r):t.selected.to}),t.disabled!==void 0&&(t.disabled=Om(t.disabled,r)),t.hidden!==void 0&&(t.hidden=Om(t.hidden,r)),t.modifiers)){const he={};Object.keys(t.modifiers).forEach(be=>{var fe;he[be]=Om((fe=t.modifiers)==null?void 0:fe[be],r)}),t.modifiers=he}const{components:n,formatters:s,labels:i,dateLib:o,locale:l,classNames:c}=h.useMemo(()=>{const he={...LN,...t.locale},be=t.broadcastCalendar?1:t.weekStartsOn,fe=t.noonSafe&&t.timeZone?gR(t.timeZone,{weekStartsOn:be,locale:he}):void 0,xe=t.dateLib&&fe?{...fe,...t.dateLib}:t.dateLib??fe,Ve=new Zr({locale:he,weekStartsOn:be,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},xe);return{dateLib:Ve,components:X4(t.components),formatters:oR(t.formatters),labels:fR(t.labels,Ve.options),locale:he,classNames:{...Z4(),...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:p,onDayClick:x,onDayFocus:g,onDayKeyDown:v,onDayMouseEnter:y,onDayMouseLeave:j,onNextClick:N,onPrevClick:w,showWeekNumber:k,styles:b}=t,{formatCaption:S,formatDay:_,formatMonthDropdown:C,formatWeekNumber:T,formatWeekNumberHeader:M,formatWeekdayName:O,formatYearDropdown:R}=s,E=MR(t,o),{days:A,months:P,navStart:U,navEnd:Q,previousMonth:K,nextMonth:se,goToMonth:ae}=E,W=G4(A,t,U,Q,o),{isSelected:Y,select:te,selected:X}=FR(t,o)??{},{blur:I,focused:D,isFocusTarget:Z,moveFocus:F,setFocused:q}=DR(t,E,W,Y??(()=>!1),o),{labelDayButton:ce,labelGridcell:ee,labelGrid:ue,labelMonthDropdown:V,labelNav:le,labelPrevious:pe,labelNext:we,labelWeekday:_e,labelWeekNumber:H,labelWeekNumberHeader:ye,labelYearDropdown:De}=i,He=h.useMemo(()=>pR(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),Fe=u!==void 0||x!==void 0,Qe=h.useCallback(()=>{K&&(ae(K),w==null||w(K))},[K,ae,w]),gt=h.useCallback(()=>{se&&(ae(se),N==null||N(se))},[ae,se,N]),Ge=h.useCallback((he,be)=>fe=>{fe.preventDefault(),fe.stopPropagation(),q(he),!be.disabled&&(te==null||te(he.date,be,fe),x==null||x(he.date,be,fe))},[te,x,q]),Ze=h.useCallback((he,be)=>fe=>{q(he),g==null||g(he.date,be,fe)},[g,q]),pr=h.useCallback((he,be)=>fe=>{I(),p==null||p(he.date,be,fe)},[I,p]),pn=h.useCallback((he,be)=>fe=>{const xe={ArrowLeft:[fe.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[fe.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[fe.shiftKey?"year":"week","after"],ArrowUp:[fe.shiftKey?"year":"week","before"],PageUp:[fe.shiftKey?"year":"month","before"],PageDown:[fe.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(xe[fe.key]){fe.preventDefault(),fe.stopPropagation();const[Ve,ie]=xe[fe.key];F(Ve,ie)}v==null||v(he.date,be,fe)},[F,v,t.dir]),Ar=h.useCallback((he,be)=>fe=>{y==null||y(he.date,be,fe)},[y]),xn=h.useCallback((he,be)=>fe=>{j==null||j(he.date,be,fe)},[j]),xr=h.useCallback(he=>be=>{const fe=Number(be.target.value),xe=o.setMonth(o.startOfMonth(he),fe);ae(xe)},[o,ae]),Ct=h.useCallback(he=>be=>{const fe=Number(be.target.value),xe=o.setYear(o.startOfMonth(he),fe);ae(xe)},[o,ae]),{className:Rt,style:Ht}=h.useMemo(()=>({className:[c[Oe.Root],t.className].filter(Boolean).join(" "),style:{...b==null?void 0:b[Oe.Root],...t.style}}),[c,t.className,t.style,b]),er=Q4(t),Dn=h.useRef(null);wR(Dn,!!t.animate,{classNames:c,months:P,focused:D,dateLib:o});const la={dayPickerProps:t,selected:X,select:te,isSelected:Y,months:P,nextMonth:se,previousMonth:K,goToMonth:ae,getModifiers:W,components:n,classNames:c,styles:b,labels:i,formatters:s};return z.createElement(BN.Provider,{value:la},z.createElement(n.Root,{rootRef:t.animate?Dn:void 0,className:Rt,style:Ht,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"],...er},z.createElement(n.Months,{className:c[Oe.Months],style:b==null?void 0:b[Oe.Months]},!t.hideNavigation&&!f&&z.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[Oe.Nav],style:b==null?void 0:b[Oe.Nav],"aria-label":le(),onPreviousClick:Qe,onNextClick:gt,previousMonth:K,nextMonth:se}),P.map((he,be)=>z.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:c[Oe.Month],style:b==null?void 0:b[Oe.Month],key:be,displayIndex:be,calendarMonth:he},f==="around"&&!t.hideNavigation&&be===0&&z.createElement(n.PreviousMonthButton,{type:"button",className:c[Oe.PreviousMonthButton],tabIndex:K?void 0:-1,"aria-disabled":K?void 0:!0,"aria-label":pe(K),onClick:Qe,"data-animated-button":t.animate?"true":void 0},z.createElement(n.Chevron,{disabled:K?void 0:!0,className:c[Oe.Chevron],orientation:t.dir==="rtl"?"right":"left"})),z.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:c[Oe.MonthCaption],style:b==null?void 0:b[Oe.MonthCaption],calendarMonth:he,displayIndex:be},d!=null&&d.startsWith("dropdown")?z.createElement(n.DropdownNav,{className:c[Oe.Dropdowns],style:b==null?void 0:b[Oe.Dropdowns]},(()=>{const fe=d==="dropdown"||d==="dropdown-months"?z.createElement(n.MonthsDropdown,{key:"month",className:c[Oe.MonthsDropdown],"aria-label":V(),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:xr(he.date),options:mR(he.date,U,Q,s,o),style:b==null?void 0:b[Oe.Dropdown],value:o.getMonth(he.date)}):z.createElement("span",{key:"month"},C(he.date,o)),xe=d==="dropdown"||d==="dropdown-years"?z.createElement(n.YearsDropdown,{key:"year",className:c[Oe.YearsDropdown],"aria-label":De(o.options),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:Ct(he.date),options:xR(U,Q,s,o,!!t.reverseYears),style:b==null?void 0:b[Oe.Dropdown],value:o.getYear(he.date)}):z.createElement("span",{key:"year"},R(he.date,o));return o.getMonthYearOrder()==="year-first"?[xe,fe]:[fe,xe]})(),z.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(he.date,o.options,o))):z.createElement(n.CaptionLabel,{className:c[Oe.CaptionLabel],role:"status","aria-live":"polite"},S(he.date,o.options,o))),f==="around"&&!t.hideNavigation&&be===m-1&&z.createElement(n.NextMonthButton,{type:"button",className:c[Oe.NextMonthButton],tabIndex:se?void 0:-1,"aria-disabled":se?void 0:!0,"aria-label":we(se),onClick:gt,"data-animated-button":t.animate?"true":void 0},z.createElement(n.Chevron,{disabled:se?void 0:!0,className:c[Oe.Chevron],orientation:t.dir==="rtl"?"left":"right"})),be===m-1&&f==="after"&&!t.hideNavigation&&z.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[Oe.Nav],style:b==null?void 0:b[Oe.Nav],"aria-label":le(),onPreviousClick:Qe,onNextClick:gt,previousMonth:K,nextMonth:se}),z.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":ue(he.date,o.options,o)||void 0,className:c[Oe.MonthGrid],style:b==null?void 0:b[Oe.MonthGrid]},!t.hideWeekdays&&z.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:c[Oe.Weekdays],style:b==null?void 0:b[Oe.Weekdays]},k&&z.createElement(n.WeekNumberHeader,{"aria-label":ye(o.options),className:c[Oe.WeekNumberHeader],style:b==null?void 0:b[Oe.WeekNumberHeader],scope:"col"},M()),He.map(fe=>z.createElement(n.Weekday,{"aria-label":_e(fe,o.options,o),className:c[Oe.Weekday],key:String(fe),style:b==null?void 0:b[Oe.Weekday],scope:"col"},O(fe,o.options,o)))),z.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:c[Oe.Weeks],style:b==null?void 0:b[Oe.Weeks]},he.weeks.map(fe=>z.createElement(n.Week,{className:c[Oe.Week],key:fe.weekNumber,style:b==null?void 0:b[Oe.Week],week:fe},k&&z.createElement(n.WeekNumber,{week:fe,style:b==null?void 0:b[Oe.WeekNumber],"aria-label":H(fe.weekNumber,{locale:l}),className:c[Oe.WeekNumber],scope:"row",role:"rowheader"},T(fe.weekNumber,o)),fe.days.map(xe=>{const{date:Ve}=xe,ie=W(xe);if(ie[bt.focused]=!ie.hidden&&!!(D!=null&&D.isEqualTo(xe)),ie[Nn.selected]=(Y==null?void 0:Y(Ve))||ie.selected,Qu(X)){const{from:tt,to:rt}=X;ie[Nn.range_start]=!!(tt&&rt&&o.isSameDay(Ve,tt)),ie[Nn.range_end]=!!(tt&&rt&&o.isSameDay(Ve,rt)),ie[Nn.range_middle]=ga(X,Ve,!0,o)}const Ce=hR(ie,b,t.modifiersStyles),Te=V4(ie,c,t.modifiersClassNames),vt=!Fe&&!ie.hidden?ee(Ve,ie,o.options,o):void 0;return z.createElement(n.Day,{key:`${xe.isoDate}_${xe.displayMonthId}`,day:xe,modifiers:ie,className:Te.join(" "),style:Ce,role:"gridcell","aria-selected":ie.selected||void 0,"aria-label":vt,"data-day":xe.isoDate,"data-month":xe.outside?xe.dateMonthId:void 0,"data-selected":ie.selected||void 0,"data-disabled":ie.disabled||void 0,"data-hidden":ie.hidden||void 0,"data-outside":xe.outside||void 0,"data-focused":ie.focused||void 0,"data-today":ie.today||void 0},!ie.hidden&&Fe?z.createElement(n.DayButton,{className:c[Oe.DayButton],style:b==null?void 0:b[Oe.DayButton],type:"button",day:xe,modifiers:ie,disabled:!ie.focused&&ie.disabled||void 0,"aria-disabled":ie.focused&&ie.disabled||void 0,tabIndex:Z(xe)?0:-1,"aria-label":ce(Ve,ie,o.options,o),onClick:Ge(xe,ie),onBlur:pr(xe,ie),onFocus:Ze(xe,ie),onKeyDown:pn(xe,ie),onMouseEnter:Ar(xe,ie),onMouseLeave:xn(xe,ie)},_(Ve,o.options,o)):!ie.hidden&&_(xe.date,o.options,o))})))))))),t.footer&&z.createElement(n.Footer,{className:c[Oe.Footer],style:b==null?void 0:b[Oe.Footer],role:"status","aria-live":"polite"},t.footer)))}function hr({className:e,classNames:t,showOutsideDays:r=!0,...n}){return a.jsx(BR,{showOutsideDays:r,className:$("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:$(zi({variant:"outline"}),"absolute left-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"),button_next:$(zi({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:$(zi({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(ms,{className:"h-4 w-4"}):a.jsx(kr,{className:"h-4 w-4"})},...n})}hr.displayName="Calendar";function WR(e,t=[]){let r=[];function n(i,o){const l=h.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:p,...x}=f,g=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>x,Object.values(x));return a.jsx(g.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;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=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,UR(s,...t)]}function UR(...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 h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function qR(e){const t=HR(e),r=h.forwardRef((n,s)=>{const{children:i,...o}=n,l=h.Children.toArray(i),c=l.find(YR);if(c){const d=c.props.children,u=l.map(f=>f===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...o,ref:s,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return a.jsx(t,{...o,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function HR(e){const t=h.forwardRef((r,n)=>{const{children:s,...i}=r;if(h.isValidElement(s)){const o=VR(s),l=GR(i,s.props);return s.type!==h.Fragment&&(l.ref=n?Hj(n,o):o),h.cloneElement(s,l)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KR=Symbol("radix.slottable");function YR(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KR}function GR(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 VR(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 XR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rk=XR.reduce((e,t)=>{const r=qR(`Primitive.${t}`),n=h.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}},{}),Ju="Switch",[QR]=WR(Ju),[ZR,JR]=QR(Ju),nk=h.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,p]=h.useState(null),x=_u(t,N=>p(N)),g=h.useRef(!1),v=m?u||!!m.closest("form"):!0,[y,j]=EM({prop:s,defaultProp:i??!1,onChange:d,caller:Ju});return a.jsxs(ZR,{scope:r,checked:y,disabled:l,children:[a.jsx(rk.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":ok(y),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:x,onClick:Rs(e.onClick,N=>{j(w=>!w),v&&(g.current=N.isPropagationStopped(),g.current||N.stopPropagation())})}),v&&a.jsx(ik,{control:m,bubbles:!g.current,name:n,value:c,checked:y,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});nk.displayName=Ju;var ak="SwitchThumb",sk=h.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=JR(ak,r);return a.jsx(rk.span,{"data-state":ok(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});sk.displayName=ak;var e$="SwitchBubbleInput",ik=h.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const o=h.useRef(null),l=_u(o,i),c=AM(r),d=DM(t);return h.useEffect(()=>{const u=o.current;if(!u)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&p){const x=new Event("click",{bubbles:n});p.call(u,r),u.dispatchEvent(x)}},[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}})});ik.displayName=e$;function ok(e){return e?"checked":"unchecked"}var lk=nk,t$=sk;const wo=h.forwardRef(({className:e,...t},r)=>a.jsx(lk,{className:$("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(t$,{className:$("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")})}));wo.displayName=lk.displayName;function r$(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?me(new Date(e.start_date),"MMM d"):"—",r=e.end_date?me(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function ef({open:e,onClose:t,projectId:r,defaultStatus:n="backlog",defaultTaskListId:s,defaultParentId:i}){const o=jt(),{workspace:l,projectKey:c}=Wt(),{workspace:d}=Ie(),[u,f]=h.useState(""),[m,p]=h.useState(""),[x,g]=h.useState(n),[v,y]=h.useState("medium"),[j,N]=h.useState("task"),[w,k]=h.useState([]),[b,S]=h.useState(""),[_,C]=h.useState(s??""),[T,M]=h.useState(void 0),[O,R]=h.useState(void 0),[E,A]=h.useState(!1),[P,U]=h.useState("weekly"),[Q,K]=h.useState(void 0),se=b1(),{data:ae}=aa(r),W=h.useMemo(()=>ae?ae.members.filter(q=>q.user).map(q=>q.user):void 0,[ae]),{data:Y}=vo(r),{data:te}=bo(r||void 0),{data:X}=lc(r||void 0),I=(te??[]).filter(q=>q.status!=="completed"),D=Y&&Y.length>0?Object.fromEntries(Y.map(q=>[q.key,q.name])):si,Z=()=>{f(""),p(""),g(n),y("medium"),N("task"),k([]),S(""),C(s??""),M(void 0),R(void 0),A(!1),U("weekly"),K(void 0),t()},F=q=>{q.preventDefault(),u.trim()&&se.mutate({title:u.trim(),description:m.trim()||void 0,status:x,priority:v,type:j,project_id:r,workspace_id:d.id,assignee_ids:w.length>0?w:void 0,sprint_id:b||null,task_list_id:_||null,parent_id:i||null,start_date:T?me(T,"yyyy-MM-dd"):null,due_date:O?me(O,"yyyy-MM-dd"):null,recurrence_frequency:E?P:void 0,recurrence_end_date:E&&Q?me(Q,"yyyy-MM-dd"):void 0},{onSuccess:()=>{B.success("Issue created"),Z()},onError:ce=>B.error(ce.message??"Failed to create issue")})};return a.jsx(gi,{open:e,onOpenChange:q=>!q&&Z(),children:a.jsxs(vi,{className:"max-w-md",children:[a.jsx(ho,{children:a.jsx(xo,{children:"New issue"})}),a.jsxs("form",{onSubmit:F,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(po,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ft,{htmlFor:"issue-title",children:"Title"}),a.jsx(Ae,{id:"issue-title",placeholder:"Issue title",value:u,onChange:q=>f(q.target.value),autoFocus:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ft,{htmlFor:"issue-desc",children:["Description ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(Yu,{id:"issue-desc",placeholder:"Add more context...",value:m,onChange:q=>p(q.target.value)})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ft,{children:"Status"}),a.jsxs(Be,{value:x,onValueChange:g,children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(D).map(([q,ce])=>a.jsx(ke,{value:q,className:"text-xs",children:ce},q))})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ft,{children:"Priority"}),a.jsxs(Be,{value:v,onValueChange:y,children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(On).map(([q,ce])=>a.jsx(ke,{value:q,className:"text-xs",children:ce},q))})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ft,{children:"Type"}),a.jsxs(Be,{value:j,onValueChange:N,children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(xs).map(([q,ce])=>a.jsx(ke,{value:q,className:"text-xs",children:ce},q))})]})]})]}),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"}),(X??[]).length>0&&!i&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ft,{children:["List ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Be,{value:_||"none",onValueChange:q=>C(q==="none"?"":q),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{placeholder:"No list"})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"none",className:"text-xs",children:a.jsx("span",{className:"text-muted-foreground",children:"No list"})}),(X??[]).map(q=>a.jsx(ke,{value:q.id,className:"text-xs",children:q.name},q.id))]})]})]}),I.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ft,{children:["Sprint ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Be,{value:b||"none",onValueChange:q=>S(q==="none"?"":q),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{placeholder:"No sprint"})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"none",className:"text-xs",children:a.jsx("span",{className:"text-muted-foreground",children:"No sprint"})}),I.map(q=>{const ce=r$(q);return a.jsx(ke,{value:q.id,className:"text-xs",children:a.jsxs("div",{children:[a.jsx("span",{children:q.name}),ce&&a.jsx("span",{className:"block text-[10px] text-muted-foreground leading-tight",children:ce})]})},q.id)})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ft,{children:["Assignees ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(cc,{value:w,onChange:k,users:W})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ft,{children:["Start Date ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:T?"text-foreground":"text-muted-foreground",children:T?me(T,"MMM d, yyyy"):"No start date"}),T&&a.jsx("button",{type:"button",onClick:q=>{q.stopPropagation(),M(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(st,{className:"h-3.5 w-3.5"})})]})}),a.jsx(St,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:T,onSelect:M,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ft,{children:["Due Date ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:O?"text-foreground":"text-muted-foreground",children:O?me(O,"MMM d, yyyy"):"No due date"}),O&&a.jsx("button",{type:"button",onClick:q=>{q.stopPropagation(),R(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(st,{className:"h-3.5 w-3.5"})})]})}),a.jsx(St,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:O,onSelect:R,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(wo,{id:"recurring",checked:E,onCheckedChange:A}),a.jsxs(ft,{htmlFor:"recurring",className:"cursor-pointer font-normal flex items-center gap-1.5",children:[a.jsx(Ui,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Recurring"]})]}),E&&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(ft,{children:"Frequency"}),a.jsxs(Be,{value:P,onValueChange:q=>U(q),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(ke,{value:"monthly",className:"text-xs",children:"Monthly"})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ft,{children:["Until ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:Q?"text-foreground":"text-muted-foreground",children:Q?me(Q,"MMM d, yyyy"):"No end date"}),Q&&a.jsx("button",{type:"button",onClick:q=>{q.stopPropagation(),K(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(st,{className:"h-3.5 w-3.5"})})]})}),a.jsx(St,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:Q,onSelect:K,initialFocus:!0})})]})]})]})})]})]}),a.jsxs(sc,{className:"flex-col-reverse sm:flex-row sm:items-center sm:justify-between gap-2",children:[a.jsxs(J,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 justify-start sm:justify-center",onClick:()=>{Z(),o(`/${l}/projects/${c}/issues/new`)},children:[a.jsx(O1,{className:"h-3.5 w-3.5"}),"Open full form"]}),a.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[a.jsx(J,{type:"button",variant:"ghost",onClick:Z,children:"Cancel"}),a.jsx(J,{type:"submit",disabled:!u.trim()||se.isPending,children:se.isPending?"Creating...":"Create issue"})]})]})]})]})})}const jx={byIssue:e=>["attachments",e]};function ck(e){return We({queryKey:jx.byIssue(e),queryFn:()=>re.get(`/admin/issues/${e}/attachments`),select:t=>t.attachments,enabled:!!e})}function dk(e){const t=Ne();return ge({mutationFn:({file:r,commentId:n})=>{const s=new FormData;return s.append("file",r),n&&s.append("comment_id",n),re.upload(`/admin/issues/${e}/attachments`,s)},onSuccess:()=>{t.invalidateQueries({queryKey:jx.byIssue(e)})}})}function n$(e){const t=Ne();return ge({mutationFn:r=>re.delete(`/admin/issues/${e}/attachments/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:jx.byIssue(e)})}})}function vl(e){return e.startsWith("image/")}function tf(e){return e.startsWith("video/")}function rf(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function jd(e){if(e.startsWith("/"))return!0;try{const{protocol:t}=new URL(e);return t==="http:"||t==="https:"}catch{return!1}}function Nx(e,t){if(!jd(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 kx({mimeType:e,className:t}){return vl(e)?a.jsx(JA,{className:t}):tf(e)?a.jsx(hl,{className:t}):e.startsWith("text/")||e.includes("json")?a.jsx(ZA,{className:t}):e.includes("zip")||e.includes("tar")||e.includes("gz")?a.jsx(QA,{className:t}):e.includes("pdf")||e.includes("word")||e.includes("document")?a.jsx(eD,{className:t}):a.jsx(tD,{className:t})}function uk({attachment:e,onClose:t}){return e?a.jsx(gi,{open:!0,onOpenChange:r=>!r&&t(),children:a.jsxs(vi,{className:"max-w-2xl w-full p-0 overflow-hidden",children:[a.jsxs(ho,{className:"flex-row items-center justify-between px-4 py-3 border-b border-border shrink-0 pr-10",children:[a.jsx(xo,{className:"text-sm font-medium truncate",children:e.original_name}),a.jsxs(J,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:()=>Nx(e.url,e.original_name),children:[a.jsx(Vp,{className:"h-3.5 w-3.5"}),"Download"]})]}),a.jsxs(po,{className:"flex items-center justify-center bg-black/5 dark:bg-black/30 min-h-[320px] max-h-[75vh] overflow-auto p-0",children:[vl(e.mime_type)&&jd(e.url)&&a.jsx("img",{src:e.url,alt:e.original_name,className:"max-w-full max-h-[75vh] object-contain"}),tf(e.mime_type)&&jd(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:rf(e.size)}),a.jsx("span",{children:"·"}),a.jsx("span",{children:e.mime_type}),a.jsx("span",{children:"·"}),a.jsxs("span",{children:["Uploaded ",me(new Date(e.created_at),"MMM d, yyyy")]})]})]})}):null}function a$({attachment:e}){const[t,r]=h.useState(null),n=vl(e.mime_type)||tf(e.mime_type),s=()=>{n?r(e):Nx(e.url,e.original_name)};return a.jsxs(a.Fragment,{children:[vl(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:jd(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(kx,{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:rf(e.size)}),!n&&a.jsx(Vp,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}),t&&a.jsx(uk,{attachment:t,onClose:()=>r(null)})]})}function s$({attachment:e,onOpen:t,onDelete:r,isDeleting:n}){const s=vl(e.mime_type)||tf(e.mime_type),i=()=>{s?t(e):Nx(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(kx,{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:rf(e.size)}),a.jsx("span",{children:"·"}),a.jsx("span",{children:me(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(Vp,{className:"h-2.5 w-2.5"}),"Click to download"]})]})]})]}),a.jsx(J,{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(Sr,{className:"h-3.5 w-3.5"})})]})}function i$({onFiles:e,isUploading:t}){const[r,n]=h.useState(!1),s=h.useRef(null),i=h.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:$("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(CD,{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 o$({issueId:e,className:t}){const[r,n]=h.useState(null),{data:s,isLoading:i}=ck(e),o=dk(e),l=n$(e),c=u=>{u.forEach(f=>{o.mutate({file:f},{onSuccess:()=>B.success(`${f.name} uploaded`),onError:()=>B.error(`Failed to upload ${f.name}`)})})},d=u=>{l.mutate(u,{onSuccess:()=>B.success("Attachment removed"),onError:()=>B.error("Failed to remove attachment")})};return a.jsxs("div",{className:$("px-6 py-4 space-y-4",t),children:[a.jsx(i$,{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(oe,{className:"h-8 w-8 rounded-md shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(oe,{className:"h-3 w-2/3"}),a.jsx(oe,{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(Qp,{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(s$,{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(uk,{attachment:r,onClose:()=>n(null)})]})}const gs={byIssue:e=>["time-logs",e],activeTimer:e=>["time-logs",e,"active-timer"]};function l$(e){return We({queryKey:gs.byIssue(e),queryFn:()=>re.get(`/admin/issues/${e}/time-logs`),enabled:!!e})}function c$(e){return We({queryKey:gs.activeTimer(e),queryFn:()=>re.get(`/admin/issues/${e}/time-logs/timer`),select:t=>t.active_timer,enabled:!!e,refetchInterval:1e4})}function d$(e){const t=Ne();return ge({mutationFn:r=>re.post(`/admin/issues/${e}/time-logs`,r),onSuccess:()=>{t.invalidateQueries({queryKey:gs.byIssue(e)})}})}function u$(e){const t=Ne();return ge({mutationFn:()=>re.post(`/admin/issues/${e}/time-logs/timer`,{action:"start"}),onSuccess:()=>{t.invalidateQueries({queryKey:gs.activeTimer(e)}),t.invalidateQueries({queryKey:gs.byIssue(e)})}})}function f$(e){const t=Ne();return ge({mutationFn:()=>re.post(`/admin/issues/${e}/time-logs/timer`,{action:"stop"}),onSuccess:()=>{t.invalidateQueries({queryKey:gs.activeTimer(e)}),t.invalidateQueries({queryKey:gs.byIssue(e)})}})}function m$(e){const t=Ne();return ge({mutationFn:r=>re.delete(`/admin/issues/${e}/time-logs/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:gs.byIssue(e)})}})}const h$=Yl("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 yl({className:e,variant:t,...r}){return a.jsx("div",{className:$(h$({variant:t}),e),...r})}function kh(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function xy(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 p$({startedAt:e}){const[t,r]=h.useState(()=>xy(e));return h.useEffect(()=>{const n=setInterval(()=>r(xy(e)),1e3);return()=>clearInterval(n)},[e]),a.jsx("span",{className:"font-mono tabular-nums text-sm font-semibold text-foreground",children:t})}function x$({onSubmit:e,isPending:t,onCancel:r}){const[n,s]=h.useState(""),[i,o]=h.useState(""),[l,c]=h.useState(""),[d,u]=h.useState(new Date().toISOString().split("T")[0]),f=m=>{m.preventDefault();const p=parseInt(n||"0",10),x=parseInt(i||"0",10),g=p*60+x;if(g<=0){B.error("Please enter a duration greater than 0.");return}e({duration_minutes:g,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(Ae,{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(Ae,{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(Ae,{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(Ae,{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(J,{type:"button",variant:"ghost",size:"sm",onClick:r,className:"h-7 text-xs",children:"Cancel"}),a.jsx(J,{type:"submit",size:"sm",disabled:t,className:"h-7 text-xs",children:t?"Saving…":"Log time"})]})]})}function g$({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:$("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(jD,{className:"h-3.5 w-3.5 text-emerald-600"}):e.source==="timer"?a.jsx(na,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(VA,{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(p$,{startedAt:e.started_at}):a.jsx("span",{className:"text-sm font-semibold text-foreground tabular-nums",children:kh(e.duration_minutes??0)}),a.jsx(yl,{variant:"muted",className:$("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:me(new Date(e.logged_date),"MMM d, yyyy")})]}),!s&&a.jsx(J,{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(Sr,{className:"h-3.5 w-3.5"})})]})}function v$({issueId:e,className:t}){const[r,n]=h.useState(!1),{data:s,isLoading:i}=l$(e),{data:o}=c$(e),{data:l}=yi(),c=d$(e),d=u$(e),u=f$(e),f=m$(e),m=(s==null?void 0:s.time_logs)??[],p=(s==null?void 0:s.total_minutes)??0,x=o!=null,g=N=>{c.mutate(N,{onSuccess:()=>{n(!1),B.success("Time logged")},onError:()=>B.error("Failed to log time")})},v=()=>{d.mutate(void 0,{onSuccess:()=>B.success("Timer started"),onError:N=>B.error(N.message??"Failed to start timer")})},y=()=>{u.mutate(void 0,{onSuccess:N=>{const w=N.time_log.duration_minutes??0;B.success(`Timer stopped — ${kh(w)} logged`)},onError:()=>B.error("Failed to stop timer")})},j=N=>{f.mutate(N,{onSuccess:()=>B.success("Time entry removed"),onError:()=>B.error("Failed to remove entry")})};return a.jsxs("div",{className:$("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:p>0?kh(p):"—"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!r&&a.jsxs(J,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>n(!0),children:[a.jsx(dt,{className:"h-3.5 w-3.5"}),"Log time"]}),x?a.jsxs(J,{size:"sm",variant:"destructive",className:"h-8 text-xs gap-1.5",onClick:y,disabled:u.isPending,children:[a.jsx(vD,{className:"h-3.5 w-3.5 fill-current"}),"Stop"]}):a.jsxs(J,{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(hl,{className:"h-3.5 w-3.5 fill-current"}),"Start"]})]})]}),r&&a.jsx(x$,{onSubmit:g,isPending:c.isPending,onCancel:()=>n(!1)}),i?a.jsx("div",{className:"space-y-2",children:[1,2].map(N=>a.jsxs("div",{className:"flex items-center gap-3 px-3",children:[a.jsx(oe,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(oe,{className:"h-3 w-1/3"}),a.jsx(oe,{className:"h-2.5 w-1/4"})]})]},N))}):m.length>0?a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx(na,{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(N=>{var w;return a.jsx(g$,{entry:N,userName:(w=l==null?void 0:l.get(N.user_id))==null?void 0:w.name,onDelete:j,isDeleting:f.isPending},N.id)})})]}):a.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No time logged yet."})]})}function y$(e){var t;const{char:r,allowSpaces:n,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=e,c=n&&!s,d=dE(r),u=new RegExp(`\\s${d}$`),f=o?"^":"",m=s?"":d,p=c?new RegExp(`${f}${d}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${f}(?:^)?${d}[^\\s${m}]*`,"gm"),x=((t=l.nodeBefore)==null?void 0:t.isText)&&l.nodeBefore.text;if(!x)return null;const g=l.pos-x.length,v=Array.from(x.matchAll(p)).pop();if(!v||v.input===void 0||v.index===void 0)return null;const y=v.input.slice(Math.max(0,v.index-1),v.index),j=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(y);if(i!==null&&!j)return null;const N=g+v.index;let w=N+v[0].length;return c&&u.test(x.slice(w-1,w+1))&&(v[0]+=" ",w+=1),N<l.pos&&w>=l.pos?{range:{from:N,to:w},query:v[0].slice(r.length),text:v[0]}:null}var b$=new e1("suggestion");function w$({pluginKey:e=b$,editor:t,char:r="@",allowSpaces:n=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:c="suggestion",decorationContent:d="",decorationEmptyClass:u="is-empty",command:f=()=>null,items:m=()=>[],render:p=()=>({}),allow:x=()=>!0,findSuggestionMatch:g=y$,shouldShow:v}){let y;const j=p==null?void 0:p(),N=()=>{const S=t.state.selection.$anchor.pos,_=t.view.coordsAtPos(S),{top:C,right:T,bottom:M,left:O}=_;try{return new DOMRect(O,C,T-O,M-C)}catch{return null}},w=(S,_)=>_?()=>{const C=e.getState(t.state),T=C==null?void 0:C.decorationId,M=S.dom.querySelector(`[data-decoration-id="${T}"]`);return(M==null?void 0:M.getBoundingClientRect())||null}:N;function k(S,_){var C;try{const M=e.getState(S.state),O=M!=null&&M.decorationId?S.dom.querySelector(`[data-decoration-id="${M.decorationId}"]`):null,R={editor:t,range:(M==null?void 0:M.range)||{from:0,to:0},query:(M==null?void 0:M.query)||null,text:(M==null?void 0:M.text)||null,items:[],command:E=>f({editor:t,range:(M==null?void 0:M.range)||{from:0,to:0},props:E}),decorationNode:O,clientRect:w(S,O)};(C=j==null?void 0:j.onExit)==null||C.call(j,R)}catch{}const T=S.state.tr.setMeta(_,{exit:!0});S.dispatch(T)}const b=new oE({key:e,view(){return{update:async(S,_)=>{var C,T,M,O,R,E,A;const P=(C=this.key)==null?void 0:C.getState(_),U=(T=this.key)==null?void 0:T.getState(S.state),Q=P.active&&U.active&&P.range.from!==U.range.from,K=!P.active&&U.active,se=P.active&&!U.active,ae=!K&&!se&&P.query!==U.query,W=K||Q&&ae,Y=ae||Q,te=se||Q&&ae;if(!W&&!Y&&!te)return;const X=te&&!W?P:U,I=S.dom.querySelector(`[data-decoration-id="${X.decorationId}"]`);y={editor:t,range:X.range,query:X.query,text:X.text,items:[],command:D=>f({editor:t,range:X.range,props:D}),decorationNode:I,clientRect:w(S,I)},W&&((M=j==null?void 0:j.onBeforeStart)==null||M.call(j,y)),Y&&((O=j==null?void 0:j.onBeforeUpdate)==null||O.call(j,y)),(Y||W)&&(y.items=await m({editor:t,query:X.query})),te&&((R=j==null?void 0:j.onExit)==null||R.call(j,y)),Y&&((E=j==null?void 0:j.onUpdate)==null||E.call(j,y)),W&&((A=j==null?void 0:j.onStart)==null||A.call(j,y))},destroy:()=>{var S;y&&((S=j==null?void 0:j.onExit)==null||S.call(j,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,_,C,T){const{isEditable:M}=t,{composing:O}=t.view,{selection:R}=S,{empty:E,from:A}=R,P={..._},U=S.getMeta(e);if(U&&U.exit)return P.active=!1,P.decorationId=null,P.range={from:0,to:0},P.query=null,P.text=null,P;if(P.composing=O,M&&(E||t.view.composing)){(A<_.range.from||A>_.range.to)&&!O&&!_.composing&&(P.active=!1);const Q=g({char:r,allowSpaces:n,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:R.$from}),K=`id_${Math.floor(Math.random()*4294967295)}`;Q&&x({editor:t,state:T,range:Q.range,isActive:_.active})&&(!v||v({editor:t,range:Q.range,query:Q.query,text:Q.text,transaction:S}))?(P.active=!0,P.decorationId=_.decorationId?_.decorationId:K,P.range=Q.range,P.query=Q.query,P.text=Q.text):P.active=!1}else P.active=!1;return P.active||(P.decorationId=null,P.range={from:0,to:0},P.query=null,P.text=null),P}},props:{handleKeyDown(S,_){var C,T,M,O;const{active:R,range:E}=b.getState(S.state);if(!R)return!1;if(_.key==="Escape"||_.key==="Esc"){const P=b.getState(S.state),U=(C=y==null?void 0:y.decorationNode)!=null?C:null,Q=U??(P!=null&&P.decorationId?S.dom.querySelector(`[data-decoration-id="${P.decorationId}"]`):null);if(((T=j==null?void 0:j.onKeyDown)==null?void 0:T.call(j,{view:S,event:_,range:P.range}))||!1)return!0;const se={editor:t,range:P.range,query:P.query,text:P.text,items:[],command:ae=>f({editor:t,range:P.range,props:ae}),decorationNode:Q,clientRect:Q?()=>Q.getBoundingClientRect()||null:null};return(M=j==null?void 0:j.onExit)==null||M.call(j,se),k(S,e),!0}return((O=j==null?void 0:j.onKeyDown)==null?void 0:O.call(j,{view:S,event:_,range:E}))||!1},decorations(S){const{active:_,range:C,decorationId:T,query:M}=b.getState(S);if(!_)return null;const O=!(M!=null&&M.length),R=[c];return O&&R.push(u),lE.create(S.doc,[cE.inline(C.from,C.to,{nodeName:l,class:R.join(" "),"data-decoration-id":T,"data-decoration-content":d})])}}});return b}function j$({editor:e,overrideSuggestionOptions:t,extensionName:r,char:n="@"}){const s=new e1;return{editor:e,char:n,pluginKey:s,command:({editor:i,range:o,props:l})=>{var c,d,u;const f=i.view.state.selection.$to.nodeAfter;((c=f==null?void 0:f.text)==null?void 0:c.startsWith(" "))&&(o.to+=1),i.chain().focus().insertContentAt(o,[{type:r,attrs:{...l,mentionSuggestionChar:n}},{type:"text",text:" "}]).run(),(u=(d=i.view.dom.ownerDocument.defaultView)==null?void 0:d.getSelection())==null||u.collapseToEnd()},allow:({state:i,range:o})=>{const l=i.doc.resolve(o.from),c=i.schema.nodes[r];return!!l.parent.type.contentMatch.matchType(c)},...t}}function fk(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(t=>j$({editor:e.editor,overrideSuggestionOptions:t,extensionName:e.name,char:t.char}))}function gy(e,t){const r=fk(e),n=r.find(s=>s.char===t);return n||(r.length?r[0]:null)}var N$=uE.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:e,suggestion:t}){var r,n;return`${(r=t==null?void 0:t.char)!=null?r:"@"}${(n=e.attrs.label)!=null?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t,suggestion:r}){var n,s;return["span",Ac(this.HTMLAttributes,e.HTMLAttributes),`${(n=r==null?void 0:r.char)!=null?n:"@"}${(s=t.attrs.label)!=null?s:t.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:e=>e.getAttribute("data-mention-suggestion-char"),renderHTML:e=>({"data-mention-suggestion-char":e.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){const r=gy(this,e.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Ac({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e,suggestion:r})];const n={...this.options};n.HTMLAttributes=Ac({"data-type":this.name},this.options.HTMLAttributes,t);const s=this.options.renderHTML({options:n,node:e,suggestion:r});return typeof s=="string"?["span",Ac({"data-type":this.name},this.options.HTMLAttributes,t),s]:s},...mE({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:e=>{const t={},r=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let n=r.exec(e);for(;n!==null;){const[,s,i,o]=n,l=i??o;t[s==="char"?"mentionSuggestionChar":s]=l,n=r.exec(e)}return t},serializeAttributes:e=>Object.entries(e).filter(([,t])=>t!=null).map(([t,r])=>`${t==="mentionSuggestionChar"?"char":t}="${r}"`).join(" ")}),renderText({node:e}){const t={options:this.options,node:e,suggestion:gy(this,e.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(t)):this.options.renderText(t)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let r=!1;const{selection:n}=t,{empty:s,anchor:i}=n;if(!s)return!1;let o=new fE,l=0;return t.doc.nodesBetween(i-1,i,(c,d)=>{if(c.type.name===this.name)return r=!0,o=c,l=d,!1}),r&&e.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,l,l+o.nodeSize),r})}},addProseMirrorPlugins(){return fk(this).map(w$)}}),k$=N$;function S$({items:e,selectedIndex:t,onSelect:r}){const n=h.useRef(null);return h.useEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.querySelector(`[data-index="${t}"]`);s==null||s.scrollIntoView({block:"nearest"})},[t]),e.length===0?null:a.jsx("div",{className:$("z-50 min-w-[220px] max-w-[280px] rounded-md border border-border","bg-popover shadow-md overflow-hidden","animate-in fade-in-0 zoom-in-95"),children:a.jsx("div",{ref:n,className:"max-h-[200px] overflow-y-auto p-1",role:"listbox",children:e.map((s,i)=>{const o=s.label.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2)||"?",l=_x(s.label);return a.jsxs("button",{"data-index":i,role:"option","aria-selected":i===t,onMouseDown:c=>{c.preventDefault(),r(s)},className:$("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs cursor-pointer","transition-colors",i===t?"bg-accent text-accent-foreground":"hover:bg-accent/60"),children:[a.jsx(Ft,{className:"h-5 w-5 shrink-0",children:a.jsx(Bt,{className:$("text-[9px] font-semibold",l.bg,l.text),children:o})}),a.jsxs("div",{className:"flex flex-col items-start min-w-0",children:[a.jsx("span",{className:"font-medium text-foreground truncate leading-tight",children:s.label}),a.jsx("span",{className:"text-[10px] text-muted-foreground truncate leading-tight",children:s.email})]})]},s.id)})})})}function Cs({onClick:e,active:t,title:r,children:n}){return a.jsx("button",{type:"button",title:r,onMouseDown:s=>{s.preventDefault(),e()},className:$("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 vy(){return a.jsx("span",{className:"mx-0.5 h-3.5 w-px shrink-0 bg-border"})}const Fc={active:!1,items:[],selectedIndex:0,rect:null,command:null};function mk({issueId:e,projectId:t,compact:r,className:n,onSuccess:s}){const[i,o]=h.useState(!0),[l,c]=h.useState([]),[d,u]=h.useState(!1),[f,m]=h.useState(Fc),p=h.useRef(null),x=h.useRef(async()=>{}),g=h.useRef(null),{user:v}=Ie(),y=UA(e),j=dk(e),{data:N}=aa(t??""),w=h.useMemo(()=>N!=null&&N.members?N.members.filter(I=>I.user).map(I=>{const D=I.user,Z=`${D.first_name??""} ${D.last_name??""}`.trim()||D.email;return{id:D.id,label:Z,email:D.email}}):[],[N]),k=h.useRef([]);k.current=w;const b=h.useRef(m);b.current=m;const S=h.useRef([]),_=h.useRef(null),C=h.useRef(0),T=(v==null?void 0:v.first_name)??"",M=(v==null?void 0:v.last_name)??"",O=`${T} ${M}`.trim()||(v==null?void 0:v.email)||"?",R=v&&`${T[0]??""}${M[0]??""}`.toUpperCase()||"?",E=_x(O),A=h.useMemo(()=>hE.create({name:"submitShortcut",addKeyboardShortcuts(){return{"Mod-Enter":()=>(x.current(),!0)}}}),[]),P=h.useMemo(()=>k$.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:I})=>{const D=k.current;if(!D.length)return[];const Z=I.toLowerCase();return D.filter(F=>!Z||F.label.toLowerCase().includes(Z)||F.email.toLowerCase().includes(Z)).slice(0,8)},render:()=>({onStart:I=>{var D;S.current=I.items,_.current=I.command,C.current=0,b.current({active:!0,items:I.items,selectedIndex:0,rect:((D=I.clientRect)==null?void 0:D.call(I))??null,command:I.command})},onUpdate:I=>{var D;S.current=I.items,_.current=I.command,C.current=0,b.current({active:!0,items:I.items,selectedIndex:0,rect:((D=I.clientRect)==null?void 0:D.call(I))??null,command:I.command})},onKeyDown:({event:I})=>{var Z;const D=S.current;if(!D.length)return!1;if(I.key==="Escape")return b.current(Fc),!0;if(I.key==="ArrowDown"){const F=(C.current+1)%D.length;return C.current=F,b.current(q=>({...q,selectedIndex:F})),!0}if(I.key==="ArrowUp"){const F=(C.current-1+D.length)%D.length;return C.current=F,b.current(q=>({...q,selectedIndex:F})),!0}if(I.key==="Enter"){const F=D[C.current];return F&&((Z=_.current)==null||Z.call(_,F)),!0}return!1},onExit:()=>{b.current(Fc),_.current=null}})}}),[]),U=t1({extensions:[r1,n1,a1.configure({placeholder:"Leave a comment… (type @ to mention)"}),A,P],editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:I}){o(I.isEmpty)}}),Q=!i||l.length>0,K=25*1024*1024,se=I=>{const D=I.filter(F=>F.size>K);D.length>0&&B.error(`Files must be under 25 MB: ${D.map(F=>F.name).join(", ")}`);const Z=I.filter(F=>F.size<=K);c(F=>{const q=new Set(F.map(ce=>`${ce.name}-${ce.size}`));return[...F,...Z.filter(ce=>!q.has(`${ce.name}-${ce.size}`))]})},ae=I=>{c(D=>D.filter((Z,F)=>F!==I))},W=h.useCallback(I=>{var D;(D=_.current)==null||D.call(_,I),m(Fc)},[]),Y=async()=>{if(!(!Q||d)){u(!0);try{const I=U!=null&&U.isEmpty?"":(U==null?void 0:U.getHTML())??"",D=[];I&&new DOMParser().parseFromString(I,"text/html").querySelectorAll("[data-type='mention']").forEach(ue=>{const V=ue.getAttribute("data-id");V&&!D.includes(V)&&D.push(V)});const Z=D.length>0?{mentioned_user_ids:D}:void 0,q=(await y.mutateAsync({body:I||" ",metadata:Z})).comment.id;for(const ce of l)await j.mutateAsync({file:ce,commentId:q});U==null||U.commands.clearContent(),o(!0),c([]),B.success("Comment added"),s==null||s()}catch{B.error("Failed to add comment")}finally{u(!1)}}};x.current=Y;const te="h-3 w-3",X=h.useMemo(()=>{if(!f.rect||!g.current)return{bottom:"105%",left:0};const I=g.current.getBoundingClientRect(),D=Math.max(0,f.rect.left-I.left);return{top:f.rect.bottom-I.top+4,left:D}},[f.rect]);return a.jsxs("div",{className:$("flex gap-3 items-start",n),children:[a.jsx(Ft,{className:"h-7 w-7 shrink-0 mt-1",children:a.jsx(Bt,{className:$("text-[11px] font-semibold",E.bg,E.text),children:R})}),a.jsxs("div",{className:"flex-1 min-w-0 relative",ref:g,children:[a.jsxs("div",{className:$("rounded-md border border-input overflow-hidden transition-shadow","focus-within:ring-1 focus-within:ring-ring",d&&"opacity-60 pointer-events-none"),children:[U&&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(Cs,{title:"Bold (⌘B)",active:U.isActive("bold"),onClick:()=>U.chain().focus().toggleBold().run(),children:a.jsx(j1,{className:te})}),a.jsx(Cs,{title:"Italic (⌘I)",active:U.isActive("italic"),onClick:()=>U.chain().focus().toggleItalic().run(),children:a.jsx(M1,{className:te})}),a.jsx(Cs,{title:"Strikethrough",active:U.isActive("strike"),onClick:()=>U.chain().focus().toggleStrike().run(),children:a.jsx($1,{className:te})}),a.jsx(Cs,{title:"Inline code",active:U.isActive("code"),onClick:()=>U.chain().focus().toggleCode().run(),children:a.jsx(_1,{className:te})}),a.jsx(vy,{}),a.jsx(Cs,{title:"Bullet list",active:U.isActive("bulletList"),onClick:()=>U.chain().focus().toggleBulletList().run(),children:a.jsx(A1,{className:te})}),a.jsx(Cs,{title:"Ordered list",active:U.isActive("orderedList"),onClick:()=>U.chain().focus().toggleOrderedList().run(),children:a.jsx(E1,{className:te})}),a.jsx(vy,{}),a.jsx(Cs,{title:"Code block",active:U.isActive("codeBlock"),onClick:()=>U.chain().focus().toggleCodeBlock().run(),children:a.jsx(C1,{className:te})})]}),a.jsx(s1,{editor:U,className:$("px-3 py-2.5 text-sm",r?"min-h-[68px]":"min-h-[80px]")})]}),l.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:l.map((I,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(kx,{mimeType:I.type,className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"truncate",children:I.name}),a.jsxs("span",{className:"text-muted-foreground shrink-0",children:["(",rf(I.size),")"]}),a.jsx("button",{type:"button",onClick:()=>ae(D),className:"ml-0.5 rounded hover:text-destructive transition-colors shrink-0",children:a.jsx(st,{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(J,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>{var I;return(I=p.current)==null?void 0:I.click()},disabled:d,title:"Attach files",children:a.jsx(Qp,{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(J,{size:"icon",className:"h-8 w-8",onClick:Y,disabled:!Q||d,children:a.jsx(pD,{className:"h-3.5 w-3.5"})})]}),a.jsx("input",{ref:p,type:"file",multiple:!0,className:"hidden",onChange:I=>{const D=Array.from(I.target.files??[]);D.length>0&&se(D),I.target.value=""}}),f.active&&f.items.length>0&&a.jsx("div",{className:"absolute z-[9999]",style:X,children:a.jsx(S$,{items:f.items,selectedIndex:f.selectedIndex,onSelect:W})})]})]})}/*! @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:hk,setPrototypeOf:yy,isFrozen:C$,getPrototypeOf:_$,getOwnPropertyDescriptor:O$}=Object;let{freeze:_r,seal:cn,create:Sh}=Object,{apply:Ch,construct:_h}=typeof Reflect<"u"&&Reflect;_r||(_r=function(t){return t});cn||(cn=function(t){return t});Ch||(Ch=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)});_h||(_h=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 Bc=Or(Array.prototype.forEach),P$=Or(Array.prototype.lastIndexOf),by=Or(Array.prototype.pop),Wo=Or(Array.prototype.push),M$=Or(Array.prototype.splice),md=Or(String.prototype.toLowerCase),Pm=Or(String.prototype.toString),Mm=Or(String.prototype.match),Uo=Or(String.prototype.replace),E$=Or(String.prototype.indexOf),A$=Or(String.prototype.trim),yn=Or(Object.prototype.hasOwnProperty),vr=Or(RegExp.prototype.test),qo=D$(TypeError);function Or(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 Ch(e,t,n)}}function D$(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return _h(e,r)}}function $e(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:md;yy&&yy(e,null);let n=t.length;for(;n--;){let s=t[n];if(typeof s=="string"){const i=r(s);i!==s&&(C$(t)||(t[n]=i),s=i)}e[s]=!0}return e}function T$(e){for(let t=0;t<e.length;t++)yn(e,t)||(e[t]=null);return e}function Fn(e){const t=Sh(null);for(const[r,n]of hk(e))yn(e,r)&&(Array.isArray(n)?t[r]=T$(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Fn(n):t[r]=n);return t}function Ho(e,t){for(;e!==null;){const n=O$(e,t);if(n){if(n.get)return Or(n.get);if(typeof n.value=="function")return Or(n.value)}e=_$(e)}function r(){return null}return r}const wy=_r(["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"]),Em=_r(["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"]),Am=_r(["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"]),I$=_r(["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"]),Dm=_r(["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"]),R$=_r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),jy=_r(["#text"]),Ny=_r(["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"]),Tm=_r(["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"]),ky=_r(["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"]),Wc=_r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$$=cn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z$=cn(/<%[\w\W]*|[\w\W]*%>/gm),L$=cn(/\$\{[\w\W]*/gm),F$=cn(/^data-[\-\w.\u00B7-\uFFFF]+$/),B$=cn(/^aria-[\-\w]+$/),pk=cn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W$=cn(/^(?:\w+script|data):/i),U$=cn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),xk=cn(/^html$/i),q$=cn(/^[a-z][.\w]*(-[.\w]+)+$/i);var Sy=Object.freeze({__proto__:null,ARIA_ATTR:B$,ATTR_WHITESPACE:U$,CUSTOM_ELEMENT:q$,DATA_ATTR:F$,DOCTYPE_NAME:xk,ERB_EXPR:z$,IS_ALLOWED_URI:pk,IS_SCRIPT_OR_DATA:W$,MUSTACHE_EXPR:$$,TMPLIT_EXPR:L$});const Ko={element:1,text:3,progressingInstruction:7,comment:8,document:9},H$=function(){return typeof window>"u"?null:window},K$=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}},Cy=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function gk(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H$();const t=Me=>gk(Me);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==Ko.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:p}=e,x=c.prototype,g=Ho(x,"cloneNode"),v=Ho(x,"remove"),y=Ho(x,"nextSibling"),j=Ho(x,"childNodes"),N=Ho(x,"parentNode");if(typeof o=="function"){const Me=r.createElement("template");Me.content&&Me.content.ownerDocument&&(r=Me.content.ownerDocument)}let w,k="";const{implementation:b,createNodeIterator:S,createDocumentFragment:_,getElementsByTagName:C}=r,{importNode:T}=n;let M=Cy();t.isSupported=typeof hk=="function"&&typeof N=="function"&&b&&b.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:R,TMPLIT_EXPR:E,DATA_ATTR:A,ARIA_ATTR:P,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:Q,CUSTOM_ELEMENT:K}=Sy;let{IS_ALLOWED_URI:se}=Sy,ae=null;const W=$e({},[...wy,...Em,...Am,...Dm,...jy]);let Y=null;const te=$e({},[...Ny,...Tm,...ky,...Wc]);let X=Object.seal(Sh(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}})),I=null,D=null;const Z=Object.seal(Sh(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let F=!0,q=!0,ce=!1,ee=!0,ue=!1,V=!0,le=!1,pe=!1,we=!1,_e=!1,H=!1,ye=!1,De=!0,He=!1;const Fe="user-content-";let Qe=!0,gt=!1,Ge={},Ze=null;const pr=$e({},["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 pn=null;const Ar=$e({},["audio","video","img","source","image","track"]);let xn=null;const xr=$e({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ct="http://www.w3.org/1998/Math/MathML",Rt="http://www.w3.org/2000/svg",Ht="http://www.w3.org/1999/xhtml";let er=Ht,Dn=!1,la=null;const Pe=$e({},[Ct,Rt,Ht],Pm);let he=$e({},["mi","mo","mn","ms","mtext"]),be=$e({},["annotation-xml"]);const fe=$e({},["title","style","font","a","script"]);let xe=null;const Ve=["application/xhtml+xml","text/html"],ie="text/html";let Ce=null,Te=null;const vt=r.createElement("form"),tt=function(L){return L instanceof RegExp||L instanceof Function},rt=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Te&&Te===L)){if((!L||typeof L!="object")&&(L={}),L=Fn(L),xe=Ve.indexOf(L.PARSER_MEDIA_TYPE)===-1?ie:L.PARSER_MEDIA_TYPE,Ce=xe==="application/xhtml+xml"?Pm:md,ae=yn(L,"ALLOWED_TAGS")?$e({},L.ALLOWED_TAGS,Ce):W,Y=yn(L,"ALLOWED_ATTR")?$e({},L.ALLOWED_ATTR,Ce):te,la=yn(L,"ALLOWED_NAMESPACES")?$e({},L.ALLOWED_NAMESPACES,Pm):Pe,xn=yn(L,"ADD_URI_SAFE_ATTR")?$e(Fn(xr),L.ADD_URI_SAFE_ATTR,Ce):xr,pn=yn(L,"ADD_DATA_URI_TAGS")?$e(Fn(Ar),L.ADD_DATA_URI_TAGS,Ce):Ar,Ze=yn(L,"FORBID_CONTENTS")?$e({},L.FORBID_CONTENTS,Ce):pr,I=yn(L,"FORBID_TAGS")?$e({},L.FORBID_TAGS,Ce):Fn({}),D=yn(L,"FORBID_ATTR")?$e({},L.FORBID_ATTR,Ce):Fn({}),Ge=yn(L,"USE_PROFILES")?L.USE_PROFILES:!1,F=L.ALLOW_ARIA_ATTR!==!1,q=L.ALLOW_DATA_ATTR!==!1,ce=L.ALLOW_UNKNOWN_PROTOCOLS||!1,ee=L.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ue=L.SAFE_FOR_TEMPLATES||!1,V=L.SAFE_FOR_XML!==!1,le=L.WHOLE_DOCUMENT||!1,_e=L.RETURN_DOM||!1,H=L.RETURN_DOM_FRAGMENT||!1,ye=L.RETURN_TRUSTED_TYPE||!1,we=L.FORCE_BODY||!1,De=L.SANITIZE_DOM!==!1,He=L.SANITIZE_NAMED_PROPS||!1,Qe=L.KEEP_CONTENT!==!1,gt=L.IN_PLACE||!1,se=L.ALLOWED_URI_REGEXP||pk,er=L.NAMESPACE||Ht,he=L.MATHML_TEXT_INTEGRATION_POINTS||he,be=L.HTML_INTEGRATION_POINTS||be,X=L.CUSTOM_ELEMENT_HANDLING||{},L.CUSTOM_ELEMENT_HANDLING&&tt(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=L.CUSTOM_ELEMENT_HANDLING.tagNameCheck),L.CUSTOM_ELEMENT_HANDLING&&tt(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),L.CUSTOM_ELEMENT_HANDLING&&typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ue&&(q=!1),H&&(_e=!0),Ge&&(ae=$e({},jy),Y=[],Ge.html===!0&&($e(ae,wy),$e(Y,Ny)),Ge.svg===!0&&($e(ae,Em),$e(Y,Tm),$e(Y,Wc)),Ge.svgFilters===!0&&($e(ae,Am),$e(Y,Tm),$e(Y,Wc)),Ge.mathMl===!0&&($e(ae,Dm),$e(Y,ky),$e(Y,Wc))),L.ADD_TAGS&&(typeof L.ADD_TAGS=="function"?Z.tagCheck=L.ADD_TAGS:(ae===W&&(ae=Fn(ae)),$e(ae,L.ADD_TAGS,Ce))),L.ADD_ATTR&&(typeof L.ADD_ATTR=="function"?Z.attributeCheck=L.ADD_ATTR:(Y===te&&(Y=Fn(Y)),$e(Y,L.ADD_ATTR,Ce))),L.ADD_URI_SAFE_ATTR&&$e(xn,L.ADD_URI_SAFE_ATTR,Ce),L.FORBID_CONTENTS&&(Ze===pr&&(Ze=Fn(Ze)),$e(Ze,L.FORBID_CONTENTS,Ce)),L.ADD_FORBID_CONTENTS&&(Ze===pr&&(Ze=Fn(Ze)),$e(Ze,L.ADD_FORBID_CONTENTS,Ce)),Qe&&(ae["#text"]=!0),le&&$e(ae,["html","head","body"]),ae.table&&($e(ae,["tbody"]),delete I.tbody),L.TRUSTED_TYPES_POLICY){if(typeof L.TRUSTED_TYPES_POLICY.createHTML!="function")throw qo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=L.TRUSTED_TYPES_POLICY,k=w.createHTML("")}else w===void 0&&(w=K$(p,s)),w!==null&&typeof k=="string"&&(k=w.createHTML(""));_r&&_r(L),Te=L}},gr=$e({},[...Em,...Am,...I$]),tr=$e({},[...Dm,...R$]),Tn=function(L){let de=N(L);(!de||!de.tagName)&&(de={namespaceURI:er,tagName:"template"});const je=md(L.tagName),ht=md(de.tagName);return la[L.namespaceURI]?L.namespaceURI===Rt?de.namespaceURI===Ht?je==="svg":de.namespaceURI===Ct?je==="svg"&&(ht==="annotation-xml"||he[ht]):!!gr[je]:L.namespaceURI===Ct?de.namespaceURI===Ht?je==="math":de.namespaceURI===Rt?je==="math"&&be[ht]:!!tr[je]:L.namespaceURI===Ht?de.namespaceURI===Rt&&!be[ht]||de.namespaceURI===Ct&&!he[ht]?!1:!tr[je]&&(fe[je]||!gr[je]):!!(xe==="application/xhtml+xml"&&la[L.namespaceURI]):!1},In=function(L){Wo(t.removed,{element:L});try{N(L).removeChild(L)}catch{v(L)}},Ns=function(L,de){try{Wo(t.removed,{attribute:de.getAttributeNode(L),from:de})}catch{Wo(t.removed,{attribute:null,from:de})}if(de.removeAttribute(L),L==="is")if(_e||H)try{In(de)}catch{}else try{de.setAttribute(L,"")}catch{}},jv=function(L){let de=null,je=null;if(we)L="<remove></remove>"+L;else{const Et=Mm(L,/^[\r\n\t ]+/);je=Et&&Et[0]}xe==="application/xhtml+xml"&&er===Ht&&(L='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+L+"</body></html>");const ht=w?w.createHTML(L):L;if(er===Ht)try{de=new m().parseFromString(ht,xe)}catch{}if(!de||!de.documentElement){de=b.createDocument(er,"template",null);try{de.documentElement.innerHTML=Dn?k:ht}catch{}}const cr=de.body||de.documentElement;return L&&je&&cr.insertBefore(r.createTextNode(je),cr.childNodes[0]||null),er===Ht?C.call(de,le?"html":"body")[0]:le?de.documentElement:cr},Nv=function(L){return S.call(L.ownerDocument||L,L,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},im=function(L){return L instanceof f&&(typeof L.nodeName!="string"||typeof L.textContent!="string"||typeof L.removeChild!="function"||!(L.attributes instanceof u)||typeof L.removeAttribute!="function"||typeof L.setAttribute!="function"||typeof L.namespaceURI!="string"||typeof L.insertBefore!="function"||typeof L.hasChildNodes!="function")},kv=function(L){return typeof l=="function"&&L instanceof l};function ca(Me,L,de){Bc(Me,je=>{je.call(t,L,de,Te)})}const Sv=function(L){let de=null;if(ca(M.beforeSanitizeElements,L,null),im(L))return In(L),!0;const je=Ce(L.nodeName);if(ca(M.uponSanitizeElement,L,{tagName:je,allowedTags:ae}),V&&L.hasChildNodes()&&!kv(L.firstElementChild)&&vr(/<[/\w!]/g,L.innerHTML)&&vr(/<[/\w!]/g,L.textContent)||L.nodeType===Ko.progressingInstruction||V&&L.nodeType===Ko.comment&&vr(/<[/\w]/g,L.data))return In(L),!0;if(!(Z.tagCheck instanceof Function&&Z.tagCheck(je))&&(!ae[je]||I[je])){if(!I[je]&&_v(je)&&(X.tagNameCheck instanceof RegExp&&vr(X.tagNameCheck,je)||X.tagNameCheck instanceof Function&&X.tagNameCheck(je)))return!1;if(Qe&&!Ze[je]){const ht=N(L)||L.parentNode,cr=j(L)||L.childNodes;if(cr&&ht){const Et=cr.length;for(let Dr=Et-1;Dr>=0;--Dr){const da=g(cr[Dr],!0);da.__removalCount=(L.__removalCount||0)+1,ht.insertBefore(da,y(L))}}}return In(L),!0}return L instanceof c&&!Tn(L)||(je==="noscript"||je==="noembed"||je==="noframes")&&vr(/<\/no(script|embed|frames)/i,L.innerHTML)?(In(L),!0):(ue&&L.nodeType===Ko.text&&(de=L.textContent,Bc([O,R,E],ht=>{de=Uo(de,ht," ")}),L.textContent!==de&&(Wo(t.removed,{element:L.cloneNode()}),L.textContent=de)),ca(M.afterSanitizeElements,L,null),!1)},Cv=function(L,de,je){if(De&&(de==="id"||de==="name")&&(je in r||je in vt))return!1;if(!(q&&!D[de]&&vr(A,de))){if(!(F&&vr(P,de))){if(!(Z.attributeCheck instanceof Function&&Z.attributeCheck(de,L))){if(!Y[de]||D[de]){if(!(_v(L)&&(X.tagNameCheck instanceof RegExp&&vr(X.tagNameCheck,L)||X.tagNameCheck instanceof Function&&X.tagNameCheck(L))&&(X.attributeNameCheck instanceof RegExp&&vr(X.attributeNameCheck,de)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(de,L))||de==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&vr(X.tagNameCheck,je)||X.tagNameCheck instanceof Function&&X.tagNameCheck(je))))return!1}else if(!xn[de]){if(!vr(se,Uo(je,Q,""))){if(!((de==="src"||de==="xlink:href"||de==="href")&&L!=="script"&&E$(je,"data:")===0&&pn[L])){if(!(ce&&!vr(U,Uo(je,Q,"")))){if(je)return!1}}}}}}}return!0},_v=function(L){return L!=="annotation-xml"&&Mm(L,K)},Ov=function(L){ca(M.beforeSanitizeAttributes,L,null);const{attributes:de}=L;if(!de||im(L))return;const je={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let ht=de.length;for(;ht--;){const cr=de[ht],{name:Et,namespaceURI:Dr,value:da}=cr,ki=Ce(Et),om=da;let rr=Et==="value"?om:A$(om);if(je.attrName=ki,je.attrValue=rr,je.keepAttr=!0,je.forceKeepAttr=void 0,ca(M.uponSanitizeAttribute,L,je),rr=je.attrValue,He&&(ki==="id"||ki==="name")&&(Ns(Et,L),rr=Fe+rr),V&&vr(/((--!?|])>)|<\/(style|title|textarea)/i,rr)){Ns(Et,L);continue}if(ki==="attributename"&&Mm(rr,"href")){Ns(Et,L);continue}if(je.forceKeepAttr)continue;if(!je.keepAttr){Ns(Et,L);continue}if(!ee&&vr(/\/>/i,rr)){Ns(Et,L);continue}ue&&Bc([O,R,E],Mv=>{rr=Uo(rr,Mv," ")});const Pv=Ce(L.nodeName);if(!Cv(Pv,ki,rr)){Ns(Et,L);continue}if(w&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Dr)switch(p.getAttributeType(Pv,ki)){case"TrustedHTML":{rr=w.createHTML(rr);break}case"TrustedScriptURL":{rr=w.createScriptURL(rr);break}}if(rr!==om)try{Dr?L.setAttributeNS(Dr,Et,rr):L.setAttribute(Et,rr),im(L)?In(L):by(t.removed)}catch{Ns(Et,L)}}ca(M.afterSanitizeAttributes,L,null)},aM=function Me(L){let de=null;const je=Nv(L);for(ca(M.beforeSanitizeShadowDOM,L,null);de=je.nextNode();)ca(M.uponSanitizeShadowNode,de,null),Sv(de),Ov(de),de.content instanceof i&&Me(de.content);ca(M.afterSanitizeShadowDOM,L,null)};return t.sanitize=function(Me){let L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},de=null,je=null,ht=null,cr=null;if(Dn=!Me,Dn&&(Me="<!-->"),typeof Me!="string"&&!kv(Me))if(typeof Me.toString=="function"){if(Me=Me.toString(),typeof Me!="string")throw qo("dirty is not a string, aborting")}else throw qo("toString is not a function");if(!t.isSupported)return Me;if(pe||rt(L),t.removed=[],typeof Me=="string"&&(gt=!1),gt){if(Me.nodeName){const da=Ce(Me.nodeName);if(!ae[da]||I[da])throw qo("root node is forbidden and cannot be sanitized in-place")}}else if(Me instanceof l)de=jv("<!---->"),je=de.ownerDocument.importNode(Me,!0),je.nodeType===Ko.element&&je.nodeName==="BODY"||je.nodeName==="HTML"?de=je:de.appendChild(je);else{if(!_e&&!ue&&!le&&Me.indexOf("<")===-1)return w&&ye?w.createHTML(Me):Me;if(de=jv(Me),!de)return _e?null:ye?k:""}de&&we&&In(de.firstChild);const Et=Nv(gt?Me:de);for(;ht=Et.nextNode();)Sv(ht),Ov(ht),ht.content instanceof i&&aM(ht.content);if(gt)return Me;if(_e){if(H)for(cr=_.call(de.ownerDocument);de.firstChild;)cr.appendChild(de.firstChild);else cr=de;return(Y.shadowroot||Y.shadowrootmode)&&(cr=T.call(n,cr,!0)),cr}let Dr=le?de.outerHTML:de.innerHTML;return le&&ae["!doctype"]&&de.ownerDocument&&de.ownerDocument.doctype&&de.ownerDocument.doctype.name&&vr(xk,de.ownerDocument.doctype.name)&&(Dr="<!DOCTYPE "+de.ownerDocument.doctype.name+`>
|
|
556
|
+
`+Dr),ue&&Bc([O,R,E],da=>{Dr=Uo(Dr,da," ")}),w&&ye?w.createHTML(Dr):Dr},t.setConfig=function(){let Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};rt(Me),pe=!0},t.clearConfig=function(){Te=null,pe=!1},t.isValidAttribute=function(Me,L,de){Te||rt({});const je=Ce(Me),ht=Ce(L);return Cv(je,ht,de)},t.addHook=function(Me,L){typeof L=="function"&&Wo(M[Me],L)},t.removeHook=function(Me,L){if(L!==void 0){const de=P$(M[Me],L);return de===-1?void 0:M$(M[Me],de,1)[0]}return by(M[Me])},t.removeHooks=function(Me){M[Me]=[]},t.removeAllHooks=function(){M=Cy()},t}var Y$=gk();function G$({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:$("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 Uc(){return a.jsx("span",{className:"mx-0.5 h-4 w-px shrink-0 bg-border"})}function Sx({content:e="",onChange:t,placeholder:r="Add a description…",className:n,toolbarClassName:s,editorClassName:i}){const o=t1({extensions:[r1.configure({heading:{levels:[1,2,3]}}),n1,pE,xE.configure({nested:!0}),a1.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,p)=>a.jsx(G$,{title:d,onClick:f,active:m,disabled:p,children:u},d),c="h-3.5 w-3.5";return a.jsxs("div",{className:$("flex flex-col overflow-hidden",n),children:[a.jsxs("div",{className:$("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(SD,{className:c}),()=>o.chain().focus().undo().run(),!1,!o.can().undo()),l("Redo",a.jsx(hD,{className:c}),()=>o.chain().focus().redo().run(),!1,!o.can().redo()),a.jsx(Uc,{}),l("Bold (⌘B)",a.jsx(j1,{className:c}),()=>o.chain().focus().toggleBold().run(),o.isActive("bold")),l("Italic (⌘I)",a.jsx(M1,{className:c}),()=>o.chain().focus().toggleItalic().run(),o.isActive("italic")),l("Underline (⌘U)",a.jsx(kD,{className:c}),()=>o.chain().focus().toggleUnderline().run(),o.isActive("underline")),l("Strikethrough",a.jsx($1,{className:c}),()=>o.chain().focus().toggleStrike().run(),o.isActive("strike")),l("Inline code",a.jsx(_1,{className:c}),()=>o.chain().focus().toggleCode().run(),o.isActive("code")),a.jsx(Uc,{}),l("Heading 1",a.jsx(rD,{className:c}),()=>o.chain().focus().toggleHeading({level:1}).run(),o.isActive("heading",{level:1})),l("Heading 2",a.jsx(nD,{className:c}),()=>o.chain().focus().toggleHeading({level:2}).run(),o.isActive("heading",{level:2})),l("Heading 3",a.jsx(aD,{className:c}),()=>o.chain().focus().toggleHeading({level:3}).run(),o.isActive("heading",{level:3})),a.jsx(Uc,{}),l("Bullet list",a.jsx(A1,{className:c}),()=>o.chain().focus().toggleBulletList().run(),o.isActive("bulletList")),l("Ordered list",a.jsx(E1,{className:c}),()=>o.chain().focus().toggleOrderedList().run(),o.isActive("orderedList")),l("Task list",a.jsx(lD,{className:c}),()=>o.chain().focus().toggleTaskList().run(),o.isActive("taskList")),a.jsx(Uc,{}),l("Blockquote",a.jsx(mD,{className:c}),()=>o.chain().focus().toggleBlockquote().run(),o.isActive("blockquote")),l("Code block",a.jsx(C1,{className:c}),()=>o.chain().focus().toggleCodeBlock().run(),o.isActive("codeBlock")),l("Divider line",a.jsx(xi,{className:c}),()=>o.chain().focus().setHorizontalRule().run())]}),a.jsx(s1,{editor:o,className:$("flex-1 px-5 py-4",i)})]})}function Cx({html:e,className:t}){return e?a.jsx("div",{className:$("meridian-editor",t),dangerouslySetInnerHTML:{__html:Y$.sanitize(e,{ADD_ATTR:["data-type","data-id","data-label"]})}}):null}const _y=[{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 _x(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)&65535;return _y[t%_y.length]}function V$({body:e}){const t=e.trim();return t?/^<[a-z][\s\S]*>/i.test(t)?a.jsx(Cx,{html:t,className:"text-xs"}):a.jsx("p",{className:"text-xs text-foreground leading-relaxed whitespace-pre-wrap",children:t}):null}const Oy={created:{icon:dt,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40"},status_changed:{icon:Hp,color:"text-indigo-500",bg:"bg-indigo-50 dark:bg-indigo-950/40"},assigned:{icon:co,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40"},unassigned:{icon:z1,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800"},updated:{icon:ti,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40"}};function X$(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:si[c]??c})]}),d&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:si[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(p=>!d.includes(p)),f=d.filter(p=>!c.includes(p)),m=p=>{var x;return((x=t==null?void 0:t.get(p))==null?void 0:x.name)??p.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:On[f]??String(f)})]}),m!=null&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:On[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:xs[f]??String(f)})]}),m!=null&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:xs[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 vk({issueId:e,projectId:t,className:r,compact:n,onViewMore:s,onTabChange:i,hideCommentInput:o}){const[l,c]=h.useState("comments"),d=w=>{c(w),i==null||i(w)},u=h.useRef(null),f=h.useRef(null),{user:m}=Ie(),{data:p}=yi(),{data:x,isLoading:g}=BA(e),{data:v,isLoading:y}=WA(e),{data:j}=ck(e);h.useEffect(()=>{var k;const w=x==null?void 0:x.length;w!==void 0&&(f.current!==null&&w>f.current&&((k=u.current)==null||k.scrollIntoView({behavior:"smooth",block:"nearest"})),f.current=w)},[x==null?void 0:x.length]);const N=w=>{var k;if(m&&w===m.id){const b=m.first_name??"",S=m.last_name??"",_=`${b} ${S}`.trim()||m.email,C=(b[0]??S[0]??((k=m.email)==null?void 0:k[0])??"U").toUpperCase();return{name:_,initials:C}}return(p==null?void 0:p.get(w))??{name:"Unknown",initials:"?"}};return a.jsxs("div",{className:r,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(w=>{const k=w==="comments"?(x==null?void 0:x.length)??0:w==="activity"?(v==null?void 0:v.length)??0:void 0,b=w==="comments"?"Comments":w==="activity"?"Activity":w==="attachments"?"Attachments":"Time",S=l===w;return a.jsxs("button",{onClick:()=>d(w),className:$("pb-2.5 mr-5 text-xs font-medium transition-colors border-b-2 -mb-px",S?"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,k!=null&&k>0&&a.jsx("span",{className:$("ml-1.5 text-[10px] tabular-nums font-normal",S?"text-indigo-700 dark:text-indigo-500":"text-zinc-400"),children:k})]},w)})}),l==="comments"&&a.jsxs("div",{className:"px-6 pb-5 pt-4",children:[a.jsx("div",{className:"space-y-5 mb-5",children:g?a.jsxs("div",{className:"flex gap-3",children:[a.jsx(oe,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsx(oe,{className:"h-16 flex-1"})]}):x&&x.length>0?(n?x.slice(-5):x).map(w=>{const k=N(w.author_id),b=_x(k.name),S=(j??[]).filter(_=>_.comment_id===w.id);return a.jsxs("div",{className:"flex gap-3",children:[a.jsx(Ft,{className:"h-7 w-7 mt-0.5 shrink-0",children:a.jsx(Bt,{className:$("text-[11px] font-semibold",b.bg,b.text),children:k.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:k.name}),a.jsx("span",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:me(new Date(w.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(V$,{body:w.body})}),S.length>0&&a.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:S.map(_=>a.jsx(a$,{attachment:_},_.id))})]})]},w.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"})]})}),n&&x&&x.length>5&&s&&a.jsxs("button",{onClick:s,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 ",x.length," comments →"]}),a.jsx("div",{ref:u}),!o&&a.jsx(mk,{issueId:e,projectId:t})]}),l==="activity"&&a.jsx("div",{className:"px-6 pb-6 pt-4",children:y?a.jsx("div",{className:"space-y-4",children:[1,2,3].map(w=>a.jsxs("div",{className:"flex gap-3",children:[a.jsx(oe,{className:"h-6 w-6 rounded-full shrink-0 mt-0.5"}),a.jsx(oe,{className:"h-4 flex-1 mt-1"})]},w))}):v&&v.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:(n?v.slice(-5):v).map((w,k,b)=>{var M;const S=Oy[w.action]??Oy.updated,_=S.icon,C=((M=p==null?void 0:p.get(w.actor_id))==null?void 0:M.name)??"System",T=k===b.length-1;return a.jsxs("div",{className:$("relative flex gap-3",T?"pb-0":"pb-4"),children:[a.jsx("div",{className:$("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full mt-0.5",S.bg),children:a.jsx(_,{className:$("h-3 w-3",S.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:C})," ",a.jsx("span",{className:"text-zinc-500 dark:text-zinc-400",children:X$(w,p)})]}),a.jsx("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:me(new Date(w.created_at),"MMM d, yyyy · h:mm a")})]})]},w.id)})})]}),n&&v.length>5&&s&&a.jsxs("button",{onClick:s,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 ",v.length," events →"]})]}):a.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 py-4",children:"No activity yet."})}),l==="attachments"&&a.jsx(o$,{issueId:e}),l==="time"&&a.jsx(v$,{issueId:e})]})}const yk=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Kj,{ref:n,className:$("relative overflow-hidden",e),...r,children:[a.jsx(TM,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(bk,{}),a.jsx(IM,{})]}));yk.displayName=Kj.displayName;const bk=h.forwardRef(({className:e,orientation:t="vertical",...r},n)=>a.jsx(Yj,{ref:n,orientation:t,className:$("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"})}));bk.displayName=Yj.displayName;function Q$(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 Z$(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?me(new Date(e.start_date),"MMM d"):"—",r=e.end_date?me(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}const J$={urgent:"bg-red-500",high:"bg-orange-500",medium:"bg-amber-500",low:"bg-sky-500",no_priority:"bg-zinc-400"};function e6(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 Rn=({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}),Yo=()=>a.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800"});function wk({issue:e,projectId:t,open:r,onClose:n}){const s=jt(),{workspace:i,projectKey:o}=Wt(),{data:l}=y1((e==null?void 0:e.id)??""),c=l??e,[d,u]=h.useState(!1),[f,m]=h.useState(""),[p,x]=h.useState(""),[g,v]=h.useState("comments"),[y,j]=h.useState(!1),[N,w]=h.useState(new Set),k=Pu((c==null?void 0:c.id)??"",t),{data:b}=aa(t),S=h.useMemo(()=>b?b.members.filter(H=>H.user).map(H=>H.user):void 0,[b]),{data:_}=vo(t),{data:C}=bo(t||void 0),{data:T}=lc(t||void 0),{data:M}=Kl(t||void 0),{data:O}=px(),{data:R=[]}=xx(new Date().getFullYear()),E=(C??[]).filter(H=>H.status!=="completed"),{data:A}=a4(),P=(A==null?void 0:A.maxChildIssueDepth)??1,Q=(c?Q$(c,M??[]):0)<P,K=c!=null&&c.parent_id?M==null?void 0:M.find(H=>H.id===c.parent_id):null,se=(M==null?void 0:M.filter(H=>H.parent_id===(c==null?void 0:c.id)))??[],ae=c!=null&&c.task_list_id?T==null?void 0:T.find(H=>H.id===c.task_list_id):null,W=_&&_.length>0?Object.fromEntries(_.map(H=>[H.key,H.name])):si;if(h.useEffect(()=>{c&&(m(c.title),x(c.description??"")),u(!1)},[c==null?void 0:c.id]),!c)return null;const Y=()=>{f.trim()&&k.mutate({title:f.trim(),description:p.trim()||void 0},{onSuccess:()=>{u(!1),B.success("Issue updated")},onError:()=>B.error("Failed to update issue")})},te=()=>{m(c.title),x(c.description??""),u(!1)},X=H=>{k.mutate({status:H},{onSuccess:()=>B.success("Status updated"),onError:()=>B.error("Failed to update status")})},I=H=>{k.mutate({priority:H},{onSuccess:()=>B.success("Priority updated"),onError:()=>B.error("Failed to update priority")})},D=H=>{k.mutate({type:H},{onSuccess:()=>B.success("Type updated"),onError:()=>B.error("Failed to update type")})},Z=H=>{k.mutate({assignee_ids:H},{onSuccess:()=>B.success("Assignees updated"),onError:()=>B.error("Failed to update assignees")})},F=H=>{k.mutate({sprint_id:H},{onSuccess:()=>B.success(H?"Sprint assigned":"Removed from sprint"),onError:()=>B.error("Failed to update sprint")})},q=H=>{k.mutate({task_list_id:H},{onSuccess:()=>B.success(H?"Moved to list":"Removed from list"),onError:()=>B.error("Failed to update list")})},ce=H=>{k.mutate({start_date:H?me(H,"yyyy-MM-dd"):null},{onSuccess:()=>B.success(H?"Start date set":"Start date cleared"),onError:()=>B.error("Failed to update start date")})},ee=H=>{k.mutate({due_date:H?me(H,"yyyy-MM-dd"):null},{onSuccess:()=>B.success(H?"Due date set":"Due date cleared"),onError:()=>B.error("Failed to update due date")})},ue=H=>{if(H){const ye=c.start_date?new Date(c.start_date):new Date,De=new Date(ye);De.setDate(De.getDate()+7),k.mutate({recurrence_frequency:"weekly",next_occurrence_date:me(De,"yyyy-MM-dd"),recurrence_end_date:null},{onSuccess:()=>B.success("Recurrence enabled"),onError:()=>B.error("Failed to enable recurrence")})}else k.mutate({recurrence_frequency:null,next_occurrence_date:null,recurrence_end_date:null},{onSuccess:()=>B.success("Recurrence stopped"),onError:()=>B.error("Failed to stop recurrence")})},V=H=>{const ye=c.start_date?new Date(c.start_date):new Date,De=new Date(ye);H==="weekly"?De.setDate(De.getDate()+7):De.setMonth(De.getMonth()+1),k.mutate({recurrence_frequency:H,next_occurrence_date:me(De,"yyyy-MM-dd")},{onSuccess:()=>B.success("Frequency updated"),onError:()=>B.error("Failed to update frequency")})},le=H=>{k.mutate({recurrence_end_date:H?me(H,"yyyy-MM-dd"):null},{onSuccess:()=>B.success(H?"End date set":"End date cleared"),onError:()=>B.error("Failed to update end date")})},pe=_==null?void 0:_.find(H=>H.category==="completed"),we=!!pe&&c.status===pe.key,_e=(H,ye,De)=>{const He=H;return a.jsx("button",{title:ye,onClick:De,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(He,{className:"h-4 w-4"})},ye)};return a.jsxs(a.Fragment,{children:[a.jsx(gi,{open:r,onOpenChange:H=>!H&&n(),children:a.jsxs(vi,{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 H;pe&&X(we?((H=_==null?void 0:_.find(ye=>ye.category==="unstarted"||ye.category==="backlog"))==null?void 0:H.key)??c.status:pe.key)},className:$("flex items-center gap-1.5 px-3 py-1.5 rounded-md border text-xs font-medium transition-colors",we?"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(ir,{className:"h-3.5 w-3.5"}),we?"Completed":"Mark complete"]}),a.jsxs("div",{className:"flex items-center",children:[_e(wD,"Upvote"),_e(Qp,"Attachments"),Q&&_e(Xn,"Add sub-issue",()=>j(!0)),_e(Zl,"Copy link",()=>{navigator.clipboard.writeText(`${window.location.origin}/${i}/projects/${o}/issues/${c.id}`),B.success("Link copied")}),_e(cD,"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(J,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:te,children:"Cancel"}),a.jsxs(J,{size:"sm",className:"h-7 text-xs",onClick:Y,disabled:!f.trim()||k.isPending,children:[a.jsx(ir,{className:"h-3.5 w-3.5 mr-1"}),"Save"]})]}):a.jsxs(Wr,{children:[a.jsx(Ur,{asChild:!0,children:_e(ka,"More options")}),a.jsx(Cr,{align:"end",className:"w-40",children:a.jsxs(nt,{onClick:()=>u(!0),children:[a.jsx(ti,{className:"h-3.5 w-3.5 mr-2"}),"Edit"]})})]}),_e(fD,"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(Ae,{value:f,onChange:H=>m(H.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:xs[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(Ui,{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(Ui,{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(yk,{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"px-6 pb-4 space-y-5 min-w-0",children:[a.jsx(Nr,{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(Rn,{children:"Status"}),a.jsxs(Be,{value:c.status,onValueChange:X,children:[a.jsx(ze,{className:"h-8 text-xs min-w-0",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(W).map(([H,ye])=>{const De=_==null?void 0:_.find(He=>He.key===H);return a.jsx(ke,{value:H,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:$("h-2 w-2 rounded-full shrink-0 flex-none",e6(De==null?void 0:De.category,H))}),a.jsx("span",{children:ye})]})},H)})})]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx(Rn,{children:"Priority"}),a.jsxs(Be,{value:c.priority,onValueChange:I,children:[a.jsx(ze,{className:"h-8 text-xs min-w-0",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(On).map(([H,ye])=>a.jsx(ke,{value:H,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:$("h-2 w-2 rounded-full shrink-0 flex-none",J$[H]??"bg-zinc-400")}),a.jsx("span",{children:ye})]})},H))})]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx(Rn,{children:"Type"}),a.jsxs(Be,{value:c.type,onValueChange:D,children:[a.jsx(ze,{className:"h-8 text-xs min-w-0",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(xs).map(([H,ye])=>a.jsx(ke,{value:H,className:"text-xs",children:ye},H))})]})]})]}),a.jsx(Yo,{}),a.jsxs("div",{children:[a.jsx(Rn,{children:"Assignees"}),a.jsx(cc,{value:c.assignee_ids??[],onChange:Z,disabled:k.isPending,users:S})]}),a.jsx(Yo,{}),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(Rn,{children:"Sprint"}),a.jsxs(Be,{value:c.sprint_id??"none",onValueChange:H=>F(H==="none"?null:H),children:[a.jsx(ze,{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(Br,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No sprint"})]})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),E.map(H=>{const ye=Z$(H);return a.jsx(ke,{value:H.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:H.name}),ye&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:ye})]})},H.id)})]})]})]}),(T??[]).length>0&&a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Rn,{children:"List"}),a.jsxs(Be,{value:c.task_list_id??"none",onValueChange:H=>q(H==="none"?null:H),children:[a.jsx(ze,{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(Xp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No list",children:ae?ae.name:"No list"})]})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(T??[]).map(H=>a.jsx(ke,{value:H.id,className:"text-xs",children:H.name},H.id))]})]})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Rn,{children:"Start Date"}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{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?me(new Date(c.start_date),"MMM d, yyyy"):"No date"})]})}),a.jsxs(St,{className:"w-auto p-0",align:"start",children:[a.jsx(hr,{mode:"single",selected:c.start_date?new Date(c.start_date):void 0,onSelect:ce,initialFocus:!0}),c.start_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>ce(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(st,{className:"h-3 w-3"}),"Clear date"]})})]})]})]}),(c==null?void 0:c.start_date)&&(c==null?void 0:c.due_date)&&(O==null?void 0:O.working_days)&&(()=>{const H=jh(new Date(c.start_date),new Date(c.due_date),O.working_days,R);return a.jsxs("div",{className:"shrink-0 self-end pb-1 text-[11px] text-muted-foreground whitespace-nowrap",children:[H," biz day",H!==1?"s":""]})})(),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Rn,{children:"Due Date"}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{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?me(new Date(c.due_date),"MMM d, yyyy"):"No date"})]})}),a.jsxs(St,{className:"w-auto p-0",align:"start",children:[a.jsx(hr,{mode:"single",selected:c.due_date?new Date(c.due_date):void 0,onSelect:ee,initialFocus:!0}),c.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>ee(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(st,{className:"h-3 w-3"}),"Clear date"]})})]})]})]})]}),a.jsx(Yo,{}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Rn,{children:"Recurring"}),a.jsx(wo,{checked:!!c.recurrence_frequency,onCheckedChange:ue,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(Be,{value:c.recurrence_frequency,onValueChange:H=>V(H),children:[a.jsx(ze,{className:"h-7 text-xs",children:a.jsx(Ye,{})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(ke,{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(Ot,{children:[a.jsx(Pt,{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(mr,{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?me(new Date(c.recurrence_end_date),"MMM d, yyyy"):"No end date"})]})}),a.jsxs(St,{className:"w-auto p-0",align:"start",children:[a.jsx(hr,{mode:"single",selected:c.recurrence_end_date?new Date(c.recurrence_end_date):void 0,onSelect:le,initialFocus:!0}),c.recurrence_end_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>le(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(st,{className:"h-3 w-3"}),"Clear end date"]})})]})]})]})]})]}),a.jsx(Yo,{}),Q&&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(dt,{className:"h-3 w-3"}),"Add"]})]}),K&&a.jsxs("button",{onClick:()=>s(`/${i}/projects/${o}/issues/${K.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(Kp,{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:K.identifier}),a.jsx("span",{className:"text-xs text-zinc-600 dark:text-zinc-300 truncate",children:K.title})]}),se.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(dt,{className:"h-3.5 w-3.5"}),"Create child issue"]}):a.jsx("div",{className:"space-y-1",children:se.map(H=>{const ye=(M??[]).filter(Fe=>Fe.parent_id===H.id),De=ye.length>0,He=N.has(H.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:[De?a.jsx("button",{onClick:()=>w(Fe=>{const Qe=new Set(Fe);return Qe.has(H.id)?Qe.delete(H.id):Qe.add(H.id),Qe}),className:"shrink-0 text-indigo-400 dark:text-indigo-500 hover:text-indigo-600 dark:hover:text-indigo-300 transition-colors",children:He?a.jsx(ra,{className:"h-3.5 w-3.5"}):a.jsx(kr,{className:"h-3.5 w-3.5"})}):a.jsx(Sn,{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/${H.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:H.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:H.title}),De&&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(Sn,{className:"h-2.5 w-2.5"}),ye.length]})]})]}),De&&He&&a.jsx("div",{className:"mt-1 ml-6 space-y-1",children:ye.map(Fe=>a.jsxs("button",{onClick:()=>{n(),s(`/${i}/projects/${o}/issues/${Fe.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(Sn,{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:Fe.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:Fe.title})]},Fe.id))})]},H.id)})})]}),a.jsx(Yo,{}),a.jsxs("div",{children:[a.jsx(Rn,{children:"Description"}),d?a.jsx(Sx,{content:p,onChange:x,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(Cx,{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(ti,{className:"h-3.5 w-3.5"}),"Add description"]})]})]}),a.jsx("div",{className:"px-6 py-4",children:a.jsx(Nr,{zone:"issue.details.after",props:{issue:c}})}),a.jsx(vk,{issueId:c.id,projectId:t,className:"border-t border-border",compact:!0,hideCommentInput:!0,onTabChange:v,onViewMore:()=>{n(),s(`/${i}/projects/${o}/issues/${c.id}`)}})]}),g==="comments"&&a.jsx("div",{className:"border-t border-border px-6 py-3 shrink-0",children:a.jsx(mk,{issueId:c.id,projectId:t,compact:!0})})]})}),a.jsx(ef,{open:y,onClose:()=>j(!1),projectId:t,defaultParentId:c.id,defaultTaskListId:c.task_list_id})]})}function t6(){const{projectKey:e,workspace:t}=Wt(),r=Z1(),[n,s]=h.useState(null),[i,o]=h.useState(!1),[l,c]=h.useState({}),{data:d}=Ia(e??""),u=(d==null?void 0:d.id)??"",{data:f,isLoading:m}=Kl(u||void 0,l),{data:p,isLoading:x}=vo(u||void 0),{data:g}=aa(u),{data:v}=yi(),y=TI(u),j=h.useMemo(()=>!(g!=null&&g.members)||!v?[]:g.members.map(k=>{const b=v.get(k.user_id);return b?{userId:k.user_id,name:b.name,initials:b.initials}:null}).filter(k=>k!==null),[g,v]);if(r&&e&&t)return a.jsx(Yn,{to:`/${t}/projects/${e}/issues`,replace:!0});if(!e)return null;const N=m||x||!d,w=k=>{y.mutate(k)};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(ZI,{statuses:p??[],members:j,filters:l,onChange:c}),a.jsxs(J,{size:"sm",onClick:()=>o(!0),children:[a.jsx(dt,{className:"h-4 w-4"}),"Create"]})]}),a.jsx(Nr,{zone:"project.board.before",props:{projectId:u}}),a.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:N?a.jsx("div",{className:"flex gap-4 px-6 py-6",children:[1,2,3,4].map(k=>a.jsxs("div",{className:"min-w-[260px]",children:[a.jsx(oe,{className:"h-5 w-24 mb-3 rounded"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(oe,{className:"h-[82px] w-full rounded-lg"}),a.jsx(oe,{className:"h-[82px] w-full rounded-lg"})]})]},k))}):a.jsx(RN,{issues:f??[],projectId:u,statuses:p??[],onIssueClick:s,onColumnsReorder:w,filters:l})})]}),a.jsx(Nr,{zone:"project.board.after",props:{projectId:u}}),a.jsx(wk,{issue:n,projectId:u,open:!!n,onClose:()=>s(null)}),a.jsx(ef,{open:i,onClose:()=>o(!1),projectId:u})]})}const Oh=({priority:e,className:t})=>{const r=$("h-3.5 w-3.5 shrink-0",hx[e],t);switch(e){case"urgent":return a.jsx(ys,{className:r});case"high":return a.jsx(Xl,{className:r});case"medium":return a.jsx(xi,{className:r});case"low":return a.jsx(Gl,{className:r});default:return a.jsx(ln,{className:$("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}},Ph="grid-cols-[70px_250px_150px_120px_130px_140px_130px_32px]";function jk({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 p=jt(),[x,g]=h.useState(null),[v,y]=h.useState(!1),j=Pu(e.id,t),{data:N}=aa(t),w=h.useMemo(()=>N?N.members.filter(C=>C.user).map(C=>C.user):void 0,[N]);function k(C){j.mutate(C),g(null)}const b=(s==null?void 0:s[e.status])??"#94a3b8",S=i.find(C=>C.id===e.sprint_id),_=u.length>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{onClick:()=>c(e),className:$(`group grid ${Ph} 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:$("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"),children:e.identifier}),a.jsxs("div",{className:$("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-white dark:bg-muted/20"),children:[_?a.jsxs(Gn,{children:[a.jsx(Vn,{asChild:!0,children:a.jsx("button",{onClick:C=>{C.stopPropagation(),y(!v)},className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:v?a.jsx(ra,{className:"h-3.5 w-3.5"}):a.jsx(kr,{className:"h-3.5 w-3.5"})})}),a.jsx(kn,{side:"top",children:v?"Collapse":"Expand"})]}):d?a.jsx(Sn,{className:"h-3 w-3 text-muted-foreground shrink-0"}):a.jsx("span",{className:"w-4 shrink-0"}),a.jsx("span",{className:$("text-sm text-foreground truncate",d&&"text-primary"),children:e.title}),_&&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(Sn,{className:"h-2.5 w-2.5"}),u.length]})]}),a.jsx("div",{onClick:C=>C.stopPropagation(),children:a.jsxs(Ot,{open:x==="status",onOpenChange:C=>g(C?"status":null),children:[a.jsx(Pt,{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:b}}),a.jsx("span",{className:"text-xs text-primary truncate",children:n[e.status]??e.status})]})}),a.jsx(St,{className:"w-52 p-1",align:"start",onClick:C=>C.stopPropagation(),children:a.jsx(Ks,{children:a.jsx(Ys,{children:a.jsx(rs,{children:r.map(C=>a.jsxs(sn,{value:C.name,onSelect:()=>k({status:C.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:C.color}}),a.jsx("span",{className:"text-xs flex-1",children:C.name}),e.status===C.key&&a.jsx(ir,{className:"h-3.5 w-3.5 text-indigo-500"})]},C.key))})})})})]})}),a.jsx("div",{onClick:C=>C.stopPropagation(),children:a.jsxs(Ot,{open:x==="priority",onOpenChange:C=>g(C?"priority":null),children:[a.jsx(Pt,{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(Oh,{priority:e.priority}),a.jsx("span",{className:"text-xs text-primary",children:On[e.priority]??e.priority})]})}),a.jsx(St,{className:"w-44 p-1",align:"start",onClick:C=>C.stopPropagation(),children:a.jsx(Ks,{children:a.jsx(Ys,{children:a.jsx(rs,{children:Object.entries(On).map(([C,T])=>a.jsxs(sn,{value:T,onSelect:()=>k({priority:C}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(Oh,{priority:C}),a.jsx("span",{className:"text-xs flex-1",children:T}),e.priority===C&&a.jsx(ir,{className:"h-3.5 w-3.5 text-indigo-500"})]},C))})})})})]})}),a.jsx("div",{onClick:C=>C.stopPropagation(),children:a.jsxs(Ot,{open:x==="sprint",onOpenChange:C=>g(C?"sprint":null),children:[a.jsx(Pt,{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(Br,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:$("text-xs truncate",S?"text-foreground":"text-muted-foreground"),children:(S==null?void 0:S.name)??"No sprint"})]})}),a.jsx(St,{className:"w-56 p-1",align:"start",onClick:C=>C.stopPropagation(),children:a.jsx(Ks,{children:a.jsx(Ys,{children:a.jsxs(rs,{children:[a.jsxs(sn,{value:"no-sprint",onSelect:()=>k({sprint_id:null}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(st,{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(ir,{className:"h-3.5 w-3.5 text-indigo-500"})]}),i.filter(C=>C.status!=="completed").map(C=>a.jsxs(sn,{value:C.name,onSelect:()=>k({sprint_id:C.id}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(Br,{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:C.name}),(C.start_date||C.end_date)&&a.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[C.start_date?me(new Date(C.start_date),"MMM d"):"—"," → ",C.end_date?me(new Date(C.end_date),"MMM d"):"—"]})]}),e.sprint_id===C.id&&a.jsx(ir,{className:"h-3.5 w-3.5 text-indigo-500 shrink-0"})]},C.id))]})})})})]})}),a.jsx("div",{onClick:C=>C.stopPropagation(),children:a.jsxs(Ot,{open:x==="due",onOpenChange:C=>g(C?"due":null),children:[a.jsx(Pt,{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(mr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:$("text-xs",e.due_date?"text-foreground":"text-muted-foreground"),children:e.due_date?me(new Date(e.due_date),"MMM d, yyyy"):"No due date"})]})}),a.jsxs(St,{className:"w-auto p-0",align:"start",onClick:C=>C.stopPropagation(),children:[a.jsx(hr,{mode:"single",selected:e.due_date?new Date(e.due_date):void 0,onSelect:C=>k({due_date:C?me(C,"yyyy-MM-dd"):null}),initialFocus:!0}),e.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>k({due_date:null}),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(st,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),a.jsx("div",{onClick:C=>C.stopPropagation(),children:a.jsx(cc,{value:e.assignee_ids??[],onChange:C=>j.mutate({assignee_ids:C}),users:w})}),a.jsxs("div",{className:"flex items-center gap-1 pr-6",onClick:C=>C.stopPropagation(),children:[!d&&m&&a.jsxs(Gn,{children:[a.jsx(Vn,{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(Sn,{className:"h-3.5 w-3.5"})})}),a.jsx(kn,{side:"top",children:"Add child issue"})]}),a.jsxs(Gn,{children:[a.jsx(Vn,{asChild:!0,children:a.jsx("button",{onClick:()=>p(`/${o}/projects/${l}/issues/${e.id}`),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:a.jsx(O1,{className:"h-3.5 w-3.5"})})}),a.jsx(kn,{side:"top",children:"Open full page"})]})]})]}),v&&u.map(C=>a.jsx(jk,{issue:C,projectId:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,workspace:o,projectKey:l,onOpen:c,isChild:!0,children:(f==null?void 0:f[C.id])??[],childrenMap:f,onAddChild:m},C.id))]})}function Py({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:p,onDeleteList:x}){const[g,v]=h.useState(!1),[y,j]=h.useState(!1),[N,w]=h.useState((e==null?void 0:e.name)??""),k=t.reduce((_,C)=>{var T;return _+(((T=r[C.id])==null?void 0:T.length)??0)},0),b=t.length+k,S=()=>{e&&N.trim()&&p&&p(e.id,N.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(Gn,{children:[a.jsx(Vn,{asChild:!0,children:a.jsx("button",{onClick:()=>v(!g),className:"text-muted-foreground hover:text-foreground transition-colors",children:g?a.jsx(kr,{className:"h-3.5 w-3.5"}):a.jsx(ra,{className:"h-3.5 w-3.5"})})}),a.jsx(kn,{side:"right",children:g?"Expand":"Collapse"})]}),e?y?a.jsx("input",{autoFocus:!0,value:N,onChange:_=>w(_.target.value),onBlur:S,onKeyDown:_=>{_.key==="Enter"&&S(),_.key==="Escape"&&(j(!1),w(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:b}),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(dt,{className:"h-3 w-3"}),"Add issue"]}),e&&a.jsxs(Wr,{children:[a.jsxs(Gn,{children:[a.jsx(Vn,{asChild:!0,children:a.jsx(Ur,{asChild:!0,children:a.jsx("button",{className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(ka,{className:"h-3.5 w-3.5"})})})}),a.jsx(kn,{side:"top",children:"More options"})]}),a.jsxs(Cr,{align:"end",className:"w-36",children:[a.jsxs(nt,{className:"text-xs gap-2 cursor-pointer",onClick:()=>{j(!0),w(e.name)},children:[a.jsx(ti,{className:"h-3.5 w-3.5"}),"Rename"]}),a.jsxs(nt,{className:"text-xs gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>x==null?void 0:x(e.id),children:[a.jsx(Sr,{className:"h-3.5 w-3.5"}),"Delete list"]})]})]})]})]}),!g&&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(_=>a.jsx(jk,{issue:_,projectId:n,statuses:s,statusLabels:i,statusColorMap:o,sprints:l,workspace:c,projectKey:d,onOpen:u,children:r[_.id]??[],childrenMap:r,onAddChild:m},_.id))})]})}function r6(){var I;const e=jt(),{workspace:t,projectKey:r}=Wt(),[n,s]=h.useState(null),[i,o]=h.useState({open:!1}),[l,c]=h.useState(""),[d,u]=h.useState(!1),[f,m]=h.useState(""),[p,x]=h.useState("all"),[g,v]=h.useState("all"),[y,j]=h.useState("all"),{data:N}=Ia(r??""),w=(N==null?void 0:N.id)??"",{data:k,isLoading:b}=Kl(w||void 0),{data:S}=vo(w||void 0),{data:_}=bo(w||void 0),{data:C}=lc(w||void 0),T=d4(w),M=u4(w),O=f4(w),R=S&&S.length>0?S:Object.entries(si).map(([D,Z],F)=>({id:D,project_id:w,key:D,name:Z,color:{backlog:"#94a3b8",todo:"#64748b",in_progress:"#6366f1",in_review:"#f59e0b",done:"#10b981",cancelled:"#9ca3af"}[D]??"#94a3b8",category:{backlog:"backlog",todo:"unstarted",in_progress:"started",in_review:"started",done:"completed",cancelled:"cancelled"}[D]??"backlog",position:F})),E=Object.fromEntries(R.map(D=>[D.key,D.name])),A=Object.fromEntries(R.map(D=>[D.key,D.color])),P=_??[];if(!r||!t)return null;const U=(k??[]).filter(D=>{const Z=!f||D.title.toLowerCase().includes(f.toLowerCase())||D.identifier.toLowerCase().includes(f.toLowerCase()),F=p==="all"||D.status===p,q=g==="all"||D.priority===g,ce=y==="all"||(y==="none"?!D.sprint_id:D.sprint_id===y);return Z&&F&&q&&ce}).sort((D,Z)=>{const F=parseInt(D.identifier.split("-")[1]??"0",10),q=parseInt(Z.identifier.split("-")[1]??"0",10);return F-q}),Q={};for(const D of k??[])D.parent_id&&(Q[D.parent_id]||(Q[D.parent_id]=[]),Q[D.parent_id].push(D));const K=U.filter(D=>!D.parent_id),se=U.length,ae=new Set((C??[]).map(D=>D.id)),W={__none__:[]};for(const D of C??[])W[D.id]=[];for(const D of K){const Z=D.task_list_id&&ae.has(D.task_list_id)?D.task_list_id:"__none__";W[Z].push(D)}function Y(){l.trim()&&T.mutate({name:l.trim()},{onSuccess:()=>{c(""),u(!1),B.success("List created")},onError:()=>B.error("Failed to create list")})}function te(D,Z){M.mutate({id:D,name:Z},{onError:()=>B.error("Failed to rename list")})}function X(D){const Z=C==null?void 0:C.find(F=>F.id===D);confirm(`Delete list "${Z==null?void 0:Z.name}"? Issues in this list will be moved to No List.`)&&O.mutate(D,{onSuccess:()=>B.success("List deleted"),onError:()=>B.error("Failed to delete list")})}return a.jsxs("div",{className:"p-2",children:[a.jsx(Nr,{zone:"project.issues.before",props:{projectId:w}}),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:[d?a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Ae,{autoFocus:!0,placeholder:"List name...",value:l,onChange:D=>c(D.target.value),onKeyDown:D=>{D.key==="Enter"&&Y(),D.key==="Escape"&&(u(!1),c(""))},className:"h-8 text-xs w-36"}),a.jsx(J,{size:"sm",variant:"outline",className:"h-8 text-xs",onClick:Y,disabled:!l.trim()||T.isPending,children:"Add"}),a.jsx(J,{size:"sm",variant:"ghost",className:"h-8 text-xs",onClick:()=>{u(!1),c("")},children:"Cancel"})]}):a.jsxs(J,{size:"sm",variant:"outline",onClick:()=>u(!0),children:[a.jsx(dt,{className:"h-4 w-4"}),"New List"]}),a.jsxs(J,{size:"sm",onClick:()=>o({open:!0}),children:[a.jsx(dt,{className:"h-4 w-4"}),"Create"]})]})}),a.jsxs("div",{className:"flex flex-col gap-2 px-4 md:px-6 py-3 border-b border-border md:flex-row md:items-center md:justify-between md:gap-3",children:[a.jsxs("div",{className:"flex items-center gap-2 md:overflow-x-auto md:scrollbar-none",children:[a.jsxs(Be,{value:y,onValueChange:j,children:[a.jsx(ze,{className:"h-8 text-xs flex-1 md:flex-none md:w-[140px] md:shrink-0 bg-transparent",children:a.jsx(Ye,{placeholder:"Sprint"})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All sprints"}),a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),P.map(D=>a.jsx(ke,{value:D.id,className:"text-xs",children:D.name},D.id))]})]}),a.jsxs(Be,{value:p,onValueChange:x,children:[a.jsx(ze,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:a.jsx(Ye,{placeholder:"Status"})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All statuses"}),R.map(({key:D,name:Z})=>a.jsx(ke,{value:D,className:"text-xs",children:Z},D))]})]}),a.jsxs(Be,{value:g,onValueChange:v,children:[a.jsx(ze,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:a.jsx(Ye,{placeholder:"Priority"})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(On).map(([D,Z])=>a.jsx(ke,{value:D,className:"text-xs",children:Z},D))]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx(lo,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Ae,{placeholder:"Search...",value:f,onChange:D=>m(D.target.value),className:"pl-8 h-8 w-full md:w-[200px] text-xs bg-transparent"})]})]}),a.jsx("div",{className:"hidden md:block overflow-x-auto",children:a.jsxs("div",{className:"min-w-[1025px]",children:[a.jsxs("div",{className:$("grid items-center py-2.5 border-b border-border",Ph),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"})]}),b?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(D=>a.jsxs("div",{className:$("grid items-center px-6 py-3 gap-4",Ph),children:[a.jsx(oe,{className:"h-4 w-14"}),a.jsx(oe,{className:"h-4 w-56"}),a.jsx(oe,{className:"h-5 w-20"}),a.jsx(oe,{className:"h-4 w-16"}),a.jsx(oe,{className:"h-4 w-20"}),a.jsx(oe,{className:"h-4 w-24"}),a.jsx(oe,{className:"h-6 w-16"}),a.jsx("span",{})]},D))}):se===0&&(k??[]).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(J,{size:"sm",onClick:()=>o({open:!0}),children:[a.jsx(dt,{className:"h-4 w-4"}),"Create issue"]})]}):K.length===0&&(k??[]).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(D=>a.jsx(Py,{taskList:D,issues:W[D.id]??[],childrenMap:Q,projectId:w,statuses:R,statusLabels:E,statusColorMap:A,sprints:P,workspace:t,projectKey:r,onOpen:s,onAddIssue:Z=>o({open:!0,defaultTaskListId:Z}),onAddChild:Z=>o({open:!0,defaultParentId:Z}),onRenameList:te,onDeleteList:X},D.id)),(((I=W.__none__)==null?void 0:I.length)>0||(C??[]).length===0)&&a.jsx(Py,{taskList:null,issues:W.__none__??[],childrenMap:Q,projectId:w,statuses:R,statusLabels:E,statusColorMap:A,sprints:P,workspace:t,projectKey:r,onOpen:s,onAddIssue:D=>o({open:!0,defaultTaskListId:D}),onAddChild:D=>o({open:!0,defaultParentId:D})})]})})]})}),a.jsx("div",{className:"md:hidden divide-y divide-border/60",children:b?[1,2,3,4].map(D=>a.jsx("div",{className:"flex items-start gap-3 px-4 py-3",children:a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"h-3 w-10 bg-muted rounded animate-pulse"}),a.jsx("div",{className:"h-4 w-48 bg-muted rounded animate-pulse"})]}),a.jsx("div",{className:"h-3 w-32 bg-muted rounded animate-pulse"})]})},D)):K.length===0?null:K.map(D=>{const Z=(A==null?void 0:A[D.status])??"#94a3b8",F=P.find(q=>q.id===D.sprint_id);return a.jsx("div",{onClick:()=>e(`/${t}/projects/${r}/issues/${D.id}`),className:"flex items-start gap-3 px-4 py-3 hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",children:a.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:D.identifier}),a.jsx("span",{className:"text-sm text-foreground truncate font-medium",children:D.title})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx(Oh,{priority:D.priority}),a.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground",children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{backgroundColor:Z}}),E[D.status]??D.status]}),F&&a.jsx("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px]",children:F.name}),D.due_date&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:me(new Date(D.due_date),"MMM d")})]})]})},D.id)})}),!b&&se>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:[se," issue",se!==1?"s":""]})})]}),a.jsx(Nr,{zone:"project.issues.after",props:{projectId:w}}),a.jsx(wk,{issue:n,projectId:w,open:!!n,onClose:()=>s(null)}),a.jsx(ef,{open:i.open,onClose:()=>o({open:!1}),projectId:w,defaultTaskListId:i.defaultTaskListId,defaultParentId:i.defaultParentId})]})}function n6(e,t=[]){let r=[];function n(i,o){const l=h.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:p,...x}=f,g=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>x,Object.values(x));return a.jsx(g.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;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=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,a6(s,...t)]}function a6(...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 h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var s6=Symbol("radix.slottable");function i6(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=s6,t}var Nk="AlertDialog",[o6]=n6(Nk,[Gj]),Fa=Gj(),kk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Fa(t);return a.jsx(Hl,{...n,...r,modal:!0})};kk.displayName=Nk;var l6="AlertDialogTrigger",c6=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Fa(r);return a.jsx(zM,{...s,...n,ref:t})});c6.displayName=l6;var d6="AlertDialogPortal",Sk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Fa(t);return a.jsx(ql,{...n,...r})};Sk.displayName=d6;var u6="AlertDialogOverlay",Ck=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Fa(r);return a.jsx(mi,{...s,...n,ref:t})});Ck.displayName=u6;var Li="AlertDialogContent",[f6,m6]=o6(Li),h6=i6("AlertDialogContent"),_k=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=Fa(r),o=h.useRef(null),l=_u(t,o),c=h.useRef(null);return a.jsx($M,{contentName:Li,titleName:Ok,docsSlug:"alert-dialog",children:a.jsx(f6,{scope:r,cancelRef:c,children:a.jsxs(hi,{role:"alertdialog",...i,...s,ref:l,onOpenAutoFocus:Rs(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(h6,{children:n}),a.jsx(x6,{contentRef:o})]})})})});_k.displayName=Li;var Ok="AlertDialogTitle",Pk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Fa(r);return a.jsx(ao,{...s,...n,ref:t})});Pk.displayName=Ok;var Mk="AlertDialogDescription",Ek=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Fa(r);return a.jsx(so,{...s,...n,ref:t})});Ek.displayName=Mk;var p6="AlertDialogAction",Ak=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Fa(r);return a.jsx(Cu,{...s,...n,ref:t})});Ak.displayName=p6;var Dk="AlertDialogCancel",Tk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=m6(Dk,r),i=Fa(r),o=_u(t,s);return a.jsx(Cu,{...i,...n,ref:o})});Tk.displayName=Dk;var x6=({contentRef:e})=>{const t=`\`${Li}\` requires a description for the component to be accessible for screen reader users.
|
|
557
|
+
|
|
558
|
+
You can add a description to the \`${Li}\` by passing a \`${Mk}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
559
|
+
|
|
560
|
+
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 \`${Li}\`. 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.
|
|
561
|
+
|
|
562
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},g6=kk,v6=Sk,Ik=Ck,Rk=_k,$k=Ak,zk=Tk,Lk=Pk,Fk=Ek;const Gs=g6,y6=v6,Bk=h.forwardRef(({className:e,...t},r)=>a.jsx(Ik,{className:$("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}));Bk.displayName=Ik.displayName;const ns=h.forwardRef(({className:e,...t},r)=>a.jsxs(y6,{children:[a.jsx(Bk,{}),a.jsx(Rk,{ref:r,className:$("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})]}));ns.displayName=Rk.displayName;const as=({className:e,...t})=>a.jsx("div",{className:$("flex flex-col space-y-2 text-center sm:text-left",e),...t});as.displayName="AlertDialogHeader";const ss=({className:e,...t})=>a.jsx("div",{className:$("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ss.displayName="AlertDialogFooter";const is=h.forwardRef(({className:e,...t},r)=>a.jsx(Lk,{ref:r,className:$("text-base font-semibold",e),...t}));is.displayName=Lk.displayName;const os=h.forwardRef(({className:e,...t},r)=>a.jsx(Fk,{ref:r,className:$("text-sm text-muted-foreground",e),...t}));os.displayName=Fk.displayName;const ls=h.forwardRef(({className:e,...t},r)=>a.jsx($k,{ref:r,className:$(zi(),e),...t}));ls.displayName=$k.displayName;const cs=h.forwardRef(({className:e,...t},r)=>a.jsx(zk,{ref:r,className:$(zi({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));cs.displayName=zk.displayName;const Tr=20;function b6({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(Ft,{className:"h-8 w-8 shrink-0",children:a.jsx(Bt,{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(yl,{className:$("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(J,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity",onClick:()=>t(e.user_id,i),children:a.jsx(st,{className:"h-3.5 w-3.5"})})]})}function w6({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(ri,{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(J,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity",onClick:()=>t(e.team_id),children:a.jsx(st,{className:"h-3.5 w-3.5"})})]})}function j6(){const{projectKey:e}=Wt(),{workspace:t}=Ie(),r=(t==null?void 0:t.id)??"",{data:n}=Ia(e??""),s=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=aa(s),{data:l}=ec(r),{data:c}=Tu(r),d=Y1(s),u=G1(s),f=V1(s),m=X1(s),[p,x]=h.useState(""),[g,v]=h.useState(""),[y,j]=h.useState(0),[N,w]=h.useState(0),[k,b]=h.useState(null),S=new Set((i==null?void 0:i.members.map(E=>E.user_id))??[]),_=new Set((i==null?void 0:i.teams.map(E=>E.team_id))??[]),C=(l??[]).filter(E=>!S.has(E.user_id)),T=(c??[]).filter(E=>!_.has(E.id)),M=(i==null?void 0:i.members.length)??0,O=(i==null?void 0:i.teams.length)??0;function R(){k&&u.mutate(k.userId,{onSuccess:()=>{B.success("Access removed"),b(null)},onError:()=>B.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:[M," member",M!==1?"s":""," • ",O," team",O!==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(E=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(oe,{className:"h-8 w-8 rounded-full"}),a.jsx(oe,{className:"h-4 w-44"}),a.jsx("div",{className:"flex-1"}),a.jsx(oe,{className:"h-5 w-20"})]},E))}),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(E=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(oe,{className:"h-8 w-8 rounded-lg"}),a.jsx(oe,{className:"h-4 w-32"}),a.jsx("div",{className:"flex-1"}),a.jsx(oe,{className:"h-4 w-20"})]},E))})]}):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"}),C.length>0&&a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsxs(Be,{value:p,onValueChange:x,children:[a.jsx(ze,{className:"h-8 text-xs w-full sm:w-56",children:a.jsx(Ye,{placeholder:"Add person…"})}),a.jsx(Le,{children:C.map(E=>{const A=E.user,P=(A==null?void 0:A.first_name)??"",U=(A==null?void 0:A.last_name)??"",Q=`${P} ${U}`.trim()||(A==null?void 0:A.email)||"Unknown";return a.jsx(ke,{value:E.user_id,children:Q},E.user_id)})})]}),a.jsxs(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:!p||d.isPending,onClick:()=>d.mutate({userId:p},{onSuccess:()=>{B.success("Access granted"),x("")},onError:()=>B.error("Failed to grant access")}),children:[a.jsx(co,{className:"h-3.5 w-3.5"}),"Add"]})]})]}),M===0?a.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No individual members."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"divide-y divide-border",children:((i==null?void 0:i.members)??[]).slice(y*Tr,(y+1)*Tr).map(E=>a.jsx(b6,{member:E,onRequestRemove:(A,P)=>b({userId:A,displayName:P})},E.id))}),M>Tr&&a.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:[y*Tr+1,"–",Math.min((y+1)*Tr,M)," of ",M]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>j(E=>E-1),disabled:y===0,children:a.jsx(ms,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[y+1," / ",Math.ceil(M/Tr)]}),a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>j(E=>E+1),disabled:(y+1)*Tr>=M,children:a.jsx(kr,{className:"h-3.5 w-3.5"})})]})]})]})]}),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"}),T.length>0&&a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsxs(Be,{value:g,onValueChange:v,children:[a.jsx(ze,{className:"h-8 text-xs w-full sm:w-56",children:a.jsx(Ye,{placeholder:"Add team…"})}),a.jsx(Le,{children:T.map(E=>a.jsx(ke,{value:E.id,children:E.name},E.id))})]}),a.jsxs(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:!g||f.isPending,onClick:()=>f.mutate(g,{onSuccess:()=>{B.success("Team access granted"),v("")},onError:()=>B.error("Failed to add team")}),children:[a.jsx(ri,{className:"h-3.5 w-3.5"}),"Add"]})]})]}),O===0?a.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No teams have access."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"divide-y divide-border",children:((i==null?void 0:i.teams)??[]).slice(N*Tr,(N+1)*Tr).map(E=>a.jsx(w6,{teamEntry:E,onRemove:A=>m.mutate(A,{onSuccess:()=>B.success("Team access removed"),onError:()=>B.error("Failed to remove team")})},E.id))}),O>Tr&&a.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:[N*Tr+1,"–",Math.min((N+1)*Tr,O)," of ",O]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>w(E=>E-1),disabled:N===0,children:a.jsx(ms,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[N+1," / ",Math.ceil(O/Tr)]}),a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>w(E=>E+1),disabled:(N+1)*Tr>=O,children:a.jsx(kr,{className:"h-3.5 w-3.5"})})]})]})]})]}),M===0&&O===0&&C.length===0&&T.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(ri,{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(Gs,{open:!!k,onOpenChange:E=>{E||b(null)},children:a.jsxs(ns,{className:"sm:max-w-md",children:[a.jsxs(as,{children:[a.jsx(is,{children:"Remove member access?"}),a.jsx(os,{children:k?`${k.displayName} will lose access to this project.`:"This member will lose access to this project."})]}),a.jsxs(ss,{children:[a.jsx(cs,{disabled:u.isPending,children:"Cancel"}),a.jsx(ls,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:E=>{E.preventDefault(),R()},disabled:u.isPending,children:u.isPending?"Removing...":"Remove"})]})]})})]})}function My(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?me(new Date(e.start_date),"MMM d"):"—",r=e.end_date?me(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function fa({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 N6={backlog:a.jsx(ln,{className:"h-3 w-3 text-zinc-400"}),todo:a.jsx(ln,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:a.jsx(na,{className:"h-3 w-3 text-indigo-500"}),in_review:a.jsx(pi,{className:"h-3 w-3 text-amber-500"}),done:a.jsx(Na,{className:"h-3 w-3 text-emerald-500"}),cancelled:a.jsx(Yp,{className:"h-3 w-3 text-zinc-400"})},k6={urgent:a.jsx(ys,{className:"h-3 w-3 text-red-500"}),high:a.jsx(Xl,{className:"h-3 w-3 text-orange-500"}),medium:a.jsx(xi,{className:"h-3 w-3 text-yellow-500"}),low:a.jsx(Gl,{className:"h-3 w-3 text-blue-400"})},S6={bug:a.jsx(N1,{className:"h-3 w-3 text-red-500"}),feature:a.jsx(I1,{className:"h-3 w-3 text-purple-500"}),task:a.jsx(R1,{className:"h-3 w-3 text-blue-500"}),chore:a.jsx(Hp,{className:"h-3 w-3 text-zinc-500"})};function Im({value:e,onValueChange:t,options:r,icons:n,placeholder:s}){return a.jsxs(Be,{value:e,onValueChange:t,children:[a.jsx(ze,{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(S1,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("span",{children:r[e]??s??""})]})}),a.jsx(Le,{children:Object.entries(r).map(([i,o])=>a.jsx(ke,{value:i,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function C6(){const{workspace:e,projectKey:t,issueId:r}=Wt(),n=jt(),[s,i]=h.useState(!1),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,f]=h.useState(!1),{data:m}=Ia(t??""),p=(m==null?void 0:m.id)??"",{data:x,isLoading:g}=y1(r??""),v=Pu(r??"",p),{data:y}=aa(p),j=h.useMemo(()=>y?y.members.filter(P=>P.user).map(P=>P.user):void 0,[y]),{data:N}=vo(p||void 0),{data:w}=bo(p||void 0),{data:k}=lc(p||void 0),{data:b}=Kl(p||void 0),S=(w??[]).filter(P=>P.status!=="completed"),_=x!=null&&x.parent_id?b==null?void 0:b.find(P=>P.id===x.parent_id):null,C=(b==null?void 0:b.filter(P=>P.parent_id===r))??[],T=x!=null&&x.task_list_id?k==null?void 0:k.find(P=>P.id===x.task_list_id):null,M=N&&N.length>0?Object.fromEntries(N.map(P=>[P.key,P.name])):si,O=N&&N.length>0?Object.fromEntries(N.map(P=>[P.key,P.category==="completed"?a.jsx(Na,{className:"h-3 w-3",style:{color:P.color}}):P.category==="started"?a.jsx(na,{className:"h-3 w-3",style:{color:P.color}}):a.jsx(ln,{className:"h-3 w-3",style:{color:P.color}})])):N6;if(h.useEffect(()=>{x&&(l(x.title),d(x.description??"")),i(!1)},[x==null?void 0:x.id]),!t||!r)return null;const R=()=>{o.trim()&&v.mutate({title:o.trim(),description:c.trim()||void 0},{onSuccess:()=>{i(!1),B.success("Issue updated")},onError:()=>B.error("Failed to update issue")})},E=()=>{x&&(l(x.title),d(x.description??"")),i(!1)},A=(P,U)=>{v.mutate(P,{onSuccess:()=>B.success(`${U} updated`),onError:()=>B.error(`Failed to update ${U.toLowerCase()}`)})};return g||!x?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 pb-24 md:pb-2",children:a.jsxs("div",{className:"flex flex-col gap-4 md:grid md:grid-cols-[1fr_256px] md:gap-5 md:items-start",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(oe,{className:"h-7 w-3/4"}),a.jsx(oe,{className:"h-32 w-full"})]}),a.jsx(oe,{className:"h-24 w-full rounded-xl"}),a.jsx(oe,{className:"h-48 w-full rounded-xl"})]}),a.jsx(oe,{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(J,{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(ms,{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:x.identifier}),a.jsx(yl,{variant:"muted",className:"text-[10px] ml-1",children:xs[x.type]??x.type})]}),a.jsx("div",{className:"flex items-center gap-2",children:s?a.jsxs(a.Fragment,{children:[a.jsx(J,{variant:"ghost",size:"sm",onClick:E,children:"Discard"}),a.jsx(J,{size:"sm",onClick:R,disabled:!o.trim()||v.isPending,className:"px-4",children:v.isPending?"Saving…":"Save changes"})]}):a.jsxs(J,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-muted-foreground hover:text-foreground",onClick:()=>i(!0),children:[a.jsx(ti,{className:"h-3.5 w-3.5"}),"Edit"]})})]}),a.jsx("div",{className:"px-2 py-2 pb-24 md:pb-2",children:a.jsxs("div",{className:"flex flex-col gap-4 md:grid md:grid-cols-[1fr_256px] md:gap-5 md:items-start",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(Nr,{zone:"issue.details.before",props:{issue:x}}),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:P=>l(P.target.value),onKeyDown:P=>{P.key==="Enter"&&P.preventDefault()},className:$("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:x.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(Sx,{content:c,onChange:d,placeholder:"Add a description…",className:"border-t border-border/50 min-h-[280px]"}):x.description?a.jsx("div",{className:"border-t border-border/50",children:a.jsx(Cx,{html:x.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"})})]}),!x.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(dt,{className:"h-3.5 w-3.5"}),"Add child issue"]})]}),C.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:C.map(P=>a.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs",children:[a.jsx(Sn,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${P.id}`),className:"font-mono text-muted-foreground hover:text-foreground transition-colors shrink-0",children:P.identifier}),a.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${P.id}`),className:"text-foreground hover:text-foreground/70 truncate text-left transition-colors",children:P.title})]},P.id))})]}),a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:a.jsx(vk,{issueId:r,projectId:p})}),a.jsx(Nr,{zone:"issue.details.after",props:{issue:x}})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(Nr,{zone:"issue.details.sidebar",props:{issue:x}}),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(fa,{label:"Status",children:a.jsx(Im,{value:x.status,onValueChange:P=>A({status:P},"Status"),options:M,icons:O})}),a.jsx(fa,{label:"Priority",children:a.jsx(Im,{value:x.priority,onValueChange:P=>A({priority:P},"Priority"),options:On,icons:k6})}),a.jsx(fa,{label:"Type",children:a.jsx(Im,{value:x.type,onValueChange:P=>A({type:P},"Type"),options:xs,icons:S6})}),a.jsx(fa,{label:"Assignees",children:a.jsx(cc,{value:x.assignee_ids??[],onChange:P=>A({assignee_ids:P},"Assignees"),disabled:v.isPending,users:j})}),a.jsx(fa,{label:"Sprint",children:a.jsxs(Be,{value:x.sprint_id??"none",onValueChange:P=>A({sprint_id:P==="none"?null:P},"Sprint"),children:[a.jsx(ze,{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(Br,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),x.sprint_id?(()=>{const P=S.find(Q=>Q.id===x.sprint_id)??(w==null?void 0:w.find(Q=>Q.id===x.sprint_id));if(!P)return a.jsxs("span",{className:"truncate",children:[x.sprint_id.slice(0,8),"…"]});const U=My(P);return a.jsxs("span",{className:"truncate",children:[P.name,U&&a.jsxs("span",{className:"text-muted-foreground ml-1",children:["· ",U]})]})})():a.jsx("span",{className:"text-muted-foreground",children:"No sprint"})]})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),S.map(P=>{const U=My(P);return a.jsx(ke,{value:P.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:P.name}),U&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:U})]})},P.id)})]})]})}),(k??[]).length>0&&a.jsx(fa,{label:"List",children:a.jsxs(Be,{value:x.task_list_id??"none",onValueChange:P=>A({task_list_id:P==="none"?null:P},"List"),children:[a.jsx(ze,{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(Xp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:T?"truncate":"text-muted-foreground",children:(T==null?void 0:T.name)??"No list"})]})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(k??[]).map(P=>a.jsx(ke,{value:P.id,className:"text-xs",children:P.name},P.id))]})]})}),a.jsx(fa,{label:"Start Date",children:a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:x.start_date?"text-foreground":"text-muted-foreground",children:x.start_date?me(new Date(x.start_date),"MMM d, yyyy"):"No start date"})]})}),a.jsxs(St,{className:"w-auto p-0",align:"start",children:[a.jsx(hr,{mode:"single",selected:x.start_date?new Date(x.start_date):void 0,onSelect:P=>A({start_date:P?me(P,"yyyy-MM-dd"):null},"Start date"),initialFocus:!0}),x.start_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>A({start_date:null},"Start date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(st,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),a.jsx(fa,{label:"Due Date",children:a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:x.due_date?"text-foreground":"text-muted-foreground",children:x.due_date?me(new Date(x.due_date),"MMM d, yyyy"):"No due date"})]})}),a.jsxs(St,{className:"w-auto p-0",align:"start",children:[a.jsx(hr,{mode:"single",selected:x.due_date?new Date(x.due_date):void 0,onSelect:P=>A({due_date:P?me(P,"yyyy-MM-dd"):null},"Due date"),initialFocus:!0}),x.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>A({due_date:null},"Due date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(st,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),_&&a.jsx(fa,{label:"Parent",children:a.jsxs("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${_.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(Kp,{className:"h-3 w-3 text-muted-foreground shrink-0"}),a.jsx("span",{className:"font-mono text-muted-foreground shrink-0",children:_.identifier}),a.jsx("span",{className:"text-foreground truncate",children:_.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:me(new Date(x.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:me(new Date(x.updated_at),"MMM d, yyyy")})]})]})]})]})]})})]}),a.jsx(ef,{open:u,onClose:()=>f(!1),projectId:p,defaultParentId:r,defaultTaskListId:x.task_list_id})]})}function ma({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 _6={backlog:a.jsx(ln,{className:"h-3 w-3 text-zinc-400"}),todo:a.jsx(ln,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:a.jsx(na,{className:"h-3 w-3 text-indigo-500"}),in_review:a.jsx(pi,{className:"h-3 w-3 text-amber-500"}),done:a.jsx(Na,{className:"h-3 w-3 text-emerald-500"}),cancelled:a.jsx(Yp,{className:"h-3 w-3 text-zinc-400"})},O6={urgent:a.jsx(ys,{className:"h-3 w-3 text-red-500"}),high:a.jsx(Xl,{className:"h-3 w-3 text-orange-500"}),medium:a.jsx(xi,{className:"h-3 w-3 text-yellow-500"}),low:a.jsx(Gl,{className:"h-3 w-3 text-blue-400"})},P6={bug:a.jsx(N1,{className:"h-3 w-3 text-red-500"}),feature:a.jsx(I1,{className:"h-3 w-3 text-purple-500"}),task:a.jsx(R1,{className:"h-3 w-3 text-blue-500"}),chore:a.jsx(Hp,{className:"h-3 w-3 text-zinc-500"})};function Rm({value:e,onValueChange:t,options:r,icons:n,placeholder:s}){return a.jsxs(Be,{value:e,onValueChange:t,children:[a.jsx(ze,{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(S1,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("span",{children:r[e]??s??""})]})}),a.jsx(Le,{children:Object.entries(r).map(([i,o])=>a.jsx(ke,{value:i,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function M6(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?me(new Date(e.start_date),"MMM d"):"—",r=e.end_date?me(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function E6(){const{workspace:e,projectKey:t}=Wt(),r=jt(),{workspace:n}=Ie(),[s,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState("backlog"),[u,f]=h.useState("medium"),[m,p]=h.useState("task"),[x,g]=h.useState([]),[v,y]=h.useState(""),[j,N]=h.useState(""),[w,k]=h.useState(void 0),[b,S]=h.useState(void 0),[_,C]=h.useState(!1),[T,M]=h.useState("weekly"),[O,R]=h.useState(void 0),{data:E}=Ia(t??""),A=(E==null?void 0:E.id)??"",P=b1(),{data:U}=aa(A),Q=h.useMemo(()=>U?U.members.filter(I=>I.user).map(I=>I.user):void 0,[U]),{data:K}=vo(A||void 0),{data:se}=bo(A||void 0),{data:ae}=lc(A||void 0),W=(se??[]).filter(I=>I.status!=="completed"),Y=K&&K.length>0?Object.fromEntries(K.map(I=>[I.key,I.name])):si,te=K&&K.length>0?Object.fromEntries(K.map(I=>[I.key,I.category==="completed"?a.jsx(Na,{className:"h-3 w-3",style:{color:I.color}}):I.category==="started"?a.jsx(na,{className:"h-3 w-3",style:{color:I.color}}):a.jsx(ln,{className:"h-3 w-3",style:{color:I.color}})])):_6;if(!t||!A)return null;const X=()=>{if(!s.trim()){B.error("Title is required");return}P.mutate({title:s.trim(),description:o||void 0,status:c,priority:u,type:m,project_id:A,workspace_id:n.id,assignee_ids:x.length>0?x:void 0,sprint_id:v||null,task_list_id:j||null,start_date:w?me(w,"yyyy-MM-dd"):null,due_date:b?me(b,"yyyy-MM-dd"):null,recurrence_frequency:_?T:void 0,recurrence_end_date:_&&O?me(O,"yyyy-MM-dd"):void 0},{onSuccess:I=>{B.success("Issue created"),r(`/${e}/projects/${t}/issues/${I.issue.id}`,{replace:!0})},onError:I=>B.error(I.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(J,{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(ms,{className:"h-3.5 w-3.5"}),(E==null?void 0:E.name)??"Issues"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(J,{variant:"ghost",size:"sm",onClick:()=>r(`/${e}/projects/${t}/issues`),children:"Discard"}),a.jsx(J,{size:"sm",onClick:X,disabled:!s.trim()||P.isPending,className:"px-4",children:P.isPending?"Creating…":"Create issue"})]})]}),a.jsx("div",{className:"px-2 py-2 pb-24 md:pb-2",children:a.jsxs("div",{className:"flex flex-col gap-4 md:grid md:grid-cols-[1fr_256px] md:gap-5 md: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:I=>i(I.target.value),onKeyDown:I=>{I.key==="Enter"&&I.preventDefault()},placeholder:"Issue title…",className:$("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(Sx,{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(ma,{label:"Status",children:a.jsx(Rm,{value:c,onValueChange:d,options:Y,icons:te})}),a.jsx(ma,{label:"Priority",children:a.jsx(Rm,{value:u,onValueChange:f,options:On,icons:O6})}),a.jsx(ma,{label:"Type",children:a.jsx(Rm,{value:m,onValueChange:p,options:xs,icons:P6})}),a.jsx(ma,{label:"Assignees",children:a.jsx(cc,{value:x,onChange:g,users:Q})}),W.length>0&&a.jsx(ma,{label:"Sprint",children:a.jsxs(Be,{value:v||"none",onValueChange:I=>y(I==="none"?"":I),children:[a.jsx(ze,{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(Br,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No sprint"})]})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),W.map(I=>{const D=M6(I);return a.jsx(ke,{value:I.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:I.name}),D&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:D})]})},I.id)})]})]})}),(ae??[]).length>0&&a.jsx(ma,{label:"List",children:a.jsxs(Be,{value:j||"none",onValueChange:I=>N(I==="none"?"":I),children:[a.jsx(ze,{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(Xp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No list"})]})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(ae??[]).map(I=>a.jsx(ke,{value:I.id,className:"text-xs",children:I.name},I.id))]})]})}),a.jsx(ma,{label:"Start Date",children:a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:w?"text-foreground":"text-muted-foreground",children:w?me(w,"MMM d, yyyy"):"No start date"}),w&&a.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),k(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(st,{className:"h-3 w-3"})})]})}),a.jsx(St,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:w,onSelect:k,initialFocus:!0})})]})}),a.jsx(ma,{label:"Due Date",children:a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:b?"text-foreground":"text-muted-foreground",children:b?me(b,"MMM d, yyyy"):"No due date"}),b&&a.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),S(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(st,{className:"h-3 w-3"})})]})}),a.jsx(St,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:b,onSelect:S,initialFocus:!0})})]})}),a.jsx(ma,{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(wo,{id:"new-recurring",checked:_,onCheckedChange:C}),a.jsxs(ft,{htmlFor:"new-recurring",className:"cursor-pointer font-normal text-xs flex items-center gap-1.5",children:[a.jsx(Ui,{className:"h-3 w-3 text-muted-foreground"}),_?T.charAt(0).toUpperCase()+T.slice(1):"Off"]})]}),_&&a.jsxs("div",{className:"space-y-2 pl-1 border-l-2 border-indigo-200 dark:border-indigo-800",children:[a.jsxs(Be,{value:T,onValueChange:I=>M(I),children:[a.jsx(ze,{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(Le,{children:[a.jsx(ke,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(ke,{value:"monthly",className:"text-xs",children:"Monthly"})]})]}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:O?"text-foreground":"text-muted-foreground",children:O?me(O,"MMM d, yyyy"):"No end date"}),O&&a.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),R(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(st,{className:"h-3 w-3"})})]})}),a.jsx(St,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:O,onSelect:R,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 A6={issue:{icon:Xn,label:"Issue"},project:{icon:Br,label:"Project"},comment:{icon:D1,label:"Comment"},sprint:{icon:ys,label:"Sprint"}};function Ey(e){const t=new Date(e);return CI(t)?yI(t,{addSuffix:!0}):_I(t)?`Yesterday ${me(t,"h:mm a")}`:me(t,"MMM d, yyyy")}function D6(){const{workspace:e}=Wt(),t=jt(),{data:r,isLoading:n}=_5(),{data:s=[]}=fo(),i=O5(),o=P5(),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(J,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>o.mutate(void 0,{onSuccess:()=>B.success("All marked as read"),onError:()=>B.error("Failed")}),disabled:o.isPending,children:[a.jsx(Bv,{className:"h-3.5 w-3.5"}),"Mark all read"]})]}),a.jsxs("div",{className:"hidden md: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",{children:[a.jsxs("div",{className:"hidden md:grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3",children:[a.jsx("div",{}),a.jsx(oe,{className:"h-5 w-20 rounded-full"}),a.jsx(oe,{className:"h-4 w-3/4"}),a.jsx(oe,{className:"h-4 w-20"}),a.jsx("div",{})]}),a.jsxs("div",{className:"md:hidden flex items-start gap-3 px-4 py-3",children:[a.jsx(oe,{className:"h-4 w-4 rounded-full mt-1 shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx(oe,{className:"h-4 w-24 rounded-full"}),a.jsx(oe,{className:"h-4 w-full"})]})]})]},u))}):r!=null&&r.length?a.jsx("div",{className:"divide-y divide-border",children:r.map(u=>{const f=A6[u.entity_type]??{icon:Zs,label:u.entity_type},m=f.icon,p=d(u),x=()=>{p&&(u.read||i.mutate(u.id),t(p))};return a.jsxs("div",{children:[a.jsxs("div",{className:$("hidden md: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",p&&"cursor-pointer"),onClick:x,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:$("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:Ey(u.created_at)}),a.jsx("div",{className:"flex justify-end",onClick:g=>g.stopPropagation(),children:!u.read&&a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground px-2",onClick:()=>i.mutate(u.id,{onError:()=>B.error("Failed")}),children:"Mark read"})})]}),a.jsxs("div",{className:$("md:hidden flex items-start gap-3 px-4 py-3 transition-colors",!u.read&&"bg-[#eff6ff] dark:bg-indigo-950/20","hover:bg-[#f9fafb] dark:hover:bg-muted/30",p&&"cursor-pointer"),onClick:x,children:[a.jsx("div",{className:"mt-1 shrink-0",children:u.read?a.jsx("div",{className:"h-1.5 w-1.5"}):a.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-indigo-500"})}),a.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground bg-muted px-2 py-0.5 rounded-full shrink-0",children:[a.jsx(m,{className:"h-3 w-3"}),f.label]}),a.jsx("span",{className:"text-[11px] text-muted-foreground shrink-0",children:Ey(u.created_at)})]}),a.jsx("p",{className:$("text-sm",u.read?"text-muted-foreground":"font-medium text-foreground"),children:u.message})]}),!u.read&&a.jsx("div",{onClick:g=>g.stopPropagation(),className:"shrink-0",children:a.jsx(J,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i.mutate(u.id,{onError:()=>B.error("Failed")}),children:a.jsx(Bv,{className:"h-3.5 w-3.5"})})})]})]},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(Zs,{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 T6({open:e,onClose:t,projectId:r}){const[n,s]=h.useState(""),[i,o]=h.useState(""),[l,c]=h.useState(),[d,u]=h.useState(),[f,m]=h.useState(!1),[p,x]=h.useState(!1),g=o4(r);function v(){s(""),o(""),c(void 0),u(void 0),t()}async function y(j){j.preventDefault(),n.trim()&&g.mutate({name:n.trim(),goal:i.trim()||void 0,start_date:l?me(l,"yyyy-MM-dd"):null,end_date:d?me(d,"yyyy-MM-dd"):null},{onSuccess:()=>{B.success("Sprint created"),v()},onError:()=>B.error("Failed to create sprint")})}return a.jsx(gi,{open:e,onOpenChange:j=>!j&&v(),children:a.jsxs(vi,{className:"sm:max-w-md",children:[a.jsx(ho,{children:a.jsx(xo,{children:"New Sprint"})}),a.jsxs("form",{onSubmit:y,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(po,{className:"space-y-4 py-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ft,{htmlFor:"sprint-name",children:["Name ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Ae,{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(ft,{htmlFor:"sprint-goal",children:["Goal ",a.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),a.jsx(Yu,{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(ft,{children:"Start Date"}),a.jsxs(Ot,{open:f,onOpenChange:m,children:[a.jsx(Pt,{asChild:!0,children:a.jsxs(J,{variant:"outline",className:$("w-full justify-start text-left font-normal text-sm h-9",!l&&"text-muted-foreground"),children:[a.jsx(mr,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),l?me(l,"MMM d, yyyy"):"Pick date"]})}),a.jsx(St,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{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(ft,{children:"End Date"}),a.jsxs(Ot,{open:p,onOpenChange:x,children:[a.jsx(Pt,{asChild:!0,children:a.jsxs(J,{variant:"outline",className:$("w-full justify-start text-left font-normal text-sm h-9",!d&&"text-muted-foreground"),children:[a.jsx(mr,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),d?me(d,"MMM d, yyyy"):"Pick date"]})}),a.jsx(St,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:d,onSelect:j=>{u(j),x(!1)},disabled:j=>l?j<l:!1,initialFocus:!0})})]})]})]})]}),a.jsxs(sc,{children:[a.jsx(J,{type:"button",variant:"ghost",onClick:v,children:"Cancel"}),a.jsx(J,{type:"submit",disabled:!n.trim()||g.isPending,children:g.isPending?"Creating…":"Create Sprint"})]})]})]})})}const I6={active:{label:"Active",icon:hl,badge:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",section:"Active Sprint"},planned:{label:"Planned",icon:na,badge:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",section:"Planned"},completed:{label:"Completed",icon:Na,badge:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",section:"Completed"}};function R6({sprint:e,projectId:t,issueCount:r,workingDays:n,holidays:s=[]}){const i=l4(e.id,t),o=c4(t),l=I6[e.status],c=l.icon;function d(){i.mutate({status:"active"},{onSuccess:()=>B.success(`"${e.name}" started`),onError:()=>B.error("Failed to start sprint")})}function u(){i.mutate({status:"completed"},{onSuccess:()=>B.success(`"${e.name}" completed`),onError:g=>B.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:()=>B.success("Sprint deleted"),onError:()=>B.error("Failed to delete sprint")})}const m=!!e.start_date,p=!!e.end_date,x=a.jsx(a.Fragment,{children:m||p?a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Js,{className:"h-3.5 w-3.5 shrink-0"}),m?me(new Date(e.start_date),"MMM d"):"—"," → ",p?me(new Date(e.end_date),"MMM d, yyyy"):"—",m&&p&&n&&(()=>{const g=jh(new Date(e.start_date),new Date(e.end_date),n,s);return a.jsxs("span",{className:"ml-1 text-[11px] text-muted-foreground/70",children:["(",g,"d)"]})})()]}):a.jsx("span",{className:"italic text-muted-foreground/60",children:"No dates"})});return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden md: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:$("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:$("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(Wv,{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(Js,{className:"h-3.5 w-3.5 shrink-0"}),m||p?a.jsxs("span",{children:[m?me(new Date(e.start_date),"MMM d"):"—"," → ",p?me(new Date(e.end_date),"MMM d, yyyy"):"—",m&&p&&n&&(()=>{const g=jh(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(yl,{className:$("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(J,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:d,disabled:i.isPending,children:[a.jsx(hl,{className:"h-3 w-3"}),"Start"]}),e.status==="active"&&a.jsxs(J,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:u,disabled:i.isPending,children:[a.jsx(Na,{className:"h-3 w-3"}),"Complete"]}),a.jsx(J,{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(Sr,{className:"h-3.5 w-3.5"})})]})]}),a.jsx("div",{className:"md:hidden px-4 py-3 hover:bg-muted/30 transition-colors",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:$("flex h-7 w-7 items-center justify-center rounded-full shrink-0 mt-0.5",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:$("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:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("p",{className:"text-sm font-medium truncate flex-1",children:e.name}),a.jsx(yl,{className:$("shrink-0 text-[11px] border-0",l.badge),children:l.label})]}),e.goal&&a.jsxs("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-1.5 flex items-center gap-1",children:[a.jsx(Wv,{className:"h-3 w-3 shrink-0"}),e.goal]}),a.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[x,a.jsx("span",{children:"·"}),a.jsxs("span",{children:[r," issue",r!==1?"s":""]})]})]}),a.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.status==="planned"&&a.jsxs(J,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:d,disabled:i.isPending,children:[a.jsx(hl,{className:"h-3 w-3"}),"Start"]}),e.status==="active"&&a.jsxs(J,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:u,disabled:i.isPending,children:[a.jsx(Na,{className:"h-3 w-3"}),"Complete"]}),a.jsx(J,{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(Sr,{className:"h-3.5 w-3.5"})})]})]})})]})}function $6(){const{projectKey:e}=Wt(),[t,r]=h.useState(!1),{data:n}=Ia(e??""),s=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=bo(s||void 0),{data:l}=Kl(s||void 0),{data:c}=px(),{data:d=[]}=xx(new Date().getFullYear()),u=(l??[]).reduce((p,x)=>(x.sprint_id&&(p[x.sprint_id]=(p[x.sprint_id]??0)+1),p),{}),f={active:(i??[]).filter(p=>p.status==="active"),planned:(i??[]).filter(p=>p.status==="planned"),completed:(i??[]).filter(p=>p.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(Nr,{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(J,{size:"sm",onClick:()=>r(!0),children:[a.jsx(dt,{className:"h-4 w-4"}),"New Sprint"]})}),o?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(p=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(oe,{className:"h-7 w-7 rounded-full"}),a.jsx(oe,{className:"h-4 w-40"}),a.jsx("div",{className:"flex-1"}),a.jsx(oe,{className:"h-4 w-32"}),a.jsx(oe,{className:"h-5 w-20"})]},p))}):(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(Js,{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(J,{size:"sm",onClick:()=>r(!0),children:[a.jsx(dt,{className:"h-4 w-4"}),"New Sprint"]})]}):a.jsx("div",{children:m.map(({key:p,label:x,items:g})=>g.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:x})}),a.jsx("div",{className:"divide-y divide-border",children:g.map(v=>a.jsx(R6,{sprint:v,projectId:s,issueCount:u[v.id]??0,workingDays:c==null?void 0:c.working_days,holidays:d},v.id))})]},p))})]}),a.jsx(Nr,{zone:"project.sprints.after",props:{projectId:s}}),a.jsx(T6,{open:t,onClose:()=>r(!1),projectId:s})]})}const Gi={all:["roles"],list:()=>[...Gi.all,"list"],detail:e=>[...Gi.all,e]};function nf(){return We({queryKey:Gi.list(),queryFn:()=>re.get("/admin/roles"),select:e=>e.roles,staleTime:1e3*60*2})}function z6(){const e=Ne();return ge({mutationFn:t=>re.post("/admin/roles",t),onSuccess:()=>{e.invalidateQueries({queryKey:Gi.list()})}})}function L6(e){const t=Ne();return ge({mutationFn:r=>re.put(`/admin/roles/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Gi.list()})}})}function F6(){const e=Ne();return ge({mutationFn:t=>re.delete(`/admin/roles/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Gi.list()})}})}function Wk(){const e=Ne();return ge({mutationFn:({userId:t,appRoleId:r})=>re.patch(`/admin/users/${t}/role`,{app_role_id:r}),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["users"]})}})}const Nd=[{group:"Workspace Admin",permissions:[{key:"workspace:admin",label:"Workspace admin (full access to workspace settings, reports, and member management)"}]},{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 bl({open:e,onClose:t,onConfirm:r,title:n,description:s,confirmLabel:i="Confirm",variant:o="default",loading:l=!1}){return a.jsx(Gs,{open:e,onOpenChange:c=>!c&&t(),children:a.jsxs(ns,{children:[a.jsxs(as,{children:[a.jsx(is,{children:n}),a.jsx(os,{children:s})]}),a.jsxs(ss,{children:[a.jsx(cs,{onClick:t,disabled:l,children:"Cancel"}),a.jsx(ls,{onClick:r,disabled:l,className:$(o==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus:ring-destructive"),children:l?"Please wait…":i})]})]})})}function Ox({value:e,className:t}){const[r,n]=h.useState(!1),s=()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)};return a.jsx("button",{onClick:s,className:$("text-muted-foreground hover:text-foreground transition-colors",t),title:"Copy",children:r?a.jsx(ir,{className:"h-3.5 w-3.5 text-emerald-500"}):a.jsx(Gp,{className:"h-3.5 w-3.5"})})}function Ay({value:e,onChange:t,appRoles:r}){return!r||r.length===0?null:a.jsxs(Be,{value:e||"none",onValueChange:n=>t(n==="none"?"":n),children:[a.jsx(ze,{className:"h-9",children:a.jsx(Ye,{placeholder:"No custom role"})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"none",children:a.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),r.map(n=>a.jsx(ke,{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 B6({open:e,onClose:t,workspaceId:r}){const[n,s]=h.useState("existing"),[i,o]=h.useState(""),[l,c]=h.useState(""),[d,u]=h.useState(""),[f,m]=h.useState(""),[p,x]=h.useState(""),[g,v]=h.useState(null),{data:y=[]}=oc(),{data:j=[]}=ec(r),N=LD(r),w=RD(r),{data:k}=nf(),b=h.useMemo(()=>new Set(j.map(M=>M.user_id)),[j]),S=h.useMemo(()=>y.filter(M=>!b.has(M.id)),[y,b]),_=h.useMemo(()=>{const M=i.toLowerCase().trim();return M?S.filter(O=>O.email.toLowerCase().includes(M)||`${O.first_name} ${O.last_name}`.toLowerCase().includes(M)):S},[S,i]);h.useEffect(()=>{e&&(o(""),c(""),u(""),m(""),x(""),v(null),s("existing"))},[e]);const C=()=>{l&&N.mutate({user_id:l,role:"member",app_role_id:d||null},{onSuccess:()=>{B.success("Member added"),t()},onError:M=>B.error(M.message||"Failed to add member")})},T=M=>{M.preventDefault(),w.mutate({email:f.trim()||void 0,role:"member",app_role_id:p||null},{onSuccess:O=>{v(O.invitation),B.success("Invitation created")},onError:O=>B.error(O.message||"Failed to create invitation")})};return a.jsx(Ra,{open:e,onOpenChange:M=>!M&&t(),children:a.jsxs(sa,{className:"sm:max-w-[520px] bg-white dark:bg-card",children:[a.jsx($a,{children:a.jsx(za,{children:"Add member"})}),!g&&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:$("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:$("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"&&!g&&a.jsxs("div",{className:"space-y-3 pt-1",children:[a.jsx(Ae,{placeholder:"Search by name or email…",value:i,onChange:M=>o(M.target.value),className:"h-9",autoFocus:!0}),a.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:S.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(M=>{const O=M.first_name??"",R=M.last_name??"",E=`${O} ${R}`.trim()||M.email,A=(O[0]??R[0]??M.email[0]??"U").toUpperCase(),P=l===M.id;return a.jsxs("button",{type:"button",onClick:()=>c(P?"":M.id),className:$("w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors",P?"bg-indigo/5 dark:bg-indigo/10":"hover:bg-muted/40"),children:[a.jsx(Ft,{className:"h-7 w-7 shrink-0",children:a.jsx(Bt,{className:"text-[11px] font-medium",children:A})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:E}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:M.email})]}),P&&a.jsx(ir,{className:"h-4 w-4 text-indigo shrink-0"})]},M.id)})})}),S.length>0&&a.jsxs(a.Fragment,{children:[k&&k.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Role ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(Ay,{value:d,onChange:u,appRoles:k})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(J,{type:"button",size:"sm",disabled:!l||N.isPending,onClick:C,children:N.isPending?"Adding…":"Add to workspace"})]})]})]}),n==="invite"&&!g&&a.jsxs("form",{onSubmit:T,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(Ae,{type:"email",placeholder:"colleague@example.com",value:f,onChange:M=>m(M.target.value),className:"h-9",autoFocus:!0}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Leave blank to generate a shareable link."})]}),k&&k.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Role ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(Ay,{value:p,onChange:x,appRoles:k})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(J,{type:"submit",size:"sm",disabled:w.isPending,children:w.isPending?"Creating…":"Create invitation"})]})]}),g&&a.jsxs("div",{className:"space-y-4 pt-1",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Share this link with"," ",g.email?a.jsx("span",{className:"font-medium text-foreground",children:g.email}):"anyone you want to invite","."]}),a.jsxs("div",{className:"flex items-start gap-2 p-3 bg-muted/50 rounded-lg border border-border",children:[a.jsx(Zl,{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/${g.token}`}),a.jsx(Ox,{value:`${window.location.origin}/invite/${g.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:()=>v(null),children:"Create another"}),a.jsx(J,{size:"sm",onClick:t,children:"Done"})]})]})]})})}function W6({invitation:e,workspaceId:t}){const r=$D(t),n=zD(t),[s,i]=h.useState(!1),o=`${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(Zl,{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:$("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:o}),a.jsx(Ox,{value:o})]})]}),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:me(new Date(e.created_at),"MMM d")}),e.email&&a.jsxs(Gn,{children:[a.jsx(Vn,{asChild:!0,children:a.jsx("button",{onClick:()=>i(!0),disabled:n.isPending,className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground disabled:opacity-50",children:a.jsx(T1,{className:$("h-3.5 w-3.5",n.isPending&&"animate-spin")})})}),a.jsx(kn,{children:"Resend invite"})]}),a.jsx("button",{onClick:()=>r.mutate(e.id,{onSuccess:()=>B.success("Invitation revoked"),onError:()=>B.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(st,{className:"h-3.5 w-3.5"})})]}),a.jsx(bl,{open:s,onClose:()=>i(!1),onConfirm:()=>n.mutate(e.id,{onSuccess:()=>{B.success("Invitation resent"),i(!1)},onError:()=>B.error("Failed to resend invitation")}),title:"Resend invitation?",description:`A new invitation email will be sent to ${e.email}.`,confirmLabel:"Resend",loading:n.isPending})]})}function U6({workspaceId:e}){var v;const{workspace:t,setWorkspace:r}=Ie(),{data:n,isLoading:s}=Du(),i=n==null?void 0:n.find(y=>y.id===(t==null?void 0:t.id)),o=AD(e),l=DD(e),c=TD(e),d=h.useRef(null),[u,f]=h.useState("");h.useEffect(()=>{i&&f(i.name)},[i==null?void 0:i.name]);const m=i?u.trim()!==i.name:!1,p=()=>{!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}),B.success("Workspace updated")},onError:()=>B.error("Failed to update workspace")})},x=y=>{var N;const j=(N=y.target.files)==null?void 0:N[0];j&&(l.mutate(j,{onSuccess:w=>{r({id:w.workspace.id,name:w.workspace.name,slug:w.workspace.slug,logo_url:w.workspace.logo_url}),B.success("Logo updated")},onError:()=>B.error("Failed to upload logo")}),d.current&&(d.current.value=""))},g=()=>{c.mutate(void 0,{onSuccess:y=>{r({id:y.workspace.id,name:y.workspace.name,slug:y.workspace.slug,logo_url:null}),B.success("Logo removed")},onError:()=>B.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:x}),a.jsx(J,{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(J,{size:"sm",variant:"ghost",className:"h-8 text-muted-foreground",onClick:g,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(oe,{className:"h-8 w-64"}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Ae,{value:u,onChange:y=>f(y.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"Workspace name"}),m&&a.jsx(J,{size:"sm",className:"h-8",onClick:p,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(oe,{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(Ox,{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(oe,{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(oe,{className:"h-4 w-28"}):a.jsx("span",{className:"text-sm text-muted-foreground",children:i!=null&&i.created_at?me(new Date(i.created_at),"MMMM d, yyyy"):"—"})]})]})}const _s=20;function q6({workspaceId:e,onInvite:t}){var g;const{data:r,isLoading:n}=ec(e),{data:s,isLoading:i}=ID(e),o=FD(e),l=Wk(),{data:c}=nf(),{user:d}=Ie(),[u,f]=h.useState(null),[m,p]=h.useState(0),x=(s==null?void 0:s.filter(v=>v.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(v=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(oe,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(oe,{className:"h-3.5 w-32"}),a.jsx(oe,{className:"h-3 w-48"})]})]},v))}):r!=null&&r.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"divide-y divide-border",children:(r??[]).slice(m*_s,(m+1)*_s).map(v=>{var S;const y=v.user,j=(y==null?void 0:y.first_name)??"",N=(y==null?void 0:y.last_name)??"",w=`${j} ${N}`.trim()||(y==null?void 0:y.email)||"Unknown",k=(j[0]??N[0]??((S=y==null?void 0:y.email)==null?void 0:S[0])??"U").toUpperCase(),b=(y==null?void 0:y.id)===(d==null?void 0:d.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(Ft,{className:"h-7 w-7 shrink-0",children:a.jsx(Bt,{className:"text-[11px] font-medium",children:k})}),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}),b&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:"(you)"})]}),(y==null?void 0:y.email)&&a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.email})]}),c&&c.length>0&&a.jsxs(Be,{value:v.app_role_id??"none",onValueChange:_=>l.mutate({userId:v.user_id,appRoleId:_==="none"?null:_},{onSuccess:()=>B.success("Custom role updated"),onError:()=>B.error("Failed to update custom role")}),children:[a.jsx(ze,{className:"h-7 text-[11px] w-32 shrink-0",children:a.jsx(Ye,{placeholder:"Custom role"})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"none",children:a.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),c.map(_=>a.jsx(ke,{value:_.id,children:_.name},_.id))]})]}),!b&&a.jsxs(Wr,{children:[a.jsx(Ur,{asChild:!0,children:a.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:a.jsx(ka,{className:"h-4 w-4"})})}),a.jsxs(Cr,{align:"end",className:"w-44",children:[a.jsx(nt,{onClick:()=>{fetch(`/admin/users/${v.user_id}/sessions`,{method:"DELETE",headers:{Authorization:`Bearer ${localStorage.getItem("meridian_token")}`}}).then(()=>B.success("Sessions revoked — user will be signed out")).catch(()=>B.error("Failed to revoke sessions"))},children:"Revoke sessions"}),a.jsx(_n,{}),a.jsxs(nt,{className:"text-destructive focus:text-destructive",onClick:()=>f(v),children:[a.jsx(Sr,{className:"h-3.5 w-3.5 mr-2"}),"Remove"]})]})]})]},v.id)})}),((r==null?void 0:r.length)??0)>_s&&a.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:[m*_s+1,"–",Math.min((m+1)*_s,r.length)," of ",r.length]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>p(v=>v-1),disabled:m===0,children:a.jsx(ms,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[m+1," / ",Math.ceil(r.length/_s)]}),a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>p(v=>v+1),disabled:(m+1)*_s>=r.length,children:a.jsx(kr,{className:"h-3.5 w-3.5"})})]})]})]}):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(xa,{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(dt,{className:"h-3 w-3"}),"Invite"]})]}),i?a.jsx("div",{className:"divide-y divide-border",children:[1,2].map(v=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(oe,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(oe,{className:"h-3.5 w-48"}),a.jsx(oe,{className:"h-3 w-64"})]})]},v))}):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(v=>a.jsx(W6,{invitation:v,workspaceId:e},v.id))}),a.jsx(bl,{open:!!u,onClose:()=>f(null),onConfirm:()=>{u&&o.mutate(u.user_id,{onSuccess:()=>{B.success("Member removed"),f(null)},onError:()=>{B.error("Failed to remove member"),f(null)}})},title:"Remove member",description:`Remove ${((g=u==null?void 0:u.user)==null?void 0:g.email)??"this member"} from the workspace? They will lose access to all projects.`,confirmLabel:"Remove",variant:"destructive",loading:o.isPending})]})}function H6({workspaceId:e,teamId:t,allMembers:r}){var y,j;const{data:n,isLoading:s}=UD(e,t),i=qD(e,t),o=HD(e,t),[l,c]=h.useState(""),[d,u]=h.useState(null),[f,m]=h.useState(null),p=new Set((n==null?void 0:n.map(N=>N.user_id))??[]),x=r.filter(N=>!p.has(N.user_id)),g=n==null?void 0:n.find(N=>N.user_id===d),v=r.find(N=>N.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(oe,{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(N=>{var C;const w=N.user,k=(w==null?void 0:w.first_name)??"",b=(w==null?void 0:w.last_name)??"",S=`${k} ${b}`.trim()||(w==null?void 0:w.email)||"Unknown",_=(k[0]??b[0]??((C=w==null?void 0:w.email)==null?void 0:C[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(Ft,{className:"h-6 w-6 shrink-0",children:a.jsx(Bt,{className:"text-[10px] font-medium",children:_})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:S}),a.jsx("button",{onClick:()=>u(N.user_id),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Remove from team",children:a.jsx(st,{className:"h-3.5 w-3.5"})})]},N.id)})}),x.length>0&&a.jsxs("div",{className:"px-8 py-2.5 flex items-center gap-2 border-t border-border/50",children:[a.jsx(co,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Be,{value:l,onValueChange:c,children:[a.jsx(ze,{className:"h-7 text-xs flex-1 max-w-[200px]",children:a.jsx(Ye,{placeholder:"Add member…"})}),a.jsx(Le,{children:x.map(N=>{const w=N.user,k=(w==null?void 0:w.first_name)??"",b=(w==null?void 0:w.last_name)??"",S=`${k} ${b}`.trim()||(w==null?void 0:w.email)||"Unknown";return a.jsx(ke,{value:N.user_id,children:S},N.user_id)})})]}),l&&a.jsx(J,{size:"sm",className:"h-7 text-xs px-2",disabled:i.isPending,onClick:()=>m(l),children:"Add"})]}),a.jsx(bl,{open:!!d,onClose:()=>u(null),onConfirm:()=>{d&&o.mutate(d,{onSuccess:()=>{B.success("Removed from team"),u(null)},onError:()=>{B.error("Failed to remove"),u(null)}})},title:"Remove from team",description:`Remove ${((y=g==null?void 0:g.user)==null?void 0:y.email)??"this member"} from the team?`,confirmLabel:"Remove",variant:"destructive",loading:o.isPending}),a.jsx(bl,{open:!!f,onClose:()=>{m(null),c("")},onConfirm:()=>{f&&i.mutate(f,{onSuccess:()=>{B.success("Added to team"),m(null),c("")},onError:()=>{B.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 K6({workspaceId:e}){const{data:t,isLoading:r}=Tu(e),{data:n}=ec(e),s=BD(e),i=WD(e),[o,l]=h.useState(new Set),[c,d]=h.useState(!1),[u,f]=h.useState(""),[m,p]=h.useState(null),x=t==null?void 0:t.find(y=>y.id===m),g=y=>{l(j=>{const N=new Set(j);return N.has(y)?N.delete(y):N.add(y),N})},v=y=>{y.preventDefault(),u.trim()&&s.mutate({name:u.trim()},{onSuccess:()=>{B.success("Team created"),f(""),d(!1)},onError:()=>B.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(dt,{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(Ae,{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(J,{type:"submit",size:"sm",className:"h-8",disabled:!u.trim()||s.isPending,children:s.isPending?"Creating…":"Create"}),a.jsx(J,{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(oe,{className:"h-7 w-7 rounded-lg shrink-0"}),a.jsx(oe,{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:()=>g(y.id),className:"text-muted-foreground hover:text-foreground shrink-0 transition-colors",children:j?a.jsx(ra,{className:"h-4 w-4"}):a.jsx(kr,{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(ri,{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(Wr,{children:[a.jsx(Ur,{asChild:!0,children:a.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:a.jsx(ka,{className:"h-4 w-4"})})}),a.jsx(Cr,{align:"end",className:"w-36",children:a.jsxs(nt,{className:"text-destructive focus:text-destructive",onClick:()=>p(y.id),children:[a.jsx(Sr,{className:"h-3.5 w-3.5 mr-2"}),"Delete team"]})})]})]}),j&&a.jsx(H6,{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(ri,{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(J,{variant:"outline",size:"sm",onClick:()=>d(!0),children:"Create a team"})]}),a.jsx(bl,{open:!!m,onClose:()=>p(null),onConfirm:()=>{m&&i.mutate(m,{onSuccess:()=>{B.success("Team deleted"),p(null)},onError:()=>{B.error("Failed to delete team"),p(null)}})},title:"Delete team",description:`Delete "${(x==null?void 0:x.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 Y6=["general","members","teams"];function G6(){const{workspace:e}=Ie(),t=(e==null?void 0:e.id)??"",[r,n]=Ul(),s=r.get("tab"),[i,o]=h.useState(Y6.includes(s)?s:"general"),l=u=>{o(u),n({tab:u},{replace:!0})},[c,d]=h.useState(!1);return a.jsxs("div",{className:"p-2",children:[a.jsx(Nr,{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 overflow-x-auto scrollbar-none",children:["general","members","teams"].map(u=>a.jsx("button",{onClick:()=>l(u),className:$("h-12 px-4 text-sm font-medium border-b-2 transition-colors capitalize whitespace-nowrap shrink-0",i===u?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:u},u))}),i==="members"&&a.jsxs(J,{size:"sm",onClick:()=>d(!0),className:"shrink-0 ml-2",children:[a.jsx(dt,{className:"h-4 w-4"}),a.jsx("span",{className:"hidden sm:inline",children:"Add member"})]})]}),i==="general"&&a.jsx(U6,{workspaceId:t}),i==="members"&&a.jsx(q6,{workspaceId:t,onInvite:()=>d(!0)}),i==="teams"&&a.jsx(K6,{workspaceId:t})]}),a.jsx(Nr,{zone:"workspace.settings.after",props:{workspaceId:t}}),a.jsx(B6,{open:c,onClose:()=>d(!1),workspaceId:t})]})}function V6({open:e,onClose:t}){const[r,n]=h.useState(""),[s,i]=h.useState(""),[o,l]=h.useState(new Set),c=z6();h.useEffect(()=>{e&&(n(""),i(""),l(new Set))},[e]);const d=Nd.flatMap(g=>g.permissions.map(v=>v.key)),u=d.every(g=>o.has(g)),f=!u&&d.some(g=>o.has(g)),m=()=>{l(u?new Set:new Set(d))},p=g=>{l(v=>{const y=new Set(v);return y.has(g)?y.delete(g):y.add(g),y})},x=g=>{g.preventDefault(),r.trim()&&c.mutate({name:r.trim(),description:s.trim()||void 0,permissions:Array.from(o)},{onSuccess:()=>{B.success("Role created"),t()},onError:v=>B.error(v.message||"Failed to create role")})};return a.jsx(Ra,{open:e,onOpenChange:g=>!g&&t(),children:a.jsxs(sa,{className:"sm:max-w-[580px] max-h-[85vh] overflow-y-auto",children:[a.jsxs($a,{children:[a.jsx(za,{children:"Create role"}),a.jsx(mo,{children:"Define a new custom role with a specific permission set."})]}),a.jsxs("form",{onSubmit:x,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(Ae,{value:r,onChange:g=>n(g.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(Ae,{value:s,onChange:g=>i(g.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"})]}),Nd.map(g=>a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:g.group}),a.jsx("div",{className:"space-y-1.5",children:g.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:()=>p(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))})]},g.group))]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(J,{type:"submit",size:"sm",disabled:!r.trim()||c.isPending,children:c.isPending?"Creating…":"Create role"})]})]})]})})}function X6({role:e,onDeleted:t}){const[r,n]=h.useState(e.name),[s,i]=h.useState(e.description??""),[o,l]=h.useState(new Set(e.permissions)),[c,d]=h.useState(!1),u=L6(e.id),f=F6();h.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(w=>!e.permissions.includes(w)),p=Nd.flatMap(w=>w.permissions.map(k=>k.key)),x=p.every(w=>o.has(w)),g=!x&&p.some(w=>o.has(w)),v=()=>{l(x?new Set:new Set(p))},y=w=>{l(k=>{const b=new Set(k);return b.has(w)?b.delete(w):b.add(w),b})},j=()=>{u.mutate({name:r.trim(),description:s.trim()||void 0,permissions:Array.from(o)},{onSuccess:()=>B.success("Role saved"),onError:w=>B.error(w.message||"Failed to save role")})},N=()=>{f.mutate(e.id,{onSuccess:()=>{B.success("Role deleted"),t(),d(!1)},onError:w=>B.error(w.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(ei,{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(Sr,{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(Ae,{value:r,onChange:w=>n(w.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(Ae,{value:s,onChange:w=>i(w.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:x?"Deselect all":"Select all"})]}),Nd.map(w=>a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:w.group}),a.jsx("div",{className:"space-y-2",children:w.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))})]},w.group))]}),a.jsx("div",{className:"shrink-0 px-6 py-4 border-t border-border flex justify-end",children:a.jsx(J,{size:"sm",onClick:j,disabled:!m||!r.trim()||u.isPending,children:u.isPending?"Saving…":"Save changes"})}),a.jsx(Gs,{open:c,onOpenChange:d,children:a.jsxs(ns,{children:[a.jsxs(as,{children:[a.jsxs(is,{children:['Delete "',e.name,'"?']}),a.jsx(os,{children:"This role will be removed from all users assigned to it. This action cannot be undone."})]}),a.jsxs(ss,{children:[a.jsx(cs,{children:"Cancel"}),a.jsx(ls,{onClick:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}function Q6(){const{data:e,isLoading:t}=nf(),[r,n]=h.useState(null),[s,i]=h.useState(!1),o=(e==null?void 0:e.filter(d=>d.is_system))??[],l=(e==null?void 0:e.filter(d=>!d.is_system))??[];h.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(xh,{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(J,{size:"sm",onClick:()=>i(!0),children:[a.jsx(dt,{className:"h-4 w-4 mr-1.5"}),"Create role"]})]}),a.jsxs("div",{className:"flex flex-col md:flex-row flex-1 min-h-0",children:[a.jsx("div",{className:"w-full md:w-56 shrink-0 md:border-r border-b md:border-b-0 border-border flex flex-col overflow-y-auto md:overflow-y-auto max-h-48 md:max-h-none",children:t?a.jsx("div",{className:"p-4 space-y-2",children:[1,2,3].map(d=>a.jsx(oe,{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:$("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(ei,{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:$("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(X6,{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(xh,{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(V6,{open:s,onClose:()=>i(!1)})]})})}function Z6(e){return We({queryKey:["invite",e],queryFn:()=>re.get(`/auth/invite/${e}`),retry:!1,enabled:!!e})}function J6(){const{token:e}=Wt(),{isAuthenticated:t}=Ie(),r=jt(),{data:n,isLoading:s,error:i}=Z6(e??""),{data:o}=Iu(),l=XD(e??""),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,p]=h.useState(""),[x,g]=h.useState(""),[v,y]=h.useState(!1);if(t&&n)return r(n.workspace?`/${n.workspace.slug}/projects`:"/",{replace:!0}),null;const j=(n==null?void 0:n.invitation.email)??null,N=w=>{w.preventDefault();const k=j??m.trim();if(!k){B.error("Email is required");return}l.mutate({email:k,password:x,first_name:c,last_name:u},{onSuccess:()=>{r(n.workspace?`/${n.workspace.slug}/projects`:"/",{replace:!0})},onError:b=>B.error(b.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(Fr,{to:"/login",children:a.jsx(J,{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(YA,{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?n.workspace.name:"Meridian"})]}),a.jsxs("div",{className:"px-5 py-3 flex items-center gap-2.5",children:[n.invitation.role==="admin"?a.jsx(gD,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):a.jsx(OD,{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:N,className:"space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Ae,{placeholder:"First name",value:c,onChange:w=>d(w.target.value),required:!0,className:"h-9 bg-transparent",autoFocus:!0}),a.jsx(Ae,{placeholder:"Last name",value:u,onChange:w=>f(w.target.value),required:!0,className:"h-9 bg-transparent"})]}),j?a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{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(Ae,{type:"email",placeholder:"Email",value:m,onChange:w=>p(w.target.value),required:!0,className:"h-9 bg-transparent",autoComplete:"email"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{type:v?"text":"password",placeholder:"Password (min. 8 characters)",value:x,onChange:w=>g(w.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(Ql,{className:"h-4 w-4"}):a.jsx(pi,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(J,{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(ix,{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(Fr,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]}):null]})})}var ez=["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 Px(e){if(typeof e!="string")return!1;var t=ez;return t.includes(e)}var tz=["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"],rz=new Set(tz);function Uk(e){return typeof e!="string"?!1:rz.has(e)}function qk(e){return typeof e=="string"&&e.startsWith("data-")}function Sa(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Uk(r)||qk(r))&&(t[r]=e[r]);return t}function Mx(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Sa(t)}return typeof e=="object"&&!Array.isArray(e)?Sa(e):null}function dn(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Uk(r)||qk(r)||Px(r))&&(t[r]=e[r]);return t}var nz=["children","width","height","viewBox","className","style","title","desc"];function Mh(){return Mh=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},Mh.apply(null,arguments)}function az(e,t){if(e==null)return{};var r,n,s=sz(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 sz(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 Hk=h.forwardRef((e,t)=>{var{children:r,width:n,height:s,viewBox:i,className:o,style:l,title:c,desc:d}=e,u=az(e,nz),f=i||{width:n,height:s,x:0,y:0},m=it("recharts-surface",o);return h.createElement("svg",Mh({},dn(u),{className:m,width:n,height:s,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),h.createElement("title",null,c),h.createElement("desc",null,d),r)}),iz=["children","className"];function Eh(){return Eh=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},Eh.apply(null,arguments)}function oz(e,t){if(e==null)return{};var r,n,s=lz(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 lz(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 Ca=h.forwardRef((e,t)=>{var{children:r,className:n}=e,s=oz(e,iz),i=it("recharts-layer",n);return h.createElement("g",Eh({className:i},dn(s),{ref:t}),r)}),cz=h.createContext(null);function ct(e){return function(){return e}}const Kk=Math.cos,kd=Math.sin,En=Math.sqrt,Sd=Math.PI,af=2*Sd,Ah=Math.PI,Dh=2*Ah,As=1e-6,dz=Dh-As;function Yk(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function uz(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Yk;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 fz{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Yk:uz(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>As)if(!(Math.abs(f*c-d*u)>As)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,x=s-l,g=c*c+d*d,v=p*p+x*x,y=Math.sqrt(g),j=Math.sqrt(m),N=i*Math.tan((Ah-Math.acos((g+m-v)/(2*y*j)))/2),w=N/j,k=N/y;Math.abs(w-1)>As&&this._append`L${t+w*u},${r+w*f}`,this._append`A${i},${i},0,0,${+(f*p>u*x)},${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)>As||Math.abs(this._y1-u)>As)&&this._append`L${d},${u}`,n&&(m<0&&(m=m%Dh+Dh),m>dz?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>As&&this._append`A${n},${n},0,${+(m>=Ah)},${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 Ex(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 fz(t)}function Ax(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Gk(e){this._context=e}Gk.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 sf(e){return new Gk(e)}function Vk(e){return e[0]}function Xk(e){return e[1]}function Qk(e,t){var r=ct(!0),n=null,s=sf,i=null,o=Ex(l);e=typeof e=="function"?e:e===void 0?Vk:ct(e),t=typeof t=="function"?t:t===void 0?Xk:ct(t);function l(c){var d,u=(c=Ax(c)).length,f,m=!1,p;for(n==null&&(i=s(p=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(p)return i=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:ct(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ct(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:ct(!!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 qc(e,t,r){var n=null,s=ct(!0),i=null,o=sf,l=null,c=Ex(d);e=typeof e=="function"?e:e===void 0?Vk:ct(+e),t=typeof t=="function"?t:ct(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?Xk:ct(+r);function d(f){var m,p,x,g=(f=Ax(f)).length,v,y=!1,j,N=new Array(g),w=new Array(g);for(i==null&&(l=o(j=c())),m=0;m<=g;++m){if(!(m<g&&s(v=f[m],m,f))===y)if(y=!y)p=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=m-1;x>=p;--x)l.point(N[x],w[x]);l.lineEnd(),l.areaEnd()}y&&(N[m]=+e(v,m,f),w[m]=+t(v,m,f),l.point(n?+n(v,m,f):N[m],r?+r(v,m,f):w[m]))}if(j)return l=null,j+""||null}function u(){return Qk().defined(s).curve(o).context(i)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:ct(+f),n=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ct(+f),d):e},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ct(+f),d):n},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:ct(+f),r=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ct(+f),d):t},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ct(+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:ct(!!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 Zk{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 mz(e){return new Zk(e,!0)}function hz(e){return new Zk(e,!1)}const Dx={draw(e,t){const r=En(t/Sd);e.moveTo(r,0),e.arc(0,0,r,0,af)}},pz={draw(e,t){const r=En(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()}},Jk=En(1/3),xz=Jk*2,gz={draw(e,t){const r=En(t/xz),n=r*Jk;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},vz={draw(e,t){const r=En(t),n=-r/2;e.rect(n,n,r,r)}},yz=.8908130915292852,eS=kd(Sd/10)/kd(7*Sd/10),bz=kd(af/10)*eS,wz=-Kk(af/10)*eS,jz={draw(e,t){const r=En(t*yz),n=bz*r,s=wz*r;e.moveTo(0,-r),e.lineTo(n,s);for(let i=1;i<5;++i){const o=af*i/5,l=Kk(o),c=kd(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*s,c*n+l*s)}e.closePath()}},$m=En(3),Nz={draw(e,t){const r=-En(t/($m*3));e.moveTo(0,r*2),e.lineTo(-$m*r,-r),e.lineTo($m*r,-r),e.closePath()}},tn=-.5,rn=En(3)/2,Th=1/En(12),kz=(Th/2+1)*3,Sz={draw(e,t){const r=En(t/kz),n=r/2,s=r*Th,i=n,o=r*Th+r,l=-i,c=o;e.moveTo(n,s),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(tn*n-rn*s,rn*n+tn*s),e.lineTo(tn*i-rn*o,rn*i+tn*o),e.lineTo(tn*l-rn*c,rn*l+tn*c),e.lineTo(tn*n+rn*s,tn*s-rn*n),e.lineTo(tn*i+rn*o,tn*o-rn*i),e.lineTo(tn*l+rn*c,tn*c-rn*l),e.closePath()}};function Cz(e,t){let r=null,n=Ex(s);e=typeof e=="function"?e:ct(e||Dx),t=typeof t=="function"?t:ct(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:ct(i),s):e},s.size=function(i){return arguments.length?(t=typeof i=="function"?i:ct(+i),s):t},s.context=function(i){return arguments.length?(r=i??null,s):r},s}function Cd(){}function _d(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 tS(e){this._context=e}tS.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:_d(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:_d(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _z(e){return new tS(e)}function rS(e){this._context=e}rS.prototype={areaStart:Cd,areaEnd:Cd,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:_d(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Oz(e){return new rS(e)}function nS(e){this._context=e}nS.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:_d(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Pz(e){return new nS(e)}function aS(e){this._context=e}aS.prototype={areaStart:Cd,areaEnd:Cd,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 Mz(e){return new aS(e)}function Dy(e){return e<0?-1:1}function Ty(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(Dy(i)+Dy(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function Iy(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function zm(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:zm(this,this._t0,Iy(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,zm(this,Iy(this,r=Ty(this,e,t)),r);break;default:zm(this,this._t0,r=Ty(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function sS(e){this._context=new iS(e)}(sS.prototype=Object.create(Od.prototype)).point=function(e,t){Od.prototype.point.call(this,t,e)};function iS(e){this._context=e}iS.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 Ez(e){return new Od(e)}function Az(e){return new sS(e)}function oS(e){this._context=e}oS.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=Ry(e),s=Ry(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 Ry(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 Dz(e){return new oS(e)}function of(e,t){this._context=e,this._t=t}of.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 Tz(e){return new of(e,.5)}function Iz(e){return new of(e,0)}function Rz(e){return new of(e,1)}function ii(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 Ih(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function $z(e,t){return e[t]}function zz(e){const t=[];return t.key=e,t}function Lz(){var e=ct([]),t=Ih,r=ii,n=$z;function s(i){var o=Array.from(e.apply(this,arguments),zz),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=Ax(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:ct(Array.from(i)),s):e},s.value=function(i){return arguments.length?(n=typeof i=="function"?i:ct(+i),s):n},s.order=function(i){return arguments.length?(t=i==null?Ih:typeof i=="function"?i:ct(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(r=i??ii,s):r},s}function Fz(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}ii(e,t)}}function Bz(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}ii(e,t)}}function Wz(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,p=(f-m)/2,x=0;x<l;++x){var g=e[t[x]],v=g[n][1]||0,y=g[n-1][1]||0;p+=v-y}c+=f,d+=p*f}s[n-1][1]+=s[n-1][0]=r,c&&(r-=d/c)}s[n-1][1]+=s[n-1][0]=r,ii(e,t)}}var lf={},lS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(lS);var Tx={};(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})(Tx);var cf={};(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})(cf);var df={},cS={};(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})(cS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cS,r=cf;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})(df);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lS,r=Tx,n=cf,s=df;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})(lf);var Uz=lf.get;const Vi=Ta(Uz);var qz=4;function ts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:qz,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function kt(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+ts(l)+i:s+i},"")}var Rr=e=>e===0?0:e>0?1:-1,Zn=e=>typeof e=="number"&&e!=+e,oi=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Se=e=>(typeof e=="number"||e instanceof Number)&&!Zn(e),Jn=e=>Se(e)||typeof e=="string",Hz=0,wl=e=>{var t=++Hz;return"".concat(e||"").concat(t)},Pn=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(!Se(t)&&typeof t!="string")return n;var i;if(oi(t)){if(r==null)return n;var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return Zn(i)&&(i=n),s&&r!=null&&i>r&&(i=r),i},dS=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 sr(e,t,r){return Se(e)&&Se(t)?ts(e+r*(t-e)):t}function Kz(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):Vi(n,t))===r)}var Vt=e=>e===null||typeof e>"u",fc=e=>Vt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function $r(e){return e!=null}function jo(){}var Yz=["type","size","sizeType"];function Rh(){return Rh=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},Rh.apply(null,arguments)}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 zy(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){Gz(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 Gz(e,t,r){return(t=Vz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vz(e){var t=Xz(e,"string");return typeof t=="symbol"?t:t+""}function Xz(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 Qz(e,t){if(e==null)return{};var r,n,s=Zz(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 Zz(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 uS={symbolCircle:Dx,symbolCross:pz,symbolDiamond:gz,symbolSquare:vz,symbolStar:jz,symbolTriangle:Nz,symbolWye:Sz},Jz=Math.PI/180,eL=e=>{var t="symbol".concat(fc(e));return uS[t]||Dx},tL=(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*Jz;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}},rL=(e,t)=>{uS["symbol".concat(fc(e))]=t},fS=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,s=Qz(e,Yz),i=zy(zy({},s),{},{type:t,size:r,sizeType:n}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var m=eL(o),p=Cz().type(m).size(tL(r,n,o)),x=p();if(x!==null)return x},{className:c,cx:d,cy:u}=i,f=dn(i);return Se(d)&&Se(u)&&Se(r)?h.createElement("path",Rh({},f,{className:it("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(u,")"),d:l()})):null};fS.registerSymbol=rL;var mS=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,nL=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(h.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(s=>{Px(s)&&(n[s]=i=>r[s](r,i))}),n},aL=(e,t,r)=>n=>(e(t,r,n),null),Ix=(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];Px(s)&&typeof i=="function"&&(n||(n={}),n[s]=aL(i,t,r))}),n};function Ly(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 sL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ly(Object(r),!0).forEach(function(n){iL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ly(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iL(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=lL(e,"string");return typeof t=="symbol"?t:t+""}function lL(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 en(e,t){var r=sL({},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 hS={},pS={};(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})(pS);var xS={};(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})(xS);var Rx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(Rx);var gS={},uf={},vS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(vS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vS;function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(uf);var yS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(yS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uf,r=yS;function n(s){return r.isObjectLike(s)&&t.isArrayLike(s)}e.isArrayLikeObject=n})(gS);var bS={},wS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lf;function r(n){return function(s){return t.get(s,n)}}e.property=r})(wS);var jS={},$x={},NS={},zx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(zx);var Lx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(Lx);var Fx={};(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})(Fx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zx,r=Lx,n=Fx;function s(u,f,m){return typeof m!="function"?s(u,f,()=>{}):i(u,f,function p(x,g,v,y,j,N){const w=m(x,g,v,y,j,N);return w!==void 0?!!w:i(x,g,p,N)},new Map)}function i(u,f,m,p){if(f===u)return!0;switch(typeof f){case"object":return o(u,f,m,p);case"function":return Object.keys(f).length>0?i(u,{...f},m,p):n.isEqualsSameValueZero(u,f);default:return t.isObject(u)?typeof f=="string"?f==="":!0:n.isEqualsSameValueZero(u,f)}}function o(u,f,m,p){if(f==null)return!0;if(Array.isArray(f))return c(u,f,m,p);if(f instanceof Map)return l(u,f,m,p);if(f instanceof Set)return d(u,f,m,p);const x=Object.keys(f);if(u==null||r.isPrimitive(u))return x.length===0;if(x.length===0)return!0;if(p!=null&&p.has(f))return p.get(f)===u;p==null||p.set(f,u);try{for(let g=0;g<x.length;g++){const v=x[g];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,p))return!1}return!0}finally{p==null||p.delete(f)}}function l(u,f,m,p){if(f.size===0)return!0;if(!(u instanceof Map))return!1;for(const[x,g]of f.entries()){const v=u.get(x);if(m(v,g,x,u,f,p)===!1)return!1}return!0}function c(u,f,m,p){if(f.length===0)return!0;if(!Array.isArray(u))return!1;const x=new Set;for(let g=0;g<f.length;g++){const v=f[g];let y=!1;for(let j=0;j<u.length;j++){if(x.has(j))continue;const N=u[j];let w=!1;if(m(N,v,g,u,f,p)&&(w=!0),w){x.add(j),y=!0;break}}if(!y)return!1}return!0}function d(u,f,m,p){return f.size===0?!0:u instanceof Set?c([...u],[...f],m,p):!1}e.isMatchWith=s,e.isSetMatch=d})(NS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=NS;function r(n,s){return t.isMatchWith(n,s,()=>{})}e.isMatch=r})($x);var kS={},Bx={},SS={};(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})(SS);var ff={};(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})(ff);var Wx={};(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]",p="[object Object]",x="[object Error]",g="[object DataView]",v="[object Uint8Array]",y="[object Uint8ClampedArray]",j="[object Uint16Array]",N="[object Uint32Array]",w="[object BigUint64Array]",k="[object Int8Array]",b="[object Int16Array]",S="[object Int32Array]",_="[object BigInt64Array]",C="[object Float32Array]",T="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=m,e.arrayTag=u,e.bigInt64ArrayTag=_,e.bigUint64ArrayTag=w,e.booleanTag=s,e.dataViewTag=g,e.dateTag=l,e.errorTag=x,e.float32ArrayTag=C,e.float64ArrayTag=T,e.functionTag=f,e.int16ArrayTag=b,e.int32ArrayTag=S,e.int8ArrayTag=k,e.mapTag=c,e.numberTag=n,e.objectTag=p,e.regexpTag=t,e.setTag=d,e.stringTag=r,e.symbolTag=o,e.uint16ArrayTag=j,e.uint32ArrayTag=N,e.uint8ArrayTag=v,e.uint8ClampedArrayTag=y})(Wx);var CS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(CS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=SS,r=ff,n=Wx,s=Lx,i=CS;function o(u,f){return l(u,void 0,u,new Map,f)}function l(u,f,m,p=new Map,x=void 0){const g=x==null?void 0:x(u,f,m,p);if(g!==void 0)return g;if(s.isPrimitive(u))return u;if(p.has(u))return p.get(u);if(Array.isArray(u)){const v=new Array(u.length);p.set(u,v);for(let y=0;y<u.length;y++)v[y]=l(u[y],y,m,p,x);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;p.set(u,v);for(const[y,j]of u)v.set(y,l(j,y,m,p,x));return v}if(u instanceof Set){const v=new Set;p.set(u,v);for(const y of u)v.add(l(y,void 0,m,p,x));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);p.set(u,v);for(let y=0;y<u.length;y++)v[y]=l(u[y],y,m,p,x);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 p.set(u,v),c(v,u,m,p,x),v}if(typeof File<"u"&&u instanceof File){const v=new File([u],u.name,{type:u.type});return p.set(u,v),c(v,u,m,p,x),v}if(typeof Blob<"u"&&u instanceof Blob){const v=new Blob([u],{type:u.type});return p.set(u,v),c(v,u,m,p,x),v}if(u instanceof Error){const v=new u.constructor;return p.set(u,v),v.message=u.message,v.name=u.name,v.stack=u.stack,v.cause=u.cause,c(v,u,m,p,x),v}if(u instanceof Boolean){const v=new Boolean(u.valueOf());return p.set(u,v),c(v,u,m,p,x),v}if(u instanceof Number){const v=new Number(u.valueOf());return p.set(u,v),c(v,u,m,p,x),v}if(u instanceof String){const v=new String(u.valueOf());return p.set(u,v),c(v,u,m,p,x),v}if(typeof u=="object"&&d(u)){const v=Object.create(Object.getPrototypeOf(u));return p.set(u,v),c(v,u,m,p,x),v}return u}function c(u,f,m=u,p,x){const g=[...Object.keys(f),...t.getSymbols(f)];for(let v=0;v<g.length;v++){const y=g[v],j=Object.getOwnPropertyDescriptor(u,y);(j==null||j.writable)&&(u[y]=l(f[y],y,m,p,x))}}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})(Bx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bx;function r(n){return t.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}e.cloneDeep=r})(kS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$x,r=kS;function n(s){return s=r.cloneDeep(s),i=>t.isMatch(i,s)}e.matches=n})(jS);var _S={},OS={},PS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bx,r=ff,n=Wx;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})(PS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=PS;function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(OS);var MS={},Ux={};(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})(Ux);var ES={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ff;function r(n){return n!==null&&typeof n=="object"&&t.getTag(n)==="[object Arguments]"}e.isArguments=r})(ES);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tx,r=Ux,n=ES,s=df;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})(MS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$x,r=cf,n=OS,s=lf,i=MS;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})(_S);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rx,r=wS,n=jS,s=_S;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})(bS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pS,r=xS,n=Rx,s=gS,i=bS;function o(l,c=n.identity){return s.isArrayLikeObject(l)?t.uniqBy(Array.from(l),r.ary(i.iteratee(c),1)):[]}e.uniqBy=o})(hS);var cL=hS.uniqBy;const Fy=Ta(cL);function dL(e,t,r){return t===!0?Fy(e,r):typeof t=="function"?Fy(e,t):e}var qx=h.createContext(null),uL=e=>e,Mt=()=>{var e=h.useContext(qx);return e?e.store.dispatch:uL},hd=()=>{},fL=()=>hd,mL=(e,t)=>e===t;function Ee(e){var t=h.useContext(qx),r=h.useMemo(()=>t?n=>{if(n!=null)return e(n)}:hd,[t,e]);return gE.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:fL,t?t.store.getState:hd,t?t.store.getState:hd,r,mL)}function hL(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function pL(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function xL(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 gL(e){const t=Array.isArray(e[0])?e[0]:e;return xL(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function vL(e,t){const r=[],{length:n}=e;for(let s=0;s<n;s++)r.push(e[s].apply(null,t));return r}var yL=class{constructor(e){this.value=e}deref(){return this.value}},bL=typeof WeakRef<"u"?WeakRef:yL,wL=0,Wy=1;function Hc(){return{s:wL,v:void 0,o:null,p:null}}function AS(e,t={}){let r=Hc();const{resultEqualityCheck:n}=t;let s,i=0;function o(){var f;let l=r;const{length:c}=arguments;for(let m=0,p=c;m<p;m++){const x=arguments[m];if(typeof x=="function"||typeof x=="object"&&x!==null){let g=l.o;g===null&&(l.o=g=new WeakMap);const v=g.get(x);v===void 0?(l=Hc(),g.set(x,l)):l=v}else{let g=l.p;g===null&&(l.p=g=new Map);const v=g.get(x);v===void 0?(l=Hc(),g.set(x,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 bL(u):u}return d.s=Wy,d.v=u,u}return o.clearCache=()=>{r=Hc(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function jL(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()),hL(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const u={...r,...c},{memoize:f,memoizeOptions:m=[],argsMemoize:p=AS,argsMemoizeOptions:x=[]}=u,g=By(m),v=By(x),y=gL(s),j=f(function(){return i++,d.apply(null,arguments)},...g),N=p(function(){o++;const k=vL(y,arguments);return l=j.apply(null,k),l},...v);return Object.assign(N,{resultFunc:d,memoizedResultFunc:j,dependencies:y,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:p})};return Object.assign(n,{withTypes:()=>n}),n}var G=jL(AS),NL=Object.assign((e,t=G)=>{pL(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:()=>NL}),DS={},TS={},IS={};(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})(IS);var RS={},Hx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(Hx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hx,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})(RS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=IS,r=RS,n=df;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(p=>String(p));const d=(p,x)=>{let g=p;for(let v=0;v<x.length&&g!=null;++v)g=g[x[v]];return g},u=(p,x)=>x==null||p==null?x:typeof p=="object"&&"key"in p?Object.hasOwn(x,p.key)?x[p.key]:d(x,p.path):typeof p=="function"?p(x):Array.isArray(p)?d(x,p):typeof x=="object"?x[p]:x,f=o.map(p=>(Array.isArray(p)&&p.length===1&&(p=p[0]),p==null||typeof p=="function"||Array.isArray(p)||r.isKey(p)?p:{key:p,path:n.toPath(p)}));return i.map(p=>({original:p,criteria:f.map(x=>u(x,p))})).slice().sort((p,x)=>{for(let g=0;g<f.length;g++){const v=t.compareValues(p.criteria[g],x.criteria[g],l[g]);if(v!==0)return v}return 0}).map(p=>p.original)}e.orderBy=s})(TS);var $S={};(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})($S);var Kx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ux,r=uf,n=zx,s=Fx;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})(Kx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=TS,r=$S,n=Kx;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})(DS);var kL=DS.sortBy;const mf=Ta(kL);var zS=e=>e.legend.settings,SL=e=>e.legend.size,CL=e=>e.legend.payload;G([CL,zS],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?mf(n,r):n});var Kc=1;function _L(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=h.useState({height:0,left:0,top:0,width:0}),n=h.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)>Kc||Math.abs(o.left-t.left)>Kc||Math.abs(o.top-t.top)>Kc||Math.abs(o.width-t.width)>Kc)&&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 nr(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 OL=typeof Symbol=="function"&&Symbol.observable||"@@observable",Uy=OL,Lm=()=>Math.random().toString(36).substring(7).split("").join("."),PL={INIT:`@@redux/INIT${Lm()}`,REPLACE:`@@redux/REPLACE${Lm()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Lm()}`},Pd=PL;function Yx(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 LS(e,t,r){if(typeof e!="function")throw new Error(nr(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(nr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(nr(1));return r(LS)(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(nr(3));return s}function f(v){if(typeof v!="function")throw new Error(nr(4));if(c)throw new Error(nr(5));let y=!0;d();const j=l++;return o.set(j,v),function(){if(y){if(c)throw new Error(nr(6));y=!1,d(),o.delete(j),i=null}}}function m(v){if(!Yx(v))throw new Error(nr(7));if(typeof v.type>"u")throw new Error(nr(8));if(typeof v.type!="string")throw new Error(nr(17));if(c)throw new Error(nr(9));try{c=!0,s=n(s,v)}finally{c=!1}return(i=o).forEach(j=>{j()}),v}function p(v){if(typeof v!="function")throw new Error(nr(10));n=v,m({type:Pd.REPLACE})}function x(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(nr(11));function j(){const w=y;w.next&&w.next(u())}return j(),{unsubscribe:v(j)}},[Uy](){return this}}}return m({type:Pd.INIT}),{dispatch:m,subscribe:f,getState:u,replaceReducer:p,[Uy]:x}}function ML(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Pd.INIT})>"u")throw new Error(nr(12));if(typeof r(void 0,{type:Pd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(nr(13))})}function FS(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{ML(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],p=o[f],x=m(p,l);if(typeof x>"u")throw l&&l.type,new Error(nr(14));d[f]=x,c=c||x!==p}return c=c||n.length!==Object.keys(o).length,c?d:o}}function Md(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function EL(...e){return t=>(r,n)=>{const s=t(r,n);let i=()=>{throw new Error(nr(15))};const o={getState:s.getState,dispatch:(c,...d)=>i(c,...d)},l=e.map(c=>c(o));return i=Md(...l)(s.dispatch),{...s,dispatch:i}}}function BS(e){return Yx(e)&&"type"in e&&typeof e.type=="string"}var WS=Symbol.for("immer-nothing"),qy=Symbol.for("immer-draftable"),Pr=Symbol.for("immer-state");function bn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Xr=Object,Xi=Xr.getPrototypeOf,Ed="constructor",hf="prototype",$h="configurable",Ad="enumerable",pd="writable",jl="value",_a=e=>!!e&&!!e[Pr];function Mn(e){var t;return e?US(e)||xf(e)||!!e[qy]||!!((t=e[Ed])!=null&&t[qy])||gf(e)||vf(e):!1}var AL=Xr[hf][Ed].toString(),Hy=new WeakMap;function US(e){if(!e||!Gx(e))return!1;const t=Xi(e);if(t===null||t===Xr[hf])return!0;const r=Xr.hasOwnProperty.call(t,Ed)&&t[Ed];if(r===Object)return!0;if(!Ai(r))return!1;let n=Hy.get(r);return n===void 0&&(n=Function.toString.call(r),Hy.set(r,n)),n===AL}function pf(e,t,r=!0){mc(e)===0?(r?Reflect.ownKeys(e):Xr.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((n,s)=>t(s,n,e))}function mc(e){const t=e[Pr];return t?t.type_:xf(e)?1:gf(e)?2:vf(e)?3:0}var Ky=(e,t,r=mc(e))=>r===2?e.has(t):Xr[hf].hasOwnProperty.call(e,t),zh=(e,t,r=mc(e))=>r===2?e.get(t):e[t],Dd=(e,t,r,n=mc(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function DL(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var xf=Array.isArray,gf=e=>e instanceof Map,vf=e=>e instanceof Set,Gx=e=>typeof e=="object",Ai=e=>typeof e=="function",Fm=e=>typeof e=="boolean";function TL(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ha=e=>e.copy_||e.base_,Vx=e=>e.modified_?e.copy_:e.base_;function Lh(e,t){if(gf(e))return new Map(e);if(vf(e))return new Set(e);if(xf(e))return Array[hf].slice.call(e);const r=US(e);if(t===!0||t==="class_only"&&!r){const n=Xr.getOwnPropertyDescriptors(e);delete n[Pr];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){const o=s[i],l=n[o];l[pd]===!1&&(l[pd]=!0,l[$h]=!0),(l.get||l.set)&&(n[o]={[$h]:!0,[pd]:!0,[Ad]:l[Ad],[jl]:e[o]})}return Xr.create(Xi(e),n)}else{const n=Xi(e);if(n!==null&&r)return{...e};const s=Xr.create(n);return Xr.assign(s,e)}}function Xx(e,t=!1){return yf(e)||_a(e)||!Mn(e)||(mc(e)>1&&Xr.defineProperties(e,{set:Yc,add:Yc,clear:Yc,delete:Yc}),Xr.freeze(e),t&&pf(e,(r,n)=>{Xx(n,!0)},!1)),e}function IL(){bn(2)}var Yc={[jl]:IL};function yf(e){return e===null||!Gx(e)?!0:Xr.isFrozen(e)}var Td="MapSet",Fh="Patches",Yy="ArrayMethods",qS={};function li(e){const t=qS[e];return t||bn(0,e),t}var Gy=e=>!!qS[e],Nl,HS=()=>Nl,RL=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Gy(Td)?li(Td):void 0,arrayMethodsPlugin_:Gy(Yy)?li(Yy):void 0});function Vy(e,t){t&&(e.patchPlugin_=li(Fh),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bh(e){Wh(e),e.drafts_.forEach($L),e.drafts_=null}function Wh(e){e===Nl&&(Nl=e.parent_)}var Xy=e=>Nl=RL(Nl,e);function $L(e){const t=e[Pr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Qy(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Pr].modified_&&(Bh(t),bn(4)),Mn(e)&&(e=Zy(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(r[Pr].base_,e,t)}else e=Zy(t,r);return zL(t,e,!0),Bh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==WS?e:void 0}function Zy(e,t){if(yf(t))return t;const r=t[Pr];if(!r)return Id(t,e.handledSet_,e);if(!bf(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);GS(r,e)}return r.copy_}function zL(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Xx(t,r)}function KS(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var bf=(e,t)=>e.scope_===t,LL=[];function YS(e,t,r,n){const s=ha(e),i=e.type_;if(n!==void 0&&zh(s,n,i)===t){Dd(s,n,r,i);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;pf(s,(c,d)=>{if(_a(d)){const u=l.get(d)||[];u.push(c),l.set(d,u)}})}const o=e.draftLocations_.get(t)??LL;for(const l of o)Dd(s,l,r,i)}function FL(e,t,r){e.callbacks_.push(function(s){var l;const i=t;if(!i||!bf(i,s))return;(l=s.mapSetPlugin_)==null||l.fixSetContents(i);const o=Vx(i);YS(e,i.draft_??i,o,r),GS(i,s)})}function GS(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)}KS(e)}}function BL(e,t,r){const{scope_:n}=e;if(_a(r)){const s=r[Pr];bf(s,n)&&s.callbacks_.push(function(){xd(e);const o=Vx(s);YS(e,r,o,t)})}else Mn(r)&&e.callbacks_.push(function(){const i=ha(e);e.type_===3?i.has(r)&&Id(r,n.handledSet_,n):zh(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Id(zh(e.copy_,t,e.type_),n.handledSet_,n)})}function Id(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||_a(e)||t.has(e)||!Mn(e)||yf(e)||(t.add(e),pf(e,(n,s)=>{if(_a(s)){const i=s[Pr];if(bf(i,r)){const o=Vx(i);Dd(e,n,o,e.type_),KS(i)}}else Mn(s)&&Id(s,t,r)})),e}function WL(e,t){const r=xf(e),n={type_:r?1:0,scope_:t?t.scope_:HS(),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=Rd;r&&(s=[n],i=kl);const{revoke:o,proxy:l}=Proxy.revocable(s,i);return n.draft_=l,n.revoke_=o,[l,n]}var Rd={get(e,t){if(t===Pr)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=ha(e);if(!Ky(s,t,e.type_))return UL(e,s,t);const i=s[t];if(e.finalized_||!Mn(i)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&TL(t))return i;if(i===Bm(e.base_,t)){xd(e);const o=e.type_===1?+t:t,l=qh(e.scope_,i,e,o);return e.copy_[o]=l}return i},has(e,t){return t in ha(e)},ownKeys(e){return Reflect.ownKeys(ha(e))},set(e,t,r){const n=VS(ha(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const s=Bm(ha(e),t),i=s==null?void 0:s[Pr];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(DL(r,s)&&(r!==void 0||Ky(e.base_,t,e.type_)))return!0;xd(e),Uh(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),BL(e,t,r)),!0},deleteProperty(e,t){return xd(e),Bm(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Uh(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ha(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[pd]:!0,[$h]:e.type_!==1||t!=="length",[Ad]:n[Ad],[jl]:r[t]}},defineProperty(){bn(11)},getPrototypeOf(e){return Xi(e.base_)},setPrototypeOf(){bn(12)}},kl={};for(let e in Rd){let t=Rd[e];kl[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}kl.deleteProperty=function(e,t){return kl.set.call(this,e,t,void 0)};kl.set=function(e,t,r){return Rd.set.call(this,e[0],t,r,e[0])};function Bm(e,t){const r=e[Pr];return(r?ha(r):e)[t]}function UL(e,t,r){var s;const n=VS(t,r);return n?jl in n?n[jl]:(s=n.get)==null?void 0:s.call(e.draft_):void 0}function VS(e,t){if(!(t in e))return;let r=Xi(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Xi(r)}}function Uh(e){e.modified_||(e.modified_=!0,e.parent_&&Uh(e.parent_))}function xd(e){e.copy_||(e.assigned_=new Map,e.copy_=Lh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var qL=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,s)=>{if(Ai(r)&&!Ai(n)){const o=n;n=r;const l=this;return function(d=o,...u){return l.produce(d,f=>n.call(this,f,...u))}}Ai(n)||bn(6),s!==void 0&&!Ai(s)&&bn(7);let i;if(Mn(r)){const o=Xy(this),l=qh(o,r,void 0);let c=!0;try{i=n(l),c=!1}finally{c?Bh(o):Wh(o)}return Vy(o,s),Qy(i,o)}else if(!r||!Gx(r)){if(i=n(r),i===void 0&&(i=r),i===WS&&(i=void 0),this.autoFreeze_&&Xx(i,!0),s){const o=[],l=[];li(Fh).generateReplacementPatches_(r,i,{patches_:o,inversePatches_:l}),s(o,l)}return i}else bn(1,r)},this.produceWithPatches=(r,n)=>{if(Ai(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]},Fm(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Fm(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Fm(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Mn(t)||bn(8),_a(t)&&(t=Cn(t));const r=Xy(this),n=qh(r,t,void 0);return n[Pr].isManual_=!0,Wh(r),n}finishDraft(t,r){const n=t&&t[Pr];(!n||!n.isManual_)&&bn(9);const{scope_:s}=n;return Vy(s,r),Qy(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=li(Fh).applyPatches_;return _a(t)?s(t,r):this.produce(t,i=>s(i,r))}};function qh(e,t,r,n){const[s,i]=gf(t)?li(Td).proxyMap_(t,r):vf(t)?li(Td).proxySet_(t,r):WL(t,r);return((r==null?void 0:r.scope_)??HS()).drafts_.push(s),i.callbacks_=(r==null?void 0:r.callbacks_)??[],i.key_=n,r&&n!==void 0?FL(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 Cn(e){return _a(e)||bn(10,e),XS(e)}function XS(e){if(!Mn(e)||yf(e))return e;const t=e[Pr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Lh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Lh(e,!0);return pf(r,(s,i)=>{Dd(r,s,XS(i))},n),t&&(t.finalized_=!1),r}var HL=new qL,QS=HL.produce;function ZS(e){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,e):s(i)}var KL=ZS(),YL=ZS,GL=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Md:Md.apply(null,arguments)};function un(e,t){function r(...n){if(t){let s=t(...n);if(!s)throw new Error(Qr(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=>BS(n)&&n.type===e,r}var JS=class il extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,il.prototype)}static get[Symbol.species](){return il}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new il(...t[0].concat(this)):new il(...t.concat(this))}};function Jy(e){return Mn(e)?QS(e,()=>{}):e}function Gc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function VL(e){return typeof e=="boolean"}var XL=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{};let o=new JS;return r&&(VL(r)?o.push(KL):o.push(YL(r.extraArgument))),o},e2="RTK_autoBatch",pt=()=>e=>({payload:e,meta:{[e2]:!0}}),eb=e=>t=>{setTimeout(t,e)},t2=(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:eb(10):e.type==="callback"?e.queueNotification:eb(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[e2]),i=!s,i&&(o||(o=!0,c(d))),n.dispatch(u)}finally{s=!0}}})},QL=e=>function(r){const{autoBatch:n=!0}=r??{};let s=new JS(e);return n&&s.push(t2(typeof n=="object"?n:void 0)),s};function ZL(e){const t=XL(),{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(Yx(r))l=FS(r);else throw new Error(Qr(1));let c;typeof n=="function"?c=n(t):c=t();let d=Md;s&&(d=GL({trace:!1,...typeof s=="object"&&s}));const u=EL(...c),f=QL(u);let m=typeof o=="function"?o(f):f();const p=d(...m);return LS(l,i,p)}function r2(e){const t={},r=[];let n;const s={addCase(i,o){const l=typeof i=="string"?i:i.type;if(!l)throw new Error(Qr(28));if(l in t)throw new Error(Qr(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 JL(e){return typeof e=="function"}function eF(e,t){let[r,n,s]=r2(t),i;if(JL(e))i=()=>Jy(e());else{const l=Jy(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(_a(u)){const p=f(u,c);return p===void 0?u:p}else{if(Mn(u))return QS(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 tF="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",rF=(e=21)=>{let t="",r=e;for(;r--;)t+=tF[Math.random()*64|0];return t},nF=Symbol.for("rtk-slice-createasyncthunk");function aF(e,t){return`${e}/${t}`}function sF({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[nF];return function(s){const{name:i,reducerPath:o=i}=s;if(!i)throw new Error(Qr(11));const l=(typeof s.reducers=="function"?s.reducers(oF()):s.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(w,k){const b=typeof w=="string"?w:w.type;if(!b)throw new Error(Qr(12));if(b in d.sliceCaseReducersByType)throw new Error(Qr(13));return d.sliceCaseReducersByType[b]=k,u},addMatcher(w,k){return d.sliceMatchers.push({matcher:w,reducer:k}),u},exposeAction(w,k){return d.actionCreators[w]=k,u},exposeCaseReducer(w,k){return d.sliceCaseReducersByName[w]=k,u}};c.forEach(w=>{const k=l[w],b={reducerName:w,type:aF(i,w),createNotation:typeof s.reducers=="function"};cF(k)?uF(b,k,u,t):lF(b,k,u)});function f(){const[w={},k=[],b=void 0]=typeof s.extraReducers=="function"?r2(s.extraReducers):[s.extraReducers],S={...w,...d.sliceCaseReducersByType};return eF(s.initialState,_=>{for(let C in S)_.addCase(C,S[C]);for(let C of d.sliceMatchers)_.addMatcher(C.matcher,C.reducer);for(let C of k)_.addMatcher(C.matcher,C.reducer);b&&_.addDefaultCase(b)})}const m=w=>w,p=new Map,x=new WeakMap;let g;function v(w,k){return g||(g=f()),g(w,k)}function y(){return g||(g=f()),g.getInitialState()}function j(w,k=!1){function b(_){let C=_[w];return typeof C>"u"&&k&&(C=Gc(x,b,y)),C}function S(_=m){const C=Gc(p,k,()=>new WeakMap);return Gc(C,_,()=>{const T={};for(const[M,O]of Object.entries(s.selectors??{}))T[M]=iF(O,_,()=>Gc(x,_,y),k);return T})}return{reducerPath:w,getSelectors:S,get selectors(){return S(b)},selectSlice:b}}const N={name:i,reducer:v,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:y,...j(o),injectInto(w,{reducerPath:k,...b}={}){const S=k??o;return w.inject({reducerPath:S,reducer:v},b),{...N,...j(S,!0)}}};return N}}function iF(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 Hr=sF();function oF(){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 lF({type:e,reducerName:t,createNotation:r},n,s){let i,o;if("reducer"in n){if(r&&!dF(n))throw new Error(Qr(17));i=n.reducer,o=n.prepare}else i=n;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,o?un(e,o):un(e))}function cF(e){return e._reducerDefinitionType==="asyncThunk"}function dF(e){return e._reducerDefinitionType==="reducerWithPrepare"}function uF({type:e,reducerName:t},r,n,s){if(!s)throw new Error(Qr(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||Vc,pending:l||Vc,rejected:c||Vc,settled:d||Vc})}function Vc(){}var fF="task",n2="listener",a2="completed",Qx="cancelled",mF=`task-${Qx}`,hF=`task-${a2}`,Hh=`${n2}-${Qx}`,pF=`${n2}-${a2}`,wf=class{constructor(e){lm(this,"name","TaskAbortError");lm(this,"message");this.code=e,this.message=`${fF} ${Qx} (reason: ${e})`}},Zx=(e,t)=>{if(typeof e!="function")throw new TypeError(Qr(32))},$d=()=>{},s2=(e,t=$d)=>(e.catch(t),e),i2=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Vs=e=>{if(e.aborted)throw new wf(e.reason)};function o2(e,t){let r=$d;return new Promise((n,s)=>{const i=()=>s(new wf(e.reason));if(e.aborted){i();return}r=i2(e,i),t.finally(()=>r()).then(n,s)}).finally(()=>{r=$d})}var xF=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof wf?"cancelled":"rejected",error:r}}finally{t==null||t()}},zd=e=>t=>s2(o2(e,t).then(r=>(Vs(e),r))),l2=e=>{const t=zd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Fi}=Object,tb={},jf="listenerMiddleware",gF=(e,t)=>{const r=n=>i2(e,()=>n.abort(e.reason));return(n,s)=>{Zx(n);const i=new AbortController;r(i);const o=xF(async()=>{Vs(e),Vs(i.signal);const l=await n({pause:zd(i.signal),delay:l2(i.signal),signal:i.signal});return Vs(i.signal),l},()=>i.abort(hF));return s!=null&&s.autoJoin&&t.push(o.catch($d)),{result:zd(e)(o),cancel(){i.abort(mF)}}}},vF=(e,t)=>{const r=async(n,s)=>{Vs(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 o2(t,Promise.race(l));return Vs(t),c}finally{i()}};return(n,s)=>s2(r(n,s))},c2=e=>{let{type:t,actionCreator:r,matcher:n,predicate:s,effect:i}=e;if(t)s=un(t).match;else if(r)t=r.type,s=r.match;else if(n)s=n;else if(!s)throw new Error(Qr(21));return Zx(i),{predicate:s,type:t,effect:i}},d2=Fi(e=>{const{type:t,predicate:r,effect:n}=c2(e);return{id:rF(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Qr(22))}}},{withTypes:()=>d2}),rb=(e,t)=>{const{type:r,effect:n,predicate:s}=c2(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===s)&&i.effect===n)},Kh=e=>{e.pending.forEach(t=>{t.abort(Hh)})},yF=(e,t)=>()=>{for(const r of t.keys())Kh(r);e.clear()},nb=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},u2=Fi(un(`${jf}/add`),{withTypes:()=>u2}),bF=un(`${jf}/removeAll`),f2=Fi(un(`${jf}/remove`),{withTypes:()=>f2}),wF=(...e)=>{console.error(`${jf}/error`,...e)},hc=(e={})=>{const t=new Map,r=new Map,n=p=>{const x=r.get(p)??0;r.set(p,x+1)},s=p=>{const x=r.get(p)??1;x===1?r.delete(p):r.set(p,x-1)},{extra:i,onError:o=wF}=e;Zx(o);const l=p=>(p.unsubscribe=()=>t.delete(p.id),t.set(p.id,p),x=>{p.unsubscribe(),x!=null&&x.cancelActive&&Kh(p)}),c=p=>{const x=rb(t,p)??d2(p);return l(x)};Fi(c,{withTypes:()=>c});const d=p=>{const x=rb(t,p);return x&&(x.unsubscribe(),p.cancelActive&&Kh(x)),!!x};Fi(d,{withTypes:()=>d});const u=async(p,x,g,v)=>{const y=new AbortController,j=vF(c,y.signal),N=[];try{p.pending.add(y),n(p),await Promise.resolve(p.effect(x,Fi({},g,{getOriginalState:v,condition:(w,k)=>j(w,k).then(Boolean),take:j,delay:l2(y.signal),pause:zd(y.signal),extra:i,signal:y.signal,fork:gF(y.signal,N),unsubscribe:p.unsubscribe,subscribe:()=>{t.set(p.id,p)},cancelActiveListeners:()=>{p.pending.forEach((w,k,b)=>{w!==y&&(w.abort(Hh),b.delete(w))})},cancel:()=>{y.abort(Hh),p.pending.delete(y)},throwIfCancelled:()=>{Vs(y.signal)}})))}catch(w){w instanceof wf||nb(o,w,{raisedBy:"effect"})}finally{await Promise.all(N),y.abort(pF),s(p),p.pending.delete(y)}},f=yF(t,r);return{middleware:p=>x=>g=>{if(!BS(g))return x(g);if(u2.match(g))return c(g.payload);if(bF.match(g)){f();return}if(f2.match(g))return d(g.payload);let v=p.getState();const y=()=>{if(v===tb)throw new Error(Qr(23));return v};let j;try{if(j=x(g),t.size>0){const N=p.getState(),w=Array.from(t.values());for(const k of w){let b=!1;try{b=k.predicate(g,N,v)}catch(S){b=!1,nb(o,S,{raisedBy:"predicate"})}b&&u(k,g,p,y)}}}finally{v=tb}return j},startListening:c,stopListening:d,clearListeners:f}};function Qr(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 jF={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},m2=Hr({name:"chartLayout",initialState:jF,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:NF,setLayout:kF,setChartSize:SF,setScale:CF}=m2.actions,_F=m2.reducer;function h2(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function qe(e){return Number.isFinite(e)}function ea(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function ab(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 Ti(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ab(Object(r),!0).forEach(function(n){OF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ab(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OF(e,t,r){return(t=PF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PF(e){var t=MF(e,"string");return typeof t=="symbol"?t:t+""}function MF(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 lr(e,t,r){return Vt(e)||Vt(t)?r:Jn(t)?Vi(e,t,r):typeof t=="function"?t(e):r}var EF=(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"&&Se(e[i]))return Ti(Ti({},e),{},{[i]:e[i]+(n||0)});if((l==="horizontal"||l==="vertical"&&i==="center")&&o!=="middle"&&Se(e[o]))return Ti(Ti({},e),{},{[o]:e[o]+(s||0)})}return e},bs=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",p2=(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},x2=(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:p}=e;if(!o)return null;var x=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,g=s==="category"&&o.bandwidth?o.bandwidth()/x:0;if(g=p==="angleAxis"&&i&&i.length>=2?Rr(i[0]-i[1])*2*g:g,f||m){var v=(f||m||[]).map((y,j)=>{var N=n?n.indexOf(y):y,w=o.map(N);return qe(w)?{coordinate:w+g,value:y,offset:g,index:j}:null}).filter($r);return v}return c&&d?d.map((y,j)=>{var N=o.map(y);return qe(N)?{coordinate:N+g,value:y,index:j,offset:g}:null}).filter($r):o.ticks&&u!=null?o.ticks(u).map((y,j)=>{var N=o.map(y);return qe(N)?{coordinate:N+g,value:y,index:j,offset:g}:null}).filter($r):o.domain().map((y,j)=>{var N=o.map(y);return qe(N)?{coordinate:N+g,value:n?n[y]:y,index:j,offset:g}:null}).filter($r)},AF=(e,t)=>{if(!t||t.length!==2||!Se(t[0])||!Se(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(!Se(e[0])||e[0]<r)&&(s[0]=r),(!Se(e[1])||e[1]>n)&&(s[1]=n),s[0]>n&&(s[0]=n),s[1]<r&&(s[1]=r),s},DF=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=Zn(u)?f:u;m>=0?(d[0]=i,i+=m,d[1]=i):(d[0]=o,o+=m,d[1]=o)}}}},TF=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=Zn(c[1])?c[0]:c[1];d>=0?(c[0]=i,i+=d,c[1]=i):(c[0]=0,c[1]=0)}}}},IF={sign:DF,expand:Fz,none:ii,silhouette:Bz,wiggle:Wz,positive:TF},RF=(e,t,r)=>{var n,s=(n=IF[r])!==null&&n!==void 0?n:ii,i=Lz().keys(t).value((l,c)=>Number(lr(l,c,0))).order(Ih).offset(s),o=i(e);return o.forEach((l,c)=>{l.forEach((d,u)=>{var f=lr(e[u],t[c],0);Array.isArray(f)&&f.length===2&&Se(f[0])&&Se(f[1])&&(d[0]=f[0],d[1]=f[1])})}),o};function $F(e){return e==null?void 0:String(e)}var sb=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=lr(i,t.dataKey,t.scale.domain()[o]);if(Vt(l))return null;var c=t.scale.map(l);return Se(c)?c-s/2+n:null},zF=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]},LF=e=>{var t=e.flat(2).filter(Se);return[Math.min(...t),Math.max(...t)]},FF=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],BF=(e,t,r)=>{if(e!=null)return FF(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=h2(d,t,r),f=LF(u);return!qe(f[0])||!qe(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]))},ib=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ob=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ld=(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=mf(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 lb(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:s,name:i}=e;return Ti(Ti({},t),{},{dataKey:r,payload:n,value:s,name:i})}function g2(e,t){if(e)return String(e);if(typeof t=="string")return t}var WF=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},UF=(e,t)=>t==="centric"?e.angle:e.radius,Ba=e=>e.layout.width,Wa=e=>e.layout.height,qF=e=>e.layout.scale,v2=e=>e.layout.margin,Nf=G(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),kf=G(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),HF="data-recharts-item-index",KF="data-recharts-item-id",pc=60;function cb(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 Xc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cb(Object(r),!0).forEach(function(n){YF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YF(e,t,r){return(t=GF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GF(e){var t=VF(e,"string");return typeof t=="symbol"?t:t+""}function VF(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 XF=e=>e.brush.height;function QF(e){var t=kf(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var s=typeof n.width=="number"?n.width:pc;return r+s}return r},0)}function ZF(e){var t=kf(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var s=typeof n.width=="number"?n.width:pc;return r+s}return r},0)}function JF(e){var t=Nf(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function e8(e){var t=Nf(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Xt=G([Ba,Wa,v2,XF,QF,ZF,JF,e8,zS,SL],(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=Xc(Xc({},f),u),p=m.bottom;m.bottom+=n,m=EF(m,c,d);var x=e-m.left-m.right,g=t-m.top-m.bottom;return Xc(Xc({brushBottom:p},m),{},{width:Math.max(x,0),height:Math.max(g,0)})}),t8=G(Xt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Jx=G(Ba,Wa,(e,t)=>({x:0,y:0,width:e,height:t})),r8=h.createContext(null),Kr=()=>h.useContext(r8)!=null,Sf=e=>e.brush,Cf=G([Sf,Xt,v2],(e,t,r)=>({height:e.height,x:Se(e.x)?e.x:t.left,y:Se(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Se(e.width)?e.width:t.width})),y2={},b2={},w2={};(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(),g()};let m=null;const p=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,f()},n)},x=()=>{m!==null&&(clearTimeout(m),m=null)},g=()=>{x(),o=void 0,l=null},v=()=>{u()},y=function(...j){if(s!=null&&s.aborted)return;o=this,l=j;const N=m==null;p(),c&&N&&u()};return y.schedule=p,y.cancel=g,y.flush=v,s==null||s.addEventListener("abort",g,{once:!0}),y}e.debounce=t})(w2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=w2;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(...g){u=n.apply(this,g),f=null},s,{edges:d}),p=function(...g){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(u=n.apply(this,g),f=Date.now(),m.cancel(),m.schedule(),u):(m.apply(this,g),u)},x=()=>(m.flush(),u);return p.cancel=m.cancel,p.flush=x,p}e.debounce=r})(b2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=b2;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})(y2);var n8=y2.throttle;const a8=Ta(n8);var Fd=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++]))}},Hn={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},j2=(e,t,r)=>{var{width:n=Hn.width,height:s=Hn.height,aspect:i,maxHeight:o}=r,l=oi(n)?e:Number(n),c=oi(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}},s8={width:0,height:0,overflow:"visible"},i8={width:0,overflowX:"visible"},o8={height:0,overflowY:"visible"},l8={},c8=e=>{var{width:t,height:r}=e,n=oi(t),s=oi(r);return n&&s?s8:n?i8:s?o8:l8};function d8(e){var{width:t,height:r,aspect:n}=e,s=t,i=r;return s===void 0&&i===void 0?(s=Hn.width,i=Hn.height):s===void 0?s=n&&n>0?void 0:Hn.width:i===void 0&&(i=n&&n>0?void 0:Hn.height),{width:s,height:i}}function Yh(){return Yh=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},Yh.apply(null,arguments)}function db(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 ub(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?db(Object(r),!0).forEach(function(n){u8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):db(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 N2=h.createContext(Hn.initialDimension);function h8(e){return ea(e.width)&&ea(e.height)}function k2(e){var{children:t,width:r,height:n}=e,s=h.useMemo(()=>({width:r,height:n}),[r,n]);return h8(s)?h.createElement(N2.Provider,{value:s},t):null}var eg=()=>h.useContext(N2),p8=h.forwardRef((e,t)=>{var{aspect:r,initialDimension:n=Hn.initialDimension,width:s,height:i,minWidth:o=Hn.minWidth,minHeight:l,maxHeight:c,children:d,debounce:u=Hn.debounce,id:f,className:m,onResize:p,style:x={}}=e,g=h.useRef(null),v=h.useRef();v.current=p,h.useImperativeHandle(t,()=>g.current);var[y,j]=h.useState({containerWidth:n.width,containerHeight:n.height}),N=h.useCallback((_,C)=>{j(T=>{var M=Math.round(_),O=Math.round(C);return T.containerWidth===M&&T.containerHeight===O?T:{containerWidth:M,containerHeight:O}})},[]);h.useEffect(()=>{if(g.current==null||typeof ResizeObserver>"u")return jo;var _=O=>{var R,E=O[0];if(E!=null){var{width:A,height:P}=E.contentRect;N(A,P),(R=v.current)===null||R===void 0||R.call(v,A,P)}};u>0&&(_=a8(_,u,{trailing:!0,leading:!1}));var C=new ResizeObserver(_),{width:T,height:M}=g.current.getBoundingClientRect();return N(T,M),C.observe(g.current),()=>{C.disconnect()}},[N,u]);var{containerWidth:w,containerHeight:k}=y;Fd(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:b,calculatedHeight:S}=j2(w,k,{width:s,height:i,aspect:r,maxHeight:c});return Fd(b!=null&&b>0||S!=null&&S>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
563
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
564
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
565
|
+
height and width.`,b,S,s,i,o,l,r),h.createElement("div",{id:f?"".concat(f):void 0,className:it("recharts-responsive-container",m),style:ub(ub({},x),{},{width:s,height:i,minWidth:o,minHeight:l,maxHeight:c}),ref:g},h.createElement("div",{style:c8({width:s,height:i})},h.createElement(k2,{width:b,height:S},d)))}),Bd=h.forwardRef((e,t)=>{var r=eg();if(ea(r.width)&&ea(r.height))return e.children;var{width:n,height:s}=d8({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:o}=j2(void 0,void 0,{width:n,height:s,aspect:e.aspect,maxHeight:e.maxHeight});return Se(i)&&Se(o)?h.createElement(k2,{width:i,height:o},e.children):h.createElement(p8,Yh({},e,{width:n,height:s,ref:t}))});function tg(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 _f=()=>{var e,t=Kr(),r=Ee(t8),n=Ee(Cf),s=(e=Ee(Sf))===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}},x8={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},S2=()=>{var e;return(e=Ee(Xt))!==null&&e!==void 0?e:x8},C2=()=>Ee(Ba),_2=()=>Ee(Wa),ot=e=>e.layout.layoutType,No=()=>Ee(ot),O2=()=>{var e=No();if(e==="horizontal"||e==="vertical")return e},P2=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},g8=()=>{var e=No();return e!==void 0},xc=e=>{var t=Mt(),r=Kr(),{width:n,height:s}=e,i=eg(),o=n,l=s;return i&&(o=i.width>0?i.width:n,l=i.height>0?i.height:s),h.useEffect(()=>{!r&&ea(o)&&ea(l)&&t(SF({width:o,height:l}))},[t,r,o,l]),null},M2=Symbol.for("immer-nothing"),fb=Symbol.for("immer-draftable"),Jr=Symbol.for("immer-state");function wn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Sl=Object.getPrototypeOf;function Qi(e){return!!e&&!!e[Jr]}function ci(e){var t;return e?E2(e)||Array.isArray(e)||!!e[fb]||!!((t=e.constructor)!=null&&t[fb])||gc(e)||Pf(e):!1}var v8=Object.prototype.constructor.toString(),mb=new WeakMap;function E2(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=mb.get(r);return n===void 0&&(n=Function.toString.call(r),mb.set(r,n)),n===v8}function Wd(e,t,r=!0){Of(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 Of(e){const t=e[Jr];return t?t.type_:Array.isArray(e)?1:gc(e)?2:Pf(e)?3:0}function Gh(e,t){return Of(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function A2(e,t,r){const n=Of(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function y8(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function gc(e){return e instanceof Map}function Pf(e){return e instanceof Set}function Ds(e){return e.copy_||e.base_}function Vh(e,t){if(gc(e))return new Map(e);if(Pf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=E2(e);if(t===!0||t==="class_only"&&!r){const n=Object.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.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(Sl(e),n)}else{const n=Sl(e);if(n!==null&&r)return{...e};const s=Object.create(n);return Object.assign(s,e)}}function rg(e,t=!1){return Mf(e)||Qi(e)||!ci(e)||(Of(e)>1&&Object.defineProperties(e,{set:Qc,add:Qc,clear:Qc,delete:Qc}),Object.freeze(e),t&&Object.values(e).forEach(r=>rg(r,!0))),e}function b8(){wn(2)}var Qc={value:b8};function Mf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var w8={};function di(e){const t=w8[e];return t||wn(0,e),t}var Cl;function D2(){return Cl}function j8(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function hb(e,t){t&&(di("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Xh(e){Qh(e),e.drafts_.forEach(N8),e.drafts_=null}function Qh(e){e===Cl&&(Cl=e.parent_)}function pb(e){return Cl=j8(Cl,e)}function N8(e){const t=e[Jr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function xb(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Jr].modified_&&(Xh(t),wn(4)),ci(e)&&(e=Ud(t,e),t.parent_||qd(t,e)),t.patches_&&di("Patches").generateReplacementPatches_(r[Jr].base_,e,t.patches_,t.inversePatches_)):e=Ud(t,r,[]),Xh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==M2?e:void 0}function Ud(e,t,r){if(Mf(t))return t;const n=e.immer_.shouldUseStrictIteration(),s=t[Jr];if(!s)return Wd(t,(i,o)=>gb(e,s,t,i,o,r),n),t;if(s.scope_!==e)return t;if(!s.modified_)return qd(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)=>gb(e,s,i,c,d,r,l),n),qd(e,i,!1),r&&e.patches_&&di("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function gb(e,t,r,n,s,i,o){if(s==null||typeof s!="object"&&!o)return;const l=Mf(s);if(!(l&&!o)){if(Qi(s)){const c=i&&t&&t.type_!==3&&!Gh(t.assigned_,n)?i.concat(n):void 0,d=Ud(e,s,c);if(A2(r,n,d),Qi(d))e.canAutoFreeze_=!1;else return}else o&&r.add(s);if(ci(s)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===s&&l)return;Ud(e,s),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(gc(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&qd(e,s)}}}function qd(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&rg(t,r)}function k8(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:D2(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=n,i=ng;r&&(s=[n],i=_l);const{revoke:o,proxy:l}=Proxy.revocable(s,i);return n.draft_=l,n.revoke_=o,l}var ng={get(e,t){if(t===Jr)return e;const r=Ds(e);if(!Gh(r,t))return S8(e,r,t);const n=r[t];return e.finalized_||!ci(n)?n:n===Wm(e.base_,t)?(Um(e),e.copy_[t]=Jh(n,e)):n},has(e,t){return t in Ds(e)},ownKeys(e){return Reflect.ownKeys(Ds(e))},set(e,t,r){const n=T2(Ds(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const s=Wm(Ds(e),t),i=s==null?void 0:s[Jr];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(y8(r,s)&&(r!==void 0||Gh(e.base_,t)))return!0;Um(e),Zh(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 Wm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Um(e),Zh(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Ds(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){wn(11)},getPrototypeOf(e){return Sl(e.base_)},setPrototypeOf(){wn(12)}},_l={};Wd(ng,(e,t)=>{_l[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});_l.deleteProperty=function(e,t){return _l.set.call(this,e,t,void 0)};_l.set=function(e,t,r){return ng.set.call(this,e[0],t,r,e[0])};function Wm(e,t){const r=e[Jr];return(r?Ds(r):e)[t]}function S8(e,t,r){var s;const n=T2(t,r);return n?"value"in n?n.value:(s=n.get)==null?void 0:s.call(e.draft_):void 0}function T2(e,t){if(!(t in e))return;let r=Sl(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Sl(r)}}function Zh(e){e.modified_||(e.modified_=!0,e.parent_&&Zh(e.parent_))}function Um(e){e.copy_||(e.copy_=Vh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var C8=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"&&wn(6),n!==void 0&&typeof n!="function"&&wn(7);let s;if(ci(t)){const i=pb(this),o=Jh(t,void 0);let l=!0;try{s=r(o),l=!1}finally{l?Xh(i):Qh(i)}return hb(i,n),xb(s,i)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===M2&&(s=void 0),this.autoFreeze_&&rg(s,!0),n){const i=[],o=[];di("Patches").generateReplacementPatches_(t,s,i,o),n(i,o)}return s}else wn(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){ci(e)||wn(8),Qi(e)&&(e=_8(e));const t=pb(this),r=Jh(e,void 0);return r[Jr].isManual_=!0,Qh(t),r}finishDraft(e,t){const r=e&&e[Jr];(!r||!r.isManual_)&&wn(9);const{scope_:n}=r;return hb(n,t),xb(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=di("Patches").applyPatches_;return Qi(e)?n(e,t):this.produce(e,s=>n(s,t))}};function Jh(e,t){const r=gc(e)?di("MapSet").proxyMap_(e,t):Pf(e)?di("MapSet").proxySet_(e,t):k8(e,t);return(t?t.scope_:D2()).drafts_.push(r),r}function _8(e){return Qi(e)||wn(10,e),I2(e)}function I2(e){if(!ci(e)||Mf(e))return e;const t=e[Jr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Vh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Vh(e,!0);return Wd(r,(s,i)=>{A2(r,s,I2(i))},n),t&&(t.finalized_=!1),r}var O8=new C8;O8.produce;var P8={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},R2=Hr({name:"legend",initialState:P8,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:pt()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,s=Cn(e).payload.indexOf(r);s>-1&&(e.payload[s]=n)},prepare:pt()},removeLegendPayload:{reducer(e,t){var r=Cn(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:pt()}}}),{setLegendSize:ite,setLegendSettings:ote,addLegendPayload:M8,replaceLegendPayload:E8,removeLegendPayload:A8}=R2.actions,D8=R2.reducer;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 vb(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 Go(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vb(Object(r),!0).forEach(function(n){T8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function T8(e,t,r){return(t=I8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function I8(e){var t=R8(e,"string");return typeof t=="symbol"?t:t+""}function R8(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 $8(e){return Array.isArray(e)&&Jn(e[0])&&Jn(e[1])?e.join(" ~ "):e}var _i={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},z8=e=>{var{separator:t=_i.separator,contentStyle:r,itemStyle:n,labelStyle:s=_i.labelStyle,payload:i,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:d,label:u,labelFormatter:f,accessibilityLayer:m=_i.accessibilityLayer}=e,p=()=>{if(i&&i.length){var k={padding:0,margin:0},b=(l?mf(i,l):i).map((S,_)=>{if(S.type==="none")return null;var C=S.formatter||o||$8,{value:T,name:M}=S,O=T,R=M;if(C){var E=C(T,M,S,_,i);if(Array.isArray(E))[O,R]=E;else if(E!=null)O=E;else return null}var A=Go(Go({},_i.itemStyle),{},{color:S.color||_i.itemStyle.color},n);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(_),style:A},Jn(R)?h.createElement("span",{className:"recharts-tooltip-item-name"},R):null,Jn(R)?h.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,h.createElement("span",{className:"recharts-tooltip-item-value"},O),h.createElement("span",{className:"recharts-tooltip-item-unit"},S.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:k},b)}return null},x=Go(Go({},_i.contentStyle),r),g=Go({margin:0},s),v=!Vt(u),y=v?u:"",j=it("recharts-default-tooltip",c),N=it("recharts-tooltip-label",d);v&&f&&i!==void 0&&i!==null&&(y=f(u,i));var w=m?{role:"status","aria-live":"assertive"}:{};return h.createElement("div",ep({className:j,style:x},w),h.createElement("p",{className:N,style:g},h.isValidElement(y)?y:"".concat(y)),p())},Vo="recharts-tooltip-wrapper",L8={visibility:"hidden"};function F8(e){var{coordinate:t,translateX:r,translateY:n}=e;return it(Vo,{["".concat(Vo,"-right")]:Se(r)&&t&&Se(t.x)&&r>=t.x,["".concat(Vo,"-left")]:Se(r)&&t&&Se(t.x)&&r<t.x,["".concat(Vo,"-bottom")]:Se(n)&&t&&Se(t.y)&&n>=t.y,["".concat(Vo,"-top")]:Se(n)&&t&&Se(t.y)&&n<t.y})}function yb(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offset:s,position:i,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:d}=e;if(i&&Se(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 p=u,x=m;return p<x?Math.max(f,m):Math.max(u,m)}if(d==null)return 0;var g=f+l,v=m+d;return g>v?Math.max(u,m):Math.max(f,m)}function B8(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 W8(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=yb({allowEscapeViewBox:t,coordinate:r,key:"x",offset:s,position:i,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),m=yb({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:i,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),u=B8({translateX:f,translateY:m,useTranslate3d:c})):u=L8,{cssProperties:u,cssClasses:F8({translateX:f,translateY:m,coordinate:r})}}function bb(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?bb(Object(r),!0).forEach(function(n){tp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tp(e,t,r){return(t=U8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function U8(e){var t=q8(e,"string");return typeof t=="symbol"?t:t+""}function q8(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 H8 extends h.PureComponent{constructor(){super(...arguments),tp(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),tp(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:p,wrapperStyle:x,lastBoundingBox:g,innerRef:v,hasPortalFromProps:y}=this.props,j=typeof d=="number"?d:d.x,N=typeof d=="number"?d:d.y,{cssClasses:w,cssProperties:k}=W8({allowEscapeViewBox:r,coordinate:o,offsetLeft:j,offsetTop:N,position:u,reverseDirection:f,tooltipBox:{height:g.height,width:g.width},useTranslate3d:m,viewBox:p}),b=y?{}:Zc(Zc({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=Zc(Zc({},b),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},x);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:w,style:S,ref:v},i)}}var $2=()=>{var e;return(e=Ee(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};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 wb(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 jb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wb(Object(r),!0).forEach(function(n){K8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function K8(e,t,r){return(t=Y8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Y8(e){var t=G8(e,"string");return typeof t=="symbol"?t:t+""}function G8(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 Nb={curveBasisClosed:Oz,curveBasisOpen:Pz,curveBasis:_z,curveBumpX:mz,curveBumpY:hz,curveLinearClosed:Mz,curveLinear:sf,curveMonotoneX:Ez,curveMonotoneY:Az,curveNatural:Dz,curveStep:Tz,curveStepAfter:Rz,curveStepBefore:Iz},Hd=e=>qe(e.x)&&qe(e.y),kb=e=>e.base!=null&&Hd(e.base)&&Hd(e),Xo=e=>e.x,Qo=e=>e.y,V8=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(fc(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=Nb["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return Nb[r]||sf},Sb={connectNulls:!1,type:"linear"},X8=e=>{var{type:t=Sb.type,points:r=[],baseLine:n,layout:s,connectNulls:i=Sb.connectNulls}=e,o=V8(t,s),l=i?r.filter(Hd):r;if(Array.isArray(n)){var c,d=r.map((x,g)=>jb(jb({},x),{},{base:n[g]}));s==="vertical"?c=qc().y(Qo).x1(Xo).x0(x=>x.base.x):c=qc().x(Xo).y1(Qo).y0(x=>x.base.y);var u=c.defined(kb).curve(o),f=i?d.filter(kb):d;return u(f)}var m;s==="vertical"&&Se(n)?m=qc().y(Qo).x1(Xo).x0(n):Se(n)?m=qc().x(Xo).y1(Qo).y0(n):m=Qk().x(Xo).y(Qo);var p=m.defined(Hd).curve(o);return p(l)},z2=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?X8(o):n;return h.createElement("path",rp({},Sa(e),nL(e),{className:it("recharts-curve",t),d:l===null?void 0:l,ref:s}))},Q8=["x","y","top","left","width","height","className"];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 Cb(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 Z8(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cb(Object(r),!0).forEach(function(n){J8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function J8(e,t,r){return(t=eB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eB(e){var t=tB(e,"string");return typeof t=="symbol"?t:t+""}function tB(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 rB(e,t){if(e==null)return{};var r,n,s=nB(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 nB(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 aB=(e,t,r,n,s,i)=>"M".concat(e,",").concat(s,"v").concat(n,"M").concat(i,",").concat(t,"h").concat(r),sB=e=>{var{x:t=0,y:r=0,top:n=0,left:s=0,width:i=0,height:o=0,className:l}=e,c=rB(e,Q8),d=Z8({x:t,y:r,top:n,left:s,width:i,height:o},c);return!Se(t)||!Se(r)||!Se(i)||!Se(o)||!Se(n)||!Se(s)?null:h.createElement("path",np({},dn(d),{className:it("recharts-cross",l),d:aB(t,r,i,o,n,s)}))};function iB(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 _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){oB(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 oB(e,t,r){return(t=lB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lB(e){var t=cB(e,"string");return typeof t=="symbol"?t:t+""}function cB(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 dB=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),L2=(e,t,r)=>e.map(n=>"".concat(dB(n)," ").concat(t,"ms ").concat(r)).join(","),uB=(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 Pb(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 zt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pb(Object(r),!0).forEach(function(n){fB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fB(e,t,r){return(t=mB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mB(e){var t=hB(e,"string");return typeof t=="symbol"?t:t+""}function hB(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 Kd=(e,t,r)=>e+(t-e)*r,ap=e=>{var{from:t,to:r}=e;return t!==r},F2=(e,t,r)=>{var n=Ol((s,i)=>{if(ap(i)){var[o,l]=e(i.from,i.to,i.velocity);return zt(zt({},i),{},{from:o,velocity:l})}return i},t);return r<1?Ol((s,i)=>ap(i)&&n[s]!=null?zt(zt({},i),{},{velocity:Kd(i.velocity,n[s].velocity,r),from:Kd(i.from,n[s].from,r)}):i,t):F2(e,n,r-1)};function pB(e,t,r,n,s,i){var o,l=n.reduce((m,p)=>zt(zt({},m),{},{[p]:{from:e[p],velocity:0,to:t[p]}}),{}),c=()=>Ol((m,p)=>p.from,l),d=()=>!Object.values(l).filter(ap).length,u=null,f=m=>{o||(o=m);var p=m-o,x=p/r.dt;l=F2(r,l,x),s(zt(zt(zt({},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 xB(e,t,r,n,s,i,o){var l=null,c=s.reduce((f,m)=>{var p=e[m],x=t[m];return p==null||x==null?f:zt(zt({},f),{},{[m]:[p,x]})},{}),d,u=f=>{d||(d=f);var m=(f-d)/n,p=Ol((g,v)=>Kd(...v,r(m)),c);if(i(zt(zt(zt({},e),t),p)),m<1)l=o.setTimeout(u);else{var x=Ol((g,v)=>Kd(...v,r(1)),c);i(zt(zt(zt({},e),t),x))}};return()=>(l=o.setTimeout(u),()=>{var f;(f=l)===null||f===void 0||f()})}const gB=(e,t,r,n,s,i)=>{var o=uB(e,t);return r==null?()=>(s(zt(zt({},e),t)),()=>{}):r.isStepper===!0?pB(e,t,r,o,s,i):xB(e,t,r,n,o,s,i)};var Yd=1e-4,B2=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],W2=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),Mb=(e,t)=>r=>{var n=B2(e,t);return W2(n,r)},vB=(e,t)=>r=>{var n=B2(e,t),s=[...n.map((i,o)=>i*o).slice(1),0];return W2(s,r)},yB=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]]},bB=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=yB(r[0]);if(s)return s}}return r.length===4?r:[0,0,1,1]},wB=(e,t,r,n)=>{var s=Mb(e,r),i=Mb(t,n),o=vB(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 p=s(f)-u,x=o(f);if(Math.abs(p-u)<Yd||x<Yd)return i(f);f=l(f-p/x)}return i(f)};return c.isStepper=!1,c},Eb=function(){return wB(...bB(...arguments))},jB=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)<Yd&&Math.abs(f)<Yd?[l,0]:[m,f]};return i.isStepper=!0,i.dt=s,i},NB=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Eb(e);case"spring":return jB();default:if(e.split("(")[0]==="cubic-bezier")return Eb(e)}return typeof e=="function"?e:null};function kB(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 SB{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 CB(){return kB(new SB)}var _B=h.createContext(CB);function OB(e,t){var r=h.useContext(_B);return h.useMemo(()=>t??r(e),[e,t,r])}var PB=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Ef={isSsr:PB()},MB={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Ab={t:0},qm={t:1};function ag(e){var t=en(e,MB),{isActive:r,canBegin:n,duration:s,easing:i,begin:o,onAnimationEnd:l,onAnimationStart:c,children:d}=t,u=r==="auto"?!Ef.isSsr:r,f=OB(t.animationId,t.animationManager),[m,p]=h.useState(u?Ab:qm),x=h.useRef(null);return h.useEffect(()=>{u||p(qm)},[u]),h.useEffect(()=>{if(!u||!n)return jo;var g=gB(Ab,qm,NB(i),s,p,f.getTimeoutController()),v=()=>{x.current=g()};return f.start([c,o,v,s,l]),()=>{f.stop(),x.current&&x.current(),l()}},[u,n,s,i,o,c,l,f]),d(m.t)}function sg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=h.useRef(wl(t)),n=h.useRef(e);return n.current!==e&&(r.current=wl(t),n.current=e),r.current}var EB=["radius"],AB=["radius"],Db,Tb,Ib,Rb,$b,zb,Lb,Fb,Bb,Wb;function Ub(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 qb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ub(Object(r),!0).forEach(function(n){DB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ub(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DB(e,t,r){return(t=TB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TB(e){var t=IB(e,"string");return typeof t=="symbol"?t:t+""}function IB(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 Gd(){return Gd=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},Gd.apply(null,arguments)}function Hb(e,t){if(e==null)return{};var r,n,s=RB(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 RB(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 $n(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Kb=(e,t,r,n,s)=>{var i=ts(r),o=ts(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],p=0,x=4;p<x;p++){var g,v=(g=s[p])!==null&&g!==void 0?g:0;m[p]=v>l?l:v}f=kt(Db||(Db=$n(["M",",",""])),e,t+c*m[0]),m[0]>0&&(f+=kt(Tb||(Tb=$n(["A ",",",",0,0,",",",",",""])),m[0],m[0],u,e+d*m[0],t)),f+=kt(Ib||(Ib=$n(["L ",",",""])),e+r-d*m[1],t),m[1]>0&&(f+=kt(Rb||(Rb=$n(["A ",",",",0,0,",`,
|
|
566
|
+
`,",",""])),m[1],m[1],u,e+r,t+c*m[1])),f+=kt($b||($b=$n(["L ",",",""])),e+r,t+n-c*m[2]),m[2]>0&&(f+=kt(zb||(zb=$n(["A ",",",",0,0,",`,
|
|
567
|
+
`,",",""])),m[2],m[2],u,e+r-d*m[2],t+n)),f+=kt(Lb||(Lb=$n(["L ",",",""])),e+d*m[3],t+n),m[3]>0&&(f+=kt(Fb||(Fb=$n(["A ",",",",0,0,",`,
|
|
568
|
+
`,",",""])),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=kt(Bb||(Bb=$n(["M ",",",`
|
|
569
|
+
A `,",",",0,0,",",",",",`
|
|
570
|
+
L `,",",`
|
|
571
|
+
A `,",",",0,0,",",",",",`
|
|
572
|
+
L `,",",`
|
|
573
|
+
A `,",",",0,0,",",",",",`
|
|
574
|
+
L `,",",`
|
|
575
|
+
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=kt(Wb||(Wb=$n(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return f},Yb={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},U2=e=>{var t=en(e,Yb),r=h.useRef(null),[n,s]=h.useState(-1);h.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var U=r.current.getTotalLength();U&&s(U)}catch{}},[]);var{x:i,y:o,width:l,height:c,radius:d,className:u}=t,{animationEasing:f,animationDuration:m,animationBegin:p,isAnimationActive:x,isUpdateAnimationActive:g}=t,v=h.useRef(l),y=h.useRef(c),j=h.useRef(i),N=h.useRef(o),w=h.useMemo(()=>({x:i,y:o,width:l,height:c,radius:d}),[i,o,l,c,d]),k=sg(w,"rectangle-");if(i!==+i||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var b=it("recharts-rectangle",u);if(!g){var S=dn(t),{radius:_}=S,C=Hb(S,EB);return h.createElement("path",Gd({},C,{x:ts(i),y:ts(o),width:ts(l),height:ts(c),radius:typeof d=="number"?d:void 0,className:b,d:Kb(i,o,l,c,d)}))}var T=v.current,M=y.current,O=j.current,R=N.current,E="0px ".concat(n===-1?1:n,"px"),A="".concat(n,"px 0px"),P=L2(["strokeDasharray"],m,typeof f=="string"?f:Yb.animationEasing);return h.createElement(ag,{animationId:k,key:k,canBegin:n>0,duration:m,easing:f,isActive:g,begin:p},U=>{var Q=sr(T,l,U),K=sr(M,c,U),se=sr(O,i,U),ae=sr(R,o,U);r.current&&(v.current=Q,y.current=K,j.current=se,N.current=ae);var W;x?U>0?W={transition:P,strokeDasharray:A}:W={strokeDasharray:E}:W={strokeDasharray:A};var Y=dn(t),{radius:te}=Y,X=Hb(Y,AB);return h.createElement("path",Gd({},X,{radius:typeof d=="number"?d:void 0,className:b,d:Kb(se,ae,Q,K,d),ref:r,style:qb(qb({},W),t.style)}))})};function Gb(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 Vb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gb(Object(r),!0).forEach(function(n){$B(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $B(e,t,r){return(t=zB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zB(e){var t=LB(e,"string");return typeof t=="symbol"?t:t+""}function LB(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 Vd=Math.PI/180,FB=e=>e*180/Math.PI,or=(e,t,r,n)=>({x:e+Math.cos(-Vd*n)*r,y:t+Math.sin(-Vd*n)*r}),BB=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},WB=(e,t)=>{var{x:r,y:n}=e,{x:s,y:i}=t;return Math.sqrt((r-s)**2+(n-i)**2)},UB=(e,t)=>{var{x:r,y:n}=e,{cx:s,cy:i}=t,o=WB({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:FB(c),angleInRadian:c}},qB=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}},HB=(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},KB=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:s,angle:i}=UB({x:r,y:n},t),{innerRadius:o,outerRadius:l}=t;if(s<o||s>l||s===0)return null;var{startAngle:c,endAngle:d}=qB(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?Vb(Vb({},t),{},{radius:s,angle:HB(u,t)}):null};function q2(e){var{cx:t,cy:r,radius:n,startAngle:s,endAngle:i}=e,o=or(t,r,n,s),l=or(t,r,n,i);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:s,endAngle:i}}var Xb,Qb,Zb,Jb,e0,t0,r0;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 Ws(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var YB=(e,t)=>{var r=Rr(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},Jc=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)/Vd,f=c?s:s+i*u,m=or(t,r,d,f),p=or(t,r,n,f),x=c?s-i*u:s,g=or(t,r,d*Math.cos(u*Vd),x);return{center:m,circleTangency:p,lineTangency:g,theta:u}},H2=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:s,startAngle:i,endAngle:o}=e,l=YB(i,o),c=i+l,d=or(t,r,s,i),u=or(t,r,s,c),f=kt(Xb||(Xb=Ws(["M ",",",`
|
|
576
|
+
A `,",",`,0,
|
|
577
|
+
`,",",`,
|
|
578
|
+
`,",",`
|
|
579
|
+
`])),d.x,d.y,s,s,+(Math.abs(l)>180),+(i>c),u.x,u.y);if(n>0){var m=or(t,r,n,i),p=or(t,r,n,c);f+=kt(Qb||(Qb=Ws(["L ",",",`
|
|
580
|
+
A `,",",`,0,
|
|
581
|
+
`,",",`,
|
|
582
|
+
`,","," Z"])),p.x,p.y,n,n,+(Math.abs(l)>180),+(i<=c),m.x,m.y)}else f+=kt(Zb||(Zb=Ws(["L ",","," Z"])),t,r);return f},GB=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:s,cornerRadius:i,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=e,u=Rr(d-c),{circleTangency:f,lineTangency:m,theta:p}=Jc({cx:t,cy:r,radius:s,angle:c,sign:u,cornerRadius:i,cornerIsExternal:l}),{circleTangency:x,lineTangency:g,theta:v}=Jc({cx:t,cy:r,radius:s,angle:d,sign:-u,cornerRadius:i,cornerIsExternal:l}),y=l?Math.abs(c-d):Math.abs(c-d)-p-v;if(y<0)return o?kt(Jb||(Jb=Ws(["M ",",",`
|
|
583
|
+
a`,",",",0,0,1,",`,0
|
|
584
|
+
a`,",",",0,0,1,",`,0
|
|
585
|
+
`])),m.x,m.y,i,i,i*2,i,i,-i*2):H2({cx:t,cy:r,innerRadius:n,outerRadius:s,startAngle:c,endAngle:d});var j=kt(e0||(e0=Ws(["M ",",",`
|
|
586
|
+
A`,",",",0,0,",",",",",`
|
|
587
|
+
A`,",",",0,",",",",",",",`
|
|
588
|
+
A`,",",",0,0,",",",",",`
|
|
589
|
+
`])),m.x,m.y,i,i,+(u<0),f.x,f.y,s,s,+(y>180),+(u<0),x.x,x.y,i,i,+(u<0),g.x,g.y);if(n>0){var{circleTangency:N,lineTangency:w,theta:k}=Jc({cx:t,cy:r,radius:n,angle:c,sign:u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),{circleTangency:b,lineTangency:S,theta:_}=Jc({cx:t,cy:r,radius:n,angle:d,sign:-u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),C=l?Math.abs(c-d):Math.abs(c-d)-k-_;if(C<0&&i===0)return"".concat(j,"L").concat(t,",").concat(r,"Z");j+=kt(t0||(t0=Ws(["L",",",`
|
|
590
|
+
A`,",",",0,0,",",",",",`
|
|
591
|
+
A`,",",",0,",",",",",",",`
|
|
592
|
+
A`,",",",0,0,",",",",","Z"])),S.x,S.y,i,i,+(u<0),b.x,b.y,n,n,+(C>180),+(u>0),N.x,N.y,i,i,+(u<0),w.x,w.y)}else j+=kt(r0||(r0=Ws(["L",",","Z"])),t,r);return j},VB={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},K2=e=>{var t=en(e,VB),{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=it("recharts-sector",f),p=i-s,x=Pn(o,p,0,!0),g;return x>0&&Math.abs(d-u)<360?g=GB({cx:r,cy:n,innerRadius:s,outerRadius:i,cornerRadius:Math.min(x,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u}):g=H2({cx:r,cy:n,innerRadius:s,outerRadius:i,startAngle:d,endAngle:u}),h.createElement("path",sp({},dn(t),{className:m,d:g}))};function XB(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(mS(t)){if(e==="centric"){var{cx:n,cy:s,innerRadius:i,outerRadius:o,angle:l}=t,c=or(n,s,i,l),d=or(n,s,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return q2(t)}}var Y2={},G2={},V2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hx;function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(V2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=V2;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})(G2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kx,r=G2;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})(Y2);var QB=Y2.range;const X2=Ta(QB);function ds(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ZB(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ig(e){let t,r,n;e.length!==2?(t=ds,r=(l,c)=>ds(e(l),c),n=(l,c)=>e(l)-c):(t=e===ds||e===ZB?e:JB,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 JB(){return 0}function Q2(e){return e===null?NaN:+e}function*eW(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const tW=ig(ds),vc=tW.right;ig(Q2).center;class n0 extends Map{constructor(t,r=aW){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(a0(this,t))}has(t){return super.has(a0(this,t))}set(t,r){return super.set(rW(this,t),r)}delete(t){return super.delete(nW(this,t))}}function a0({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function rW({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function nW({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function aW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function sW(e=ds){if(e===ds)return Z2;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 Z2(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const iW=Math.sqrt(50),oW=Math.sqrt(10),lW=Math.sqrt(2);function Xd(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>=iW?10:i>=oW?5:i>=lW?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?Xd(e,t,r*2):[l,c,d]}function ip(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?Xd(t,e,r):Xd(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 op(e,t,r){return t=+t,e=+e,r=+r,Xd(e,t,r)[2]}function lp(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?op(t,e,r):op(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function s0(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function i0(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function J2(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?Z2:sW(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),p=Math.max(r,Math.floor(t-d*f/c+m)),x=Math.min(n,Math.floor(t+(c-d)*f/c+m));J2(e,t,p,x,s)}const i=e[t];let o=r,l=n;for(Zo(e,r,t),s(e[n],i)>0&&Zo(e,r,n);o<l;){for(Zo(e,o,l),++o,--l;s(e[o],i)<0;)++o;for(;s(e[l],i)>0;)--l}s(e[r],i)===0?Zo(e,r,l):(++l,Zo(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Zo(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function cW(e,t,r){if(e=Float64Array.from(eW(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return i0(e);if(t>=1)return s0(e);var n,s=(n-1)*t,i=Math.floor(s),o=s0(J2(e,i).subarray(0,i+1)),l=i0(e.subarray(i+1));return o+(l-o)*(s-i)}}function dW(e,t,r=Q2){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 uW(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 mn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ua(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 cp=Symbol("implicit");function og(){var e=new n0,t=[],r=[],n=cp;function s(i){let o=e.get(i);if(o===void 0){if(n!==cp)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 n0;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 og(t,r).unknown(n)},mn.apply(s,arguments),s}function lg(){var e=og().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,p=s<n,x=p?s:n,g=p?n:s;i=(g-x)/Math.max(1,m-c+d*2),l&&(i=Math.floor(i)),x+=(g-x-i*(m-c))*u,o=i*(1-c),l&&(x=Math.round(x),o=Math.round(o));var v=uW(m).map(function(y){return x+i*y});return r(p?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 lg(t(),[n,s]).round(l).paddingInner(c).paddingOuter(d).align(u)},mn.apply(f(),arguments)}function eC(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return eC(t())},e}function fW(){return eC(lg.apply(null,arguments).paddingInner(1))}function cg(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function tC(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function yc(){}var Pl=.7,Qd=1/Pl,Bi="\\s*([+-]?\\d+)\\s*",Ml="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mW=/^#([0-9a-f]{3,8})$/,hW=new RegExp(`^rgb\\(${Bi},${Bi},${Bi}\\)$`),pW=new RegExp(`^rgb\\(${Qn},${Qn},${Qn}\\)$`),xW=new RegExp(`^rgba\\(${Bi},${Bi},${Bi},${Ml}\\)$`),gW=new RegExp(`^rgba\\(${Qn},${Qn},${Qn},${Ml}\\)$`),vW=new RegExp(`^hsl\\(${Ml},${Qn},${Qn}\\)$`),yW=new RegExp(`^hsla\\(${Ml},${Qn},${Qn},${Ml}\\)$`),o0={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};cg(yc,El,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:l0,formatHex:l0,formatHex8:bW,formatHsl:wW,formatRgb:c0,toString:c0});function l0(){return this.rgb().formatHex()}function bW(){return this.rgb().formatHex8()}function wW(){return rC(this).formatHsl()}function c0(){return this.rgb().formatRgb()}function El(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=mW.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?d0(t):r===3?new zr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ed(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ed(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=hW.exec(e))?new zr(t[1],t[2],t[3],1):(t=pW.exec(e))?new zr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=xW.exec(e))?ed(t[1],t[2],t[3],t[4]):(t=gW.exec(e))?ed(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vW.exec(e))?m0(t[1],t[2]/100,t[3]/100,1):(t=yW.exec(e))?m0(t[1],t[2]/100,t[3]/100,t[4]):o0.hasOwnProperty(e)?d0(o0[e]):e==="transparent"?new zr(NaN,NaN,NaN,0):null}function d0(e){return new zr(e>>16&255,e>>8&255,e&255,1)}function ed(e,t,r,n){return n<=0&&(e=t=r=NaN),new zr(e,t,r,n)}function jW(e){return e instanceof yc||(e=El(e)),e?(e=e.rgb(),new zr(e.r,e.g,e.b,e.opacity)):new zr}function dp(e,t,r,n){return arguments.length===1?jW(e):new zr(e,t,r,n??1)}function zr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}cg(zr,dp,tC(yc,{brighter(e){return e=e==null?Qd:Math.pow(Qd,e),new zr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Pl:Math.pow(Pl,e),new zr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new zr(Xs(this.r),Xs(this.g),Xs(this.b),Zd(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:u0,formatHex:u0,formatHex8:NW,formatRgb:f0,toString:f0}));function u0(){return`#${Us(this.r)}${Us(this.g)}${Us(this.b)}`}function NW(){return`#${Us(this.r)}${Us(this.g)}${Us(this.b)}${Us((isNaN(this.opacity)?1:this.opacity)*255)}`}function f0(){const e=Zd(this.opacity);return`${e===1?"rgb(":"rgba("}${Xs(this.r)}, ${Xs(this.g)}, ${Xs(this.b)}${e===1?")":`, ${e})`}`}function Zd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Us(e){return e=Xs(e),(e<16?"0":"")+e.toString(16)}function m0(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new jn(e,t,r,n)}function rC(e){if(e instanceof jn)return new jn(e.h,e.s,e.l,e.opacity);if(e instanceof yc||(e=El(e)),!e)return new jn;if(e instanceof jn)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 jn(o,l,c,e.opacity)}function kW(e,t,r,n){return arguments.length===1?rC(e):new jn(e,t,r,n??1)}function jn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}cg(jn,kW,tC(yc,{brighter(e){return e=e==null?Qd:Math.pow(Qd,e),new jn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Pl:Math.pow(Pl,e),new jn(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 zr(Hm(e>=240?e-240:e+120,s,n),Hm(e,s,n),Hm(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new jn(h0(this.h),td(this.s),td(this.l),Zd(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=Zd(this.opacity);return`${e===1?"hsl(":"hsla("}${h0(this.h)}, ${td(this.s)*100}%, ${td(this.l)*100}%${e===1?")":`, ${e})`}`}}));function h0(e){return e=(e||0)%360,e<0?e+360:e}function td(e){return Math.max(0,Math.min(1,e||0))}function Hm(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 dg=e=>()=>e;function SW(e,t){return function(r){return e+r*t}}function CW(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 _W(e){return(e=+e)==1?nC:function(t,r){return r-t?CW(t,r,e):dg(isNaN(t)?r:t)}}function nC(e,t){var r=t-e;return r?SW(e,r):dg(isNaN(e)?t:e)}const p0=function e(t){var r=_W(t);function n(s,i){var o=r((s=dp(s)).r,(i=dp(i)).r),l=r(s.g,i.g),c=r(s.b,i.b),d=nC(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 OW(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 PW(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function MW(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]=ko(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 EW(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Jd(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function AW(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]=ko(e[s],t[s]):n[s]=t[s];return function(i){for(s in r)n[s]=r[s](i);return n}}var up=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Km=new RegExp(up.source,"g");function DW(e){return function(){return e}}function TW(e){return function(t){return e(t)+""}}function IW(e,t){var r=up.lastIndex=Km.lastIndex=0,n,s,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=up.exec(e))&&(s=Km.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:Jd(n,s)})),r=Km.lastIndex;return r<t.length&&(i=t.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?TW(c[0].x):DW(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 ko(e,t){var r=typeof t,n;return t==null||r==="boolean"?dg(t):(r==="number"?Jd:r==="string"?(n=El(t))?(t=n,p0):IW:t instanceof El?p0:t instanceof Date?EW:PW(t)?OW:Array.isArray(t)?MW:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?AW:Jd)(e,t)}function ug(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function RW(e,t){t===void 0&&(t=e,e=ko);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 $W(e){return function(){return e}}function eu(e){return+e}var x0=[0,1];function wr(e){return e}function fp(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:$W(isNaN(t)?NaN:.5)}function zW(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function LW(e,t,r){var n=e[0],s=e[1],i=t[0],o=t[1];return s<n?(n=fp(s,n),i=r(o,i)):(n=fp(n,s),i=r(i,o)),function(l){return i(n(l))}}function FW(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]=fp(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(l){var c=vc(e,l,1,n)-1;return i[c](s[c](l))}}function bc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Af(){var e=x0,t=x0,r=ko,n,s,i,o=wr,l,c,d;function u(){var m=Math.min(e.length,t.length);return o!==wr&&(o=zW(e[0],e[m-1])),l=m>2?FW:LW,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),Jd)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,eu),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=ug,u()},f.clamp=function(m){return arguments.length?(o=m?!0:wr,u()):o!==wr},f.interpolate=function(m){return arguments.length?(r=m,u()):r},f.unknown=function(m){return arguments.length?(i=m,f):i},function(m,p){return n=m,s=p,u()}}function fg(){return Af()(wr,wr)}function BW(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function tu(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 Zi(e){return e=tu(Math.abs(e)),e?e[1]:NaN}function WW(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 UW(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var qW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Al(e){if(!(t=qW.exec(e)))throw new Error("invalid format: "+e);var t;return new mg({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]})}Al.prototype=mg.prototype;function mg(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+""}mg.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 HW(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 ru;function KW(e,t){var r=tu(e,t);if(!r)return ru=void 0,e.toPrecision(t);var n=r[0],s=r[1],i=s-(ru=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")+tu(e,Math.max(0,t+i-1))[0]}function g0(e,t){var r=tu(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 v0={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:BW,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)=>g0(e*100,t),r:g0,s:KW,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function y0(e){return e}var b0=Array.prototype.map,w0=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function YW(e){var t=e.grouping===void 0||e.thousands===void 0?y0:WW(b0.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?y0:UW(b0.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=Al(f);var p=f.fill,x=f.align,g=f.sign,v=f.symbol,y=f.zero,j=f.width,N=f.comma,w=f.precision,k=f.trim,b=f.type;b==="n"?(N=!0,b="g"):v0[b]||(w===void 0&&(w=12),k=!0,b="g"),(y||p==="0"&&x==="=")&&(y=!0,p="0",x="=");var S=(m&&m.prefix!==void 0?m.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),_=(v==="$"?n:/[%p]/.test(b)?o:"")+(m&&m.suffix!==void 0?m.suffix:""),C=v0[b],T=/[defgprs%]/.test(b);w=w===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function M(O){var R=S,E=_,A,P,U;if(b==="c")E=C(O)+E,O="";else{O=+O;var Q=O<0||1/O<0;if(O=isNaN(O)?c:C(Math.abs(O),w),k&&(O=HW(O)),Q&&+O==0&&g!=="+"&&(Q=!1),R=(Q?g==="("?g:l:g==="-"||g==="("?"":g)+R,E=(b==="s"&&!isNaN(O)&&ru!==void 0?w0[8+ru/3]:"")+E+(Q&&g==="("?")":""),T){for(A=-1,P=O.length;++A<P;)if(U=O.charCodeAt(A),48>U||U>57){E=(U===46?s+O.slice(A+1):O.slice(A))+E,O=O.slice(0,A);break}}}N&&!y&&(O=t(O,1/0));var K=R.length+O.length+E.length,se=K<j?new Array(j-K+1).join(p):"";switch(N&&y&&(O=t(se+O,se.length?j-E.length:1/0),se=""),x){case"<":O=R+O+E+se;break;case"=":O=R+se+O+E;break;case"^":O=se.slice(0,K=se.length>>1)+R+O+E+se.slice(K);break;default:O=se+R+O+E;break}return i(O)}return M.toString=function(){return f+""},M}function u(f,m){var p=Math.max(-8,Math.min(8,Math.floor(Zi(m)/3)))*3,x=Math.pow(10,-p),g=d((f=Al(f),f.type="f",f),{suffix:w0[8+p/3]});return function(v){return g(x*v)}}return{format:d,formatPrefix:u}}var rd,hg,aC;GW({thousands:",",grouping:[3],currency:["$",""]});function GW(e){return rd=YW(e),hg=rd.format,aC=rd.formatPrefix,rd}function VW(e){return Math.max(0,-Zi(Math.abs(e)))}function XW(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Zi(t)/3)))*3-Zi(Math.abs(e)))}function QW(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Zi(t)-Zi(e))+1}function sC(e,t,r,n){var s=lp(e,t,r),i;switch(n=Al(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=XW(s,o))&&(n.precision=i),aC(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=QW(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=VW(s))&&(n.precision=i-(n.type==="%")*2);break}}return hg(n)}function ws(e){var t=e.domain;return e.ticks=function(r){var n=t();return ip(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return sC(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=op(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 iC(){var e=fg();return e.copy=function(){return bc(e,iC())},mn.apply(e,arguments),ws(e)}function oC(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,eu),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return oC(e).unknown(t)},e=arguments.length?Array.from(e,eu):[0,1],ws(r)}function lC(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 j0(e){return Math.log(e)}function N0(e){return Math.exp(e)}function ZW(e){return-Math.log(-e)}function JW(e){return-Math.exp(-e)}function e7(e){return isFinite(e)?+("1e"+e):e<0?0:e}function t7(e){return e===10?e7:e===Math.E?Math.exp:t=>Math.pow(e,t)}function r7(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 k0(e){return(t,r)=>-e(-t,r)}function pg(e){const t=e(j0,N0),r=t.domain;let n=10,s,i;function o(){return s=r7(n),i=t7(n),r()[0]<0?(s=k0(s),i=k0(i),e(ZW,JW)):e(j0,N0),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),p=s(u),x,g;const v=l==null?10:+l;let y=[];if(!(n%1)&&p-m<v){if(m=Math.floor(m),p=Math.ceil(p),d>0){for(;m<=p;++m)for(x=1;x<n;++x)if(g=m<0?x/i(-m):x*i(m),!(g<d)){if(g>u)break;y.push(g)}}else for(;m<=p;++m)for(x=n-1;x>=1;--x)if(g=m>0?x/i(-m):x*i(m),!(g<d)){if(g>u)break;y.push(g)}y.length*2<v&&(y=ip(d,u,v))}else y=ip(m,p,Math.min(p-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=Al(c)).precision==null&&(c.trim=!0),c=hg(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(lC(r(),{floor:l=>i(Math.floor(s(l))),ceil:l=>i(Math.ceil(s(l)))})),t}function cC(){const e=pg(Af()).domain([1,10]);return e.copy=()=>bc(e,cC()).base(e.base()),mn.apply(e,arguments),e}function S0(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function C0(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function xg(e){var t=1,r=e(S0(t),C0(t));return r.constant=function(n){return arguments.length?e(S0(t=+n),C0(t)):t},ws(r)}function dC(){var e=xg(Af());return e.copy=function(){return bc(e,dC()).constant(e.constant())},mn.apply(e,arguments)}function _0(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function n7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function a7(e){return e<0?-e*e:e*e}function gg(e){var t=e(wr,wr),r=1;function n(){return r===1?e(wr,wr):r===.5?e(n7,a7):e(_0(r),_0(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},ws(t)}function vg(){var e=gg(Af());return e.copy=function(){return bc(e,vg()).exponent(e.exponent())},mn.apply(e,arguments),e}function s7(){return vg.apply(null,arguments).exponent(.5)}function O0(e){return Math.sign(e)*e*e}function i7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function uC(){var e=fg(),t=[0,1],r=!1,n;function s(i){var o=i7(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,eu)).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 uC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},mn.apply(s,arguments),ws(s)}function fC(){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]=dW(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:t[vc(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(ds),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 fC().domain(e).range(t).unknown(n)},mn.apply(i,arguments)}function mC(){var e=0,t=1,r=1,n=[.5],s=[0,1],i;function o(c){return c!=null&&c<=c?s[vc(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 mC().domain([e,t]).range(s).unknown(i)},mn.apply(ws(o),arguments)}function hC(){var e=[.5],t=[0,1],r,n=1;function s(i){return i!=null&&i<=i?t[vc(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 hC().domain(e).range(t).unknown(r)},mn.apply(s,arguments)}const Ym=new Date,Gm=new Date;function Ut(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=>Ut(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)=>(Ym.setTime(+i),Gm.setTime(+o),e(Ym),e(Gm),Math.floor(r(Ym,Gm))),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 nu=Ut(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);nu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ut(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):nu);nu.range;const ya=1e3,on=ya*60,ba=on*60,Oa=ba*24,yg=Oa*7,P0=Oa*30,Vm=Oa*365,qs=Ut(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ya)},(e,t)=>(t-e)/ya,e=>e.getUTCSeconds());qs.range;const bg=Ut(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ya)},(e,t)=>{e.setTime(+e+t*on)},(e,t)=>(t-e)/on,e=>e.getMinutes());bg.range;const wg=Ut(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*on)},(e,t)=>(t-e)/on,e=>e.getUTCMinutes());wg.range;const jg=Ut(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ya-e.getMinutes()*on)},(e,t)=>{e.setTime(+e+t*ba)},(e,t)=>(t-e)/ba,e=>e.getHours());jg.range;const Ng=Ut(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ba)},(e,t)=>(t-e)/ba,e=>e.getUTCHours());Ng.range;const wc=Ut(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*on)/Oa,e=>e.getDate()-1);wc.range;const Df=Ut(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Oa,e=>e.getUTCDate()-1);Df.range;const pC=Ut(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Oa,e=>Math.floor(e/Oa));pC.range;function bi(e){return Ut(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())*on)/yg)}const Tf=bi(0),au=bi(1),o7=bi(2),l7=bi(3),Ji=bi(4),c7=bi(5),d7=bi(6);Tf.range;au.range;o7.range;l7.range;Ji.range;c7.range;d7.range;function wi(e){return Ut(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)/yg)}const If=wi(0),su=wi(1),u7=wi(2),f7=wi(3),eo=wi(4),m7=wi(5),h7=wi(6);If.range;su.range;u7.range;f7.range;eo.range;m7.range;h7.range;const kg=Ut(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());kg.range;const Sg=Ut(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());Sg.range;const Pa=Ut(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());Pa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ut(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)});Pa.range;const Ma=Ut(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());Ma.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ut(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)});Ma.range;function xC(e,t,r,n,s,i){const o=[[qs,1,ya],[qs,5,5*ya],[qs,15,15*ya],[qs,30,30*ya],[i,1,on],[i,5,5*on],[i,15,15*on],[i,30,30*on],[s,1,ba],[s,3,3*ba],[s,6,6*ba],[s,12,12*ba],[n,1,Oa],[n,2,2*Oa],[r,1,yg],[t,1,P0],[t,3,3*P0],[e,1,Vm]];function l(d,u,f){const m=u<d;m&&([d,u]=[u,d]);const p=f&&typeof f.range=="function"?f:c(d,u,f),x=p?p.range(d,+u+1):[];return m?x.reverse():x}function c(d,u,f){const m=Math.abs(u-d)/f,p=ig(([,,v])=>v).right(o,m);if(p===o.length)return e.every(lp(d/Vm,u/Vm,f));if(p===0)return nu.every(Math.max(lp(d,u,f),1));const[x,g]=o[m/o[p-1][2]<o[p][2]/m?p-1:p];return x.every(g)}return[l,c]}const[p7,x7]=xC(Ma,Sg,If,pC,Ng,wg),[g7,v7]=xC(Pa,kg,Tf,wc,jg,bg);function Xm(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 Qm(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 Jo(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function y7(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=el(s),u=tl(s),f=el(i),m=tl(i),p=el(o),x=tl(o),g=el(l),v=tl(l),y=el(c),j=tl(c),N={a:U,A:Q,b:K,B:se,c:null,d:I0,e:I0,f:W7,g:Z7,G:e9,H:L7,I:F7,j:B7,L:gC,m:U7,M:q7,p:ae,q:W,Q:z0,s:L0,S:H7,u:K7,U:Y7,V:G7,w:V7,W:X7,x:null,X:null,y:Q7,Y:J7,Z:t9,"%":$0},w={a:Y,A:te,b:X,B:I,c:null,d:R0,e:R0,f:s9,g:p9,G:g9,H:r9,I:n9,j:a9,L:yC,m:i9,M:o9,p:D,q:Z,Q:z0,s:L0,S:l9,u:c9,U:d9,V:u9,w:f9,W:m9,x:null,X:null,y:h9,Y:x9,Z:v9,"%":$0},k={a:T,A:M,b:O,B:R,c:E,d:D0,e:D0,f:I7,g:A0,G:E0,H:T0,I:T0,j:E7,L:T7,m:M7,M:A7,p:C,q:P7,Q:$7,s:z7,S:D7,u:k7,U:S7,V:C7,w:N7,W:_7,x:A,X:P,y:A0,Y:E0,Z:O7,"%":R7};N.x=b(r,N),N.X=b(n,N),N.c=b(t,N),w.x=b(r,w),w.X=b(n,w),w.c=b(t,w);function b(F,q){return function(ce){var ee=[],ue=-1,V=0,le=F.length,pe,we,_e;for(ce instanceof Date||(ce=new Date(+ce));++ue<le;)F.charCodeAt(ue)===37&&(ee.push(F.slice(V,ue)),(we=M0[pe=F.charAt(++ue)])!=null?pe=F.charAt(++ue):we=pe==="e"?" ":"0",(_e=q[pe])&&(pe=_e(ce,we)),ee.push(pe),V=ue+1);return ee.push(F.slice(V,ue)),ee.join("")}}function S(F,q){return function(ce){var ee=Jo(1900,void 0,1),ue=_(ee,F,ce+="",0),V,le;if(ue!=ce.length)return null;if("Q"in ee)return new Date(ee.Q);if("s"in ee)return new Date(ee.s*1e3+("L"in ee?ee.L:0));if(q&&!("Z"in ee)&&(ee.Z=0),"p"in ee&&(ee.H=ee.H%12+ee.p*12),ee.m===void 0&&(ee.m="q"in ee?ee.q:0),"V"in ee){if(ee.V<1||ee.V>53)return null;"w"in ee||(ee.w=1),"Z"in ee?(V=Qm(Jo(ee.y,0,1)),le=V.getUTCDay(),V=le>4||le===0?su.ceil(V):su(V),V=Df.offset(V,(ee.V-1)*7),ee.y=V.getUTCFullYear(),ee.m=V.getUTCMonth(),ee.d=V.getUTCDate()+(ee.w+6)%7):(V=Xm(Jo(ee.y,0,1)),le=V.getDay(),V=le>4||le===0?au.ceil(V):au(V),V=wc.offset(V,(ee.V-1)*7),ee.y=V.getFullYear(),ee.m=V.getMonth(),ee.d=V.getDate()+(ee.w+6)%7)}else("W"in ee||"U"in ee)&&("w"in ee||(ee.w="u"in ee?ee.u%7:"W"in ee?1:0),le="Z"in ee?Qm(Jo(ee.y,0,1)).getUTCDay():Xm(Jo(ee.y,0,1)).getDay(),ee.m=0,ee.d="W"in ee?(ee.w+6)%7+ee.W*7-(le+5)%7:ee.w+ee.U*7-(le+6)%7);return"Z"in ee?(ee.H+=ee.Z/100|0,ee.M+=ee.Z%100,Qm(ee)):Xm(ee)}}function _(F,q,ce,ee){for(var ue=0,V=q.length,le=ce.length,pe,we;ue<V;){if(ee>=le)return-1;if(pe=q.charCodeAt(ue++),pe===37){if(pe=q.charAt(ue++),we=k[pe in M0?q.charAt(ue++):pe],!we||(ee=we(F,ce,ee))<0)return-1}else if(pe!=ce.charCodeAt(ee++))return-1}return ee}function C(F,q,ce){var ee=d.exec(q.slice(ce));return ee?(F.p=u.get(ee[0].toLowerCase()),ce+ee[0].length):-1}function T(F,q,ce){var ee=p.exec(q.slice(ce));return ee?(F.w=x.get(ee[0].toLowerCase()),ce+ee[0].length):-1}function M(F,q,ce){var ee=f.exec(q.slice(ce));return ee?(F.w=m.get(ee[0].toLowerCase()),ce+ee[0].length):-1}function O(F,q,ce){var ee=y.exec(q.slice(ce));return ee?(F.m=j.get(ee[0].toLowerCase()),ce+ee[0].length):-1}function R(F,q,ce){var ee=g.exec(q.slice(ce));return ee?(F.m=v.get(ee[0].toLowerCase()),ce+ee[0].length):-1}function E(F,q,ce){return _(F,t,q,ce)}function A(F,q,ce){return _(F,r,q,ce)}function P(F,q,ce){return _(F,n,q,ce)}function U(F){return o[F.getDay()]}function Q(F){return i[F.getDay()]}function K(F){return c[F.getMonth()]}function se(F){return l[F.getMonth()]}function ae(F){return s[+(F.getHours()>=12)]}function W(F){return 1+~~(F.getMonth()/3)}function Y(F){return o[F.getUTCDay()]}function te(F){return i[F.getUTCDay()]}function X(F){return c[F.getUTCMonth()]}function I(F){return l[F.getUTCMonth()]}function D(F){return s[+(F.getUTCHours()>=12)]}function Z(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var q=b(F+="",N);return q.toString=function(){return F},q},parse:function(F){var q=S(F+="",!1);return q.toString=function(){return F},q},utcFormat:function(F){var q=b(F+="",w);return q.toString=function(){return F},q},utcParse:function(F){var q=S(F+="",!0);return q.toString=function(){return F},q}}}var M0={"-":"",_:" ",0:"0"},Qt=/^\s*\d+/,b7=/^%/,w7=/[\\^$*+?|[\]().{}]/g;function Xe(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 j7(e){return e.replace(w7,"\\$&")}function el(e){return new RegExp("^(?:"+e.map(j7).join("|")+")","i")}function tl(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function N7(e,t,r){var n=Qt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function k7(e,t,r){var n=Qt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function S7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function C7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function _7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function E0(e,t,r){var n=Qt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function A0(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function O7(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 P7(e,t,r){var n=Qt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function M7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function D0(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function E7(e,t,r){var n=Qt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function T0(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function A7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function D7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function T7(e,t,r){var n=Qt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function I7(e,t,r){var n=Qt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function R7(e,t,r){var n=b7.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function $7(e,t,r){var n=Qt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function z7(e,t,r){var n=Qt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function I0(e,t){return Xe(e.getDate(),t,2)}function L7(e,t){return Xe(e.getHours(),t,2)}function F7(e,t){return Xe(e.getHours()%12||12,t,2)}function B7(e,t){return Xe(1+wc.count(Pa(e),e),t,3)}function gC(e,t){return Xe(e.getMilliseconds(),t,3)}function W7(e,t){return gC(e,t)+"000"}function U7(e,t){return Xe(e.getMonth()+1,t,2)}function q7(e,t){return Xe(e.getMinutes(),t,2)}function H7(e,t){return Xe(e.getSeconds(),t,2)}function K7(e){var t=e.getDay();return t===0?7:t}function Y7(e,t){return Xe(Tf.count(Pa(e)-1,e),t,2)}function vC(e){var t=e.getDay();return t>=4||t===0?Ji(e):Ji.ceil(e)}function G7(e,t){return e=vC(e),Xe(Ji.count(Pa(e),e)+(Pa(e).getDay()===4),t,2)}function V7(e){return e.getDay()}function X7(e,t){return Xe(au.count(Pa(e)-1,e),t,2)}function Q7(e,t){return Xe(e.getFullYear()%100,t,2)}function Z7(e,t){return e=vC(e),Xe(e.getFullYear()%100,t,2)}function J7(e,t){return Xe(e.getFullYear()%1e4,t,4)}function e9(e,t){var r=e.getDay();return e=r>=4||r===0?Ji(e):Ji.ceil(e),Xe(e.getFullYear()%1e4,t,4)}function t9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Xe(t/60|0,"0",2)+Xe(t%60,"0",2)}function R0(e,t){return Xe(e.getUTCDate(),t,2)}function r9(e,t){return Xe(e.getUTCHours(),t,2)}function n9(e,t){return Xe(e.getUTCHours()%12||12,t,2)}function a9(e,t){return Xe(1+Df.count(Ma(e),e),t,3)}function yC(e,t){return Xe(e.getUTCMilliseconds(),t,3)}function s9(e,t){return yC(e,t)+"000"}function i9(e,t){return Xe(e.getUTCMonth()+1,t,2)}function o9(e,t){return Xe(e.getUTCMinutes(),t,2)}function l9(e,t){return Xe(e.getUTCSeconds(),t,2)}function c9(e){var t=e.getUTCDay();return t===0?7:t}function d9(e,t){return Xe(If.count(Ma(e)-1,e),t,2)}function bC(e){var t=e.getUTCDay();return t>=4||t===0?eo(e):eo.ceil(e)}function u9(e,t){return e=bC(e),Xe(eo.count(Ma(e),e)+(Ma(e).getUTCDay()===4),t,2)}function f9(e){return e.getUTCDay()}function m9(e,t){return Xe(su.count(Ma(e)-1,e),t,2)}function h9(e,t){return Xe(e.getUTCFullYear()%100,t,2)}function p9(e,t){return e=bC(e),Xe(e.getUTCFullYear()%100,t,2)}function x9(e,t){return Xe(e.getUTCFullYear()%1e4,t,4)}function g9(e,t){var r=e.getUTCDay();return e=r>=4||r===0?eo(e):eo.ceil(e),Xe(e.getUTCFullYear()%1e4,t,4)}function v9(){return"+0000"}function $0(){return"%"}function z0(e){return+e}function L0(e){return Math.floor(+e/1e3)}var Oi,wC,jC;y9({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 y9(e){return Oi=y7(e),wC=Oi.format,Oi.parse,jC=Oi.utcFormat,Oi.utcParse,Oi}function b9(e){return new Date(e)}function w9(e){return e instanceof Date?+e:+new Date(+e)}function Cg(e,t,r,n,s,i,o,l,c,d){var u=fg(),f=u.invert,m=u.domain,p=d(".%L"),x=d(":%S"),g=d("%I:%M"),v=d("%I %p"),y=d("%a %d"),j=d("%b %d"),N=d("%B"),w=d("%Y");function k(b){return(c(b)<b?p:l(b)<b?x:o(b)<b?g:i(b)<b?v:n(b)<b?s(b)<b?y:j:r(b)<b?N:w)(b)}return u.invert=function(b){return new Date(f(b))},u.domain=function(b){return arguments.length?m(Array.from(b,w9)):m().map(b9)},u.ticks=function(b){var S=m();return e(S[0],S[S.length-1],b??10)},u.tickFormat=function(b,S){return S==null?k:d(S)},u.nice=function(b){var S=m();return(!b||typeof b.range!="function")&&(b=t(S[0],S[S.length-1],b??10)),b?m(lC(S,b)):u},u.copy=function(){return bc(u,Cg(e,t,r,n,s,i,o,l,c,d))},u}function j9(){return mn.apply(Cg(g7,v7,Pa,kg,Tf,wc,jg,bg,qs,wC).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function N9(){return mn.apply(Cg(p7,x7,Ma,Sg,If,Df,Ng,wg,qs,jC).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Rf(){var e=0,t=1,r,n,s,i,o=wr,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 p,x;return arguments.length?([p,x]=m,o=f(p,x),d):[o(0),o(1)]}}return d.range=u(ko),d.rangeRound=u(ug),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 js(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function NC(){var e=ws(Rf()(wr));return e.copy=function(){return js(e,NC())},Ua.apply(e,arguments)}function kC(){var e=pg(Rf()).domain([1,10]);return e.copy=function(){return js(e,kC()).base(e.base())},Ua.apply(e,arguments)}function SC(){var e=xg(Rf());return e.copy=function(){return js(e,SC()).constant(e.constant())},Ua.apply(e,arguments)}function _g(){var e=gg(Rf());return e.copy=function(){return js(e,_g()).exponent(e.exponent())},Ua.apply(e,arguments)}function k9(){return _g.apply(null,arguments).exponent(.5)}function CC(){var e=[],t=wr;function r(n){if(n!=null&&!isNaN(n=+n))return t((vc(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(ds),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)=>cW(e,i/n))},r.copy=function(){return CC(t).domain(e)},Ua.apply(r,arguments)}function $f(){var e=0,t=.5,r=1,n=1,s,i,o,l,c,d=wr,u,f=!1,m;function p(g){return isNaN(g=+g)?m:(g=.5+((g=+u(g))-i)*(n*g<n*i?l:c),d(f?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([e,t,r]=g,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,p):[e,t,r]},p.clamp=function(g){return arguments.length?(f=!!g,p):f},p.interpolator=function(g){return arguments.length?(d=g,p):d};function x(g){return function(v){var y,j,N;return arguments.length?([y,j,N]=v,d=RW(g,[y,j,N]),p):[d(0),d(.5),d(1)]}}return p.range=x(ko),p.rangeRound=x(ug),p.unknown=function(g){return arguments.length?(m=g,p):m},function(g){return u=g,s=g(e),i=g(t),o=g(r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,p}}function _C(){var e=ws($f()(wr));return e.copy=function(){return js(e,_C())},Ua.apply(e,arguments)}function OC(){var e=pg($f()).domain([.1,1,10]);return e.copy=function(){return js(e,OC()).base(e.base())},Ua.apply(e,arguments)}function PC(){var e=xg($f());return e.copy=function(){return js(e,PC()).constant(e.constant())},Ua.apply(e,arguments)}function Og(){var e=gg($f());return e.copy=function(){return js(e,Og()).exponent(e.exponent())},Ua.apply(e,arguments)}function S9(){return Og.apply(null,arguments).exponent(.5)}const ol=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:lg,scaleDiverging:_C,scaleDivergingLog:OC,scaleDivergingPow:Og,scaleDivergingSqrt:S9,scaleDivergingSymlog:PC,scaleIdentity:oC,scaleImplicit:cp,scaleLinear:iC,scaleLog:cC,scaleOrdinal:og,scalePoint:fW,scalePow:vg,scaleQuantile:fC,scaleQuantize:mC,scaleRadial:uC,scaleSequential:NC,scaleSequentialLog:kC,scaleSequentialPow:_g,scaleSequentialQuantile:CC,scaleSequentialSqrt:k9,scaleSequentialSymlog:SC,scaleSqrt:s7,scaleSymlog:dC,scaleThreshold:hC,scaleTime:j9,scaleUtc:N9,tickFormat:sC},Symbol.toStringTag,{value:"Module"}));var qa=e=>e.chartData,MC=G([qa],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),EC=(e,t,r,n)=>n?MC(e):qa(e),C9=(e,t,r)=>r?MC(e):qa(e);function Ea(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(qe(t)&&qe(r))return!0}return!1}function F0(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function AC(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,s,i;if(qe(r))s=r;else if(typeof r=="function")return;if(qe(n))i=n;else if(typeof n=="function")return;var o=[s,i];if(Ea(o))return o}}function _9(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(Ea(n))return F0(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(Se(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"&&ib.test(s)){var c=ib.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(Se(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"&&ob.test(i)){var u=ob.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(Ea(m))return t==null?m:F0(m,t,r)}}}var So=1e9,O9={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Mg,xt=!0,fn="[DecimalError] ",Qs=fn+"Invalid argument: ",Pg=fn+"Exponent out of range: ",Co=Math.floor,Ts=Math.pow,P9=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Gr,Gt=1e7,mt=7,DC=9007199254740991,iu=Co(DC/mt),ve={};ve.absoluteValue=ve.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ve.comparedTo=ve.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};ve.decimalPlaces=ve.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*mt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};ve.dividedBy=ve.div=function(e){return wa(this,new this.constructor(e))};ve.dividedToIntegerBy=ve.idiv=function(e){var t=this,r=t.constructor;return at(wa(t,new r(e),0,1),r.precision)};ve.equals=ve.eq=function(e){return!this.cmp(e)};ve.exponent=function(){return It(this)};ve.greaterThan=ve.gt=function(e){return this.cmp(e)>0};ve.greaterThanOrEqualTo=ve.gte=function(e){return this.cmp(e)>=0};ve.isInteger=ve.isint=function(){return this.e>this.d.length-2};ve.isNegative=ve.isneg=function(){return this.s<0};ve.isPositive=ve.ispos=function(){return this.s>0};ve.isZero=function(){return this.s===0};ve.lessThan=ve.lt=function(e){return this.cmp(e)<0};ve.lessThanOrEqualTo=ve.lte=function(e){return this.cmp(e)<1};ve.logarithm=ve.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(Gr))throw Error(fn+"NaN");if(r.s<1)throw Error(fn+(r.s?"NaN":"-Infinity"));return r.eq(Gr)?new n(0):(xt=!1,t=wa(Dl(r,i),Dl(e,i),i),xt=!0,at(t,s))};ve.minus=ve.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?RC(t,e):TC(t,(e.s=-e.s,e))};ve.modulo=ve.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(fn+"NaN");return r.s?(xt=!1,t=wa(r,e,0,1).times(e),xt=!0,r.minus(t)):at(new n(r),s)};ve.naturalExponential=ve.exp=function(){return IC(this)};ve.naturalLogarithm=ve.ln=function(){return Dl(this)};ve.negated=ve.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ve.plus=ve.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?TC(t,e):RC(t,(e.s=-e.s,e))};ve.precision=ve.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Qs+e);if(t=It(s)+1,n=s.d.length-1,r=n*mt+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};ve.squareRoot=ve.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(fn+"NaN")}for(e=It(l),xt=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Kn(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=Co((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(wa(l,i,o+2)).times(.5),Kn(i.d).slice(0,o)===(t=Kn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(at(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;o+=4}return xt=!0,at(n,r)};ve.times=ve.mul=function(e){var t,r,n,s,i,o,l,c,d,u=this,f=u.constructor,m=u.d,p=(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=p.length,c<d&&(i=m,m=p,p=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]+p[n]*m[s-n-1]+t,i[s--]=l%Gt|0,t=l/Gt|0;i[s]=(i[s]+t)%Gt|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,xt?at(e,f.precision):e};ve.toDecimalPlaces=ve.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ta(e,0,So),t===void 0?t=n.rounding:ta(t,0,8),at(r,e+It(r)+1,t))};ve.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=ui(n,!0):(ta(e,0,So),t===void 0?t=s.rounding:ta(t,0,8),n=at(new s(n),e+1,t),r=ui(n,!0,e+1)),r};ve.toFixed=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?ui(s):(ta(e,0,So),t===void 0?t=i.rounding:ta(t,0,8),n=at(new i(s),e+It(s)+1,t),r=ui(n.abs(),!1,e+It(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};ve.toInteger=ve.toint=function(){var e=this,t=e.constructor;return at(new t(e),It(e)+1,t.rounding)};ve.toNumber=function(){return+this};ve.toPower=ve.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(Gr);if(l=new c(l),!l.s){if(e.s<1)throw Error(fn+"Infinity");return l}if(l.eq(Gr))return l;if(n=c.precision,e.eq(Gr))return at(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=l.s,o){if((r=u<0?-u:u)<=DC){for(s=new c(Gr),t=Math.ceil(n/mt+4),xt=!1;r%2&&(s=s.times(l),W0(s.d,t)),r=Co(r/2),r!==0;)l=l.times(l),W0(l.d,t);return xt=!0,e.s<0?new c(Gr).div(s):at(s,n)}}else if(i<0)throw Error(fn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,xt=!1,s=e.times(Dl(l,n+d)),xt=!0,s=IC(s),s.s=i,s};ve.toPrecision=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?(r=It(s),n=ui(s,r<=i.toExpNeg||r>=i.toExpPos)):(ta(e,1,So),t===void 0?t=i.rounding:ta(t,0,8),s=at(new i(s),e,t),r=It(s),n=ui(s,e<=r||r<=i.toExpNeg,e)),n};ve.toSignificantDigits=ve.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ta(e,1,So),t===void 0?t=n.rounding:ta(t,0,8)),at(new n(r),e,t)};ve.toString=ve.valueOf=ve.val=ve.toJSON=ve[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=It(e),r=e.constructor;return ui(e,t<=r.toExpNeg||t>=r.toExpPos)};function TC(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)),xt?at(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/mt),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)/Gt|0,c[i]%=Gt;for(r&&(c.unshift(r),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,xt?at(t,f):t}function ta(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Qs+e)}function Kn(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=mt-n.length,r&&(i+=Za(r)),i+=n;o=e[t],n=o+"",r=mt-n.length,r&&(i+=Za(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var wa=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%Gt|0,o=i/Gt|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*Gt+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,p,x,g,v,y,j,N,w,k,b,S,_,C=n.constructor,T=n.s==s.s?1:-1,M=n.d,O=s.d;if(!n.s)return new C(n);if(!s.s)throw Error(fn+"Division by zero");for(c=n.e-s.e,S=O.length,k=M.length,p=new C(T),x=p.d=[],d=0;O[d]==(M[d]||0);)++d;if(O[d]>(M[d]||0)&&--c,i==null?j=i=C.precision:o?j=i+(It(n)-It(s))+1:j=i,j<0)return new C(0);if(j=j/mt+2|0,d=0,S==1)for(u=0,O=O[0],j++;(d<k||u)&&j--;d++)N=u*Gt+(M[d]||0),x[d]=N/O|0,u=N%O|0;else{for(u=Gt/(O[0]+1)|0,u>1&&(O=e(O,u),M=e(M,u),S=O.length,k=M.length),w=S,g=M.slice(0,S),v=g.length;v<S;)g[v++]=0;_=O.slice(),_.unshift(0),b=O[0],O[1]>=Gt/2&&++b;do u=0,l=t(O,g,S,v),l<0?(y=g[0],S!=v&&(y=y*Gt+(g[1]||0)),u=y/b|0,u>1?(u>=Gt&&(u=Gt-1),f=e(O,u),m=f.length,v=g.length,l=t(f,g,m,v),l==1&&(u--,r(f,S<m?_:O,m))):(u==0&&(l=u=1),f=O.slice()),m=f.length,m<v&&f.unshift(0),r(g,f,v),l==-1&&(v=g.length,l=t(O,g,S,v),l<1&&(u++,r(g,S<v?_:O,v))),v=g.length):l===0&&(u++,g=[0]),x[d++]=u,l&&g[0]?g[v++]=M[w]||0:(g=[M[w]],v=1);while((w++<k||g[0]!==void 0)&&j--)}return x[0]||x.shift(),p.e=c,at(p,o?i+It(p)+1:i)}}();function IC(e,t){var r,n,s,i,o,l,c=0,d=0,u=e.constructor,f=u.precision;if(It(e)>16)throw Error(Pg+It(e));if(!e.s)return new u(Gr);for(xt=!1,l=f,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(n=Math.log(Ts(2,d))/Math.LN10*2+5|0,l+=n,r=s=i=new u(Gr),u.precision=l;;){if(s=at(s.times(e),l),r=r.times(++c),o=i.plus(wa(s,r,l)),Kn(o.d).slice(0,l)===Kn(i.d).slice(0,l)){for(;d--;)i=at(i.times(i),l);return u.precision=f,t==null?(xt=!0,at(i,f)):i}i=o}}function It(e){for(var t=e.e*mt,r=e.d[0];r>=10;r/=10)t++;return t}function Zm(e,t,r){if(t>e.LN10.sd())throw xt=!0,r&&(e.precision=r),Error(fn+"LN10 precision limit exceeded");return at(new e(e.LN10),t)}function Za(e){for(var t="";e--;)t+="0";return t}function Dl(e,t){var r,n,s,i,o,l,c,d,u,f=1,m=10,p=e,x=p.d,g=p.constructor,v=g.precision;if(p.s<1)throw Error(fn+(p.s?"NaN":"-Infinity"));if(p.eq(Gr))return new g(0);if(t==null?(xt=!1,d=v):d=t,p.eq(10))return t==null&&(xt=!0),Zm(g,d);if(d+=m,g.precision=d,r=Kn(x),n=r.charAt(0),i=It(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=Kn(p.d),n=r.charAt(0),f++;i=It(p),n>1?(p=new g("0."+r),i++):p=new g(n+"."+r.slice(1))}else return c=Zm(g,d+2,v).times(i+""),p=Dl(new g(n+"."+r.slice(1)),d-m).plus(c),g.precision=v,t==null?(xt=!0,at(p,v)):p;for(l=o=p=wa(p.minus(Gr),p.plus(Gr),d),u=at(p.times(p),d),s=3;;){if(o=at(o.times(u),d),c=l.plus(wa(o,new g(s),d)),Kn(c.d).slice(0,d)===Kn(l.d).slice(0,d))return l=l.times(2),i!==0&&(l=l.plus(Zm(g,d+2,v).times(i+""))),l=wa(l,new g(f),d),g.precision=v,t==null?(xt=!0,at(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=Co(r/mt),e.d=[],n=(r+1)%mt,r<0&&(n+=mt),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=mt;n<s;)e.d.push(+t.slice(n,n+=mt));t=t.slice(n),n=mt-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),xt&&(e.e>iu||e.e<-iu))throw Error(Pg+r)}else e.s=0,e.e=0,e.d=[0];return e}function at(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+=mt,s=t,d=f[u=0];else{if(u=Math.ceil((n+1)/mt),i=f.length,u>=i)return e;for(d=i=f[u],o=1;i>=10;i/=10)o++;n%=mt,s=n-mt+o}if(r!==void 0&&(i=Ts(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/Ts(10,o-s):0:f[u-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(i=It(e),f.length=1,t=t-i-1,f[0]=Ts(10,(mt-t%mt)%mt),e.e=Co(-t/mt)||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=Ts(10,mt-n),f[u]=s>0?(d/Ts(10,o-s)%Ts(10,s)|0)*i:0),c)for(;;)if(u==0){(f[0]+=i)==Gt&&(f[0]=1,++e.e);break}else{if(f[u]+=i,f[u]!=Gt)break;f[u--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(xt&&(e.e>iu||e.e<-iu))throw Error(Pg+It(e));return e}function RC(e,t){var r,n,s,i,o,l,c,d,u,f,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),xt?at(t,p):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(p/mt),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]=Gt-1;--c[i],c[s]+=Gt}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,xt?at(t,p):t):new m(0)}function ui(e,t,r){var n,s=It(e),i=Kn(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+Za(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Za(-s-1)+i,r&&(n=r-o)>0&&(i+=Za(n))):s>=o?(i+=Za(s+1-o),r&&(n=r-s-1)>0&&(i=i+"."+Za(n))):((n=s+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(s+1===o&&(i+="."),i+=Za(n))),e.s<0?"-"+i:i}function W0(e,t){if(e.length>t)return e.length=t,!0}function $C(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(Qs+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(Qs+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,P9.test(i))B0(o,i);else throw Error(Qs+i)}if(s.prototype=ve,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=$C,s.config=s.set=M9,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 M9(e){if(!e||typeof e!="object")throw Error(fn+"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(Co(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Qs+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Qs+r+": "+n);return this}var Mg=$C(O9);Gr=new Mg(1);const et=Mg;function zC(e){var t;return e===0?t=1:t=Math.floor(new et(e).abs().log(10).toNumber())+1,t}function LC(e,t,r){for(var n=new et(e),s=0,i=[];n.lt(t)&&s<1e5;)i.push(n.toNumber()),n=n.add(r),s++;return i}var FC=e=>{var[t,r]=e,[n,s]=[t,r];return t>r&&([n,s]=[r,t]),[n,s]},BC=(e,t,r)=>{if(e.lte(0))return new et(0);var n=zC(e.toNumber()),s=new et(10).pow(n),i=e.div(s),o=n!==1?.05:.1,l=new et(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(s);return t?new et(c.toNumber()):new et(Math.ceil(c.toNumber()))},E9=(e,t,r)=>{var n=new et(1),s=new et(e);if(!s.isint()&&r){var i=Math.abs(e);i<1?(n=new et(10).pow(zC(e)-1),s=new et(Math.floor(s.div(n).toNumber())).mul(n)):i>1&&(s=new et(Math.floor(e)))}else e===0?s=new et(Math.floor((t-1)/2)):r||(s=new et(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(s.add(new et(c-o).mul(n)).toNumber());return l},WC=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 et(0),tickMin:new et(0),tickMax:new et(0)};var o=BC(new et(r).sub(t).div(n-1),s,i),l;t<=0&&r>=0?l=new et(0):(l=new et(t).add(r).div(2),l=l.sub(new et(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),d=Math.ceil(new et(r).sub(l).div(o).toNumber()),u=c+d+1;return u>n?WC(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 et(c).mul(o)),tickMax:l.add(new et(d).mul(o))})},A9=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]=FC([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 E9(l,s,i);var{step:u,tickMin:f,tickMax:m}=WC(l,c,o,i,0),p=LC(f,m.add(new et(.1).mul(u)),u);return r>n?p.reverse():p},D9=function(t,r){var[n,s]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,l]=FC([n,s]);if(o===-1/0||l===1/0)return[n,s];if(o===l)return[o];var c=Math.max(r,2),d=BC(new et(l).sub(o).div(c-1),i,0),u=[...LC(new et(o),new et(l),d),l];return i===!1&&(u=u.map(f=>Math.round(f))),n>s?u.reverse():u},UC=e=>e.rootProps.maxBarSize,T9=e=>e.rootProps.barGap,qC=e=>e.rootProps.barCategoryGap,I9=e=>e.rootProps.barSize,zf=e=>e.rootProps.stackOffset,HC=e=>e.rootProps.reverseStackOrder,Eg=e=>e.options.chartName,Ag=e=>e.rootProps.syncId,KC=e=>e.rootProps.syncMethod,Dg=e=>e.options.eventEmitter,jr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Os={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},zn={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Lf=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Ff(e,t,r){if(r!=="auto")return r;if(e!=null)return bs(e,t)?"category":"number"}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 ou(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){R9(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 R9(e,t,r){return(t=$9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $9(e){var t=z9(e,"string");return typeof t=="symbol"?t:t+""}function z9(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 q0={allowDataOverflow:Os.allowDataOverflow,allowDecimals:Os.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Os.angleAxisId,includeHidden:!1,name:void 0,reversed:Os.reversed,scale:Os.scale,tick:Os.tick,tickCount:void 0,ticks:void 0,type:Os.type,unit:void 0},H0={allowDataOverflow:zn.allowDataOverflow,allowDecimals:zn.allowDecimals,allowDuplicatedCategory:zn.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:zn.radiusAxisId,includeHidden:zn.includeHidden,name:void 0,reversed:zn.reversed,scale:zn.scale,tick:zn.tick,tickCount:zn.tickCount,ticks:void 0,type:zn.type,unit:void 0},L9=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Tg=G([L9,P2],(e,t)=>{var r;if(e!=null)return e;var n=(r=Ff(t,"angleAxis",q0.type))!==null&&r!==void 0?r:"category";return ou(ou({},q0),{},{type:n})}),F9=(e,t)=>e.polarAxis.radiusAxis[t],Ig=G([F9,P2],(e,t)=>{var r;if(e!=null)return e;var n=(r=Ff(t,"radiusAxis",H0.type))!==null&&r!==void 0?r:"category";return ou(ou({},H0),{},{type:n})}),Bf=e=>e.polarOptions,Rg=G([Ba,Wa,Xt],BB),YC=G([Bf,Rg],(e,t)=>{if(e!=null)return Pn(e.innerRadius,t,0)}),GC=G([Bf,Rg],(e,t)=>{if(e!=null)return Pn(e.outerRadius,t,t*.8)}),B9=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},VC=G([Bf],B9);G([Tg,VC],Lf);var XC=G([Rg,YC,GC],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});G([Ig,XC],Lf);var QC=G([ot,Bf,YC,GC,Ba,Wa],(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:Pn(o,s,s/2),cy:Pn(l,i,i/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:d,clockWise:!1}}}),Zt=(e,t)=>t,Wf=(e,t,r)=>r;function $g(e){return e==null?void 0:e.id}function ZC(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=$g(l);d.forEach((f,m)=>{var p=i==null||s?m:String(lr(f,i,null)),x=lr(f,l.dataKey,0),g;o.has(p)?g=o.get(p):g={},Object.assign(g,{[u]:x}),o.set(p,g)})}}),Array.from(o.values())}function Uf(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var qf=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Hf(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function W9(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 Jt=e=>{var t=ot(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},_o=e=>e.tooltip.settings.axisId;function U9(e){if(e in ol)return ol[e]();var t="scale".concat(fc(e));if(t in ol)return ol[t]()}function K0(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 Y0(e,t,r){if(typeof e=="function")return K0(e.copy().domain(t).range(r));if(e!=null){var n=U9(e);if(n!=null)return n.domain(t).range(r),K0(n)}}var q9=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Ea(t)){for(var r,n,s=0;s<t.length;s++){var i=t[s];qe(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 G0(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 lu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?G0(Object(r),!0).forEach(function(n){H9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function H9(e,t,r){return(t=K9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function K9(e){var t=Y9(e,"string");return typeof t=="symbol"?t:t+""}function Y9(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 mp=[0,"auto"],Kt={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},JC=(e,t)=>e.cartesianAxis.xAxis[t],Ha=(e,t)=>{var r=JC(e,t);return r??Kt},Yt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:mp,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:pc},e_=(e,t)=>e.cartesianAxis.yAxis[t],Ka=(e,t)=>{var r=e_(e,t);return r??Yt},G9={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:""},zg=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??G9},Mr=(e,t,r)=>{switch(t){case"xAxis":return Ha(e,r);case"yAxis":return Ka(e,r);case"zAxis":return zg(e,r);case"angleAxis":return Tg(e,r);case"radiusAxis":return Ig(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},V9=(e,t,r)=>{switch(t){case"xAxis":return Ha(e,r);case"yAxis":return Ka(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},jc=(e,t,r)=>{switch(t){case"xAxis":return Ha(e,r);case"yAxis":return Ka(e,r);case"angleAxis":return Tg(e,r);case"radiusAxis":return Ig(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},t_=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function r_(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 Lg=e=>e.graphicalItems.cartesianItems,X9=G([Zt,Wf],r_),n_=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),Nc=G([Lg,Mr,X9],n_,{memoizeOptions:{resultEqualityCheck:Hf}}),a_=G([Nc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Uf)),s_=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Q9=G([Nc],s_),i_=e=>e.map(t=>t.data).filter(Boolean).flat(1),Z9=G([Nc],i_,{memoizeOptions:{resultEqualityCheck:Hf}}),o_=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:s}=t;return e.length>0?e:r.slice(n,s+1)},Fg=G([Z9,EC],o_),l_=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:lr(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(s=>({value:lr(s,n)}))):e.map(n=>({value:n})),Kf=G([Fg,Mr,Nc],l_);function c_(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function gd(e){if(Jn(e)||e instanceof Date){var t=Number(e);if(qe(t))return t}}function V0(e){if(Array.isArray(e)){var t=[gd(e[0]),gd(e[1])];return Ea(t)?t:void 0}var r=gd(e);if(r!=null)return[r,r]}function Aa(e){return e.map(gd).filter($r)}function J9(e,t,r){return!r||typeof t!="number"||Zn(t)?[]:r.length?Aa(r.flatMap(n=>{var s=lr(e,n.dataKey),i,o;if(Array.isArray(s)?[i,o]=s:i=o=s,!(!qe(i)||!qe(o)))return[t-i,t+o]})):[]}var qt=e=>{var t=Jt(e),r=_o(e);return jc(e,t,r)},kc=G([qt],e=>e==null?void 0:e.dataKey),eU=G([a_,EC,qt],ZC),d_=(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($g);return[l,{stackedData:RF(e,u,r),graphicalItems:d}]}))},hp=G([eU,a_,zf,HC],d_),u_=(e,t,r,n)=>{var{dataStartIndex:s,dataEndIndex:i}=t;if(n==null&&r!=="zAxis"){var o=BF(e,s,i);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},tU=G([Mr],e=>e.allowDataOverflow),Bg=e=>{var t;if(e==null||!("domain"in e))return mp;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Aa(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:mp},f_=G([Mr],Bg),m_=G([f_,tU],AC),rU=G([hp,qa,Zt,m_],u_,{memoizeOptions:{resultEqualityCheck:qf}}),Wg=e=>e.errorBars,nU=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>c_(r,n)),cu=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]}},h_=(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=lr(l,(u=t.dataKey)!==null&&u!==void 0?u:c.dataKey),p=J9(l,m,f);if(p.length>=2){var x=Math.min(...p),g=Math.max(...p);(i==null||x<i)&&(i=x),(o==null||g>o)&&(o=g)}var v=V0(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=V0(lr(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]))}),qe(i)&&qe(o))return[i,o]},aU=G([Fg,Mr,Q9,Wg,Zt],h_,{memoizeOptions:{resultEqualityCheck:qf}});function sU(e){var{value:t}=e;if(Jn(t)||t instanceof Date)return t}var iU=(e,t,r)=>{var n=e.map(sU).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&dS(n))?X2(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},p_=e=>e.referenceElements.dots,Oo=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),oU=G([p_,Zt,Wf],Oo),x_=e=>e.referenceElements.areas,lU=G([x_,Zt,Wf],Oo),g_=e=>e.referenceElements.lines,cU=G([g_,Zt,Wf],Oo),v_=(e,t)=>{if(e!=null){var r=Aa(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},dU=G(oU,Zt,v_),y_=(e,t)=>{if(e!=null){var r=Aa(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)]}},uU=G([lU,Zt],y_);function fU(e){var t;if(e.x!=null)return Aa([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Aa(r)}function mU(e){var t;if(e.y!=null)return Aa([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Aa(r)}var b_=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?fU(n):mU(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},hU=G([cU,Zt],b_),pU=G(dU,hU,uU,(e,t,r)=>cu(e,r,t)),w_=(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?cu(n,i,s):cu(i,s);return _9(t,d,e.allowDataOverflow)},xU=G([Mr,f_,m_,rU,aU,pU,ot,Zt],w_,{memoizeOptions:{resultEqualityCheck:qf}}),gU=[0,1],j_=(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=bs(t,i);if(d&&l==null){var u;return X2(0,(u=r==null?void 0:r.length)!==null&&u!==void 0?u:0)}return c==="category"?iU(n,e,d):s==="expand"?gU:o}},Ug=G([Mr,ot,Fg,Kf,zf,Zt,xU],j_);function vU(e){return e in ol}var N_=(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(fc(n));return vU(i)?i:"point"}}},Po=G([Mr,t_,Eg],N_);function qg(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?Y0(e.scale,r,n):Y0(t,r,n)}var k_=(e,t,r)=>{var n=Bg(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&Ea(e))return A9(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Ea(e))return D9(e,t.tickCount,t.allowDecimals)}},Hg=G([Ug,jc,Po],k_),S_=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Ea(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},yU=G([Mr,Ug,Hg,Zt],S_),bU=G(Kf,Mr,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Aa(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}}),C_=G(bU,ot,qC,Xt,(e,t,r,n,s)=>s,(e,t,r,n,s)=>{if(!qe(e))return 0;var i=t==="vertical"?n.height:n.width;if(s==="gap")return e*i/2;if(s==="no-gap"){var o=Pn(r,e*i),l=e*i/2;return l-o-(l-o)/i*o}return 0}),wU=(e,t,r)=>{var n=Ha(e,t);return n==null||typeof n.padding!="string"?0:C_(e,"xAxis",t,r,n.padding)},jU=(e,t,r)=>{var n=Ka(e,t);return n==null||typeof n.padding!="string"?0:C_(e,"yAxis",t,r,n.padding)},NU=G(Ha,wU,(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}}),kU=G(Ka,jU,(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}}),SU=G([Xt,NU,Cf,Sf,(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]}),CU=G([Xt,ot,kU,Cf,Sf,(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]}),Sc=(e,t,r,n)=>{var s;switch(t){case"xAxis":return SU(e,r,n);case"yAxis":return CU(e,r,n);case"zAxis":return(s=zg(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return VC(e);case"radiusAxis":return XC(e,r);default:return}},__=G([Mr,Sc],Lf),_U=G([Po,yU],q9),Yf=G([Mr,Po,_U,__],qg);G([Nc,Wg,Zt],nU);function O_(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Gf=(e,t)=>t,Vf=(e,t,r)=>r,OU=G(Nf,Gf,Vf,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(O_)),PU=G(kf,Gf,Vf,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(O_)),P_=(e,t)=>({width:e.width,height:t.height}),MU=(e,t)=>{var r=typeof t.width=="number"?t.width:pc;return{width:r,height:e.height}},M_=G(Xt,Ha,P_),EU=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},AU=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},DU=G(Wa,Xt,OU,Gf,Vf,(e,t,r,n,s)=>{var i={},o;return r.forEach(l=>{var c=P_(t,l);o==null&&(o=EU(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}),TU=G(Ba,Xt,PU,Gf,Vf,(e,t,r,n,s)=>{var i={},o;return r.forEach(l=>{var c=MU(t,l);o==null&&(o=AU(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}),IU=(e,t)=>{var r=Ha(e,t);if(r!=null)return DU(e,r.orientation,r.mirror)},RU=G([Xt,Ha,IU,(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}}}),$U=(e,t)=>{var r=Ka(e,t);if(r!=null)return TU(e,r.orientation,r.mirror)},zU=G([Xt,Ka,$U,(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}}}),E_=G(Xt,Ka,(e,t)=>{var r=typeof t.width=="number"?t.width:pc;return{width:r,height:e.height}}),X0=(e,t,r)=>{switch(t){case"xAxis":return M_(e,r).width;case"yAxis":return E_(e,r).height;default:return}},A_=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:s,type:i,dataKey:o}=r,l=bs(e,n),c=t.map(d=>d.value);if(o&&l&&i==="category"&&s&&dS(c))return c}},Kg=G([ot,Kf,Mr,Zt],A_),D_=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:i}=r,o=bs(e,n);if(o&&(s==="number"||i!=="auto"))return t.map(l=>l.value)}},Yg=G([ot,Kf,jc,Zt],D_),Q0=G([ot,V9,Po,Yf,Kg,Yg,Sc,Hg,Zt],(e,t,r,n,s,i,o,l,c)=>{if(t!=null){var d=bs(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}}}),LU=(e,t,r,n,s,i,o,l,c)=>{if(!(t==null||n==null)){var d=bs(e,c),{type:u,ticks:f,tickCount:m}=t,p=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,x=u==="category"&&n.bandwidth?n.bandwidth()/p:0;x=c==="angleAxis"&&i!=null&&i.length>=2?Rr(i[0]-i[1])*2*x:x;var g=f||s;return g?g.map((v,y)=>{var j=o?o.indexOf(v):v,N=n.map(j);return qe(N)?{index:y,coordinate:N+x,value:v,offset:x}:null}).filter($r):d&&l?l.map((v,y)=>{var j=n.map(v);return qe(j)?{coordinate:j+x,value:v,index:y,offset:x}:null}).filter($r):n.ticks?n.ticks(m).map((v,y)=>{var j=n.map(v);return qe(j)?{coordinate:j+x,value:v,index:y,offset:x}:null}).filter($r):n.domain().map((v,y)=>{var j=n.map(v);return qe(j)?{coordinate:j+x,value:o?o[v]:v,index:y,offset:x}:null}).filter($r)}},T_=G([ot,jc,Po,Yf,Hg,Sc,Kg,Yg,Zt],LU),FU=(e,t,r,n,s,i,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=bs(e,o),{tickCount:c}=t,d=0;return d=o==="angleAxis"&&(n==null?void 0:n.length)>=2?Rr(n[0]-n[1])*2*d:d,l&&i?i.map((u,f)=>{var m=r.map(u);return qe(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter($r):r.ticks?r.ticks(c).map((u,f)=>{var m=r.map(u);return qe(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter($r):r.domain().map((u,f)=>{var m=r.map(u);return qe(m)?{coordinate:m+d,value:s?s[u]:u,index:f,offset:d}:null}).filter($r)}},to=G([ot,jc,Yf,Sc,Kg,Yg,Zt],FU),ro=G(Mr,Yf,(e,t)=>{if(!(e==null||t==null))return lu(lu({},e),{},{scale:t})}),BU=G([Mr,Po,Ug,__],qg);G((e,t,r)=>zg(e,r),BU,(e,t)=>{if(!(e==null||t==null))return lu(lu({},e),{},{scale:t})});var WU=G([ot,Nf,kf],(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}}),I_=e=>e.options.defaultTooltipEventType,R_=e=>e.options.validateTooltipEventTypes;function $_(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function Gg(e,t){var r=I_(e),n=R_(e);return $_(t,r,n)}function UU(e){return Ee(t=>Gg(t,e))}var z_=(e,t)=>{var r,n=Number(t);if(!(Zn(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},qU=e=>e.tooltip.settings,es={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},HU={itemInteraction:{click:es,hover:es},axisInteraction:{click:es,hover:es},keyboardInteraction:es,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}},L_=Hr({name:"tooltip",initialState:HU,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:pt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,s=Cn(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=n)},prepare:pt()},removeTooltipEntrySettings:{reducer(e,t){var r=Cn(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:pt()},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:KU,replaceTooltipEntrySettings:YU,removeTooltipEntrySettings:GU,setTooltipSettingsState:VU,setActiveMouseOverItemIndex:F_,mouseLeaveItem:XU,mouseLeaveChart:B_,setActiveClickItemIndex:QU,setMouseOverAxisIndex:W_,setMouseClickAxisIndex:ZU,setSyncInteraction:pp,setKeyboardInteraction:xp}=L_.actions,JU=L_.reducer;function Z0(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 nd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z0(Object(r),!0).forEach(function(n){eq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eq(e,t,r){return(t=tq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tq(e){var t=rq(e,"string");return typeof t=="symbol"?t:t+""}function rq(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 nq(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function aq(e){return e.index!=null}var U_=(e,t,r,n)=>{if(t==null)return es;var s=nq(e,t,r);if(s==null)return es;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(aq(s)){if(i)return nd(nd({},s),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return nd(nd({},es),{},{coordinate:s.coordinate})};function sq(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 iq(e,t){var r=sq(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 oq(e,t,r){if(r==null||t==null)return!0;var n=lr(e,t);return n==null||!Ea(r)?!0:iq(n,r)}var Vg=(e,t,r,n)=>{var s=e==null?void 0:e.index;if(s==null)return null;var i=Number(s);if(!qe(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||oq(d,r,n)?String(c):null},q_=(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}}}},H_=(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})},K_=e=>e.options.tooltipPayloadSearcher,Mo=e=>e.tooltip;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 ew(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){lq(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 lq(e,t,r){return(t=cq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cq(e){var t=dq(e,"string");return typeof t=="symbol"?t:t+""}function dq(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 uq(e,t){return e??t}var Y_=(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,p)=>{var x,{dataDefinedOnItem:g,settings:v}=p,y=uq(g,l),j=Array.isArray(y)?h2(y,d,u):y,N=(x=v==null?void 0:v.dataKey)!==null&&x!==void 0?x:n,w=v==null?void 0:v.nameKey,k;if(n&&Array.isArray(j)&&!Array.isArray(j[0])&&o==="axis"?k=Kz(j,n,s):k=i(j,t,c,w),Array.isArray(k))k.forEach(S=>{var _=ew(ew({},v),{},{name:S.name,unit:S.unit,color:void 0,fill:void 0});m.push(lb({tooltipEntrySettings:_,dataKey:S.dataKey,payload:S.payload,value:lr(S.payload,S.dataKey),name:S.name}))});else{var b;m.push(lb({tooltipEntrySettings:v,dataKey:N,payload:k,value:lr(k,N),name:(b=lr(k,w))!==null&&b!==void 0?b:v==null?void 0:v.name}))}return m},f)}},Xg=G([qt,t_,Eg],N_),fq=G([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),mq=G([Jt,_o],r_),Eo=G([fq,qt,mq],n_,{memoizeOptions:{resultEqualityCheck:Hf}}),hq=G([Eo],e=>e.filter(Uf)),pq=G([Eo],i_,{memoizeOptions:{resultEqualityCheck:Hf}}),Ao=G([pq,qa],o_),xq=G([hq,qa,qt],ZC),Qg=G([Ao,qt,Eo],l_),G_=G([qt],Bg),gq=G([qt],e=>e.allowDataOverflow),V_=G([G_,gq],AC),vq=G([Eo],e=>e.filter(Uf)),yq=G([xq,vq,zf,HC],d_),bq=G([yq,qa,Jt,V_],u_),wq=G([Eo],s_),jq=G([Ao,qt,wq,Wg,Jt],h_,{memoizeOptions:{resultEqualityCheck:qf}}),Nq=G([p_,Jt,_o],Oo),kq=G([Nq,Jt],v_),Sq=G([x_,Jt,_o],Oo),Cq=G([Sq,Jt],y_),_q=G([g_,Jt,_o],Oo),Oq=G([_q,Jt],b_),Pq=G([kq,Oq,Cq],cu),Mq=G([qt,G_,V_,bq,jq,Pq,ot,Jt],w_),Cc=G([qt,ot,Ao,Qg,zf,Jt,Mq],j_),Eq=G([Cc,qt,Xg],k_),Aq=G([qt,Cc,Eq,Jt],S_),X_=e=>{var t=Jt(e),r=_o(e),n=!1;return Sc(e,t,r,n)},Q_=G([qt,X_],Lf),Z_=G([qt,Xg,Aq,Q_],qg),Dq=G([ot,Qg,qt,Jt],A_),Tq=G([ot,Qg,qt,Jt],D_),Iq=(e,t,r,n,s,i,o,l)=>{if(t){var{type:c}=t,d=bs(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?Rr(s[0]-s[1])*2*f:f,d&&o?o.map((m,p)=>{var x=n.map(m);return qe(x)?{coordinate:x+f,value:m,index:p,offset:f}:null}).filter($r):n.domain().map((m,p)=>{var x=n.map(m);return qe(x)?{coordinate:x+f,value:i?i[m]:m,index:p,offset:f}:null}).filter($r)}}},Ya=G([ot,qt,Xg,Z_,X_,Dq,Tq,Jt],Iq),Zg=G([I_,R_,qU],(e,t,r)=>$_(r.shared,e,t)),J_=e=>e.tooltip.settings.trigger,Jg=e=>e.tooltip.settings.defaultIndex,_c=G([Mo,Zg,J_,Jg],U_),no=G([_c,Ao,kc,Cc],Vg),eO=G([Ya,no],z_),tO=G([_c],e=>{if(e)return e.dataKey});G([_c],e=>{if(e)return e.graphicalItemId});var rO=G([Mo,Zg,J_,Jg],H_),Rq=G([Ba,Wa,ot,Xt,Ya,Jg,rO],q_),$q=G([_c,Rq],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),zq=G([_c],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),Lq=G([rO,no,qa,kc,eO,K_,Zg],Y_);G([Lq],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function tw(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 rw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tw(Object(r),!0).forEach(function(n){Fq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fq(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)}var Uq=()=>Ee(qt),qq=()=>{var e=Uq(),t=Ee(Ya),r=Ee(Z_);return Ld(!e||!r?void 0:rw(rw({},e),{},{scale:r}),t)};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 Pi(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){Hq(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 Hq(e,t,r){return(t=Kq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kq(e){var t=Yq(e,"string");return typeof t=="symbol"?t:t+""}function Yq(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 Gq=(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}},Vq=(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 Pi(Pi(Pi({},n),or(n.cx,n.cy,o,i)),{},{angle:i,radius:o})}var l=s.coordinate,{angle:c}=n;return Pi(Pi(Pi({},n),or(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 Xq(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 nO=(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,p=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,x=(u=r[l])===null||u===void 0?void 0:u.coordinate,g=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(!(p==null||x==null||g==null))if(Rr(x-p)!==Rr(g-x)){var y=[];if(Rr(g-x)===Rr(s[1]-s[0])){v=g;var j=x+s[1]-s[0];y[0]=Math.min(j,(j+p)/2),y[1]=Math.max(j,(j+p)/2)}else{v=p;var N=g+s[1]-s[0];y[0]=Math.min(x,(N+x)/2),y[1]=Math.max(x,(N+x)/2)}var w=[Math.min(x,(v+x)/2),Math.max(x,(v+x)/2)];if(e>w[0]&&e<=w[1]||e>=y[0]&&e<=y[1]){var k;return(k=r[l])===null||k===void 0?void 0:k.index}}else{var b=Math.min(p,g),S=Math.max(p,g);if(e>(b+x)/2&&e<=(S+x)/2){var _;return(_=r[l])===null||_===void 0?void 0:_.index}}}else if(t)for(var C=0;C<o;C++){var T=t[C];if(T!=null){var M=t[C+1],O=t[C-1];if(C===0&&M!=null&&e<=(T.coordinate+M.coordinate)/2||C===o-1&&O!=null&&e>(T.coordinate+O.coordinate)/2||C>0&&C<o-1&&O!=null&&M!=null&&e>(T.coordinate+O.coordinate)/2&&e<=(T.coordinate+M.coordinate)/2)return T.index}}return-1},Qq=()=>Ee(Eg),ev=(e,t)=>t,aO=(e,t,r)=>r,tv=(e,t,r,n)=>n,Zq=G(Ya,e=>mf(e,t=>t.coordinate)),rv=G([Mo,ev,aO,tv],U_),nv=G([rv,Ao,kc,Cc],Vg),Jq=(e,t,r)=>{if(t!=null){var n=Mo(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},sO=G([Mo,ev,aO,tv],H_),du=G([Ba,Wa,ot,Xt,Ya,tv,sO],q_),eH=G([rv,du],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),iO=G([Ya,nv],z_),tH=G([sO,nv,qa,kc,iO,K_,ev],Y_),rH=G([rv,nv],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),nH=(e,t,r,n,s,i,o)=>{if(!(!e||!r||!n||!s)&&Xq(e,o)){var l=WF(e,t),c=nO(l,i,s,r,n),d=Gq(t,s,c,e);return{activeIndex:String(c),activeCoordinate:d}}},aH=(e,t,r,n,s,i,o)=>{if(!(!e||!n||!s||!i||!r)){var l=KB(e,r);if(l){var c=UF(l,t),d=nO(c,o,i,n,s),u=Vq(t,i,d,l);return{activeIndex:String(d),activeCoordinate:u}}}},sH=(e,t,r,n,s,i,o,l)=>{if(!(!e||!t||!n||!s||!i))return t==="horizontal"||t==="vertical"?nH(e,t,n,s,i,o,l):aH(e,t,r,n,s,i,o)},iH=G(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}}),oH=G(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(jr)),r=Array.from(new Set(t));return r.sort((n,s)=>n-s)},{memoizeOptions:{resultEqualityCheck:W9}});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 sw(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){lH(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 lH(e,t,r){return(t=cH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cH(e){var t=dH(e,"string");return typeof t=="symbol"?t:t+""}function dH(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 uH={},fH={zIndexMap:Object.values(jr).reduce((e,t)=>sw(sw({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),uH)},mH=new Set(Object.values(jr));function hH(e){return mH.has(e)}var oO=Hr({name:"zIndex",initialState:fH,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:pt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!hH(r)&&delete e.zIndexMap[r])},prepare:pt()},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:pt()},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:pt()}}}),{registerZIndexPortal:pH,unregisterZIndexPortal:xH,registerZIndexPortalElement:gH,unregisterZIndexPortalElement:vH}=oO.actions,yH=oO.reducer;function Ga(e){var{zIndex:t,children:r}=e,n=g8(),s=n&&t!==void 0&&t!==0,i=Kr(),o=Mt();h.useLayoutEffect(()=>s?(o(pH({zIndex:t})),()=>{o(xH({zIndex:t}))}):jo,[o,t,s]);var l=Ee(c=>iH(c,t,i));return s?l?Ip.createPortal(r,l):null:r}function gp(){return gp=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},gp.apply(null,arguments)}function iw(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 ad(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iw(Object(r),!0).forEach(function(n){bH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bH(e,t,r){return(t=wH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wH(e){var t=jH(e,"string");return typeof t=="symbol"?t:t+""}function jH(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 NH(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return h.isValidElement(t)?h.cloneElement(t,n):h.createElement(r,n)}function kH(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,p=s;if(!c||!f||u!=="ScatterChart"&&d!=="axis")return null;var x,g,v;if(u==="ScatterChart")x=f,g=sB,v=jr.cursorLine;else if(u==="BarChart")x=iB(l,f,i,o),g=U2,v=jr.cursorRectangle;else if(l==="radial"&&mS(f)){var{cx:y,cy:j,radius:N,startAngle:w,endAngle:k}=q2(f);x={cx:y,cy:j,startAngle:w,endAngle:k,innerRadius:N,outerRadius:N},g=K2,v=jr.cursorLine}else x={points:XB(l,f,i)},g=z2,v=jr.cursorLine;var b=typeof c=="object"&&"className"in c?c.className:void 0,S=ad(ad(ad(ad({stroke:"#ccc",pointerEvents:"none"},i),x),Mx(c)),{},{payload:m,payloadIndex:p,className:it("recharts-tooltip-cursor",b)});return h.createElement(Ga,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:v},h.createElement(NH,{cursor:c,cursorComp:g,cursorProps:S}))}function SH(e){var t=qq(),r=S2(),n=No(),s=Qq();return t==null||r==null||n==null||s==null?null:h.createElement(kH,gp({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:s}))}var lO=h.createContext(null),CH=()=>h.useContext(lO),cO={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 p=new s(u,f||c,m),x=r?r+d:d;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],p]:c._events[x].push(p):(c._events[x]=p,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,p=f.length,x=new Array(p);m<p;m++)x[m]=f[m].fn;return x},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,p,x){var g=r?r+d:d;if(!this._events[g])return!1;var v=this._events[g],y=arguments.length,j,N;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,p),!0;case 6:return v.fn.call(v.context,u,f,m,p,x),!0}for(N=1,j=new Array(y-1);N<y;N++)j[N-1]=arguments[N];v.fn.apply(v.context,j)}else{var w=v.length,k;for(N=0;N<w;N++)switch(v[N].once&&this.removeListener(d,v[N].fn,void 0,!0),y){case 1:v[N].fn.call(v[N].context);break;case 2:v[N].fn.call(v[N].context,u);break;case 3:v[N].fn.call(v[N].context,u,f);break;case 4:v[N].fn.call(v[N].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[N].fn.apply(v[N].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 p=r?r+d:d;if(!this._events[p])return this;if(!u)return o(this,p),this;var x=this._events[p];if(x.fn)x.fn===u&&(!m||x.once)&&(!f||x.context===f)&&o(this,p);else{for(var g=0,v=[],y=x.length;g<y;g++)(x[g].fn!==u||m&&!x[g].once||f&&x[g].context!==f)&&v.push(x[g]);v.length?this._events[p]=v.length===1?v[0]:v:o(this,p)}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})(cO);var _H=cO.exports;const OH=Ta(_H);var Tl=new OH,vp="recharts.syncEvent.tooltip",ow="recharts.syncEvent.brush",PH=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Zn(r))return e[r]}},MH={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},dO=Hr({name:"options",initialState:MH,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),EH=dO.reducer,{createEventEmitter:AH}=dO.actions;function DH(e){return e.tooltip.syncInteraction}var TH={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},uO=Hr({name:"chartData",initialState:TH,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:lw,setDataStartEndIndexes:IH,setComputedData:lte}=uO.actions,RH=uO.reducer,$H=["x","y"];function cw(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 Mi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cw(Object(r),!0).forEach(function(n){zH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zH(e,t,r){return(t=LH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LH(e){var t=FH(e,"string");return typeof t=="symbol"?t:t+""}function FH(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 BH(e,t){if(e==null)return{};var r,n,s=WH(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 WH(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 UH(){var e=Ee(Ag),t=Ee(Dg),r=Mt(),n=Ee(KC),s=Ee(Ya),i=No(),o=_f(),l=Ee(c=>c.rootProps.className);h.useEffect(()=>{if(e==null)return jo;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 p=u.payload.coordinate,{x,y:g}=p,v=BH(p,$H),{x:y,y:j,width:N,height:w}=u.payload.sourceViewBox,k=Mi(Mi({},v),{},{x:o.x+(N?(x-y)/N:0)*o.width,y:o.y+(w?(g-j)/w:0)*o.height});r(Mi(Mi({},u),{},{payload:Mi(Mi({},u.payload),{},{coordinate:k})}))}else r(u);return}if(s!=null){var b;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},_=n(s,S);b=s[_]}else n==="value"&&(b=s.find(P=>String(P.value)===u.payload.label));var{coordinate:C}=u.payload;if(b==null||u.payload.active===!1||C==null||o==null){r(pp({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:T,y:M}=C,O=Math.min(T,o.x+o.width),R=Math.min(M,o.y+o.height),E={x:i==="horizontal"?b.coordinate:O,y:i==="horizontal"?R:b.coordinate},A=pp({active:u.payload.active,coordinate:E,dataKey:u.payload.dataKey,index:String(b.index),label:u.payload.label,sourceViewBox:u.payload.sourceViewBox,graphicalItemId:u.payload.graphicalItemId});r(A)}}};return Tl.on(vp,c),()=>{Tl.off(vp,c)}},[l,r,t,e,n,s,i,o])}function qH(){var e=Ee(Ag),t=Ee(Dg),r=Mt();h.useEffect(()=>{if(e==null)return jo;var n=(s,i,o)=>{t!==o&&e===s&&r(IH(i))};return Tl.on(ow,n),()=>{Tl.off(ow,n)}},[r,t,e])}function HH(){var e=Mt();h.useEffect(()=>{e(AH())},[e]),UH(),qH()}function KH(e,t,r,n,s,i){var o=Ee(p=>Jq(p,e,t)),l=Ee(Dg),c=Ee(Ag),d=Ee(KC),u=Ee(DH),f=u==null?void 0:u.active,m=_f();h.useEffect(()=>{if(!f&&c!=null&&l!=null){var p=pp({active:i,coordinate:r,dataKey:o,index:s,label:typeof n=="number"?String(n):n,sourceViewBox:m,graphicalItemId:void 0});Tl.emit(vp,c,p,l)}},[f,r,o,s,n,l,c,d,i,m])}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 uw(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){YH(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 YH(e,t,r){return(t=GH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GH(e){var t=VH(e,"string");return typeof t=="symbol"?t:t+""}function VH(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 XH(e){return e.dataKey}function QH(e,t){return h.isValidElement(e)?h.cloneElement(e,t):typeof e=="function"?h.createElement(e,t):h.createElement(z8,t)}var fw=[],ZH={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 uu(e){var t,r,n=en(e,ZH),{active:s,allowEscapeViewBox:i,animationDuration:o,animationEasing:l,content:c,filterNull:d,isAnimationActive:u,offset:f,payloadUniqBy:m,position:p,reverseDirection:x,useTranslate3d:g,wrapperStyle:v,cursor:y,shared:j,trigger:N,defaultIndex:w,portal:k,axisId:b}=n,S=Mt(),_=typeof w=="number"?String(w):w;h.useEffect(()=>{S(VU({shared:j,trigger:N,axisId:b,active:s,defaultIndex:_}))},[S,j,N,b,s,_]);var C=_f(),T=$2(),M=UU(j),{activeIndex:O,isActive:R}=(t=Ee(D=>rH(D,M,N,_)))!==null&&t!==void 0?t:{},E=Ee(D=>tH(D,M,N,_)),A=Ee(D=>iO(D,M,N,_)),P=Ee(D=>eH(D,M,N,_)),U=E,Q=CH(),K=(r=s??R)!==null&&r!==void 0?r:!1,[se,ae]=_L([U,K]),W=M==="axis"?A:void 0;KH(M,N,P,W,O,K);var Y=k??Q;if(Y==null||C==null||M==null)return null;var te=U??fw;K||(te=fw),d&&te.length&&(te=dL(te.filter(D=>D.value!=null&&(D.hide!==!0||n.includeHidden)),m,XH));var X=te.length>0,I=h.createElement(H8,{allowEscapeViewBox:i,animationDuration:o,animationEasing:l,isAnimationActive:u,active:K,coordinate:P,hasPayload:X,offset:f,position:p,reverseDirection:x,useTranslate3d:g,viewBox:C,wrapperStyle:v,lastBoundingBox:se,innerRef:ae,hasPortalFromProps:!!k},QH(c,uw(uw({},n),{},{payload:te,label:W,active:K,activeIndex:O,coordinate:P,accessibilityLayer:T})));return h.createElement(h.Fragment,null,Ip.createPortal(I,Y),K&&h.createElement(SH,{cursor:y,tooltipEventType:M,coordinate:P,payload:te,index:O}))}var fO=e=>null;fO.displayName="Cell";function JH(e,t,r){return(t=eK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eK(e){var t=tK(e,"string");return typeof t=="symbol"?t:t+""}function tK(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 rK{constructor(t){JH(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 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 nK(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){aK(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 aK(e,t,r){return(t=sK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sK(e){var t=iK(e,"string");return typeof t=="symbol"?t:t+""}function iK(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 oK={cacheSize:2e3,enableCache:!0},mO=nK({},oK),hw=new rK(mO.cacheSize),lK={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},pw="recharts_measurement_span";function cK(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 xw=(e,t)=>{try{var r=document.getElementById(pw);r||(r=document.createElement("span"),r.setAttribute("id",pw),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,lK,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},ml=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ef.isSsr)return{width:0,height:0};if(!mO.enableCache)return xw(t,r);var n=cK(t,r),s=hw.get(n);if(s)return s;var i=xw(t,r);return hw.set(n,i),i},hO;function dK(e,t,r){return(t=uK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uK(e){var t=fK(e,"string");return typeof t=="symbol"?t:t+""}function fK(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 gw=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,vw=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,mK=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,hK=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,pK={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},xK=["cm","mm","pt","pc","in","Q","px"];function gK(e){return xK.includes(e)}var Ii="NaN";function vK(e,t){return e*pK[t]}class ar{static parse(t){var r,[,n,s]=(r=hK.exec(t))!==null&&r!==void 0?r:[];return n==null?ar.NaN:new ar(parseFloat(n),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Zn(t)&&(this.unit=""),r!==""&&!mK.test(r)&&(this.num=NaN,this.unit=""),gK(r)&&(this.num=vK(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new ar(NaN,""):new ar(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new ar(NaN,""):new ar(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new ar(NaN,""):new ar(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new ar(NaN,""):new ar(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Zn(this.num)}}hO=ar;dK(ar,"NaN",new hO(NaN,""));function pO(e){if(e==null||e.includes(Ii))return Ii;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,s,i]=(r=gw.exec(t))!==null&&r!==void 0?r:[],o=ar.parse(n??""),l=ar.parse(i??""),c=s==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Ii;t=t.replace(gw,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,u,f,m]=(d=vw.exec(t))!==null&&d!==void 0?d:[],p=ar.parse(u??""),x=ar.parse(m??""),g=f==="+"?p.add(x):p.subtract(x);if(g.isNaN())return Ii;t=t.replace(vw,g.toString())}return t}var yw=/\(([^()]*)\)/;function yK(e){for(var t=e,r;(r=yw.exec(t))!=null;){var[,n]=r;t=t.replace(yw,pO(n))}return t}function bK(e){var t=e.replace(/\s+/g,"");return t=yK(t),t=pO(t),t}function wK(e){try{return bK(e)}catch{return Ii}}function Jm(e){var t=wK(e.slice(5,-1));return t===Ii?"":t}var jK=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],NK=["dx","dy","angle","className","breakAll"];function yp(){return yp=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},yp.apply(null,arguments)}function bw(e,t){if(e==null)return{};var r,n,s=kK(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 kK(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 xO=/[ \f\n\r\t\v\u2028\u2029]+/,gO=e=>{var{children:t,breakAll:r,style:n}=e;try{var s=[];Vt(t)||(r?s=t.toString().split(""):s=t.toString().split(xO));var i=s.map(l=>({word:l,width:ml(l,n).width})),o=r?0:ml(" ",n).width;return{wordsWithComputedWidth:i,spaceWidth:o}}catch{return null}};function SK(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var vO=(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},[]),yO=e=>e.reduce((t,r)=>t.width>r.width?t:r),CK="…",ww=(e,t,r,n,s,i,o,l)=>{var c=e.slice(0,t),d=gO({breakAll:r,style:n,children:c+CK});if(!d)return[!1,[]];var u=vO(d.wordsWithComputedWidth,i,o,l),f=u.length>s||yO(u).width>Number(i);return[f,u]},_K=(e,t,r,n,s)=>{var{maxLines:i,children:o,style:l,breakAll:c}=e,d=Se(i),u=String(o),f=vO(t,n,r,s);if(!d||s)return f;var m=f.length>i||yO(f).width>Number(n);if(!m)return f;for(var p=0,x=u.length-1,g=0,v;p<=x&&g<=u.length-1;){var y=Math.floor((p+x)/2),j=y-1,[N,w]=ww(u,j,c,l,i,n,r,s),[k]=ww(u,y,c,l,i,n,r,s);if(!N&&!k&&(p=y+1),N&&k&&(x=y-1),!N&&k){v=w;break}g++}return v||f},jw=e=>{var t=Vt(e)?[]:e.toString().split(xO);return[{words:t,width:void 0}]},OK=e=>{var{width:t,scaleToFit:r,children:n,style:s,breakAll:i,maxLines:o}=e;if((t||r)&&!Ef.isSsr){var l,c,d=gO({breakAll:i,children:n,style:s});if(d){var{wordsWithComputedWidth:u,spaceWidth:f}=d;l=u,c=f}else return jw(n);return _K({breakAll:i,children:n,maxLines:o,style:s},l,c,t,!!r)}return jw(n)},bO="#808080",PK={angle:0,breakAll:!1,capHeight:"0.71em",fill:bO,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},av=h.forwardRef((e,t)=>{var r=en(e,PK),{x:n,y:s,lineHeight:i,capHeight:o,fill:l,scaleToFit:c,textAnchor:d,verticalAnchor:u}=r,f=bw(r,jK),m=h.useMemo(()=>OK({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:p,dy:x,angle:g,className:v,breakAll:y}=f,j=bw(f,NK);if(!Jn(n)||!Jn(s)||m.length===0)return null;var N=Number(n)+(Se(p)?p:0),w=Number(s)+(Se(x)?x:0);if(!qe(N)||!qe(w))return null;var k;switch(u){case"start":k=Jm("calc(".concat(o,")"));break;case"middle":k=Jm("calc(".concat((m.length-1)/2," * -").concat(i," + (").concat(o," / 2))"));break;default:k=Jm("calc(".concat(m.length-1," * -").concat(i,")"));break}var b=[],S=m[0];if(c&&S!=null){var _=S.width,{width:C}=f;b.push("scale(".concat(Se(C)&&Se(_)?C/_:1,")"))}return g&&b.push("rotate(".concat(g,", ").concat(N,", ").concat(w,")")),b.length&&(j.transform=b.join(" ")),h.createElement("text",yp({},dn(j),{ref:t,x:N,y:w,className:it("recharts-text",v),textAnchor:d,fill:l.includes("url")?bO:l}),m.map((T,M)=>{var O=T.words.join(y?"":" ");return h.createElement("tspan",{x:N,dy:M===0?k:i,key:"".concat(O,"-").concat(M)},O)}))});av.displayName="Text";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 Ln(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){MK(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 MK(e,t,r){return(t=EK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EK(e){var t=AK(e,"string");return typeof t=="symbol"?t:t+""}function AK(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 DK=e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:s}=e,{x:i,y:o,height:l,upperWidth:c,lowerWidth:d}=tg(t),u=i,f=i+(c-d)/2,m=(u+f)/2,p=(c+d)/2,x=u+c/2,g=l>=0?1:-1,v=g*n,y=g>0?"end":"start",j=g>0?"start":"end",N=c>=0?1:-1,w=N*n,k=N>0?"end":"start",b=N>0?"start":"end",S=s;if(r==="top"){var _={x:u+c/2,y:o-v,horizontalAnchor:"middle",verticalAnchor:y};return S&&(_.height=Math.max(o-S.y,0),_.width=c),_}if(r==="bottom"){var C={x:f+d/2,y:o+l+v,horizontalAnchor:"middle",verticalAnchor:j};return S&&(C.height=Math.max(S.y+S.height-(o+l),0),C.width=d),C}if(r==="left"){var T={x:m-w,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"};return S&&(T.width=Math.max(T.x-S.x,0),T.height=l),T}if(r==="right"){var M={x:m+p+w,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"};return S&&(M.width=Math.max(S.x+S.width-M.x,0),M.height=l),M}var O=S?{width:p,height:l}:{};return r==="insideLeft"?Ln({x:m+w,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"},O):r==="insideRight"?Ln({x:m+p-w,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"},O):r==="insideTop"?Ln({x:u+c/2,y:o+v,horizontalAnchor:"middle",verticalAnchor:j},O):r==="insideBottom"?Ln({x:f+d/2,y:o+l-v,horizontalAnchor:"middle",verticalAnchor:y},O):r==="insideTopLeft"?Ln({x:u+w,y:o+v,horizontalAnchor:b,verticalAnchor:j},O):r==="insideTopRight"?Ln({x:u+c-w,y:o+v,horizontalAnchor:k,verticalAnchor:j},O):r==="insideBottomLeft"?Ln({x:f+w,y:o+l-v,horizontalAnchor:b,verticalAnchor:y},O):r==="insideBottomRight"?Ln({x:f+d-w,y:o+l-v,horizontalAnchor:k,verticalAnchor:y},O):r&&typeof r=="object"&&(Se(r.x)||oi(r.x))&&(Se(r.y)||oi(r.y))?Ln({x:i+Pn(r.x,p),y:o+Pn(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},O):Ln({x,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},O)},TK=["labelRef"],IK=["content"];function kw(e,t){if(e==null)return{};var r,n,s=RK(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 RK(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 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 ll(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){$K(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 $K(e,t,r){return(t=zK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zK(e){var t=LK(e,"string");return typeof t=="symbol"?t:t+""}function LK(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 pa(){return pa=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},pa.apply(null,arguments)}var wO=h.createContext(null),FK=e=>{var{x:t,y:r,upperWidth:n,lowerWidth:s,width:i,height:o,children:l}=e,c=h.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:s,width:i,height:o}),[t,r,n,s,i,o]);return h.createElement(wO.Provider,{value:c},l)},jO=()=>{var e=h.useContext(wO),t=_f();return e||(t?tg(t):void 0)},BK=h.createContext(null),WK=()=>{var e=h.useContext(BK),t=Ee(QC);return e||t},UK=e=>{var{value:t,formatter:r}=e,n=Vt(e.children)?t:e.children;return typeof r=="function"?r(n):n},sv=e=>e!=null&&typeof e=="function",qK=(e,t)=>{var r=Rr(t-e),n=Math.min(Math.abs(t-e),360);return r*n},HK=(e,t,r,n,s)=>{var{offset:i,className:o}=e,{cx:l,cy:c,innerRadius:d,outerRadius:u,startAngle:f,endAngle:m,clockWise:p}=s,x=(d+u)/2,g=qK(f,m),v=g>=0?1:-1,y,j;switch(t){case"insideStart":y=f+v*i,j=p;break;case"insideEnd":y=m-v*i,j=!p;break;case"end":y=m+v*i,j=p;break;default:throw new Error("Unsupported position ".concat(t))}j=g<=0?j:!j;var N=or(l,c,x,y),w=or(l,c,x,y+(j?1:-1)*359),k="M".concat(N.x,",").concat(N.y,`
|
|
593
|
+
A`).concat(x,",").concat(x,",0,1,").concat(j?0:1,`,
|
|
594
|
+
`).concat(w.x,",").concat(w.y),b=Vt(e.id)?wl("recharts-radial-line-"):e.id;return h.createElement("text",pa({},n,{dominantBaseline:"central",className:it("recharts-radial-bar-label",o)}),h.createElement("defs",null,h.createElement("path",{id:b,d:k})),h.createElement("textPath",{xlinkHref:"#".concat(b)},r))},KK=(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}=or(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:p,y:x}=or(n,s,m,d);return{x:p,y:x,textAnchor:"middle",verticalAnchor:"middle"}},vd=e=>e!=null&&"cx"in e&&Se(e.cx),YK={angle:0,offset:5,zIndex:jr.label,position:"middle",textBreakAll:!1};function GK(e){if(!vd(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 Ja(e){var t=en(e,YK),{viewBox:r,parentViewBox:n,position:s,value:i,children:o,content:l,className:c="",textBreakAll:d,labelRef:u}=t,f=WK(),m=jO(),p=s==="center"?m:f??m,x,g,v;r==null?x=p:vd(r)?x=r:x=tg(r);var y=GK(x);if(!x||Vt(i)&&Vt(o)&&!h.isValidElement(l)&&typeof l!="function")return null;var j=ll(ll({},t),{},{viewBox:x});if(h.isValidElement(l)){var{labelRef:N}=j,w=kw(j,TK);return h.cloneElement(l,w)}if(typeof l=="function"){var{content:k}=j,b=kw(j,IK);if(g=h.createElement(l,b),h.isValidElement(g))return g}else g=UK(t);var S=dn(t);if(vd(x)){if(s==="insideStart"||s==="insideEnd"||s==="end")return HK(t,s,g,S,x);v=KK(x,t.offset,t.position)}else{if(!y)return null;var _=DK({viewBox:y,position:s,offset:t.offset,parentViewBox:vd(n)?void 0:n});v=ll(ll({x:_.x,y:_.y,textAnchor:_.horizontalAnchor,verticalAnchor:_.verticalAnchor},_.width!==void 0?{width:_.width}:{}),_.height!==void 0?{height:_.height}:{})}return h.createElement(Ga,{zIndex:t.zIndex},h.createElement(av,pa({ref:u,className:it("recharts-label",c)},S,v,{textAnchor:SK(S.textAnchor)?S.textAnchor:v.textAnchor,breakAll:d}),g))}Ja.displayName="Label";var VK=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?h.createElement(Ja,pa({key:"label-implicit"},n)):Jn(e)?h.createElement(Ja,pa({key:"label-implicit",value:e},n)):h.isValidElement(e)?e.type===Ja?h.cloneElement(e,ll({key:"label-implicit"},n)):h.createElement(Ja,pa({key:"label-implicit",content:e},n)):sv(e)?h.createElement(Ja,pa({key:"label-implicit",content:e},n)):e&&typeof e=="object"?h.createElement(Ja,pa({},e,{key:"label-implicit"},n)):null};function XK(e){var{label:t,labelRef:r}=e,n=jO();return VK(t,n,r)||null}var NO={},kO={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(kO);var SO={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(SO);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kO,r=SO,n=uf;function s(i){if(n.isArrayLike(i))return t.last(r.toArray(i))}e.last=s})(NO);var QK=NO.last;const ZK=Ta(QK);var JK=["valueAccessor"],eY=["dataKey","clockWise","id","textBreakAll","zIndex"];function fu(){return fu=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},fu.apply(null,arguments)}function Cw(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}var rY=e=>Array.isArray(e.value)?ZK(e.value):e.value,CO=h.createContext(void 0),nY=CO.Provider,_O=h.createContext(void 0);_O.Provider;function aY(){return h.useContext(CO)}function sY(){return h.useContext(_O)}function yd(e){var{valueAccessor:t=rY}=e,r=Cw(e,JK),{dataKey:n,clockWise:s,id:i,textBreakAll:o,zIndex:l}=r,c=Cw(r,eY),d=aY(),u=sY(),f=d||u;return!f||!f.length?null:h.createElement(Ga,{zIndex:l??jr.label},h.createElement(Ca,{className:"recharts-label-list"},f.map((m,p)=>{var x,g=Vt(n)?t(m,p):lr(m.payload,n),v=Vt(i)?{}:{id:"".concat(i,"-").concat(p)};return h.createElement(Ja,fu({key:"label-".concat(p)},dn(m),c,v,{fill:(x=r.fill)!==null&&x!==void 0?x:m.fill,parentViewBox:m.parentViewBox,value:g,textBreakAll:o,viewBox:m.viewBox,index:p,zIndex:0}))})))}yd.displayName="LabelList";function iY(e){var{label:t}=e;return t?t===!0?h.createElement(yd,{key:"labelList-implicit"}):h.isValidElement(t)||sv(t)?h.createElement(yd,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(yd,fu({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var oY={radiusAxis:{},angleAxis:{}},OO=Hr({name:"polarAxis",initialState:oY,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:cte,removeRadiusAxis:dte,addAngleAxis:ute,removeAngleAxis:fte}=OO.actions,lY=OO.reducer;function cY(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var PO={exports:{}},lt={};/**
|
|
595
|
+
* @license React
|
|
596
|
+
* react-is.production.js
|
|
597
|
+
*
|
|
598
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
599
|
+
*
|
|
600
|
+
* This source code is licensed under the MIT license found in the
|
|
601
|
+
* LICENSE file in the root directory of this source tree.
|
|
602
|
+
*/var iv=Symbol.for("react.transitional.element"),ov=Symbol.for("react.portal"),Xf=Symbol.for("react.fragment"),Qf=Symbol.for("react.strict_mode"),Zf=Symbol.for("react.profiler"),Jf=Symbol.for("react.consumer"),em=Symbol.for("react.context"),tm=Symbol.for("react.forward_ref"),rm=Symbol.for("react.suspense"),nm=Symbol.for("react.suspense_list"),am=Symbol.for("react.memo"),sm=Symbol.for("react.lazy"),dY=Symbol.for("react.view_transition"),uY=Symbol.for("react.client.reference");function hn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case iv:switch(e=e.type,e){case Xf:case Zf:case Qf:case rm:case nm:case dY:return e;default:switch(e=e&&e.$$typeof,e){case em:case tm:case sm:case am:return e;case Jf:return e;default:return t}}case ov:return t}}}lt.ContextConsumer=Jf;lt.ContextProvider=em;lt.Element=iv;lt.ForwardRef=tm;lt.Fragment=Xf;lt.Lazy=sm;lt.Memo=am;lt.Portal=ov;lt.Profiler=Zf;lt.StrictMode=Qf;lt.Suspense=rm;lt.SuspenseList=nm;lt.isContextConsumer=function(e){return hn(e)===Jf};lt.isContextProvider=function(e){return hn(e)===em};lt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===iv};lt.isForwardRef=function(e){return hn(e)===tm};lt.isFragment=function(e){return hn(e)===Xf};lt.isLazy=function(e){return hn(e)===sm};lt.isMemo=function(e){return hn(e)===am};lt.isPortal=function(e){return hn(e)===ov};lt.isProfiler=function(e){return hn(e)===Zf};lt.isStrictMode=function(e){return hn(e)===Qf};lt.isSuspense=function(e){return hn(e)===rm};lt.isSuspenseList=function(e){return hn(e)===nm};lt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Xf||e===Zf||e===Qf||e===rm||e===nm||typeof e=="object"&&e!==null&&(e.$$typeof===sm||e.$$typeof===am||e.$$typeof===em||e.$$typeof===Jf||e.$$typeof===tm||e.$$typeof===uY||e.getModuleId!==void 0)};lt.typeOf=hn;PO.exports=lt;var fY=PO.exports,_w=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",Ow=null,eh=null,MO=e=>{if(e===Ow&&Array.isArray(eh))return eh;var t=[];return h.Children.forEach(e,r=>{Vt(r)||(fY.isFragment(r)?t=t.concat(MO(r.props.children)):t.push(r))}),eh=t,Ow=e,t};function mY(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(s=>_w(s)):n=[_w(t)],MO(e).forEach(s=>{var i=Vi(s,"type.displayName")||Vi(s,"type.name");i&&n.indexOf(i)!==-1&&r.push(s)}),r}var EO={};(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})(EO);var hY=EO.isPlainObject;const pY=Ta(hY);var Pw,Mw,Ew,Aw,Dw;function Tw(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 Iw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tw(Object(r),!0).forEach(function(n){xY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xY(e,t,r){return(t=gY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gY(e){var t=vY(e,"string");return typeof t=="symbol"?t:t+""}function vY(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 mu(){return mu=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},mu.apply(null,arguments)}function rl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Rw=(e,t,r,n,s)=>{var i=r-n,o;return o=kt(Pw||(Pw=rl(["M ",",",""])),e,t),o+=kt(Mw||(Mw=rl(["L ",",",""])),e+r,t),o+=kt(Ew||(Ew=rl(["L ",",",""])),e+r-i/2,t+s),o+=kt(Aw||(Aw=rl(["L ",",",""])),e+r-i/2-n,t+s),o+=kt(Dw||(Dw=rl(["L ",","," Z"])),e,t),o},yY={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},bY=e=>{var t=en(e,yY),{x:r,y:n,upperWidth:s,lowerWidth:i,height:o,className:l}=t,{animationEasing:c,animationDuration:d,animationBegin:u,isUpdateAnimationActive:f}=t,m=h.useRef(null),[p,x]=h.useState(-1),g=h.useRef(s),v=h.useRef(i),y=h.useRef(o),j=h.useRef(r),N=h.useRef(n),w=sg(e,"trapezoid-");if(h.useEffect(()=>{if(m.current&&m.current.getTotalLength)try{var E=m.current.getTotalLength();E&&x(E)}catch{}},[]),r!==+r||n!==+n||s!==+s||i!==+i||o!==+o||s===0&&i===0||o===0)return null;var k=it("recharts-trapezoid",l);if(!f)return h.createElement("g",null,h.createElement("path",mu({},dn(t),{className:k,d:Rw(r,n,s,i,o)})));var b=g.current,S=v.current,_=y.current,C=j.current,T=N.current,M="0px ".concat(p===-1?1:p,"px"),O="".concat(p,"px 0px"),R=L2(["strokeDasharray"],d,c);return h.createElement(ag,{animationId:w,key:w,canBegin:p>0,duration:d,easing:c,isActive:f,begin:u},E=>{var A=sr(b,s,E),P=sr(S,i,E),U=sr(_,o,E),Q=sr(C,r,E),K=sr(T,n,E);m.current&&(g.current=A,v.current=P,y.current=U,j.current=Q,N.current=K);var se=E>0?{transition:R,strokeDasharray:O}:{strokeDasharray:M};return h.createElement("path",mu({},dn(t),{className:k,d:Rw(Q,K,A,P,U),ref:m,style:Iw(Iw({},se),t.style)}))})},wY=["option","shapeType","activeClassName"];function jY(e,t){if(e==null)return{};var r,n,s=NY(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 NY(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 $w(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 hu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$w(Object(r),!0).forEach(function(n){kY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$w(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kY(e,t,r){return(t=SY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SY(e){var t=CY(e,"string");return typeof t=="symbol"?t:t+""}function CY(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 _Y(e,t){return hu(hu({},t),e)}function OY(e,t){return e==="symbols"}function zw(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return h.createElement(U2,r);case"trapezoid":return h.createElement(bY,r);case"sector":return h.createElement(K2,r);case"symbols":if(OY(t))return h.createElement(fS,r);break;case"curve":return h.createElement(z2,r);default:return null}}function PY(e){return h.isValidElement(e)?e.props:e}function MY(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape"}=e,s=jY(e,wY),i;if(h.isValidElement(t))i=h.cloneElement(t,hu(hu({},s),PY(t)));else if(typeof t=="function")i=t(s,s.index);else if(pY(t)&&typeof t!="boolean"){var o=_Y(t,s);i=h.createElement(zw,{shapeType:r,elementProps:o})}else{var l=s;i=h.createElement(zw,{shapeType:r,elementProps:l})}return s.isActive?h.createElement(Ca,{className:n},i):i}var AO=(e,t,r)=>{var n=Mt();return(s,i)=>o=>{e==null||e(s,i,o),n(F_({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}},DO=e=>{var t=Mt();return(r,n)=>s=>{e==null||e(r,n,s),t(XU())}},TO=(e,t,r)=>{var n=Mt();return(s,i)=>o=>{e==null||e(s,i,o),n(QU({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}};function EY(e){var{tooltipEntrySettings:t}=e,r=Mt(),n=Kr(),s=h.useRef(null);return h.useLayoutEffect(()=>{n||(s.current===null?r(KU(t)):s.current!==t&&r(YU({prev:s.current,next:t})),s.current=t)},[t,r,n]),h.useLayoutEffect(()=>()=>{s.current&&(r(GU(s.current)),s.current=null)},[r]),null}function AY(e){var{legendPayload:t}=e,r=Mt(),n=Kr(),s=h.useRef(null);return h.useLayoutEffect(()=>{n||(s.current===null?r(M8(t)):s.current!==t&&r(E8({prev:s.current,next:t})),s.current=t)},[r,n,t]),h.useLayoutEffect(()=>()=>{s.current&&(r(A8(s.current)),s.current=null)},[r]),null}var th,DY=()=>{var[e]=h.useState(()=>wl("uid-"));return e},TY=(th=uM.useId)!==null&&th!==void 0?th:DY;function IY(e,t){var r=TY();return t||(e?"".concat(e,"-").concat(r):r)}var RY=h.createContext(void 0),$Y=e=>{var{id:t,type:r,children:n}=e,s=IY("recharts-".concat(r),t);return h.createElement(RY.Provider,{value:s},n(s))},zY={cartesianItems:[],polarItems:[]},IO=Hr({name:"graphicalItems",initialState:zY,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:pt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=Cn(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:pt()},removeCartesianGraphicalItem:{reducer(e,t){var r=Cn(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:pt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:pt()},removePolarGraphicalItem:{reducer(e,t){var r=Cn(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:pt()}}}),{addCartesianGraphicalItem:LY,replaceCartesianGraphicalItem:FY,removeCartesianGraphicalItem:BY,addPolarGraphicalItem:mte,removePolarGraphicalItem:hte}=IO.actions,WY=IO.reducer,UY=e=>{var t=Mt(),r=h.useRef(null);return h.useLayoutEffect(()=>{r.current===null?t(LY(e)):r.current!==e&&t(FY({prev:r.current,next:e})),r.current=e},[t,e]),h.useLayoutEffect(()=>()=>{r.current&&(t(BY(r.current)),r.current=null)},[t]),null},qY=h.memo(UY);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 Fw(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){HY(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 HY(e,t,r){return(t=KY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KY(e){var t=YY(e,"string");return typeof t=="symbol"?t:t+""}function YY(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 RO=0,GY={xAxis:{},yAxis:{},zAxis:{}},$O=Hr({name:"cartesianAxis",initialState:GY,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:pt()},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:pt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:pt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:pt()},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:pt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:pt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:pt()},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:pt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:pt()},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]=Fw(Fw({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:VY,replaceXAxis:XY,removeXAxis:QY,addYAxis:ZY,replaceYAxis:JY,removeYAxis:eG,addZAxis:pte,replaceZAxis:xte,removeZAxis:gte,updateYAxisWidth:tG}=$O.actions,rG=$O.reducer,nG=G([Xt],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),aG=G([nG,Ba,Wa],(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)}}),zO=()=>Ee(aG),Bw=(e,t,r)=>{var n=r??e;if(!Vt(n))return Pn(n,t,0)},sG=(e,t,r)=>{var n={},s=e.filter(Uf),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,p=m.map(g=>g.dataKey),x=Bw(t,r,(u=m[0])===null||u===void 0?void 0:u.barSize);return{stackId:f,dataKeys:p,barSize:x}}),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 sd(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){iG(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 iG(e,t,r){return(t=oG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oG(e){var t=lG(e,"string");return typeof t=="symbol"?t:t+""}function lG(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 cG(e,t,r,n,s){var i,o=n.length;if(!(o<1)){var l=Pn(e,r,0,!0),c,d=[];if(qe((i=n[0])===null||i===void 0?void 0:i.barSize)){var u=!1,f=r/o,m=n.reduce((j,N)=>j+(N.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 p=(r-m)/2>>0,x={offset:p-l,size:0};c=n.reduce((j,N)=>{var w,k={stackId:N.stackId,dataKeys:N.dataKeys,position:{offset:x.offset+x.size+l,size:u?f:(w=N.barSize)!==null&&w!==void 0?w:0}},b=[...j,k];return x=k.position,b},d)}else{var g=Pn(t,r,0,!0);r-2*g-(o-1)*l<=0&&(l=0);var v=(r-2*g-(o-1)*l)/o;v>1&&(v>>=0);var y=qe(s)?Math.min(v,s):v;c=n.reduce((j,N,w)=>[...j,{stackId:N.stackId,dataKeys:N.dataKeys,position:{offset:g+(v+l)*w+(v-y)/2,size:y}}],d)}return c}}var dG=(e,t,r,n,s,i,o)=>{var l=Vt(o)?t:o,c=cG(r,n,s!==i?s:i,e,l);return s!==i&&c!=null&&(c=c.map(d=>sd(sd({},d),{},{position:sd(sd({},d.position),{},{offset:d.position.offset-s/2})}))),c},uG=(e,t)=>{var r=$g(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)}}}},fG=(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 mG(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&qe(e.zIndex)?e.zIndex:t}var hG=e=>{var{chartData:t}=e,r=Mt(),n=Kr();return h.useEffect(()=>n?()=>{}:(r(lw(t)),()=>{r(lw(void 0))}),[t,r,n]),null},Uw={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},LO=Hr({name:"brush",initialState:Uw,reducers:{setBrushSettings(e,t){return t.payload==null?Uw:t.payload}}}),{setBrushSettings:vte}=LO.actions,pG=LO.reducer;function xG(e){return(e%180+180)%180}var gG=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=xG(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)},vG={dots:[],areas:[],lines:[]},FO=Hr({name:"referenceElements",initialState:vG,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Cn(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=Cn(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=Cn(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:yte,removeDot:bte,addArea:wte,removeArea:jte,addLine:Nte,removeLine:kte}=FO.actions,yG=FO.reducer,bG=h.createContext(void 0),wG=e=>{var{children:t}=e,[r]=h.useState("".concat(wl("recharts"),"-clip")),n=zO();if(n==null)return null;var{x:s,y:i,width:o,height:l}=n;return h.createElement(bG.Provider,{value:r},h.createElement("defs",null,h.createElement("clipPath",{id:r},h.createElement("rect",{x:s,y:i,height:l,width:o}))),t)};function BO(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 jG(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return gG(n,r)}function NG(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 Il(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 kG(e,t){return BO(e,t+1)}function SG(e,t,r,n,s){for(var i=(n||[]).slice(),{start:o,end:l}=t,c=0,d=1,u=o,f=function(){var x=n==null?void 0:n[c];if(x===void 0)return{v:BO(n,d)};var g=c,v,y=()=>(v===void 0&&(v=r(x,g)),v),j=x.coordinate,N=c===0||Il(e,j,y,u,l);N||(c=0,u=o,d+=1),N&&(u=j+e*(y()/2+s),c+=d)},m;d<=i.length;)if(m=f(),m)return m.v;return[]}function CG(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,p=function(){var w=n[g];if(w==null)return 0;var k=g,b,S=()=>(b===void 0&&(b=r(w,k)),b),_=w.coordinate,C=g===u||Il(e,_,S,f,c);if(!C)return m=!1,1;C&&(f=_+e*(S()/2+s))},x,g=u;g<o&&(x=p(),!(x!==0&&x===1));g+=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 qw(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 dr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qw(Object(r),!0).forEach(function(n){_G(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _G(e,t,r){return(t=OG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OG(e){var t=PG(e,"string");return typeof t=="symbol"?t:t+""}function PG(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 MG(e,t,r,n,s){for(var i=(n||[]).slice(),o=i.length,{start:l}=t,{end:c}=t,d=function(m){var p=i[m];if(p==null)return 1;var x=p,g,v=()=>(g===void 0&&(g=r(p,m)),g);if(m===o-1){var y=e*(x.coordinate+e*v()/2-c);i[m]=x=dr(dr({},x),{},{tickCoord:y>0?x.coordinate-y*e:x.coordinate})}else i[m]=x=dr(dr({},x),{},{tickCoord:x.coordinate});if(x.tickCoord!=null){var j=Il(e,x.tickCoord,v,l,c);j&&(c=x.tickCoord-e*(v()/2+s),i[m]=dr(dr({},x),{},{isShow:!0}))}},u=o-1;u>=0;u--)d(u);return i}function EG(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=dr(dr({},u),{},{tickCoord:m>0?u.coordinate-m*e:u.coordinate}),u.tickCoord!=null){var p=Il(e,u.tickCoord,()=>f,c,d);p&&(d=u.tickCoord-e*(f/2+s),o[l-1]=dr(dr({},u),{},{isShow:!0}))}}}for(var x=i?l-1:l,g=function(j){var N=o[j];if(N==null)return 1;var w=N,k,b=()=>(k===void 0&&(k=r(N,j)),k);if(j===0){var S=e*(w.coordinate-e*b()/2-c);o[j]=w=dr(dr({},w),{},{tickCoord:S<0?w.coordinate-S*e:w.coordinate})}else o[j]=w=dr(dr({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var _=Il(e,w.tickCoord,b,c,d);_&&(c=w.tickCoord+e*(b()/2+s),o[j]=dr(dr({},w),{},{isShow:!0}))}},v=0;v<x;v++)g(v);return o}function lv(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(Se(c)||Ef.isSsr){var m;return(m=kG(s,Se(c)?c:0))!==null&&m!==void 0?m:[]}var p=[],x=l==="top"||l==="bottom"?"width":"height",g=u&&x==="width"?ml(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},v=(k,b)=>{var S=typeof d=="function"?d(k.value,b):k.value;return x==="width"?jG(ml(S,{fontSize:t,letterSpacing:r}),g,f):ml(S,{fontSize:t,letterSpacing:r})[x]},y=s[0],j=s[1],N=s.length>=2&&y!=null&&j!=null?Rr(j.coordinate-y.coordinate):1,w=NG(i,N,x);return c==="equidistantPreserveStart"?SG(N,w,v,s,o):c==="equidistantPreserveEnd"?CG(N,w,v,s,o):(c==="preserveStart"||c==="preserveStartEnd"?p=EG(N,w,v,s,o,c==="preserveStartEnd"):p=MG(N,w,v,s,o),p.filter(k=>k.isShow))}var AG=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},DG=["axisLine","width","height","className","hide","ticks","axisType"];function TG(e,t){if(e==null)return{};var r,n,s=IG(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 IG(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 fi(){return fi=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},fi.apply(null,arguments)}function Hw(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 Nt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hw(Object(r),!0).forEach(function(n){RG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RG(e,t,r){return(t=$G(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $G(e){var t=zG(e,"string");return typeof t=="symbol"?t:t+""}function zG(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 ja={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:jr.axis};function LG(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=Nt(Nt(Nt({},c),Sa(l)),{},{fill:"none"});if(i==="top"||i==="bottom"){var u=+(i==="top"&&!o||i==="bottom"&&o);d=Nt(Nt({},d),{},{x1:t,y1:r+u*s,x2:t+n,y2:r+u*s})}else{var f=+(i==="left"&&!o||i==="right"&&o);d=Nt(Nt({},d),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+s})}return h.createElement("line",fi({},d,{className:it("recharts-cartesian-axis-line",Vi(l,"className"))}))}function FG(e,t,r,n,s,i,o,l,c){var d,u,f,m,p,x,g=l?-1:1,v=e.tickSize||o,y=Se(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":d=u=e.coordinate,m=r+ +!l*s,f=m-g*v,x=f-g*c,p=y;break;case"left":f=m=e.coordinate,u=t+ +!l*n,d=u-g*v,p=d-g*c,x=y;break;case"right":f=m=e.coordinate,u=t+ +l*n,d=u+g*v,p=d+g*c,x=y;break;default:d=u=e.coordinate,m=r+ +l*s,f=m+g*v,x=f+g*c,p=y;break}return{line:{x1:d,y1:f,x2:u,y2:m},tick:{x:p,y:x}}}function BG(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function WG(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function UG(e){var{option:t,tickProps:r,value:n}=e,s,i=it(r.className,"recharts-cartesian-axis-tick-value");if(h.isValidElement(t))s=h.cloneElement(t,Nt(Nt({},r),{},{className:i}));else if(typeof t=="function")s=t(Nt(Nt({},r),{},{className:i}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=it(o,cY(t))),s=h.createElement(av,fi({},r,{className:o}),n)}return s}var qG=h.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:p,width:x,height:g,tickSize:v,tickMargin:y,fontSize:j,letterSpacing:N,getTicksConfig:w,events:k,axisType:b}=e,S=lv(Nt(Nt({},w),{},{ticks:r}),j,N),_=BG(u,f),C=WG(u,f),T=Sa(w),M=Mx(n),O={};typeof s=="object"&&(O=s);var R=Nt(Nt({},T),{},{fill:"none"},O),E=S.map(U=>Nt({entry:U},FG(U,m,p,x,g,u,v,f,y))),A=E.map(U=>{var{entry:Q,line:K}=U;return h.createElement(Ca,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},s&&h.createElement("line",fi({},R,K,{className:it("recharts-cartesian-axis-tick-line",Vi(s,"className"))})))}),P=E.map((U,Q)=>{var K,se,{entry:ae,tick:W}=U,Y=Nt(Nt(Nt(Nt({verticalAnchor:C},T),{},{textAnchor:_,stroke:"none",fill:i},W),{},{index:Q,payload:ae,visibleTicksCount:S.length,tickFormatter:o,padding:c},d),{},{angle:(K=(se=d==null?void 0:d.angle)!==null&&se!==void 0?se:T.angle)!==null&&K!==void 0?K:0}),te=Nt(Nt({},Y),M);return h.createElement(Ca,fi({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(ae.value,"-").concat(ae.coordinate,"-").concat(ae.tickCoord)},Ix(k,ae,Q)),n&&h.createElement(UG,{option:n,tickProps:te,value:"".concat(typeof o=="function"?o(ae.value,Q):ae.value).concat(l||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(b,"-ticks")},P.length>0&&h.createElement(Ga,{zIndex:jr.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(b,"-tick-labels"),ref:t},P)),A.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(b,"-tick-lines")},A))}),HG=h.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:i,hide:o,ticks:l,axisType:c}=e,d=TG(e,DG),[u,f]=h.useState(""),[m,p]=h.useState(""),x=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var v;return AG({ticks:x.current,label:(v=e.labelRef)===null||v===void 0?void 0:v.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var g=h.useCallback(v=>{if(v){var y=v.getElementsByClassName("recharts-cartesian-axis-tick-value");x.current=y;var j=y[0];if(j){var N=window.getComputedStyle(j),w=N.fontSize,k=N.letterSpacing;(w!==u||k!==m)&&(f(w),p(k))}}},[u,m]);return o||n!=null&&n<=0||s!=null&&s<=0?null:h.createElement(Ga,{zIndex:e.zIndex},h.createElement(Ca,{className:it("recharts-cartesian-axis",i)},h.createElement(LG,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Sa(e)}),h.createElement(qG,{ref:g,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}),h.createElement(FK,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement(XK,{label:e.label,labelRef:e.labelRef}),e.children)))}),cv=h.forwardRef((e,t)=>{var r=en(e,ja);return h.createElement(HG,fi({},r,{ref:t}))});cv.displayName="CartesianAxis";var KG=["x1","y1","x2","y2","key"],YG=["offset"],GG=["xAxisId","yAxisId"],VG=["xAxisId","yAxisId"];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 fr(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){XG(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 XG(e,t,r){return(t=QG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function QG(e){var t=ZG(e,"string");return typeof t=="symbol"?t:t+""}function ZG(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 Hs(){return Hs=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},Hs.apply(null,arguments)}function pu(e,t){if(e==null)return{};var r,n,s=JG(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 JG(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 eV=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 h.createElement("rect",{x:n,y:s,ry:l,width:i,height:o,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function WO(e){var{option:t,lineItemProps:r}=e,n;if(h.isValidElement(t))n=h.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=pu(r,KG),f=(s=Sa(u))!==null&&s!==void 0?s:{},{offset:m}=f,p=pu(f,YG);n=h.createElement("line",Hs({},p,{x1:i,y1:o,x2:l,y2:c,fill:"none",key:d}))}return n}function tV(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=pu(e,GG),c=s.map((d,u)=>{var f=fr(fr({},l),{},{x1:t,y1:d,x2:t+r,y2:d,key:"line-".concat(u),index:u});return h.createElement(WO,{key:"line-".concat(u),option:n,lineItemProps:f})});return h.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function rV(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=pu(e,VG),c=s.map((d,u)=>{var f=fr(fr({},l),{},{x1:d,y1:t,x2:d,y2:t+r,key:"line-".concat(u),index:u});return h.createElement(WO,{option:n,lineItemProps:f,key:"line-".concat(u)})});return h.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function nV(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 p=d[m+1],x=p==null,g=x?s+o-f:p-f;if(g<=0)return null;var v=m%t.length;return h.createElement("rect",{key:"react-".concat(m),y:f,x:n,height:g,width:i,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},u)}function aV(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 p=d[m+1],x=p==null,g=x?s+o-f:p-f;if(g<=0)return null;var v=m%r.length;return h.createElement("rect",{key:"react-".concat(m),x:f,y:i,width:g,height:l,stroke:"none",fill:r[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},u)}var sV=(e,t)=>{var{xAxis:r,width:n,height:s,offset:i}=e;return p2(lv(fr(fr(fr({},ja),r),{},{ticks:x2(r),viewBox:{x:0,y:0,width:n,height:s}})),i.left,i.left+i.width,t)},iV=(e,t)=>{var{yAxis:r,width:n,height:s,offset:i}=e;return p2(lv(fr(fr(fr({},ja),r),{},{ticks:x2(r),viewBox:{x:0,y:0,width:n,height:s}})),i.top,i.top+i.height,t)},oV={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:jr.grid};function Rl(e){var t=C2(),r=_2(),n=S2(),s=fr(fr({},en(e,oV)),{},{x:Se(e.x)?e.x:n.left,y:Se(e.y)?e.y:n.top,width:Se(e.width)?e.width:n.width,height:Se(e.height)?e.height:n.height}),{xAxisId:i,yAxisId:o,x:l,y:c,width:d,height:u,syncWithTicks:f,horizontalValues:m,verticalValues:p}=s,x=Kr(),g=Ee(C=>Q0(C,"xAxis",i,x)),v=Ee(C=>Q0(C,"yAxis",o,x));if(!ea(d)||!ea(u)||!Se(l)||!Se(c))return null;var y=s.verticalCoordinatesGenerator||sV,j=s.horizontalCoordinatesGenerator||iV,{horizontalPoints:N,verticalPoints:w}=s;if((!N||!N.length)&&typeof j=="function"){var k=m&&m.length,b=j({yAxis:v?fr(fr({},v),{},{ticks:k?m:v.ticks}):void 0,width:t??d,height:r??u,offset:n},k?!0:f);Fd(Array.isArray(b),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof b,"]")),Array.isArray(b)&&(N=b)}if((!w||!w.length)&&typeof y=="function"){var S=p&&p.length,_=y({xAxis:g?fr(fr({},g),{},{ticks:S?p:g.ticks}):void 0,width:t??d,height:r??u,offset:n},S?!0:f);Fd(Array.isArray(_),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof _,"]")),Array.isArray(_)&&(w=_)}return h.createElement(Ga,{zIndex:s.zIndex},h.createElement("g",{className:"recharts-cartesian-grid"},h.createElement(eV,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),h.createElement(nV,Hs({},s,{horizontalPoints:N})),h.createElement(aV,Hs({},s,{verticalPoints:w})),h.createElement(tV,Hs({},s,{offset:n,horizontalPoints:N,xAxis:g,yAxis:v})),h.createElement(rV,Hs({},s,{offset:n,verticalPoints:w,xAxis:g,yAxis:v}))))}Rl.displayName="CartesianGrid";var lV={},UO=Hr({name:"errorBars",initialState:lV,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:Ste,replaceErrorBar:Cte,removeErrorBar:_te}=UO.actions,cV=UO.reducer,dV=["children"];function uV(e,t){if(e==null)return{};var r,n,s=fV(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 fV(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 mV={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},hV=h.createContext(mV);function pV(e){var{children:t}=e,r=uV(e,dV);return h.createElement(hV.Provider,{value:r},t)}function qO(e,t){var r,n,s=Ee(d=>Ha(d,e)),i=Ee(d=>Ka(d,t)),o=(r=s==null?void 0:s.allowDataOverflow)!==null&&r!==void 0?r:Kt.allowDataOverflow,l=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:Yt.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function xV(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=zO(),{needClipX:i,needClipY:o,needClip:l}=qO(t,r);if(!l||!s)return null;var{x:c,y:d,width:u,height:f}=s;return h.createElement("clipPath",{id:"clipPath-".concat(n)},h.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 gV={};/**
|
|
603
|
+
* @license React
|
|
604
|
+
* use-sync-external-store-with-selector.production.js
|
|
605
|
+
*
|
|
606
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
607
|
+
*
|
|
608
|
+
* This source code is licensed under the MIT license found in the
|
|
609
|
+
* LICENSE file in the root directory of this source tree.
|
|
610
|
+
*/var Oc=h;function vV(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yV=typeof Object.is=="function"?Object.is:vV,bV=Oc.useSyncExternalStore,wV=Oc.useRef,jV=Oc.useEffect,NV=Oc.useMemo,kV=Oc.useDebugValue;gV.useSyncExternalStoreWithSelector=function(e,t,r,n,s){var i=wV(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=NV(function(){function c(p){if(!d){if(d=!0,u=p,p=n(p),s!==void 0&&o.hasValue){var x=o.value;if(s(x,p))return f=x}return f=p}if(x=f,yV(u,p))return x;var g=n(p);return s!==void 0&&s(x,g)?(u=p,x):(u=p,f=g)}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=bV(e,i[0],i[1]);return jV(function(){o.hasValue=!0,o.value=l},[l]),kV(l),l};function SV(e){e()}function CV(){let e=null,t=null;return{clear(){e=null,t=null},notify(){SV(()=>{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 Yw={notify(){},get:()=>[]};function _V(e,t){let r,n=Yw,s=0,i=!1;function o(g){u();const v=n.subscribe(g);let y=!1;return()=>{y||(y=!0,v(),f())}}function l(){n.notify()}function c(){x.onStateChange&&x.onStateChange()}function d(){return i}function u(){s++,r||(r=e.subscribe(c),n=CV())}function f(){s--,r&&s===0&&(r(),r=void 0,n.clear(),n=Yw)}function m(){i||(i=!0,u())}function p(){i&&(i=!1,f())}const x={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:m,tryUnsubscribe:p,getListeners:()=>n};return x}var OV=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",PV=OV(),MV=()=>typeof navigator<"u"&&navigator.product==="ReactNative",EV=MV(),AV=()=>PV||EV?h.useLayoutEffect:h.useEffect,DV=AV();function Gw(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function TV(e,t){if(Gw(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])||!Gw(e[r[s]],t[r[s]]))return!1;return!0}var rh=Symbol.for("react-redux-context"),nh=typeof globalThis<"u"?globalThis:{};function IV(){if(!h.createContext)return{};const e=nh[rh]??(nh[rh]=new Map);let t=e.get(h.createContext);return t||(t=h.createContext(null),e.set(h.createContext,t)),t}var RV=IV();function $V(e){const{children:t,context:r,serverState:n,store:s}=e,i=h.useMemo(()=>{const c=_V(s);return{store:s,subscription:c,getServerState:n?()=>n:void 0}},[s,n]),o=h.useMemo(()=>s.getState(),[s]);DV(()=>{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||RV;return h.createElement(l.Provider,{value:i},t)}var zV=$V,LV=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function FV(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function dv(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(LV.has(n)){if(e[n]==null&&t[n]==null)continue;if(!TV(e[n],t[n]))return!1}else if(!FV(e[n],t[n]))return!1;return!0}function ji(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:RO}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:RO}var BV="Invariant failed";function WV(e,t){throw new Error(BV)}function bp(){return bp=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},bp.apply(null,arguments)}function xu(e){return h.createElement(MY,bp({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var UV=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,s)=>{if(Se(t))return t;var i=Se(n)||Vt(n);return i?t(n,s):(i||WV(),r)}},qV=(e,t,r)=>r,HV=(e,t)=>t,Pc=G([Lg,HV],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),KV=G([Pc],e=>e==null?void 0:e.maxBarSize),YV=(e,t,r,n)=>n,GV=G([ot,Lg,ji,Ni,qV],(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")),VV=(e,t,r)=>{var n=ot(e),s=ji(e,t),i=Ni(e,t);if(!(s==null||i==null))return n==="horizontal"?hp(e,"yAxis",i,r):hp(e,"xAxis",s,r)},XV=(e,t)=>{var r=ot(e),n=ji(e,t),s=Ni(e,t);if(!(n==null||s==null))return r==="horizontal"?X0(e,"xAxis",n):X0(e,"yAxis",s)},QV=G([GV,I9,XV],sG),ZV=(e,t,r)=>{var n,s,i=Pc(e,t);if(i==null)return 0;var o=ji(e,t),l=Ni(e,t);if(o==null||l==null)return 0;var c=ot(e),d=UC(e),{maxBarSize:u}=i,f=Vt(u)?d:u,m,p;return c==="horizontal"?(m=ro(e,"xAxis",o,r),p=to(e,"xAxis",o,r)):(m=ro(e,"yAxis",l,r),p=to(e,"yAxis",l,r)),(n=(s=Ld(m,p,!0))!==null&&s!==void 0?s:f)!==null&&n!==void 0?n:0},HO=(e,t,r)=>{var n=ot(e),s=ji(e,t),i=Ni(e,t);if(!(s==null||i==null)){var o,l;return n==="horizontal"?(o=ro(e,"xAxis",s,r),l=to(e,"xAxis",s,r)):(o=ro(e,"yAxis",i,r),l=to(e,"yAxis",i,r)),Ld(o,l)}},JV=G([QV,UC,T9,qC,ZV,HO,KV],dG),eX=(e,t,r)=>{var n=ji(e,t);if(n!=null)return ro(e,"xAxis",n,r)},tX=(e,t,r)=>{var n=Ni(e,t);if(n!=null)return ro(e,"yAxis",n,r)},rX=(e,t,r)=>{var n=ji(e,t);if(n!=null)return to(e,"xAxis",n,r)},nX=(e,t,r)=>{var n=Ni(e,t);if(n!=null)return to(e,"yAxis",n,r)},aX=G([JV,Pc],fG),sX=G([VV,Pc],uG),iX=G([Xt,Jx,eX,tX,rX,nX,aX,ot,C9,HO,sX,Pc,YV],(e,t,r,n,s,i,o,l,c,d,u,f,m)=>{var{chartData:p,dataStartIndex:x,dataEndIndex:g}=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=p==null?void 0:p.slice(x,g+1),y!=null)return TX({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:x})}}),oX=["index"];function wp(){return wp=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},wp.apply(null,arguments)}function lX(e,t){if(e==null)return{};var r,n,s=cX(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 cX(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 KO=h.createContext(void 0),dX=e=>{var t=h.useContext(KO);if(t!=null)return t.stackId;if(e!=null)return $F(e)},uX=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),fX=e=>{var t=h.useContext(KO);if(t!=null){var{stackId:r}=t;return"url(#".concat(uX(r,e),")")}},YO=e=>{var{index:t}=e,r=lX(e,oX),n=fX(t);return h.createElement(Ca,wp({className:"recharts-bar-stack-layer",clipPath:n},r))},mX=["onMouseEnter","onMouseLeave","onClick"],hX=["value","background","tooltipPosition"],pX=["id"],xX=["onMouseEnter","onClick","onMouseLeave"];function Da(){return Da=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},Da.apply(null,arguments)}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 yr(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){gX(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 gX(e,t,r){return(t=vX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vX(e){var t=yX(e,"string");return typeof t=="symbol"?t:t+""}function yX(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 gu(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=e=>{var{dataKey:t,name:r,fill:n,legendType:s,hide:i}=e;return[{inactive:i,dataKey:t,type:s,color:n,value:g2(r,t),payload:e}]},jX=h.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:jo,settings:{stroke:r,strokeWidth:n,fill:s,dataKey:t,nameKey:void 0,name:g2(i,t),hide:o,type:c,color:s,unit:l,graphicalItemId:d}};return h.createElement(EY,{tooltipEntrySettings:u})});function NX(e){var t=Ee(no),{data:r,dataKey:n,background:s,allOtherBarProps:i}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=i,d=gu(i,mX),u=AO(o,n,i.id),f=DO(l),m=TO(c,n,i.id);if(!s||r==null)return null;var p=Mx(s);return h.createElement(Ga,{zIndex:mG(s,jr.barBackground)},r.map((x,g)=>{var{value:v,background:y,tooltipPosition:j}=x,N=gu(x,hX);if(!y)return null;var w=u(x,g),k=f(x,g),b=m(x,g),S=yr(yr(yr(yr(yr({option:s,isActive:String(g)===t},N),{},{fill:"#eee"},y),p),Ix(d,x,g)),{},{onMouseEnter:w,onMouseLeave:k,onClick:b,dataKey:n,index:g,className:"recharts-bar-background-rectangle"});return h.createElement(xu,Da({key:"background-bar-".concat(g)},S))}))}function kX(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 yr(yr({},o),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:o,fill:i.fill})});return h.createElement(nY,{value:t?s:void 0},r)}function SX(e){var{shape:t,activeBar:r,baseProps:n,entry:s,index:i,dataKey:o}=e,l=Ee(no),c=Ee(tO),d=r&&String(i)===l&&(c==null||o===c),u=d?r:t;return d?h.createElement(Ga,{zIndex:jr.activeBar},h.createElement(YO,{index:i},h.createElement(xu,Da({},n,{name:String(n.name)},s,{isActive:d,option:u,index:i,dataKey:o})))):h.createElement(xu,Da({},n,{name:String(n.name)},s,{isActive:d,option:u,index:i,dataKey:o}))}function CX(e){var{shape:t,baseProps:r,entry:n,index:s,dataKey:i}=e;return h.createElement(xu,Da({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:s,dataKey:i}))}function _X(e){var t,{data:r,props:n}=e,s=(t=Sa(n))!==null&&t!==void 0?t:{},{id:i}=s,o=gu(s,pX),{shape:l,dataKey:c,activeBar:d}=n,{onMouseEnter:u,onClick:f,onMouseLeave:m}=n,p=gu(n,xX),x=AO(u,c,i),g=DO(m),v=TO(f,c,i);return r?h.createElement(h.Fragment,null,r.map((y,j)=>h.createElement(YO,Da({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"},Ix(p,y,j),{onMouseEnter:x(y,j),onMouseLeave:g(y,j),onClick:v(y,j)}),d?h.createElement(SX,{shape:l,activeBar:d,baseProps:o,entry:y,index:j,dataKey:c}):h.createElement(CX,{shape:l,baseProps:o,entry:y,index:j,dataKey:c})))):null}function OX(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=sg(t,"recharts-bar-"),[p,x]=h.useState(!1),g=!p,v=h.useCallback(()=>{typeof d=="function"&&d(),x(!1)},[d]),y=h.useCallback(()=>{typeof u=="function"&&u(),x(!0)},[u]);return h.createElement(kX,{showLabels:g,rects:n},h.createElement(ag,{animationId:m,begin:o,duration:l,isActive:i,easing:c,onAnimationEnd:v,onAnimationStart:y,key:m},j=>{var N=j===1?n:n==null?void 0:n.map((w,k)=>{var b=f&&f[k];if(b)return yr(yr({},w),{},{x:sr(b.x,w.x,j),y:sr(b.y,w.y,j),width:sr(b.width,w.width,j),height:sr(b.height,w.height,j)});if(s==="horizontal"){var S=sr(0,w.height,j),_=sr(w.stackedBarStart,w.y,j);return yr(yr({},w),{},{y:_,height:S})}var C=sr(0,w.width,j),T=sr(w.stackedBarStart,w.x,j);return yr(yr({},w),{},{width:C,x:T})});return j>0&&(r.current=N??null),N==null?null:h.createElement(Ca,null,h.createElement(_X,{props:t,data:N}))}),h.createElement(iY,{label:t.label}),t.children)}function PX(e){var t=h.useRef(null);return h.createElement(OX,{previousRectanglesRef:t,props:e})}var GO=0,MX=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:lr(e,t)}};class EX extends h.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=it("recharts-bar",s),f=d;return h.createElement(Ca,{className:u,id:d},l&&h.createElement("defs",null,h.createElement(xV,{clipPathId:f,xAxisId:i,yAxisId:o})),h.createElement(Ca,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(f,")"):void 0},h.createElement(NX,{data:r,dataKey:n,background:c,allOtherBarProps:this.props}),h.createElement(PX,this.props)))}}var AX={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:GO,xAxisId:0,yAxisId:0,zIndex:jr.bar};function DX(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}=qO(t,r),m=No(),p=Kr(),x=mY(e.children,fO),g=Ee(j=>iX(j,e.id,p,x));if(m!=="vertical"&&m!=="horizontal")return null;var v,y=g==null?void 0:g[0];return y==null||y.height==null||y.width==null?v=0:v=m==="vertical"?y.height/2:y.width/2,h.createElement(pV,{xAxisId:t,yAxisId:r,data:g,dataPointFormatter:MX,errorBarOffset:v},h.createElement(EX,Da({},e,{layout:m,needClip:f,data:g,xAxisId:t,yAxisId:r,hide:n,legendType:s,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u})))}function TX(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:p,parentViewBox:x,dataStartIndex:g}=e,v=t==="horizontal"?l:o,y=u?v.scale.domain():null,j=zF({numericAxis:v}),N=v.scale.map(j);return f.map((w,k)=>{var b,S,_,C,T,M;if(u){var O=u[k+g];if(O==null)return null;b=AF(O,y)}else b=lr(w,r),Array.isArray(b)||(b=[j,b]);var R=UV(n,GO)(b[1],k);if(t==="horizontal"){var E,A=l.scale.map(b[0]),P=l.scale.map(b[1]);if(A==null||P==null)return null;S=sb({axis:o,ticks:c,bandSize:i,offset:s.offset,entry:w,index:k}),_=(E=P??A)!==null&&E!==void 0?E:void 0,C=s.size;var U=A-P;if(T=Zn(U)?0:U,M={x:S,y:m.top,width:C,height:m.height},Math.abs(R)>0&&Math.abs(T)<Math.abs(R)){var Q=Rr(T||R)*(Math.abs(R)-Math.abs(T));_-=Q,T+=Q}}else{var K=o.scale.map(b[0]),se=o.scale.map(b[1]);if(K==null||se==null)return null;if(S=K,_=sb({axis:l,ticks:d,bandSize:i,offset:s.offset,entry:w,index:k}),C=se-K,T=s.size,M={x:m.left,y:_,width:m.width,height:T},Math.abs(R)>0&&Math.abs(C)<Math.abs(R)){var ae=Rr(C||R)*(Math.abs(R)-Math.abs(C));C+=ae}}if(S==null||_==null||C==null||T==null)return null;var W=yr(yr({},w),{},{stackedBarStart:N,x:S,y:_,width:C,height:T,value:u?b:b[1],payload:w,background:M,tooltipPosition:{x:S+C/2,y:_+T/2},parentViewBox:x},p&&p[k]&&p[k].props);return W}).filter(Boolean)}function IX(e){var t=en(e,AX),r=dX(t.stackId),n=Kr();return h.createElement($Y,{id:t.id,type:"bar"},s=>h.createElement(h.Fragment,null,h.createElement(AY,{legendPayload:wX(t)}),h.createElement(jX,{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}),h.createElement(qY,{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}),h.createElement(Ga,{zIndex:t.zIndex},h.createElement(DX,Da({},t,{id:s})))))}var $l=h.memo(IX,dv);$l.displayName="Bar";var RX=["domain","range"],$X=["domain","range"];function Xw(e,t){if(e==null)return{};var r,n,s=zX(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 zX(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 Qw(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 VO(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=Xw(e,RX),{domain:i,range:o}=t,l=Xw(t,$X);return!Qw(r,i)||!Qw(n,o)?!1:dv(s,l)}var LX=["type"],FX=["dangerouslySetInnerHTML","ticks","scale"],BX=["id","scale"];function jp(){return jp=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},jp.apply(null,arguments)}function Zw(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 Jw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zw(Object(r),!0).forEach(function(n){WX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function WX(e,t,r){return(t=UX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UX(e){var t=qX(e,"string");return typeof t=="symbol"?t:t+""}function qX(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 Np(e,t){if(e==null)return{};var r,n,s=HX(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 HX(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 KX(e){var t=Mt(),r=h.useRef(null),n=O2(),{type:s}=e,i=Np(e,LX),o=Ff(n,"xAxis",s),l=h.useMemo(()=>{if(o!=null)return Jw(Jw({},i),{},{type:o})},[i,o]);return h.useLayoutEffect(()=>{l!=null&&(r.current===null?t(VY(l)):r.current!==l&&t(XY({prev:r.current,next:l})),r.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(QY(r.current)),r.current=null)},[t]),null}var YX=e=>{var{xAxisId:t,className:r}=e,n=Ee(Jx),s=Kr(),i="xAxis",o=Ee(y=>T_(y,i,t,s)),l=Ee(y=>M_(y,t)),c=Ee(y=>RU(y,t)),d=Ee(y=>JC(y,t));if(l==null||c==null||d==null)return null;var{dangerouslySetInnerHTML:u,ticks:f,scale:m}=e,p=Np(e,FX),{id:x,scale:g}=d,v=Np(d,BX);return h.createElement(cv,jp({},p,v,{x:c.x,y:c.y,width:l.width,height:l.height,className:it("recharts-".concat(i," ").concat(i),r),viewBox:n,ticks:o,axisType:i}))},GX={allowDataOverflow:Kt.allowDataOverflow,allowDecimals:Kt.allowDecimals,allowDuplicatedCategory:Kt.allowDuplicatedCategory,angle:Kt.angle,axisLine:ja.axisLine,height:Kt.height,hide:!1,includeHidden:Kt.includeHidden,interval:Kt.interval,label:!1,minTickGap:Kt.minTickGap,mirror:Kt.mirror,orientation:Kt.orientation,padding:Kt.padding,reversed:Kt.reversed,scale:Kt.scale,tick:Kt.tick,tickCount:Kt.tickCount,tickLine:ja.tickLine,tickSize:ja.tickSize,type:Kt.type,xAxisId:0},VX=e=>{var t=en(e,GX);return h.createElement(h.Fragment,null,h.createElement(KX,{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}),h.createElement(YX,t))},zl=h.memo(VX,VO);zl.displayName="XAxis";var XX=["type"],QX=["dangerouslySetInnerHTML","ticks","scale"],ZX=["id","scale"];function kp(){return kp=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},kp.apply(null,arguments)}function ej(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 tj(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ej(Object(r),!0).forEach(function(n){JX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ej(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function JX(e,t,r){return(t=eQ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eQ(e){var t=tQ(e,"string");return typeof t=="symbol"?t:t+""}function tQ(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 Sp(e,t){if(e==null)return{};var r,n,s=rQ(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 rQ(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 nQ(e){var t=Mt(),r=h.useRef(null),n=O2(),{type:s}=e,i=Sp(e,XX),o=Ff(n,"yAxis",s),l=h.useMemo(()=>{if(o!=null)return tj(tj({},i),{},{type:o})},[o,i]);return h.useLayoutEffect(()=>{l!=null&&(r.current===null?t(ZY(l)):r.current!==l&&t(JY({prev:r.current,next:l})),r.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(eG(r.current)),r.current=null)},[t]),null}function aQ(e){var{yAxisId:t,className:r,width:n,label:s}=e,i=h.useRef(null),o=h.useRef(null),l=Ee(Jx),c=Kr(),d=Mt(),u="yAxis",f=Ee(b=>E_(b,t)),m=Ee(b=>zU(b,t)),p=Ee(b=>T_(b,u,t,c)),x=Ee(b=>e_(b,t));if(h.useLayoutEffect(()=>{if(!(n!=="auto"||!f||sv(s)||h.isValidElement(s)||x==null)){var b=i.current;if(b){var S=b.getCalculatedWidth();Math.round(f.width)!==Math.round(S)&&d(tG({id:t,width:S}))}}},[p,f,d,s,t,n,x]),f==null||m==null||x==null)return null;var{dangerouslySetInnerHTML:g,ticks:v,scale:y}=e,j=Sp(e,QX),{id:N,scale:w}=x,k=Sp(x,ZX);return h.createElement(cv,kp({},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:it("recharts-".concat(u," ").concat(u),r),viewBox:l,ticks:p,axisType:u}))}var sQ={allowDataOverflow:Yt.allowDataOverflow,allowDecimals:Yt.allowDecimals,allowDuplicatedCategory:Yt.allowDuplicatedCategory,angle:Yt.angle,axisLine:ja.axisLine,hide:!1,includeHidden:Yt.includeHidden,interval:Yt.interval,label:!1,minTickGap:Yt.minTickGap,mirror:Yt.mirror,orientation:Yt.orientation,padding:Yt.padding,reversed:Yt.reversed,scale:Yt.scale,tick:Yt.tick,tickCount:Yt.tickCount,tickLine:ja.tickLine,tickSize:ja.tickSize,type:Yt.type,width:Yt.width,yAxisId:0},iQ=e=>{var t=en(e,sQ);return h.createElement(h.Fragment,null,h.createElement(nQ,{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}),h.createElement(aQ,t))},Ll=h.memo(iQ,VO);Ll.displayName="YAxis";var oQ=(e,t)=>t,uv=G([oQ,ot,QC,Jt,Q_,Ya,Zq,Xt],sH),fv=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)}},XO=un("mouseClick"),QO=hc();QO.startListening({actionCreator:XO,effect:(e,t)=>{var r=e.payload,n=uv(t.getState(),fv(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(ZU({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Cp=un("mouseMove"),ZO=hc(),id=null;ZO.startListening({actionCreator:Cp,effect:(e,t)=>{var r=e.payload;id!==null&&cancelAnimationFrame(id);var n=fv(r);id=requestAnimationFrame(()=>{var s=t.getState(),i=Gg(s,s.tooltip.settings.shared);if(i==="axis"){var o=uv(s,n);(o==null?void 0:o.activeIndex)!=null?t.dispatch(W_({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):t.dispatch(B_())}id=null})}});function lQ(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 rj={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},JO=Hr({name:"rootProps",initialState:rj,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:rj.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}}}),cQ=JO.reducer,{updateOptions:dQ}=JO.actions,uQ=null,fQ={updatePolarOptions:(e,t)=>t.payload},eP=Hr({name:"polarOptions",initialState:uQ,reducers:fQ}),{updatePolarOptions:Ote}=eP.actions,mQ=eP.reducer,tP=un("keyDown"),rP=un("focus"),mv=hc();mv.startListening({actionCreator:tP,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=Vg(s,Ao(r),kc(r),Cc(r)),l=o==null?-1:Number(o);if(!(!Number.isFinite(l)||l<0)){var c=Ya(r);if(i==="Enter"){var d=du(r,"axis","hover",String(s.index));t.dispatch(xp({active:!s.active,activeIndex:s.index,activeCoordinate:d}));return}var u=WU(r),f=u==="left-to-right"?1:-1,m=i==="ArrowRight"?1:-1,p=l+m*f;if(!(c==null||p>=c.length||p<0)){var x=du(r,"axis","hover",String(p));t.dispatch(xp({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}}}}}});mv.startListening({actionCreator:rP,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=du(r,"axis","hover",String(i));t.dispatch(xp({active:!0,activeIndex:i,activeCoordinate:o}))}}}});var nn=un("externalEvent"),nP=hc(),ah=new Map;nP.startListening({actionCreator:nn,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){n.persist();var s=n.type,i=ah.get(s);i!==void 0&&cancelAnimationFrame(i);var o=requestAnimationFrame(()=>{try{var l=t.getState(),c={activeCoordinate:$q(l),activeDataKey:tO(l),activeIndex:no(l),activeLabel:eO(l),activeTooltipIndex:no(l),isTooltipActive:zq(l)};r(c,n)}finally{ah.delete(s)}});ah.set(s,o)}}});var hQ=G([Mo],e=>e.tooltipItemPayloads),pQ=G([hQ,(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)}}}),aP=un("touchMove"),sP=hc();sP.startListening({actionCreator:aP,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var n=t.getState(),s=Gg(n,n.tooltip.settings.shared);if(s==="axis"){var i=r.touches[0];if(i==null)return;var o=uv(n,fv({clientX:i.clientX,clientY:i.clientY,currentTarget:r.currentTarget}));(o==null?void 0:o.activeIndex)!=null&&t.dispatch(W_({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(HF),f=(l=d.getAttribute(KF))!==null&&l!==void 0?l:void 0,m=Eo(n).find(g=>g.id===f);if(u==null||m==null||f==null)return;var{dataKey:p}=m,x=pQ(n,u,f);t.dispatch(F_({activeDataKey:p,activeIndex:u,activeCoordinate:x,activeGraphicalItemId:f}))}}}});var xQ=FS({brush:pG,cartesianAxis:rG,chartData:RH,errorBars:cV,graphicalItems:WY,layout:_F,legend:D8,options:EH,polarAxis:lY,polarOptions:mQ,referenceElements:yG,rootProps:cQ,tooltip:JU,zIndex:yH}),gQ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return ZL({reducer:xQ,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([QO.middleware,ZO.middleware,mv.middleware,nP.middleware,sP.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(t2({type:"raf"}))},devTools:{serialize:{replacer:lQ},name:"recharts-".concat(r)}})};function vQ(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=Kr(),i=h.useRef(null);if(s)return r;i.current==null&&(i.current=gQ(t,n));var o=qx;return h.createElement(zV,{context:o,store:i.current},r)}function yQ(e){var{layout:t,margin:r}=e,n=Mt(),s=Kr();return h.useEffect(()=>{s||(n(kF(t)),n(NF(r)))},[n,s,t,r]),null}var bQ=h.memo(yQ,dv);function wQ(e){var t=Mt();return h.useEffect(()=>{t(dQ(e))},[t,e]),null}function nj(e){var{zIndex:t,isPanorama:r}=e,n=h.useRef(null),s=Mt();return h.useLayoutEffect(()=>(n.current&&s(gH({zIndex:t,element:n.current,isPanorama:r})),()=>{s(vH({zIndex:t,isPanorama:r}))}),[s,t,r]),h.createElement("g",{tabIndex:-1,ref:n})}function aj(e){var{children:t,isPanorama:r}=e,n=Ee(oH);if(!n||n.length===0)return t;var s=n.filter(o=>o<0),i=n.filter(o=>o>0);return h.createElement(h.Fragment,null,s.map(o=>h.createElement(nj,{key:o,zIndex:o,isPanorama:r})),t,i.map(o=>h.createElement(nj,{key:o,zIndex:o,isPanorama:r})))}var jQ=["children"];function NQ(e,t){if(e==null)return{};var r,n,s=kQ(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 kQ(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 vu(){return vu=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},vu.apply(null,arguments)}var SQ={width:"100%",height:"100%",display:"block"},CQ=h.forwardRef((e,t)=>{var r=C2(),n=_2(),s=$2();if(!ea(r)||!ea(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),h.createElement(Hk,vu({},o,{title:l,desc:c,role:u,tabIndex:d,width:r,height:n,style:SQ,ref:t}),i)}),_Q=e=>{var{children:t}=e,r=Ee(Cf);if(!r)return null;var{width:n,height:s,y:i,x:o}=r;return h.createElement(Hk,{width:n,height:s,x:o,y:i},t)},sj=h.forwardRef((e,t)=>{var{children:r}=e,n=NQ(e,jQ),s=Kr();return s?h.createElement(_Q,null,h.createElement(aj,{isPanorama:!0},r)):h.createElement(CQ,vu({ref:t},n),h.createElement(aj,{isPanorama:!1},r))});function OQ(){var e=Mt(),[t,r]=h.useState(null),n=Ee(qF);return h.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),i=s.width/t.offsetWidth;qe(i)&&i!==n&&e(CF(i))}},[t,e,n]),r}function ij(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 PQ(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ij(Object(r),!0).forEach(function(n){MQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ij(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function MQ(e,t,r){return(t=EQ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EQ(e){var t=AQ(e,"string");return typeof t=="symbol"?t:t+""}function AQ(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 us(){return us=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},us.apply(null,arguments)}var DQ=()=>(HH(),null);function yu(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var TQ=h.forwardRef((e,t)=>{var r,n,s=h.useRef(null),[i,o]=h.useState({containerWidth:yu((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:yu((n=e.style)===null||n===void 0?void 0:n.height)}),l=h.useCallback((d,u)=>{o(f=>{var m=Math.round(d),p=Math.round(u);return f.containerWidth===m&&f.containerHeight===p?f:{containerWidth:m,containerHeight:p}})},[]),c=h.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=x=>{var g=x[0];if(g!=null){var{width:v,height:y}=g.contentRect;l(v,y)}},p=new ResizeObserver(m);p.observe(d),s.current=p}},[t,l]);return h.useEffect(()=>()=>{var d=s.current;d!=null&&d.disconnect()},[l]),h.createElement(h.Fragment,null,h.createElement(xc,{width:i.containerWidth,height:i.containerHeight}),h.createElement("div",us({ref:c},e)))}),IQ=h.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,i]=h.useState({containerWidth:yu(r),containerHeight:yu(n)}),o=h.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=h.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:d,height:u}=c.getBoundingClientRect();o(d,u)}},[t,o]);return h.createElement(h.Fragment,null,h.createElement(xc,{width:s.containerWidth,height:s.containerHeight}),h.createElement("div",us({ref:l},e)))}),RQ=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return h.createElement(h.Fragment,null,h.createElement(xc,{width:r,height:n}),h.createElement("div",us({ref:t},e)))}),$Q=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?h.createElement(IQ,us({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?h.createElement(RQ,us({},e,{width:r,height:n,ref:t})):h.createElement(h.Fragment,null,h.createElement(xc,{width:r,height:n}),h.createElement("div",us({ref:t},e)))});function zQ(e){return e?TQ:$Q}var LQ=h.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:p,onTouchMove:x,onTouchStart:g,style:v,width:y,responsive:j,dispatchTouchEvents:N=!0}=e,w=h.useRef(null),k=Mt(),[b,S]=h.useState(null),[_,C]=h.useState(null),T=OQ(),M=eg(),O=(M==null?void 0:M.width)>0?M.width:y,R=(M==null?void 0:M.height)>0?M.height:s,E=h.useCallback(F=>{T(F),typeof t=="function"&&t(F),S(F),C(F),F!=null&&(w.current=F)},[T,t,S,C]),A=h.useCallback(F=>{k(XO(F)),k(nn({handler:i,reactEvent:F}))},[k,i]),P=h.useCallback(F=>{k(Cp(F)),k(nn({handler:d,reactEvent:F}))},[k,d]),U=h.useCallback(F=>{k(B_()),k(nn({handler:u,reactEvent:F}))},[k,u]),Q=h.useCallback(F=>{k(Cp(F)),k(nn({handler:f,reactEvent:F}))},[k,f]),K=h.useCallback(()=>{k(rP())},[k]),se=h.useCallback(F=>{k(tP(F.key))},[k]),ae=h.useCallback(F=>{k(nn({handler:o,reactEvent:F}))},[k,o]),W=h.useCallback(F=>{k(nn({handler:l,reactEvent:F}))},[k,l]),Y=h.useCallback(F=>{k(nn({handler:c,reactEvent:F}))},[k,c]),te=h.useCallback(F=>{k(nn({handler:m,reactEvent:F}))},[k,m]),X=h.useCallback(F=>{k(nn({handler:g,reactEvent:F}))},[k,g]),I=h.useCallback(F=>{N&&k(aP(F)),k(nn({handler:x,reactEvent:F}))},[k,N,x]),D=h.useCallback(F=>{k(nn({handler:p,reactEvent:F}))},[k,p]),Z=zQ(j);return h.createElement(lO.Provider,{value:b},h.createElement(cz.Provider,{value:_},h.createElement(Z,{width:O??(v==null?void 0:v.width),height:R??(v==null?void 0:v.height),className:it("recharts-wrapper",n),style:PQ({position:"relative",cursor:"default",width:O,height:R},v),onClick:A,onContextMenu:ae,onDoubleClick:W,onFocus:K,onKeyDown:se,onMouseDown:Y,onMouseEnter:P,onMouseLeave:U,onMouseMove:Q,onMouseUp:te,onTouchEnd:D,onTouchMove:I,onTouchStart:X,ref:E},h.createElement(DQ,null),r)))}),FQ=["width","height","responsive","children","className","style","compact","title","desc"];function BQ(e,t){if(e==null)return{};var r,n,s=WQ(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 WQ(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 UQ=h.forwardRef((e,t)=>{var{width:r,height:n,responsive:s,children:i,className:o,style:l,compact:c,title:d,desc:u}=e,f=BQ(e,FQ),m=Sa(f);return c?h.createElement(h.Fragment,null,h.createElement(xc,{width:r,height:n}),h.createElement(sj,{otherAttributes:m,title:d,desc:u},i)):h.createElement(LQ,{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},h.createElement(sj,{otherAttributes:m,title:d,desc:u,ref:t},h.createElement(wG,null,i)))});function _p(){return _p=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},_p.apply(null,arguments)}var qQ={top:5,right:5,bottom:5,left:5},HQ={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:qQ,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},KQ=h.forwardRef(function(t,r){var n,s=en(t.categoricalChartProps,HQ),{chartName:i,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:d}=t,u={chartName:i,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return h.createElement(vQ,{preloadedState:{options:u},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:i},h.createElement(hG,{chartData:d.data}),h.createElement(bQ,{layout:s.layout,margin:s.margin}),h.createElement(wQ,{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}),h.createElement(UQ,_p({},s,{ref:r})))}),YQ=["axis","item"],bu=h.forwardRef((e,t)=>h.createElement(KQ,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:YQ,tooltipPayloadSearcher:PH,categoricalChartProps:e,ref:t}));const iP={all:["reporting"],timeLogs:e=>[...iP.all,"time-logs",e]};function oP(e,t){return We({queryKey:iP.timeLogs(e),queryFn:()=>{const r=new URLSearchParams;return Object.entries(e).forEach(([n,s])=>{s&&r.set(n,s)}),re.get(`/admin/reporting/time-logs?${r}`)},enabled:(t==null?void 0:t.enabled)??(Object.values(e).some(Boolean)||!!e.workspace_id)})}function wu({value:e,onChange:t,placeholder:r="Pick a date",className:n}){return a.jsxs(Ot,{children:[a.jsx(Pt,{asChild:!0,children:a.jsxs(J,{variant:"outline",className:$("h-8 w-36 justify-start text-left font-normal text-xs gap-1.5",!e&&"text-muted-foreground",n),children:[a.jsx(mr,{className:"h-3.5 w-3.5 shrink-0"}),e?me(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(st,{className:"h-3 w-3"})})]})}),a.jsx(St,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]})}function Op({options:e,selected:t,onSelectionChange:r,placeholder:n="Select…",className:s}){var d;const[i,o]=h.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(Ot,{open:i,onOpenChange:o,children:[a.jsx(Pt,{asChild:!0,children:a.jsxs(J,{variant:"outline",role:"combobox","aria-expanded":i,className:$("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(oo,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),a.jsxs(St,{className:"w-56 p-0",align:"start",children:[a.jsxs(Ks,{children:[a.jsx(Hu,{placeholder:"Search…",className:"h-8 text-xs"}),a.jsxs(Ys,{children:[a.jsx(Ku,{className:"text-xs py-4 text-center text-muted-foreground",children:"No results."}),a.jsx(rs,{children:e.map(u=>a.jsxs(sn,{value:u.label,onSelect:()=>l(u.value),className:"text-xs cursor-pointer",children:[a.jsx(ir,{className:$("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(J,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs text-muted-foreground",onClick:()=>r([]),children:[a.jsx(st,{className:"h-3 w-3 mr-1"}),"Clear all"]})})]})]})}function cl(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function oj({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:cl(((n=t[0])==null?void 0:n.value)??0)})]})}function GQ({workspaceId:e}){const[t,r]=h.useState(void 0),[n,s]=h.useState(void 0),[i,o]=h.useState([]),[l,c]=h.useState([]),{workspace:d}=Ie(),u=(d==null?void 0:d.slug)??"",{data:f=[],isLoading:m}=oc(),{data:p=[],isLoading:x}=fo(),{data:g}=yi(),v=t?me(t,"yyyy-MM-dd"):void 0,y=n?me(n,"yyyy-MM-dd"):void 0,j=h.useMemo(()=>new Map(p.map(E=>[E.id,E])),[p]),{data:N,isLoading:w}=oP({from:v,to:y,workspace_id:e},{enabled:!0}),k=(N==null?void 0:N.time_logs)??[],b=h.useMemo(()=>{let E=k;return x||(E=E.filter(A=>!A.project_id||j.has(A.project_id))),i.length>0&&(E=E.filter(A=>i.includes(A.user_id))),l.length>0&&(E=E.filter(A=>A.project_id&&l.includes(A.project_id))),E},[k,i,l,j,x]),S=b.reduce((E,A)=>E+(A.duration_minutes??0),0),_=h.useMemo(()=>new Set(b.map(E=>E.user_id)).size,[b]),C=h.useMemo(()=>new Set(b.map(E=>E.project_id).filter(Boolean)).size,[b]),T=h.useMemo(()=>{const E=new Map;for(const A of b)E.set(A.user_id,(E.get(A.user_id)??0)+(A.duration_minutes??0));return Array.from(E.entries()).map(([A,P])=>{var U;return{name:((U=g==null?void 0:g.get(A))==null?void 0:U.name)??"Unknown",minutes:P}}).sort((A,P)=>P.minutes-A.minutes).slice(0,8)},[b,g]),M=h.useMemo(()=>{const E=new Map;for(const A of b){const P=A.project_id??"__none__";E.set(P,(E.get(P)??0)+(A.duration_minutes??0))}return Array.from(E.entries()).map(([A,P])=>{var U;return{name:A==="__none__"?"No project":((U=j.get(A))==null?void 0:U.name)??"Unknown",minutes:P}}).sort((A,P)=>P.minutes-A.minutes).slice(0,8)},[b,j]),O=h.useMemo(()=>f.map(E=>({value:E.id,label:[E.first_name,E.last_name].filter(Boolean).join(" ")||E.email})),[f]),R=h.useMemo(()=>p.map(E=>({value:E.id,label:E.name})),[p]);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(fs,{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 flex-col gap-3 md:flex-row md:items-center md:flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Js,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Date range"})]}),a.jsx(wu,{value:t,onChange:r,placeholder:"From"}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"→"}),a.jsx(wu,{value:n,onChange:s,placeholder:"To"})]}),a.jsx("div",{className:"hidden md:block w-px h-5 bg-border mx-1 shrink-0"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(xa,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Employees"})]}),m?a.jsx(oe,{className:"h-8 w-40"}):a.jsx(Op,{options:O,selected:i,onSelectionChange:o,placeholder:"All employees",className:"w-44"})]}),a.jsx("div",{className:"hidden md:block w-px h-5 bg-border mx-1 shrink-0"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Br,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Projects"})]}),x?a.jsx(oe,{className:"h-8 w-40"}):a.jsx(Op,{options:R,selected:l,onSelectionChange:c,placeholder:"All projects",className:"w-44"})]})]}),w?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(E=>a.jsxs("div",{className:"px-6 py-4 flex items-center gap-4",children:[a.jsx(oe,{className:"h-4 w-24"}),a.jsx(oe,{className:"h-4 w-32"}),a.jsx(oe,{className:"h-4 w-48"})]},E))}):b.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(na,{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:cl(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:_})]}),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:C})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[T.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(xa,{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,T.length*36),children:a.jsxs(bu,{data:T,layout:"vertical",margin:{left:0,right:40,top:0,bottom:0},children:[a.jsx(Rl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(zl,{type:"number",tickFormatter:E=>cl(E),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Ll,{type:"category",dataKey:"name",width:100,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(uu,{content:a.jsx(oj,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx($l,{dataKey:"minutes",fill:"#6366f1",radius:[0,4,4,0]})]})})]}),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(Br,{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,M.length*36),children:a.jsxs(bu,{data:M,layout:"vertical",margin:{left:0,right:40,top:0,bottom:0},children:[a.jsx(Rl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(zl,{type:"number",tickFormatter:E=>cl(E),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Ll,{type:"category",dataKey:"name",width:100,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(uu,{content:a.jsx(oj,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx($l,{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:b.map(E=>{var U;const A=E.project_id?j.get(E.project_id):void 0,P=((U=g==null?void 0:g.get(E.user_id))==null?void 0:U.name)??E.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:P}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:(A==null?void 0:A.name)??(E.project_id?"Unknown":"—")}),a.jsx("td",{className:"px-6 py-3",children:E.issue_identifier?a.jsx(Fr,{to:`/${u}/projects/${A==null?void 0:A.identifier}/issues/${E.issue_id}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline",children:E.issue_identifier}):a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[E.issue_id.slice(0,8),"…"]})}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground tabular-nums whitespace-nowrap",children:E.logged_date?me(new Date(E.logged_date),"MMM d, yyyy"):"—"}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground truncate max-w-xs",children:E.description??a.jsx("span",{className:"italic",children:"—"})}),a.jsx("td",{className:"px-6 py-3 text-xs text-right tabular-nums font-semibold",children:E.duration_minutes!=null?cl(E.duration_minutes):"Running…"})]},E.id)})})]})})]})]})}function Di(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function lj({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:Di(((n=t[0])==null?void 0:n.value)??0)})]})}function VQ(){const{projectKey:e,workspace:t}=Wt(),[r,n]=h.useState(void 0),[s,i]=h.useState(void 0),[o,l]=h.useState([]),{data:c}=Ia(e??""),{data:d}=yi(),{data:u=[]}=oc(),f=r?me(r,"yyyy-MM-dd"):void 0,m=s?me(s,"yyyy-MM-dd"):void 0,{data:p,isLoading:x}=oP({project_id:c==null?void 0:c.id,from:f,to:m}),g=(p==null?void 0:p.time_logs)??[],v=h.useMemo(()=>o.length>0?g.filter(_=>o.includes(_.user_id)):g,[g,o]),y=h.useMemo(()=>v.reduce((_,C)=>_+(C.duration_minutes??0),0),[v]),j=h.useMemo(()=>{const _=new Map;for(const C of v){_.has(C.user_id)||_.set(C.user_id,{logs:[],totalMinutes:0});const T=_.get(C.user_id);T.logs.push(C),T.totalMinutes+=C.duration_minutes??0}return _},[v]),N=h.useMemo(()=>{const _=new Map;for(const C of v){_.has(C.issue_id)||_.set(C.issue_id,{logs:[],totalMinutes:0});const T=_.get(C.issue_id);T.logs.push(C),T.totalMinutes+=C.duration_minutes??0}return _},[v]),w=Array.from(j.entries()).sort((_,C)=>C[1].totalMinutes-_[1].totalMinutes).slice(0,8).map(([_,{totalMinutes:C}])=>{var T;return{name:((T=d==null?void 0:d.get(_))==null?void 0:T.name)??"Unknown",minutes:C}}),k=Array.from(N.entries()).sort((_,C)=>C[1].totalMinutes-_[1].totalMinutes).slice(0,8).map(([_,{totalMinutes:C,logs:T}])=>{var M;return{name:((M=T[0])==null?void 0:M.issue_identifier)??_.slice(0,8),minutes:C}}),b=h.useMemo(()=>u.map(_=>({value:_.id,label:[_.first_name,_.last_name].filter(Boolean).join(" ")||_.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 flex-col gap-3 md:flex-row md:items-center md:flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Js,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Date range"})]}),a.jsx(wu,{value:r,onChange:n,placeholder:"From"}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"→"}),a.jsx(wu,{value:s,onChange:i,placeholder:"To"})]}),a.jsx("div",{className:"hidden md:block w-px h-4 bg-border"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(xa,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Employee"})]}),a.jsx(Op,{options:b,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?Di(y):"—",icon:na},{label:"Contributors",value:j.size>0?String(j.size):"—",icon:xa},{label:"Issues tracked",value:N.size>0?String(N.size):"—",icon:Xn}].map(({label:_,value:C,icon:T})=>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(T,{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:_})]}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:C})]},_))}),x?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(_=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(oe,{className:"h-7 w-7 rounded-full"}),a.jsx(oe,{className:"h-4 w-40"}),a.jsx("div",{className:"flex-1"}),a.jsx(oe,{className:"h-4 w-20"})]},_))})}):c!=null&&c.id?S?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 md: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(xa,{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,w.length*36),children:a.jsxs(bu,{data:w,layout:"vertical",margin:{left:0,right:32,top:0,bottom:0},children:[a.jsx(Rl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(zl,{type:"number",tickFormatter:_=>Di(_),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Ll,{type:"category",dataKey:"name",width:88,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(uu,{content:a.jsx(lj,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx($l,{dataKey:"minutes",fill:"#6366f1",radius:[0,4,4,0]})]})})]}),N.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(Xn,{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(bu,{data:k,layout:"vertical",margin:{left:0,right:32,top:0,bottom:0},children:[a.jsx(Rl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(zl,{type:"number",tickFormatter:_=>Di(_),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Ll,{type:"category",dataKey:"name",width:64,tick:{fontSize:11,fill:"hsl(var(--foreground))",fontFamily:"monospace"},axisLine:!1,tickLine:!1}),a.jsx(uu,{content:a.jsx(lj,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx($l,{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(xa,{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)=>C[1].totalMinutes-_[1].totalMinutes).map(([_,{logs:C,totalMinutes:T}])=>{const M=d==null?void 0:d.get(_),O=new Set(C.map(R=>R.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:(M==null?void 0:M.name)??_.slice(0,8)+"…"}),a.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:O}),a.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:Di(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 gap-2 px-6 py-3 border-b border-border",children:[a.jsx(Xn,{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(N.entries()).sort((_,C)=>C[1].totalMinutes-_[1].totalMinutes).map(([_,{logs:C,totalMinutes:T}])=>{var A,P;const M=new Set(C.map(U=>U.user_id)).size,O=C.reduce((U,Q)=>Q.logged_date&&(!U||new Date(Q.logged_date)>new Date(U))?Q.logged_date:U,null),R=(A=C[0])==null?void 0:A.issue_identifier,E=(P=C[0])==null?void 0:P.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:[R?a.jsx(Fr,{to:`/${t}/projects/${e}/issues/${_}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline shrink-0",children:R}):a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[_.slice(0,8),"…"]}),E&&a.jsx("span",{className:"text-xs text-muted-foreground truncate",children:E})]})}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:O?me(new Date(O),"MMM d, yyyy"):"—"}),a.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:M}),a.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:Di(T)})]},_)})})]})]})]}):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(fs,{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 XQ={share_enabled:{icon:ph,color:"text-green-600",bg:"bg-green-50 dark:bg-green-950/40",label:()=>"Enabled public link"},share_revoked:{icon:oD,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:()=>"Revoked public link"},member_added:{icon:co,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:z1,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:xa,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:L1,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:bD,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:Sr,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:ti,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40",label:()=>"Updated project"},created:{icon:dt,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40",label:()=>"Created project"}},QQ={icon:Mu,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800",label:()=>"Activity"};function ZQ({activity:e,userMap:t,teamMap:r}){const n=XQ[e.action]??QQ,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-start md:items-center gap-3 md:gap-4 px-4 md:px-6 py-4 hover:bg-muted/30 transition-colors",children:[a.jsx("div",{className:$("h-8 w-8 rounded-full flex items-center justify-center shrink-0",n.bg),children:a.jsx(s,{className:$("h-4 w-4",n.color)})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center gap-x-2 gap-y-0.5",children:[a.jsx(Ft,{className:"h-5 w-5 shrink-0",children:a.jsx(Bt,{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})]}),a.jsx("time",{className:"md:hidden text-[11px] text-muted-foreground/70 mt-1 block",children:me(new Date(e.created_at),"MMM d, yyyy · h:mm a")}),d&&a.jsx("div",{className:"mt-0.5 pl-7",children:d})]}),a.jsx("time",{className:"hidden md:block text-xs text-muted-foreground shrink-0",children:me(new Date(e.created_at),"MMM d, yyyy · h:mm a")})]})}function JQ(){const{projectKey:e}=Wt(),{workspace:t}=Ie(),{data:r}=Ia(e??""),{data:n,isLoading:s}=y5((r==null?void 0:r.id)??""),{data:i=new Map}=yi(),{data:o=[]}=Tu((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(oe,{className:"h-8 w-8 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(oe,{className:"h-4 w-48"}),a.jsx(oe,{className:"h-3 w-64"})]}),a.jsx(oe,{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(Mu,{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(ZQ,{activity:d,userMap:i,teamMap:l},d.id))})]})})}function lP(){return We({queryKey:["me"],queryFn:()=>re.get("/admin/users/me")})}function eZ(){const e=Ne(),{updateLocalUser:t}=Ie();return ge({mutationFn:r=>re.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 tZ(){const e=Ne(),{updateLocalUser:t}=Ie();return ge({mutationFn:r=>{const n=new FormData;return n.append("avatar",r),re.upload("/admin/users/me/avatar",n)},onSuccess:({user:r})=>{t({avatar_url:r.avatar_url}),e.invalidateQueries({queryKey:["me"]})}})}function rZ(){const e=Ne(),{updateLocalUser:t}=Ie();return ge({mutationFn:()=>re.delete("/admin/users/me/avatar"),onSuccess:()=>{t({avatar_url:null}),e.invalidateQueries({queryKey:["me"]})}})}function nZ(){return ge({mutationFn:()=>re.post("/admin/users/me/password/send-otp",{})})}function aZ(){const e=Ne();return ge({mutationFn:t=>re.post("/admin/users/me/password",t),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]})}})}function sZ(){const e=Ne();return ge({mutationFn:()=>re.delete("/admin/users/me/google"),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]})}})}const iZ=[{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"}],oZ={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function lZ({open:e,onClose:t,holiday:r}){const[n,s]=h.useState((r==null?void 0:r.name)??""),[i,o]=h.useState(r!=null&&r.date?r.date.split("T")[0]:""),[l,c]=h.useState((r==null?void 0:r.recurring)??!1);h.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=t4(),u=r4(),f=d.isPending||u.isPending,m=p=>{if(p.preventDefault(),!n.trim()){B.error("Holiday name is required");return}if(!i){B.error("Date is required");return}r?u.mutate({id:r.id,name:n.trim(),date:i,recurring:l},{onSuccess:()=>{B.success("Holiday updated"),t()},onError:()=>B.error("Failed to update holiday")}):d.mutate({name:n.trim(),date:i,recurring:l},{onSuccess:()=>{B.success("Holiday added"),t()},onError:()=>B.error("Failed to add holiday")})};return a.jsx(Ra,{open:e,onOpenChange:p=>!p&&t(),children:a.jsxs(sa,{className:"sm:max-w-md",children:[a.jsxs($a,{children:[a.jsx(za,{children:r?"Edit holiday":"Add holiday"}),a.jsx(mo,{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(Ae,{value:n,onChange:p=>s(p.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(Ae,{type:"date",value:i,onChange:p=>o(p.target.value),className:"h-9",required:!0})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(wo,{checked:l,onCheckedChange:p=>c(p)}),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(J,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(J,{type:"submit",size:"sm",disabled:f,children:f?r?"Saving…":"Adding…":r?"Save changes":"Add holiday"})]})]})]})})}function cZ(){const{data:e,isLoading:t}=px(),r=e4(),n=(e==null?void 0:e.working_days)??oZ,s=(i,o)=>{const l={...n,[i]:o};r.mutate({working_days:l},{onSuccess:()=>B.success("Working days updated"),onError:()=>B.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 min-h-[45px] flex items-center",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(oe,{className:"h-8 w-full"},i))}):iZ.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:$("text-xs font-medium",l?"text-foreground":"text-muted-foreground/60"),children:l?"Working day":"Not a working day"}),a.jsx(wo,{checked:l,onCheckedChange:c=>s(i,c),disabled:r.isPending})]},i)})]})}function dZ(){const[e,t]=h.useState(new Date().getFullYear()),[r,n]=h.useState(!1),[s,i]=h.useState(null),[o,l]=h.useState(null),{data:c=[],isLoading:d}=xx(e),u=n4(),f=()=>{o&&u.mutate(o.id,{onSuccess:()=>{B.success("Holiday removed"),l(null)},onError:()=>B.error("Failed to remove holiday")})},m=[...c].sort((p,x)=>{const g=new Date(p.date).getMonth()*100+new Date(p.date).getDate(),v=new Date(x.date).getMonth()*100+new Date(x.date).getDate();return g-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(J,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[a.jsx(dt,{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(p=>p-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(ms,{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(p=>p+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(kr,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"hidden md: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(p=>a.jsx(oe,{className:"h-8 w-full"},p))}):m.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-6 text-center",children:[a.jsx(k1,{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(J,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[a.jsx(dt,{className:"h-3.5 w-3.5"}),"Add holiday"]})]}):m.map(p=>{const x=new Date(p.date),g=a.jsxs(Wr,{children:[a.jsx(Ur,{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(ka,{className:"h-3.5 w-3.5"})})}),a.jsxs(Cr,{align:"end",className:"w-36",children:[a.jsxs(nt,{className:"gap-2 cursor-pointer",onClick:()=>{i(p),n(!0)},children:[a.jsx(ti,{className:"h-3.5 w-3.5"}),"Edit"]}),a.jsxs(nt,{className:"gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>l(p),children:[a.jsx(Sr,{className:"h-3.5 w-3.5"}),"Remove"]})]})]});return a.jsxs("div",{children:[a.jsxs("div",{className:"hidden md: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:me(x,"MMM d, yyyy")}),a.jsx("span",{className:"text-sm font-medium truncate",children:p.name}),a.jsx("span",{className:"text-sm",children:p.recurring?a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(Ui,{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:g})]}),a.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3 border-b border-border hover:bg-muted/20 transition-colors",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:p.name}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[a.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:me(x,"MMM d, yyyy")}),p.recurring&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(Ui,{className:"h-3 w-3"}),"Recurring"]})]})]}),g]})]},p.id)}),a.jsx(lZ,{open:r,onClose:()=>{n(!1),i(null)},holiday:s}),a.jsx(Gs,{open:!!o,onOpenChange:p=>!p&&l(null),children:a.jsxs(ns,{children:[a.jsxs(as,{children:[a.jsxs(is,{children:['Remove "',o==null?void 0:o.name,'"?']}),a.jsx(os,{children:"This holiday will no longer be excluded from business day calculations."})]}),a.jsxs(ss,{children:[a.jsx(cs,{children:"Cancel"}),a.jsx(ls,{onClick:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]})})]})}const cj=["super-admin","admin","member"],sh={"super-admin":"bg-purple-100 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300",admin:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/40 dark:text-indigo-300",member:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300"},dj={pending:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",accepted:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300",revoked:"bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400"};function uZ({value:e}){const[t,r]=h.useState(!1),n=()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)};return a.jsx("button",{onClick:n,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Copy",children:t?a.jsx(ir,{className:"h-3.5 w-3.5 text-emerald-500"}):a.jsx(Gp,{className:"h-3.5 w-3.5"})})}const ih={"super-admin":3,admin:2,moderator:1,member:0},Ps=20;function fZ(){const{data:e}=lP(),t=ih[(e==null?void 0:e.role)??"member"]??0,{data:r=[],isLoading:n}=oc(),{data:s=[],isLoading:i}=II(),{data:o=[]}=nf(),l=Wk(),c=LI(),d=FI(),u=BI(),f=RI(),m=$I(),p=zI(),[x,g]=h.useState(null),[v,y]=h.useState(null),[j,N]=h.useState(null),[w,k]=h.useState(!1),[b,S]=h.useState(""),[_,C]=h.useState("member"),[T,M]=h.useState(0),O=h.useMemo(()=>[...r].sort((A,P)=>{const U=`${A.first_name??""} ${A.last_name??""}`.trim()||A.email,Q=`${P.first_name??""} ${P.last_name??""}`.trim()||P.email;return U.localeCompare(Q)}),[r]),R=A=>{A.preventDefault(),b.trim()&&p.mutate({email:b.trim().toLowerCase(),role:_},{onSuccess:()=>{B.success(`Invitation sent to ${b.trim()}`),k(!1),S(""),C("member")},onError:P=>B.error((P==null?void 0:P.message)??"Failed to send invitation")})},E=()=>{x&&d.mutate(x,{onSuccess:()=>{B.success("User deactivated"),g(null)},onError:()=>B.error("Failed to deactivate user")})};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:"All users"}),a.jsxs(J,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>k(!0),children:[a.jsx(dt,{className:"h-3.5 w-3.5"}),"Invite member"]})]}),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:"View and manage all platform users. Change a user's custom role or remove them from the system."})}),a.jsx(Ra,{open:w,onOpenChange:A=>{A||(k(!1),S(""),C("member"))},children:a.jsxs(sa,{className:"sm:max-w-md",children:[a.jsx($a,{children:a.jsx(za,{children:"Invite member"})}),a.jsxs("form",{onSubmit:R,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:"Email"}),a.jsx(Ae,{type:"email",value:b,onChange:A=>S(A.target.value),placeholder:"name@example.com",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:"Role"}),a.jsxs(Be,{value:_,onValueChange:C,children:[a.jsx(ze,{className:"h-9 text-sm",children:a.jsx(Ye,{})}),a.jsx(Le,{children:cj.map(A=>a.jsx(ke,{value:A,className:"text-sm capitalize",children:A},A))})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"The user will receive an invite link to create their account. They won't be added to any workspace automatically — you can add them from workspace settings after they join."}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:()=>k(!1),children:"Cancel"}),a.jsx(J,{type:"submit",size:"sm",disabled:p.isPending,children:p.isPending?"Sending…":"Send invite"})]})]})]})}),a.jsxs("div",{className:"hidden md:grid grid-cols-[1fr_160px_200px_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:"User"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Global role"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Custom role"}),a.jsx("span",{})]}),n?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(A=>a.jsx(oe,{className:"h-10 w-full"},A))}):r.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[a.jsx(xa,{className:"h-8 w-8 text-muted-foreground/40 mb-3"}),a.jsx("p",{className:"text-sm font-medium",children:"No users found"})]}):a.jsxs(a.Fragment,{children:[O.slice(T*Ps,(T+1)*Ps).map(A=>{var D;const P=A.first_name??"",U=A.last_name??"",Q=`${P} ${U}`.trim()||A.email,K=(P[0]??U[0]??((D=A.email)==null?void 0:D[0])??"U").toUpperCase(),se=ih[A.role??"member"]??0,ae=A.id===(e==null?void 0:e.id),W=!ae&&se<t,Y=W?a.jsxs(Be,{value:A.role??"member",onValueChange:Z=>c.mutate({userId:A.id,role:Z},{onSuccess:()=>B.success("Global role updated"),onError:F=>B.error((F==null?void 0:F.message)??"Failed to update global role")}),children:[a.jsx(ze,{className:"h-7 text-xs w-full",children:a.jsx(Ye,{})}),a.jsx(Le,{children:cj.filter(Z=>(ih[Z]??0)<t).map(Z=>a.jsx(ke,{value:Z,className:"text-xs",children:a.jsx("span",{className:$("inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",sh[Z]),children:Z})},Z))})]}):a.jsx("span",{className:$("inline-flex items-center px-2 py-0.5 rounded text-xs font-medium",sh[A.role??"member"]??sh.member),children:A.role??"member"}),te=a.jsxs(Be,{value:A.app_role_id??"none",disabled:!W,onValueChange:Z=>l.mutate({userId:A.id,appRoleId:Z==="none"?null:Z},{onSuccess:()=>B.success("Custom role updated"),onError:()=>B.error("Failed to update custom role")}),children:[a.jsx(ze,{className:$("h-7 text-xs w-full",!W&&"opacity-60 cursor-not-allowed"),children:a.jsx(Ye,{placeholder:"No role"})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"none",className:"text-xs",children:"No role"}),o.map(Z=>a.jsx(ke,{value:Z.id,className:"text-xs",children:Z.name},Z.id))]})]}),X=A.is_active!==!1,I=W?a.jsxs(Wr,{children:[a.jsx(Ur,{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(ka,{className:"h-3.5 w-3.5"})})}),a.jsx(Cr,{align:"end",className:"w-40",children:X?a.jsxs(nt,{className:"gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>g(A.id),children:[a.jsx(L1,{className:"h-3.5 w-3.5"}),"Deactivate user"]}):a.jsxs(nt,{className:"gap-2 cursor-pointer",onClick:()=>{u.mutate(A.id,{onSuccess:()=>B.success("User reactivated"),onError:()=>B.error("Failed to reactivate user")})},children:[a.jsx(_D,{className:"h-3.5 w-3.5"}),"Reactivate user"]})})]}):null;return a.jsxs("div",{className:"border-b border-border hover:bg-muted/20 transition-colors group",children:[a.jsxs("div",{className:"hidden md:grid grid-cols-[1fr_160px_200px_40px] gap-4 items-center px-6 py-3",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-zinc-200 dark:bg-zinc-700 flex items-center justify-center text-xs font-semibold text-zinc-600 dark:text-zinc-300 shrink-0",children:K}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("p",{className:"text-sm font-medium truncate",children:[Q,ae&&a.jsx("span",{className:"text-xs text-muted-foreground ml-1.5",children:"(you)"}),!X&&a.jsx("span",{className:"ml-1.5 inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:"Deactivated"})]}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.email})]})]}),Y,te,a.jsx("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 transition-opacity",children:I})]}),a.jsxs("div",{className:"md:hidden px-4 py-3",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0 mb-2",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-zinc-200 dark:bg-zinc-700 flex items-center justify-center text-xs font-semibold text-zinc-600 dark:text-zinc-300 shrink-0",children:K}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("p",{className:"text-sm font-medium truncate",children:[Q,ae&&a.jsx("span",{className:"text-xs text-muted-foreground ml-1.5",children:"(you)"}),!X&&a.jsx("span",{className:"ml-1.5 inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:"Deactivated"})]}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.email})]}),I]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex-1",children:Y}),a.jsx("div",{className:"flex-1",children:te})]})]})]},A.id)}),O.length>Ps&&a.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:[T*Ps+1,"–",Math.min((T+1)*Ps,O.length)," of ",O.length]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>M(A=>A-1),disabled:T===0,children:a.jsx(ms,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[T+1," / ",Math.ceil(O.length/Ps)]}),a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>M(A=>A+1),disabled:(T+1)*Ps>=O.length,children:a.jsx(kr,{className:"h-3.5 w-3.5"})})]})]})]}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 mt-2",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Invitations"})}),i?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(A=>a.jsx(oe,{className:"h-8 w-full"},A))}):s.filter(A=>A.status==="pending").length===0?a.jsx("div",{className:"px-6 py-6 text-center",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"No pending invitations."})}):s.filter(A=>A.status==="pending").map(A=>{const P=`${window.location.origin}/invite/${A.token}`;return a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5 border-b border-border hover:bg-muted/20 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(Zl,{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:A.email??"Shareable link"}),a.jsx("span",{className:$("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium",A.role==="super-admin"?"bg-purple-50 text-purple-700 dark:bg-purple-950/30 dark:text-purple-300":A.role==="admin"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-300":"bg-muted text-muted-foreground"),children:A.role==="super-admin"?"Super Admin":A.role==="admin"?"Admin":"Member"}),A.workspace_name&&a.jsxs("span",{className:"text-[11px] text-muted-foreground truncate",children:["· ",A.workspace_name]})]}),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-[320px]",children:P}),a.jsx(uZ,{value:P})]})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[a.jsx("span",{className:$("inline-flex items-center px-2 py-0.5 rounded text-[11px] font-medium",dj[A.status]??dj.revoked),children:A.status}),a.jsx("span",{className:"text-xs text-muted-foreground hidden sm:block",children:me(new Date(A.created_at),"MMM d")}),A.status==="pending"&&A.email&&a.jsxs(Gn,{children:[a.jsx(Vn,{asChild:!0,children:a.jsx("button",{onClick:()=>N(A),disabled:m.isPending,className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground disabled:opacity-50",children:a.jsx(T1,{className:$("h-3.5 w-3.5",m.isPending&&"animate-spin")})})}),a.jsx(kn,{children:"Resend invite"})]}),A.status==="pending"&&a.jsx("button",{onClick:()=>y(A),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Revoke invitation",children:a.jsx(st,{className:"h-3.5 w-3.5"})})]})]},A.id)}),a.jsx(Gs,{open:!!x,onOpenChange:A=>!A&&g(null),children:a.jsxs(ns,{children:[a.jsxs(as,{children:[a.jsx(is,{children:"Deactivate this user?"}),a.jsx(os,{children:"The user will lose access immediately and be hidden from member lists. You can reactivate them later."})]}),a.jsxs(ss,{children:[a.jsx(cs,{children:"Cancel"}),a.jsx(ls,{onClick:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Deactivate"})]})]})}),a.jsx(Gs,{open:!!v,onOpenChange:A=>!A&&y(null),children:a.jsxs(ns,{children:[a.jsxs(as,{children:[a.jsx(is,{children:"Revoke this invitation?"}),a.jsxs(os,{children:["The invite link sent to ",a.jsx("span",{className:"font-medium",children:v==null?void 0:v.email})," will no longer work."]})]}),a.jsxs(ss,{children:[a.jsx(cs,{children:"Cancel"}),a.jsx(ls,{onClick:()=>{v&&f.mutate(v.id,{onSuccess:()=>{B.success("Invitation revoked"),y(null)},onError:()=>B.error("Failed to revoke invitation")})},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Revoke"})]})]})}),a.jsx(Gs,{open:!!j,onOpenChange:A=>!A&&N(null),children:a.jsxs(ns,{children:[a.jsxs(as,{children:[a.jsx(is,{children:"Resend invitation?"}),a.jsxs(os,{children:["A new invitation email will be sent to ",a.jsx("span",{className:"font-medium",children:j==null?void 0:j.email}),"."]})]}),a.jsxs(ss,{children:[a.jsx(cs,{children:"Cancel"}),a.jsx(ls,{onClick:()=>{j&&m.mutate(j.id,{onSuccess:()=>{B.success("Invitation resent"),N(null)},onError:()=>B.error("Failed to resend invitation")})},children:"Resend"})]})]})})]})}const mZ=["working-days","holidays","members"];function hZ(){const[e,t]=Ul(),r=e.get("tab"),n=r&&mZ.includes(r)?r:"working-days",s=o=>t({tab:o},{replace:!0}),i=[{id:"working-days",label:"Working Days"},{id:"holidays",label:"Holidays"},{id:"members",label:"Members"}];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(k1,{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:i.map(o=>a.jsx("button",{onClick:()=>s(o.id),className:$("px-1 py-3 mr-6 text-sm font-medium border-b-2 transition-colors",n===o.id?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:o.label},o.id))}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n==="working-days"&&a.jsx(cZ,{}),n==="holidays"&&a.jsx(dZ,{}),n==="members"&&a.jsx(fZ,{})]})]})})}const oh=e=>{let{transform:t}=e;return{...t,y:0}};function hv(){const[e,t]=h.useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0}),r=h.useRef(null);return h.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 pZ(e,t=500){const[r,n]=h.useState(e),s=h.useRef(null);return h.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 xZ(){const[e,t]=h.useState({x:null,y:null}),r=h.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 h.useLayoutEffect(()=>{const n=()=>{t({x:window.scrollX,y:window.scrollY})};return n(),window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}},[]),[e,r]}const Un={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function cP(e){return"init"in e}function Pp(e){return!!e.write}function uj(e){return"v"in e||"e"in e}function ju(e){if("e"in e)throw e.e;if((Un?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function Nu(e){return typeof(e==null?void 0:e.then)=="function"}function dP(e,t,r){if(!r.p.has(e)){r.p.add(e);const n=()=>r.p.delete(e);t.then(n,n)}}function uP(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 gZ=(e,t,...r)=>t.read(...r),vZ=(e,t,...r)=>t.write(...r),yZ=(e,t)=>{var r;return(r=t.INTERNAL_onInit)==null?void 0:r.call(t,e)},bZ=(e,t,r)=>{var n;return(n=t.onMount)==null?void 0:n.call(t,r)},wZ=(e,t)=>{var r;const n=Lt(e),s=n[0],i=n[6],o=n[9];if((Un?"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},jZ=e=>{const t=Lt(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 p;return(p=r.get(m))==null?void 0:p.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)},NZ=e=>{const t=Lt(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],p=i(e,m);if(u.has(m)){f.pop();continue}if(d.has(m)){if(n.get(m)===p.n)c.push([m,p]);else if((Un?"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 x of uP(m,p,r))d.has(x)||f.push(x)}for(let m=c.length-1;m>=0;--m){const[p,x]=c[m];let g=!1;for(const v of x.d.keys())if(v!==p&&s.has(v)){g=!0;break}g&&(o(e,p),l(e,p)),n.delete(p)}},Mp=new WeakSet,kZ=(e,t)=>{var r,n;const s=Lt(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],p=s[14],x=s[16],g=s[17],v=s[20],y=s[26],j=u(e,t);if(uj(j)){if(i.has(t)&&o.get(t)!==j.n)return j;let R=!1;for(const[E,A]of j.d)if(p(e,E).n!==A){R=!0;break}if(!R)return j}let N=!0;const w=new Set(j.d.keys()),k=new Map,b=()=>{for(const R of w)k.has(R)||j.d.delete(R)},S=()=>{if(i.has(t)){const R=!l.size;g(e,t),R&&(m(e),f(e))}},_=R=>{var E;if(R===t){const P=u(e,R);if(!uj(P))if(cP(R))v(e,R,R.init);else throw new Error("no atom init");return ju(P)}const A=p(e,R);try{return ju(A)}finally{k.set(R,A.n),j.d.set(R,A.n),Nu(j.v)&&dP(t,j.v,A),i.has(t)&&((E=i.get(R))==null||E.t.add(t)),N||S()}};let C,T;const M={get signal(){return C||(C=new AbortController),C.signal},get setSelf(){return(Un?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Un?"production":void 0)!=="production"&&!Pp(t)&&console.warn("setSelf function cannot be used with read-only atom"),!T&&Pp(t)&&(T=(...R)=>{if((Un?"production":void 0)!=="production"&&N&&console.warn("setSelf function cannot be called in sync"),!N)try{return x(e,t,...R)}finally{m(e),f(e)}}),T}},O=j.n;try{(Un?"production":void 0)!=="production"&&Mp.delete(e);const R=d(e,t,_,M);if((Un?"production":void 0)!=="production"&&Mp.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),v(e,t,R),Nu(R)){y(e,R,()=>C==null?void 0:C.abort());const E=()=>{b(),S()};R.then(E,E)}else b();return(r=c.r)==null||r.call(c,t),j}catch(R){return delete j.v,j.e=R,++j.n,j}finally{N=!1,O!==j.n&&o.get(t)===O&&(o.set(t,j.n),l.add(t),(n=c.c)==null||n.call(c,t))}},SZ=(e,t)=>{const r=Lt(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 uP(l,c,n)){const u=i(e,d);s.get(d)!==u.n&&(s.set(d,u.n),o.push(d))}}},CZ=(e,t,...r)=>{const n=Lt(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],p=n[17],x=n[20];let g=!0;const v=j=>ju(u(e,j)),y=(j,...N)=>{var w;const k=l(e,j);try{if(j===t){if(!cP(j))throw new Error("atom not writable");(Un?"production":void 0)!=="production"&&Mp.add(e);const b=k.n,S=N[0];x(e,j,S),p(e,j),b!==k.n&&(s.add(j),f(e,j),(w=i.c)==null||w.call(i,j));return}else return m(e,j,...N)}finally{g||(d(e),c(e))}};try{return o(e,t,v,y,...r)}finally{g=!1}},_Z=(e,t)=>{var r;const n=Lt(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[p,x]of f.d)if(!m.d.has(p)){const g=l(e,p);d(e,p).t.add(t),m.d.add(p),x!==g.n&&(i.add(p),c(e,p),(r=o.c)==null||r.call(o,p))}for(const p of m.d)if(!f.d.has(p)){m.d.delete(p);const x=u(e,p);x==null||x.t.delete(t)}}},OZ=(e,t)=>{var r;const n=Lt(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],p=n[18],x=c(e,t);let g=s.get(t);if(!g){f(e,t);for(const v of x.d.keys())p(e,v).t.add(t);if(g={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(t,g),Pp(t)){const v=()=>{let y=!0;const j=(...N)=>{try{return m(e,t,...N)}finally{y||(u(e),d(e))}};try{const N=l(e,t,j);N&&(g.u=()=>{y=!0;try{N()}finally{y=!1}})}finally{y=!1}};i.add(v)}(r=o.m)==null||r.call(o,t)}return g},PZ=(e,t)=>{var r,n;const s=Lt(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 p of f.t)if((r=i.get(p))!=null&&r.d.has(t)){m=!0;break}if(!m){f.u&&o.add(f.u),f=void 0,i.delete(t);for(const p of u.d.keys()){const x=d(e,p);x==null||x.t.delete(t)}(n=l.u)==null||n.call(l,t);return}return f},MZ=(e,t,r)=>{const n=Lt(e),s=n[11],i=n[27],o=s(e,t),l="v"in o,c=o.v;if(Nu(r))for(const d of o.d.keys())dP(t,r,s(e,d));o.v=r,delete o.e,(!l||!Object.is(c,o.v))&&(++o.n,Nu(c)&&i(e,c))},EZ=(e,t)=>{const r=Lt(e)[14];return ju(r(e,t))},AZ=(e,t,...r)=>{const n=Lt(e),s=n[12],i=n[13],o=n[16];try{return o(e,t,...r)}finally{i(e),s(e)}},DZ=(e,t,r)=>{const n=Lt(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)}},TZ=(e,t,r)=>{const s=Lt(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)},IZ=(e,t)=>{const s=Lt(e)[25].get(t);s==null||s.forEach(i=>i())},fP=new WeakMap,Lt=e=>{const t=fP.get(e);if((Un?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};function RZ(e){const t=Lt(e),r=t[24];return r?r(t):t}function $Z(...e){const t={get(n){const s=Lt(t)[21];return s(t,n)},set(n,...s){const i=Lt(t)[22];return i(t,n,...s)},sub(n,s){const i=Lt(t)[23];return i(t,n,s)}},r=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},gZ,vZ,yZ,bZ,wZ,jZ,NZ,kZ,SZ,CZ,_Z,OZ,PZ,MZ,EZ,AZ,DZ,void 0,new WeakMap,TZ,IZ].map((n,s)=>e[s]||n);return fP.set(t,Object.freeze(r)),t}const mP={};let zZ=0;function hP(e,t){const r=`atom${++zZ}`,n={toString(){return(mP?"production":void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof e=="function"?n.read=e:(n.init=e,n.read=LZ,n.write=FZ),n}function LZ(e){return e(this)}function FZ(e,t,r){return t(this,typeof r=="function"?r(e(this)):r)}function BZ(){return $Z()}let nl;function WZ(){return nl||(nl=BZ(),(mP?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=nl),globalThis.__JOTAI_DEFAULT_STORE__!==nl&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),nl}const UZ={},qZ=h.createContext(void 0);function pP(e){return h.useContext(qZ)||WZ()}const Ep=e=>typeof(e==null?void 0:e.then)=="function",Ap=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},HZ=z.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(Ap(e),e)}),lh=new WeakMap,fj=(e,t,r)=>{const s=RZ(e)[26];let i=lh.get(t);return i||(i=new Promise((o,l)=>{let c=t;const d=m=>p=>{c===m&&o(p)},u=m=>p=>{c===m&&l(p)},f=()=>{try{const m=r();Ep(m)?(lh.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)}),lh.set(t,i)),i};function KZ(e,t){const{delay:r,unstable_promiseStatus:n=!z.use}={},s=pP(),[[i,o,l],c]=h.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)),h.useEffect(()=>{const u=s.sub(e,()=>{if(n)try{const f=s.get(e);Ep(f)&&Ap(fj(s,f,()=>s.get(e)))}catch{}if(typeof r=="number"){setTimeout(c,r);return}c()});return c(),u},[s,e,r,n]),h.useDebugValue(d),Ep(d)){const u=fj(s,d,()=>s.get(e));return n&&Ap(u),HZ(u)}return d}function YZ(e,t){const r=pP();return h.useCallback((...s)=>{if((UZ?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return r.set(e,...s)},[r,e])}function xP(e,t){return[KZ(e),YZ(e)]}var gP="Expected a function",mj=NaN,GZ="[object Symbol]",VZ=/^\s+|\s+$/g,XZ=/^[-+]0x[0-9a-f]+$/i,QZ=/^0b[01]+$/i,ZZ=/^0o[0-7]+$/i,JZ=parseInt,eJ=typeof Ec=="object"&&Ec&&Ec.Object===Object&&Ec,tJ=typeof self=="object"&&self&&self.Object===Object&&self,rJ=eJ||tJ||Function("return this")(),nJ=Object.prototype,aJ=nJ.toString,sJ=Math.max,iJ=Math.min,ch=function(){return rJ.Date.now()};function oJ(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(gP);t=hj(t)||0,ku(r)&&(u=!!r.leading,f="maxWait"in r,i=f?sJ(hj(r.maxWait)||0,t):i,m="trailing"in r?!!r.trailing:m);function p(b){var S=n,_=s;return n=s=void 0,d=b,o=e.apply(_,S),o}function x(b){return d=b,l=setTimeout(y,t),u?p(b):o}function g(b){var S=b-c,_=b-d,C=t-S;return f?iJ(C,i-_):C}function v(b){var S=b-c,_=b-d;return c===void 0||S>=t||S<0||f&&_>=i}function y(){var b=ch();if(v(b))return j(b);l=setTimeout(y,g(b))}function j(b){return l=void 0,m&&n?p(b):(n=s=void 0,o)}function N(){l!==void 0&&clearTimeout(l),d=0,n=c=s=l=void 0}function w(){return l===void 0?o:j(ch())}function k(){var b=ch(),S=v(b);if(n=arguments,s=this,c=b,S){if(l===void 0)return x(c);if(f)return l=setTimeout(y,t),p(c)}return l===void 0&&(l=setTimeout(y,t)),o}return k.cancel=N,k.flush=w,k}function lJ(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(gP);return ku(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),oJ(e,t,{leading:n,maxWait:t,trailing:s})}function ku(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function cJ(e){return!!e&&typeof e=="object"}function dJ(e){return typeof e=="symbol"||cJ(e)&&aJ.call(e)==GZ}function hj(e){if(typeof e=="number")return e;if(dJ(e))return mj;if(ku(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ku(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(VZ,"");var r=QZ.test(e);return r||ZZ.test(e)?JZ(e.slice(2),r?2:8):XZ.test(e)?mj:+e}var uJ=lJ;const fJ=Ta(uJ),vP=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:$("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));vP.displayName="Card";const mJ=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:$("flex flex-col space-y-1.5 p-6",e),...t}));mJ.displayName="CardHeader";const hJ=h.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:$("text-2xl font-semibold leading-none tracking-tight",e),...t}));hJ.displayName="CardTitle";const pJ=h.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:$("text-sm text-muted-foreground",e),...t}));pJ.displayName="CardDescription";const xJ=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:$("p-6 pt-0",e),...t}));xJ.displayName="CardContent";const gJ=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:$("flex items-center p-6 pt-0",e),...t}));gJ.displayName="CardFooter";function vJ(e,t=[]){let r=[];function n(i,o){const l=h.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:p,...x}=f,g=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>x,Object.values(x));return a.jsx(g.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;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=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,yJ(s,...t)]}function yJ(...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 h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function bJ(e){const t=wJ(e),r=h.forwardRef((n,s)=>{const{children:i,...o}=n,l=h.Children.toArray(i),c=l.find(NJ);if(c){const d=c.props.children,u=l.map(f=>f===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...o,ref:s,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return a.jsx(t,{...o,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function wJ(e){const t=h.forwardRef((r,n)=>{const{children:s,...i}=r;if(h.isValidElement(s)){const o=SJ(s),l=kJ(i,s.props);return s.type!==h.Fragment&&(l.ref=n?Hj(n,o):o),h.cloneElement(s,l)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jJ=Symbol("radix.slottable");function NJ(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jJ}function kJ(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 SJ(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 CJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_J=CJ.reduce((e,t)=>{const r=bJ(`Primitive.${t}`),n=h.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}},{}),pv="ContextMenu",[OJ]=vJ(pv,[Vj]),Er=Vj(),[PJ,yP]=OJ(pv),bP=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:s,modal:i=!0}=e,[o,l]=h.useState(!1),c=Er(t),d=VM(n),u=h.useCallback(f=>{l(f),d(f)},[d]);return a.jsx(PJ,{scope:t,open:o,onOpenChange:u,modal:i,children:a.jsx(XM,{...c,dir:s,open:o,onOpenChange:u,modal:i,children:r})})};bP.displayName=pv;var wP="ContextMenuTrigger",jP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...s}=e,i=yP(wP,r),o=Er(r),l=h.useRef({x:0,y:0}),c=h.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=h.useRef(0),u=h.useCallback(()=>window.clearTimeout(d.current),[]),f=m=>{l.current={x:m.clientX,y:m.clientY},i.onOpenChange(!0)};return h.useEffect(()=>u,[u]),h.useEffect(()=>void(n&&u()),[n,u]),a.jsxs(a.Fragment,{children:[a.jsx(QM,{...o,virtualRef:c}),a.jsx(_J.span,{"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:Rs(e.onContextMenu,m=>{u(),f(m),m.preventDefault()}),onPointerDown:n?e.onPointerDown:Rs(e.onPointerDown,od(m=>{u(),d.current=window.setTimeout(()=>f(m),700)})),onPointerMove:n?e.onPointerMove:Rs(e.onPointerMove,od(u)),onPointerCancel:n?e.onPointerCancel:Rs(e.onPointerCancel,od(u)),onPointerUp:n?e.onPointerUp:Rs(e.onPointerUp,od(u))})]})});jP.displayName=wP;var MJ="ContextMenuPortal",NP=e=>{const{__scopeContextMenu:t,...r}=e,n=Er(t);return a.jsx(BM,{...n,...r})};NP.displayName=MJ;var kP="ContextMenuContent",SP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=yP(kP,r),i=Er(r),o=h.useRef(!1);return a.jsx(WM,{...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)"}})});SP.displayName=kP;var EJ="ContextMenuGroup",AJ=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Er(r);return a.jsx(ZM,{...s,...n,ref:t})});AJ.displayName=EJ;var DJ="ContextMenuLabel",CP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Er(r);return a.jsx(YM,{...s,...n,ref:t})});CP.displayName=DJ;var TJ="ContextMenuItem",_P=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Er(r);return a.jsx(UM,{...s,...n,ref:t})});_P.displayName=TJ;var IJ="ContextMenuCheckboxItem",OP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Er(r);return a.jsx(qM,{...s,...n,ref:t})});OP.displayName=IJ;var RJ="ContextMenuRadioGroup",$J=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Er(r);return a.jsx(JM,{...s,...n,ref:t})});$J.displayName=RJ;var zJ="ContextMenuRadioItem",PP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Er(r);return a.jsx(KM,{...s,...n,ref:t})});PP.displayName=zJ;var LJ="ContextMenuItemIndicator",MP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Er(r);return a.jsx(HM,{...s,...n,ref:t})});MP.displayName=LJ;var FJ="ContextMenuSeparator",EP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Er(r);return a.jsx(GM,{...s,...n,ref:t})});EP.displayName=FJ;var BJ="ContextMenuArrow",WJ=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Er(r);return a.jsx(eE,{...s,...n,ref:t})});WJ.displayName=BJ;var UJ="ContextMenuSubTrigger",AP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Er(r);return a.jsx(LM,{...s,...n,ref:t})});AP.displayName=UJ;var qJ="ContextMenuSubContent",DP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Er(r);return a.jsx(FM,{...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)"}})});DP.displayName=qJ;function od(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var HJ=bP,KJ=jP,YJ=NP,TP=SP,IP=CP,RP=_P,$P=OP,zP=PP,LP=MP,FP=EP,BP=AP,WP=DP;const GJ=HJ,VJ=KJ,XJ=h.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(BP,{ref:s,className:$("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(kr,{className:"ml-auto h-4 w-4"})]}));XJ.displayName=BP.displayName;const QJ=h.forwardRef(({className:e,...t},r)=>a.jsx(WP,{ref:r,className:$("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}));QJ.displayName=WP.displayName;const UP=h.forwardRef(({className:e,...t},r)=>a.jsx(YJ,{children:a.jsx(TP,{ref:r,className:$("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})}));UP.displayName=TP.displayName;const qP=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(RP,{ref:n,className:$("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}));qP.displayName=RP.displayName;const ZJ=h.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs($P,{ref:s,className:$("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(LP,{children:a.jsx(ir,{className:"h-4 w-4"})})}),t]}));ZJ.displayName=$P.displayName;const JJ=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(zP,{ref:n,className:$("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(LP,{children:a.jsx(ln,{className:"h-2 w-2 fill-current"})})}),t]}));JJ.displayName=zP.displayName;const eee=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(IP,{ref:n,className:$("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r}));eee.displayName=IP.displayName;const tee=h.forwardRef(({className:e,...t},r)=>a.jsx(FP,{ref:r,className:$("-mx-1 my-1 h-px bg-border",e),...t}));tee.displayName=FP.displayName;const ree=hP(!1),nee=hP(0),xv=()=>xP(ree),gv=()=>xP(nee),aee=e=>{let t=r=>1;return(e==="monthly"||e==="quarterly")&&(t=ps),t},Mc=e=>{let t=kN;return(e==="monthly"||e==="quarterly")&&(t=_N),t},vv=e=>{let t=x3;return(e==="monthly"||e==="quarterly")&&(t=kN),t},Fl=e=>{let t=Hi;return(e==="monthly"||e==="quarterly")&&(t=PN),t},see=e=>{let t=CN;return(e==="monthly"||e==="quarterly")&&(t=ux),t},HP=e=>{let t=Lr;return(e==="monthly"||e==="quarterly")&&(t=lx),t},dl=(e,t)=>{const r=new Date(e.timelineData[0].year,0,1),n=e.columnWidth*e.zoom/100,s=Math.floor(t/n),i=aee(e.range),l=HP(e.range)(r,s),c=i(l),d=Math.round(n/c),u=Math.floor(t%n/d);return Lr(l,u)},iee=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:ps(new Date(r.year,l,1))}})}));return t},KP=(e,t,r)=>{const n=r.columnWidth*r.zoom/100,s=Mc(r.range),i=Fl(r.range),o=s(i(e),t);if(r.range==="daily")return n*o;const l=e.getDate(),c=ps(e),d=n/c;return o*n+l*d},oee=(e,t,r)=>{const n=r.columnWidth*r.zoom/100;if(!t)return n*2;const s=Mc(r.range);if(r.range==="daily"){const x=s(t,e);return n*(x||1)}const i=ps(e),o=n/i;if(Ki(e,t))return o;const l=vv(r.range),c=Fl(r.range);if(Ki(c(e),c(t)))return l(t,e)*o;const d=i-fl(e),u=fl(t),f=s(c(t),c(e)),m=ps(t),p=n/m;return(f-1)*n+d*o+u*p},YP=(e,t,r)=>{const n=Fl(t),s=see(t),i=vv(t),o=n(e),l=s(e),c=i(l,o);return e.getDate()/c*r},An=h.createContext({zoom:100,range:"monthly",columnWidth:50,headerHeight:60,sidebarWidth:300,rowHeight:36,onAddItem:void 0,placeholderLength:2,timelineData:[],ref:null,scrollToFeature:void 0}),yv=({title:e,columns:t,renderHeaderItem:r})=>{const n=h.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}`))})]})},lee=()=>h.useContext(An).timelineData.map(t=>t.quarters.flatMap(r=>r.months).map((r,n)=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(yv,{columns:r.days,renderHeaderItem:s=>a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx("p",{children:me(Lr(new Date(t.year,n,1),s),"d")}),a.jsx("p",{className:"text-muted-foreground",children:me(Lr(new Date(t.year,n,1),s),"EEEEE")})]}),title:me(new Date(t.year,n,1),"MMMM yyyy")}),a.jsx(bv,{columns:r.days,isColumnSecondary:s=>[0,6].includes(Lr(new Date(t.year,n,1),s).getDay())})]},`${t.year}-${n}`))),cee=()=>h.useContext(An).timelineData.map(t=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(yv,{columns:t.quarters.flatMap(r=>r.months).length,renderHeaderItem:r=>a.jsx("p",{children:me(new Date(t.year,r,1),"MMM")}),title:`${t.year}`}),a.jsx(bv,{columns:t.quarters.flatMap(r=>r.months).length})]},t.year)),dee=()=>h.useContext(An).timelineData.map(t=>t.quarters.map((r,n)=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(yv,{columns:r.months.length,renderHeaderItem:s=>a.jsx("p",{children:me(new Date(t.year,n*3+s,1),"MMM")}),title:`Q${n+1} ${t.year}`}),a.jsx(bv,{columns:r.months.length})]},`${t.year}-${n}`))),uee={daily:lee,monthly:cee,quarterly:dee},fee=({className:e})=>{const t=h.useContext(An),r=uee[t.range];return a.jsx("div",{className:$("-space-x-px flex h-full w-max divide-x divide-border/50",e),children:a.jsx(r,{})})},dh=({feature:e,onSelectItem:t,className:r,duration:n})=>{const s=h.useContext(An),i=e.endAt&&Ki(e.startAt,e.endAt)?Lr(e.endAt,1):e.endAt,o=n??(i?wh(e.startAt,i):`${wh(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:$("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)},mee=()=>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"})]}),uh=({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})]}),hee=({children:e,className:t})=>a.jsxs("div",{className:$("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(mee,{}),a.jsx("div",{className:"space-y-4",children:e})]}),pee=({top:e,className:t})=>{const[r]=gv(),n=h.useContext(An),[s,i]=hv(),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=dl(n,c);(m=n.onAddItem)==null||m.call(n,d)};return a.jsx("div",{className:$("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(dt,{className:"pointer-events-none select-none text-muted-foreground",size:16})})})},xee=({index:e,isColumnSecondary:t})=>{var m;const r=h.useContext(An),[n]=xv(),[s,i]=hv(),[o,l]=h.useState(!1),[c]=xZ(),d=()=>l(!0),u=()=>l(!1),f=pZ(s.y-(((m=i.current)==null?void 0:m.getBoundingClientRect().y)??0)-(c.y??0),10);return a.jsx("div",{className:$("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(pee,{top:f}):null})},bv=({columns:e,isColumnSecondary:t})=>{const r=h.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(xee,{index:s,isColumnSecondary:t},`${r}-${s}`))})},pj=({direction:e,featureId:t,date:r})=>{const[,n]=xv(),{attributes:s,listeners:i,setNodeRef:o}=Jj({id:`feature-drag-helper-${t}`}),l=!!s["aria-pressed"];return h.useEffect(()=>n(l),[l,n]),a.jsxs("div",{className:$("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:$("-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:$("-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:me(r,"MMM dd, yyyy")})]})},gee=({id:e,children:t})=>{const[,r]=xv(),{attributes:n,listeners:s,setNodeRef:i}=Jj({id:e}),o=!!n["aria-pressed"];return h.useEffect(()=>r(o),[o,r]),a.jsx(vP,{className:"h-full w-full rounded-md bg-background p-2 text-xs shadow-sm",children:a.jsx("div",{className:$("flex h-full w-full items-center justify-between gap-2 text-left",o&&"cursor-grabbing"),...n,...s,ref:i,children:t})})},xj=({onMove:e,children:t,className:r,...n})=>{const[s]=gv(),i=h.useContext(An),o=h.useMemo(()=>{var M;return new Date(((M=i.timelineData.at(0))==null?void 0:M.year)??0,0,1)},[i.timelineData]),[l,c]=h.useState(n.startAt),[d,u]=h.useState(n.endAt),f=h.useMemo(()=>oee(l,d,i),[l,d,i]),m=h.useMemo(()=>KP(l,o,i),[l,o,i]),p=h.useMemo(()=>HP(i.range),[i.range]),[x]=hv(),[g,v]=h.useState(0),[y,j]=h.useState(l),[N,w]=h.useState(d),k=$p(iE,{activationConstraint:{distance:10}}),b=h.useCallback(()=>{v(x.x),j(l),w(d)},[x.x,l,d]),S=h.useCallback(()=>{const M=dl(i,x.x),O=dl(i,g),R=i.range==="daily"?Mc(i.range)(M,O):vv(i.range)(M,O),E=Lr(y,R),A=N?Lr(N,R):null;c(E),u(A)},[i,x.x,g,y,N]),_=h.useCallback(()=>e==null?void 0:e(n.id,l,d),[e,n.id,l,d]),C=h.useCallback(()=>{var A,P;const M=(P=(A=i.ref)==null?void 0:A.current)==null?void 0:P.getBoundingClientRect(),O=x.x-((M==null?void 0:M.left)??0)+s-i.sidebarWidth,E=Fl(i.range)(dl(i,O));c(E)},[i,x.x,s]),T=h.useCallback(()=>{var A,P;const M=(P=(A=i.ref)==null?void 0:A.current)==null?void 0:P.getBoundingClientRect(),O=x.x-((M==null?void 0:M.left)??0)+s-i.sidebarWidth,E=Fl(i.range)(dl(i,O));u(E)},[i,x.x,s]);return a.jsx("div",{className:$("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(ul,{modifiers:[oh],onDragEnd:_,onDragMove:C,sensors:[k],children:a.jsx(pj,{date:l,direction:"left",featureId:n.id})}),a.jsx(ul,{modifiers:[oh],onDragEnd:_,onDragMove:S,onDragStart:b,sensors:[k],children:a.jsx(gee,{id:n.id,children:t??a.jsx("p",{className:"flex-1 truncate text-xs",children:n.name})})}),e&&a.jsx(ul,{modifiers:[oh],onDragEnd:_,onDragMove:T,sensors:[k],children:a.jsx(pj,{date:d?TN(d,1):p(l,1),direction:"right",featureId:n.id})})]})})},fh=({children:e,className:t})=>a.jsx("div",{className:t,style:{paddingTop:"var(--gantt-row-height)"},children:e}),vee=({className:e,children:t})=>a.jsx("div",{className:$("absolute top-0 left-0 h-full w-max space-y-4",e),style:{marginTop:"var(--gantt-header-height)"},children:t}),GP=h.memo(({label:e,date:t,id:r,onRemove:n,className:s})=>{const i=h.useContext(An),o=h.useMemo(()=>Mc(i.range),[i.range]),l=h.useMemo(()=>{var f;return new Date(((f=i.timelineData.at(0))==null?void 0:f.year)??0,0,1)},[i.timelineData]),c=h.useMemo(()=>o(t,l),[o,t,l]),d=h.useMemo(()=>YP(t,i.range,i.columnWidth*i.zoom/100),[t,i.range,i.columnWidth,i.zoom]),u=h.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(GJ,{children:[a.jsx(VJ,{asChild:!0,children:a.jsxs("div",{className:$("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:me(t,"MMM dd, yyyy")})]})}),a.jsx(UP,{children:n?a.jsxs(qP,{className:"flex items-center gap-2 text-destructive",onClick:u,children:[a.jsx(ND,{size:16}),"Remove marker"]}):null})]}),a.jsx("div",{className:$("h-full w-px bg-card",s)})]})});GP.displayName="GanttMarker";const yee=({zoom:e=100,range:t="monthly",onAddItem:r,children:n,className:s})=>{const i=h.useRef(null),[o,l]=h.useState(iee(new Date)),[,c]=gv(),[d,u]=h.useState(0),f=60,m=36;let p=50;t==="monthly"?p=150:t==="quarterly"&&(p=100);const x=h.useMemo(()=>({"--gantt-zoom":`${e}`,"--gantt-column-width":`${e/100*p}px`,"--gantt-header-height":`${f}px`,"--gantt-row-height":`${m}px`,"--gantt-sidebar-width":`${d}px`}),[e,p,d]);h.useEffect(()=>{i.current&&(i.current.scrollLeft=i.current.scrollWidth/2-i.current.clientWidth/2,c(i.current.scrollLeft))},[c]),h.useEffect(()=>{const y=()=>{var k;const w=((k=i.current)==null?void 0:k.querySelector('[data-roadmap-ui="gantt-sidebar"]'))?300:0;u(w)};y();const j=new MutationObserver(y);return i.current&&j.observe(i.current,{childList:!0,subtree:!0}),()=>{j.disconnect()}},[]);const g=h.useCallback(fJ(()=>{var k,b;const y=i.current;if(!y)return;const{scrollLeft:j,scrollWidth:N,clientWidth:w}=y;if(c(j),j===0){const S=(k=o[0])==null?void 0:k.year;if(!S)return;const _=[...o];_.unshift({year:S-1,quarters:new Array(4).fill(null).map((C,T)=>({months:new Array(3).fill(null).map((M,O)=>{const R=T*3+O;return{days:ps(new Date(S,R,1))}})}))}),l(_),y.scrollLeft=y.clientWidth,c(y.scrollLeft)}else if(j+w>=N){const S=(b=o.at(-1))==null?void 0:b.year;if(!S)return;const _=[...o];_.push({year:S+1,quarters:new Array(4).fill(null).map((C,T)=>({months:new Array(3).fill(null).map((M,O)=>{const R=T*3+O;return{days:ps(new Date(S,R,1))}})}))}),l(_),y.scrollLeft=y.scrollWidth-y.clientWidth,c(y.scrollLeft)}},100),[]);h.useEffect(()=>{const y=i.current;return y&&y.addEventListener("scroll",g),()=>{y&&y.removeEventListener("scroll",g)}},[g]);const v=h.useCallback(y=>{const j=i.current;if(!j)return;const N=new Date(o[0].year,0,1),w=KP(y.startAt,N,{zoom:e,range:t,columnWidth:p}),k=Math.max(0,w);j.scrollTo({left:k,behavior:"smooth"})},[o,e,t,p,d,r]);return a.jsx(An.Provider,{value:{zoom:e,range:t,headerHeight:f,columnWidth:p,sidebarWidth:d,rowHeight:m,onAddItem:r,timelineData:o,placeholderLength:2,ref:i,scrollToFeature:v},children:a.jsx("div",{className:$("gantt relative isolate grid h-full w-full flex-none select-none overflow-auto rounded-sm bg-secondary",t,s),ref:i,style:{...x,gridTemplateColumns:"var(--gantt-sidebar-width) 1fr"},children:n})})},bee=({children:e,className:t})=>a.jsx("div",{className:$("relative flex h-full w-max flex-none overflow-clip",t),children:e}),wee=({className:e})=>{const t="Today",r=h.useMemo(()=>new Date,[]),n=h.useContext(An),s=h.useMemo(()=>Mc(n.range),[n.range]),i=h.useMemo(()=>{var c;return new Date(((c=n.timelineData.at(0))==null?void 0:c.year)??0,0,1)},[n.timelineData]),o=h.useMemo(()=>s(r,i),[s,r,i]),l=h.useMemo(()=>YP(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:$("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:me(r,"MMM dd, yyyy")})]}),a.jsx("div",{className:$("h-full w-px bg-card",e)})]})};function jee(e){return We({queryKey:["public","share",e],queryFn:()=>re.get(`/public/share/${e}`),select:t=>t.project,enabled:!!e,retry:!1})}function wv(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 We({queryKey:["public","share",e,"issues",t],queryFn:()=>re.get(`/public/share/${e}/issues${n}`),select:s=>s.issues,enabled:!!e,retry:!1})}function VP(e){return We({queryKey:["public","share",e,"sprints"],queryFn:()=>re.get(`/public/share/${e}/sprints`),select:t=>t.sprints,enabled:!!e,retry:!1})}function Nee({priority:e,className:t}){const r=$("h-3.5 w-3.5 shrink-0",hx[e],t);switch(e){case"urgent":return a.jsx(ys,{className:r});case"high":return a.jsx(Xl,{className:r});case"medium":return a.jsx(xi,{className:r});case"low":return a.jsx(Gl,{className:r});default:return a.jsx(ln,{className:$("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}}const Dp="grid-cols-[70px_250px_150px_120px_130px_140px_130px]";function XP({issue:e,statuses:t,statusLabels:r,statusColorMap:n,sprints:s,isChild:i=!1,children:o=[],childrenMap:l}){const[c,d]=h.useState(!1),u=o.length>0,f=n[e.status]??"#94a3b8",m=s.find(p=>p.id===e.sprint_id);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:$(`group grid ${Dp} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors",i&&"bg-muted/10"),children:[a.jsx("span",{className:$("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:$("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(Gn,{children:[a.jsx(Vn,{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(ra,{className:"h-3.5 w-3.5"}):a.jsx(kr,{className:"h-3.5 w-3.5"})})}),a.jsx(kn,{side:"top",children:c?"Collapse":"Expand"})]}):i?a.jsx(Sn,{className:"h-3 w-3 text-muted-foreground/40 shrink-0"}):a.jsx("span",{className:"w-4 shrink-0"}),a.jsx("span",{className:$("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(Sn,{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(Nee,{priority:e.priority}),a.jsx("span",{className:"text-xs text-muted-foreground",children:On[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(Br,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),a.jsx("span",{className:$("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(mr,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),a.jsx("span",{className:$("text-xs",e.due_date?"text-foreground":"text-muted-foreground/50"),children:e.due_date?me(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(p=>a.jsx("div",{title:p.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:p.initials},p.id))})})]}),c&&o.map(p=>a.jsx(XP,{issue:p,statuses:t,statusLabels:r,statusColorMap:n,sprints:s,isChild:!0,children:(l==null?void 0:l[p.id])??[],childrenMap:l},p.id))]})}function kee({issues:e,childrenMap:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,totalCount:o}){const[l,c]=h.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(kr,{className:"h-3.5 w-3.5"}):a.jsx(ra,{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(XP,{issue:d,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,children:t[d.id]??[],childrenMap:t},d.id))})]})}function See({token:e,statuses:t}){const[r,n]=h.useState("all"),[s,i]=h.useState("all"),[o,l]=h.useState("all"),[c,d]=h.useState(""),{data:u=[],isLoading:f}=wv(e),{data:m=[]}=VP(e),p=Object.fromEntries(t.map(N=>[N.key,N.name])),x=Object.fromEntries(t.map(N=>[N.key,N.color])),g={};for(const N of u)N.parent_id&&(g[N.parent_id]||(g[N.parent_id]=[]),g[N.parent_id].push(N));const v=u.filter(N=>!N.parent_id).filter(N=>{const w=c.toLowerCase(),k=!c||N.title.toLowerCase().includes(w)||N.identifier.toLowerCase().includes(w),b=r==="all"||N.status===r,S=s==="all"||N.priority===s,_=o==="all"?!0:o==="none"?!N.sprint_id:N.sprint_id===o;return k&&b&&S&&_}).sort((N,w)=>{const k=parseInt(N.identifier.split("-")[1]??"0",10),b=parseInt(w.identifier.split("-")[1]??"0",10);return k-b}),y=v.reduce((N,w)=>{var k;return N+(((k=g[w.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(Be,{value:o,onValueChange:l,children:[a.jsx(ze,{className:"h-8 text-xs w-[140px] bg-transparent",children:a.jsx(Ye,{placeholder:"Sprint"})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All sprints"}),a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),m.map(N=>a.jsx(ke,{value:N.id,className:"text-xs",children:N.name},N.id))]})]}),a.jsxs(Be,{value:r,onValueChange:n,children:[a.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Ye,{placeholder:"Status"})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All statuses"}),t.map(({key:N,name:w})=>a.jsx(ke,{value:N,className:"text-xs",children:w},N))]})]}),a.jsxs(Be,{value:s,onValueChange:i,children:[a.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Ye,{placeholder:"Priority"})}),a.jsxs(Le,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(On).map(([N,w])=>a.jsx(ke,{value:N,className:"text-xs",children:w},N))]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx(lo,{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(Ae,{placeholder:"Search...",value:c,onChange:N=>d(N.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:$("grid items-center py-2.5 border-b border-border",Dp),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(N=>a.jsxs("div",{className:$("grid items-center px-6 py-3 gap-4",Dp),children:[a.jsx(oe,{className:"h-4 w-14"}),a.jsx(oe,{className:"h-4 w-56"}),a.jsx(oe,{className:"h-5 w-20"}),a.jsx(oe,{className:"h-4 w-16"}),a.jsx(oe,{className:"h-4 w-20"}),a.jsx(oe,{className:"h-4 w-24"}),a.jsx(oe,{className:"h-6 w-16"})]},N))}):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(kee,{issues:v,childrenMap:g,statuses:t,statusLabels:p,statusColorMap:x,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 ld(e,t){const r=e.start_date?new Date(e.start_date):new Date(e.due_date),n=e.due_date?Lr(new Date(e.due_date),1):Lr(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 Cee({token:e,statuses:t}){const[r,n]=h.useState("monthly"),s=h.useRef(null),{data:i=[]}=wv(e),{data:o=[]}=VP(e);h.useEffect(()=>{const m=requestAnimationFrame(()=>{var j;const p=(j=s.current)==null?void 0:j.querySelector(".gantt");if(!p)return;const x=new Date,g=x.getFullYear()-1,v=300;let y;if(r==="daily")y=Math.floor((x.getTime()-new Date(g,0,1).getTime())/864e5)*50;else{const N=r==="monthly"?150:100,w=(x.getFullYear()-g)*12+x.getMonth(),k=new Date(x.getFullYear(),x.getMonth()+1,0).getDate();y=w*N+(x.getDate()-1)/k*N}p.scrollLeft=Math.max(0,y-(p.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(yee,{range:r,zoom:100,className:"h-full bg-white dark:bg-zinc-950",children:[a.jsxs(hee,{children:[o.map(m=>{const p=u[m.id]??[];return a.jsx(uh,{name:m.name,children:p.map(x=>a.jsx(dh,{feature:ld(x,l[x.status]??"#94a3b8")},x.id))},m.id)}),f.length>0&&a.jsx(uh,{name:"No Sprint",children:f.map(m=>a.jsx(dh,{feature:ld(m,l[m.status]??"#94a3b8")},m.id))}),d.length>0&&a.jsx(uh,{name:"Unscheduled",children:d.map(m=>a.jsx(dh,{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(bee,{children:[a.jsx(fee,{}),a.jsxs(vee,{children:[o.map(m=>a.jsx(fh,{children:(u[m.id]??[]).map(p=>a.jsx("div",{className:"flex",children:a.jsx(xj,{...ld(p,l[p.status]??"#94a3b8")})},p.id))},m.id)),f.length>0&&a.jsx(fh,{children:f.map(m=>a.jsx("div",{className:"flex",children:a.jsx(xj,{...ld(m,l[m.status]??"#94a3b8")})},m.id))}),d.length>0&&a.jsx(fh,{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(GP,{id:m.id,date:new Date(m.end_date),label:`${m.name} end`},m.id)),a.jsx(wee,{})]})]})})]})}function _ee(){const{token:e}=Wt(),[t,r]=h.useState("board"),{data:n,isLoading:s,isError:i}=jee(e??""),{data:o}=wv(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(RN,{issues:o??[],projectId:n.id,statuses:n.statuses,readOnly:!0}),t==="issues"&&a.jsx(See,{token:e,statuses:n.statuses}),t==="timeline"&&a.jsx(Cee,{token:e,statuses:n.statuses})]})]})}const Oee=new URLSearchParams(window.location.search);function Pee(){const[e,t]=h.useState(null),r=jt(),n=Ie(),s=h.useRef(!1);if(h.useEffect(()=>{if(s.current)return;s.current=!0;const i=Oee;if(history.replaceState(null,"",window.location.pathname),i.get("linked")==="true"){r("/profile?linked=true",{replace:!0});return}const l=i.get("error");if(l){t(decodeURIComponent(l));return}const c=i.get("code");if(!c){t("No authorization code received from Google sign-in");return}(async()=>{const u=await fetch(`${Wi}/auth/google/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:c})});if(!u.ok)throw new Error(`Code exchange failed (${u.status}). Please try signing in again.`);const{token:f}=await u.json(),m=await fetch(`${Wi}/admin/users/me`,{headers:{Authorization:`Bearer ${f}`}});if(!m.ok)throw new Error(`Failed to load user profile (${m.status})`);const p=await m.json();n.login({id:p.id,email:p.email,first_name:p.first_name??"",last_name:p.last_name??"",avatar_url:p.avatar_url},f),r("/",{replace:!0})})().catch(u=>t(u.message??"Failed to complete sign-in"))},[]),e){const i=e.startsWith("GOOGLE_NOT_LINKED:"),o=i?e.replace("GOOGLE_NOT_LINKED: ",""):e;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-[400px] 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:i?"Google account not connected":"Sign-in failed"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:o}),i?a.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[a.jsx(Fr,{to:"/login",children:a.jsx(J,{className:"w-full",size:"sm",children:"Sign in with email & password"})}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["After signing in, go to ",a.jsx("strong",{children:"Profile"})," → ",a.jsx("strong",{children:"Connections"})," to link your Google account."]})]}):a.jsx(Fr,{to:"/login",children:a.jsx(J,{variant:"outline",size:"sm",children:"Back to login"})})]})})}return 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..."})})}var Mee=Object.defineProperty,Eee=Object.defineProperties,Aee=Object.getOwnPropertyDescriptors,Su=Object.getOwnPropertySymbols,QP=Object.prototype.hasOwnProperty,ZP=Object.prototype.propertyIsEnumerable,gj=(e,t,r)=>t in e?Mee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dee=(e,t)=>{for(var r in t||(t={}))QP.call(t,r)&&gj(e,r,t[r]);if(Su)for(var r of Su(t))ZP.call(t,r)&&gj(e,r,t[r]);return e},Tee=(e,t)=>Eee(e,Aee(t)),Iee=(e,t)=>{var r={};for(var n in e)QP.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Su)for(var n of Su(e))t.indexOf(n)<0&&ZP.call(e,n)&&(r[n]=e[n]);return r};function Ree(e){let t=setTimeout(e,0),r=setTimeout(e,10),n=setTimeout(e,50);return[t,r,n]}function $ee(e){let t=h.useRef();return h.useEffect(()=>{t.current=e}),t.current}var zee=18,JP=40,Lee=`${JP}px`,Fee=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function Bee({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:n}){let[s,i]=h.useState(!1),[o,l]=h.useState(!1),[c,d]=h.useState(!1),u=h.useMemo(()=>r==="none"?!1:(r==="increase-width"||r==="experimental-no-flickering")&&s&&o,[s,o,r]),f=h.useCallback(()=>{let m=e.current,p=t.current;if(!m||!p||c||r==="none")return;let x=m,g=x.getBoundingClientRect().left+x.offsetWidth,v=x.getBoundingClientRect().top+x.offsetHeight/2,y=g-zee,j=v;document.querySelectorAll(Fee).length===0&&document.elementFromPoint(y,j)===m||(i(!0),d(!0))},[e,t,c,r]);return h.useEffect(()=>{let m=e.current;if(!m||r==="none")return;function p(){let g=window.innerWidth-m.getBoundingClientRect().right;l(g>=JP)}p();let x=setInterval(p,1e3);return()=>{clearInterval(x)}},[e,r]),h.useEffect(()=>{let m=n||document.activeElement===t.current;if(r==="none"||!m)return;let p=setTimeout(f,0),x=setTimeout(f,2e3),g=setTimeout(f,5e3),v=setTimeout(()=>{d(!0)},6e3);return()=>{clearTimeout(p),clearTimeout(x),clearTimeout(g),clearTimeout(v)}},[t,n,r,f]),{hasPWMBadge:s,willPushPWMBadge:u,PWM_BADGE_SPACE_WIDTH:Lee}}var eM=h.createContext({}),tM=h.forwardRef((e,t)=>{var r=e,{value:n,onChange:s,maxLength:i,textAlign:o="left",pattern:l,placeholder:c,inputMode:d="numeric",onComplete:u,pushPasswordManagerStrategy:f="increase-width",pasteTransformer:m,containerClassName:p,noScriptCSSFallback:x=Wee,render:g,children:v}=r,y=Iee(r,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),j,N,w,k,b;let[S,_]=h.useState(typeof y.defaultValue=="string"?y.defaultValue:""),C=n??S,T=$ee(C),M=h.useCallback(V=>{s==null||s(V),_(V)},[s]),O=h.useMemo(()=>l?typeof l=="string"?new RegExp(l):l:null,[l]),R=h.useRef(null),E=h.useRef(null),A=h.useRef({value:C,onChange:M,isIOS:typeof window<"u"&&((N=(j=window==null?void 0:window.CSS)==null?void 0:j.supports)==null?void 0:N.call(j,"-webkit-touch-callout","none"))}),P=h.useRef({prev:[(w=R.current)==null?void 0:w.selectionStart,(k=R.current)==null?void 0:k.selectionEnd,(b=R.current)==null?void 0:b.selectionDirection]});h.useImperativeHandle(t,()=>R.current,[]),h.useEffect(()=>{let V=R.current,le=E.current;if(!V||!le)return;A.current.value!==V.value&&A.current.onChange(V.value),P.current.prev=[V.selectionStart,V.selectionEnd,V.selectionDirection];function pe(){if(document.activeElement!==V){W(null),te(null);return}let H=V.selectionStart,ye=V.selectionEnd,De=V.selectionDirection,He=V.maxLength,Fe=V.value,Qe=P.current.prev,gt=-1,Ge=-1,Ze;if(Fe.length!==0&&H!==null&&ye!==null){let xn=H===ye,xr=H===Fe.length&&Fe.length<He;if(xn&&!xr){let Ct=H;if(Ct===0)gt=0,Ge=1,Ze="forward";else if(Ct===He)gt=Ct-1,Ge=Ct,Ze="backward";else if(He>1&&Fe.length>1){let Rt=0;if(Qe[0]!==null&&Qe[1]!==null){Ze=Ct<Qe[1]?"backward":"forward";let Ht=Qe[0]===Qe[1]&&Qe[0]<He;Ze==="backward"&&!Ht&&(Rt=-1)}gt=Rt+Ct,Ge=Rt+Ct+1}}gt!==-1&&Ge!==-1&>!==Ge&&R.current.setSelectionRange(gt,Ge,Ze)}let pr=gt!==-1?gt:H,pn=Ge!==-1?Ge:ye,Ar=Ze??De;W(pr),te(pn),P.current.prev=[pr,pn,Ar]}if(document.addEventListener("selectionchange",pe,{capture:!0}),pe(),document.activeElement===V&&se(!0),!document.getElementById("input-otp-style")){let H=document.createElement("style");if(H.id="input-otp-style",document.head.appendChild(H),H.sheet){let ye="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";al(H.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),al(H.sheet,`[data-input-otp]:autofill { ${ye} }`),al(H.sheet,`[data-input-otp]:-webkit-autofill { ${ye} }`),al(H.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),al(H.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let we=()=>{le&&le.style.setProperty("--root-height",`${V.clientHeight}px`)};we();let _e=new ResizeObserver(we);return _e.observe(V),()=>{document.removeEventListener("selectionchange",pe,{capture:!0}),_e.disconnect()}},[]);let[U,Q]=h.useState(!1),[K,se]=h.useState(!1),[ae,W]=h.useState(null),[Y,te]=h.useState(null);h.useEffect(()=>{Ree(()=>{var V,le,pe,we;(V=R.current)==null||V.dispatchEvent(new Event("input"));let _e=(le=R.current)==null?void 0:le.selectionStart,H=(pe=R.current)==null?void 0:pe.selectionEnd,ye=(we=R.current)==null?void 0:we.selectionDirection;_e!==null&&H!==null&&(W(_e),te(H),P.current.prev=[_e,H,ye])})},[C,K]),h.useEffect(()=>{T!==void 0&&C!==T&&T.length<i&&C.length===i&&(u==null||u(C))},[i,u,T,C]);let X=Bee({containerRef:E,inputRef:R,pushPasswordManagerStrategy:f,isFocused:K}),I=h.useCallback(V=>{let le=V.currentTarget.value.slice(0,i);if(le.length>0&&O&&!O.test(le)){V.preventDefault();return}typeof T=="string"&&le.length<T.length&&document.dispatchEvent(new Event("selectionchange")),M(le)},[i,M,T,O]),D=h.useCallback(()=>{var V;if(R.current){let le=Math.min(R.current.value.length,i-1),pe=R.current.value.length;(V=R.current)==null||V.setSelectionRange(le,pe),W(le),te(pe)}se(!0)},[i]),Z=h.useCallback(V=>{var le,pe;let we=R.current;if(!m&&(!A.current.isIOS||!V.clipboardData||!we))return;let _e=V.clipboardData.getData("text/plain"),H=m?m(_e):_e;V.preventDefault();let ye=(le=R.current)==null?void 0:le.selectionStart,De=(pe=R.current)==null?void 0:pe.selectionEnd,He=(ye!==De?C.slice(0,ye)+H+C.slice(De):C.slice(0,ye)+H+C.slice(ye)).slice(0,i);if(He.length>0&&O&&!O.test(He))return;we.value=He,M(He);let Fe=Math.min(He.length,i-1),Qe=He.length;we.setSelectionRange(Fe,Qe),W(Fe),te(Qe)},[i,M,O,C]),F=h.useMemo(()=>({position:"relative",cursor:y.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[y.disabled]),q=h.useMemo(()=>({position:"absolute",inset:0,width:X.willPushPWMBadge?`calc(100% + ${X.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:X.willPushPWMBadge?`inset(0 ${X.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:o,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[X.PWM_BADGE_SPACE_WIDTH,X.willPushPWMBadge,o]),ce=h.useMemo(()=>h.createElement("input",Tee(Dee({autoComplete:y.autoComplete||"one-time-code"},y),{"data-input-otp":!0,"data-input-otp-placeholder-shown":C.length===0||void 0,"data-input-otp-mss":ae,"data-input-otp-mse":Y,inputMode:d,pattern:O==null?void 0:O.source,"aria-placeholder":c,style:q,maxLength:i,value:C,ref:R,onPaste:V=>{var le;Z(V),(le=y.onPaste)==null||le.call(y,V)},onChange:I,onMouseOver:V=>{var le;Q(!0),(le=y.onMouseOver)==null||le.call(y,V)},onMouseLeave:V=>{var le;Q(!1),(le=y.onMouseLeave)==null||le.call(y,V)},onFocus:V=>{var le;D(),(le=y.onFocus)==null||le.call(y,V)},onBlur:V=>{var le;se(!1),(le=y.onBlur)==null||le.call(y,V)}})),[I,D,Z,d,q,i,Y,ae,y,O==null?void 0:O.source,C]),ee=h.useMemo(()=>({slots:Array.from({length:i}).map((V,le)=>{var pe;let we=K&&ae!==null&&Y!==null&&(ae===Y&&le===ae||le>=ae&&le<Y),_e=C[le]!==void 0?C[le]:null,H=C[0]!==void 0?null:(pe=c==null?void 0:c[le])!=null?pe:null;return{char:_e,placeholderChar:H,isActive:we,hasFakeCaret:we&&_e===null}}),isFocused:K,isHovering:!y.disabled&&U}),[K,U,i,Y,ae,y.disabled,C]),ue=h.useMemo(()=>g?g(ee):h.createElement(eM.Provider,{value:ee},v),[v,ee,g]);return h.createElement(h.Fragment,null,x!==null&&h.createElement("noscript",null,h.createElement("style",null,x)),h.createElement("div",{ref:E,"data-input-otp-container":!0,style:F,className:p},ue,h.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},ce)))});tM.displayName="Input";function al(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var Wee=`
|
|
611
|
+
[data-input-otp] {
|
|
612
|
+
--nojs-bg: white !important;
|
|
613
|
+
--nojs-fg: black !important;
|
|
614
|
+
|
|
615
|
+
background-color: var(--nojs-bg) !important;
|
|
616
|
+
color: var(--nojs-fg) !important;
|
|
617
|
+
caret-color: var(--nojs-fg) !important;
|
|
618
|
+
letter-spacing: .25em !important;
|
|
619
|
+
text-align: center !important;
|
|
620
|
+
border: 1px solid var(--nojs-fg) !important;
|
|
621
|
+
border-radius: 4px !important;
|
|
622
|
+
width: 100% !important;
|
|
623
|
+
}
|
|
624
|
+
@media (prefers-color-scheme: dark) {
|
|
625
|
+
[data-input-otp] {
|
|
626
|
+
--nojs-bg: black !important;
|
|
627
|
+
--nojs-fg: white !important;
|
|
628
|
+
}
|
|
629
|
+
}`;const rM=h.forwardRef(({className:e,containerClassName:t,...r},n)=>a.jsx(tM,{ref:n,containerClassName:$("flex items-center gap-2 has-[:disabled]:opacity-50",t),className:$("disabled:cursor-not-allowed",e),...r}));rM.displayName="InputOTP";const Tp=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:$("flex items-center",e),...t}));Tp.displayName="InputOTPGroup";const Is=h.forwardRef(({index:e,className:t,...r},n)=>{const s=h.useContext(eM),{char:i,hasFakeCaret:o,isActive:l}=s.slots[e];return a.jsxs("div",{ref:n,className:$("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",l&&"z-10 ring-2 ring-ring ring-offset-background",t),...r,children:[i,o&&a.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:a.jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});Is.displayName="InputOTPSlot";const nM=h.forwardRef(({...e},t)=>a.jsx("div",{ref:t,role:"separator",...e,children:a.jsx(xi,{})}));nM.displayName="InputOTPSeparator";function vj({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 Uee(){var F,q,ce,ee;const[e,t]=Ul(),{user:r}=Ie(),{data:n,isLoading:s}=lP(),i=eZ(),o=tZ(),l=rZ(),c=sZ(),d=nZ(),u=aZ(),f=h.useRef(null),[m,p]=h.useState(""),[x,g]=h.useState(""),[v,y]=h.useState(""),[j,N]=h.useState(""),[w,k]=h.useState(!1),[b,S]=h.useState(!1),[_,C]=h.useState(""),[T,M]=h.useState(""),[O,R]=h.useState(""),[E,A]=h.useState(!1),[P,U]=h.useState(0),Q=h.useRef(null);h.useEffect(()=>{n&&(p(n.first_name??""),g(n.last_name??""),y(n.designation??""),N(n.phone_number??""))},[n]),h.useEffect(()=>{e.get("linked")==="true"&&(B.success("Google account connected successfully"),t(ue=>(ue.delete("linked"),ue),{replace:!0}))},[e,t]);const K=r&&(`${((F=r.first_name)==null?void 0:F[0])??""}${((q=r.last_name)==null?void 0:q[0])??""}`.toUpperCase()||((ee=(ce=r.email)==null?void 0:ce[0])==null?void 0:ee.toUpperCase()))||"?",se=ue=>{var le;const V=(le=ue.target.files)==null?void 0:le[0];V&&(o.mutate(V,{onSuccess:()=>B.success("Avatar updated"),onError:pe=>B.error(pe.message??"Failed to upload avatar")}),ue.target.value="")},ae=()=>{l.mutate(void 0,{onSuccess:()=>B.success("Avatar removed"),onError:ue=>B.error(ue.message??"Failed to remove avatar")})},W=()=>{i.mutate({first_name:m,last_name:x,designation:v||null,phone_number:j||null},{onSuccess:()=>B.success("Profile updated"),onError:ue=>B.error(ue.message??"Failed to update profile")})},Y=()=>{const ue=localStorage.getItem("meridian_token");if(!ue){B.error("You must be logged in to connect Google");return}window.location.href=`${Wi}/auth/google/link?token=${encodeURIComponent(ue)}`},te=()=>{c.mutate(void 0,{onSuccess:()=>B.success("Google account disconnected"),onError:ue=>B.error(ue.message??"Failed to unlink Google account")})},X=h.useCallback(()=>{U(30),Q.current&&clearInterval(Q.current),Q.current=setInterval(()=>{U(ue=>ue<=1?(Q.current&&clearInterval(Q.current),0):ue-1)},1e3)},[]);h.useEffect(()=>()=>{Q.current&&clearInterval(Q.current)},[]);const I=()=>{d.mutate(void 0,{onSuccess:()=>{S(!0),X(),B.success("Verification code sent to your email")},onError:ue=>B.error(ue.message??"Failed to send verification code")})},D=()=>{if(T.length<8){B.error("New password must be at least 8 characters");return}if(T!==O){B.error("Passwords do not match");return}u.mutate({otp:_,new_password:T},{onSuccess:()=>{B.success("Password updated"),Z()},onError:ue=>B.error(ue.message??"Failed to set password")})},Z=()=>{k(!1),S(!1),C(""),M(""),R(""),A(!1),U(0),Q.current&&clearInterval(Q.current)};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(Jl,{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(Ft,{className:"h-14 w-14 rounded-xl",children:[n!=null&&n.avatar_url?a.jsx(pl,{src:n.avatar_url,alt:"Avatar",className:"object-cover"}):null,a.jsx(Bt,{className:"rounded-xl bg-foreground text-background text-base font-medium",children:K})]}),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(J,{variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{var ue;return(ue=f.current)==null?void 0:ue.click()},disabled:o.isPending,children:[a.jsx(GA,{className:"size-3.5"}),"Change photo"]}),(n==null?void 0:n.avatar_url)&&a.jsxs(J,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-destructive",onClick:ae,disabled:l.isPending,children:[a.jsx(Sr,{className:"size-3.5"}),"Remove"]})]}),a.jsx("input",{ref:f,type:"file",accept:"image/*",className:"hidden",onChange:se})]})]}),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(oe,{className:"h-8 w-56"}):a.jsx(Ae,{value:m,onChange:ue=>p(ue.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(oe,{className:"h-8 w-56"}):a.jsx(Ae,{value:x,onChange:ue=>g(ue.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(oe,{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(oe,{className:"h-8 w-56"}):a.jsx(Ae,{value:v,onChange:ue=>y(ue.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(oe,{className:"h-8 w-56"}):a.jsx(Ae,{value:j,onChange:ue=>N(ue.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(J,{size:"sm",onClick:W,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(vj,{className:"size-3.5 shrink-0"}),"Google"]}),s?a.jsx(oe,{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(Na,{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(J,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-muted-foreground hover:text-destructive ml-auto",onClick:te,disabled:c.isPending,children:[a.jsx(Yp,{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(J,{variant:"outline",size:"sm",className:"h-7 gap-1.5",onClick:Y,children:[a.jsx(vj,{className:"size-3.5"}),"Connect"]})]})]}),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:"Security"})}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-4 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Password"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:(n==null?void 0:n.has_password)===!1?"No password set":"••••••••"}),a.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1.5",onClick:()=>k(!0),children:[a.jsx(sD,{className:"size-3.5"}),(n==null?void 0:n.has_password)===!1?"Create password":"Change password"]})]})]}),a.jsx(Ra,{open:w,onOpenChange:ue=>{ue||Z()},children:a.jsxs(sa,{className:"sm:max-w-md",children:[a.jsxs($a,{children:[a.jsx(za,{children:(n==null?void 0:n.has_password)===!1?"Create password":"Change password"}),a.jsxs(mo,{children:["We'll send a 6-digit verification code to ",a.jsx("span",{className:"font-medium text-foreground",children:n==null?void 0:n.email})]})]}),a.jsxs("div",{className:"space-y-4 py-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(ft,{className:"text-sm",children:"Verification code"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(rM,{maxLength:6,value:_,onChange:C,children:[a.jsxs(Tp,{children:[a.jsx(Is,{index:0}),a.jsx(Is,{index:1}),a.jsx(Is,{index:2})]}),a.jsx(nM,{}),a.jsxs(Tp,{children:[a.jsx(Is,{index:3}),a.jsx(Is,{index:4}),a.jsx(Is,{index:5})]})]}),b?P>0?a.jsxs("span",{className:"text-xs text-muted-foreground shrink-0 tabular-nums w-16 text-center",children:["Resend in ",P,"s"]}):a.jsx(J,{variant:"ghost",size:"sm",className:"h-8 shrink-0 text-indigo-500 hover:text-indigo-600",onClick:I,disabled:d.isPending,children:d.isPending?"Sending…":"Resend"}):a.jsx(J,{variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:I,disabled:d.isPending,children:d.isPending?"Sending…":"Send code"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ft,{className:"text-sm",children:"New password"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{type:E?"text":"password",value:T,onChange:ue=>M(ue.target.value),className:"h-9 text-sm pr-9",placeholder:"At least 8 characters",autoComplete:"new-password"}),a.jsx("button",{type:"button",onClick:()=>A(!E),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",tabIndex:-1,children:E?a.jsx(Ql,{className:"size-3.5"}):a.jsx(pi,{className:"size-3.5"})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ft,{className:"text-sm",children:"Confirm password"}),a.jsx(Ae,{type:"password",value:O,onChange:ue=>R(ue.target.value),className:"h-9 text-sm",placeholder:"Re-enter new password",autoComplete:"new-password"})]})]}),a.jsxs(nx,{children:[a.jsx(J,{variant:"ghost",size:"sm",onClick:Z,children:"Cancel"}),a.jsx(J,{size:"sm",onClick:D,disabled:u.isPending||_.length!==6||!T||!O,children:u.isPending?"Saving…":(n==null?void 0:n.has_password)===!1?"Create password":"Update password"})]})]})})]})]})})}function qee(){const[e,t]=h.useState(""),[r,n]=h.useState(!1),s=GD(),i=o=>{o.preventDefault(),s.mutate({email:e},{onSuccess:()=>n(!0),onError:l=>B.error(l.message??"Something went wrong")})};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:r?"Check your email":"Forgot password?"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:r?"If an account exists with that email, we've sent a reset link.":"Enter your email and we'll send you a reset link."})]})]}),r?a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Didn't receive an email? Check your spam folder or try again."}),a.jsx(J,{variant:"outline",className:"w-full h-10",onClick:()=>{n(!1),t("")},children:"Try again"})]}):a.jsxs("form",{onSubmit:i,className:"space-y-2",children:[a.jsx(Ae,{type:"email",placeholder:"Email",value:e,onChange:o=>t(o.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10",autoFocus:!0}),a.jsx("div",{className:"pt-1",children:a.jsx(J,{type:"submit",className:"w-full h-10 font-medium",disabled:s.isPending,children:s.isPending?"Sending...":"Send reset link"})})]}),a.jsx("div",{className:"mt-6 text-center",children:a.jsxs(Fr,{to:"/login",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(Vl,{className:"size-3.5"}),"Back to login"]})})]})})}function Hee(){const[e]=Ul(),t=e.get("token")??"",r=jt(),n=VD(),[s,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),u=f=>{if(f.preventDefault(),s.length<8){B.error("Password must be at least 8 characters");return}if(s!==o){B.error("Passwords do not match");return}n.mutate({token:t,password:s},{onSuccess:()=>{B.success("Password has been reset. Please sign in."),r("/login",{replace:!0})},onError:m=>B.error(m.message??"Failed to reset password")})};return t?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:"Set new password"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Enter your new password below."})]})]}),a.jsxs("form",{onSubmit:u,className:"space-y-2",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{type:c?"text":"password",placeholder:"New password",value:s,onChange:f=>i(f.target.value),autoComplete:"new-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10",autoFocus:!0}),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(Ql,{className:"h-4 w-4"}):a.jsx(pi,{className:"h-4 w-4"})})]}),a.jsx(Ae,{type:"password",placeholder:"Confirm password",value:o,onChange:f=>l(f.target.value),autoComplete:"new-password",required:!0,className:"bg-white dark:bg-card h-10"}),a.jsx("div",{className:"pt-1",children:a.jsx(J,{type:"submit",className:"w-full h-10 font-medium",disabled:n.isPending,children:n.isPending?"Resetting...":"Reset password"})})]}),a.jsx("div",{className:"mt-6 text-center",children:a.jsxs(Fr,{to:"/login",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(Vl,{className:"size-3.5"}),"Back to login"]})})]})}):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] text-center space-y-4",children:[a.jsx("p",{className:"text-sm font-medium",children:"Invalid reset link"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This link is missing or expired."}),a.jsx(Fr,{to:"/forgot-password",children:a.jsx(J,{variant:"outline",size:"sm",children:"Request a new link"})})]})})}const Kee=h.lazy(()=>o1(()=>import("./ProjectTimelinePage-t37bNlU4.js"),__vite__mapDeps([0,1,2,3,4,5])).then(e=>({default:e.ProjectTimelinePage}))),Yee=h.lazy(()=>o1(()=>import("./WorkspaceReportingPage-C5UxrMV5.js"),__vite__mapDeps([6,1,2,3,4,5])).then(e=>({default:e.WorkspaceReportingPage})));function Ms({children:e}){const{isAuthenticated:t}=Ie();return t?a.jsx(a.Fragment,{children:e}):a.jsx(Yn,{to:"/login",replace:!0})}function Gee({children:e}){var r;const{user:t}=Ie();return(r=t==null?void 0:t.roles)!=null&&r.includes("super-admin")?a.jsx(a.Fragment,{children:e}):a.jsx(Yn,{to:"/",replace:!0})}function yj({children:e}){var s,i,o;const{user:t}=Ie(),r=((s=t==null?void 0:t.roles)==null?void 0:s.includes("super-admin"))||((i=t==null?void 0:t.roles)==null?void 0:i.includes("admin")),n=(o=t==null?void 0:t.permissions)==null?void 0:o.includes("workspace:admin");return r||n?a.jsx(a.Fragment,{children:e}):a.jsx(Yn,{to:"/",replace:!0})}function cd({children:e}){const{isAuthenticated:t}=Ie(),{data:r}=Iu(),n=Bl();return t?a.jsx(Yn,{to:"/",replace:!0}):r!=null&&r.needsSetup&&n.pathname==="/login"?a.jsx(Yn,{to:"/register",replace:!0}):r&&!r.needsSetup&&n.pathname==="/register"?a.jsx(Yn,{to:"/login",replace:!0}):a.jsx(a.Fragment,{children:e})}function Vee(){const{workspace:e,setWorkspace:t,user:r}=Ie(),n=jt(),{data:s,isLoading:i}=Du(!e);return h.useEffect(()=>{var o,l;if(e){n(`/${e.slug}/projects`,{replace:!0});return}if(!i&&s!==void 0)if(s.length>0){const c=s[0];t({id:c.id,name:c.name,slug:c.slug}),n(`/${c.slug}/projects`,{replace:!0})}else{const c=((o=r==null?void 0:r.roles)==null?void 0:o.includes("super-admin"))||((l=r==null?void 0:r.roles)==null?void 0:l.includes("admin"));n(c?"/setup":"/awaiting-access",{replace:!0})}},[e,s,i,n,t,r]),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 Xee(){const{workspace:e}=Wt(),{workspace:t,setWorkspace:r}=Ie();JD();const n=jt(),{data:s,isLoading:i,isFetching:o}=Du();return h.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(T5,{}),a.jsx(vT,{})]})}function Qee(){return a.jsxs(fM,{children:[a.jsx(Ke,{path:"/login",element:a.jsx(cd,{children:a.jsx(yT,{})})}),a.jsx(Ke,{path:"/register",element:a.jsx(cd,{children:a.jsx(bT,{})})}),a.jsx(Ke,{path:"/forgot-password",element:a.jsx(cd,{children:a.jsx(qee,{})})}),a.jsx(Ke,{path:"/reset-password",element:a.jsx(cd,{children:a.jsx(Hee,{})})}),a.jsx(Ke,{path:"/invite/:token",element:a.jsx(J6,{})}),a.jsx(Ke,{path:"/oauth/google/callback",element:a.jsx(Pee,{})}),a.jsx(Ke,{path:"/share/:token",element:a.jsx(_ee,{})}),a.jsx(Ke,{path:"/reporting",element:a.jsx(Ms,{children:a.jsx(yj,{children:a.jsx(F5,{})})}),children:a.jsx(Ke,{index:!0,element:a.jsx(GQ,{})})}),a.jsx(Ke,{path:"/org/settings",element:a.jsx(Ms,{children:a.jsx(yj,{children:a.jsx(U5,{})})}),children:a.jsx(Ke,{index:!0,element:a.jsx(hZ,{})})}),a.jsx(Ke,{path:"/profile",element:a.jsx(Ms,{children:a.jsx(K5,{})}),children:a.jsx(Ke,{index:!0,element:a.jsx(Uee,{})})}),a.jsx(Ke,{path:"/setup",element:a.jsx(Ms,{children:a.jsx(wT,{})})}),a.jsx(Ke,{path:"/awaiting-access",element:a.jsx(Ms,{children:a.jsx(jT,{})})}),a.jsx(Ke,{index:!0,element:a.jsx(Ms,{children:a.jsx(Vee,{})})}),a.jsxs(Ke,{path:"/:workspace",element:a.jsx(Ms,{children:a.jsx(Xee,{})}),children:[a.jsx(Ke,{index:!0,element:a.jsx(Yn,{to:"projects",replace:!0})}),a.jsx(Ke,{path:"projects",element:a.jsx(MI,{})}),a.jsxs(Ke,{path:"projects/:projectKey",element:a.jsx($5,{}),children:[a.jsx(Ke,{path:"board",element:a.jsx(t6,{})}),a.jsx(Ke,{path:"issues",element:a.jsx(r6,{})}),a.jsx(Ke,{path:"issues/new",element:a.jsx(E6,{})}),a.jsx(Ke,{path:"issues/:issueId",element:a.jsx(C6,{})}),a.jsx(Ke,{path:"sprints",element:a.jsx($6,{})}),a.jsx(Ke,{path:"timeline",element:a.jsx(h.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:a.jsx(Kee,{})})}),a.jsx(Ke,{path:"access",element:a.jsx(j6,{})}),a.jsx(Ke,{path:"reports",element:a.jsx(VQ,{})}),a.jsx(Ke,{path:"activity",element:a.jsx(JQ,{})})]}),a.jsx(Ke,{path:"notifications",element:a.jsx(D6,{})}),a.jsx(Ke,{path:"reporting",element:a.jsx(h.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:a.jsx(Yee,{})})}),a.jsx(Ke,{path:"settings",element:a.jsx(G6,{})}),a.jsx(Ke,{path:"roles",element:a.jsx(Gee,{children:a.jsx(Q6,{})})})]}),a.jsx(Ke,{path:"*",element:a.jsx(Yn,{to:"/",replace:!0})})]})}window.__React=z;window.__ReactJsxRuntime=oM;const Zee=new lM({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{}i1(document.getElementById("root")).render(a.jsx(h.StrictMode,{children:a.jsx(LA,{widgets:[...MD,...e],children:a.jsx(aA,{children:a.jsxs(cM,{client:Zee,children:[a.jsx(sA,{children:a.jsx(iA,{children:a.jsx(mM,{children:a.jsxs(Ou,{delayDuration:300,children:[a.jsx(Qee,{}),a.jsx(YE,{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(bE,{initialIsOpen:!1})]})})})}))})();export{Ie as A,J as B,ef as C,Vp as D,yee as G,wk as I,dt as P,GQ as R,Nr as W,o1 as _,Lr as a,Ia as b,jh as c,Kl as d,vo as e,me as f,bo as g,px as h,i4 as i,xx as j,yi as k,hee as l,uh as m,dh as n,bee as o,fee as p,vee as q,fh as r,TN as s,xj as t,Z1 as u,GP as v,wee as w,B as x,Tt as y,re as z};
|