iris-gantt 1.3.1 → 1.3.2
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/Gantt/Gantt.d.ts.map +1 -1
- package/dist/Gantt/types.d.ts +2 -0
- package/dist/Gantt/types.d.ts.map +1 -1
- package/dist/iris-gantt.js +900 -893
- package/dist/iris-gantt.umd.cjs +13 -13
- package/package.json +2 -2
package/dist/iris-gantt.umd.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
(function(W,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("antd"),require("@fortawesome/react-fontawesome"),require("@fortawesome/free-solid-svg-icons"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","react","antd","@fortawesome/react-fontawesome","@fortawesome/free-solid-svg-icons","dayjs"],g):(W=typeof globalThis<"u"?globalThis:W||self,g(W.IrisGantt={},W.React,W.antd,W.ReactFontawesome,W.FontAwesomeSolid,W.dayjs))})(this,(function(W,g,p,ce,G,Et){"use strict";var at={exports:{}},Ze={};var $t;function Jt(){if($t)return Ze;$t=1;var t=g,a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function
|
|
2
|
-
`+
|
|
3
|
-
`),
|
|
4
|
-
`),ee=
|
|
5
|
-
`+
|
|
1
|
+
(function(W,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("antd"),require("@fortawesome/react-fontawesome"),require("@fortawesome/free-solid-svg-icons"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","react","antd","@fortawesome/react-fontawesome","@fortawesome/free-solid-svg-icons","dayjs"],g):(W=typeof globalThis<"u"?globalThis:W||self,g(W.IrisGantt={},W.React,W.antd,W.ReactFontawesome,W.FontAwesomeSolid,W.dayjs))})(this,(function(W,g,p,ce,G,Et){"use strict";var at={exports:{}},Ze={};var $t;function Jt(){if($t)return Ze;$t=1;var t=g,a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function m(i,s,b){var c,w={},T=null,u=null;b!==void 0&&(T=""+b),s.key!==void 0&&(T=""+s.key),s.ref!==void 0&&(u=s.ref);for(c in s)l.call(s,c)&&!y.hasOwnProperty(c)&&(w[c]=s[c]);if(i&&i.defaultProps)for(c in s=i.defaultProps,s)w[c]===void 0&&(w[c]=s[c]);return{$$typeof:a,type:i,key:T,ref:u,props:w,_owner:r.current}}return Ze.Fragment=o,Ze.jsx=m,Ze.jsxs=m,Ze}var Ke={};var Ft;function Gt(){return Ft||(Ft=1,process.env.NODE_ENV!=="production"&&(function(){var t=g,a=Symbol.for("react.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),i=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),u=Symbol.for("react.offscreen"),h=Symbol.iterator,v="@@iterator";function S(n){if(n===null||typeof n!="object")return null;var x=h&&n[h]||n[v];return typeof x=="function"?x:null}var D=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function $(n){{for(var x=arguments.length,k=new Array(x>1?x-1:0),N=1;N<x;N++)k[N-1]=arguments[N];F("error",n,k)}}function F(n,x,k){{var N=D.ReactDebugCurrentFrame,V=N.getStackAddendum();V!==""&&(x+="%s",k=k.concat([V]));var C=k.map(function(B){return String(B)});C.unshift("Warning: "+x),Function.prototype.apply.call(console[n],console,C)}}var H=!1,ae=!1,X=!1,fe=!1,E=!1,K;K=Symbol.for("react.module.reference");function q(n){return!!(typeof n=="string"||typeof n=="function"||n===l||n===y||E||n===r||n===b||n===c||fe||n===u||H||ae||X||typeof n=="object"&&n!==null&&(n.$$typeof===T||n.$$typeof===w||n.$$typeof===m||n.$$typeof===i||n.$$typeof===s||n.$$typeof===K||n.getModuleId!==void 0))}function M(n,x,k){var N=n.displayName;if(N)return N;var V=x.displayName||x.name||"";return V!==""?k+"("+V+")":k}function U(n){return n.displayName||"Context"}function se(n){if(n==null)return null;if(typeof n.tag=="number"&&$("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case l:return"Fragment";case o:return"Portal";case y:return"Profiler";case r:return"StrictMode";case b:return"Suspense";case c:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case i:var x=n;return U(x)+".Consumer";case m:var k=n;return U(k._context)+".Provider";case s:return M(n,n.render,"ForwardRef");case w:var N=n.displayName||null;return N!==null?N:se(n.type)||"Memo";case T:{var V=n,C=V._payload,B=V._init;try{return se(B(C))}catch{return null}}}return null}var Z=Object.assign,ye=0,$e,De,_,Y,pe,te,re;function Q(){}Q.__reactDisabledLog=!0;function f(){{if(ye===0){$e=console.log,De=console.info,_=console.warn,Y=console.error,pe=console.group,te=console.groupCollapsed,re=console.groupEnd;var n={configurable:!0,enumerable:!0,value:Q,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}ye++}}function L(){{if(ye--,ye===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Z({},n,{value:$e}),info:Z({},n,{value:De}),warn:Z({},n,{value:_}),error:Z({},n,{value:Y}),group:Z({},n,{value:pe}),groupCollapsed:Z({},n,{value:te}),groupEnd:Z({},n,{value:re})})}ye<0&&$("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var P=D.ReactCurrentDispatcher,A;function R(n,x,k){{if(A===void 0)try{throw Error()}catch(V){var N=V.stack.trim().match(/\n( *(at )?)/);A=N&&N[1]||""}return`
|
|
2
|
+
`+A+n}}var le=!1,ne;{var Fe=typeof WeakMap=="function"?WeakMap:Map;ne=new Fe}function de(n,x){if(!n||le)return"";{var k=ne.get(n);if(k!==void 0)return k}var N;le=!0;var V=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=P.current,P.current=null,f();try{if(x){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(Se){N=Se}Reflect.construct(n,[],B)}else{try{B.call()}catch(Se){N=Se}n.call(B.prototype)}}else{try{throw Error()}catch(Se){N=Se}n()}}catch(Se){if(Se&&N&&typeof Se.stack=="string"){for(var I=Se.stack.split(`
|
|
3
|
+
`),me=N.stack.split(`
|
|
4
|
+
`),ee=I.length-1,ue=me.length-1;ee>=1&&ue>=0&&I[ee]!==me[ue];)ue--;for(;ee>=1&&ue>=0;ee--,ue--)if(I[ee]!==me[ue]){if(ee!==1||ue!==1)do if(ee--,ue--,ue<0||I[ee]!==me[ue]){var ge=`
|
|
5
|
+
`+I[ee].replace(" at new "," at ");return n.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",n.displayName)),typeof n=="function"&&ne.set(n,ge),ge}while(ee>=1&&ue>=0);break}}}finally{le=!1,P.current=C,L(),Error.prepareStackTrace=V}var Ge=n?n.displayName||n.name:"",We=Ge?R(Ge):"";return typeof n=="function"&&ne.set(n,We),We}function ke(n,x,k){return de(n,!1)}function Be(n){var x=n.prototype;return!!(x&&x.isReactComponent)}function Pe(n,x,k){if(n==null)return"";if(typeof n=="function")return de(n,Be(n));if(typeof n=="string")return R(n);switch(n){case b:return R("Suspense");case c:return R("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case s:return ke(n.render);case w:return Pe(n.type,x,k);case T:{var N=n,V=N._payload,C=N._init;try{return Pe(C(V),x,k)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Oe={},tt=D.ReactDebugCurrentFrame;function ze(n){if(n){var x=n._owner,k=Pe(n.type,n._source,x?x.type:null);tt.setExtraStackFrame(k)}else tt.setExtraStackFrame(null)}function bt(n,x,k,N,V){{var C=Function.call.bind(Te);for(var B in n)if(C(n,B)){var I=void 0;try{if(typeof n[B]!="function"){var me=Error((N||"React class")+": "+k+" type `"+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof n[B]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw me.name="Invariant Violation",me}I=n[B](x,B,N,k,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ee){I=ee}I&&!(I instanceof Error)&&(ze(V),$("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",N||"React class",k,B,typeof I),ze(null)),I instanceof Error&&!(I.message in Oe)&&(Oe[I.message]=!0,ze(V),$("Failed %s type: %s",k,I.message),ze(null))}}}var it=Array.isArray;function Ce(n){return it(n)}function wt(n){{var x=typeof Symbol=="function"&&Symbol.toStringTag,k=x&&n[Symbol.toStringTag]||n.constructor.name||"Object";return k}}function Ie(n){try{return Me(n),!1}catch{return!0}}function Me(n){return""+n}function ve(n){if(Ie(n))return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",wt(n)),Me(n)}var lt=D.ReactCurrentOwner,Xt={key:!0,ref:!0,__self:!0,__source:!0},dt,ct;function vt(n){if(Te.call(n,"ref")){var x=Object.getOwnPropertyDescriptor(n,"ref").get;if(x&&x.isReactWarning)return!1}return n.ref!==void 0}function St(n){if(Te.call(n,"key")){var x=Object.getOwnPropertyDescriptor(n,"key").get;if(x&&x.isReactWarning)return!1}return n.key!==void 0}function rt(n,x){typeof n.ref=="string"&<.current}function jt(n,x){{var k=function(){dt||(dt=!0,$("%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://reactjs.org/link/special-props)",x))};k.isReactWarning=!0,Object.defineProperty(n,"key",{get:k,configurable:!0})}}function Tt(n,x){{var k=function(){ct||(ct=!0,$("%s: `ref` 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://reactjs.org/link/special-props)",x))};k.isReactWarning=!0,Object.defineProperty(n,"ref",{get:k,configurable:!0})}}var nt=function(n,x,k,N,V,C,B){var I={$$typeof:a,type:n,key:x,ref:k,props:B,_owner:C};return I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(I,"_self",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:V}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function Dt(n,x,k,N,V){{var C,B={},I=null,me=null;k!==void 0&&(ve(k),I=""+k),St(x)&&(ve(x.key),I=""+x.key),vt(x)&&(me=x.ref,rt(x,V));for(C in x)Te.call(x,C)&&!Xt.hasOwnProperty(C)&&(B[C]=x[C]);if(n&&n.defaultProps){var ee=n.defaultProps;for(C in ee)B[C]===void 0&&(B[C]=ee[C])}if(I||me){var ue=typeof n=="function"?n.displayName||n.name||"Unknown":n;I&&jt(B,ue),me&&Tt(B,ue)}return nt(n,I,me,V,N,lt.current,B)}}var qe=D.ReactCurrentOwner,ut=D.ReactDebugCurrentFrame;function Le(n){if(n){var x=n._owner,k=Pe(n.type,n._source,x?x.type:null);ut.setExtraStackFrame(k)}else ut.setExtraStackFrame(null)}var Xe;Xe=!1;function Je(n){return typeof n=="object"&&n!==null&&n.$$typeof===a}function ot(){{if(qe.current){var n=se(qe.current.type);if(n)return`
|
|
6
6
|
|
|
7
|
-
Check the render method of \``+n+"`."}return""}}function
|
|
7
|
+
Check the render method of \``+n+"`."}return""}}function kt(n){return""}var pt={};function d(n){{var x=ot();if(!x){var k=typeof n=="string"?n:n.displayName||n.name;k&&(x=`
|
|
8
8
|
|
|
9
|
-
Check the top-level render call using <`+k+">.")}return
|
|
9
|
+
Check the top-level render call using <`+k+">.")}return x}}function j(n,x){{if(!n._store||n._store.validated||n.key!=null)return;n._store.validated=!0;var k=d(x);if(pt[k])return;pt[k]=!0;var N="";n&&n._owner&&n._owner!==qe.current&&(N=" It was passed a child from "+se(n._owner.type)+"."),Le(n),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',k,N),Le(null)}}function O(n,x){{if(typeof n!="object")return;if(Ce(n))for(var k=0;k<n.length;k++){var N=n[k];Je(N)&&j(N,x)}else if(Je(n))n._store&&(n._store.validated=!0);else if(n){var V=S(n);if(typeof V=="function"&&V!==n.entries)for(var C=V.call(n),B;!(B=C.next()).done;)Je(B.value)&&j(B.value,x)}}}function z(n){{var x=n.type;if(x==null||typeof x=="string")return;var k;if(typeof x=="function")k=x.propTypes;else if(typeof x=="object"&&(x.$$typeof===s||x.$$typeof===w))k=x.propTypes;else return;if(k){var N=se(x);bt(k,n.props,"prop",N,n)}else if(x.PropTypes!==void 0&&!Xe){Xe=!0;var V=se(x);$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V||"Unknown")}typeof x.getDefaultProps=="function"&&!x.getDefaultProps.isReactClassApproved&&$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ie(n){{for(var x=Object.keys(n.props),k=0;k<x.length;k++){var N=x[k];if(N!=="children"&&N!=="key"){Le(n),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",N),Le(null);break}}n.ref!==null&&(Le(n),$("Invalid attribute `ref` supplied to `React.Fragment`."),Le(null))}}var J={};function be(n,x,k,N,V,C){{var B=q(n);if(!B){var I="";(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(I+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var me=kt();me?I+=me:I+=ot();var ee;n===null?ee="null":Ce(n)?ee="array":n!==void 0&&n.$$typeof===a?(ee="<"+(se(n.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):ee=typeof n,$("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ee,I)}var ue=Dt(n,x,k,V,C);if(ue==null)return ue;if(B){var ge=x.children;if(ge!==void 0)if(N)if(Ce(ge)){for(var Ge=0;Ge<ge.length;Ge++)O(ge[Ge],n);Object.freeze&&Object.freeze(ge)}else $("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 O(ge,n)}if(Te.call(x,"key")){var We=se(n),Se=Object.keys(x).filter(function(Dr){return Dr!=="key"}),Lt=Se.length>0?"{key: someKey, "+Se.join(": ..., ")+": ...}":"{key: someKey}";if(!J[We+Lt]){var Tr=Se.length>0?"{"+Se.join(": ..., ")+": ...}":"{}";$(`A props object containing a "key" prop is being spread into JSX:
|
|
10
10
|
let props = %s;
|
|
11
11
|
<%s {...props} />
|
|
12
12
|
React keys must be passed directly to JSX without using spread:
|
|
13
13
|
let props = %s;
|
|
14
|
-
<%s key={someKey} {...props} />`,Lt,We,Tr,We),X[We+Lt]=!0}}return n===l?de(pe):z(pe),pe}}function oe(n,m,k){return ye(n,m,k,!0)}function ge(n,m,k){return ye(n,m,k,!1)}var _e=ge,ht=oe;Ke.Fragment=l,Ke.jsx=_e,Ke.jsxs=ht})()),Ke}var Pt;function Zt(){return Pt||(Pt=1,process.env.NODE_ENV==="production"?at.exports=Jt():at.exports=Gt()),at.exports}var e=Zt();const he=(t,a,o)=>{const l=new Date(t);switch(o){case"hour":l.setHours(l.getHours()+a);break;case"day":l.setDate(l.getDate()+a);break;case"week":l.setDate(l.getDate()+a*7);break;case"month":l.setMonth(l.getMonth()+a);break;case"quarter":l.setMonth(l.getMonth()+a*3);break;case"year":l.setFullYear(l.getFullYear()+a);break}return l},Qe=(t,a)=>{const o=a.getTime()-t.getTime();return Math.ceil(o/(1e3*60*60*24))},Ot=(t,a)=>{const o=a.getTime()-t.getTime();return Math.ceil(o/(1e3*60*60))},me=(t,a)=>{const o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],y={YYYY:t.getFullYear().toString(),YY:t.getFullYear().toString().slice(-2),MMMM:l[t.getMonth()],MMM:o[t.getMonth()],MM:String(t.getMonth()+1).padStart(2,"0"),M:String(t.getMonth()+1),DD:String(t.getDate()).padStart(2,"0"),D:String(t.getDate()),dddd:r[t.getDay()],HH:String(t.getHours()).padStart(2,"0"),H:String(t.getHours()),mm:String(t.getMinutes()).padStart(2,"0"),m:String(t.getMinutes())};return a.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g,x=>y[x])},ft=t=>{const a=t.getDay();return a===0||a===6},mt=(t,a)=>a.some(o=>o.getFullYear()===t.getFullYear()&&o.getMonth()===t.getMonth()&&o.getDate()===t.getDate()),Ye=t=>{const a=new Date(t);return a.setHours(0,0,0,0),a},Kt=t=>{const a=new Date(t);return a.setHours(23,59,59,999),a},Qt=(t,a,o="day")=>{switch(o){case"hour":return Ot(t,a);case"day":return Qe(t,a);case"week":return Math.ceil(Qe(t,a)/7);case"month":return(a.getFullYear()-t.getFullYear())*12+(a.getMonth()-t.getMonth());default:return Qe(t,a)}};function er(t){if(!t||typeof t!="string")return null;const a=t.trim(),o=/^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i,l=a.match(o);if(!l)return null;const r=parseInt(l[1],10),y=l[2].toUpperCase();let x=0,i="day";if(l[3]){const s=l[4]==="-"?-1:1;switch(x=parseInt(l[5],10)*s,l[6].toLowerCase()){case"d":i="day";break;case"h":i="hour";break;case"w":i="week";break;case"m":i="month";break}}return{taskNumber:r,type:y,lag:x,lagUnit:i}}function xt(t,a){switch(a){case"hour":return t/24;case"day":return t;case"week":return t*7;case"month":return t*30;default:return t}}function tr(t,a){const l={e2s:"FS",s2s:"SS",e2e:"FF",s2e:"SF"}[t.type];let r=`${a}${l}`;if(t.lag&&t.lag!==0){const y=t.lag>0?"+":"",i=(t.lagUnit||"day").charAt(0);let s=t.lag;if(t.lagUnit&&t.lagUnit!=="day")switch(t.lagUnit){case"hour":s=t.lag*24;break;case"week":s=t.lag/7;break;case"month":s=t.lag/30;break}r+=`${y}${Math.round(s)}${i}`}return r}function rr(t){return{FS:"e2s",SS:"s2s",FF:"e2e",SF:"s2e"}[t]}const He=t=>t?{popover:{backgroundColor:t.popoverBackground||"#fff",borderColor:t.popoverBorderColor||"#f0f0f0",borderRadius:t.popoverBorderRadius||"8px",boxShadow:t.popoverShadow||"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",padding:t.popoverPadding||"0",fontFamily:t.popoverFontFamily||t.fontFamily||"inherit",fontSize:t.popoverFontSize||t.fontSize||"14px"},modal:{backgroundColor:t.modalBackground||"#fff",borderRadius:t.modalBorderRadius||"8px",borderColor:t.modalBorderColor||"#f0f0f0",boxShadow:t.modalShadow||"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)"},buttonPrimary:{backgroundColor:t.buttonPrimaryBackground||"#1677ff",color:t.buttonPrimaryColor||"#fff",borderRadius:t.buttonPrimaryBorderRadius||"6px",fontWeight:t.buttonPrimaryFontWeight||400,fontFamily:t.buttonPrimaryFontFamily||t.fontFamily||"inherit",boxShadow:"0 2px 0 rgba(5, 145, 255, 0.1)"},buttonDanger:{backgroundColor:t.buttonDangerBackground||"#ff4d4f",color:t.buttonDangerColor||"#fff",borderRadius:t.buttonPrimaryBorderRadius||"6px",boxShadow:"0 2px 0 rgba(255, 38, 5, 0.06)"},buttonSecondary:{backgroundColor:t.buttonSecondaryBackground||"transparent",color:t.buttonSecondaryColor||"rgba(0, 0, 0, 0.88)",borderColor:t.buttonSecondaryBorderColor||"#d9d9d9",borderRadius:t.buttonPrimaryBorderRadius||"6px",boxShadow:"0 2px 0 rgba(0, 0, 0, 0.02)"},input:{backgroundColor:t.inputBackground,borderColor:t.inputBorderColor,borderRadius:t.inputBorderRadius||"6px",fontFamily:t.inputFontFamily||t.fontFamily||"inherit",fontSize:t.inputFontSize||t.fontSize||"14px"},listItem:{hoverBackground:t.listItemHoverBackground||"#f5f5f5",selectedBackground:t.listItemSelectedBackground||"#e6f4ff",borderColor:t.listItemBorderColor||"#f0f0f0"},badge:{backgroundColor:t.badgeBackground||"#e6f4ff",borderColor:t.badgeBorderColor||"transparent",color:t.badgeColor||"#1677ff",fontSize:t.badgeFontSize||"12px",padding:t.badgePadding||"0 7px",borderRadius:t.badgeBorderRadius||"10px"},link:{color:t.linkColor||"#1677ff",hoverColor:t.linkHoverColor||"#69b1ff",fontWeight:t.linkFontWeight||400},font:{fontFamily:t.fontFamily||"inherit",fontSize:t.fontSize||"14px",fontWeight:t.fontWeight||400,lineHeight:t.lineHeight||1.5714285714285714,color:t.fontColor||"rgba(0, 0, 0, 0.88)"}}:{},{Text:je,Paragraph:nr}=p.Typography,{Option:Ne}=p.Select,or=({task:t,allTasks:a,links:o,onAddDependency:l,onRemoveDependency:r,onTaskUpdate:y,children:x,styleConfig:i})=>{const s=He(i),[b,c]=g.useState(!1),[w,T]=g.useState(null),[u,h]=g.useState("e2s"),[v,j]=g.useState("lag"),[D,$]=g.useState(0),[P,H]=g.useState(t.duration),[ae,J]=g.useState(!0),fe="day",E=o.find(I=>I.target===t.id),K=!!E,V=g.useMemo(()=>a.length===0?new Date:new Date(Math.min(...a.map(I=>I.start.getTime()))),[a]),M=()=>{if(w){const I=v==="lag"?D:-D,Y=xt(I,fe);if(P!==t.duration&&y){const ue=he(new Date(t.start),P,"day");y({...t,duration:P,end:ue})}l(w,t.id,u,Y),c(!1),U()}},U=()=>{T(null),h("e2s"),j("lag"),$(0),H(t.duration)},se=()=>{E&&r&&(r(E.id),c(!1),U())},Z=I=>{if(c(I),I){if(J(!0),E){T(E.source),h(E.type);const Y=E.lag||0;Y>=0?(j("lag"),$(Y)):(j("lead"),$(Math.abs(Y)))}else U();H(t.duration)}},xe=()=>{if(!ae)return null;const I=u==="e2s",Y=u==="s2s",ue=u==="e2e",te=u==="s2e";let re=0,Q=0,f="",L=0,O=-1;I?(re=50,Q=350,L=250,O=350,f="M 250 60 L 300 60 L 300 140 L 348 140"):ue?(re=100,Q=100,L=300,O=-1,f="M 300 60 L 350 60 L 350 140 L 302 140"):Y?(re=250,Q=250,L=250,O=-1,f="M 250 60 L 200 60 L 200 140 L 248 140"):te&&(re=350,Q=50,L=350,O=250,f="M 350 60 L 300 60 L 300 140 L 252 140");const N=w==="gantt-start-date",R=a.find(ie=>ie.id===w);return e.jsx("div",{style:{width:"100%",height:90,backgroundColor:"#fbfbfb",borderRadius:4,marginBottom:12,border:"1px solid #f0f0f0",position:"relative",overflow:"hidden",flexShrink:0},children:e.jsxs("svg",{viewBox:"0 0 600 200",style:{width:"100%",height:"100%"},preserveAspectRatio:"xMidYMid meet",children:[e.jsx("defs",{children:e.jsx("marker",{id:"arrowhead",markerWidth:"12",markerHeight:"9",refX:"12",refY:"4.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 12 4.5, 0 9",fill:"#8c8c8c"})})}),e.jsx("line",{x1:L,x2:L,y1:"0",y2:"200",stroke:"#f0f0f0",strokeDasharray:"3,3"}),O!==-1&&e.jsx("line",{x1:O,x2:O,y1:"0",y2:"200",stroke:"#f0f0f0",strokeDasharray:"3,3"}),e.jsx("rect",{x:re,y:"35",width:"200",height:"50",rx:"4",fill:"#e6f4ff",stroke:"#91caff",strokeWidth:"2"}),e.jsx("text",{x:re+100,y:"66",fontSize:"15",textAnchor:"middle",fill:"#003a8c",fontWeight:"600",children:N?"Start Date":R?`Stage ${a.indexOf(R)+1}`:"Predecessor"}),e.jsx("rect",{x:Q,y:"115",width:"200",height:"50",rx:"4",fill:"#e6f4ff",stroke:"#91caff",strokeWidth:"2"}),e.jsxs("text",{x:Q+100,y:"146",fontSize:"15",textAnchor:"middle",fill:"#003a8c",fontWeight:"600",children:["Stage ",a.indexOf(t)+1]}),e.jsx("path",{d:f,fill:"none",stroke:"#8c8c8c",strokeWidth:"2.5",markerEnd:"url(#arrowhead)"})]})})},$e=()=>{const I=w==="gantt-start-date",Y=a.find(Q=>Q.id===w);if(!w)return"Select a checklist from the list to see how it will relate to the current stage.";const ue=a.indexOf(t)+1,te=I?"Start Date":`Stage ${a.indexOf(Y)+1}`;let re="";switch(u){case"e2s":re=`Stage ${ue} starts after ${te} finishes`;break;case"s2s":re=`Stage ${ue} starts when ${te} starts`;break;case"e2e":re=`Stage ${ue} finishes when ${te} finishes`;break;case"s2e":re=`Stage ${ue} finishes when ${te} starts`;break}if(D>0){const Q=`${D} ${fe}${D>1?"s":""}`;v==="lag"?re+=` + ${Q} delay`:re+=` - ${Q} overlap`}return re+"."},De=e.jsxs("div",{style:{width:550,backgroundColor:s.popover?.backgroundColor||"#fff",borderRadius:s.popover?.borderRadius||"8px",padding:"16px 20px",boxShadow:s.popover?.boxShadow,fontFamily:s.popover?.fontFamily},children:[e.jsx(je,{strong:!0,style:{fontSize:"16px",display:"block",marginBottom:16,color:s.font?.color},children:"Add Dependency"}),e.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14},children:[e.jsx("div",{style:{flex:1},children:e.jsxs(p.Select,{showSearch:!0,placeholder:"Select checklist",value:w,onChange:T,style:{width:"100%"},filterOption:(I,Y)=>{if(Y?.value==="gantt-start-date")return"start date".includes(I.toLowerCase());const ue=a.find(re=>re.id===Y?.value);if(!ue)return!1;const te=a.indexOf(ue)+1;return ue.text.toLowerCase().includes(I.toLowerCase())||te.toString().includes(I)},optionLabelProp:"label",children:[a.filter(I=>I.id!==t.id).map(I=>e.jsx(Ne,{value:I.id,label:I.text,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:"4px 0"},children:[e.jsxs(je,{style:{fontSize:"13px"},children:[a.indexOf(I)+1,". ",I.text]}),e.jsxs(je,{type:"secondary",style:{fontSize:"11px"},children:["Start: ",me(I.start,"MMM D, YYYY")]})]})},I.id)),e.jsx(Ne,{value:"gantt-start-date",label:"Start Date",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:"4px 0",borderTop:"1px solid #f0f0f0",marginTop:"4px",paddingTop:"8px"},children:[e.jsx(je,{style:{fontSize:"13px",fontWeight:600},children:"Start Date"}),e.jsx(je,{type:"secondary",style:{fontSize:"11px"},children:me(V,"MMM D, YYYY")})]})},"gantt-start-date")]})}),e.jsx("div",{style:{width:100},children:e.jsxs(p.Select,{value:u,onChange:h,style:{width:"100%"},children:[e.jsx(Ne,{value:"e2s",children:"FS"}),e.jsx(Ne,{value:"e2e",children:"FF"}),e.jsx(Ne,{value:"s2s",children:"SS"}),e.jsx(Ne,{value:"s2e",children:"SF"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Delay type"}),e.jsxs(p.Select,{value:v,onChange:j,style:{width:"100%"},children:[e.jsx(Ne,{value:"lag",children:"Lag by"}),e.jsx(Ne,{value:"lead",children:"Lead by"})]})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Days"}),e.jsx(p.InputNumber,{min:0,value:D,onChange:I=>$(I||0),style:{width:"100%"},placeholder:"0"})]})]}),e.jsxs("div",{style:{marginBottom:14},children:[e.jsx(je,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Duration (days)"}),e.jsx(p.InputNumber,{min:1,value:P,onChange:I=>H(I||1),style:{width:"100%"},placeholder:"Duration"})]}),e.jsx("div",{style:{backgroundColor:"#f5f5f5",padding:"10px 12px",borderRadius:"4px",marginBottom:14},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"},children:[e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"FS: Finish to Start"}),e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"SS: Start to Start"}),e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"FF: Finish to Finish"}),e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"SF: Start to Finish"})]})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[e.jsx(je,{strong:!0,style:{fontSize:"13px",color:s.font?.color},children:"Dependency preview"}),e.jsx("a",{onClick:()=>J(!ae),style:{fontSize:"12px",color:"#1890ff",cursor:"pointer",textDecoration:"none"},children:ae?"Hide preview":"Show preview"})]}),ae&&e.jsxs(e.Fragment,{children:[xe(),e.jsx(nr,{style:{fontSize:"12px",color:s.font?.color||"#262626",marginBottom:14,lineHeight:"1.5"},children:$e()})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[K&&e.jsx(p.Button,{danger:!0,onClick:se,style:{...s.buttonDanger},children:"Remove Dependency"}),e.jsx(p.Button,{type:"primary",onClick:M,disabled:!w,style:{...s.buttonPrimary,minWidth:100},children:K?"Update":"Add"})]})]});return e.jsx(p.Popover,{content:De,trigger:"click",open:b,onOpenChange:Z,placement:"bottomLeft",overlayClassName:"dependency-popover",overlayInnerStyle:{padding:0},children:x})},yt=g.memo(g.forwardRef(({tasks:t,allTasks:a=[],columns:o,selectedTask:l,onTaskClick:r,onTaskContextMenu:y,onTaskUpdate:x,onTaskDragStart:i,onAddTask:s,onAddDependency:b,onRemoveDependency:c,links:w=[],dropIndicator:T,reorderTask:u,styleConfig:h},v)=>{const j=g.useRef(null);g.useImperativeHandle(v,()=>j.current);const[D,$]=g.useState(null),[P,H]=g.useState(0),ae=(E,K=0)=>{if(!E.parent)return K;const V=t.find(M=>M.id===E.parent);return V?ae(V,K+1):K},J=(E,K)=>{if(K===E.duration)return;const V=he(new Date(E.start),K,"day");x?.({...E,duration:K,end:V})},fe=(E,K)=>{if(K.template)return K.template(E);switch(K.name){case"text":{const V=ae(E);return e.jsxs("div",{className:"gantt-grid-cell-text",style:{paddingLeft:V*14},children:[e.jsx("div",{className:"gantt-row-drag-handle",onMouseDown:M=>{M.preventDefault(),i?.(E.id,M.clientX,M.clientY,"reorder")},children:e.jsx(ce.FontAwesomeIcon,{icon:G.faGripVertical})}),E.type==="project"?e.jsx("span",{className:"gantt-tree-icon",onClick:M=>{M.stopPropagation(),x?.({...E,open:!E.open})},children:e.jsx(ce.FontAwesomeIcon,{icon:E.open?G.faChevronDown:G.faChevronRight})}):e.jsx("span",{style:{width:16,display:"inline-block"}}),e.jsx("span",{className:"gantt-task-name-text",children:E.text})]})}case"start":return me(E.start,"DD-MM-YYYY");case"end":return me(E.end,"DD-MM-YYYY");case"duration":return D===E.id?e.jsx(p.InputNumber,{size:"small",min:1,value:P,onChange:M=>H(M||1),onBlur:()=>{J(E,P),$(null)},onPressEnter:()=>{J(E,P),$(null)},autoFocus:!0,style:{width:"100%",fontSize:"12px"}}):e.jsxs("div",{onClick:M=>{M.stopPropagation(),$(E.id),H(E.duration)},style:{backgroundColor:"#fff7e6",padding:"2px 8px",borderRadius:"4px",border:"1px solid #ffd591",fontWeight:400,color:"#d46b08",display:"inline-block",fontSize:"12px",cursor:"text"},children:[E.duration," day",E.duration!==1?"s":""]});case"predecessors":{const M=w.filter(U=>U.target===E.id)[0];return e.jsx(or,{task:E,allTasks:a,links:w,onAddDependency:(U,se,Z,xe)=>b?.(U,se,Z,xe),onRemoveDependency:U=>c?.(U),onTaskUpdate:x,styleConfig:h,children:e.jsx("div",{style:{cursor:"pointer",minHeight:"24px",width:"100%",display:"flex",alignItems:"center",gap:"4px"},children:M?(()=>{const U=a.find(Z=>Z.id===M.source),se=U?a.indexOf(U)+1:0;return e.jsx("span",{style:{fontSize:"12px",backgroundColor:"#e6f4ff",border:"1px solid #91caff",color:"#1677ff",padding:"0 7px",borderRadius:"4px",whiteSpace:"nowrap"},children:tr(M,se)})})():e.jsx("span",{style:{fontSize:"12px",color:"#1890ff",textDecoration:"none",fontWeight:500},onMouseEnter:U=>U.currentTarget.style.textDecoration="underline",onMouseLeave:U=>U.currentTarget.style.textDecoration="none",children:"Add"})})})}case"add":return e.jsx(p.Button,{type:"primary",size:"small",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faPlus,style:{fontSize:12}}),onClick:V=>{V.stopPropagation(),s?.(E.id)},title:"Add Subtask",style:{minWidth:"28px",width:"28px",height:"28px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px"}});case"progress":return e.jsxs("div",{className:"gantt-progress-cell",children:[e.jsx("div",{className:"gantt-progress-bar-bg",children:e.jsx("div",{className:"gantt-progress-bar-fill",style:{width:`${E.progress}%`}})}),e.jsxs("span",{className:"gantt-progress-text",children:[E.progress,"%"]})]});case"index":return e.jsx("span",{style:{color:"#8c8c8c"},children:a.indexOf(E)+1});default:return E[K.name]||""}};return e.jsxs("div",{className:"gantt-grid",ref:j,children:[e.jsx("div",{className:"gantt-grid-header",style:{display:"flex",minWidth:"100%"},children:o.map(E=>e.jsx("div",{className:"gantt-grid-header-cell",style:{width:E.width,minWidth:E.width,justifyContent:E.align==="center"?"center":"flex-start"},children:E.name==="add"?e.jsx("span",{style:{fontSize:11,color:"#64748b",fontWeight:600,whiteSpace:"nowrap"},children:"Add"}):e.jsxs(e.Fragment,{children:[E.label,E.name==="start"&&e.jsx(ce.FontAwesomeIcon,{icon:G.faChevronDown,style:{marginLeft:8,fontSize:10,color:"#64748b"}})]})},E.name))}),e.jsx("div",{className:"gantt-grid-body",children:t.map(E=>{const K=u?.id===E.id,V=u?.descendantIds.includes(E.id);return e.jsxs("div",{className:`gantt-grid-row ${l===E.id?"selected":""} ${K?"dragging-row":""} ${V?"descendant-dragging-row":""} ${T?.taskId===E.id?`drop-target-${T.position}`:""}`,onClick:()=>r(E.id),onContextMenu:M=>y?.(M,E.id),style:{display:"flex",minWidth:"100%"},children:[o.map(M=>{const U=M.name==="add";return e.jsx("div",{className:"gantt-grid-cell",style:{width:M.width,minWidth:M.width,textAlign:M.align||"left",display:"flex",alignItems:"center",justifyContent:U?"center":M.name==="text"?"flex-start":M.align==="center"?"center":M.align==="right"?"flex-end":"flex-start",visibility:"visible",opacity:1},children:fe(E,M)},`${E.id}-${M.name}`)}),T?.taskId===E.id&&e.jsx("div",{className:`gantt-drop-indicator ${T.position}`})]},E.id)})})]})}));yt.displayName="Grid";const Ct=({task:t,position:a,selected:o,dragging:l,onClick:r,onDragStart:y,dragDeltaX:x=0,dragType:i=null,readonly:s=!1})=>{const b=(h,v)=>{s||(h.preventDefault(),h.stopPropagation(),y(h.clientX,h.clientY,v))},c=()=>{const h=["gantt-task-bar"];return t.type==="milestone"&&h.push("milestone"),t.type==="project"&&h.push("project"),o&&h.push("selected"),l&&h.push("dragging"),t.status&&h.push(`status-${t.status}`),h.join(" ")},w=()=>{let h=a.left,v=a.width;return l&&i&&(i==="move"?h+=x:i==="resize-left"?(h+=x,v-=x):i==="resize-right"&&(v+=x)),{left:`${h}px`,width:`${Math.max(v,0)}px`,backgroundColor:t.color||void 0}},T=(h=!1)=>e.jsxs(e.Fragment,{children:[!s&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-left",onMouseDown:v=>b(v,"resize-left")}),!h&&t.type!=="milestone"&&e.jsx("div",{className:"gantt-task-progress",style:{width:`${t.progress}%`},children:t.progress>5&&t.progress<100&&e.jsxs("span",{className:"gantt-task-progress-text",children:[t.progress,"%"]})}),e.jsx("div",{className:"gantt-task-content",children:!h&&e.jsx("span",{className:"gantt-task-text",children:t.text})}),!s&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-right",onMouseDown:v=>b(v,"resize-right")})]}),u=e.jsxs("div",{className:"gantt-tooltip",children:[e.jsx("div",{className:"gantt-tooltip-title",children:t.text}),e.jsxs("div",{className:"gantt-tooltip-dates",children:[me(t.start,"MMM D")," - ",me(t.end,"MMM D")]}),e.jsxs("div",{className:"gantt-tooltip-progress",children:["Progress: ",t.progress,"%"]}),t.owner&&e.jsxs("div",{className:"gantt-tooltip-owner",children:["Owner: ",t.owner]})]});if(t.segments&&t.segments.length>0||t.onHoldPeriods&&t.onHoldPeriods.length>0){const h=t.end.getTime()-t.start.getTime(),v=t.segments&&t.segments.length>0?t.segments:[{start:t.start,end:t.end,duration:t.duration||0}];return e.jsxs("div",{className:"gantt-task-group",children:[t.onHoldPeriods?.map((j,D)=>e.jsx("div",{className:"gantt-on-hold-period",style:{left:`${a.left+(j.start.getTime()-t.start.getTime())/h*a.width}px`,width:`${(j.end.getTime()-j.start.getTime())/h*a.width}px`}},`hold-${D}`)),v.map((j,D)=>e.jsx(p.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:c()+" segment",style:{left:`${a.left+(j.start.getTime()-t.start.getTime())/h*a.width}px`,width:`${(j.end.getTime()-j.start.getTime())/h*a.width}px`,backgroundColor:t.color||void 0},onClick:r,onMouseDown:$=>b($,"move"),children:T(D>0)})},`seg-${D}`))]})}return e.jsx(p.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:c(),style:w(),onClick:r,onMouseDown:h=>b(h,"move"),children:T()})})},ar=({links:t,tasks:a,getTaskPosition:o})=>{const l=i=>a.find(s=>s.id===i),r=g.useMemo(()=>{let i=0,s=0;return a.forEach(b=>{try{const c=o(b);c&&typeof c.left=="number"&&typeof c.width=="number"&&(i=Math.max(i,c.left+c.width)),c&&typeof c.top=="number"&&typeof c.height=="number"&&(s=Math.max(s,c.top+c.height))}catch(c){console.warn("Failed to position task for link rendering:",b.id,c)}}),{width:Math.max(i,1e3),height:Math.max(s,100)}},[a,o]),y=i=>{const s=l(i.source),b=l(i.target);if(!s||!b)return"";const c=o(s),w=o(b),T=c.top+c.height/2,u=w.top+w.height/2;let h=0,v=0;switch(i.type){case"e2s":h=c.left+c.width,v=w.left;break;case"s2s":h=c.left,v=w.left;break;case"e2e":h=c.left+c.width,v=w.left+w.width;break;case"s2e":h=c.left,v=w.left+w.width;break}const j=v-h,D=u-T,$=20;if(i.type==="e2s")if(j>=$){const P=h+j/2;return`M ${h},${T} L ${P},${T} L ${P},${u} L ${v},${u}`}else{const P=$/2,H=T+D/2;return`M ${h},${T} L ${h+P},${T} L ${h+P},${H} L ${v-P},${H} L ${v-P},${u} L ${v},${u}`}else if(i.type==="s2s"){const P=Math.min(h,v)-$/2;return`M ${h},${T} L ${P},${T} L ${P},${u} L ${v},${u}`}else if(i.type==="e2e"){const P=Math.max(h,v)+$/2;return`M ${h},${T} L ${P},${T} L ${P},${u} L ${v},${u}`}else if(i.type==="s2e")if(j<=-$){const P=h+j/2;return`M ${h},${T} L ${P},${T} L ${P},${u} L ${v},${u}`}else{const P=$/2,H=T+D/2;return`M ${h},${T} L ${h-P},${T} L ${h-P},${H} L ${v+P},${H} L ${v+P},${u} L ${v},${u}`}return""},x=i=>{const s=l(i.target);if(!s)return"";const b=o(s),c=b.top+b.height/2,w=8,T=6;let u=0,h=!0;return i.type==="e2s"||i.type==="s2s"?(u=b.left,h=!0):(u=b.left+b.width,h=!1),h?`M ${u},${c} L ${u-w},${c-T/2} L ${u-w},${c+T/2} Z`:`M ${u},${c} L ${u+w},${c-T/2} L ${u+w},${c+T/2} Z`};return t.length===0?null:e.jsx("svg",{className:"gantt-links-layer",style:{overflow:"visible",width:r.width,height:r.height,position:"absolute",top:0,left:0,pointerEvents:"none"},children:t.map(i=>{const s=l(i.source),b=l(i.target);if(!s||!b)return null;const c=y(i),w=x(i);return!c||!w?null:e.jsxs("g",{className:"gantt-link",children:[e.jsx("path",{d:c,fill:"none",strokeWidth:"1.5",className:"gantt-link-line"}),e.jsx("path",{d:w,className:"gantt-link-arrow"})]},i.id)})})},sr=(t,a,o=60,l="day",r=1)=>{const[y,x]=g.useState({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0}),i=g.useCallback((c,w,T,u)=>{const h=t.find(v=>v.id===c);h&&x({taskId:c,initialX:w,initialY:T,initialStart:new Date(h.start),initialEnd:new Date(h.end),type:u,dragDeltaX:0,dragDeltaY:0})},[t]),s=g.useCallback((c,w)=>{if(!y.taskId||!y.type)return null;const T=c-y.initialX,u=w-y.initialY;if(x(P=>({...P,dragDeltaX:T,dragDeltaY:u})),y.type==="reorder")return null;const h=t.find(P=>P.id===y.taskId);if(!h)return null;const v=Math.round(T/o);let j=new Date(y.initialStart),D=new Date(y.initialEnd);switch(y.type){case"move":j=he(y.initialStart,v*r,l),D=he(y.initialEnd,v*r,l);break;case"resize-left":j=he(y.initialStart,v*r,l),j>=D&&(j=he(D,-r,l));break;case"resize-right":D=he(y.initialEnd,v*r,l),D<=j&&(D=he(j,r,l));break}const $=Qe(j,D);return{...h,start:j,end:D,duration:$}},[y,t,o,r,l]),b=g.useCallback(c=>{if(c&&a){const{id:w,...T}=c;a(w,T)}x({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0})},[a]);return{dragState:y,handleDragStart:i,handleDrag:s,handleDragEnd:b}},gt=g.forwardRef(({tasks:t,links:a,range:o,scales:l,config:r,selectedTask:y,onTaskClick:x,onTaskDragStart:i,onTaskDragEnd:s,onTaskUpdate:b,zoomLevel:c,baselines:w},T)=>{const[u,h]=g.useState(t),v=(r.columnWidth||60)*c,j=r.baselines&&w&&w.size>0,{dragState:D,handleDragStart:$,handleDrag:P,handleDragEnd:H}=sr(u,b,v,l[1].unit,l[1].step);g.useEffect(()=>{(t.length!==u.length||t.some((L,O)=>{const N=u[O];return!N||L.id!==N.id||L.start.getTime()!==N.start.getTime()||L.end.getTime()!==N.end.getTime()}))&&h(t)},[t]);const ae=g.useCallback(f=>{const L=[];let O=new Date(o.start);for(;O<=o.end;)L.push({date:new Date(O),label:me(O,f.format||"D")}),O=he(O,f.step,f.unit);return L},[o.start,o.end]),J=g.useCallback(f=>{const L=l[1],O=o.start.getTime(),R=f.getTime()-O,ne={hour:36e5,day:864e5,week:6048e5,month:2592e6,quarter:7776e6,year:31536e6}[L.unit]||864e5;return R/(ne*L.step)*v},[l,o.start,v]),fe=f=>{const L=J(f.start),O=J(f.end);return{left:L,width:Math.max(O-L,0)}},E=f=>{const L=J(f.start),O=J(f.end);return{left:L,width:Math.max(O-L,0)}},K=f=>{const L=fe(f),O=u.findIndex(ne=>ne.id===f.id),N=r.rowHeight||48,R=32,ie=(N-R)/2;return{left:L.left,width:L.width,top:O*N+ie,height:R}},V=g.useRef(null),M=g.useCallback(f=>{D.taskId&&D.type&&(V.current&&cancelAnimationFrame(V.current),V.current=requestAnimationFrame(()=>{const L=P(f.clientX,f.clientY);L&&h(O=>O.map(N=>N.id===L.id?L:N))}))},[D,P]),U=g.useCallback(()=>{if(D.taskId){const f=u.find(L=>L.id===D.taskId);H(f||null),s()}},[D,u,H,s]),se=l[1],Z=g.useMemo(()=>ae(se),[ae,se]),xe=g.useCallback(()=>{const f=[];let L=-1,O=-1,N=0,R="";return Z.forEach(ie=>{const ne=ie.date.getMonth(),Fe=ie.date.getFullYear(),le=me(ie.date,"MMM YYYY");ne!==L||Fe!==O?(L!==-1&&f.push({label:R,width:N}),L=ne,O=Fe,N=v,R=le):N+=v}),L!==-1&&f.push({label:R,width:N}),f},[Z,v]),$e=g.useCallback(()=>{const f=[];let L=-1,O=0,N=-1,R=-1,ie="";return Z.forEach(ne=>{const le=ne.date.getDate()<=15?0:1,ke=ne.date.getMonth(),Be=ne.date.getFullYear(),Pe=me(ne.date,"MMM"),Se=new Date(Be,ke+1,0).getDate(),Oe=le===0?`${Pe} 1 - 15`:`${Pe} 16 - ${Se}`;le!==L||ke!==N||Be!==R?(L!==-1&&f.push({label:ie,width:O}),L=le,N=ke,R=Be,O=v,ie=Oe):O+=v}),L!==-1&&f.push({label:ie,width:O}),f},[Z,v]),De=g.useMemo(()=>xe(),[xe]),I=g.useMemo(()=>$e(),[$e]),Y=g.useMemo(()=>Z.length*v,[Z.length,v]),ue=g.useMemo(()=>{const f=new Date;return f.setHours(0,0,0,0),f},[]),te=g.useMemo(()=>{if(!r.showTodayLine)return null;const f=J(ue);return f>=-v&&f<=Y+v?Math.max(0,Math.min(f,Y)):null},[r.showTodayLine,ue,Y,v,J]),re=g.useMemo(()=>{if(r.projectStartDate)return Ye(r.projectStartDate);if(t.length>0){const f=t.map(L=>L.start.getTime());return Ye(new Date(Math.min(...f)))}return null},[r.projectStartDate,t]),Q=g.useMemo(()=>{if(!r.showProjectStartLine||!re)return null;const f=J(re);return f>=-v&&f<=Y+v?Math.max(0,Math.min(f,Y)):null},[r.showProjectStartLine,re,Y,v,J]);return e.jsxs("div",{className:"gantt-timeline-container",ref:T,onMouseMove:M,onMouseUp:U,style:{width:Y,position:"relative"},children:[e.jsxs("div",{className:"gantt-timeline-header",style:{width:Y,minWidth:Y,position:"relative"},children:[te!==null&&r.showTodayLine&&r.todayLineLabel&&r.todayLineLabel!==""&&e.jsx("div",{className:"gantt-today-line-label",style:{position:"absolute",top:"calc(var(--gantt-scale-height, 24px) * 2)",left:`${te}px`,transform:"translateX(-50%)",backgroundColor:r.todayLineColor||"#ff4d4f",color:"#ffffff",padding:"4px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 2px 6px rgba(0, 0, 0, 0.2)",lineHeight:"1.2",zIndex:101,pointerEvents:"none",...r.todayLineLabelStyle},children:r.todayLineLabel}),Q!==null&&r.showProjectStartLine&&r.projectStartLineLabel&&r.projectStartLineLabel!==""&&e.jsx("div",{className:"gantt-project-start-line-label",style:{position:"absolute",top:"calc(var(--gantt-scale-height, 24px) * 2)",left:`${Q}px`,transform:"translateX(-50%)",backgroundColor:r.projectStartLineColor||"#40a9ff",color:"#ffffff",padding:"4px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 2px 6px rgba(0, 0, 0, 0.2)",lineHeight:"1.2",zIndex:101,pointerEvents:"none",...r.projectStartLineLabelStyle},children:r.projectStartLineLabel}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-month",style:{width:Y},children:De.map((f,L)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:f.width,minWidth:f.width,maxWidth:f.width,borderRight:L===De.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`top-${L}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-range",style:{width:Y},children:I.map((f,L)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:f.width,minWidth:f.width,maxWidth:f.width,borderRight:L===I.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`mid-${L}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-day",style:{width:Y},children:Z.map((f,L)=>{const O=r.weekends&&ft(f.date),N=r.holidays&&mt(f.date,r.holidays);return e.jsx("div",{className:`gantt-timeline-cell ${O?"weekend":""} ${N?"holiday":""}`,style:{width:v,minWidth:v,maxWidth:v,borderRight:L===Z.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`day-${L}`)})})]}),e.jsxs("div",{className:"gantt-timeline-body",style:{width:Y,position:"relative"},children:[te!==null&&e.jsxs(e.Fragment,{children:[r.showTodayLineMarker!==!1&&(()=>{const f=r.todayLineMarkerSize||8,L=r.todayLineColor||"#ff4d4f",O=r.todayLineMarkerStyle||"triangle",N=r.todayLineOpacity!==void 0?r.todayLineOpacity:1;return O==="triangle"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${te}px`,top:"-4px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:N}}):O==="arrow"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${te}px`,top:"-6px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f*.7}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:N}}):O==="dot"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${te}px`,top:`-${f/2}px`,transform:"translateX(-50%)",width:`${f}px`,height:`${f}px`,borderRadius:"50%",backgroundColor:L,zIndex:7,pointerEvents:"none",opacity:N}}):null})(),e.jsx("div",{className:"gantt-today-line",style:{position:"absolute",left:`${te}px`,top:0,bottom:0,width:`${r.todayLineWidth||1}px`,backgroundColor:r.todayLineColor||"#ff4d4f",opacity:r.todayLineOpacity!==void 0?r.todayLineOpacity:1,borderLeft:r.todayLineStyle==="dashed"?`${r.todayLineWidth||1}px dashed ${r.todayLineColor||"#ff4d4f"}`:r.todayLineStyle==="dotted"?`${r.todayLineWidth||1}px dotted ${r.todayLineColor||"#ff4d4f"}`:"none",zIndex:6,pointerEvents:"none"}})]}),Q!==null&&e.jsxs(e.Fragment,{children:[r.showProjectStartLineMarker!==!1&&(()=>{const f=r.projectStartLineMarkerSize||8,L=r.projectStartLineColor||"#40a9ff",O=r.projectStartLineMarkerStyle||"triangle",N=r.projectStartLineOpacity!==void 0?r.projectStartLineOpacity:1;return O==="triangle"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${Q}px`,top:"-4px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:N}}):O==="arrow"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${Q}px`,top:"-6px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f*.7}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:N}}):O==="dot"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${Q}px`,top:`-${f/2}px`,transform:"translateX(-50%)",width:`${f}px`,height:`${f}px`,borderRadius:"50%",backgroundColor:L,zIndex:7,pointerEvents:"none",opacity:N}}):null})(),e.jsx("div",{className:"gantt-project-start-line",style:{position:"absolute",left:`${Q}px`,top:0,bottom:0,width:`${r.projectStartLineWidth||1}px`,backgroundColor:r.projectStartLineColor||"#40a9ff",opacity:r.projectStartLineOpacity!==void 0?r.projectStartLineOpacity:1,borderLeft:r.projectStartLineStyle==="dashed"?`${r.projectStartLineWidth||1}px dashed ${r.projectStartLineColor||"#40a9ff"}`:r.projectStartLineStyle==="dotted"?`${r.projectStartLineWidth||1}px dotted ${r.projectStartLineColor||"#40a9ff"}`:"none",zIndex:6,pointerEvents:"none"}})]}),e.jsx("div",{className:"gantt-timeline-grid",children:Z.map((f,L)=>{const O=r.weekends&&ft(f.date),N=r.holidays&&mt(f.date,r.holidays);return e.jsx("div",{className:`gantt-timeline-grid-column ${O?"weekend":""} ${N?"holiday":""}`,style:{width:v,minWidth:v}},L)})}),a.length>0&&e.jsx(ar,{links:a,tasks:u,getTaskPosition:K}),e.jsx("div",{className:"gantt-timeline-tasks",style:{width:Y},children:u.map(f=>{const L=fe(f),O=j?w?.get(f.id):void 0,N=O?E(O):void 0;return e.jsxs("div",{className:"gantt-timeline-row",children:[O&&N&&e.jsx("div",{className:`gantt-baseline-bar ${f.type==="milestone"?"milestone":""}`,style:{left:`${N.left}px`,width:`${N.width}px`},title:`Baseline: ${O.start.toLocaleDateString()} - ${O.end.toLocaleDateString()}`}),e.jsx(Ct,{task:f,position:L,selected:y===f.id,dragging:D.taskId===f.id,dragDeltaX:D.dragDeltaX,dragType:D.type,onClick:()=>x(f.id),onDragStart:(R,ie,ne)=>{$(f.id,R,ie,ne),i(f.id,R,ie)},readonly:r.readonly})]},f.id)})})]})]})});gt.displayName="Timeline";const bt=g.forwardRef((t,a)=>e.jsx("div",{className:"gantt-chart-wrapper",style:{flex:1,minWidth:0},children:e.jsx(gt,{...t,ref:a})}));bt.displayName="Chart";const{Search:ir}=p.Input,Nt=({onFilterChange:t,owners:a=[],uiConfig:o={}})=>{const[l,r]=g.useState({searchText:"",status:"all",priority:"all",owner:""}),y=s=>{const b={...l,...s};r(b),t(b)},x=()=>{const s={searchText:"",status:"all",priority:"all",owner:""};r(s),t(s)},i=l.searchText!==""||l.status!=="all"||l.priority!=="all"||l.owner!=="";return e.jsx("div",{className:"gantt-filter-container",children:e.jsxs("div",{className:"gantt-filter-bar",children:[e.jsx("div",{className:"gantt-filter-left",children:e.jsx(ir,{placeholder:o.searchPlaceholder||"Search stages...",value:l.searchText,onChange:s=>y({searchText:s.target.value}),allowClear:!0,className:"gantt-search-antd",style:{width:250}})}),e.jsxs("div",{className:"gantt-filter-right",children:[e.jsx(p.Select,{value:l.status,onChange:s=>y({status:s}),className:"gantt-filter-select-antd",style:{width:140},options:[{value:"all",label:o.statusOptions?.all||"All Status"},{value:"not-started",label:o.statusOptions?.notStarted||"Not Started"},{value:"in-progress",label:o.statusOptions?.inProgress||"In Progress"},{value:"completed",label:o.statusOptions?.completed||"Completed"}]}),e.jsx(p.Select,{value:l.priority,onChange:s=>y({priority:s}),className:"gantt-filter-select-antd",style:{width:130},options:[{value:"all",label:o.priorityFilterOptions?.all||"All Priority"},{value:"low",label:o.priorityFilterOptions?.low||"Low"},{value:"medium",label:o.priorityFilterOptions?.medium||"Medium"},{value:"high",label:o.priorityFilterOptions?.high||"High"}]}),e.jsx(p.Select,{value:l.owner||void 0,onChange:s=>y({owner:s||""}),className:"gantt-filter-select-antd",style:{width:130},placeholder:o.allOwnersText||"All Owners",allowClear:!0,options:[{value:"",label:o.allOwnersText||"All Owners"},...(a||[]).map(s=>({value:s,label:s}))]}),i&&e.jsx(p.Button,{type:"default",danger:!0,icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTimesCircle}),onClick:x,className:"gantt-filter-clear-antd",children:o.clearFiltersText||"Clear"})]})]})})},Ae=(t,a)=>t?typeof t=="string"?e.jsx(ce.FontAwesomeIcon,{icon:a}):t:e.jsx(ce.FontAwesomeIcon,{icon:a}),At=({zoomLevel:t,setZoomLevel:a,onExport:o,onFilterChange:l,owners:r,onAddTask:y,uiConfig:x,iconConfig:i={},styleConfig:s})=>{const b=He(s),c=x.showZoomButtons!==!1,w=x.showExportButtons!==!1,T=c&&w;return e.jsxs("div",{className:"gantt-toolbar-wrapper",children:[e.jsxs("div",{className:"gantt-toolbar",children:[e.jsx("div",{className:"gantt-toolbar-left",children:e.jsx(p.Space,{size:8,children:x.showAddTaskButton!==!1&&e.jsx(p.Button,{type:"primary",icon:Ae(i.addTask,G.faPlus),onClick:()=>y?.(),style:b.buttonPrimary,children:x.addTaskButtonText||"New Stage"})})}),e.jsx("div",{className:"gantt-toolbar-right",children:e.jsxs(p.Space,{size:4,children:[c&&e.jsxs(e.Fragment,{children:[e.jsx(p.Tooltip,{title:x.zoomOutTooltip||"Zoom Out",children:e.jsx(p.Button,{icon:Ae(i.zoomOut,G.faSearchMinus),onClick:()=>a(Math.max(.5,t-.25)),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:x.zoomInTooltip||"Zoom In",children:e.jsx(p.Button,{icon:Ae(i.zoomIn,G.faSearchPlus),onClick:()=>a(Math.min(2,t+.25)),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:x.resetZoomTooltip||"Reset Zoom",children:e.jsx(p.Button,{icon:Ae(i.resetZoom,G.faRotateLeft),onClick:()=>a(1),style:b.buttonSecondary})})]}),T&&e.jsx(p.Divider,{type:"vertical",style:{height:24,margin:"0 4px"}}),w&&e.jsxs(e.Fragment,{children:[e.jsx(p.Tooltip,{title:x.exportCSVTooltip||"Export to CSV",children:e.jsx(p.Button,{icon:Ae(i.exportCSV,G.faFileCsv),onClick:()=>o("csv"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:x.exportExcelTooltip||"Export to Excel",children:e.jsx(p.Button,{icon:Ae(i.exportExcel,G.faFileExcel),onClick:()=>o("excel"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:x.exportJSONTooltip||"Export to JSON",children:e.jsx(p.Button,{icon:Ae(i.exportJSON,G.faFileCode),onClick:()=>o("json"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:x.exportPDFTooltip||"Export to PDF",children:e.jsx(p.Button,{icon:Ae(i.exportPDF,G.faFilePdf),onClick:()=>o("pdf"),style:b.buttonSecondary})})]})]})})]}),x.showFilterSearch!==!1&&e.jsx(Nt,{onFilterChange:l,owners:r,uiConfig:x})]})},{Option:Ue}=p.Select,{TextArea:lr}=p.Input,Bt=({onCreateTask:t,onClose:a,uiConfig:o={},parentId:l,parentTaskName:r,styleConfig:y})=>{const[x]=p.Form.useForm(),i=He(y),s=b=>{const c=b.start.toDate(),w=new Date(c);w.setDate(w.getDate()+(b.duration||1)),t({text:b.text,start:c,end:w,duration:b.duration||1,progress:b.progress||0,type:b.type,color:typeof b.color=="string"?b.color:b.color?.toHexString?.()||"#4A90E2",owner:b.owner||"",priority:b.priority||"medium",details:b.details||"",parent:l},l),a()};return e.jsx(p.Modal,{title:l?(o.taskCreatorTitle||"Create Checklist")+(r?` for "${r}"`:""):o.taskCreatorTitle||"Create New Stage",open:!0,onCancel:a,onOk:()=>x.submit(),okText:o.taskCreatorOkText||"Create Stage",cancelText:o.taskCreatorCancelText||"Cancel",width:600,className:"gantt-modal-antd",styles:{content:i.modal,header:{borderBottom:`1px solid ${i.modal?.borderColor||"#f0f0f0"}`,marginBottom:16}},okButtonProps:{style:i.buttonPrimary},cancelButtonProps:{style:i.buttonSecondary},children:e.jsxs(p.Form,{form:x,layout:"vertical",onFinish:s,initialValues:{type:"task",priority:"medium",start:Et(),duration:1,progress:0,color:"#4A90E2"},children:[e.jsx(p.Form.Item,{name:"text",label:o.taskNameLabel||"Stage Name",rules:[{required:!0,message:o.taskNameRequired||"Please enter stage name"}],children:e.jsx(p.Input,{placeholder:o.taskNamePlaceholder||"Enter stage name",autoFocus:!0,style:i.input})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"type",label:o.typeLabel||"Type",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ue,{value:"task",children:o.taskTypeOptions?.task||"Stage"}),e.jsx(Ue,{value:"milestone",children:o.taskTypeOptions?.milestone||"Milestone"}),e.jsx(Ue,{value:"project",children:o.taskTypeOptions?.project||"Project"})]})}),e.jsx(p.Form.Item,{name:"priority",label:o.priorityLabel||"Priority",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ue,{value:"low",children:o.priorityOptions?.low||"Low"}),e.jsx(Ue,{value:"medium",children:o.priorityOptions?.medium||"Medium"}),e.jsx(Ue,{value:"high",children:o.priorityOptions?.high||"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"start",label:o.startDateLabel||"Start Date",style:{flex:1},children:e.jsx(p.DatePicker,{style:{width:"100%",...i.input}})}),e.jsx(p.Form.Item,{name:"duration",label:o.durationLabel||"Duration (days)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,style:{width:"100%",...i.input}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"color",label:o.colorLabel||"Color",style:{flex:1},children:e.jsx(p.ColorPicker,{showText:!0})}),e.jsx(p.Form.Item,{name:"progress",label:o.progressLabel||"Progress (%)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,max:100,style:{width:"100%",...i.input}})})]}),e.jsx(p.Form.Item,{name:"owner",label:o.ownerLabel||"Owner",children:e.jsx(p.Input,{placeholder:o.ownerPlaceholder||"Assign to...",style:i.input})}),e.jsx(p.Form.Item,{name:"details",label:o.detailsLabel||"Details",children:e.jsx(lr,{placeholder:o.detailsPlaceholder||"Add stage description...",rows:3,style:i.input})})]})})},{Option:Ve}=p.Select,{TextArea:dr}=p.Input,{confirm:cr}=p.Modal,It=({task:t,onUpdate:a,onDelete:o,onClose:l,uiConfig:r={},styleConfig:y})=>{const[x]=p.Form.useForm(),i=He(y),s=c=>{const w=c.start.toDate(),T=new Date(w);T.setDate(T.getDate()+(c.duration||1)),a({...t,text:c.text,start:w,end:T,duration:c.duration||1,progress:c.progress||0,type:c.type,color:typeof c.color=="string"?c.color:c.color?.toHexString?.()||"#4A90E2",owner:c.owner||"",priority:c.priority||"medium",details:c.details||""}),l()},b=()=>{cr({title:r.deleteConfirmTitle?`${r.deleteConfirmTitle}: "${t.text}"?`:`Are you sure you want to delete "${t.text}"?`,icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faExclamationTriangle,style:{color:"#faad14",marginRight:8}}),content:r.deleteConfirmContent||"This action cannot be undone.",okText:r.deleteConfirmOkText||"Yes, Delete",okType:"danger",cancelText:r.deleteConfirmCancelText||"No",onOk(){o(t.id),l()}})};return e.jsx(p.Modal,{title:r.taskEditorTitle||"Edit Stage",open:!0,onCancel:l,footer:[e.jsx(p.Button,{danger:!0,onClick:b,style:{float:"left",...i.buttonDanger},children:r.taskEditorDeleteText||"Delete"},"delete"),e.jsx(p.Button,{onClick:l,style:i.buttonSecondary,children:r.taskEditorCancelText||"Cancel"},"cancel"),e.jsx(p.Button,{type:"primary",onClick:()=>x.submit(),style:i.buttonPrimary,children:r.taskEditorSaveText||"Save Changes"},"submit")],width:600,className:"gantt-modal-antd",styles:{content:i.modal,header:{borderBottom:`1px solid ${i.modal?.borderColor||"#f0f0f0"}`,marginBottom:16}},children:e.jsxs(p.Form,{form:x,layout:"vertical",onFinish:s,initialValues:{text:t.text,type:t.type||"task",priority:t.priority||"medium",start:Et(t.start),duration:t.duration,progress:t.progress,color:t.color||"#4A90E2",owner:t.owner||"",details:t.details||""},children:[e.jsx(p.Form.Item,{name:"text",label:r.taskNameLabel||"Stage Name",rules:[{required:!0,message:r.taskNameRequired||"Please enter stage name"}],children:e.jsx(p.Input,{placeholder:r.taskNamePlaceholder||"Enter stage name",style:i.input})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"type",label:r.typeLabel||"Type",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ve,{value:"task",children:r.taskTypeOptions?.task||"Stage"}),e.jsx(Ve,{value:"milestone",children:r.taskTypeOptions?.milestone||"Milestone"}),e.jsx(Ve,{value:"project",children:r.taskTypeOptions?.project||"Project"})]})}),e.jsx(p.Form.Item,{name:"priority",label:r.priorityLabel||"Priority",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ve,{value:"low",children:r.priorityOptions?.low||"Low"}),e.jsx(Ve,{value:"medium",children:r.priorityOptions?.medium||"Medium"}),e.jsx(Ve,{value:"high",children:r.priorityOptions?.high||"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"start",label:r.startDateLabel||"Start Date",style:{flex:1},children:e.jsx(p.DatePicker,{style:{width:"100%",...i.input}})}),e.jsx(p.Form.Item,{name:"duration",label:r.durationLabel||"Duration (days)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,style:{width:"100%",...i.input}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"color",label:r.colorLabel||"Color",style:{flex:1},children:e.jsx(p.ColorPicker,{showText:!0})}),e.jsx(p.Form.Item,{name:"progress",label:r.progressLabel||"Progress (%)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,max:100,style:{width:"100%",...i.input}})})]}),e.jsx(p.Form.Item,{name:"owner",label:r.ownerLabel||"Owner",children:e.jsx(p.Input,{placeholder:r.ownerPlaceholder||"Assign to...",style:i.input})}),e.jsx(p.Form.Item,{name:"details",label:r.detailsLabel||"Details",children:e.jsx(dr,{placeholder:r.detailsPlaceholder||"Add stage description...",rows:3,style:i.input})})]})})},{Title:et,Text:Re,Paragraph:ur}=p.Typography,{Option:Ee}=p.Select,_t=({task:t,allTasks:a,links:o,onAddDependency:l,onRemoveDependency:r,onTaskUpdate:y,onClose:x,styleConfig:i})=>{const s=He(i),[b,c]=g.useState(""),[w,T]=g.useState("e2s"),[u,h]=g.useState(0),[v,j]=g.useState("day"),[D,$]=g.useState(t.duration),[P,H]=g.useState(""),ae=o.filter(M=>M.target===t.id),J=a.filter(M=>M.id!==t.id&&M.id!==t.parent),fe=()=>{if(b){const M=xt(u,v);if(D!==t.duration&&y){const U=he(new Date(t.start),D,"day");y({...t,duration:D,end:U})}l(b,t.id,w,M),c(""),h(0),j("day")}},E=()=>{if(!P.trim())return;const M=er(P.trim());if(!M){alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
|
|
15
|
-
Example: 3FS+10d`);return}const U=M.taskNumber-1,se=a[U];if(!se){alert(`Task ${M.taskNumber} not found`);return}const Z=rr(M.type),xe=xt(M.lag,M.lagUnit);l(se.id,t.id,Z,xe),H("")},K=M=>{switch(M){case"e2s":return"Finish-to-Start (FS)";case"s2s":return"Start-to-Start (SS)";case"e2e":return"Finish-to-Finish (FF)";case"s2e":return"Start-to-Finish (SF)"}},V=M=>{switch(M){case"e2s":return"blue";case"s2s":return"green";case"e2e":return"purple";case"s2e":return"orange"}};return e.jsx(p.Modal,{title:e.jsx(et,{level:4,style:{margin:0,color:s.font?.color},children:"Dependency Editor"}),open:!0,onCancel:x,footer:null,width:700,styles:{content:s.modal,header:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`}},children:e.jsxs("div",{style:{padding:"8px 0"},children:[e.jsx(p.Alert,{message:"Managing dependencies helps in auto-scheduling and critical path calculation.",type:"info",showIcon:!0,style:{marginBottom:20,...s.font}}),e.jsxs("div",{style:{display:"flex",gap:20,marginBottom:24},children:[e.jsx(p.Card,{title:e.jsx(et,{level:5,style:{margin:0,fontSize:14,color:s.font?.color},children:"Settings"}),size:"small",style:{flex:1,...s.modal},headStyle:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`},children:e.jsxs(p.Space,{direction:"vertical",style:{width:"100%"},size:"middle",children:[e.jsxs("div",{children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Predecessor"}),e.jsx(p.Select,{showSearch:!0,placeholder:"Select a task",optionFilterProp:"children",style:{width:"100%",...s.input},value:b,onChange:c,children:J.map(M=>e.jsxs(Ee,{value:M.id,children:["[",a.indexOf(M)+1,"] ",M.text]},M.id))})]}),e.jsxs("div",{children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Type"}),e.jsxs(p.Select,{style:{width:"100%",...s.input},value:w,onChange:T,children:[e.jsx(Ee,{value:"e2s",children:"Finish-to-Start (FS)"}),e.jsx(Ee,{value:"s2s",children:"Start-to-Start (SS)"}),e.jsx(Ee,{value:"e2e",children:"Finish-to-Finish (FF)"}),e.jsx(Ee,{value:"s2e",children:"Start-to-Finish (SF)"})]})]}),e.jsxs("div",{style:{display:"flex",gap:12},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Lag/Lead"}),e.jsx(p.InputNumber,{style:{width:"100%",...s.input},value:u,onChange:M=>h(M||0)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Units"}),e.jsxs(p.Select,{style:{width:"100%",...s.input},value:v,onChange:j,children:[e.jsx(Ee,{value:"day",children:"Days"}),e.jsx(Ee,{value:"hour",children:"Hours"}),e.jsx(Ee,{value:"week",children:"Weeks"}),e.jsx(Ee,{value:"month",children:"Months"})]})]})]}),e.jsxs("div",{children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Duration (days)"}),e.jsx(p.InputNumber,{style:{width:"100%",...s.input},min:1,value:D,onChange:M=>$(M||1)})]}),e.jsx(p.Button,{type:"primary",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faPlus,style:{marginRight:8}}),block:!0,onClick:fe,disabled:!b,style:{height:40,marginTop:8,...s.buttonPrimary},children:"Add Dependency"})]})}),e.jsxs(p.Card,{title:e.jsx(et,{level:5,style:{margin:0,fontSize:14,color:s.font?.color},children:"Quick Add"}),size:"small",style:{width:250,...s.modal},headStyle:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`},children:[e.jsxs(ur,{type:"secondary",style:{fontSize:12,marginBottom:16,color:s.font?.color,opacity:.7},children:["Format: [TaskNumber][Type][+/-][Lag][Unit]",e.jsx("br",{}),"Example: 3FS+10d"]}),e.jsx(p.Input,{placeholder:"e.g. 5FS+2d",value:P,onChange:M=>H(M.target.value),onPressEnter:E,style:{marginBottom:16,height:40,...s.input}}),e.jsx(p.Button,{block:!0,onClick:E,style:{height:40,...s.buttonSecondary},children:"Apply"})]})]}),e.jsx(p.Divider,{style:{margin:"0 0 24px 0",borderColor:s.modal?.borderColor}}),e.jsxs("div",{style:{maxHeight:300,overflowY:"auto"},children:[e.jsx(et,{level:5,style:{fontSize:14,marginBottom:16,color:s.font?.color},children:"Current Dependencies"}),e.jsx(p.List,{dataSource:ae,locale:{emptyText:e.jsx(Re,{type:"secondary",style:{color:s.font?.color,opacity:.5},children:"No dependencies added yet."})},renderItem:M=>{const U=a.find(se=>se.id===M.source);return e.jsx(p.List.Item,{style:{padding:"12px 16px",background:"#fafafa",borderRadius:8,marginBottom:12,border:`1px solid ${s.listItem?.borderColor||"#f0f0f0"}`},actions:[e.jsx(p.Button,{type:"text",danger:!0,icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTrash}),onClick:()=>r(M.id)},"delete")],children:e.jsx(p.List.Item.Meta,{avatar:e.jsx("div",{style:{width:32,height:32,borderRadius:16,background:"#1890ff",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:12,fontWeight:"bold"},children:U?a.indexOf(U)+1:"?"}),title:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontWeight:600,color:s.font?.color},children:U?.text||"Unknown Task"}),e.jsx(p.Tag,{color:V(M.type),style:{margin:0},children:K(M.type)})]}),description:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16,marginTop:4},children:e.jsxs("span",{style:{fontSize:12,color:s.font?.color,opacity:.7},children:[e.jsx(ce.FontAwesomeIcon,{icon:G.faLink,style:{marginRight:6}}),"Lag: ",M.lag||0," days"]})})})})}})]}),e.jsxs("div",{style:{marginTop:24,padding:"16px",background:"#fff7e6",borderRadius:8,border:"1px solid #ffe7ba"},children:[e.jsxs(et,{level:5,style:{fontSize:13,marginBottom:8,display:"flex",alignItems:"center"},children:[e.jsx(ce.FontAwesomeIcon,{icon:G.faInfoCircle,style:{marginRight:8,color:"#fa8c16"}}),"Coming soon"]}),e.jsx(Re,{style:{fontSize:12,color:"rgba(0,0,0,0.65)"},children:"Dependency visualization on the chart and automatic lag calculations based on working hours."})]})]})})},pr=({x:t,y:a,task:o,onEdit:l,onDelete:r,onCopy:y,onDependencies:x,onConvertToMilestone:i,onConvertToTask:s,onConvertToProject:b,onAutoSchedule:c,onClose:w,styleConfig:T})=>{const u=He(T);if(!o)return null;const h=[{key:"edit",label:"Edit",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faEdit}),onClick:()=>{l(),w()}},{key:"copy",label:"Copy",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faCopy}),onClick:()=>{y(),w()}},{key:"dependencies",label:"Dependencies",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faLink}),onClick:()=>{x(),w()}},{type:"divider"},{key:"convert",label:"Convert to",type:"submenu",children:[{key:"milestone",label:"Milestone",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faFlag}),disabled:o.type==="milestone",onClick:()=>{i(),w()}},{key:"task",label:"Task",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTasks}),disabled:o.type==="task",onClick:()=>{s(),w()}},{key:"project",label:"Project",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faFolder}),disabled:o.type==="project",onClick:()=>{b(),w()}}]},{key:"auto-schedule",label:"Auto Schedule",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faRotateLeft}),onClick:()=>{c?.(),w()}},{type:"divider"},{key:"delete",label:"Delete",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTrash}),danger:!0,onClick:()=>{r(),w()}}];return e.jsx("div",{className:"gantt-context-menu",style:{position:"fixed",left:`${t}px`,top:`${a}px`,zIndex:1e4},onClick:v=>v.stopPropagation(),children:e.jsx(p.Menu,{items:h,style:{boxShadow:u.popover?.boxShadow||"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:u.popover?.borderRadius||"6px",border:`1px solid ${u.popover?.borderColor||"#e0e0e0"}`,backgroundColor:u.popover?.backgroundColor,color:u.font?.color,fontFamily:u.font?.fontFamily}})})},Yt=(t,a=[])=>{const[o,l]=g.useState([]),[r,y]=g.useState(-1),[x,i]=g.useState(t),[s,b]=g.useState(a);g.useEffect(()=>{i(t)},[t]),g.useEffect(()=>{b(a)},[a]);const c=g.useCallback(($,P,H)=>{const ae={type:$,before:P,after:H,timestamp:Date.now()},J=o.slice(0,r+1);J.push(ae),J.length>50?J.shift():y(r+1),l(J)},[o,r]),w=g.useCallback(()=>{if(r<0)return;const $=o[r];i($.before.tasks),b($.before.links),y(r-1)},[o,r]),T=g.useCallback(()=>{if(r>=o.length-1)return;const $=o[r+1];i($.after.tasks),b($.after.links),y(r+1)},[o,r]),u=r>=0,h=r<o.length-1,v=g.useCallback($=>{const P={tasks:x,links:s},H=x.map(J=>J.id===$.id?$:J);c("task_update",P,{tasks:H,links:s}),i(H)},[x,s,c]),j=g.useCallback($=>{const P={tasks:x,links:s},H=[...x,$];c("task_create",P,{tasks:H,links:s}),i(H)},[x,s,c]),D=g.useCallback($=>{const P={tasks:x,links:s},H=x.filter(fe=>fe.id!==$),ae=s.filter(fe=>fe.source!==$&&fe.target!==$);c("task_delete",P,{tasks:H,links:ae}),i(H),b(ae)},[x,s,c]);return{tasks:x,links:s,setTasks:i,setLinks:b,undo:w,redo:T,canUndo:u,canRedo:h,updateTask:v,createTask:j,deleteTask:D,saveState:c,history:o}},Rt=(t,a,o={mode:"forward"})=>{const l=new Map,r=new Map;return t.forEach(y=>{l.set(y.id,[]),r.set(y.id,[])}),a.forEach(y=>{y.type==="e2s"&&(l.get(y.target)?.push(y.source),r.get(y.source)?.push(y.target))}),o.mode==="forward"?hr(t,l,o):fr(t,r,o)},hr=(t,a,o)=>{const l=new Map,r=new Set,y=o.projectStart||new Date,x=i=>{if(r.has(i))return;const s=t.find(h=>h.id===i);if(!s)return;const b=a.get(i)||[];b.forEach(h=>x(h));let c=y;b.forEach(h=>{const v=l.get(h);v&&v.end>c&&(c=new Date(v.end))});const w=new Date(c),T=he(w,s.duration,"day"),u={...s,start:w,end:T};l.set(i,u),r.add(i)};return t.forEach(i=>x(i.id)),t.map(i=>l.get(i.id)||i)},fr=(t,a,o)=>{const l=new Map,r=new Set,y=o.projectEnd||new Date(Math.max(...t.map(i=>i.end.getTime()))),x=i=>{if(r.has(i))return;const s=t.find(h=>h.id===i);if(!s)return;const b=a.get(i)||[];b.forEach(h=>x(h));let c=y;b.forEach(h=>{const v=l.get(h);v&&v.start<c&&(c=new Date(v.start))});const w=new Date(c),T=he(w,-s.duration,"day"),u={...s,start:T,end:w};l.set(i,u),r.add(i)};return t.forEach(i=>x(i.id)),t.map(i=>l.get(i.id)||i)},mr=Object.freeze(Object.defineProperty({__proto__:null,autoSchedule:Rt,levelResources:t=>{const a=new Map;t.forEach(l=>{l.owner&&(a.has(l.owner)||a.set(l.owner,[]),a.get(l.owner).push(l))});const o=[...t];return a.forEach(l=>{const r=l.sort((y,x)=>y.start.getTime()-x.start.getTime());for(let y=1;y<r.length;y++){const x=r[y],i=r[y-1];if(x.start<i.end){const s=o.findIndex(b=>b.id===x.id);if(s>=0){const b=new Date(i.end),c=he(b,x.duration,"day");o[s]={...x,start:b,end:c}}}}}),o}},Symbol.toStringTag,{value:"Module"})),zt=t=>{const a=new Map;return t.forEach(o=>{a.set(o.id,{taskId:o.id,start:new Date(o.start),end:new Date(o.end)})}),a},Wt=t=>{const a=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority"],o=t.map(r=>[r.id,r.text,me(r.start,"YYYY-MM-DD"),me(r.end,"YYYY-MM-DD"),r.duration.toString(),`${r.progress}%`,r.type||"task",r.owner||"",r.priority||"medium"]),l=[a.join(","),...o.map(r=>r.map(y=>`"${y}"`).join(","))].join(`
|
|
16
|
-
`);st(l,"gantt-tasks.csv","text/csv")},Ht=t=>{const a=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority","Details"],o=t.map(r=>[r.id,r.text,
|
|
14
|
+
<%s key={someKey} {...props} />`,Lt,We,Tr,We),J[We+Lt]=!0}}return n===l?ie(ue):z(ue),ue}}function oe(n,x,k){return be(n,x,k,!0)}function we(n,x,k){return be(n,x,k,!1)}var _e=we,Mt=oe;Ke.Fragment=l,Ke.jsx=_e,Ke.jsxs=Mt})()),Ke}var Pt;function Zt(){return Pt||(Pt=1,process.env.NODE_ENV==="production"?at.exports=Jt():at.exports=Gt()),at.exports}var e=Zt();const he=(t,a,o)=>{const l=new Date(t);switch(o){case"hour":l.setHours(l.getHours()+a);break;case"day":l.setDate(l.getDate()+a);break;case"week":l.setDate(l.getDate()+a*7);break;case"month":l.setMonth(l.getMonth()+a);break;case"quarter":l.setMonth(l.getMonth()+a*3);break;case"year":l.setFullYear(l.getFullYear()+a);break}return l},Qe=(t,a)=>{const o=a.getTime()-t.getTime();return Math.ceil(o/(1e3*60*60*24))},Ot=(t,a)=>{const o=a.getTime()-t.getTime();return Math.ceil(o/(1e3*60*60))},xe=(t,a)=>{const o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],y={YYYY:t.getFullYear().toString(),YY:t.getFullYear().toString().slice(-2),MMMM:l[t.getMonth()],MMM:o[t.getMonth()],MM:String(t.getMonth()+1).padStart(2,"0"),M:String(t.getMonth()+1),DD:String(t.getDate()).padStart(2,"0"),D:String(t.getDate()),dddd:r[t.getDay()],HH:String(t.getHours()).padStart(2,"0"),H:String(t.getHours()),mm:String(t.getMinutes()).padStart(2,"0"),m:String(t.getMinutes())};return a.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g,m=>y[m])},ht=t=>{const a=t.getDay();return a===0||a===6},ft=(t,a)=>a.some(o=>o.getFullYear()===t.getFullYear()&&o.getMonth()===t.getMonth()&&o.getDate()===t.getDate()),Ye=t=>{const a=new Date(t);return a.setHours(0,0,0,0),a},Kt=t=>{const a=new Date(t);return a.setHours(23,59,59,999),a},Qt=(t,a,o="day")=>{switch(o){case"hour":return Ot(t,a);case"day":return Qe(t,a);case"week":return Math.ceil(Qe(t,a)/7);case"month":return(a.getFullYear()-t.getFullYear())*12+(a.getMonth()-t.getMonth());default:return Qe(t,a)}};function er(t){if(!t||typeof t!="string")return null;const a=t.trim(),o=/^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i,l=a.match(o);if(!l)return null;const r=parseInt(l[1],10),y=l[2].toUpperCase();let m=0,i="day";if(l[3]){const s=l[4]==="-"?-1:1;switch(m=parseInt(l[5],10)*s,l[6].toLowerCase()){case"d":i="day";break;case"h":i="hour";break;case"w":i="week";break;case"m":i="month";break}}return{taskNumber:r,type:y,lag:m,lagUnit:i}}function mt(t,a){switch(a){case"hour":return t/24;case"day":return t;case"week":return t*7;case"month":return t*30;default:return t}}function tr(t,a){const l={e2s:"FS",s2s:"SS",e2e:"FF",s2e:"SF"}[t.type];let r=`${a}${l}`;if(t.lag&&t.lag!==0){const y=t.lag>0?"+":"",i=(t.lagUnit||"day").charAt(0);let s=t.lag;if(t.lagUnit&&t.lagUnit!=="day")switch(t.lagUnit){case"hour":s=t.lag*24;break;case"week":s=t.lag/7;break;case"month":s=t.lag/30;break}r+=`${y}${Math.round(s)}${i}`}return r}function rr(t){return{FS:"e2s",SS:"s2s",FF:"e2e",SF:"s2e"}[t]}const He=t=>t?{popover:{backgroundColor:t.popoverBackground||"#fff",borderColor:t.popoverBorderColor||"#f0f0f0",borderRadius:t.popoverBorderRadius||"8px",boxShadow:t.popoverShadow||"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",padding:t.popoverPadding||"0",fontFamily:t.popoverFontFamily||t.fontFamily||"inherit",fontSize:t.popoverFontSize||t.fontSize||"14px"},modal:{backgroundColor:t.modalBackground||"#fff",borderRadius:t.modalBorderRadius||"8px",borderColor:t.modalBorderColor||"#f0f0f0",boxShadow:t.modalShadow||"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)"},buttonPrimary:{backgroundColor:t.buttonPrimaryBackground||"#1677ff",color:t.buttonPrimaryColor||"#fff",borderRadius:t.buttonPrimaryBorderRadius||"6px",fontWeight:t.buttonPrimaryFontWeight||400,fontFamily:t.buttonPrimaryFontFamily||t.fontFamily||"inherit",boxShadow:"0 2px 0 rgba(5, 145, 255, 0.1)"},buttonDanger:{backgroundColor:t.buttonDangerBackground||"#ff4d4f",color:t.buttonDangerColor||"#fff",borderRadius:t.buttonPrimaryBorderRadius||"6px",boxShadow:"0 2px 0 rgba(255, 38, 5, 0.06)"},buttonSecondary:{backgroundColor:t.buttonSecondaryBackground||"transparent",color:t.buttonSecondaryColor||"rgba(0, 0, 0, 0.88)",borderColor:t.buttonSecondaryBorderColor||"#d9d9d9",borderRadius:t.buttonPrimaryBorderRadius||"6px",boxShadow:"0 2px 0 rgba(0, 0, 0, 0.02)"},input:{backgroundColor:t.inputBackground,borderColor:t.inputBorderColor,borderRadius:t.inputBorderRadius||"6px",fontFamily:t.inputFontFamily||t.fontFamily||"inherit",fontSize:t.inputFontSize||t.fontSize||"14px"},listItem:{hoverBackground:t.listItemHoverBackground||"#f5f5f5",selectedBackground:t.listItemSelectedBackground||"#e6f4ff",borderColor:t.listItemBorderColor||"#f0f0f0"},badge:{backgroundColor:t.badgeBackground||"#e6f4ff",borderColor:t.badgeBorderColor||"transparent",color:t.badgeColor||"#1677ff",fontSize:t.badgeFontSize||"12px",padding:t.badgePadding||"0 7px",borderRadius:t.badgeBorderRadius||"10px"},link:{color:t.linkColor||"#1677ff",hoverColor:t.linkHoverColor||"#69b1ff",fontWeight:t.linkFontWeight||400},font:{fontFamily:t.fontFamily||"inherit",fontSize:t.fontSize||"14px",fontWeight:t.fontWeight||400,lineHeight:t.lineHeight||1.5714285714285714,color:t.fontColor||"rgba(0, 0, 0, 0.88)"}}:{},{Text:je,Paragraph:nr}=p.Typography,{Option:Ne}=p.Select,or=({task:t,allTasks:a,links:o,onAddDependency:l,onRemoveDependency:r,onTaskUpdate:y,children:m,styleConfig:i})=>{const s=He(i),[b,c]=g.useState(!1),[w,T]=g.useState(null),[u,h]=g.useState("e2s"),[v,S]=g.useState("lag"),[D,$]=g.useState(0),[F,H]=g.useState(t.duration),[ae,X]=g.useState(!0),fe="day",E=o.find(_=>_.target===t.id),K=!!E,q=g.useMemo(()=>a.length===0?new Date:new Date(Math.min(...a.map(_=>_.start.getTime()))),[a]),M=()=>{if(w){const _=v==="lag"?D:-D,Y=mt(_,fe);if(F!==t.duration&&y){const pe=he(new Date(t.start),F,"day");y({...t,duration:F,end:pe})}l(w,t.id,u,Y),c(!1),U()}},U=()=>{T(null),h("e2s"),S("lag"),$(0),H(t.duration)},se=()=>{E&&r&&(r(E.id),c(!1),U())},Z=_=>{if(c(_),_){if(X(!0),E){T(E.source),h(E.type);const Y=E.lag||0;Y>=0?(S("lag"),$(Y)):(S("lead"),$(Math.abs(Y)))}else U();H(t.duration)}},ye=()=>{if(!ae)return null;const _=u==="e2s",Y=u==="s2s",pe=u==="e2e",te=u==="s2e";let re=0,Q=0,f="",L=0,P=-1;_?(re=50,Q=350,L=250,P=350,f="M 250 60 L 300 60 L 300 140 L 348 140"):pe?(re=100,Q=100,L=300,P=-1,f="M 300 60 L 350 60 L 350 140 L 302 140"):Y?(re=250,Q=250,L=250,P=-1,f="M 250 60 L 200 60 L 200 140 L 248 140"):te&&(re=350,Q=50,L=350,P=250,f="M 350 60 L 300 60 L 300 140 L 252 140");const A=w==="gantt-start-date",R=a.find(le=>le.id===w);return e.jsx("div",{style:{width:"100%",height:90,backgroundColor:"#fbfbfb",borderRadius:4,marginBottom:12,border:"1px solid #f0f0f0",position:"relative",overflow:"hidden",flexShrink:0},children:e.jsxs("svg",{viewBox:"0 0 600 200",style:{width:"100%",height:"100%"},preserveAspectRatio:"xMidYMid meet",children:[e.jsx("defs",{children:e.jsx("marker",{id:"arrowhead",markerWidth:"12",markerHeight:"9",refX:"12",refY:"4.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 12 4.5, 0 9",fill:"#8c8c8c"})})}),e.jsx("line",{x1:L,x2:L,y1:"0",y2:"200",stroke:"#f0f0f0",strokeDasharray:"3,3"}),P!==-1&&e.jsx("line",{x1:P,x2:P,y1:"0",y2:"200",stroke:"#f0f0f0",strokeDasharray:"3,3"}),e.jsx("rect",{x:re,y:"35",width:"200",height:"50",rx:"4",fill:"#e6f4ff",stroke:"#91caff",strokeWidth:"2"}),e.jsx("text",{x:re+100,y:"66",fontSize:"15",textAnchor:"middle",fill:"#003a8c",fontWeight:"600",children:A?"Start Date":R?`Stage ${a.indexOf(R)+1}`:"Predecessor"}),e.jsx("rect",{x:Q,y:"115",width:"200",height:"50",rx:"4",fill:"#e6f4ff",stroke:"#91caff",strokeWidth:"2"}),e.jsxs("text",{x:Q+100,y:"146",fontSize:"15",textAnchor:"middle",fill:"#003a8c",fontWeight:"600",children:["Stage ",a.indexOf(t)+1]}),e.jsx("path",{d:f,fill:"none",stroke:"#8c8c8c",strokeWidth:"2.5",markerEnd:"url(#arrowhead)"})]})})},$e=()=>{const _=w==="gantt-start-date",Y=a.find(Q=>Q.id===w);if(!w)return"Select a checklist from the list to see how it will relate to the current stage.";const pe=a.indexOf(t)+1,te=_?"Start Date":`Stage ${a.indexOf(Y)+1}`;let re="";switch(u){case"e2s":re=`Stage ${pe} starts after ${te} finishes`;break;case"s2s":re=`Stage ${pe} starts when ${te} starts`;break;case"e2e":re=`Stage ${pe} finishes when ${te} finishes`;break;case"s2e":re=`Stage ${pe} finishes when ${te} starts`;break}if(D>0){const Q=`${D} ${fe}${D>1?"s":""}`;v==="lag"?re+=` + ${Q} delay`:re+=` - ${Q} overlap`}return re+"."},De=e.jsxs("div",{style:{width:550,backgroundColor:s.popover?.backgroundColor||"#fff",borderRadius:s.popover?.borderRadius||"8px",padding:"16px 20px",boxShadow:s.popover?.boxShadow,fontFamily:s.popover?.fontFamily},children:[e.jsx(je,{strong:!0,style:{fontSize:"16px",display:"block",marginBottom:16,color:s.font?.color},children:"Add Dependency"}),e.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14},children:[e.jsx("div",{style:{flex:1},children:e.jsxs(p.Select,{showSearch:!0,placeholder:"Select checklist",value:w,onChange:T,style:{width:"100%"},filterOption:(_,Y)=>{if(Y?.value==="gantt-start-date")return"start date".includes(_.toLowerCase());const pe=a.find(re=>re.id===Y?.value);if(!pe)return!1;const te=a.indexOf(pe)+1;return pe.text.toLowerCase().includes(_.toLowerCase())||te.toString().includes(_)},optionLabelProp:"label",children:[a.filter(_=>_.id!==t.id).map(_=>e.jsx(Ne,{value:_.id,label:_.text,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:"4px 0"},children:[e.jsxs(je,{style:{fontSize:"13px"},children:[a.indexOf(_)+1,". ",_.text]}),e.jsxs(je,{type:"secondary",style:{fontSize:"11px"},children:["Start: ",xe(_.start,"MMM D, YYYY")]})]})},_.id)),e.jsx(Ne,{value:"gantt-start-date",label:"Start Date",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:"4px 0",borderTop:"1px solid #f0f0f0",marginTop:"4px",paddingTop:"8px"},children:[e.jsx(je,{style:{fontSize:"13px",fontWeight:600},children:"Start Date"}),e.jsx(je,{type:"secondary",style:{fontSize:"11px"},children:xe(q,"MMM D, YYYY")})]})},"gantt-start-date")]})}),e.jsx("div",{style:{width:100},children:e.jsxs(p.Select,{value:u,onChange:h,style:{width:"100%"},children:[e.jsx(Ne,{value:"e2s",children:"FS"}),e.jsx(Ne,{value:"e2e",children:"FF"}),e.jsx(Ne,{value:"s2s",children:"SS"}),e.jsx(Ne,{value:"s2e",children:"SF"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Delay type"}),e.jsxs(p.Select,{value:v,onChange:S,style:{width:"100%"},children:[e.jsx(Ne,{value:"lag",children:"Lag by"}),e.jsx(Ne,{value:"lead",children:"Lead by"})]})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Days"}),e.jsx(p.InputNumber,{min:0,value:D,onChange:_=>$(_||0),style:{width:"100%"},placeholder:"0"})]})]}),e.jsxs("div",{style:{marginBottom:14},children:[e.jsx(je,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Duration (days)"}),e.jsx(p.InputNumber,{min:1,value:F,onChange:_=>H(_||1),style:{width:"100%"},placeholder:"Duration"})]}),e.jsx("div",{style:{backgroundColor:"#f5f5f5",padding:"10px 12px",borderRadius:"4px",marginBottom:14},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"},children:[e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"FS: Finish to Start"}),e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"SS: Start to Start"}),e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"FF: Finish to Finish"}),e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"SF: Start to Finish"})]})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[e.jsx(je,{strong:!0,style:{fontSize:"13px",color:s.font?.color},children:"Dependency preview"}),e.jsx("a",{onClick:()=>X(!ae),style:{fontSize:"12px",color:"#1890ff",cursor:"pointer",textDecoration:"none"},children:ae?"Hide preview":"Show preview"})]}),ae&&e.jsxs(e.Fragment,{children:[ye(),e.jsx(nr,{style:{fontSize:"12px",color:s.font?.color||"#262626",marginBottom:14,lineHeight:"1.5"},children:$e()})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[K&&e.jsx(p.Button,{danger:!0,onClick:se,style:{...s.buttonDanger},children:"Remove Dependency"}),e.jsx(p.Button,{type:"primary",onClick:M,disabled:!w,style:{...s.buttonPrimary,minWidth:100},children:K?"Update":"Add"})]})]});return e.jsx(p.Popover,{content:De,trigger:"click",open:b,onOpenChange:Z,placement:"bottomLeft",overlayClassName:"dependency-popover",overlayInnerStyle:{padding:0},children:m})},xt=g.memo(g.forwardRef(({tasks:t,allTasks:a=[],columns:o,selectedTask:l,onTaskClick:r,onTaskContextMenu:y,onTaskUpdate:m,onTaskDragStart:i,onAddTask:s,onAddDependency:b,onRemoveDependency:c,links:w=[],dropIndicator:T,reorderTask:u,styleConfig:h},v)=>{const S=g.useRef(null);g.useImperativeHandle(v,()=>S.current);const[D,$]=g.useState(null),[F,H]=g.useState(0),ae=(E,K=0)=>{if(!E.parent)return K;const q=t.find(M=>M.id===E.parent);return q?ae(q,K+1):K},X=(E,K)=>{if(K===E.duration)return;const q=he(new Date(E.start),K,"day");m?.({...E,duration:K,end:q})},fe=(E,K)=>{if(K.template)return K.template(E);switch(K.name){case"text":{const q=ae(E);return e.jsxs("div",{className:"gantt-grid-cell-text",style:{paddingLeft:q*14},children:[e.jsx("div",{className:"gantt-row-drag-handle",onMouseDown:M=>{M.preventDefault(),i?.(E.id,M.clientX,M.clientY,"reorder")},children:e.jsx(ce.FontAwesomeIcon,{icon:G.faGripVertical})}),E.type==="project"?e.jsx("span",{className:"gantt-tree-icon",onClick:M=>{M.stopPropagation(),m?.({...E,open:!E.open})},children:e.jsx(ce.FontAwesomeIcon,{icon:E.open?G.faChevronDown:G.faChevronRight})}):e.jsx("span",{style:{width:16,display:"inline-block"}}),e.jsx("span",{className:"gantt-task-name-text",children:E.text})]})}case"start":return xe(E.start,"DD-MM-YYYY");case"end":return xe(E.end,"DD-MM-YYYY");case"duration":return D===E.id?e.jsx(p.InputNumber,{size:"small",min:1,value:F,onChange:M=>H(M||1),onBlur:()=>{X(E,F),$(null)},onPressEnter:()=>{X(E,F),$(null)},autoFocus:!0,style:{width:"100%",fontSize:"12px"}}):e.jsxs("div",{onClick:M=>{M.stopPropagation(),$(E.id),H(E.duration)},style:{backgroundColor:"#fff7e6",padding:"2px 8px",borderRadius:"4px",border:"1px solid #ffd591",fontWeight:400,color:"#d46b08",display:"inline-block",fontSize:"12px",cursor:"text"},children:[E.duration," day",E.duration!==1?"s":""]});case"predecessors":{const M=w.filter(U=>U.target===E.id)[0];return e.jsx(or,{task:E,allTasks:a,links:w,onAddDependency:(U,se,Z,ye)=>b?.(U,se,Z,ye),onRemoveDependency:U=>c?.(U),onTaskUpdate:m,styleConfig:h,children:e.jsx("div",{style:{cursor:"pointer",minHeight:"24px",width:"100%",display:"flex",alignItems:"center",gap:"4px"},children:M?(()=>{const U=a.find(Z=>Z.id===M.source),se=U?a.indexOf(U)+1:0;return e.jsx("span",{style:{fontSize:"12px",backgroundColor:"#e6f4ff",border:"1px solid #91caff",color:"#1677ff",padding:"0 7px",borderRadius:"4px",whiteSpace:"nowrap"},children:tr(M,se)})})():e.jsx("span",{style:{fontSize:"12px",color:"#1890ff",textDecoration:"none",fontWeight:500},onMouseEnter:U=>U.currentTarget.style.textDecoration="underline",onMouseLeave:U=>U.currentTarget.style.textDecoration="none",children:"Add"})})})}case"add":return e.jsx(p.Button,{type:"primary",size:"small",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faPlus,style:{fontSize:12}}),onClick:q=>{q.stopPropagation(),s?.(E.id)},title:"Add Subtask",style:{minWidth:"28px",width:"28px",height:"28px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px"}});case"progress":return e.jsxs("div",{className:"gantt-progress-cell",children:[e.jsx("div",{className:"gantt-progress-bar-bg",children:e.jsx("div",{className:"gantt-progress-bar-fill",style:{width:`${E.progress}%`}})}),e.jsxs("span",{className:"gantt-progress-text",children:[E.progress,"%"]})]});case"index":return e.jsx("span",{style:{color:"#8c8c8c"},children:a.indexOf(E)+1});default:return E[K.name]||""}};return e.jsxs("div",{className:"gantt-grid",ref:S,children:[e.jsx("div",{className:"gantt-grid-header",style:{display:"flex",minWidth:"100%"},children:o.map(E=>e.jsx("div",{className:"gantt-grid-header-cell",style:{width:E.width,minWidth:E.width,justifyContent:E.align==="center"?"center":"flex-start"},children:E.name==="add"?e.jsx("span",{style:{fontSize:11,color:"#64748b",fontWeight:600,whiteSpace:"nowrap"},children:"Add"}):e.jsxs(e.Fragment,{children:[E.label,E.name==="start"&&e.jsx(ce.FontAwesomeIcon,{icon:G.faChevronDown,style:{marginLeft:8,fontSize:10,color:"#64748b"}})]})},E.name))}),e.jsx("div",{className:"gantt-grid-body",children:t.map(E=>{const K=u?.id===E.id,q=u?.descendantIds.includes(E.id);return e.jsxs("div",{className:`gantt-grid-row ${l===E.id?"selected":""} ${K?"dragging-row":""} ${q?"descendant-dragging-row":""} ${T?.taskId===E.id?`drop-target-${T.position}`:""}`,onClick:()=>r(E.id),onContextMenu:M=>y?.(M,E.id),style:{display:"flex",minWidth:"100%"},children:[o.map(M=>{const U=M.name==="add";return e.jsx("div",{className:"gantt-grid-cell",style:{width:M.width,minWidth:M.width,textAlign:M.align||"left",display:"flex",alignItems:"center",justifyContent:U?"center":M.name==="text"?"flex-start":M.align==="center"?"center":M.align==="right"?"flex-end":"flex-start",visibility:"visible",opacity:1},children:fe(E,M)},`${E.id}-${M.name}`)}),T?.taskId===E.id&&e.jsx("div",{className:`gantt-drop-indicator ${T.position}`})]},E.id)})})]})}));xt.displayName="Grid";const Ct=({task:t,position:a,selected:o,dragging:l,onClick:r,onDragStart:y,dragDeltaX:m=0,dragType:i=null,readonly:s=!1})=>{const b=(h,v)=>{s||(h.preventDefault(),h.stopPropagation(),y(h.clientX,h.clientY,v))},c=()=>{const h=["gantt-task-bar"];return t.type==="milestone"&&h.push("milestone"),t.type==="project"&&h.push("project"),o&&h.push("selected"),l&&h.push("dragging"),t.status&&h.push(`status-${t.status}`),h.join(" ")},w=()=>{let h=a.left,v=a.width;return l&&i&&(i==="move"?h+=m:i==="resize-left"?(h+=m,v-=m):i==="resize-right"&&(v+=m)),{left:`${h}px`,width:`${Math.max(v,0)}px`,backgroundColor:t.color||void 0}},T=(h=!1)=>e.jsxs(e.Fragment,{children:[!s&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-left",onMouseDown:v=>b(v,"resize-left")}),!h&&t.type!=="milestone"&&e.jsx("div",{className:"gantt-task-progress",style:{width:`${t.progress}%`},children:t.progress>5&&t.progress<100&&e.jsxs("span",{className:"gantt-task-progress-text",children:[t.progress,"%"]})}),e.jsx("div",{className:"gantt-task-content",children:!h&&e.jsx("span",{className:"gantt-task-text",children:t.text})}),!s&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-right",onMouseDown:v=>b(v,"resize-right")})]}),u=e.jsxs("div",{className:"gantt-tooltip",children:[e.jsx("div",{className:"gantt-tooltip-title",children:t.text}),e.jsxs("div",{className:"gantt-tooltip-dates",children:[xe(t.start,"MMM D")," - ",xe(t.end,"MMM D")]}),e.jsxs("div",{className:"gantt-tooltip-progress",children:["Progress: ",t.progress,"%"]}),t.owner&&e.jsxs("div",{className:"gantt-tooltip-owner",children:["Owner: ",t.owner]})]});if(t.segments&&t.segments.length>0||t.onHoldPeriods&&t.onHoldPeriods.length>0){const h=t.end.getTime()-t.start.getTime(),v=t.segments&&t.segments.length>0?t.segments:[{start:t.start,end:t.end,duration:t.duration||0}];return e.jsxs("div",{className:"gantt-task-group",children:[t.onHoldPeriods?.map((S,D)=>e.jsx("div",{className:"gantt-on-hold-period",style:{left:`${a.left+(S.start.getTime()-t.start.getTime())/h*a.width}px`,width:`${(S.end.getTime()-S.start.getTime())/h*a.width}px`}},`hold-${D}`)),v.map((S,D)=>e.jsx(p.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:c()+" segment",style:{left:`${a.left+(S.start.getTime()-t.start.getTime())/h*a.width}px`,width:`${(S.end.getTime()-S.start.getTime())/h*a.width}px`,backgroundColor:t.color||void 0},onClick:r,onMouseDown:$=>b($,"move"),children:T(D>0)})},`seg-${D}`))]})}return e.jsx(p.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:c(),style:w(),onClick:r,onMouseDown:h=>b(h,"move"),children:T()})})},ar=({links:t,tasks:a,getTaskPosition:o})=>{const l=i=>a.find(s=>s.id===i),r=g.useMemo(()=>{let i=0,s=0;return a.forEach(b=>{try{const c=o(b);c&&typeof c.left=="number"&&typeof c.width=="number"&&(i=Math.max(i,c.left+c.width)),c&&typeof c.top=="number"&&typeof c.height=="number"&&(s=Math.max(s,c.top+c.height))}catch(c){console.warn("Failed to position task for link rendering:",b.id,c)}}),{width:Math.max(i,1e3),height:Math.max(s,100)}},[a,o]),y=i=>{const s=l(i.source),b=l(i.target);if(!s||!b)return"";const c=o(s),w=o(b),T=c.top+c.height/2,u=w.top+w.height/2;let h=0,v=0;switch(i.type){case"e2s":h=c.left+c.width,v=w.left;break;case"s2s":h=c.left,v=w.left;break;case"e2e":h=c.left+c.width,v=w.left+w.width;break;case"s2e":h=c.left,v=w.left+w.width;break}const S=v-h,D=u-T,$=20;if(i.type==="e2s")if(S>=$){const F=h+S/2;return`M ${h},${T} L ${F},${T} L ${F},${u} L ${v},${u}`}else{const F=$/2,H=T+D/2;return`M ${h},${T} L ${h+F},${T} L ${h+F},${H} L ${v-F},${H} L ${v-F},${u} L ${v},${u}`}else if(i.type==="s2s"){const F=Math.min(h,v)-$/2;return`M ${h},${T} L ${F},${T} L ${F},${u} L ${v},${u}`}else if(i.type==="e2e"){const F=Math.max(h,v)+$/2;return`M ${h},${T} L ${F},${T} L ${F},${u} L ${v},${u}`}else if(i.type==="s2e")if(S<=-$){const F=h+S/2;return`M ${h},${T} L ${F},${T} L ${F},${u} L ${v},${u}`}else{const F=$/2,H=T+D/2;return`M ${h},${T} L ${h-F},${T} L ${h-F},${H} L ${v+F},${H} L ${v+F},${u} L ${v},${u}`}return""},m=i=>{const s=l(i.target);if(!s)return"";const b=o(s),c=b.top+b.height/2,w=8,T=6;let u=0,h=!0;return i.type==="e2s"||i.type==="s2s"?(u=b.left,h=!0):(u=b.left+b.width,h=!1),h?`M ${u},${c} L ${u-w},${c-T/2} L ${u-w},${c+T/2} Z`:`M ${u},${c} L ${u+w},${c-T/2} L ${u+w},${c+T/2} Z`};return t.length===0?null:e.jsx("svg",{className:"gantt-links-layer",style:{overflow:"visible",width:r.width,height:r.height,position:"absolute",top:0,left:0,pointerEvents:"none"},children:t.map(i=>{const s=l(i.source),b=l(i.target);if(!s||!b)return null;const c=y(i),w=m(i);return!c||!w?null:e.jsxs("g",{className:"gantt-link",children:[e.jsx("path",{d:c,fill:"none",strokeWidth:"1.5",className:"gantt-link-line"}),e.jsx("path",{d:w,className:"gantt-link-arrow"})]},i.id)})})},sr=(t,a,o=60,l="day",r=1)=>{const[y,m]=g.useState({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0}),i=g.useCallback((c,w,T,u)=>{const h=t.find(v=>v.id===c);h&&m({taskId:c,initialX:w,initialY:T,initialStart:new Date(h.start),initialEnd:new Date(h.end),type:u,dragDeltaX:0,dragDeltaY:0})},[t]),s=g.useCallback((c,w)=>{if(!y.taskId||!y.type)return null;const T=c-y.initialX,u=w-y.initialY;if(m(F=>({...F,dragDeltaX:T,dragDeltaY:u})),y.type==="reorder")return null;const h=t.find(F=>F.id===y.taskId);if(!h)return null;const v=Math.round(T/o);let S=new Date(y.initialStart),D=new Date(y.initialEnd);switch(y.type){case"move":S=he(y.initialStart,v*r,l),D=he(y.initialEnd,v*r,l);break;case"resize-left":S=he(y.initialStart,v*r,l),S>=D&&(S=he(D,-r,l));break;case"resize-right":D=he(y.initialEnd,v*r,l),D<=S&&(D=he(S,r,l));break}const $=Qe(S,D);return{...h,start:S,end:D,duration:$}},[y,t,o,r,l]),b=g.useCallback(c=>{if(c&&a){const{id:w,...T}=c;a(w,T)}m({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0})},[a]);return{dragState:y,handleDragStart:i,handleDrag:s,handleDragEnd:b}},yt=g.forwardRef(({tasks:t,links:a,range:o,scales:l,config:r,selectedTask:y,onTaskClick:m,onTaskDragStart:i,onTaskDragEnd:s,onTaskUpdate:b,zoomLevel:c,baselines:w},T)=>{const[u,h]=g.useState(t),v=(r.columnWidth||60)*c,S=r.baselines&&w&&w.size>0,{dragState:D,handleDragStart:$,handleDrag:F,handleDragEnd:H}=sr(u,b,v,l[1].unit,l[1].step);g.useEffect(()=>{(t.length!==u.length||t.some((L,P)=>{const A=u[P];return!A||L.id!==A.id||L.start.getTime()!==A.start.getTime()||L.end.getTime()!==A.end.getTime()}))&&h(t)},[t]);const ae=g.useCallback(f=>{const L=[];let P=new Date(o.start);for(;P<=o.end;)L.push({date:new Date(P),label:xe(P,f.format||"D")}),P=he(P,f.step,f.unit);return L},[o.start,o.end]),X=g.useCallback(f=>{const L=l[1],P=o.start.getTime(),R=f.getTime()-P,ne={hour:36e5,day:864e5,week:6048e5,month:2592e6,quarter:7776e6,year:31536e6}[L.unit]||864e5;return R/(ne*L.step)*v},[l,o.start,v]),fe=f=>{const L=X(f.start),P=X(f.end);return{left:L,width:Math.max(P-L,0)}},E=f=>{const L=X(f.start),P=X(f.end);return{left:L,width:Math.max(P-L,0)}},K=f=>{const L=fe(f),P=u.findIndex(ne=>ne.id===f.id),A=r.rowHeight||48,R=32,le=(A-R)/2;return{left:L.left,width:L.width,top:P*A+le,height:R}},q=g.useRef(null),M=g.useCallback(f=>{D.taskId&&D.type&&(q.current&&cancelAnimationFrame(q.current),q.current=requestAnimationFrame(()=>{const L=F(f.clientX,f.clientY);L&&h(P=>P.map(A=>A.id===L.id?L:A))}))},[D,F]),U=g.useCallback(()=>{if(D.taskId){const f=u.find(L=>L.id===D.taskId);H(f||null),s()}},[D,u,H,s]),se=l[1],Z=g.useMemo(()=>ae(se),[ae,se]),ye=g.useCallback(()=>{const f=[];let L=-1,P=-1,A=0,R="";return Z.forEach(le=>{const ne=le.date.getMonth(),Fe=le.date.getFullYear(),de=xe(le.date,"MMM YYYY");ne!==L||Fe!==P?(L!==-1&&f.push({label:R,width:A}),L=ne,P=Fe,A=v,R=de):A+=v}),L!==-1&&f.push({label:R,width:A}),f},[Z,v]),$e=g.useCallback(()=>{const f=[];let L=-1,P=0,A=-1,R=-1,le="";return Z.forEach(ne=>{const de=ne.date.getDate()<=15?0:1,ke=ne.date.getMonth(),Be=ne.date.getFullYear(),Pe=xe(ne.date,"MMM"),Te=new Date(Be,ke+1,0).getDate(),Oe=de===0?`${Pe} 1 - 15`:`${Pe} 16 - ${Te}`;de!==L||ke!==A||Be!==R?(L!==-1&&f.push({label:le,width:P}),L=de,A=ke,R=Be,P=v,le=Oe):P+=v}),L!==-1&&f.push({label:le,width:P}),f},[Z,v]),De=g.useMemo(()=>ye(),[ye]),_=g.useMemo(()=>$e(),[$e]),Y=g.useMemo(()=>Z.length*v,[Z.length,v]),pe=g.useMemo(()=>{const f=new Date;return f.setHours(0,0,0,0),f},[]),te=g.useMemo(()=>{if(!r.showTodayLine)return null;const f=X(pe);return f>=-v&&f<=Y+v?Math.max(0,Math.min(f,Y)):null},[r.showTodayLine,pe,Y,v,X]),re=g.useMemo(()=>{if(r.projectStartDate)return Ye(r.projectStartDate);if(t.length>0){const f=t.map(L=>L.start.getTime());return Ye(new Date(Math.min(...f)))}return null},[r.projectStartDate,t]),Q=g.useMemo(()=>{if(!r.showProjectStartLine||!re)return null;const f=X(re);return f>=-v&&f<=Y+v?Math.max(0,Math.min(f,Y)):null},[r.showProjectStartLine,re,Y,v,X]);return e.jsxs("div",{className:"gantt-timeline-container",ref:T,onMouseMove:M,onMouseUp:U,style:{width:Y,position:"relative"},children:[e.jsxs("div",{className:"gantt-timeline-header",style:{width:Y,minWidth:Y,position:"relative"},children:[te!==null&&r.showTodayLine&&r.todayLineLabel&&r.todayLineLabel!==""&&e.jsx("div",{className:"gantt-today-line-label",style:{position:"absolute",top:"calc(var(--gantt-scale-height, 24px) * 2)",left:`${te}px`,transform:"translateX(-50%)",backgroundColor:r.todayLineColor||"#ff4d4f",color:"#ffffff",padding:"4px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 2px 6px rgba(0, 0, 0, 0.2)",lineHeight:"1.2",zIndex:101,pointerEvents:"none",...r.todayLineLabelStyle},children:r.todayLineLabel}),Q!==null&&r.showProjectStartLine&&r.projectStartLineLabel&&r.projectStartLineLabel!==""&&e.jsx("div",{className:"gantt-project-start-line-label",style:{position:"absolute",top:"calc(var(--gantt-scale-height, 24px) * 2)",left:`${Q}px`,transform:"translateX(-50%)",backgroundColor:r.projectStartLineColor||"#40a9ff",color:"#ffffff",padding:"4px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 2px 6px rgba(0, 0, 0, 0.2)",lineHeight:"1.2",zIndex:101,pointerEvents:"none",...r.projectStartLineLabelStyle},children:r.projectStartLineLabel}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-month",style:{width:Y},children:De.map((f,L)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:f.width,minWidth:f.width,maxWidth:f.width,borderRight:L===De.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`top-${L}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-range",style:{width:Y},children:_.map((f,L)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:f.width,minWidth:f.width,maxWidth:f.width,borderRight:L===_.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`mid-${L}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-day",style:{width:Y},children:Z.map((f,L)=>{const P=r.weekends&&ht(f.date),A=r.holidays&&ft(f.date,r.holidays);return e.jsx("div",{className:`gantt-timeline-cell ${P?"weekend":""} ${A?"holiday":""}`,style:{width:v,minWidth:v,maxWidth:v,borderRight:L===Z.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`day-${L}`)})})]}),e.jsxs("div",{className:"gantt-timeline-body",style:{width:Y,position:"relative"},children:[te!==null&&e.jsxs(e.Fragment,{children:[r.showTodayLineMarker!==!1&&(()=>{const f=r.todayLineMarkerSize||8,L=r.todayLineColor||"#ff4d4f",P=r.todayLineMarkerStyle||"triangle",A=r.todayLineOpacity!==void 0?r.todayLineOpacity:1;return P==="triangle"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${te}px`,top:"-4px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:A}}):P==="arrow"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${te}px`,top:"-6px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f*.7}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:A}}):P==="dot"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${te}px`,top:`-${f/2}px`,transform:"translateX(-50%)",width:`${f}px`,height:`${f}px`,borderRadius:"50%",backgroundColor:L,zIndex:7,pointerEvents:"none",opacity:A}}):null})(),e.jsx("div",{className:"gantt-today-line",style:{position:"absolute",left:`${te}px`,top:0,bottom:0,width:`${r.todayLineWidth||1}px`,backgroundColor:r.todayLineColor||"#ff4d4f",opacity:r.todayLineOpacity!==void 0?r.todayLineOpacity:1,borderLeft:r.todayLineStyle==="dashed"?`${r.todayLineWidth||1}px dashed ${r.todayLineColor||"#ff4d4f"}`:r.todayLineStyle==="dotted"?`${r.todayLineWidth||1}px dotted ${r.todayLineColor||"#ff4d4f"}`:"none",zIndex:6,pointerEvents:"none"}})]}),Q!==null&&e.jsxs(e.Fragment,{children:[r.showProjectStartLineMarker!==!1&&(()=>{const f=r.projectStartLineMarkerSize||8,L=r.projectStartLineColor||"#40a9ff",P=r.projectStartLineMarkerStyle||"triangle",A=r.projectStartLineOpacity!==void 0?r.projectStartLineOpacity:1;return P==="triangle"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${Q}px`,top:"-4px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:A}}):P==="arrow"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${Q}px`,top:"-6px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f*.7}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:A}}):P==="dot"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${Q}px`,top:`-${f/2}px`,transform:"translateX(-50%)",width:`${f}px`,height:`${f}px`,borderRadius:"50%",backgroundColor:L,zIndex:7,pointerEvents:"none",opacity:A}}):null})(),e.jsx("div",{className:"gantt-project-start-line",style:{position:"absolute",left:`${Q}px`,top:0,bottom:0,width:`${r.projectStartLineWidth||1}px`,backgroundColor:r.projectStartLineColor||"#40a9ff",opacity:r.projectStartLineOpacity!==void 0?r.projectStartLineOpacity:1,borderLeft:r.projectStartLineStyle==="dashed"?`${r.projectStartLineWidth||1}px dashed ${r.projectStartLineColor||"#40a9ff"}`:r.projectStartLineStyle==="dotted"?`${r.projectStartLineWidth||1}px dotted ${r.projectStartLineColor||"#40a9ff"}`:"none",zIndex:6,pointerEvents:"none"}})]}),e.jsx("div",{className:"gantt-timeline-grid",children:Z.map((f,L)=>{const P=r.weekends&&ht(f.date),A=r.holidays&&ft(f.date,r.holidays);return e.jsx("div",{className:`gantt-timeline-grid-column ${P?"weekend":""} ${A?"holiday":""}`,style:{width:v,minWidth:v}},L)})}),a.length>0&&e.jsx(ar,{links:a,tasks:u,getTaskPosition:K}),e.jsx("div",{className:"gantt-timeline-tasks",style:{width:Y},children:u.map(f=>{const L=fe(f),P=S?w?.get(f.id):void 0,A=P?E(P):void 0;return e.jsxs("div",{className:"gantt-timeline-row",children:[P&&A&&e.jsx("div",{className:`gantt-baseline-bar ${f.type==="milestone"?"milestone":""}`,style:{left:`${A.left}px`,width:`${A.width}px`},title:`Baseline: ${P.start.toLocaleDateString()} - ${P.end.toLocaleDateString()}`}),e.jsx(Ct,{task:f,position:L,selected:y===f.id,dragging:D.taskId===f.id,dragDeltaX:D.dragDeltaX,dragType:D.type,onClick:()=>m(f.id),onDragStart:(R,le,ne)=>{$(f.id,R,le,ne),i(f.id,R,le)},readonly:r.readonly})]},f.id)})})]})]})});yt.displayName="Timeline";const gt=g.forwardRef((t,a)=>e.jsx("div",{className:"gantt-chart-wrapper",style:{flex:1,minWidth:0},children:e.jsx(yt,{...t,ref:a})}));gt.displayName="Chart";const{Search:ir}=p.Input,Nt=({onFilterChange:t,owners:a=[],uiConfig:o={}})=>{const[l,r]=g.useState({searchText:"",status:"all",priority:"all",owner:""}),y=s=>{const b={...l,...s};r(b),t(b)},m=()=>{const s={searchText:"",status:"all",priority:"all",owner:""};r(s),t(s)},i=l.searchText!==""||l.status!=="all"||l.priority!=="all"||l.owner!=="";return e.jsx("div",{className:"gantt-filter-container",children:e.jsxs("div",{className:"gantt-filter-bar",children:[e.jsx("div",{className:"gantt-filter-left",children:e.jsx(ir,{placeholder:o.searchPlaceholder||"Search stages...",value:l.searchText,onChange:s=>y({searchText:s.target.value}),allowClear:!0,className:"gantt-search-antd",style:{width:250}})}),e.jsxs("div",{className:"gantt-filter-right",children:[e.jsx(p.Select,{value:l.status,onChange:s=>y({status:s}),className:"gantt-filter-select-antd",style:{width:140},options:[{value:"all",label:o.statusOptions?.all||"All Status"},{value:"not-started",label:o.statusOptions?.notStarted||"Not Started"},{value:"in-progress",label:o.statusOptions?.inProgress||"In Progress"},{value:"completed",label:o.statusOptions?.completed||"Completed"}]}),e.jsx(p.Select,{value:l.priority,onChange:s=>y({priority:s}),className:"gantt-filter-select-antd",style:{width:130},options:[{value:"all",label:o.priorityFilterOptions?.all||"All Priority"},{value:"low",label:o.priorityFilterOptions?.low||"Low"},{value:"medium",label:o.priorityFilterOptions?.medium||"Medium"},{value:"high",label:o.priorityFilterOptions?.high||"High"}]}),e.jsx(p.Select,{value:l.owner||void 0,onChange:s=>y({owner:s||""}),className:"gantt-filter-select-antd",style:{width:130},placeholder:o.allOwnersText||"All Owners",allowClear:!0,options:[{value:"",label:o.allOwnersText||"All Owners"},...(a||[]).map(s=>({value:s,label:s}))]}),i&&e.jsx(p.Button,{type:"default",danger:!0,icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTimesCircle}),onClick:m,className:"gantt-filter-clear-antd",children:o.clearFiltersText||"Clear"})]})]})})},Ae=(t,a)=>t?typeof t=="string"?e.jsx(ce.FontAwesomeIcon,{icon:a}):t:e.jsx(ce.FontAwesomeIcon,{icon:a}),At=({zoomLevel:t,setZoomLevel:a,onExport:o,onFilterChange:l,owners:r,onAddTask:y,uiConfig:m,iconConfig:i={},styleConfig:s})=>{const b=He(s),c=m.showZoomButtons!==!1,w=m.showExportButtons!==!1,T=c&&w;return e.jsxs("div",{className:"gantt-toolbar-wrapper",children:[e.jsxs("div",{className:"gantt-toolbar",children:[e.jsx("div",{className:"gantt-toolbar-left",children:e.jsx(p.Space,{size:8,children:m.showAddTaskButton!==!1&&e.jsx(p.Button,{type:"primary",icon:Ae(i.addTask,G.faPlus),onClick:()=>y?.(),style:b.buttonPrimary,children:m.addTaskButtonText||"New Stage"})})}),e.jsx("div",{className:"gantt-toolbar-right",children:e.jsxs(p.Space,{size:4,children:[c&&e.jsxs(e.Fragment,{children:[e.jsx(p.Tooltip,{title:m.zoomOutTooltip||"Zoom Out",children:e.jsx(p.Button,{icon:Ae(i.zoomOut,G.faSearchMinus),onClick:()=>a(Math.max(.5,t-.25)),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:m.zoomInTooltip||"Zoom In",children:e.jsx(p.Button,{icon:Ae(i.zoomIn,G.faSearchPlus),onClick:()=>a(Math.min(2,t+.25)),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:m.resetZoomTooltip||"Reset Zoom",children:e.jsx(p.Button,{icon:Ae(i.resetZoom,G.faRotateLeft),onClick:()=>a(1),style:b.buttonSecondary})})]}),T&&e.jsx(p.Divider,{type:"vertical",style:{height:24,margin:"0 4px"}}),w&&e.jsxs(e.Fragment,{children:[e.jsx(p.Tooltip,{title:m.exportCSVTooltip||"Export to CSV",children:e.jsx(p.Button,{icon:Ae(i.exportCSV,G.faFileCsv),onClick:()=>o("csv"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:m.exportExcelTooltip||"Export to Excel",children:e.jsx(p.Button,{icon:Ae(i.exportExcel,G.faFileExcel),onClick:()=>o("excel"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:m.exportJSONTooltip||"Export to JSON",children:e.jsx(p.Button,{icon:Ae(i.exportJSON,G.faFileCode),onClick:()=>o("json"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:m.exportPDFTooltip||"Export to PDF",children:e.jsx(p.Button,{icon:Ae(i.exportPDF,G.faFilePdf),onClick:()=>o("pdf"),style:b.buttonSecondary})})]})]})})]}),m.showFilterSearch!==!1&&e.jsx(Nt,{onFilterChange:l,owners:r,uiConfig:m})]})},{Option:Ue}=p.Select,{TextArea:lr}=p.Input,Bt=({onCreateTask:t,onClose:a,uiConfig:o={},parentId:l,parentTaskName:r,styleConfig:y})=>{const[m]=p.Form.useForm(),i=He(y),s=b=>{const c=b.start.toDate(),w=new Date(c);w.setDate(w.getDate()+(b.duration||1)),t({text:b.text,start:c,end:w,duration:b.duration||1,progress:b.progress||0,type:b.type,color:typeof b.color=="string"?b.color:b.color?.toHexString?.()||"#4A90E2",owner:b.owner||"",priority:b.priority||"medium",details:b.details||"",parent:l},l),a()};return e.jsx(p.Modal,{title:l?(o.taskCreatorTitle||"Create Checklist")+(r?` for "${r}"`:""):o.taskCreatorTitle||"Create New Stage",open:!0,onCancel:a,onOk:()=>m.submit(),okText:o.taskCreatorOkText||"Create Stage",cancelText:o.taskCreatorCancelText||"Cancel",width:600,className:"gantt-modal-antd",styles:{content:i.modal,header:{borderBottom:`1px solid ${i.modal?.borderColor||"#f0f0f0"}`,marginBottom:16}},okButtonProps:{style:i.buttonPrimary},cancelButtonProps:{style:i.buttonSecondary},children:e.jsxs(p.Form,{form:m,layout:"vertical",onFinish:s,initialValues:{type:"task",priority:"medium",start:Et(),duration:1,progress:0,color:"#4A90E2"},children:[e.jsx(p.Form.Item,{name:"text",label:o.taskNameLabel||"Stage Name",rules:[{required:!0,message:o.taskNameRequired||"Please enter stage name"}],children:e.jsx(p.Input,{placeholder:o.taskNamePlaceholder||"Enter stage name",autoFocus:!0,style:i.input})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"type",label:o.typeLabel||"Type",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ue,{value:"task",children:o.taskTypeOptions?.task||"Stage"}),e.jsx(Ue,{value:"milestone",children:o.taskTypeOptions?.milestone||"Milestone"}),e.jsx(Ue,{value:"project",children:o.taskTypeOptions?.project||"Project"})]})}),e.jsx(p.Form.Item,{name:"priority",label:o.priorityLabel||"Priority",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ue,{value:"low",children:o.priorityOptions?.low||"Low"}),e.jsx(Ue,{value:"medium",children:o.priorityOptions?.medium||"Medium"}),e.jsx(Ue,{value:"high",children:o.priorityOptions?.high||"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"start",label:o.startDateLabel||"Start Date",style:{flex:1},children:e.jsx(p.DatePicker,{style:{width:"100%",...i.input}})}),e.jsx(p.Form.Item,{name:"duration",label:o.durationLabel||"Duration (days)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,style:{width:"100%",...i.input}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"color",label:o.colorLabel||"Color",style:{flex:1},children:e.jsx(p.ColorPicker,{showText:!0})}),e.jsx(p.Form.Item,{name:"progress",label:o.progressLabel||"Progress (%)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,max:100,style:{width:"100%",...i.input}})})]}),e.jsx(p.Form.Item,{name:"owner",label:o.ownerLabel||"Owner",children:e.jsx(p.Input,{placeholder:o.ownerPlaceholder||"Assign to...",style:i.input})}),e.jsx(p.Form.Item,{name:"details",label:o.detailsLabel||"Details",children:e.jsx(lr,{placeholder:o.detailsPlaceholder||"Add stage description...",rows:3,style:i.input})})]})})},{Option:Ve}=p.Select,{TextArea:dr}=p.Input,{confirm:cr}=p.Modal,It=({task:t,onUpdate:a,onDelete:o,onClose:l,uiConfig:r={},styleConfig:y})=>{const[m]=p.Form.useForm(),i=He(y),s=c=>{const w=c.start.toDate(),T=new Date(w);T.setDate(T.getDate()+(c.duration||1)),a({...t,text:c.text,start:w,end:T,duration:c.duration||1,progress:c.progress||0,type:c.type,color:typeof c.color=="string"?c.color:c.color?.toHexString?.()||"#4A90E2",owner:c.owner||"",priority:c.priority||"medium",details:c.details||""}),l()},b=()=>{cr({title:r.deleteConfirmTitle?`${r.deleteConfirmTitle}: "${t.text}"?`:`Are you sure you want to delete "${t.text}"?`,icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faExclamationTriangle,style:{color:"#faad14",marginRight:8}}),content:r.deleteConfirmContent||"This action cannot be undone.",okText:r.deleteConfirmOkText||"Yes, Delete",okType:"danger",cancelText:r.deleteConfirmCancelText||"No",onOk(){o(t.id),l()}})};return e.jsx(p.Modal,{title:r.taskEditorTitle||"Edit Stage",open:!0,onCancel:l,footer:[e.jsx(p.Button,{danger:!0,onClick:b,style:{float:"left",...i.buttonDanger},children:r.taskEditorDeleteText||"Delete"},"delete"),e.jsx(p.Button,{onClick:l,style:i.buttonSecondary,children:r.taskEditorCancelText||"Cancel"},"cancel"),e.jsx(p.Button,{type:"primary",onClick:()=>m.submit(),style:i.buttonPrimary,children:r.taskEditorSaveText||"Save Changes"},"submit")],width:600,className:"gantt-modal-antd",styles:{content:i.modal,header:{borderBottom:`1px solid ${i.modal?.borderColor||"#f0f0f0"}`,marginBottom:16}},children:e.jsxs(p.Form,{form:m,layout:"vertical",onFinish:s,initialValues:{text:t.text,type:t.type||"task",priority:t.priority||"medium",start:Et(t.start),duration:t.duration,progress:t.progress,color:t.color||"#4A90E2",owner:t.owner||"",details:t.details||""},children:[e.jsx(p.Form.Item,{name:"text",label:r.taskNameLabel||"Stage Name",rules:[{required:!0,message:r.taskNameRequired||"Please enter stage name"}],children:e.jsx(p.Input,{placeholder:r.taskNamePlaceholder||"Enter stage name",style:i.input})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"type",label:r.typeLabel||"Type",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ve,{value:"task",children:r.taskTypeOptions?.task||"Stage"}),e.jsx(Ve,{value:"milestone",children:r.taskTypeOptions?.milestone||"Milestone"}),e.jsx(Ve,{value:"project",children:r.taskTypeOptions?.project||"Project"})]})}),e.jsx(p.Form.Item,{name:"priority",label:r.priorityLabel||"Priority",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ve,{value:"low",children:r.priorityOptions?.low||"Low"}),e.jsx(Ve,{value:"medium",children:r.priorityOptions?.medium||"Medium"}),e.jsx(Ve,{value:"high",children:r.priorityOptions?.high||"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"start",label:r.startDateLabel||"Start Date",style:{flex:1},children:e.jsx(p.DatePicker,{style:{width:"100%",...i.input}})}),e.jsx(p.Form.Item,{name:"duration",label:r.durationLabel||"Duration (days)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,style:{width:"100%",...i.input}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"color",label:r.colorLabel||"Color",style:{flex:1},children:e.jsx(p.ColorPicker,{showText:!0})}),e.jsx(p.Form.Item,{name:"progress",label:r.progressLabel||"Progress (%)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,max:100,style:{width:"100%",...i.input}})})]}),e.jsx(p.Form.Item,{name:"owner",label:r.ownerLabel||"Owner",children:e.jsx(p.Input,{placeholder:r.ownerPlaceholder||"Assign to...",style:i.input})}),e.jsx(p.Form.Item,{name:"details",label:r.detailsLabel||"Details",children:e.jsx(dr,{placeholder:r.detailsPlaceholder||"Add stage description...",rows:3,style:i.input})})]})})},{Title:et,Text:Re,Paragraph:ur}=p.Typography,{Option:Ee}=p.Select,_t=({task:t,allTasks:a,links:o,onAddDependency:l,onRemoveDependency:r,onTaskUpdate:y,onClose:m,styleConfig:i})=>{const s=He(i),[b,c]=g.useState(""),[w,T]=g.useState("e2s"),[u,h]=g.useState(0),[v,S]=g.useState("day"),[D,$]=g.useState(t.duration),[F,H]=g.useState(""),ae=o.filter(M=>M.target===t.id),X=a.filter(M=>M.id!==t.id&&M.id!==t.parent),fe=()=>{if(b){const M=mt(u,v);if(D!==t.duration&&y){const U=he(new Date(t.start),D,"day");y({...t,duration:D,end:U})}l(b,t.id,w,M),c(""),h(0),S("day")}},E=()=>{if(!F.trim())return;const M=er(F.trim());if(!M){alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
|
|
15
|
+
Example: 3FS+10d`);return}const U=M.taskNumber-1,se=a[U];if(!se){alert(`Task ${M.taskNumber} not found`);return}const Z=rr(M.type),ye=mt(M.lag,M.lagUnit);l(se.id,t.id,Z,ye),H("")},K=M=>{switch(M){case"e2s":return"Finish-to-Start (FS)";case"s2s":return"Start-to-Start (SS)";case"e2e":return"Finish-to-Finish (FF)";case"s2e":return"Start-to-Finish (SF)"}},q=M=>{switch(M){case"e2s":return"blue";case"s2s":return"green";case"e2e":return"purple";case"s2e":return"orange"}};return e.jsx(p.Modal,{title:e.jsx(et,{level:4,style:{margin:0,color:s.font?.color},children:"Dependency Editor"}),open:!0,onCancel:m,footer:null,width:700,styles:{content:s.modal,header:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`}},children:e.jsxs("div",{style:{padding:"8px 0"},children:[e.jsx(p.Alert,{message:"Managing dependencies helps in auto-scheduling and critical path calculation.",type:"info",showIcon:!0,style:{marginBottom:20,...s.font}}),e.jsxs("div",{style:{display:"flex",gap:20,marginBottom:24},children:[e.jsx(p.Card,{title:e.jsx(et,{level:5,style:{margin:0,fontSize:14,color:s.font?.color},children:"Settings"}),size:"small",style:{flex:1,...s.modal},headStyle:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`},children:e.jsxs(p.Space,{direction:"vertical",style:{width:"100%"},size:"middle",children:[e.jsxs("div",{children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Predecessor"}),e.jsx(p.Select,{showSearch:!0,placeholder:"Select a task",optionFilterProp:"children",style:{width:"100%",...s.input},value:b,onChange:c,children:X.map(M=>e.jsxs(Ee,{value:M.id,children:["[",a.indexOf(M)+1,"] ",M.text]},M.id))})]}),e.jsxs("div",{children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Type"}),e.jsxs(p.Select,{style:{width:"100%",...s.input},value:w,onChange:T,children:[e.jsx(Ee,{value:"e2s",children:"Finish-to-Start (FS)"}),e.jsx(Ee,{value:"s2s",children:"Start-to-Start (SS)"}),e.jsx(Ee,{value:"e2e",children:"Finish-to-Finish (FF)"}),e.jsx(Ee,{value:"s2e",children:"Start-to-Finish (SF)"})]})]}),e.jsxs("div",{style:{display:"flex",gap:12},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Lag/Lead"}),e.jsx(p.InputNumber,{style:{width:"100%",...s.input},value:u,onChange:M=>h(M||0)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Units"}),e.jsxs(p.Select,{style:{width:"100%",...s.input},value:v,onChange:S,children:[e.jsx(Ee,{value:"day",children:"Days"}),e.jsx(Ee,{value:"hour",children:"Hours"}),e.jsx(Ee,{value:"week",children:"Weeks"}),e.jsx(Ee,{value:"month",children:"Months"})]})]})]}),e.jsxs("div",{children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Duration (days)"}),e.jsx(p.InputNumber,{style:{width:"100%",...s.input},min:1,value:D,onChange:M=>$(M||1)})]}),e.jsx(p.Button,{type:"primary",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faPlus,style:{marginRight:8}}),block:!0,onClick:fe,disabled:!b,style:{height:40,marginTop:8,...s.buttonPrimary},children:"Add Dependency"})]})}),e.jsxs(p.Card,{title:e.jsx(et,{level:5,style:{margin:0,fontSize:14,color:s.font?.color},children:"Quick Add"}),size:"small",style:{width:250,...s.modal},headStyle:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`},children:[e.jsxs(ur,{type:"secondary",style:{fontSize:12,marginBottom:16,color:s.font?.color,opacity:.7},children:["Format: [TaskNumber][Type][+/-][Lag][Unit]",e.jsx("br",{}),"Example: 3FS+10d"]}),e.jsx(p.Input,{placeholder:"e.g. 5FS+2d",value:F,onChange:M=>H(M.target.value),onPressEnter:E,style:{marginBottom:16,height:40,...s.input}}),e.jsx(p.Button,{block:!0,onClick:E,style:{height:40,...s.buttonSecondary},children:"Apply"})]})]}),e.jsx(p.Divider,{style:{margin:"0 0 24px 0",borderColor:s.modal?.borderColor}}),e.jsxs("div",{style:{maxHeight:300,overflowY:"auto"},children:[e.jsx(et,{level:5,style:{fontSize:14,marginBottom:16,color:s.font?.color},children:"Current Dependencies"}),e.jsx(p.List,{dataSource:ae,locale:{emptyText:e.jsx(Re,{type:"secondary",style:{color:s.font?.color,opacity:.5},children:"No dependencies added yet."})},renderItem:M=>{const U=a.find(se=>se.id===M.source);return e.jsx(p.List.Item,{style:{padding:"12px 16px",background:"#fafafa",borderRadius:8,marginBottom:12,border:`1px solid ${s.listItem?.borderColor||"#f0f0f0"}`},actions:[e.jsx(p.Button,{type:"text",danger:!0,icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTrash}),onClick:()=>r(M.id)},"delete")],children:e.jsx(p.List.Item.Meta,{avatar:e.jsx("div",{style:{width:32,height:32,borderRadius:16,background:"#1890ff",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:12,fontWeight:"bold"},children:U?a.indexOf(U)+1:"?"}),title:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontWeight:600,color:s.font?.color},children:U?.text||"Unknown Task"}),e.jsx(p.Tag,{color:q(M.type),style:{margin:0},children:K(M.type)})]}),description:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16,marginTop:4},children:e.jsxs("span",{style:{fontSize:12,color:s.font?.color,opacity:.7},children:[e.jsx(ce.FontAwesomeIcon,{icon:G.faLink,style:{marginRight:6}}),"Lag: ",M.lag||0," days"]})})})})}})]}),e.jsxs("div",{style:{marginTop:24,padding:"16px",background:"#fff7e6",borderRadius:8,border:"1px solid #ffe7ba"},children:[e.jsxs(et,{level:5,style:{fontSize:13,marginBottom:8,display:"flex",alignItems:"center"},children:[e.jsx(ce.FontAwesomeIcon,{icon:G.faInfoCircle,style:{marginRight:8,color:"#fa8c16"}}),"Coming soon"]}),e.jsx(Re,{style:{fontSize:12,color:"rgba(0,0,0,0.65)"},children:"Dependency visualization on the chart and automatic lag calculations based on working hours."})]})]})})},pr=({x:t,y:a,task:o,onEdit:l,onDelete:r,onCopy:y,onDependencies:m,onConvertToMilestone:i,onConvertToTask:s,onConvertToProject:b,onAutoSchedule:c,onClose:w,styleConfig:T})=>{const u=He(T);if(!o)return null;const h=[{key:"edit",label:"Edit",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faEdit}),onClick:()=>{l(),w()}},{key:"copy",label:"Copy",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faCopy}),onClick:()=>{y(),w()}},{key:"dependencies",label:"Dependencies",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faLink}),onClick:()=>{m(),w()}},{type:"divider"},{key:"convert",label:"Convert to",type:"submenu",children:[{key:"milestone",label:"Milestone",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faFlag}),disabled:o.type==="milestone",onClick:()=>{i(),w()}},{key:"task",label:"Task",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTasks}),disabled:o.type==="task",onClick:()=>{s(),w()}},{key:"project",label:"Project",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faFolder}),disabled:o.type==="project",onClick:()=>{b(),w()}}]},{key:"auto-schedule",label:"Auto Schedule",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faRotateLeft}),onClick:()=>{c?.(),w()}},{type:"divider"},{key:"delete",label:"Delete",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTrash}),danger:!0,onClick:()=>{r(),w()}}];return e.jsx("div",{className:"gantt-context-menu",style:{position:"fixed",left:`${t}px`,top:`${a}px`,zIndex:1e4},onClick:v=>v.stopPropagation(),children:e.jsx(p.Menu,{items:h,style:{boxShadow:u.popover?.boxShadow||"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:u.popover?.borderRadius||"6px",border:`1px solid ${u.popover?.borderColor||"#e0e0e0"}`,backgroundColor:u.popover?.backgroundColor,color:u.font?.color,fontFamily:u.font?.fontFamily}})})},Yt=(t,a=[])=>{const[o,l]=g.useState([]),[r,y]=g.useState(-1),[m,i]=g.useState(t),[s,b]=g.useState(a);g.useEffect(()=>{i(t)},[t]),g.useEffect(()=>{b(a)},[a]);const c=g.useCallback(($,F,H)=>{const ae={type:$,before:F,after:H,timestamp:Date.now()},X=o.slice(0,r+1);X.push(ae),X.length>50?X.shift():y(r+1),l(X)},[o,r]),w=g.useCallback(()=>{if(r<0)return;const $=o[r];i($.before.tasks),b($.before.links),y(r-1)},[o,r]),T=g.useCallback(()=>{if(r>=o.length-1)return;const $=o[r+1];i($.after.tasks),b($.after.links),y(r+1)},[o,r]),u=r>=0,h=r<o.length-1,v=g.useCallback($=>{const F={tasks:m,links:s},H=m.map(X=>X.id===$.id?$:X);c("task_update",F,{tasks:H,links:s}),i(H)},[m,s,c]),S=g.useCallback($=>{const F={tasks:m,links:s},H=[...m,$];c("task_create",F,{tasks:H,links:s}),i(H)},[m,s,c]),D=g.useCallback($=>{const F={tasks:m,links:s},H=m.filter(fe=>fe.id!==$),ae=s.filter(fe=>fe.source!==$&&fe.target!==$);c("task_delete",F,{tasks:H,links:ae}),i(H),b(ae)},[m,s,c]);return{tasks:m,links:s,setTasks:i,setLinks:b,undo:w,redo:T,canUndo:u,canRedo:h,updateTask:v,createTask:S,deleteTask:D,saveState:c,history:o}},Rt=(t,a,o={mode:"forward"})=>{const l=new Map,r=new Map;return t.forEach(y=>{l.set(y.id,[]),r.set(y.id,[])}),a.forEach(y=>{y.type==="e2s"&&(l.get(y.target)?.push(y.source),r.get(y.source)?.push(y.target))}),o.mode==="forward"?hr(t,l,o):fr(t,r,o)},hr=(t,a,o)=>{const l=new Map,r=new Set,y=o.projectStart||new Date,m=i=>{if(r.has(i))return;const s=t.find(h=>h.id===i);if(!s)return;const b=a.get(i)||[];b.forEach(h=>m(h));let c=y;b.forEach(h=>{const v=l.get(h);v&&v.end>c&&(c=new Date(v.end))});const w=new Date(c),T=he(w,s.duration,"day"),u={...s,start:w,end:T};l.set(i,u),r.add(i)};return t.forEach(i=>m(i.id)),t.map(i=>l.get(i.id)||i)},fr=(t,a,o)=>{const l=new Map,r=new Set,y=o.projectEnd||new Date(Math.max(...t.map(i=>i.end.getTime()))),m=i=>{if(r.has(i))return;const s=t.find(h=>h.id===i);if(!s)return;const b=a.get(i)||[];b.forEach(h=>m(h));let c=y;b.forEach(h=>{const v=l.get(h);v&&v.start<c&&(c=new Date(v.start))});const w=new Date(c),T=he(w,-s.duration,"day"),u={...s,start:T,end:w};l.set(i,u),r.add(i)};return t.forEach(i=>m(i.id)),t.map(i=>l.get(i.id)||i)},mr=Object.freeze(Object.defineProperty({__proto__:null,autoSchedule:Rt,levelResources:t=>{const a=new Map;t.forEach(l=>{l.owner&&(a.has(l.owner)||a.set(l.owner,[]),a.get(l.owner).push(l))});const o=[...t];return a.forEach(l=>{const r=l.sort((y,m)=>y.start.getTime()-m.start.getTime());for(let y=1;y<r.length;y++){const m=r[y],i=r[y-1];if(m.start<i.end){const s=o.findIndex(b=>b.id===m.id);if(s>=0){const b=new Date(i.end),c=he(b,m.duration,"day");o[s]={...m,start:b,end:c}}}}}),o}},Symbol.toStringTag,{value:"Module"})),zt=t=>{const a=new Map;return t.forEach(o=>{a.set(o.id,{taskId:o.id,start:new Date(o.start),end:new Date(o.end)})}),a},Wt=t=>{const a=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority"],o=t.map(r=>[r.id,r.text,xe(r.start,"YYYY-MM-DD"),xe(r.end,"YYYY-MM-DD"),r.duration.toString(),`${r.progress}%`,r.type||"task",r.owner||"",r.priority||"medium"]),l=[a.join(","),...o.map(r=>r.map(y=>`"${y}"`).join(","))].join(`
|
|
16
|
+
`);st(l,"gantt-tasks.csv","text/csv")},Ht=t=>{const a=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority","Details"],o=t.map(r=>[r.id,r.text,xe(r.start,"MM/DD/YYYY"),xe(r.end,"MM/DD/YYYY"),r.duration.toString(),r.progress.toString(),r.type||"task",r.owner||"",r.priority||"medium",r.details||""]),l="\uFEFF"+[a.join(" "),...o.map(r=>r.map(y=>y.replace(/\t/g," ")).join(" "))].join(`
|
|
17
17
|
`);st(l,"gantt-tasks.xls","application/vnd.ms-excel")},Ut=(t,a)=>{const o={tasks:t,links:a,exported:new Date().toISOString(),version:"1.0"},l=JSON.stringify(o,null,2);st(l,"gantt-project.json","application/json")},Vt=t=>{const a=`
|
|
18
18
|
GANTT CHART PROJECT
|
|
19
19
|
Generated: ${new Date().toLocaleString()}
|
|
@@ -21,11 +21,11 @@ Generated: ${new Date().toLocaleString()}
|
|
|
21
21
|
Tasks:
|
|
22
22
|
${t.map((o,l)=>`
|
|
23
23
|
${l+1}. ${o.text}
|
|
24
|
-
Start: ${
|
|
25
|
-
End: ${
|
|
24
|
+
Start: ${xe(o.start,"MM/DD/YYYY")}
|
|
25
|
+
End: ${xe(o.end,"MM/DD/YYYY")}
|
|
26
26
|
Duration: ${o.duration} days
|
|
27
27
|
Progress: ${o.progress}%
|
|
28
28
|
${o.owner?`Owner: ${o.owner}`:""}
|
|
29
29
|
`).join(`
|
|
30
30
|
`)}
|
|
31
|
-
`.trim();st(a,"gantt-report.txt","text/plain"),alert("PDF export is a simplified text version. For full PDF with charts, a PDF library would be needed.")},xr=(t,a,o="png")=>{if(!document.getElementById(t)){alert("Could not find Gantt chart element to export");return}if(o==="svg"){alert("SVG export requires additional library. Use PNG or implement with dom-to-svg.");return}alert("Image export requires html2canvas library. Install with: npm install html2canvas")},st=(t,a,o)=>{const l=new Blob([t],{type:o}),r=URL.createObjectURL(l);yr(r,a),URL.revokeObjectURL(r)},yr=(t,a)=>{const o=document.createElement("a");o.href=t,o.download=a,document.body.appendChild(o),o.click(),document.body.removeChild(o)},gr=Object.freeze(Object.defineProperty({__proto__:null,exportToCSV:Wt,exportToExcel:Ht,exportToImage:xr,exportToJSON:Ut,exportToPDF:Vt,importFromJSON:t=>new Promise((a,o)=>{const l=new FileReader;l.onload=r=>{try{const y=r.target?.result,x=JSON.parse(y),i=x.tasks.map(s=>({...s,start:new Date(s.start),end:new Date(s.end)}));a({tasks:i,links:x.links||[]})}catch{o(new Error("Invalid JSON file"))}},l.onerror=()=>o(new Error("Failed to read file")),l.readAsText(t)})},Symbol.toStringTag,{value:"Module"})),Xt=(t,a)=>t.filter(o=>{if(a.searchText){const l=a.searchText.toLowerCase(),r=o.text.toLowerCase().includes(l),y=o.owner?.toLowerCase().includes(l),x=o.details?.toLowerCase().includes(l);if(!r&&!y&&!x)return!1}if(a.status!=="all"&&(o.progress===0?"not-started":o.progress===100?"completed":"in-progress")!==a.status||a.priority!=="all"&&o.priority!==a.priority||a.owner&&o.owner!==a.owner)return!1;if(a.dateRange){const l=o.start.getTime(),r=a.dateRange.start.getTime(),y=a.dateRange.end.getTime();if(l<r||l>y)return!1}return!0}),br=t=>[{name:"index",label:"",width:40,align:"center"},{name:"text",label:t?.columnLabels?.name||"Name",width:250,align:"left",resize:!0},{name:"predecessors",label:t?.columnLabels?.dependsOn||"Depends on",width:120,align:"left"},{name:"duration",label:t?.columnLabels?.duration||"Duration",width:110,align:"left"},{name:"start",label:t?.columnLabels?.start||"Start",width:130,align:"left"},{name:"add",label:"",width:50,align:"center"}],wr=[{unit:"month",step:1,format:"MMM"},{unit:"day",step:1,format:"D"}],vr={headerTitle:"Iris Gantt",showHeader:!0,showAddTaskButton:!0,showBaselineButton:!1,showZoomButtons:!0,showExportButtons:!0,showFilterSearch:!0,addTaskButtonText:"New Task",baselineButtonText:"Set Baseline",baselineButtonTextActive:"Baselines",zoomOutTooltip:"Zoom Out",zoomInTooltip:"Zoom In",resetZoomTooltip:"Reset Zoom",exportCSVTooltip:"Export to CSV",exportExcelTooltip:"Export to Excel",exportJSONTooltip:"Export to JSON",exportPDFTooltip:"Export to PDF",hideBaselinesTooltip:"Hide Baselines",showBaselinesTooltip:"Show Baselines",taskCreatorTitle:"Create New Task",taskCreatorOkText:"Create Task",taskCreatorCancelText:"Cancel",taskNameLabel:"Task Name",taskNamePlaceholder:"Enter task name",typeLabel:"Type",priorityLabel:"Priority",startDateLabel:"Start Date",durationLabel:"Duration (days)",colorLabel:"Color",progressLabel:"Progress (%)",ownerLabel:"Owner",ownerPlaceholder:"Assign to...",detailsLabel:"Details",detailsPlaceholder:"Add task description...",taskTypeOptions:{task:"Task",milestone:"Milestone",project:"Project"},priorityOptions:{low:"Low",medium:"Medium",high:"High"},taskEditorTitle:"Edit Task",taskEditorSaveText:"Save Changes",taskEditorCancelText:"Cancel",taskEditorDeleteText:"Delete",deleteConfirmTitle:"Delete Task",deleteConfirmContent:"This action cannot be undone.",deleteConfirmOkText:"Yes, Delete",deleteConfirmCancelText:"No",searchPlaceholder:"Search tasks...",allOwnersText:"All Owners",allStatusText:"All Status",allPriorityText:"All Priority",clearFiltersText:"Clear",statusOptions:{all:"All Status",notStarted:"Not Started",inProgress:"In Progress",completed:"Completed"},priorityFilterOptions:{all:"All Priority",low:"Low",medium:"Medium",high:"High"},columnLabels:{name:"Name",dependsOn:"Depends on",duration:"Duration",start:"Start"},taskNameRequired:"Please enter task name"},jr=({tasks:t=[],links:a=[],config:o={},uiConfig:l={},styleConfig:r={},iconConfig:y={},onTaskUpdate:x,onTaskCreate:i,onTaskDelete:s,onLinkCreate:b,onLinkDelete:c,baselines:w})=>{const T={...vr,...l},u=g.useMemo(()=>{const d={};return r.primary&&(d["--wx-gantt-primary"]=r.primary),r.primarySelected&&(d["--wx-gantt-primary-selected"]=r.primarySelected),r.success&&(d["--wx-gantt-success"]=r.success),r.warning&&(d["--wx-gantt-warning"]=r.warning),r.danger&&(d["--wx-gantt-danger"]=r.danger),r.background&&(d["--wx-gantt-background"]=r.background),r.backgroundAlt&&(d["--wx-gantt-background-alt"]=r.backgroundAlt),r.backgroundHover&&(d["--wx-gantt-background-hover"]=r.backgroundHover),r.selectColor&&(d["--wx-gantt-select-color"]=r.selectColor),r.taskColor&&(d["--wx-gantt-task-color"]=r.taskColor),r.taskFillColor&&(d["--wx-gantt-task-fill-color"]=r.taskFillColor),r.projectColor&&(d["--wx-gantt-project-color"]=r.projectColor),r.milestoneColor&&(d["--wx-gantt-milestone-color"]=r.milestoneColor),r.fontColor&&(d["--wx-gantt-font-color"]=r.fontColor),r.fontColorAlt&&(d["--wx-gantt-font-color-alt"]=r.fontColorAlt),r.iconColor&&(d["--wx-gantt-icon-color"]=r.iconColor),r.borderColor&&(d["--wx-gantt-border-color"]=r.borderColor),r.fontFamily&&(d["--wx-gantt-font-family"]=r.fontFamily),r.fontMono&&(d["--wx-gantt-font-mono"]=r.fontMono),r.fontSize&&(d["--wx-gantt-font-size"]=r.fontSize),r.fontWeight&&(d["--wx-gantt-font-weight"]=String(r.fontWeight)),r.lineHeight&&(d["--wx-gantt-line-height"]=String(r.lineHeight)),r.spacingXS&&(d["--gantt-spacing-xs"]=r.spacingXS),r.spacingSM&&(d["--gantt-spacing-sm"]=r.spacingSM),r.spacingMD&&(d["--gantt-spacing-md"]=r.spacingMD),r.spacingLG&&(d["--gantt-spacing-lg"]=r.spacingLG),r.customCSSVariables&&Object.entries(r.customCSSVariables).forEach(([S,C])=>{d[S.startsWith("--")?S:`--${S}`]=C}),d},[r]),h=Array.isArray(t)?t:[],v=Array.isArray(a)?a:[],{tasks:j,links:D,setTasks:$,setLinks:P,undo:H,redo:ae,updateTask:J,createTask:fe,deleteTask:E,saveState:K}=Yt(h,v),[V,M]=g.useState(j),[U,se]=g.useState(null),[Z,xe]=g.useState(null),[$e,De]=g.useState(!1),[I,Y]=g.useState(void 0),[ue,te]=g.useState(void 0),[re,Q]=g.useState(!1),[f,L]=g.useState(null),[O,N]=g.useState(null),[R,ie]=g.useState(null),[ne,Fe]=g.useState(null),[le,ke]=g.useState(null),[Be,Pe]=g.useState(1),[Se,Oe]=g.useState(()=>w&&w.size>0?w:h.length>0?zt(h):new Map);g.useEffect(()=>{w&&w.size>0&&Oe(w)},[w]);const[tt]=g.useState(o.theme||"light"),[ze,wt]=g.useState({searchText:"",status:"all",priority:"all",owner:""}),it=g.useRef(null),Ce=g.useRef(null),vt=g.useRef(null),Ie=g.useRef(!1),Me=g.useRef(null),we={columns:o.columns||br(l),scales:wr,readonly:!1,editable:!0,taskHeight:28,rowHeight:44,scaleHeight:28,columnWidth:80,minColumnWidth:60,autoSchedule:!1,criticalPath:!1,baselines:!0,weekends:!0,holidays:[],theme:tt,locale:"en",showTodayLine:o.showTodayLine!==!1,todayLineColor:o.todayLineColor||"#ff4d4f",todayLineLabel:o.todayLineLabel!==void 0?o.todayLineLabel:"Today",todayLineWidth:o.todayLineWidth||1,todayLineStyle:o.todayLineStyle||"solid",todayLineOpacity:o.todayLineOpacity!==void 0?o.todayLineOpacity:1,todayLineLabelStyle:o.todayLineLabelStyle,showTodayLineMarker:o.showTodayLineMarker!==!1,todayLineMarkerSize:o.todayLineMarkerSize||8,todayLineMarkerStyle:o.todayLineMarkerStyle||"triangle",showProjectStartLine:o.showProjectStartLine!==!1,projectStartDate:o.projectStartDate,projectStartLineColor:o.projectStartLineColor||"#40a9ff",projectStartLineLabel:o.projectStartLineLabel!==void 0?o.projectStartLineLabel:"Start Project",projectStartLineWidth:o.projectStartLineWidth||1,projectStartLineStyle:o.projectStartLineStyle||"solid",projectStartLineOpacity:o.projectStartLineOpacity!==void 0?o.projectStartLineOpacity:1,projectStartLineLabelStyle:o.projectStartLineLabelStyle,showProjectStartLineMarker:o.showProjectStartLineMarker!==!1,projectStartLineMarkerSize:o.projectStartLineMarkerSize||8,projectStartLineMarkerStyle:o.projectStartLineMarkerStyle||"triangle",...o};g.useEffect(()=>{const d=Xt(j,ze);M((C=>{const z=[],de=X=>{if(!X)return!1;const ye=C.find(oe=>oe.id===X);return ye&&!ye.open&&ye.type==="project"?!0:de(ye?.parent)};return C.forEach(X=>{de(X.parent)||z.push(X)}),z})(d))},[j,ze]);const lt=g.useMemo(()=>{if(!j||!Array.isArray(j))return[];try{return Array.from(new Set(j.map(d=>d?.owner).filter(Boolean)))}catch(d){return console.warn("Error extracting owners:",d),[]}},[j]),dt=(()=>{const d=V.length>0?V:j;if(d.length===0){const X=new Date;return{start:Ye(he(X,-30,"day")),end:Ye(he(X,60,"day"))}}const S=d.map(X=>X.start.getTime()),C=d.map(X=>X.end.getTime()),z=new Date(Math.min(...S)),de=new Date(Math.max(...C));return{start:Ye(he(z,-7,"day")),end:Ye(de)}})(),ct=d=>{se(d)},jt=(d,S)=>{if(we.readonly)return;d.preventDefault();const C=j.find(z=>z.id===S);C&&ke({x:d.clientX,y:d.clientY,task:C})},St=()=>{if(!le?.task)return;const d=le.task,S={...d,id:`task-${Date.now()}`,text:`${d.text} (Copy)`,start:he(d.start,7,"day"),end:he(d.end,7,"day")};fe(S),i&&i(S)},rt=d=>{if(!le?.task)return;const S={...le.task,type:d};J(S),x&&x(S)},Tt=(d,S,C,z)=>{if(!we.readonly)if(z==="reorder"){const de=V.findIndex(oe=>oe.id===d),X=(oe,ge)=>{let _e=[];return ge.filter(n=>n.parent===oe).forEach(n=>{_e.push(n.id),_e=[..._e,...X(n.id,ge)]}),_e},ye=X(d,j);ie({id:d,initialIndex:de,currentY:C,descendantIds:ye}),document.body.classList.add("gantt-dragging")}else N(d)},Dt=()=>{if(R&&ne){const d=j.find(C=>C.id===R.id),S=j.find(C=>C.id===ne.taskId);if(d&&S&&d.id!==S.id){const C=[d.id,...R.descendantIds];if(!C.includes(S.id)){const z=[...j],de=ne.position==="inside"?S.id:S.parent,X=z.findIndex(F=>F.id===d.id);X!==-1&&(z[X]={...z[X],parent:de});const ye=z.filter(F=>C.includes(F.id)),oe=z.filter(F=>!C.includes(F.id));let ge=oe.findIndex(F=>F.id===S.id);if(ne.position==="inside"){const F=oe.filter(B=>B.parent===S.id);F.length>0?ge=oe.findIndex(B=>B.id===F[F.length-1].id)+1:ge++}else if(ne.position==="below"){const F=(q,_)=>{let A=[];return _.filter(ee=>ee.parent===q).forEach(ee=>{A.push(ee.id),A=[...A,...F(ee.id,_)]}),A},B=F(S.id,oe);B.length>0?ge=oe.findIndex(q=>q.id===B[B.length-1])+1:ge++}const _e={tasks:[...j],links:[...D]};oe.splice(ge,0,...ye),$(oe),K("task_update",_e,{tasks:oe,links:D});const ht=X+1,n=oe.findIndex(F=>F.id===d.id)+1,m={currentSequenceId:ht,targetSequenceId:n,targetStageId:de??null},k=oe.find(F=>F.id===d.id);k&&x&&x(k,m)}}}N(null),ie(null),Fe(null),document.body.classList.remove("gantt-dragging")},nt=g.useRef(null),kt=g.useCallback(d=>{R&&(nt.current&&cancelAnimationFrame(nt.current),nt.current=requestAnimationFrame(()=>{const S=we.rowHeight||44,C=Ce.current?.querySelector(".gantt-grid-body");if(!C)return;const z=C.getBoundingClientRect(),de=d.clientY-z.top;let X=Math.floor(de/S);X=Math.max(0,Math.min(X,V.length-1));const ye=V[X];if(ye){const oe=de-X*S;let ge="above";ye.type==="project"?oe<S*.3?ge="above":oe>S*.7?ge="below":ge="inside":ge=oe<S/2?"above":"below",ye.id!==R.id?Fe({taskId:ye.id,position:ge}):Fe(null)}ie(oe=>oe?{...oe,currentY:d.clientY}:null)}))},[R,V,we.rowHeight]),Xe=()=>{R&&Dt()},ut=(d,S)=>{const C={...d,id:`task-${Date.now()}`,parent:S};fe(C);const z={taskId:C.id,start:new Date(C.start),end:new Date(C.end)};Oe(de=>{const X=new Map(de);return X.set(C.id,z),X}),i&&i(C)},Le=d=>{J(d),x&&x(d)},qe=d=>{E(d),Oe(S=>{const C=new Map(S);return C.delete(d),C}),s&&s(d)},Je=(d,S,C,z)=>{const de={id:`link-${Date.now()}`,source:d,target:S,type:C,lag:z};P([...D,de]),b&&b(de)},ot=d=>{const S=D.filter(C=>C.id!==d);P(S),c&&c(d)};g.useEffect(()=>{const d=new Map(Se);let S=!1;j.forEach(z=>{Se.has(z.id)||(d.set(z.id,{taskId:z.id,start:new Date(z.start),end:new Date(z.end)}),S=!0)});const C=new Set(j.map(z=>z.id));Se.forEach((z,de)=>{C.has(de)||(d.delete(de),S=!0)}),S&&Oe(d)},[j]),g.useEffect(()=>{const d=S=>{(S.ctrlKey||S.metaKey)&&(S.key==="z"&&!S.shiftKey?(S.preventDefault(),H()):(S.key==="y"||S.key==="z"&&S.shiftKey)&&(S.preventDefault(),ae()))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[H,ae]),g.useEffect(()=>{const d=Ce.current?.querySelector(".gantt-grid-body"),S=it.current?.querySelector(".gantt-timeline-body");if(!d||!S)return;const C=()=>{Ie.current||(Ie.current=!0,S.scrollTop=d.scrollTop,Me.current&&clearTimeout(Me.current),Me.current=window.setTimeout(()=>{Ie.current=!1},150))},z=()=>{Ie.current||(Ie.current=!0,d.scrollTop=S.scrollTop,Me.current&&clearTimeout(Me.current),Me.current=window.setTimeout(()=>{Ie.current=!1},150))};return d.addEventListener("scroll",C,{passive:!0}),S.addEventListener("scroll",z,{passive:!0}),()=>{d.removeEventListener("scroll",C),S.removeEventListener("scroll",z),Me.current&&clearTimeout(Me.current)}},[V]);const Mt={height:o.containerHeight||"100%",minHeight:o.containerMinHeight||"400px"},pt=o.gridWidth?{"--gantt-grid-width":o.gridWidth}:{};return e.jsxs("div",{className:`gantt-page-wrapper theme-${tt}`,style:{...Mt,...u},children:[T.showHeader&&e.jsx("div",{className:"gantt-page-header",children:e.jsx("div",{className:"gantt-page-header-left",children:e.jsx("h1",{className:"gantt-page-title",children:T.headerTitle})})}),e.jsxs("div",{className:`gantt-container theme-${we.theme}`,style:pt,children:[e.jsx(At,{zoomLevel:Be,setZoomLevel:Pe,onExport:d=>{d==="csv"&&Wt(j),d==="excel"&&Ht(j),d==="json"&&Ut(j,D),d==="pdf"&&Vt(j)},onFilterChange:d=>wt(d),owners:lt||[],onAddTask:d=>{if(d){const S=j.find(C=>C.id===d);Y(d),te(S?.text)}else Y(void 0),te(void 0);De(!0)},uiConfig:T,iconConfig:y,styleConfig:r}),e.jsxs("div",{className:"gantt-layout",ref:vt,onMouseMove:kt,onMouseUp:Xe,onMouseLeave:Xe,children:[e.jsx(yt,{ref:Ce,tasks:V,columns:we.columns||[],selectedTask:U,onTaskClick:ct,onTaskContextMenu:jt,onTaskUpdate:Le,onTaskDragStart:Tt,onAddTask:d=>{if(d){const S=j.find(C=>C.id===d);Y(d),te(S?.text)}else Y(void 0),te(void 0);De(!0)},onAddDependency:Je,onRemoveDependency:ot,onDependencyClick:d=>{const S=j.find(C=>C.id===d);S&&(L(S),Q(!0))},links:D,allTasks:j,dropIndicator:ne,reorderTask:R,iconConfig:y,styleConfig:r}),e.jsx(bt,{ref:it,tasks:V,links:D,range:dt,scales:we.scales,config:we,selectedTask:U,draggedTask:O,onTaskClick:()=>{},onTaskDragStart:()=>{},onTaskDragEnd:()=>{},onTaskUpdate:(d,S)=>{const C=j.find(z=>z.id===d);C&&Le({...C,...S})},zoomLevel:Be,baselines:Se})]}),$e&&e.jsx(Bt,{onCreateTask:ut,onClose:()=>{De(!1),Y(void 0),te(void 0)},uiConfig:T,parentId:I,parentTaskName:ue,styleConfig:r}),Z&&e.jsx(It,{task:Z,onUpdate:Le,onDelete:qe,onClose:()=>xe(null),uiConfig:T,styleConfig:r}),re&&f&&e.jsx(_t,{task:f,allTasks:j,links:D,onAddDependency:Je,onRemoveDependency:ot,onTaskUpdate:Le,onClose:()=>{Q(!1),L(null)},styleConfig:r}),le&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-context-menu-overlay",onClick:()=>ke(null),onContextMenu:d=>{d.preventDefault(),ke(null)}}),e.jsx(pr,{x:le.x,y:le.y,task:le.task,onEdit:()=>{le.task&&xe(le.task)},onDelete:()=>{le.task&&qe(le.task.id)},onCopy:St,onDependencies:()=>{le.task&&(L(le.task),Q(!0))},onConvertToMilestone:()=>rt("milestone"),onConvertToTask:()=>rt("task"),onConvertToProject:()=>rt("project"),onClose:()=>ke(null),onAutoSchedule:()=>{const d=Rt(j,D,{mode:"forward"});$(d),ke(null)},iconConfig:y,styleConfig:r})]}),R&&e.jsx("div",{className:"gantt-grid-row ghost-row",style:{height:we.rowHeight,top:R.currentY-(we.rowHeight||48)/2,left:Ce.current?.getBoundingClientRect().left,position:"fixed",pointerEvents:"none",opacity:.8,zIndex:9999,width:Ce.current?.offsetWidth,backgroundColor:"#ffffff",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #2196F3",display:"flex"},children:we.columns?.map(d=>e.jsx("div",{className:"gantt-grid-cell",style:{width:d.width,textAlign:d.align||"left"},children:(()=>{const S=j.find(C=>C.id===R.id);if(!S)return null;if(d.template)return d.template(S);switch(d.name){case"text":return e.jsxs("div",{className:"gantt-grid-cell-text",children:[e.jsx(ce.FontAwesomeIcon,{icon:G.faGripVertical,style:{marginRight:8,color:"#adb5bd"}}),e.jsxs("span",{className:"gantt-task-name-text",children:[S.text,R.descendantIds.length>0&&e.jsxs("span",{children:[" +",R.descendantIds.length," subtasks"]})]})]});case"start":return me(S.start,"DD MMM YYYY");case"duration":return`${S.duration}`;default:return S[d.name]||""}})()},`ghost-${d.name}`))})]})]})},Sr=Object.freeze(Object.defineProperty({__proto__:null,calculateCriticalPath:(t,a)=>{const o=new Set,l=new Map,r=new Map,y=new Map;t.forEach(u=>{r.set(u.id,[]),y.set(u.id,[])}),a.forEach(u=>{u.type==="e2s"&&(r.get(u.source)?.push(u.target),y.get(u.target)?.push(u.source))});const x=new Map,i=new Map,s=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const v=t.find(D=>D.id===u);if(!v)return;const j=y.get(u)||[];if(j.length===0)x.set(u,0),i.set(u,v.duration);else{let D=0;j.forEach($=>{s($,h);const P=i.get($)||0;D=Math.max(D,P)}),x.set(u,D),i.set(u,D+v.duration)}};t.forEach(u=>s(u.id));const b=new Map,c=new Map,w=Math.max(...Array.from(i.values())),T=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const v=t.find(D=>D.id===u);if(!v)return;const j=r.get(u)||[];if(j.length===0)c.set(u,w),b.set(u,w-v.duration);else{let D=1/0;j.forEach($=>{T($,h);const P=b.get($)||0;D=Math.min(D,P)}),c.set(u,D),b.set(u,D-v.duration)}};return t.forEach(u=>T(u.id)),t.forEach(u=>{const h=x.get(u.id)||0,j=(b.get(u.id)||0)-h;l.set(u.id,j),Math.abs(j)<.01&&o.add(u.id)}),{criticalTasks:o,taskFloats:l,projectDuration:w}},getTaskFloat:(t,a)=>a.taskFloats.get(t)||0,isCriticalTask:(t,a)=>a.criticalTasks.has(t)},Symbol.toStringTag,{value:"Module"}));W.AutoScheduler=mr,W.Chart=bt,W.CriticalPath=Sr,W.DependencyEditor=_t,W.ExportUtils=gr,W.FilterSearch=Nt,W.Gantt=jr,W.Grid=yt,W.TaskBar=Ct,W.TaskCreator=Bt,W.TaskEditor=It,W.Timeline=gt,W.Toolbar=At,W.addToDate=he,W.applyFilters=Xt,W.calculateDuration=Qt,W.createBaseline=zt,W.formatDate=me,W.getDaysBetween=Qe,W.getEndOfDay=Kt,W.getHoursBetween=Ot,W.getStartOfDay=Ye,W.isHoliday=mt,W.isWeekend=ft,W.useUndoRedo=Yt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
|
|
31
|
+
`.trim();st(a,"gantt-report.txt","text/plain"),alert("PDF export is a simplified text version. For full PDF with charts, a PDF library would be needed.")},xr=(t,a,o="png")=>{if(!document.getElementById(t)){alert("Could not find Gantt chart element to export");return}if(o==="svg"){alert("SVG export requires additional library. Use PNG or implement with dom-to-svg.");return}alert("Image export requires html2canvas library. Install with: npm install html2canvas")},st=(t,a,o)=>{const l=new Blob([t],{type:o}),r=URL.createObjectURL(l);yr(r,a),URL.revokeObjectURL(r)},yr=(t,a)=>{const o=document.createElement("a");o.href=t,o.download=a,document.body.appendChild(o),o.click(),document.body.removeChild(o)},gr=Object.freeze(Object.defineProperty({__proto__:null,exportToCSV:Wt,exportToExcel:Ht,exportToImage:xr,exportToJSON:Ut,exportToPDF:Vt,importFromJSON:t=>new Promise((a,o)=>{const l=new FileReader;l.onload=r=>{try{const y=r.target?.result,m=JSON.parse(y),i=m.tasks.map(s=>({...s,start:new Date(s.start),end:new Date(s.end)}));a({tasks:i,links:m.links||[]})}catch{o(new Error("Invalid JSON file"))}},l.onerror=()=>o(new Error("Failed to read file")),l.readAsText(t)})},Symbol.toStringTag,{value:"Module"})),qt=(t,a)=>t.filter(o=>{if(a.searchText){const l=a.searchText.toLowerCase(),r=o.text.toLowerCase().includes(l),y=o.owner?.toLowerCase().includes(l),m=o.details?.toLowerCase().includes(l);if(!r&&!y&&!m)return!1}if(a.status!=="all"&&(o.progress===0?"not-started":o.progress===100?"completed":"in-progress")!==a.status||a.priority!=="all"&&o.priority!==a.priority||a.owner&&o.owner!==a.owner)return!1;if(a.dateRange){const l=o.start.getTime(),r=a.dateRange.start.getTime(),y=a.dateRange.end.getTime();if(l<r||l>y)return!1}return!0}),br=t=>[{name:"index",label:"",width:40,align:"center"},{name:"text",label:t?.columnLabels?.name||"Name",width:250,align:"left",resize:!0},{name:"predecessors",label:t?.columnLabels?.dependsOn||"Depends on",width:120,align:"left"},{name:"duration",label:t?.columnLabels?.duration||"Duration",width:110,align:"left"},{name:"start",label:t?.columnLabels?.start||"Start",width:130,align:"left"},{name:"add",label:"",width:50,align:"center"}],wr=[{unit:"month",step:1,format:"MMM"},{unit:"day",step:1,format:"D"}],vr={headerTitle:"Iris Gantt",showHeader:!0,showAddTaskButton:!0,showBaselineButton:!1,showZoomButtons:!0,showExportButtons:!0,showFilterSearch:!0,addTaskButtonText:"New Task",baselineButtonText:"Set Baseline",baselineButtonTextActive:"Baselines",zoomOutTooltip:"Zoom Out",zoomInTooltip:"Zoom In",resetZoomTooltip:"Reset Zoom",exportCSVTooltip:"Export to CSV",exportExcelTooltip:"Export to Excel",exportJSONTooltip:"Export to JSON",exportPDFTooltip:"Export to PDF",hideBaselinesTooltip:"Hide Baselines",showBaselinesTooltip:"Show Baselines",taskCreatorTitle:"Create New Task",taskCreatorOkText:"Create Task",taskCreatorCancelText:"Cancel",taskNameLabel:"Task Name",taskNamePlaceholder:"Enter task name",typeLabel:"Type",priorityLabel:"Priority",startDateLabel:"Start Date",durationLabel:"Duration (days)",colorLabel:"Color",progressLabel:"Progress (%)",ownerLabel:"Owner",ownerPlaceholder:"Assign to...",detailsLabel:"Details",detailsPlaceholder:"Add task description...",taskTypeOptions:{task:"Task",milestone:"Milestone",project:"Project"},priorityOptions:{low:"Low",medium:"Medium",high:"High"},taskEditorTitle:"Edit Task",taskEditorSaveText:"Save Changes",taskEditorCancelText:"Cancel",taskEditorDeleteText:"Delete",deleteConfirmTitle:"Delete Task",deleteConfirmContent:"This action cannot be undone.",deleteConfirmOkText:"Yes, Delete",deleteConfirmCancelText:"No",searchPlaceholder:"Search tasks...",allOwnersText:"All Owners",allStatusText:"All Status",allPriorityText:"All Priority",clearFiltersText:"Clear",statusOptions:{all:"All Status",notStarted:"Not Started",inProgress:"In Progress",completed:"Completed"},priorityFilterOptions:{all:"All Priority",low:"Low",medium:"Medium",high:"High"},columnLabels:{name:"Name",dependsOn:"Depends on",duration:"Duration",start:"Start"},taskNameRequired:"Please enter task name"},Sr=({tasks:t=[],links:a=[],config:o={},uiConfig:l={},styleConfig:r={},iconConfig:y={},onTaskUpdate:m,onTaskCreate:i,onTaskDelete:s,onLinkCreate:b,onLinkDelete:c,baselines:w})=>{const T={...vr,...l},u=g.useMemo(()=>{const d={};return r.primary&&(d["--wx-gantt-primary"]=r.primary),r.primarySelected&&(d["--wx-gantt-primary-selected"]=r.primarySelected),r.success&&(d["--wx-gantt-success"]=r.success),r.warning&&(d["--wx-gantt-warning"]=r.warning),r.danger&&(d["--wx-gantt-danger"]=r.danger),r.background&&(d["--wx-gantt-background"]=r.background),r.backgroundAlt&&(d["--wx-gantt-background-alt"]=r.backgroundAlt),r.backgroundHover&&(d["--wx-gantt-background-hover"]=r.backgroundHover),r.selectColor&&(d["--wx-gantt-select-color"]=r.selectColor),r.taskColor&&(d["--wx-gantt-task-color"]=r.taskColor),r.taskFillColor&&(d["--wx-gantt-task-fill-color"]=r.taskFillColor),r.projectColor&&(d["--wx-gantt-project-color"]=r.projectColor),r.milestoneColor&&(d["--wx-gantt-milestone-color"]=r.milestoneColor),r.fontColor&&(d["--wx-gantt-font-color"]=r.fontColor),r.fontColorAlt&&(d["--wx-gantt-font-color-alt"]=r.fontColorAlt),r.iconColor&&(d["--wx-gantt-icon-color"]=r.iconColor),r.borderColor&&(d["--wx-gantt-border-color"]=r.borderColor),r.fontFamily&&(d["--wx-gantt-font-family"]=r.fontFamily),r.fontMono&&(d["--wx-gantt-font-mono"]=r.fontMono),r.fontSize&&(d["--wx-gantt-font-size"]=r.fontSize),r.fontWeight&&(d["--wx-gantt-font-weight"]=String(r.fontWeight)),r.lineHeight&&(d["--wx-gantt-line-height"]=String(r.lineHeight)),r.spacingXS&&(d["--gantt-spacing-xs"]=r.spacingXS),r.spacingSM&&(d["--gantt-spacing-sm"]=r.spacingSM),r.spacingMD&&(d["--gantt-spacing-md"]=r.spacingMD),r.spacingLG&&(d["--gantt-spacing-lg"]=r.spacingLG),r.customCSSVariables&&Object.entries(r.customCSSVariables).forEach(([j,O])=>{d[j.startsWith("--")?j:`--${j}`]=O}),d},[r]),h=Array.isArray(t)?t:[],v=Array.isArray(a)?a:[],{tasks:S,links:D,setTasks:$,setLinks:F,undo:H,redo:ae,updateTask:X,createTask:fe,deleteTask:E,saveState:K}=Yt(h,v),[q,M]=g.useState(S),[U,se]=g.useState(null),[Z,ye]=g.useState(null),[$e,De]=g.useState(!1),[_,Y]=g.useState(void 0),[pe,te]=g.useState(void 0),[re,Q]=g.useState(!1),[f,L]=g.useState(null),[P,A]=g.useState(null),[R,le]=g.useState(null),[ne,Fe]=g.useState(null),[de,ke]=g.useState(null),[Be,Pe]=g.useState(1),[Te,Oe]=g.useState(()=>w&&w.size>0?w:h.length>0?zt(h):new Map);g.useEffect(()=>{w&&w.size>0&&Oe(w)},[w]);const[tt]=g.useState(o.theme||"light"),[ze,bt]=g.useState({searchText:"",status:"all",priority:"all",owner:""}),it=g.useRef(null),Ce=g.useRef(null),wt=g.useRef(null),Ie=g.useRef(!1),Me=g.useRef(null),ve={columns:o.columns||br(l),scales:wr,readonly:!1,editable:!0,taskHeight:28,rowHeight:44,scaleHeight:28,columnWidth:80,minColumnWidth:60,autoSchedule:!1,criticalPath:!1,baselines:!0,weekends:!0,holidays:[],theme:tt,locale:"en",showTodayLine:o.showTodayLine!==!1,todayLineColor:o.todayLineColor||"#ff4d4f",todayLineLabel:o.todayLineLabel!==void 0?o.todayLineLabel:"Today",todayLineWidth:o.todayLineWidth||1,todayLineStyle:o.todayLineStyle||"solid",todayLineOpacity:o.todayLineOpacity!==void 0?o.todayLineOpacity:1,todayLineLabelStyle:o.todayLineLabelStyle,showTodayLineMarker:o.showTodayLineMarker!==!1,todayLineMarkerSize:o.todayLineMarkerSize||8,todayLineMarkerStyle:o.todayLineMarkerStyle||"triangle",showProjectStartLine:o.showProjectStartLine!==!1,projectStartDate:o.projectStartDate,projectStartLineColor:o.projectStartLineColor||"#40a9ff",projectStartLineLabel:o.projectStartLineLabel!==void 0?o.projectStartLineLabel:"Start Project",projectStartLineWidth:o.projectStartLineWidth||1,projectStartLineStyle:o.projectStartLineStyle||"solid",projectStartLineOpacity:o.projectStartLineOpacity!==void 0?o.projectStartLineOpacity:1,projectStartLineLabelStyle:o.projectStartLineLabelStyle,showProjectStartLineMarker:o.showProjectStartLineMarker!==!1,projectStartLineMarkerSize:o.projectStartLineMarkerSize||8,projectStartLineMarkerStyle:o.projectStartLineMarkerStyle||"triangle",...o};g.useEffect(()=>{const d=qt(S,ze);M((O=>{const z=[],ie=J=>{if(!J)return!1;const be=O.find(oe=>oe.id===J);return be&&!be.open&&be.type==="project"?!0:ie(be?.parent)};return O.forEach(J=>{ie(J.parent)||z.push(J)}),z})(d))},[S,ze]);const lt=g.useMemo(()=>{if(!S||!Array.isArray(S))return[];try{return Array.from(new Set(S.map(d=>d?.owner).filter(Boolean)))}catch(d){return console.warn("Error extracting owners:",d),[]}},[S]),dt=(()=>{const d=q.length>0?q:S;if(d.length===0){const J=new Date;return{start:Ye(he(J,-30,"day")),end:Ye(he(J,60,"day"))}}const j=d.map(J=>J.start.getTime()),O=d.map(J=>J.end.getTime()),z=new Date(Math.min(...j)),ie=new Date(Math.max(...O));return{start:Ye(he(z,-7,"day")),end:Ye(ie)}})(),ct=d=>{se(d)},vt=(d,j)=>{if(ve.readonly)return;d.preventDefault();const O=S.find(z=>z.id===j);O&&ke({x:d.clientX,y:d.clientY,task:O})},St=()=>{if(!de?.task)return;const d=de.task,j={...d,id:`task-${Date.now()}`,text:`${d.text} (Copy)`,start:he(d.start,7,"day"),end:he(d.end,7,"day")};fe(j),i&&i(j)},rt=d=>{if(!de?.task)return;const j={...de.task,type:d};X(j),m&&m(j)},jt=(d,j,O,z)=>{if(!ve.readonly)if(z==="reorder"){const ie=q.findIndex(oe=>oe.id===d),J=(oe,we)=>{let _e=[];return we.filter(n=>n.parent===oe).forEach(n=>{_e.push(n.id),_e=[..._e,...J(n.id,we)]}),_e},be=J(d,S);le({id:d,initialIndex:ie,currentY:O,descendantIds:be}),document.body.classList.add("gantt-dragging")}else A(d)},Tt=()=>{if(R&&ne){const d=S.find(O=>O.id===R.id),j=S.find(O=>O.id===ne.taskId);if(d&&j&&d.id!==j.id){const O=[d.id,...R.descendantIds];if(!O.includes(j.id)){const z=[...S],ie=ne.position==="inside"?j.id:j.parent,J=z.findIndex(C=>C.id===d.id);J!==-1&&(z[J]={...z[J],parent:ie});const be=z.filter(C=>O.includes(C.id)),oe=z.filter(C=>!O.includes(C.id));let we=oe.findIndex(C=>C.id===j.id);if(ne.position==="inside"){const C=oe.filter(B=>B.parent===j.id);C.length>0?we=oe.findIndex(B=>B.id===C[C.length-1].id)+1:we++}else if(ne.position==="below"){const C=(I,me)=>{let ee=[];return me.filter(ge=>ge.parent===I).forEach(ge=>{ee.push(ge.id),ee=[...ee,...C(ge.id,me)]}),ee},B=C(j.id,oe);B.length>0?we=oe.findIndex(I=>I.id===B[B.length-1])+1:we++}const _e={tasks:[...S],links:[...D]};oe.splice(we,0,...be),$(oe),K("task_update",_e,{tasks:oe,links:D});const n=S.filter(C=>C.parent===d.parent).findIndex(C=>C.id===d.id)+1,k=oe.filter(C=>C.parent===ie).findIndex(C=>C.id===d.id)+1,N={currentSequenceId:n,targetSequenceId:k,targetStageId:ie??null},V=oe.find(C=>C.id===d.id);if(V&&m){const C={...V,sequence_id:k,stage_id:ie??null};m(C,N)}}}}A(null),le(null),Fe(null),document.body.classList.remove("gantt-dragging")},nt=g.useRef(null),Dt=g.useCallback(d=>{R&&(nt.current&&cancelAnimationFrame(nt.current),nt.current=requestAnimationFrame(()=>{const j=ve.rowHeight||44,O=Ce.current?.querySelector(".gantt-grid-body");if(!O)return;const z=O.getBoundingClientRect(),ie=d.clientY-z.top;let J=Math.floor(ie/j);J=Math.max(0,Math.min(J,q.length-1));const be=q[J];if(be){const oe=ie-J*j;let we="above";be.type==="project"?oe<j*.3?we="above":oe>j*.7?we="below":we="inside":we=oe<j/2?"above":"below",be.id!==R.id?Fe({taskId:be.id,position:we}):Fe(null)}le(oe=>oe?{...oe,currentY:d.clientY}:null)}))},[R,q,ve.rowHeight]),qe=()=>{R&&Tt()},ut=(d,j)=>{const O={...d,id:`task-${Date.now()}`,parent:j};fe(O);const z={taskId:O.id,start:new Date(O.start),end:new Date(O.end)};Oe(ie=>{const J=new Map(ie);return J.set(O.id,z),J}),i&&i(O)},Le=d=>{X(d),m&&m(d)},Xe=d=>{E(d),Oe(j=>{const O=new Map(j);return O.delete(d),O}),s&&s(d)},Je=(d,j,O,z)=>{const ie={id:`link-${Date.now()}`,source:d,target:j,type:O,lag:z};F([...D,ie]),b&&b(ie)},ot=d=>{const j=D.filter(O=>O.id!==d);F(j),c&&c(d)};g.useEffect(()=>{const d=new Map(Te);let j=!1;S.forEach(z=>{Te.has(z.id)||(d.set(z.id,{taskId:z.id,start:new Date(z.start),end:new Date(z.end)}),j=!0)});const O=new Set(S.map(z=>z.id));Te.forEach((z,ie)=>{O.has(ie)||(d.delete(ie),j=!0)}),j&&Oe(d)},[S]),g.useEffect(()=>{const d=j=>{(j.ctrlKey||j.metaKey)&&(j.key==="z"&&!j.shiftKey?(j.preventDefault(),H()):(j.key==="y"||j.key==="z"&&j.shiftKey)&&(j.preventDefault(),ae()))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[H,ae]),g.useEffect(()=>{const d=Ce.current?.querySelector(".gantt-grid-body"),j=it.current?.querySelector(".gantt-timeline-body");if(!d||!j)return;const O=()=>{Ie.current||(Ie.current=!0,j.scrollTop=d.scrollTop,Me.current&&clearTimeout(Me.current),Me.current=window.setTimeout(()=>{Ie.current=!1},150))},z=()=>{Ie.current||(Ie.current=!0,d.scrollTop=j.scrollTop,Me.current&&clearTimeout(Me.current),Me.current=window.setTimeout(()=>{Ie.current=!1},150))};return d.addEventListener("scroll",O,{passive:!0}),j.addEventListener("scroll",z,{passive:!0}),()=>{d.removeEventListener("scroll",O),j.removeEventListener("scroll",z),Me.current&&clearTimeout(Me.current)}},[q]);const kt={height:o.containerHeight||"100%",minHeight:o.containerMinHeight||"400px"},pt=o.gridWidth?{"--gantt-grid-width":o.gridWidth}:{};return e.jsxs("div",{className:`gantt-page-wrapper theme-${tt}`,style:{...kt,...u},children:[T.showHeader&&e.jsx("div",{className:"gantt-page-header",children:e.jsx("div",{className:"gantt-page-header-left",children:e.jsx("h1",{className:"gantt-page-title",children:T.headerTitle})})}),e.jsxs("div",{className:`gantt-container theme-${ve.theme}`,style:pt,children:[e.jsx(At,{zoomLevel:Be,setZoomLevel:Pe,onExport:d=>{d==="csv"&&Wt(S),d==="excel"&&Ht(S),d==="json"&&Ut(S,D),d==="pdf"&&Vt(S)},onFilterChange:d=>bt(d),owners:lt||[],onAddTask:d=>{if(d){const j=S.find(O=>O.id===d);Y(d),te(j?.text)}else Y(void 0),te(void 0);De(!0)},uiConfig:T,iconConfig:y,styleConfig:r}),e.jsxs("div",{className:"gantt-layout",ref:wt,onMouseMove:Dt,onMouseUp:qe,onMouseLeave:qe,children:[e.jsx(xt,{ref:Ce,tasks:q,columns:ve.columns||[],selectedTask:U,onTaskClick:ct,onTaskContextMenu:vt,onTaskUpdate:Le,onTaskDragStart:jt,onAddTask:d=>{if(d){const j=S.find(O=>O.id===d);Y(d),te(j?.text)}else Y(void 0),te(void 0);De(!0)},onAddDependency:Je,onRemoveDependency:ot,onDependencyClick:d=>{const j=S.find(O=>O.id===d);j&&(L(j),Q(!0))},links:D,allTasks:S,dropIndicator:ne,reorderTask:R,iconConfig:y,styleConfig:r}),e.jsx(gt,{ref:it,tasks:q,links:D,range:dt,scales:ve.scales,config:ve,selectedTask:U,draggedTask:P,onTaskClick:()=>{},onTaskDragStart:()=>{},onTaskDragEnd:()=>{},onTaskUpdate:(d,j)=>{const O=S.find(z=>z.id===d);O&&Le({...O,...j})},zoomLevel:Be,baselines:Te})]}),$e&&e.jsx(Bt,{onCreateTask:ut,onClose:()=>{De(!1),Y(void 0),te(void 0)},uiConfig:T,parentId:_,parentTaskName:pe,styleConfig:r}),Z&&e.jsx(It,{task:Z,onUpdate:Le,onDelete:Xe,onClose:()=>ye(null),uiConfig:T,styleConfig:r}),re&&f&&e.jsx(_t,{task:f,allTasks:S,links:D,onAddDependency:Je,onRemoveDependency:ot,onTaskUpdate:Le,onClose:()=>{Q(!1),L(null)},styleConfig:r}),de&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-context-menu-overlay",onClick:()=>ke(null),onContextMenu:d=>{d.preventDefault(),ke(null)}}),e.jsx(pr,{x:de.x,y:de.y,task:de.task,onEdit:()=>{de.task&&ye(de.task)},onDelete:()=>{de.task&&Xe(de.task.id)},onCopy:St,onDependencies:()=>{de.task&&(L(de.task),Q(!0))},onConvertToMilestone:()=>rt("milestone"),onConvertToTask:()=>rt("task"),onConvertToProject:()=>rt("project"),onClose:()=>ke(null),onAutoSchedule:()=>{const d=Rt(S,D,{mode:"forward"});$(d),ke(null)},iconConfig:y,styleConfig:r})]}),R&&e.jsx("div",{className:"gantt-grid-row ghost-row",style:{height:ve.rowHeight,top:R.currentY-(ve.rowHeight||48)/2,left:Ce.current?.getBoundingClientRect().left,position:"fixed",pointerEvents:"none",opacity:.8,zIndex:9999,width:Ce.current?.offsetWidth,backgroundColor:"#ffffff",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #2196F3",display:"flex"},children:ve.columns?.map(d=>e.jsx("div",{className:"gantt-grid-cell",style:{width:d.width,textAlign:d.align||"left"},children:(()=>{const j=S.find(O=>O.id===R.id);if(!j)return null;if(d.template)return d.template(j);switch(d.name){case"text":return e.jsxs("div",{className:"gantt-grid-cell-text",children:[e.jsx(ce.FontAwesomeIcon,{icon:G.faGripVertical,style:{marginRight:8,color:"#adb5bd"}}),e.jsxs("span",{className:"gantt-task-name-text",children:[j.text,R.descendantIds.length>0&&e.jsxs("span",{children:[" +",R.descendantIds.length," subtasks"]})]})]});case"start":return xe(j.start,"DD MMM YYYY");case"duration":return`${j.duration}`;default:return j[d.name]||""}})()},`ghost-${d.name}`))})]})]})},jr=Object.freeze(Object.defineProperty({__proto__:null,calculateCriticalPath:(t,a)=>{const o=new Set,l=new Map,r=new Map,y=new Map;t.forEach(u=>{r.set(u.id,[]),y.set(u.id,[])}),a.forEach(u=>{u.type==="e2s"&&(r.get(u.source)?.push(u.target),y.get(u.target)?.push(u.source))});const m=new Map,i=new Map,s=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const v=t.find(D=>D.id===u);if(!v)return;const S=y.get(u)||[];if(S.length===0)m.set(u,0),i.set(u,v.duration);else{let D=0;S.forEach($=>{s($,h);const F=i.get($)||0;D=Math.max(D,F)}),m.set(u,D),i.set(u,D+v.duration)}};t.forEach(u=>s(u.id));const b=new Map,c=new Map,w=Math.max(...Array.from(i.values())),T=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const v=t.find(D=>D.id===u);if(!v)return;const S=r.get(u)||[];if(S.length===0)c.set(u,w),b.set(u,w-v.duration);else{let D=1/0;S.forEach($=>{T($,h);const F=b.get($)||0;D=Math.min(D,F)}),c.set(u,D),b.set(u,D-v.duration)}};return t.forEach(u=>T(u.id)),t.forEach(u=>{const h=m.get(u.id)||0,S=(b.get(u.id)||0)-h;l.set(u.id,S),Math.abs(S)<.01&&o.add(u.id)}),{criticalTasks:o,taskFloats:l,projectDuration:w}},getTaskFloat:(t,a)=>a.taskFloats.get(t)||0,isCriticalTask:(t,a)=>a.criticalTasks.has(t)},Symbol.toStringTag,{value:"Module"}));W.AutoScheduler=mr,W.Chart=gt,W.CriticalPath=jr,W.DependencyEditor=_t,W.ExportUtils=gr,W.FilterSearch=Nt,W.Gantt=Sr,W.Grid=xt,W.TaskBar=Ct,W.TaskCreator=Bt,W.TaskEditor=It,W.Timeline=yt,W.Toolbar=At,W.addToDate=he,W.applyFilters=qt,W.calculateDuration=Qt,W.createBaseline=zt,W.formatDate=xe,W.getDaysBetween=Qe,W.getEndOfDay=Kt,W.getHoursBetween=Ot,W.getStartOfDay=Ye,W.isHoliday=ft,W.isWeekend=ht,W.useUndoRedo=Yt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iris-gantt",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "A comprehensive, production-ready Gantt chart component built with React and TypeScript. Easy to install, simple to use.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gantt",
|
|
@@ -102,4 +102,4 @@
|
|
|
102
102
|
"vite": "^7.2.4",
|
|
103
103
|
"vitest": "^4.0.17"
|
|
104
104
|
}
|
|
105
|
-
}
|
|
105
|
+
}
|