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