iris-gantt 1.2.6 → 1.3.0

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