@jaeungkim/gantt-chart 0.1.0
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/README.md +172 -0
- package/dist/index.cjs.js +31 -0
- package/dist/index.es.js +1729 -0
- package/dist/readmeImg.png +0 -0
- package/package.json +74 -0
package/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# React Gantt Chart
|
|
2
|
+
|
|
3
|
+
<!--  -->
|
|
4
|
+
|
|
5
|
+
**React Gantt Chart** is a lightweight, high-performance Gantt chart component for React applications, for fast rendering and state management. It is designed to be highly customizable and easy to integrate into modern React projects.
|
|
6
|
+
|
|
7
|
+
π― Motivation
|
|
8
|
+
|
|
9
|
+
I originally wanted to use Microsoft Project's Gantt Chart for personal project management, but it required subscription π. Thus, I decided to build my own Gantt chart, referencing various open-source projects and examples, including MS Project, DHTMLX, Frappe Gantt Chart, and etc.
|
|
10
|
+
|
|
11
|
+
Since there arenβt many open-source Gantt chart solutions available, I hope this project will be useful for others as well. I am very open to feedback, feature requests, and contributions to make this Gantt chart as robust and versatile as possible.
|
|
12
|
+
|
|
13
|
+
Currently, this project is built specifically for React due to my development background, but in the future, I may explore making it available for other frameworks as well. Since this is my first open-source project, I look forward to learning and improving it with the community!
|
|
14
|
+
|
|
15
|
+
## π Features
|
|
16
|
+
- π **Lightweight & Fast** β Optimized with Vite for lightning-fast performance.
|
|
17
|
+
- π **Modern State Management** β Uses Zustand for efficient and minimal state handling.
|
|
18
|
+
- π **Drag & Drop Support** β Easily move and resize tasks.
|
|
19
|
+
<!-- - π¨ **Customizable Themes** β Style your Gantt chart with Tailwind CSS or custom styles. -->
|
|
20
|
+
- π **Dependencies Between Tasks** β Visualize relationships between tasks.
|
|
21
|
+
- π **Zoom & Pan** β Navigate large project timelines with ease.
|
|
22
|
+
<!-- - π§ **API & Data Fetching** β Optional integration with React Query for backend connectivity. -->
|
|
23
|
+
<!-- - π **Internationalization (i18n)** β Multi-language support for global usage. -->
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
<!--
|
|
27
|
+
## π¦ Installation
|
|
28
|
+
|
|
29
|
+
Install via npm:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npm install @jaeungkim/gantt-chart
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Or with yarn:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
yarn add @jaeungkim/gantt-chart
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## π Usage
|
|
44
|
+
|
|
45
|
+
Basic example to integrate **React Gantt Chart** into your project:
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import React from "react";
|
|
49
|
+
import GanttChart from "@jaeungkim/gantt-chart";
|
|
50
|
+
|
|
51
|
+
const tasks = [
|
|
52
|
+
{ id: 1, name: "Task 1", start: "2024-03-01", end: "2024-03-05", progress: 50 },
|
|
53
|
+
{ id: 2, name: "Task 2", start: "2024-03-06", end: "2024-03-10", progress: 30 }
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
export default function App() {
|
|
57
|
+
return (
|
|
58
|
+
<div style={{ width: "100%", height: "500px" }}>
|
|
59
|
+
<GanttChart tasks={tasks} />
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## π¨ Customization
|
|
68
|
+
|
|
69
|
+
### **Theming with TailwindCSS**
|
|
70
|
+
|
|
71
|
+
You can apply custom styles using TailwindCSS or standard CSS:
|
|
72
|
+
|
|
73
|
+
```css
|
|
74
|
+
.gantt-container {
|
|
75
|
+
background-color: #f8f9fa;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### **Custom Task Styling**
|
|
80
|
+
|
|
81
|
+
You can pass a `taskRenderer` function to customize task appearance:
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
<GanttChart
|
|
85
|
+
tasks={tasks}
|
|
86
|
+
taskRenderer={(task) => (
|
|
87
|
+
<div style={{ background: task.progress > 50 ? "#4caf50" : "#ff9800" }}>
|
|
88
|
+
{task.name}
|
|
89
|
+
</div>
|
|
90
|
+
)}
|
|
91
|
+
/>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## π‘ API & Props
|
|
97
|
+
|
|
98
|
+
| Prop | Type | Description |
|
|
99
|
+
|-------------|-----------|--------------------------------------|
|
|
100
|
+
| `tasks` | `Task[]` | Array of tasks for the Gantt chart |
|
|
101
|
+
| `onTaskClick` | `function` | Callback when a task is clicked |
|
|
102
|
+
| `zoomLevel` | `number` | Adjust the zoom level (1-5) |
|
|
103
|
+
| `taskRenderer` | `function` | Custom render function for tasks |
|
|
104
|
+
|
|
105
|
+
### **Task Object Structure**
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
interface Task {
|
|
109
|
+
id: number;
|
|
110
|
+
name: string;
|
|
111
|
+
start: string;
|
|
112
|
+
end: string;
|
|
113
|
+
progress: number;
|
|
114
|
+
dependencies?: number[];
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## β‘ Performance Optimizations
|
|
121
|
+
- **Virtualized Rendering** β Uses `react-window` for handling large datasets efficiently.
|
|
122
|
+
- **Zustand for State Management** β Avoids unnecessary re-renders.
|
|
123
|
+
- **Code Splitting** β Load components lazily with `React.lazy()` and `Suspense`.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## π Contributing
|
|
128
|
+
We welcome contributions! To get started:
|
|
129
|
+
|
|
130
|
+
1. **Fork the repo** and clone it locally:
|
|
131
|
+
```sh
|
|
132
|
+
git clone https://github.com/your-username/@jaeungkim/gantt-chart.git
|
|
133
|
+
```
|
|
134
|
+
2. **Install dependencies:**
|
|
135
|
+
```sh
|
|
136
|
+
npm install
|
|
137
|
+
```
|
|
138
|
+
3. **Run the dev server:**
|
|
139
|
+
```sh
|
|
140
|
+
npm run dev
|
|
141
|
+
```
|
|
142
|
+
4. **Submit a pull request!** π
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## β FAQ
|
|
147
|
+
### **1. How do I handle large datasets?**
|
|
148
|
+
Use the `react-window` library for virtualization.
|
|
149
|
+
|
|
150
|
+
### **2. Can I add task dependencies?**
|
|
151
|
+
Yes! Provide an array of `dependencies` for each task.
|
|
152
|
+
|
|
153
|
+
### **3. Does this support dark mode?**
|
|
154
|
+
Yes, you can customize it with CSS or Tailwind.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## π License
|
|
159
|
+
This project is licensed under the **MIT License** β feel free to use and modify it as needed.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## π Support & Community
|
|
164
|
+
- **GitHub Issues** β Report bugs or request features [here](https://github.com/your-username/@jaeungkim/gantt-chart/issues).
|
|
165
|
+
- **Discussions** β Join the community and share ideas.
|
|
166
|
+
|
|
167
|
+
If you find this project useful, please β star the repo and contribute!
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
**π Build better project timelines with React Gantt Chart!**
|
|
172
|
+
-->
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react");function it(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(s,r,o.get?o:{enumerable:!0,get:()=>n[r]})}}return s.default=n,Object.freeze(s)}const Ae=it(A);function te(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Se={exports:{}},$e={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var qe;function ut(){if(qe)return $e;qe=1;var n=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function r(o,u,e){var f=null;if(e!==void 0&&(f=""+e),u.key!==void 0&&(f=""+u.key),"key"in u){e={};for(var i in u)i!=="key"&&(e[i]=u[i])}else e=u;return u=e.ref,{$$typeof:n,type:o,key:f,ref:u!==void 0?u:null,props:e}}return $e.Fragment=s,$e.jsx=r,$e.jsxs=r,$e}var ge={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ce;function ct(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){function n(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===x?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case j:return"Fragment";case E:return"Portal";case B:return"Profiler";case q:return"StrictMode";case G:return"Suspense";case le:return"SuspenseList"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case d:return(t.displayName||"Context")+".Provider";case g:return(t._context.displayName||"Context")+".Consumer";case O:var b=t.render;return t=t.displayName,t||(t=b.displayName||b.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case R:return b=t.displayName||null,b!==null?b:n(t.type)||"Memo";case y:b=t._payload,t=t._init;try{return n(t(b))}catch{}}return null}function s(t){return""+t}function r(t){try{s(t);var b=!1}catch{b=!0}if(b){b=console;var w=b.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return w.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),s(t)}}function o(){}function u(){if(Y===0){J=console.log,ae=console.info,ne=console.warn,ue=console.error,re=console.group,V=console.groupCollapsed,ee=console.groupEnd;var t={configurable:!0,enumerable:!0,value:o,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}Y++}function e(){if(Y--,Y===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},t,{value:J}),info:F({},t,{value:ae}),warn:F({},t,{value:ne}),error:F({},t,{value:ue}),group:F({},t,{value:re}),groupCollapsed:F({},t,{value:V}),groupEnd:F({},t,{value:ee})})}0>Y&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function f(t){if(se===void 0)try{throw Error()}catch(w){var b=w.stack.trim().match(/\n( *(at )?)/);se=b&&b[1]||"",de=-1<w.stack.indexOf(`
|
|
18
|
+
at`)?" (<anonymous>)":-1<w.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
+
`+se+t+de}function i(t,b){if(!t||Le)return"";var w=je.get(t);if(w!==void 0)return w;Le=!0,w=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var C=null;C=I.H,I.H=null,u();try{var X={DetermineComponentFrameRoot:function(){try{if(b){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ie){var De=ie}Reflect.construct(t,[],ce)}else{try{ce.call()}catch(ie){De=ie}t.call(ce.prototype)}}else{try{throw Error()}catch(ie){De=ie}(ce=t())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ie){if(ie&&De&&typeof ie.stack=="string")return[ie.stack,De.stack]}return[null,null]}};X.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var z=Object.getOwnPropertyDescriptor(X.DetermineComponentFrameRoot,"name");z&&z.configurable&&Object.defineProperty(X.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=X.DetermineComponentFrameRoot(),oe=_[0],me=_[1];if(oe&&me){var Q=oe.split(`
|
|
20
|
+
`),fe=me.split(`
|
|
21
|
+
`);for(_=z=0;z<Q.length&&!Q[z].includes("DetermineComponentFrameRoot");)z++;for(;_<fe.length&&!fe[_].includes("DetermineComponentFrameRoot");)_++;if(z===Q.length||_===fe.length)for(z=Q.length-1,_=fe.length-1;1<=z&&0<=_&&Q[z]!==fe[_];)_--;for(;1<=z&&0<=_;z--,_--)if(Q[z]!==fe[_]){if(z!==1||_!==1)do if(z--,_--,0>_||Q[z]!==fe[_]){var pe=`
|
|
22
|
+
`+Q[z].replace(" at new "," at ");return t.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",t.displayName)),typeof t=="function"&&je.set(t,pe),pe}while(1<=z&&0<=_);break}}}finally{Le=!1,I.H=C,e(),Error.prepareStackTrace=w}return Q=(Q=t?t.displayName||t.name:"")?f(Q):"",typeof t=="function"&&je.set(t,Q),Q}function p(t){if(t==null)return"";if(typeof t=="function"){var b=t.prototype;return i(t,!(!b||!b.isReactComponent))}if(typeof t=="string")return f(t);switch(t){case G:return f("Suspense");case le:return f("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case O:return t=i(t.render,!1),t;case R:return p(t.type);case y:b=t._payload,t=t._init;try{return p(t(b))}catch{}}return""}function h(){var t=I.A;return t===null?null:t.getOwner()}function m(t){if(Z.call(t,"key")){var b=Object.getOwnPropertyDescriptor(t,"key").get;if(b&&b.isReactWarning)return!1}return t.key!==void 0}function a(t,b){function w(){Pe||(Pe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",b))}w.isReactWarning=!0,Object.defineProperty(t,"key",{get:w,configurable:!0})}function c(){var t=n(this.type);return _e[t]||(_e[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function S(t,b,w,C,X,z){return w=z.ref,t={$$typeof:L,type:t,key:b,props:z,_owner:X},(w!==void 0?w:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:c}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function v(t,b,w,C,X,z){if(typeof t=="string"||typeof t=="function"||t===j||t===B||t===q||t===G||t===le||t===D||typeof t=="object"&&t!==null&&(t.$$typeof===y||t.$$typeof===R||t.$$typeof===d||t.$$typeof===g||t.$$typeof===O||t.$$typeof===U||t.getModuleId!==void 0)){var _=b.children;if(_!==void 0)if(C)if(H(_)){for(C=0;C<_.length;C++)l(_[C],t);Object.freeze&&Object.freeze(_)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else l(_,t)}else _="",(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(_+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),t===null?C="null":H(t)?C="array":t!==void 0&&t.$$typeof===L?(C="<"+(n(t.type)||"Unknown")+" />",_=" Did you accidentally export a JSX literal instead of a component?"):C=typeof t,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",C,_);if(Z.call(b,"key")){_=n(t);var oe=Object.keys(b).filter(function(Q){return Q!=="key"});C=0<oe.length?"{key: someKey, "+oe.join(": ..., ")+": ...}":"{key: someKey}",Fe[_+C]||(oe=0<oe.length?"{"+oe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
|
+
let props = %s;
|
|
24
|
+
<%s {...props} />
|
|
25
|
+
React keys must be passed directly to JSX without using spread:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s key={someKey} {...props} />`,C,_,oe,_),Fe[_+C]=!0)}if(_=null,w!==void 0&&(r(w),_=""+w),m(b)&&(r(b.key),_=""+b.key),"key"in b){w={};for(var me in b)me!=="key"&&(w[me]=b[me])}else w=b;return _&&a(w,typeof t=="function"?t.displayName||t.name||"Unknown":t),S(t,_,z,X,h(),w)}function l(t,b){if(typeof t=="object"&&t&&t.$$typeof!==ot){if(H(t))for(var w=0;w<t.length;w++){var C=t[w];$(C)&&T(C,b)}else if($(t))t._store&&(t._store.validated=1);else if(t===null||typeof t!="object"?w=null:(w=M&&t[M]||t["@@iterator"],w=typeof w=="function"?w:null),typeof w=="function"&&w!==t.entries&&(w=w.call(t),w!==t))for(;!(t=w.next()).done;)$(t.value)&&T(t.value,b)}}function $(t){return typeof t=="object"&&t!==null&&t.$$typeof===L}function T(t,b){if(t._store&&!t._store.validated&&t.key==null&&(t._store.validated=1,b=P(b),!Ne[b])){Ne[b]=!0;var w="";t&&t._owner!=null&&t._owner!==h()&&(w=null,typeof t._owner.tag=="number"?w=n(t._owner.type):typeof t._owner.name=="string"&&(w=t._owner.name),w=" It was passed a child from "+w+".");var C=I.getCurrentStack;I.getCurrentStack=function(){var X=p(t.type);return C&&(X+=C()||""),X},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',b,w),I.getCurrentStack=C}}function P(t){var b="",w=h();return w&&(w=n(w.type))&&(b=`
|
|
28
|
+
|
|
29
|
+
Check the render method of \``+w+"`."),b||(t=n(t))&&(b=`
|
|
30
|
+
|
|
31
|
+
Check the top-level render call using <`+t+">."),b}var k=A,L=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),d=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),M=Symbol.iterator,x=Symbol.for("react.client.reference"),I=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=Object.prototype.hasOwnProperty,F=Object.assign,U=Symbol.for("react.client.reference"),H=Array.isArray,Y=0,J,ae,ne,ue,re,V,ee;o.__reactDisabledLog=!0;var se,de,Le=!1,je=new(typeof WeakMap=="function"?WeakMap:Map),ot=Symbol.for("react.client.reference"),Pe,_e={},Fe={},Ne={};ge.Fragment=j,ge.jsx=function(t,b,w,C,X){return v(t,b,w,!1,C,X)},ge.jsxs=function(t,b,w,C,X){return v(t,b,w,!0,C,X)}}()),ge}var We;function dt(){return We||(We=1,process.env.NODE_ENV==="production"?Se.exports=ut():Se.exports=ct()),Se.exports}var N=dt();const at=2.375*16,Ue=3,K={day:{labelUnit:"day",tickUnit:"hour",unitPerTick:1,dragStepUnit:"minute",dragStepAmount:15,basePxPerDragStep:16,formatTickLabel:n=>n.format("h A"),formatHeaderLabel:n=>n.format("MMM D")},week:{labelUnit:"week",tickUnit:"day",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:6,basePxPerDragStep:32,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("MMM")},month:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:64,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("MMM YYYY")},year:{labelUnit:"year",tickUnit:"day",unitPerTick:7,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:16,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("YYYY")}};var ye={exports:{}},ft=ye.exports,ze;function lt(){return ze||(ze=1,function(n,s){(function(r,o){n.exports=o()})(ft,function(){var r=1e3,o=6e4,u=36e5,e="millisecond",f="second",i="minute",p="hour",h="day",m="week",a="month",c="quarter",S="year",v="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var y=["th","st","nd","rd"],D=R%100;return"["+R+(y[(D-20)%10]||y[D]||y[0])+"]"}},k=function(R,y,D){var M=String(R);return!M||M.length>=y?R:""+Array(y+1-M.length).join(D)+R},L={s:k,z:function(R){var y=-R.utcOffset(),D=Math.abs(y),M=Math.floor(D/60),x=D%60;return(y<=0?"+":"-")+k(M,2,"0")+":"+k(x,2,"0")},m:function R(y,D){if(y.date()<D.date())return-R(D,y);var M=12*(D.year()-y.year())+(D.month()-y.month()),x=y.clone().add(M,a),I=D-x<0,Z=y.clone().add(M+(I?-1:1),a);return+(-(M+(D-x)/(I?x-Z:Z-x))||0)},a:function(R){return R<0?Math.ceil(R)||0:Math.floor(R)},p:function(R){return{M:a,y:S,w:m,d:h,D:v,h:p,m:i,s:f,ms:e,Q:c}[R]||String(R||"").toLowerCase().replace(/s$/,"")},u:function(R){return R===void 0}},E="en",j={};j[E]=P;var q="$isDayjsObject",B=function(R){return R instanceof G||!(!R||!R[q])},g=function R(y,D,M){var x;if(!y)return E;if(typeof y=="string"){var I=y.toLowerCase();j[I]&&(x=I),D&&(j[I]=D,x=I);var Z=y.split("-");if(!x&&Z.length>1)return R(Z[0])}else{var F=y.name;j[F]=y,x=F}return!M&&x&&(E=x),x||!M&&E},d=function(R,y){if(B(R))return R.clone();var D=typeof y=="object"?y:{};return D.date=R,D.args=arguments,new G(D)},O=L;O.l=g,O.i=B,O.w=function(R,y){return d(R,{locale:y.$L,utc:y.$u,x:y.$x,$offset:y.$offset})};var G=function(){function R(D){this.$L=g(D.locale,null,!0),this.parse(D),this.$x=this.$x||D.x||{},this[q]=!0}var y=R.prototype;return y.parse=function(D){this.$d=function(M){var x=M.date,I=M.utc;if(x===null)return new Date(NaN);if(O.u(x))return new Date;if(x instanceof Date)return new Date(x);if(typeof x=="string"&&!/Z$/i.test(x)){var Z=x.match($);if(Z){var F=Z[2]-1||0,U=(Z[7]||"0").substring(0,3);return I?new Date(Date.UTC(Z[1],F,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,U)):new Date(Z[1],F,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,U)}}return new Date(x)}(D),this.init()},y.init=function(){var D=this.$d;this.$y=D.getFullYear(),this.$M=D.getMonth(),this.$D=D.getDate(),this.$W=D.getDay(),this.$H=D.getHours(),this.$m=D.getMinutes(),this.$s=D.getSeconds(),this.$ms=D.getMilliseconds()},y.$utils=function(){return O},y.isValid=function(){return this.$d.toString()!==l},y.isSame=function(D,M){var x=d(D);return this.startOf(M)<=x&&x<=this.endOf(M)},y.isAfter=function(D,M){return d(D)<this.startOf(M)},y.isBefore=function(D,M){return this.endOf(M)<d(D)},y.$g=function(D,M,x){return O.u(D)?this[M]:this.set(x,D)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(D,M){var x=this,I=!!O.u(M)||M,Z=O.p(D),F=function(re,V){var ee=O.w(x.$u?Date.UTC(x.$y,V,re):new Date(x.$y,V,re),x);return I?ee:ee.endOf(h)},U=function(re,V){return O.w(x.toDate()[re].apply(x.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(V)),x)},H=this.$W,Y=this.$M,J=this.$D,ae="set"+(this.$u?"UTC":"");switch(Z){case S:return I?F(1,0):F(31,11);case a:return I?F(1,Y):F(0,Y+1);case m:var ne=this.$locale().weekStart||0,ue=(H<ne?H+7:H)-ne;return F(I?J-ue:J+(6-ue),Y);case h:case v:return U(ae+"Hours",0);case p:return U(ae+"Minutes",1);case i:return U(ae+"Seconds",2);case f:return U(ae+"Milliseconds",3);default:return this.clone()}},y.endOf=function(D){return this.startOf(D,!1)},y.$set=function(D,M){var x,I=O.p(D),Z="set"+(this.$u?"UTC":""),F=(x={},x[h]=Z+"Date",x[v]=Z+"Date",x[a]=Z+"Month",x[S]=Z+"FullYear",x[p]=Z+"Hours",x[i]=Z+"Minutes",x[f]=Z+"Seconds",x[e]=Z+"Milliseconds",x)[I],U=I===h?this.$D+(M-this.$W):M;if(I===a||I===S){var H=this.clone().set(v,1);H.$d[F](U),H.init(),this.$d=H.set(v,Math.min(this.$D,H.daysInMonth())).$d}else F&&this.$d[F](U);return this.init(),this},y.set=function(D,M){return this.clone().$set(D,M)},y.get=function(D){return this[O.p(D)]()},y.add=function(D,M){var x,I=this;D=Number(D);var Z=O.p(M),F=function(Y){var J=d(I);return O.w(J.date(J.date()+Math.round(Y*D)),I)};if(Z===a)return this.set(a,this.$M+D);if(Z===S)return this.set(S,this.$y+D);if(Z===h)return F(1);if(Z===m)return F(7);var U=(x={},x[i]=o,x[p]=u,x[f]=r,x)[Z]||1,H=this.$d.getTime()+D*U;return O.w(H,this)},y.subtract=function(D,M){return this.add(-1*D,M)},y.format=function(D){var M=this,x=this.$locale();if(!this.isValid())return x.invalidDate||l;var I=D||"YYYY-MM-DDTHH:mm:ssZ",Z=O.z(this),F=this.$H,U=this.$m,H=this.$M,Y=x.weekdays,J=x.months,ae=x.meridiem,ne=function(V,ee,se,de){return V&&(V[ee]||V(M,I))||se[ee].slice(0,de)},ue=function(V){return O.s(F%12||12,V,"0")},re=ae||function(V,ee,se){var de=V<12?"AM":"PM";return se?de.toLowerCase():de};return I.replace(T,function(V,ee){return ee||function(se){switch(se){case"YY":return String(M.$y).slice(-2);case"YYYY":return O.s(M.$y,4,"0");case"M":return H+1;case"MM":return O.s(H+1,2,"0");case"MMM":return ne(x.monthsShort,H,J,3);case"MMMM":return ne(J,H);case"D":return M.$D;case"DD":return O.s(M.$D,2,"0");case"d":return String(M.$W);case"dd":return ne(x.weekdaysMin,M.$W,Y,2);case"ddd":return ne(x.weekdaysShort,M.$W,Y,3);case"dddd":return Y[M.$W];case"H":return String(F);case"HH":return O.s(F,2,"0");case"h":return ue(1);case"hh":return ue(2);case"a":return re(F,U,!0);case"A":return re(F,U,!1);case"m":return String(U);case"mm":return O.s(U,2,"0");case"s":return String(M.$s);case"ss":return O.s(M.$s,2,"0");case"SSS":return O.s(M.$ms,3,"0");case"Z":return Z}return null}(V)||Z.replace(":","")})},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(D,M,x){var I,Z=this,F=O.p(M),U=d(D),H=(U.utcOffset()-this.utcOffset())*o,Y=this-U,J=function(){return O.m(Z,U)};switch(F){case S:I=J()/12;break;case a:I=J();break;case c:I=J()/3;break;case m:I=(Y-H)/6048e5;break;case h:I=(Y-H)/864e5;break;case p:I=Y/u;break;case i:I=Y/o;break;case f:I=Y/r;break;default:I=Y}return x?I:O.a(I)},y.daysInMonth=function(){return this.endOf(a).$D},y.$locale=function(){return j[this.$L]},y.locale=function(D,M){if(!D)return this.$L;var x=this.clone(),I=g(D,M,!0);return I&&(x.$L=I),x},y.clone=function(){return O.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},R}(),le=G.prototype;return d.prototype=le,[["$ms",e],["$s",f],["$m",i],["$H",p],["$W",h],["$M",a],["$y",S],["$D",v]].forEach(function(R){le[R[1]]=function(y){return this.$g(y,R[0],R[1])}}),d.extend=function(R,y){return R.$i||(R(y,G,d),R.$i=!0),d},d.locale=g,d.isDayjs=B,d.unix=function(R){return d(1e3*R)},d.en=j[E],d.Ls=j,d.p={},d})}(ye)),ye.exports}var mt=lt();const W=te(mt);function ht(n,s,r,o){if(!r.length)return{barMarginLeftAmount:0,barWidthSize:0};const{tickUnit:u,unitPerTick:e}=K[o],f=r.reduce((l,$)=>l+$.widthPx,0),i=r[0].startDate,p=r[r.length-1].startDate,h=W(p).add(e,u).diff(i),m=f/h,a=n.diff(i),c=s.diff(i),S=a*m,v=Math.max(c-a,1)*m;return{barMarginLeftAmount:S,barWidthSize:v}}function pt(n){let s=1/0,r=-1/0;for(const{startDate:o,endDate:u}of Object.values(n)){const e=W(o).valueOf(),f=W(u).valueOf();Number.isNaN(e)||(s=Math.min(s,e)),Number.isNaN(f)||(r=Math.max(r,f))}return{minDate:W(s),maxDate:W(r)}}function $t(n,s,r){const{tickUnit:o,unitPerTick:u}=K[r];return{paddedMinDate:n.subtract(Ue*u,o),paddedMaxDate:s.add(Ue*u,o)}}function gt(n,s,r){const{tickUnit:o,unitPerTick:u,basePxPerDragStep:e,dragStepUnit:f,dragStepAmount:i}=K[r],p=[];let h=n.startOf(o);for(;h.isBefore(s);){const m=W(h).add(u,o).diff(h,f)/i;p.push({startDate:h,widthPx:m*e}),h=h.add(u,o)}return p}function st(n,s){const{labelUnit:r,formatHeaderLabel:o}=K[s],u=[];let e=null,f="",i=0,p=null;return n.forEach((h,m)=>{const a=h.startDate.startOf(r),c=a.valueOf(),S=(o==null?void 0:o(a))??a.format();c===e?i+=h.widthPx:(e!==null&&u.push({label:f,widthPx:i,startDate:p}),e=c,f=S,i=h.widthPx,p=a),m===n.length-1&&u.push({label:f,widthPx:i,startDate:p})}),u}function vt(n,s,r,o,u,e){const{minDate:f,maxDate:i}=pt(n);r(f),o(i);const{paddedMinDate:p,paddedMaxDate:h}=$t(f,i,s),m=gt(p,h,s),a=st(m,s);u(m),e(a)}const Dt=({bottomRowCells:n,selectedScale:s,scrollRef:r})=>{var m;const o=K[s],[u,e]=A.useState(0),f=A.useMemo(()=>st(n,s),[n,s]),i=A.useMemo(()=>{const a=[];for(const c of f){const S=a[a.length-1];S&&S.label===c.label?S.widthPx+=c.widthPx:a.push({...c})}return a},[f]),p=A.useMemo(()=>{let a=0;return i.map(c=>{const S={...c,left:a};return a+=c.widthPx,S})},[i]);A.useEffect(()=>{const a=r.current;if(!a)return;const c=()=>{const S=a.scrollLeft;for(let v=p.length-1;v>=0;v--)if(S>=p[v].left){e(v);break}};return a.addEventListener("scroll",c),c(),()=>a.removeEventListener("scroll",c)},[p]);const h=((m=p[u])==null?void 0:m.label)??"";return N.jsx("div",{className:"bg-base-200 sticky top-0 z-30",children:N.jsxs("div",{className:"flex min-w-max flex-col",children:[N.jsxs("div",{className:"relative flex h-8",children:[N.jsx("div",{className:"bg-base-200 border-base-400 sticky left-0 z-40 flex w-24 shrink-0 items-center justify-center border-b border-solid text-sm font-bold",children:h}),N.jsx("div",{className:"flex",children:p.map((a,c)=>N.jsx("div",{className:"border-base-400 bg-base-200 border-b border-solid py-2 pr-4 text-left text-sm font-bold",style:{width:`${a.widthPx}px`},children:N.jsx("p",{className:"px-4",children:c===0?"":a.label})},c))})]}),N.jsx("div",{className:"flex",children:n.map((a,c)=>{var v;const S=((v=o.formatTickLabel)==null?void 0:v.call(o,a.startDate))||"";return N.jsx("div",{className:"relative p-1 text-center text-xs",style:{width:`${a.widthPx}px`},children:S},c)})})]})})};var xe={exports:{}},St=xe.exports,He;function yt(){return He||(He=1,function(n,s){(function(r,o){n.exports=o()})(St,function(){return function(r,o,u){o.prototype.isBetween=function(e,f,i,p){var h=u(e),m=u(f),a=(p=p||"()")[0]==="(",c=p[1]===")";return(a?this.isAfter(h,i):!this.isBefore(h,i))&&(c?this.isBefore(m,i):!this.isAfter(m,i))||(a?this.isBefore(h,i):!this.isAfter(h,i))&&(c?this.isAfter(m,i):!this.isBefore(m,i))}}})}(xe)),xe.exports}var xt=yt();const bt=te(xt);var be={exports:{}},wt=be.exports,Ye;function Tt(){return Ye||(Ye=1,function(n,s){(function(r,o){n.exports=o()})(wt,function(){var r="day";return function(o,u,e){var f=function(h){return h.add(4-h.isoWeekday(),r)},i=u.prototype;i.isoWeekYear=function(){return f(this).year()},i.isoWeek=function(h){if(!this.$utils().u(h))return this.add(7*(h-this.isoWeek()),r);var m,a,c,S,v=f(this),l=(m=this.isoWeekYear(),a=this.$u,c=(a?e.utc:e)().year(m).startOf("year"),S=4-c.isoWeekday(),c.isoWeekday()>4&&(S+=7),c.add(S,r));return v.diff(l,"week")+1},i.isoWeekday=function(h){return this.$utils().u(h)?this.day()||7:this.day(this.day()%7?h:h-7)};var p=i.startOf;i.startOf=function(h,m){var a=this.$utils(),c=!!a.u(m)||m;return a.p(h)==="isoweek"?c?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):p.bind(this)(h,m)}}})}(be)),be.exports}var Mt=Tt();const Et=te(Mt);var we={exports:{}},kt=we.exports,Be;function Ot(){return Be||(Be=1,function(n,s){(function(r,o){n.exports=o()})(kt,function(){return function(r,o){o.prototype.isSameOrAfter=function(u,e){return this.isSame(u,e)||this.isAfter(u,e)}}})}(we)),we.exports}var It=Ot();const Rt=te(It);var Te={exports:{}},Lt=Te.exports,Ge;function jt(){return Ge||(Ge=1,function(n,s){(function(r,o){n.exports=o()})(Lt,function(){return function(r,o){o.prototype.isSameOrBefore=function(u,e){return this.isSame(u,e)||this.isBefore(u,e)}}})}(Te)),Te.exports}var Zt=jt();const Pt=te(Zt);var Me={exports:{}},_t=Me.exports,Ve;function Ft(){return Ve||(Ve=1,function(n,s){(function(r,o){n.exports=o()})(_t,function(){return function(r,o,u){o.prototype.isToday=function(){var e="YYYY-MM-DD",f=u();return this.format(e)===f.format(e)}}})}(Me)),Me.exports}var Nt=Ft();const At=te(Nt);var Ee={exports:{}},qt=Ee.exports,Xe;function Ct(){return Xe||(Xe=1,function(n,s){(function(r,o){n.exports=o()})(qt,function(){return function(r,o,u){var e=o.prototype,f=function(a){return a&&(a.indexOf?a:a.s)},i=function(a,c,S,v,l){var $=a.name?a:a.$locale(),T=f($[c]),P=f($[S]),k=T||P.map(function(E){return E.slice(0,v)});if(!l)return k;var L=$.weekStart;return k.map(function(E,j){return k[(j+(L||0))%7]})},p=function(){return u.Ls[u.locale()]},h=function(a,c){return a.formats[c]||function(S){return S.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(v,l,$){return l||$.slice(1)})}(a.formats[c.toUpperCase()])},m=function(){var a=this;return{months:function(c){return c?c.format("MMMM"):i(a,"months")},monthsShort:function(c){return c?c.format("MMM"):i(a,"monthsShort","months",3)},firstDayOfWeek:function(){return a.$locale().weekStart||0},weekdays:function(c){return c?c.format("dddd"):i(a,"weekdays")},weekdaysMin:function(c){return c?c.format("dd"):i(a,"weekdaysMin","weekdays",2)},weekdaysShort:function(c){return c?c.format("ddd"):i(a,"weekdaysShort","weekdays",3)},longDateFormat:function(c){return h(a.$locale(),c)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};e.localeData=function(){return m.bind(this)()},u.localeData=function(){var a=p();return{firstDayOfWeek:function(){return a.weekStart||0},weekdays:function(){return u.weekdays()},weekdaysShort:function(){return u.weekdaysShort()},weekdaysMin:function(){return u.weekdaysMin()},months:function(){return u.months()},monthsShort:function(){return u.monthsShort()},longDateFormat:function(c){return h(a,c)},meridiem:a.meridiem,ordinal:a.ordinal}},u.months=function(){return i(p(),"months")},u.monthsShort=function(){return i(p(),"monthsShort","months",3)},u.weekdays=function(a){return i(p(),"weekdays",null,null,a)},u.weekdaysShort=function(a){return i(p(),"weekdaysShort","weekdays",3,a)},u.weekdaysMin=function(a){return i(p(),"weekdaysMin","weekdays",2,a)}}})}(Ee)),Ee.exports}var Wt=Ct();const Ut=te(Wt);var ke={exports:{}},zt=ke.exports,Je;function Ht(){return Je||(Je=1,function(n,s){(function(r,o){n.exports=o()})(zt,function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},o={};return function(u,e,f){var i,p=function(c,S,v){v===void 0&&(v={});var l=new Date(c),$=function(T,P){P===void 0&&(P={});var k=P.timeZoneName||"short",L=T+"|"+k,E=o[L];return E||(E=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:T,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:k}),o[L]=E),E}(S,v);return $.formatToParts(l)},h=function(c,S){for(var v=p(c,S),l=[],$=0;$<v.length;$+=1){var T=v[$],P=T.type,k=T.value,L=r[P];L>=0&&(l[L]=parseInt(k,10))}var E=l[3],j=E===24?0:E,q=l[0]+"-"+l[1]+"-"+l[2]+" "+j+":"+l[4]+":"+l[5]+":000",B=+c;return(f.utc(q).valueOf()-(B-=B%1e3))/6e4},m=e.prototype;m.tz=function(c,S){c===void 0&&(c=i);var v,l=this.utcOffset(),$=this.toDate(),T=$.toLocaleString("en-US",{timeZone:c}),P=Math.round(($-new Date(T))/1e3/60),k=15*-Math.round($.getTimezoneOffset()/15)-P;if(!Number(k))v=this.utcOffset(0,S);else if(v=f(T,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(k,!0),S){var L=v.utcOffset();v=v.add(l-L,"minute")}return v.$x.$timezone=c,v},m.offsetName=function(c){var S=this.$x.$timezone||f.tz.guess(),v=p(this.valueOf(),S,{timeZoneName:c}).find(function(l){return l.type.toLowerCase()==="timezonename"});return v&&v.value};var a=m.startOf;m.startOf=function(c,S){if(!this.$x||!this.$x.$timezone)return a.call(this,c,S);var v=f(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return a.call(v,c,S).tz(this.$x.$timezone,!0)},f.tz=function(c,S,v){var l=v&&S,$=v||S||i,T=h(+f(),$);if(typeof c!="string")return f(c).tz($);var P=function(j,q,B){var g=j-60*q*1e3,d=h(g,B);if(q===d)return[g,q];var O=h(g-=60*(d-q)*1e3,B);return d===O?[g,d]:[j-60*Math.min(d,O)*1e3,Math.max(d,O)]}(f.utc(c,l).valueOf(),T,$),k=P[0],L=P[1],E=f(k).utcOffset(L);return E.$x.$timezone=$,E},f.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},f.tz.setDefault=function(c){i=c}}})}(ke)),ke.exports}var Yt=Ht();const Bt=te(Yt);var Oe={exports:{}},Gt=Oe.exports,Qe;function Vt(){return Qe||(Qe=1,function(n,s){(function(r,o){n.exports=o()})(Gt,function(){return function(r,o,u){u.updateLocale=function(e,f){var i=u.Ls[e];if(i)return(f?Object.keys(f):[]).forEach(function(p){i[p]=f[p]}),i}}})}(Oe)),Oe.exports}var Xt=Vt();const Jt=te(Xt);var Ie={exports:{}},Qt=Ie.exports,Ke;function Kt(){return Ke||(Ke=1,function(n,s){(function(r,o){n.exports=o()})(Qt,function(){var r="minute",o=/[+-]\d\d(?::?\d\d)?/g,u=/([+-]|\d\d)/g;return function(e,f,i){var p=f.prototype;i.utc=function(l){var $={date:l,utc:!0,args:arguments};return new f($)},p.utc=function(l){var $=i(this.toDate(),{locale:this.$L,utc:!0});return l?$.add(this.utcOffset(),r):$},p.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var h=p.parse;p.parse=function(l){l.utc&&(this.$u=!0),this.$utils().u(l.$offset)||(this.$offset=l.$offset),h.call(this,l)};var m=p.init;p.init=function(){if(this.$u){var l=this.$d;this.$y=l.getUTCFullYear(),this.$M=l.getUTCMonth(),this.$D=l.getUTCDate(),this.$W=l.getUTCDay(),this.$H=l.getUTCHours(),this.$m=l.getUTCMinutes(),this.$s=l.getUTCSeconds(),this.$ms=l.getUTCMilliseconds()}else m.call(this)};var a=p.utcOffset;p.utcOffset=function(l,$){var T=this.$utils().u;if(T(l))return this.$u?0:T(this.$offset)?a.call(this):this.$offset;if(typeof l=="string"&&(l=function(E){E===void 0&&(E="");var j=E.match(o);if(!j)return null;var q=(""+j[0]).match(u)||["-",0,0],B=q[0],g=60*+q[1]+ +q[2];return g===0?0:B==="+"?g:-g}(l),l===null))return this;var P=Math.abs(l)<=16?60*l:l,k=this;if($)return k.$offset=P,k.$u=l===0,k;if(l!==0){var L=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(k=this.local().add(P+L,r)).$offset=P,k.$x.$localOffset=L}else k=this.utc();return k};var c=p.format;p.format=function(l){var $=l||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,$)},p.valueOf=function(){var l=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*l},p.isUTC=function(){return!!this.$u},p.toISOString=function(){return this.toDate().toISOString()},p.toString=function(){return this.toDate().toUTCString()};var S=p.toDate;p.toDate=function(l){return l==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():S.call(this)};var v=p.diff;p.diff=function(l,$,T){if(l&&this.$u===l.$u)return v.call(this,l,$,T);var P=this.local(),k=i(l).local();return v.call(P,k,$,T)}}})}(Ie)),Ie.exports}var en=Kt();const tn=te(en);var Re={exports:{}},nn=Re.exports,et;function rn(){return et||(et=1,function(n,s){(function(r,o){n.exports=o()})(nn,function(){return function(r,o){o.prototype.weekday=function(u){var e=this.$locale().weekStart||0,f=this.$W,i=(f<e?f+7:f)-e;return this.$utils().u(u)?i:this.subtract(i,"day").add(u,"day")}}})}(Re)),Re.exports}var an=rn();const sn=te(an);W.extend(sn);W.extend(At);W.extend(tn);W.extend(Bt);W.extend(Rt);W.extend(Pt);W.extend(bt);W.extend(Ut);W.extend(Jt);W.extend(Et);function on(n){return[...n].sort((s,r)=>{const o=s.sequence.split(".").map(Number),u=r.sequence.split(".").map(Number);for(let e=0;e<Math.max(o.length,u.length);e++){const f=o[e]||0,i=u[e]||0;if(f!==i)return f-i}return 0})}function un(n){return n.split(".").length-1}function Ze(n,s,r){const o=on(n);let u=0;return o.map(e=>{u++;const f=un(e.sequence),{barMarginLeftAmount:i,barWidthSize:p}=ht(W(e.startDate),W(e.endDate),s,r);return{...e,barLeft:i,barWidth:p,depth:f,order:u,originalOrder:u}})}const tt=n=>{let s;const r=new Set,o=(h,m)=>{const a=typeof h=="function"?h(s):h;if(!Object.is(a,s)){const c=s;s=m??(typeof a!="object"||a===null)?a:Object.assign({},s,a),r.forEach(S=>S(s,c))}},u=()=>s,i={setState:o,getState:u,getInitialState:()=>p,subscribe:h=>(r.add(h),()=>r.delete(h))},p=s=n(o,u,i);return i},cn=n=>n?tt(n):tt,dn=n=>n;function fn(n,s=dn){const r=A.useSyncExternalStore(n.subscribe,()=>s(n.getState()),()=>s(n.getInitialState()));return A.useDebugValue(r),r}const nt=n=>{const s=cn(n),r=o=>fn(s,o);return Object.assign(r,s),r},ln=n=>n?nt(n):nt,ve=ln((n,s)=>({rawTasks:[],transformedTasks:[],bottomRowCells:[],topHeaderGroups:[],selectedScale:"day",minDate:W(),maxDate:W(),draggingTaskMeta:null,setSelectedScale:r=>{const{rawTasks:o,bottomRowCells:u}=s(),e=Ze(o,u,r);n({selectedScale:r,transformedTasks:e})},setRawTasks:r=>{const{bottomRowCells:o,selectedScale:u}=s(),e=Ze(r,o,u);n({rawTasks:r,transformedTasks:e})},setBottomRowCells:r=>{const{rawTasks:o,selectedScale:u}=s(),e=Ze(o,r,u);n({bottomRowCells:r,transformedTasks:e})},setTopHeaderGroups:r=>n({topHeaderGroups:r}),setMinDate:r=>n({minDate:r}),setMaxDate:r=>n({maxDate:r}),setDraggingTaskMeta:r=>n({draggingTaskMeta:r}),clearDraggingTaskMeta:()=>n({draggingTaskMeta:null})})),mn=[{id:"1",name:"Project Kickoff",startDate:"2024-06-01T09:00:00Z",endDate:"2024-06-01T11:00:00Z",parentId:null,sequence:"1",dependencies:[]},{id:"2",name:"Requirement Gathering",startDate:"2024-06-02T09:00:00Z",endDate:"2024-06-05T17:00:00Z",parentId:null,sequence:"2",dependencies:[{targetId:"1",type:"FS"}]},{id:"3",name:"Stakeholder Interviews",startDate:"2024-06-02T10:00:00Z",endDate:"2024-06-03T17:00:00Z",parentId:"2",sequence:"2.1",dependencies:[{targetId:"1",type:"SF"}]},{id:"4",name:"Market Analysis",startDate:"2024-06-06T09:00:00Z",endDate:"2024-06-07T17:00:00Z",parentId:null,sequence:"3",dependencies:[{targetId:"2",type:"FS"}]},{id:"5",name:"Design System Creation",startDate:"2024-06-08T09:00:00Z",endDate:"2024-06-12T17:00:00Z",parentId:null,sequence:"4",dependencies:[{targetId:"2",type:"FS"},{targetId:"3",type:"SS"}]},{id:"6",name:"UI/UX Design",startDate:"2024-06-13T09:00:00Z",endDate:"2024-06-16T17:00:00Z",parentId:"5",sequence:"4.1",dependencies:[{targetId:"5",type:"FS"}]},{id:"7",name:"Prototyping",startDate:"2024-06-17T09:00:00Z",endDate:"2024-06-20T17:00:00Z",parentId:"6",sequence:"4.1.1",dependencies:[{targetId:"6",type:"FS"}]},{id:"8",name:"Frontend Development",startDate:"2024-06-21T09:00:00Z",endDate:"2024-06-30T17:00:00Z",parentId:null,sequence:"5",dependencies:[{targetId:"7",type:"FS"}]},{id:"9",name:"Backend Development",startDate:"2024-07-01T09:00:00Z",endDate:"2024-07-10T17:00:00Z",parentId:null,sequence:"6",dependencies:[{targetId:"7",type:"FS"}]},{id:"10",name:"API Integration",startDate:"2024-07-11T09:00:00Z",endDate:"2024-07-15T17:00:00Z",parentId:"9",sequence:"6.1",dependencies:[{targetId:"9",type:"FS"}]},{id:"11",name:"Module Development",startDate:"2024-07-16T09:00:00Z",endDate:"2024-07-20T17:00:00Z",parentId:"8",sequence:"5.1",dependencies:[{targetId:"8",type:"FS"}]},{id:"12",name:"Unit Testing",startDate:"2024-07-21T09:00:00Z",endDate:"2024-07-25T17:00:00Z",parentId:"8",sequence:"5.2",dependencies:[{targetId:"8",type:"FS"}]},{id:"13",name:"Integration Testing",startDate:"2024-07-26T09:00:00Z",endDate:"2024-07-30T17:00:00Z",parentId:"10",sequence:"6.1.1",dependencies:[{targetId:"10",type:"FS"}]},{id:"14",name:"Code Review",startDate:"2024-07-31T09:00:00Z",endDate:"2024-08-04T17:00:00Z",parentId:"10",sequence:"6.1.2",dependencies:[{targetId:"13",type:"FS"}]},{id:"15",name:"Community Feedback",startDate:"2024-08-05T09:00:00Z",endDate:"2024-08-08T17:00:00Z",parentId:null,sequence:"7",dependencies:[{targetId:"14",type:"FS"}]},{id:"16",name:"Documentation Drafting",startDate:"2024-08-09T09:00:00Z",endDate:"2024-08-12T17:00:00Z",parentId:null,sequence:"8",dependencies:[{targetId:"14",type:"FS"}]},{id:"17",name:"Documentation Finalization",startDate:"2024-08-13T09:00:00Z",endDate:"2024-08-16T17:00:00Z",parentId:"16",sequence:"8.1",dependencies:[{targetId:"16",type:"FS"}]},{id:"18",name:"Pre-release Demo",startDate:"2024-08-17T09:00:00Z",endDate:"2024-08-20T17:00:00Z",parentId:null,sequence:"9",dependencies:[{targetId:"15",type:"FS"}]},{id:"19",name:"Bug Fixing",startDate:"2024-08-21T09:00:00Z",endDate:"2024-08-25T17:00:00Z",parentId:null,sequence:"10",dependencies:[{targetId:"15",type:"FS"}]},{id:"20",name:"Release Candidate",startDate:"2024-08-26T09:00:00Z",endDate:"2024-08-30T17:00:00Z",parentId:null,sequence:"11",dependencies:[{targetId:"18",type:"FS"}]},{id:"21",name:"Final Release",startDate:"2024-08-31T09:00:00Z",endDate:"2024-09-02T17:00:00Z",parentId:null,sequence:"12",dependencies:[{targetId:"20",type:"FS"}]},{id:"22",name:"Post-release Monitoring",startDate:"2024-09-03T09:00:00Z",endDate:"2024-09-04T17:00:00Z",parentId:null,sequence:"13",dependencies:[{targetId:"21",type:"FS"}]},{id:"23",name:"Community Engagement",startDate:"2024-09-05T09:00:00Z",endDate:"2024-09-06T17:00:00Z",parentId:null,sequence:"14",dependencies:[{targetId:"21",type:"FS"}]},{id:"24",name:"Feature Iteration Planning",startDate:"2024-09-07T09:00:00Z",endDate:"2024-09-08T17:00:00Z",parentId:null,sequence:"15",dependencies:[{targetId:"22",type:"FS"}]},{id:"25",name:"Additional Module Development",startDate:"2024-09-09T09:00:00Z",endDate:"2024-09-10T17:00:00Z",parentId:"24",sequence:"15.1",dependencies:[{targetId:"24",type:"FS"}]},{id:"26",name:"Additional Testing",startDate:"2024-09-11T09:00:00Z",endDate:"2024-09-12T17:00:00Z",parentId:"25",sequence:"15.1.1",dependencies:[{targetId:"25",type:"FS"}]},{id:"27",name:"Code Refactoring",startDate:"2024-09-13T09:00:00Z",endDate:"2024-09-14T17:00:00Z",parentId:null,sequence:"16",dependencies:[{targetId:"26",type:"FS"}]},{id:"28",name:"Performance Optimization",startDate:"2024-09-15T09:00:00Z",endDate:"2024-09-16T17:00:00Z",parentId:"27",sequence:"16.1",dependencies:[{targetId:"27",type:"FS"}]},{id:"29",name:"Security Audit",startDate:"2024-09-17T09:00:00Z",endDate:"2024-09-18T17:00:00Z",parentId:null,sequence:"17",dependencies:[{targetId:"28",type:"FS"}]},{id:"30",name:"Final QA",startDate:"2024-09-19T09:00:00Z",endDate:"2024-09-20T17:00:00Z",parentId:null,sequence:"18",dependencies:[{targetId:"29",type:"FS"}]},{id:"31",name:"Launch Webinar",startDate:"2024-09-21T09:00:00Z",endDate:"2024-09-22T17:00:00Z",parentId:null,sequence:"19",dependencies:[{targetId:"21",type:"SS"}]},{id:"32",name:"Marketing Campaign",startDate:"2024-09-23T09:00:00Z",endDate:"2024-09-24T17:00:00Z",parentId:null,sequence:"20",dependencies:[{targetId:"21",type:"SF"}]},{id:"33",name:"Post-release Bug Fixing",startDate:"2024-09-25T09:00:00Z",endDate:"2024-09-26T17:00:00Z",parentId:null,sequence:"21",dependencies:[{targetId:"22",type:"SS"}]},{id:"34",name:"Version 1.1 Planning",startDate:"2024-09-27T09:00:00Z",endDate:"2024-09-28T17:00:00Z",parentId:null,sequence:"22",dependencies:[{targetId:"24",type:"FS"}]},{id:"35",name:"Feature Implementation",startDate:"2024-09-29T09:00:00Z",endDate:"2024-09-30T17:00:00Z",parentId:"34",sequence:"22.1",dependencies:[{targetId:"34",type:"FS"}]},{id:"36",name:"Beta Testing",startDate:"2024-10-01T09:00:00Z",endDate:"2024-10-02T17:00:00Z",parentId:"35",sequence:"22.1.1",dependencies:[{targetId:"35",type:"FS"}]},{id:"37",name:"Community Beta Feedback",startDate:"2024-10-03T09:00:00Z",endDate:"2024-10-04T17:00:00Z",parentId:"36",sequence:"22.1.2",dependencies:[{targetId:"36",type:"FS"}]},{id:"38",name:"Final Beta Fixes",startDate:"2024-10-05T09:00:00Z",endDate:"2024-10-06T17:00:00Z",parentId:"37",sequence:"22.1.3",dependencies:[{targetId:"37",type:"FS"}]},{id:"39",name:"Documentation Update",startDate:"2024-10-07T09:00:00Z",endDate:"2024-10-08T17:00:00Z",parentId:"17",sequence:"8.1.1",dependencies:[{targetId:"17",type:"FS"}]},{id:"40",name:"Final Release Version 1.1",startDate:"2024-10-09T09:00:00Z",endDate:"2024-10-10T17:00:00Z",parentId:null,sequence:"23",dependencies:[{targetId:"38",type:"FS"}]},{id:"41",name:"Project Retrospective",startDate:"2024-10-11T09:00:00Z",endDate:"2024-10-12T17:00:00Z",parentId:null,sequence:"24",dependencies:[{targetId:"40",type:"FS"}]}],rt=n=>Ae.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...n},Ae.createElement("path",{d:"M10.2 4L10.2 20L7.8 20L7.8 4L10.2 4ZM15 4L15 20L12.6 20L12.6 4L15 4ZM5.4 15.0999L5.4 7.8999L1.8 11.4999L5.4 15.0999ZM17.4 7.8999L17.4 15.0999L21 11.4999L17.4 7.8999Z"}));function he(n,s){const{basePxPerDragStep:r}=K[s];return Math.round(n/r)}function hn(n,s,r){const{rawTasks:o,selectedScale:u,setRawTasks:e,setDraggingTaskMeta:f,clearDraggingTaskMeta:i}=ve(),[p,h]=A.useState(s),m=A.useRef(s),a=A.useRef(null),c=A.useRef(s),S=A.useRef(n.startDate),v=A.useRef(n.endDate),l=P=>{a.current=P.clientX,c.current=s,S.current=n.startDate,v.current=n.endDate,h(s),m.current=s,f({taskId:n.id,type:"bar"}),document.addEventListener("mousemove",$),document.addEventListener("mouseup",T)},$=P=>{if(a.current===null)return;const k=P.clientX-a.current,E=he(k,u)*K[u].basePxPerDragStep,j=c.current+E;h(j),m.current=j},T=()=>{document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",T);const P=m.current-c.current,k=he(P,u),{dragStepUnit:L,dragStepAmount:E}=K[u],j=o.map(q=>q.id===n.id?{...q,startDate:W(S.current).add(k*E,L).toISOString(),endDate:W(v.current).add(k*E,L).toISOString()}:q);e(j),r==null||r(j),i(),a.current=null};return{onDragStart:l,tempLeft:p}}function pn(n,s,r,o){const{rawTasks:u,selectedScale:e,setRawTasks:f,setDraggingTaskMeta:i,clearDraggingTaskMeta:p}=ve(),[h,m]=A.useState(s),[a,c]=A.useState(r),S=A.useRef(s),v=A.useRef(r),l=A.useRef(null),$=A.useRef(s),T=A.useRef(r),P=A.useRef(n.startDate),k=j=>{j.stopPropagation(),l.current=j.clientX,$.current=s,T.current=r,P.current=n.startDate,m(s),c(r),S.current=s,v.current=r,i({taskId:n.id,type:"left"}),document.addEventListener("mousemove",L),document.addEventListener("mouseup",E)},L=j=>{if(l.current==null)return;const q=j.clientX-l.current,g=he(q,e)*K[e].basePxPerDragStep,d=$.current+g,O=T.current-g;O<1||(m(d),c(O),S.current=d,v.current=O)},E=()=>{document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",E);const j=S.current-$.current,q=he(j,e),{dragStepUnit:B,dragStepAmount:g}=K[e],d=u.map(O=>{if(O.id!==n.id)return O;const G=W(P.current).add(q*g,B);return G.isAfter(W(O.endDate))?O:{...O,startDate:G.toISOString()}});f(d),o==null||o(d),p(),l.current=null};return{onDragStart:k,tempLeft:h,tempWidth:a}}function $n(n,s,r){const{rawTasks:o,selectedScale:u,setRawTasks:e,setDraggingTaskMeta:f,clearDraggingTaskMeta:i}=ve(),[p,h]=A.useState(s),m=A.useRef(s),a=A.useRef(null),c=A.useRef(s),S=A.useRef(n.endDate),v=T=>{T.stopPropagation(),a.current=T.clientX,c.current=s,S.current=n.endDate,h(s),m.current=s,f({taskId:n.id,type:"right"}),document.addEventListener("mousemove",l),document.addEventListener("mouseup",$)},l=T=>{if(a.current===null)return;const P=T.clientX-a.current,L=he(P,u)*K[u].basePxPerDragStep,E=c.current+L;E<1||(h(E),m.current=E)},$=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",$);const T=m.current-c.current,P=he(T,u),{dragStepUnit:k,dragStepAmount:L}=K[u],E=o.map(j=>{if(j.id!==n.id)return j;const q=W(S.current).add(P*L,k);return q.isBefore(W(j.startDate))?j:{...j,endDate:q.toISOString()}});e(E),r==null||r(E),i(),a.current=null};return{onDragStart:v,tempWidth:p}}function gn(n,s,r,o,u){if(r<0||u<0)return`M ${s} ${r} h ${(o-s)/2}`;const e=7,f=11,i=25,p=20,h=`M ${s} ${r}`,m=o-s,a=u-r,c=Math.abs(m),S=Math.abs(a),v=u<=r,l=u>=r,$=o>=s,T=o<=s,P=c>p,k=Math.abs(m/2),L=Math.abs(a/2);function E(){function g(){return($||T)&&l&&!P?"downSmallHorizontal":($||T)&&v&&!P?"upSmallHorizontal":l&&T?"downLeft":l&&$?"downRight":v&&T?"upLeft":v&&$?"upRight":""}let d=h;switch(g()){case"downRight":{d+=` h ${k-e}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${a-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${k-e}`;break}case"upRight":{d+=` h ${k-e}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v -${S-e*2}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${k-e}`;break}case"downLeft":case"downSmallHorizontal":{const G=r+a/2;d+=` h ${f}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${G-r-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=` h ${m-2*f}`,d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${G-r-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${f}`;break}case"upLeft":case"upSmallHorizontal":{const G=r+a/2;d+=` h ${f}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v -${r-G-e*2}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=` h ${m-2*f}`,d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v -${r-G-e*2}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${f}`;break}default:return d}return d}function j(){let g=h;return l&&T?(g+=` h ${i-f}`,g+=` a ${e} ${e} 0 0 1 ${e} ${e}`,g+=` v ${a-e*2}`,g+=` a ${e} ${e} 0 0 1 -${e} ${e}`,g+=` h ${m-e*2}`):l&&$?(g+=` h ${m+i-f}`,g+=` a ${e} ${e} 0 0 1 ${e} ${e}`,g+=` v ${a-e*2}`,g+=` a ${e} ${e} 0 0 1 -${e} ${e}`,g+=` h -${i-f}`):v&&T?(g+=` h ${i-f}`,g+=` a ${e} ${e} 0 0 0 ${e} -${e}`,g+=` v ${a+e*2}`,g+=` a ${e} ${e} 0 0 0 -${e} -${e}`,g+=` h ${m-i+f}`):v&&$&&(g+=` h ${m+i-f}`,g+=` a ${e} ${e} 0 0 0 ${e} -${e}`,g+=` v ${a+e*2}`,g+=` a ${e} ${e} 0 0 0 -${e} -${e}`,g+=` h -${i-f}`),g}function q(){function g(){return($||T)&&l&&!P?"downSmallHorizontal":($||T)&&v&&!P?"upSmallHorizontal":l&&T?"downLeft":l&&$?"downRight":v&&T?"upLeft":v&&$?"upRight":""}let d=h;switch(g()){case"downRight":case"downSmallHorizontal":{d+=" h -11",d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${L-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${f*2+m}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${L-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=" h -11";break}case"upRight":case"upSmallHorizontal":{d+=" h -11",d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v ${-(L-e*2)}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${f*2+m}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v ${-(L-e*2)}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=" h -11";break}case"downLeft":{d+=` h ${-k+e}`,d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${S-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=` h ${-k+e}`;break}case"upLeft":{d+=` h ${-(k-e)}`,d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v ${-(S-e*2)}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=` h ${-k+e}`;break}default:return d}return d}function B(){let g=h;return l&&T?(g+=` h ${m-i}`,g+=` a ${e} ${e} 0 0 0 -${e} ${e}`,g+=` v ${a-e*2}`,g+=` a ${e} ${e} 0 0 0 ${e} ${e}`,g+=` h ${i}`):l&&$?(g+=" h -25",g+=` a ${e} ${e} 0 0 0 -${e} ${e}`,g+=` v ${a-e*2}`,g+=` a ${e} ${e} 0 0 0 ${e} ${e}`,g+=` h ${m+i}`):v&&T?(g+=` h ${m-i}`,g+=` a ${e} ${e} 0 0 1 -${e} -${e}`,g+=` v ${a+e*2}`,g+=` a ${e} ${e} 0 0 1 ${e} -${e}`,g+=` h ${i}`):v&&$&&(g+=" h -25",g+=` a ${e} ${e} 0 0 1 -${e} -${e}`,g+=` v ${a+e*2}`,g+=` a ${e} ${e} 0 0 1 ${e} -${e}`,g+=` h ${m+i}`),g}switch(n){case"FS":return E();case"FF":return j();case"SF":return q();case"SS":return B();default:return`${h} L ${o} ${u}`}}function vn({allTasks:n,currentTask:s,onTasksChange:r}){const{onDragStart:o,tempLeft:u}=hn(s,s.barLeft,r),{onDragStart:e,tempLeft:f,tempWidth:i}=pn(s,s.barLeft,s.barWidth,r),{onDragStart:p,tempWidth:h}=$n(s,s.barWidth,r),{draggingTaskMeta:m}=ve(),a=(m==null?void 0:m.taskId)===s.id;let c=!1,S=!1,v=!1;a&&((m==null?void 0:m.type)==="left"?c=!0:(m==null?void 0:m.type)==="right"?S=!0:(m==null?void 0:m.type)==="bar"&&(v=!0));let l=s.barLeft,$=s.barWidth;c?(l=f,$=i):S?$=h:v&&(l=u);const T=()=>N.jsx("button",{type:"button",onMouseDown:e,className:"absolute top-0 flex h-full cursor-w-resize items-center justify-center opacity-0 hover:opacity-100",style:{left:"-1.15rem",width:"2rem",height:"100%"},children:N.jsx(rt,{className:"fill-base-500 size-6"})}),P=()=>N.jsx("button",{type:"button",onMouseDown:p,className:"absolute top-0 flex h-full cursor-w-resize items-center justify-center opacity-0 hover:opacity-100",style:{right:"-1.15rem",width:"2rem",height:"100%"},children:N.jsx(rt,{className:"fill-base-500 size-6"})}),k=(s.dependencies||[]).map(L=>{const E=n.find(O=>O.id===L.targetId);if(!E)return null;const j=at,q=(E.order-1)*j+j/2,B=(s.order-1)*j+j/2;let g,d;switch(L.type){case"FS":g=E.barLeft+E.barWidth,d=s.barLeft;break;case"SS":g=E.barLeft,d=s.barLeft;break;case"FF":g=E.barLeft+E.barWidth,d=s.barLeft+s.barWidth;break;case"SF":g=E.barLeft,d=s.barLeft+s.barWidth;break;default:return console.warn(`Unknown dependency type: ${L.type}`),null}return{...L,fromX:g,fromY:q,toX:d,toY:B}}).filter(Boolean);return N.jsxs(N.Fragment,{children:[N.jsxs("div",{role:"button",tabIndex:0,className:"bg-base-400 relative flex items-center",onMouseDown:o,style:{marginLeft:`${l}px`,width:`${$}px`,height:"1rem"},children:[T(),P()]}),N.jsxs("svg",{className:"pointer-events-none absolute top-0 left-0 z-10 size-full",children:[N.jsx("defs",{children:N.jsx("marker",{id:"arrowhead",markerWidth:"6",markerHeight:"6",refX:"5.25",refY:"3",orient:"auto",children:N.jsx("polygon",{points:"0 0, 6 3, 0 6",fill:"#000"})})}),k.map((L,E)=>N.jsx("path",{d:gn(L.type,L.fromX,L.fromY,L.toX,L.toY),fill:"none",markerEnd:"url(#arrowhead)",style:{stroke:"#000",strokeWidth:.75}},E))]})]})}function Dn({tasks:n,onTasksChange:s}){const[r,o]=A.useState(n||[]),u=A.useRef(null),{rawTasks:e,transformedTasks:f,selectedScale:i,setSelectedScale:p,bottomRowCells:h,topHeaderGroups:m,setRawTasks:a,setBottomRowCells:c,setTopHeaderGroups:S,setMinDate:v,setMaxDate:l}=ve();return A.useEffect(()=>{n.length===0?o(mn):o(n)},[n]),A.useEffect(()=>{if(!r.length)return;const $=Object.fromEntries(r.map(T=>[T.id,{startDate:T.startDate,endDate:T.endDate}]));vt($,i,v,l,c,S)},[r,i]),A.useEffect(()=>{!h.length||!r.length||e.length===0&&a(r)},[h,r]),N.jsx("div",{className:"bg-base-50 h-full w-full overflow-hidden",children:N.jsxs("section",{className:"relative flex h-full w-full flex-col",children:[N.jsx("div",{className:"fixed top-0.75 right-4 z-40",children:N.jsx("select",{className:"bg-base-50 rounded-md px-2 py-0.5 text-sm font-medium",value:i,onChange:$=>{const T=$.target.value;p(T)},children:Object.keys(K).map($=>N.jsx("option",{value:$,children:K[$].labelUnit},$))})}),N.jsx("div",{ref:u,className:"grow overflow-x-auto",children:N.jsxs("div",{className:"flex min-w-max flex-col",children:[N.jsx(Dt,{topHeaderGroups:m,bottomRowCells:h,selectedScale:i,scrollRef:u}),N.jsx("div",{className:"relative flex",children:N.jsx("div",{className:"flex grow flex-col",children:f.map($=>N.jsx("div",{className:"border-base-300 bg-base-100 flex w-full items-center border-b border-solid",style:{height:`${at}px`},children:N.jsx(vn,{allTasks:f,currentTask:$,onTasksChange:s})},$.id))})})]})})]})})}exports.ReactGanttChart=Dn;
|