@nocobase/plugin-gantt 0.19.0-alpha.9 → 0.20.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,7 @@
1
1
  import { SchemaSettings } from '@nocobase/client';
2
+ /**
3
+ * @deprecated
4
+ * 用于兼容旧版 schema
5
+ */
6
+ export declare const oldGanttSettings: SchemaSettings<{}>;
2
7
  export declare const ganttSettings: SchemaSettings<{}>;
@@ -1,4 +1,4 @@
1
- (function(T,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("react/jsx-runtime"),require("react"),require("@nocobase/client"),require("@emotion/css"),require("@formily/core"),require("@formily/react"),require("antd"),require("lodash"),require("react-i18next"),require("antd-style"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/shared")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","@nocobase/client","@emotion/css","@formily/core","@formily/react","antd","lodash","react-i18next","antd-style","@nocobase/utils/client","@ant-design/icons","@formily/antd-v5","@formily/shared"],l):(T=typeof globalThis!="undefined"?globalThis:T||self,l(T["@nocobase/plugin-gantt"]={},T.jsxRuntime,T.react,T["@nocobase/client"],T["@emotion/css"],T["@formily/core"],T["@formily/react"],T.antd,T.lodash,T["react-i18next"],T["antd-style"],T["@nocobase/utils"],T["@ant-design/icons"],T["@formily/antd-v5"],T["@formily/shared"]))})(this,function(T,l,u,f,N,Je,O,we,Z,me,Ee,Ze,tr,rr,or){"use strict";var ko=Object.defineProperty,Yo=Object.defineProperties;var jo=Object.getOwnPropertyDescriptors;var Ke=Object.getOwnPropertySymbols;var Zt=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable;var Jt=(T,l,u)=>l in T?ko(T,l,{enumerable:!0,configurable:!0,writable:!0,value:u}):T[l]=u,E=(T,l)=>{for(var u in l||(l={}))Zt.call(l,u)&&Jt(T,u,l[u]);if(Ke)for(var u of Ke(l))Rt.call(l,u)&&Jt(T,u,l[u]);return T},ue=(T,l)=>Yo(T,jo(l));var er=(T,l)=>{var u={};for(var f in T)Zt.call(T,f)&&l.indexOf(f)<0&&(u[f]=T[f]);if(T!=null&&Ke)for(var f of Ke(T))l.indexOf(f)<0&&Rt.call(T,f)&&(u[f]=T[f]);return u};var ne=(T,l,u)=>new Promise((f,N)=>{var Je=Z=>{try{we(u.next(Z))}catch(me){N(me)}},O=Z=>{try{we(u.throw(Z))}catch(me){N(me)}},we=Z=>Z.done?f(Z.value):Promise.resolve(Z.value).then(Je,O);we((u=u.apply(T,l)).next())});const ht=u.createContext({}),Re=(e=[],t,r=[],o=void 0,n=!1,a)=>(e.forEach(s=>{var d,p;const i=a(s),c=parseFloat((s[t.progress]*100).toFixed(2));s.children&&s.children.length?(r.push({start:new Date((d=s[t.start])!=null?d:void 0),end:new Date((p=s[t.end])!=null?p:void 0),name:s[t.title],id:s.id+"",type:"project",progress:c>100?100:c||0,hideChildren:n,project:o,color:s.color,isDisabled:i}),Re(s.children,t,r,s.id+"",n,a)):r.push({start:s[t.start]?new Date(s[t.start]):void 0,end:new Date(s[t.end]||s[t.start]),name:s[t.title],id:s.id+"",type:t.end?"task":"milestone",progress:c>100?100:c||0,project:o,color:s.color,isDisabled:i})}),r),nr=e=>{const{fieldNames:t,timeRange:r,resource:o}=e,n=O.useField(),{service:a}=f.useBlockRequestContext();return l.jsx(ht.Provider,{value:{field:n,service:a,resource:o,fieldNames:t,timeRange:r},children:e.children})},ar=e=>{const t={filter:e.params.filter,tree:!0,paginate:!1,sort:e.fieldNames.start};return l.jsx("div",{"aria-label":"block-item-gantt",role:"button",children:l.jsx(f.BlockProvider,ue(E({name:"gantt"},e),{params:t,children:l.jsx(f.TableBlockProvider,ue(E({},e),{params:t,children:l.jsx(nr,E({},e))}))}))})},fe=()=>u.useContext(ht),sr=()=>{var $;const e=fe(),[t,r]=u.useState([]),{getPrimaryKey:o,name:n,template:a,writableView:s}=f.useCollection(),{parseAction:i}=f.useACLRoleContext(),c=o(),d=v=>{const x=`${n}:update`,P={},g=v==null?void 0:v[c],y=i(x,{schema:P,recordPkValue:g});return a==="view"&&!s||!y},p=v=>{const P=e.field.data.map(g=>g.id===v.id?v:g);r(P),e.field.data=P},S=v=>{var P;const x=Re((P=e.service.data)==null?void 0:P.data,e.fieldNames,[],void 0,v,d);r(x),e.field.data=x};return u.useEffect(()=>{var v,x;if(!((v=e==null?void 0:e.service)!=null&&v.loading)){const P=Re((x=e.service.data)==null?void 0:x.data,e.fieldNames,[],void 0,!1,d);r(P),e.field.data=P}},[($=e==null?void 0:e.service)==null?void 0:$.loading]),{fieldNames:e.fieldNames,timeRange:e.timeRange,onExpanderClick:p,expandAndCollapseAll:S,tasks:t}},ir=(e,t,r,o,n,a,s,i,c,d,p,S,$,v,x,P,g,y)=>{let C=e.map((M,B)=>lr(M,B,t,r,o,n,a,s,i,c,d,p,S,$,v,x,P,g,y));return C=C.map(M=>{const B=M.dependencies||[];for(let b=0;b<B.length;b++){const h=C.findIndex(m=>m.id===B[b]);h!==-1&&C[h].barChildren.push(M)}return M}),C},lr=(e,t,r,o,n,a,s,i,c,d,p,S,$,v,x,P,g,y,C)=>{let M;switch(e.type){case"milestone":M=cr(e,t,r,o,n,a,s,i,y,C);break;case"project":M=pt(e,t,r,o,n,a*.5,s,i,c,v,x,P,g);break;default:M=pt(e,t,r,o,n,a,s,i,c,d,p,S,$);break}return M},pt=(e,t,r,o,n,a,s,i,c,d,p,S,$)=>{let v,x;c?(x=gt(e.start,r,o),v=gt(e.end,r,o)):(v=ze(e.start,r,o),x=ze(e.end,r,o));let P=e.type;P==="task"&&x-v<i*2&&(P="smalltask",x=v>0?v+i*2:v);const[g,y]=Pe(v,x,e.progress,c),C=e.type==="project"?et(t,n,a)+8:et(t,n,a),M=e.type==="project"?e.hideChildren:void 0,B=E({backgroundColor:S,backgroundSelectedColor:$,progressColor:d,progressSelectedColor:p},e.styles);return ue(E({},e),{typeInternal:P,x1:v,x2:x,y:C,index:t,progressX:y,progressWidth:g,barCornerRadius:s,handleWidth:i,hideChildren:M,height:a,barChildren:[],styles:B})},cr=(e,t,r,o,n,a,s,i,c,d)=>{const p=ze(e.start,r,o),S=et(t,n,a),$=p-a*.5,v=p+a*.5,x=a/1.414,P=E({backgroundColor:c,backgroundSelectedColor:d,progressColor:"",progressSelectedColor:""},e.styles);return ue(E({},e),{end:e.start,x1:$,x2:v,y:S,index:t,progressX:0,progressWidth:0,barCornerRadius:s,handleWidth:i,typeInternal:e.type,progress:0,height:x,hideChildren:void 0,barChildren:[],styles:P})},ze=(e,t,r)=>{var i,c,d;const o=t.findIndex(p=>(p==null?void 0:p.getTime())>=(e==null?void 0:e.getTime()))-1,a=((e==null?void 0:e.getTime())-((i=t[o])==null?void 0:i.getTime()))/(((c=t[o+1])==null?void 0:c.getTime())-((d=t[o])==null?void 0:d.getTime())),s=o*r+a*r;return isNaN(s)?0:s},gt=(e,t,r)=>{let o=ze(e,t,r);return o+=r,isNaN(o)?0:o},et=(e,t,r)=>{const o=e*t+(t-r)/2;return isNaN(o)?0:o},Pe=(e,t,r,o)=>{const n=(t-e)*r*.01;let a;return o?a=t-n:a=e,[n,a]},dr=(e,t)=>{if(e>=t.x2)return 100;if(e<=t.x1)return 0;{const r=t.x2-t.x1;return Math.round((e-t.x1)*100/r)}},ur=(e,t)=>{if(e>=t.x2)return 0;if(e<=t.x1)return 100;{const r=t.x2-t.x1;return Math.round((t.x2-e)*100/r)}},bt=(e,t,r)=>[e-5,t+r,e+5,t+r,e,t+r-8.66].join(","),fr=(e,t,r)=>{e>=r.x2-r.handleWidth*2&&(e=r.x2-r.handleWidth*2);const n=Math.round((e-r.x1)/t)*t;return r.x1+n},hr=(e,t,r)=>{e<=r.x1+r.handleWidth*2&&(e=r.x1+r.handleWidth*2);const n=Math.round((e-r.x2)/t)*t;return r.x2+n},mt=(e,t,r)=>{const n=Math.round((e-r.x1)/t)*t,a=r.x1+n,s=a+r.x2-r.x1;return[a,s]},xe=(e,t,r,o,n)=>{var s,i;let a=new Date((e-t)/o*n+((s=r==null?void 0:r.getTime)==null?void 0:s.call(r)));return a=new Date(((i=a==null?void 0:a.getTime)==null?void 0:i.call(a))+((a==null?void 0:a.getTimezoneOffset())-(r==null?void 0:r.getTimezoneOffset()))*6e4),a},xt=(e,t,r,o,n,a,s)=>{let i;switch(r.type){case"milestone":i=gr(e,t,r,o,n,a);break;default:i=pr(e,t,r,o,n,a,s);break}return i},pr=(e,t,r,o,n,a,s)=>{const i=E({},r);let c=!1;switch(t){case"progress":if(s?i.progress=ur(e,r):i.progress=dr(e,r),c=i.progress!==r.progress,c){const[d,p]=Pe(i.x1,i.x2,i.progress,s);i.progressWidth=d,i.progressX=p}break;case"start":{const d=fr(e,o,r);if(i.x1=d,c=i.x1!==r.x1,c){s?i.end=xe(d,r.x1,r.end,o,n):i.start=xe(d,r.x1,r.start,o,n);const[p,S]=Pe(i.x1,i.x2,i.progress,s);i.progressWidth=p,i.progressX=S}break}case"end":{const d=hr(e,o,r);if(i.x2=d,c=i.x2!==r.x2,c){s?i.start=xe(d,r.x2,r.start,o,n):i.end=xe(d,r.x2,r.end,o,n);const[p,S]=Pe(i.x1,i.x2,i.progress,s);i.progressWidth=p,i.progressX=S}break}case"move":{const[d,p]=mt(e-a,o,r);if(c=d!==r.x1,c){i.start=xe(d,r.x1,r.start,o,n),i.end=xe(p,r.x2,r.end,o,n),i.x1=d,i.x2=p;const[S,$]=Pe(i.x1,i.x2,i.progress,s);i.progressWidth=S,i.progressX=$}break}}return{isChanged:c,changedTask:i}},gr=(e,t,r,o,n,a)=>{const s=E({},r);let i=!1;switch(t){case"move":{const[c,d]=mt(e-a,o,r);i=c!==r.x1,i&&(s.start=xe(c,r.x1,r.start,o,n),s.end=s.start,s.x1=c,s.x2=d);break}}return{isChanged:i,changedTask:s}};var z=(e=>(e.Hour="hour",e.QuarterDay="quarterDay",e.HalfDay="halfDay",e.Day="day",e.Week="week",e.Month="month",e.QuarterYear="quarterYear",e.Year="year",e))(z||{});const yt={},Ge=(e,t={})=>{const r=JSON.stringify([e,t]);let o=yt[r];return o||(o=new Intl.DateTimeFormat(e,t),yt[r]=o),o},G=(e,t,r)=>new Date(e.getFullYear()+(r==="year"?t:0),e.getMonth()+(r==="month"?t:0),e.getDate()+(r==="day"?t:0),e.getHours()+(r==="hour"?t:0),e.getMinutes()+(r==="minute"?t:0),e.getSeconds()+(r==="second"?t:0),e.getMilliseconds()+(r==="millisecond"?t:0)),j=(e,t)=>{const r=["millisecond","second","minute","hour","day","month","year"],o=a=>{const s=r.indexOf(t);return r.indexOf(a)<=s};return new Date(e==null?void 0:e.getFullYear(),o("year")?0:e.getMonth(),o("month")?1:e.getDate(),o("day")?0:e.getHours(),o("hour")?0:e.getMinutes(),o("minute")?0:e.getSeconds(),o("second")?0:e.getMilliseconds())},vt=(e,t,r)=>{var a,s;let o=((a=e[0])==null?void 0:a.start)||new Date,n=((s=e[0])==null?void 0:s.start)||new Date;for(const i of e)i.start<o&&(o=i.start),i.end>n&&(n=i.end);switch(t){case z.Year:o=G(o,-1,"year"),o=j(o,"year"),n=G(n,1,"year"),n=j(n,"year");break;case z.QuarterYear:o=G(o,-3,"month"),o=j(o,"month"),n=G(n,3,"year"),n=j(n,"year");break;case z.Month:o=G(o,-1*r,"month"),o=j(o,"month"),n=G(n,1,"year"),n=j(n,"year");break;case z.Week:o=j(o,"day"),o=G(br(o),-7*r,"day"),n=j(n,"day"),n=G(n,1.5,"month");break;case z.Day:o=j(o,"day"),o=G(o,-1*r,"day"),n=j(n,"day"),n=G(n,19,"day");break;case z.QuarterDay:o=j(o,"day"),o=G(o,-1*r,"day"),n=j(n,"day"),n=G(n,66,"hour");break;case z.HalfDay:o=j(o,"day"),o=G(o,-1*r,"day"),n=j(n,"day"),n=G(n,108,"hour");break;case z.Hour:o=j(o,"hour"),o=G(o,-1*r,"hour"),n=j(n,"day"),n=G(n,1,"day");break}return[o,n]},St=(e,t,r)=>{let o=new Date(e);const n=[o];for(;o<t;){switch(r){case z.Year:o=G(o,1,"year");break;case z.QuarterYear:o=G(o,3,"month");break;case z.Month:o=G(o,1,"month");break;case z.Week:o=G(o,7,"day");break;case z.Day:o=G(o,1,"day");break;case z.HalfDay:o=G(o,12,"hour");break;case z.QuarterDay:o=G(o,6,"hour");break;case z.Hour:o=G(o,1,"hour");break}n.push(o)}return n},Fe=(e,t)=>{let r=Ge(t,{month:"long"}).format(e);return r=r.replace(r[0],r[0].toLocaleUpperCase()),r},wt=(e,t,r)=>{let o=Ge(t,{weekday:r}).format(e);return o=o.replace(o[0],o[0].toLocaleUpperCase()),o},br=e=>{const t=e.getDay(),r=e.getDate()-t+(t===0?-6:1);return new Date(e.setDate(r))},mr=e=>{const t=new Date(e.valueOf()),r=(t.getDay()+6)%7;t.setDate(t.getDate()-r+3);const o=t.valueOf();t.setMonth(0,1),t.getDay()!==4&&t.setMonth(0,1+(4-t.getDay()+7)%7);const n=(1+Math.ceil((o-t.valueOf())/6048e5)).toString();return n.length===1?`0${n}`:n},xr=(e,t)=>new Date(t,e+1,0).getDate();function yr(e){return e.key!==void 0}function vr(e){const t=e.filter(r=>r.hideChildren&&r.type==="project");if(t.length>0)for(let r=0;t.length>r;r++){const o=t[r],n=Ct(e,o);e=e.filter(a=>n.indexOf(a)===-1)}return e}function Ct(e,t){let r=[];t.type!=="project"?r=e.filter(n=>n.dependencies&&n.dependencies.indexOf(t.id)!==-1):r=e.filter(n=>n.project&&n.project===t.id);const o=[];return r.forEach(n=>{o.push(...Ct(e,n))}),r=r.concat(r,o),r}const Sr=(e,t)=>{const r=e.displayOrder||Number.MAX_VALUE,o=t.displayOrder||Number.MAX_VALUE;return r>o?1:r<o?-1:0},Ce=e=>{var t;return isNaN((t=e==null?void 0:e.getTime)==null?void 0:t.call(e))?0:e.getFullYear()+`/${e.getMonth()+1}/`+e.getDate()},Oe=Ee.createStyles(({token:e,css:t})=>({scrollWrapper:t`
1
+ (function(N,c){typeof exports=="object"&&typeof module!="undefined"?c(exports,require("react/jsx-runtime"),require("@nocobase/client"),require("react"),require("@formily/react"),require("@formily/shared"),require("react-i18next"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@emotion/css"),require("antd"),require("lodash"),require("antd-style"),require("@nocobase/utils/client")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@nocobase/client","react","@formily/react","@formily/shared","react-i18next","@ant-design/icons","@formily/antd-v5","@emotion/css","antd","lodash","antd-style","@nocobase/utils/client"],c):(N=typeof globalThis!="undefined"?globalThis:N||self,c(N["@nocobase/plugin-gantt"]={},N.jsxRuntime,N["@nocobase/client"],N.react,N["@formily/react"],N["@formily/shared"],N["react-i18next"],N["@ant-design/icons"],N["@formily/antd-v5"],N["@emotion/css"],N.antd,N.lodash,N["antd-style"],N["@nocobase/utils"]))})(this,function(N,c,u,f,A,Je,Be,Fe,ie,M,ht,pt,ze,Ze){"use strict";var Xo=Object.defineProperty,Yo=Object.defineProperties;var jo=Object.getOwnPropertyDescriptors;var Ke=Object.getOwnPropertySymbols;var er=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable;var Rt=(N,c,u)=>c in N?Xo(N,c,{enumerable:!0,configurable:!0,writable:!0,value:u}):N[c]=u,z=(N,c)=>{for(var u in c||(c={}))er.call(c,u)&&Rt(N,u,c[u]);if(Ke)for(var u of Ke(c))tr.call(c,u)&&Rt(N,u,c[u]);return N},ae=(N,c)=>Yo(N,jo(c));var rr=(N,c)=>{var u={};for(var f in N)er.call(N,f)&&c.indexOf(f)<0&&(u[f]=N[f]);if(N!=null&&Ke)for(var f of Ke(N))c.indexOf(f)<0&&tr.call(N,f)&&(u[f]=N[f]);return u};var se=(N,c,u)=>new Promise((f,A)=>{var Je=ie=>{try{Fe(u.next(ie))}catch(M){A(M)}},Be=ie=>{try{Fe(u.throw(ie))}catch(M){A(M)}},Fe=ie=>ie.done?f(ie.value):Promise.resolve(ie.value).then(Je,Be);Fe((u=u.apply(N,c)).next())});const or=()=>{const{name:e,title:t}=u.useCollection_deprecated(),r=u.useSchemaTemplate();return c.jsx(u.GeneralSchemaDesigner,{schemaSettings:"blockSettings:gantt",template:r,title:t||e})},gt=f.createContext({}),Re=(e=[],t,r=[],o=void 0,n=!1,a,i)=>(e.forEach(s=>{var h,x;const l=a(s),d=parseFloat((s[t.progress]*100).toFixed(2));s.children&&s.children.length?(r.push({start:new Date((h=s[t.start])!=null?h:void 0),end:new Date((x=s[t.end])!=null?x:void 0),name:s[t.title],id:s[i]+"",type:"project",progress:d>100?100:d||0,hideChildren:n,project:o,color:s.color,isDisabled:l}),Re(s.children,t,r,s.id+"",n,a)):r.push({start:s[t.start]?new Date(s[t.start]):void 0,end:new Date(s[t.end]||s[t.start]),name:s[t.title],id:s[i]+"",type:t.end?"task":"milestone",progress:d>100?100:d||0,project:o,color:s.color,isDisabled:l})}),r),nr=e=>{const{fieldNames:t,timeRange:r,resource:o}=e,n=A.useField(),{service:a}=u.useBlockRequestContext();return c.jsx(gt.Provider,{value:{field:n,service:a,resource:o,fieldNames:t,timeRange:r},children:e.children})},ar=e=>{const t={filter:e.params.filter,paginate:!1,sort:e.fieldNames.start},r=u.useCollection_deprecated();return r!=null&&r.tree&&(t.tree=!0),c.jsx("div",{"aria-label":"block-item-gantt",role:"button",children:c.jsx(u.BlockProvider,ae(z({name:"gantt"},e),{params:t,children:c.jsx(u.TableBlockProvider,ae(z({},e),{params:t,children:c.jsx(nr,z({},e))}))}))})},W=()=>f.useContext(gt),sr=()=>{var I;const e=W(),[t,r]=f.useState([]),{getPrimaryKey:o,name:n,template:a,writableView:i}=u.useCollection_deprecated(),{parseAction:s}=u.useACLRoleContext(),l=o(),d=S=>{const y=`${n}:update`,B={},g=S==null?void 0:S[l],v=s(y,{schema:B,recordPkValue:g});return a==="view"&&!i||!v},h=S=>{const B=e.field.data.map(g=>g.id===S.id?S:g);r(B),e.field.data=B},x=S=>{var B;const y=Re((B=e.service.data)==null?void 0:B.data,e.fieldNames,[],void 0,S,d,l);r(y),e.field.data=y};return f.useEffect(()=>{var S,y;if(!((S=e==null?void 0:e.service)!=null&&S.loading)){const B=Re((y=e.service.data)==null?void 0:y.data,e.fieldNames,[],void 0,!1,d,l);r(B),e.field.data=B}},[(I=e==null?void 0:e.service)==null?void 0:I.loading]),{fieldNames:e.fieldNames,timeRange:e.timeRange,onExpanderClick:h,expandAndCollapseAll:x,tasks:t}},R=()=>Be.useTranslation("gantt"),pe=(e="string")=>{var n;const t=u.useCompile(),{fields:r}=u.useCollection_deprecated();return(n=r==null?void 0:r.filter(a=>a.type===e))==null?void 0:n.map(a=>{var i;return{value:a.name,label:t((i=a==null?void 0:a.uiSchema)==null?void 0:i.title)}})},ir=e=>{const i=e,{collection:t,resource:r,fieldNames:o}=i,n=rr(i,["collection","resource","fieldNames"]);return{type:"void","x-acl-action":`${r||t}:list`,"x-decorator":"GanttBlockProvider","x-decorator-props":z({collection:t,resource:r||t,action:"list",fieldNames:z({},o),params:{paginate:!1}},n),"x-designer":"Gantt.Designer","x-component":"CardItem",properties:{[Je.uid()]:{type:"void","x-component":"Gantt","x-component-props":{useProps:"{{ useGanttBlockProps }}"},properties:{toolBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},"x-initializer":"GanttActionInitializers",properties:{}},table:{type:"array","x-decorator":"div","x-decorator-props":{style:{float:"left",maxWidth:"35%"}},"x-initializer":"TableColumnInitializers","x-component":"TableV2","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useProps:"{{ useTableBlockProps }}",pagination:!1},properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-designer":"TableV2.ActionColumnDesigner","x-initializer":"TableActionColumnInitializers",properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"},properties:{}}}}}},detail:{type:"void","x-component":"Gantt.Event",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{className:"nb-action-popup"},title:'{{ t("View record") }}',properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"TabPaneInitializers",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"RecordBlockInitializers",properties:{}}}}}}}}}}}}}}},lr=new u.SchemaSettings({name:"GanttBlockSettings",items:[{name:"title",Component:u.SchemaSettingsBlockTitleItem},{name:"titleField",Component:u.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=R(),t=A.useFieldSchema(),r=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{},{service:o}=W(),n=A.useField(),{dn:a}=u.useDesignable();return{title:e("Title field"),value:r.title,options:pe("string"),onChange:s=>{const l=n.decoratorProps.fieldNames||{};l.title=s,n.decoratorProps.params=l,t["x-decorator-props"].params=l,t["x-decorator-props"].fieldNames=l,o.refresh(),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":n.decoratorProps}}),a.refresh()}}}},{name:"timeScale",Component:u.SchemaSettingsSelectItem,useComponentProps(){var s;const{t:e}=R(),t=A.useFieldSchema(),r=((s=t==null?void 0:t["x-decorator-props"])==null?void 0:s.fieldNames)||{},o=A.useField(),{service:n}=W(),{dn:a}=u.useDesignable(),i=u.useCompile();return{title:e("Time scale"),value:r.range||"day",options:[{label:i('{{t("Hour")}}'),value:"hour",color:"orange"},{label:i('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:i('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:i('{{t("Day")}}'),value:"day",color:"yellow"},{label:i('{{t("Week")}}'),value:"week",color:"pule"},{label:i('{{t("Month")}}'),value:"month",color:"green"},{label:i('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:i('{{t("Year")}}'),value:"year",color:"green"}],onChange:l=>{const d=o.decoratorProps.fieldNames||{};d.range=l,o.decoratorProps.params=d,t["x-decorator-props"].params=d,t["x-decorator-props"].fieldNames=d,n.refresh(),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":o.decoratorProps}}),a.refresh()}}}},{name:"startDateField",Component:u.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=R(),t=A.useFieldSchema(),r=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{},o=A.useField(),{dn:n}=u.useDesignable(),{service:a}=W();return{title:e("Start date field"),value:r.start,options:pe("date"),onChange:s=>{const l=o.decoratorProps.fieldNames||{};l.start=s,o.decoratorProps.fieldNames=l,t["x-decorator-props"].fieldNames=l,a.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":o.decoratorProps}}),n.refresh()}}}},{name:"endDateField",Component:u.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=R(),t=A.useFieldSchema(),r=A.useField(),{service:o}=W(),{dn:n}=u.useDesignable(),a=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{};return{title:e("End date field"),value:a.end,options:pe("date"),onChange:s=>{const l=r.decoratorProps.fieldNames||{};l.end=s,r.decoratorProps.fieldNames=l,t["x-decorator-props"].fieldNames=l,o.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":r.decoratorProps}}),n.refresh()}}}},{name:"processField",Component:u.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=R(),t=A.useFieldSchema(),r=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{},{service:o}=W(),{dn:n}=u.useDesignable(),a=A.useField();return{title:e("Progress field"),value:r.progress,options:pe("float"),onChange:s=>{const l=a.decoratorProps.fieldNames||{};l.progress=s,a.decoratorProps.fieldNames=l,t["x-decorator-props"].fieldNames=l,o.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":a.decoratorProps}}),n.refresh()}}}},{name:"dataScope",Component:u.SchemaSettingsDataScope,useComponentProps(){var i,s;const{name:e}=u.useCollection_deprecated(),t=A.useFieldSchema(),{form:r}=u.useFormBlockContext(),o=A.useField(),{service:n}=W(),{dn:a}=u.useDesignable();return{collectionName:e,defaultFilter:((s=(i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.params)==null?void 0:s.filter)||{},form:r,onSubmit:({filter:l})=>{var h;l=u.removeNullCondition(l);const d=o.decoratorProps.params||{};d.filter=l,o.decoratorProps.params=d,t["x-decorator-props"].params=d,n.run(ae(z({},(h=n.params)==null?void 0:h[0]),{filter:l})),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":t["x-decorator-props"]}})}}}},{name:"divider",type:"divider"},{name:"template",Component:u.SchemaSettingsTemplate,useComponentProps(){const{name:e}=u.useCollection_deprecated();return{componentName:"Gantt",collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),cr=new u.SchemaSettings({name:"blockSettings:gantt",items:[{name:"title",Component:u.SchemaSettingsBlockTitleItem},{name:"titleField",Component:u.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=R(),t=A.useFieldSchema(),r=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{},{service:o}=W(),n=A.useField(),{dn:a}=u.useDesignable();return{title:e("Title field"),value:r.title,options:pe("string"),onChange:s=>{const l=n.decoratorProps.fieldNames||{};l.title=s,n.decoratorProps.params=l,t["x-decorator-props"].params=l,t["x-decorator-props"].fieldNames=l,o.refresh(),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":n.decoratorProps}}),a.refresh()}}}},{name:"timeScale",Component:u.SchemaSettingsSelectItem,useComponentProps(){var s;const{t:e}=R(),t=A.useFieldSchema(),r=((s=t==null?void 0:t["x-decorator-props"])==null?void 0:s.fieldNames)||{},o=A.useField(),{service:n}=W(),{dn:a}=u.useDesignable(),i=u.useCompile();return{title:e("Time scale"),value:r.range||"day",options:[{label:i('{{t("Hour")}}'),value:"hour",color:"orange"},{label:i('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:i('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:i('{{t("Day")}}'),value:"day",color:"yellow"},{label:i('{{t("Week")}}'),value:"week",color:"pule"},{label:i('{{t("Month")}}'),value:"month",color:"green"},{label:i('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:i('{{t("Year")}}'),value:"year",color:"green"}],onChange:l=>{const d=o.decoratorProps.fieldNames||{};d.range=l,o.decoratorProps.params=d,t["x-decorator-props"].params=d,t["x-decorator-props"].fieldNames=d,n.refresh(),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":o.decoratorProps}}),a.refresh()}}}},{name:"startDateField",Component:u.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=R(),t=A.useFieldSchema(),r=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{},o=A.useField(),{dn:n}=u.useDesignable(),{service:a}=W();return{title:e("Start date field"),value:r.start,options:pe("date"),onChange:s=>{const l=o.decoratorProps.fieldNames||{};l.start=s,o.decoratorProps.fieldNames=l,t["x-decorator-props"].fieldNames=l,a.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":o.decoratorProps}}),n.refresh()}}}},{name:"endDateField",Component:u.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=R(),t=A.useFieldSchema(),r=A.useField(),{service:o}=W(),{dn:n}=u.useDesignable(),a=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{};return{title:e("End date field"),value:a.end,options:pe("date"),onChange:s=>{const l=r.decoratorProps.fieldNames||{};l.end=s,r.decoratorProps.fieldNames=l,t["x-decorator-props"].fieldNames=l,o.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":r.decoratorProps}}),n.refresh()}}}},{name:"processField",Component:u.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=R(),t=A.useFieldSchema(),r=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{},{service:o}=W(),{dn:n}=u.useDesignable(),a=A.useField();return{title:e("Progress field"),value:r.progress,options:pe("float"),onChange:s=>{const l=a.decoratorProps.fieldNames||{};l.progress=s,a.decoratorProps.fieldNames=l,t["x-decorator-props"].fieldNames=l,o.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":a.decoratorProps}}),n.refresh()}}}},{name:"dataScope",Component:u.SchemaSettingsDataScope,useComponentProps(){var i,s;const{name:e}=u.useCollection(),t=A.useFieldSchema(),{form:r}=u.useFormBlockContext(),o=A.useField(),{service:n}=W(),{dn:a}=u.useDesignable();return{collectionName:e,defaultFilter:((s=(i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.params)==null?void 0:s.filter)||{},form:r,onSubmit:({filter:l})=>{var h;l=u.removeNullCondition(l);const d=o.decoratorProps.params||{};d.filter=l,o.decoratorProps.params=d,t["x-decorator-props"].params=d,n.run(ae(z({},(h=n.params)==null?void 0:h[0]),{filter:l})),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":t["x-decorator-props"]}})}}}},{name:"divider",type:"divider"},{name:"template",Component:u.SchemaSettingsTemplate,useComponentProps(){const{name:e}=u.useCollection();return{componentName:"Gantt",collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),dr=new u.SchemaInitializer({name:"GanttActionInitializers",title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"itemGroup",name:"enableActions",title:"{{t('Enable actions')}}",children:[{type:"item",name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{type:"item",title:"{{t('Add new')}}",name:"addNew",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){const e=u.useCollection_deprecated();return!["view","file","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"item",title:"{{t('Delete')}}",name:"delete",Component:"BulkDestroyActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider"},useVisible(){const e=u.useCollection_deprecated();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"item",title:"{{t('Refresh')}}",name:"refresh",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"toggle",title:"{{t('Expand/Collapse')}}",Component:"ExpandableActionInitializer",schema:{"x-align":"right"},useVisible(){var o;const e=A.useFieldSchema(),t=u.useCollection_deprecated(),{treeTable:r}=((o=e==null?void 0:e.parent)==null?void 0:o["x-decorator-props"])||{};return t.tree&&r!==!1}}]},{name:"divider",type:"divider",useVisible(){const e=u.useCollection_deprecated();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"subMenu",name:"customize",title:'{{t("Customize")}}',children:[{type:"item",title:'{{t("Add record")}}',name:"addRecord",Component:"CustomizeAddRecordActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action":"create","x-acl-action-props":{skipScopeCheck:!0}}}],useVisible(){const e=u.useCollection_deprecated();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}}]}),ur=()=>{const{insert:e}=u.useSchemaInitializer(),{t}=Be.useTranslation(),{getCollectionFields:r}=u.useCollectionManager_deprecated(),o=f.useContext(A.SchemaOptionsContext),{theme:n}=u.useGlobalTheme(),a=u.useSchemaInitializerItem();return c.jsx(u.DataBlockInitializer,ae(z({},a),{componentType:"Gantt",icon:c.jsx(Fe.FormOutlined,{}),onCreateBlockSchema:s=>se(this,[s],function*({item:i}){var S,y,B;const l=r(i.name,i.dataSource),d=(S=l==null?void 0:l.filter(g=>g.type==="string"))==null?void 0:S.map(g=>{var v;return{label:(v=g==null?void 0:g.uiSchema)==null?void 0:v.title,value:g.name}}),h=(y=l==null?void 0:l.filter(g=>g.type==="date"))==null?void 0:y.map(g=>{var v;return{label:(v=g==null?void 0:g.uiSchema)==null?void 0:v.title,value:g.name}}),x=(B=l==null?void 0:l.filter(g=>g.type==="float"))==null?void 0:B.map(g=>{var v;return{label:(v=g==null?void 0:g.uiSchema)==null?void 0:v.title,value:g.name}}),I=yield u.FormDialog(t("Create gantt block"),()=>c.jsx(u.SchemaComponentOptions,{scope:o.scope,components:z({},o.components),children:c.jsx(ie.FormLayout,{layout:"vertical",children:c.jsx(u.SchemaComponent,{schema:{properties:{title:{title:t("Title field"),enum:d,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:t("Start date field"),enum:h,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:t("End date field"),enum:h,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:t("Progress field"),enum:x,"x-component":"Select","x-decorator":"FormItem"},range:{title:t("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})})}),n).open({initialValues:{}});e(ir({collection:i.name,dataSource:i.dataSource,fieldNames:z({},I)}))})}))},fr=A.observer(e=>c.jsx(c.Fragment,{children:e.children}),{displayName:"Event"}),hr=(e,t,r,o,n,a,i,s,l,d,h,x,I,S,y,B,g,v)=>{let C=e.map((T,D)=>pr(T,D,t,r,o,n,a,i,s,l,d,h,x,I,S,y,B,g,v));return C=C.map(T=>{const D=T.dependencies||[];for(let m=0;m<D.length;m++){const p=C.findIndex(b=>b.id===D[m]);p!==-1&&C[p].barChildren.push(T)}return T}),C},pr=(e,t,r,o,n,a,i,s,l,d,h,x,I,S,y,B,g,v,C)=>{let T;switch(e.type){case"milestone":T=gr(e,t,r,o,n,a,i,s,v,C);break;case"project":T=mt(e,t,r,o,n,a*.5,i,s,l,S,y,B,g);break;default:T=mt(e,t,r,o,n,a,i,s,l,d,h,x,I);break}return T},mt=(e,t,r,o,n,a,i,s,l,d,h,x,I)=>{let S,y;l?(y=bt(e.start,r,o),S=bt(e.end,r,o)):(S=Ge(e.start,r,o),y=Ge(e.end,r,o));let B=e.type;B==="task"&&y-S<s*2&&(B="smalltask",y=S>0?S+s*2:S);const[g,v]=Ae(S,y,e.progress,l),C=e.type==="project"?et(t,n,a)+8:et(t,n,a),T=e.type==="project"?e.hideChildren:void 0,D=z({backgroundColor:x,backgroundSelectedColor:I,progressColor:d,progressSelectedColor:h},e.styles);return ae(z({},e),{typeInternal:B,x1:S,x2:y,y:C,index:t,progressX:v,progressWidth:g,barCornerRadius:i,handleWidth:s,hideChildren:T,height:a,barChildren:[],styles:D})},gr=(e,t,r,o,n,a,i,s,l,d)=>{const h=Ge(e.start,r,o),x=et(t,n,a),I=h-a*.5,S=h+a*.5,y=a/1.414,B=z({backgroundColor:l,backgroundSelectedColor:d,progressColor:"",progressSelectedColor:""},e.styles);return ae(z({},e),{end:e.start,x1:I,x2:S,y:x,index:t,progressX:0,progressWidth:0,barCornerRadius:i,handleWidth:s,typeInternal:e.type,progress:0,height:y,hideChildren:void 0,barChildren:[],styles:B})},Ge=(e,t,r)=>{var s,l,d;const o=t.findIndex(h=>(h==null?void 0:h.getTime())>=(e==null?void 0:e.getTime()))-1,a=((e==null?void 0:e.getTime())-((s=t[o])==null?void 0:s.getTime()))/(((l=t[o+1])==null?void 0:l.getTime())-((d=t[o])==null?void 0:d.getTime())),i=o*r+a*r;return isNaN(i)?0:i},bt=(e,t,r)=>{let o=Ge(e,t,r);return o+=r,isNaN(o)?0:o},et=(e,t,r)=>{const o=e*t+(t-r)/2;return isNaN(o)?0:o},Ae=(e,t,r,o)=>{const n=(t-e)*r*.01;let a;return o?a=t-n:a=e,[n,a]},mr=(e,t)=>{if(e>=t.x2)return 100;if(e<=t.x1)return 0;{const r=t.x2-t.x1;return Math.round((e-t.x1)*100/r)}},br=(e,t)=>{if(e>=t.x2)return 0;if(e<=t.x1)return 100;{const r=t.x2-t.x1;return Math.round((t.x2-e)*100/r)}},xt=(e,t,r)=>[e-5,t+r,e+5,t+r,e,t+r-8.66].join(","),xr=(e,t,r)=>{e>=r.x2-r.handleWidth*2&&(e=r.x2-r.handleWidth*2);const n=Math.round((e-r.x1)/t)*t;return r.x1+n},yr=(e,t,r)=>{e<=r.x1+r.handleWidth*2&&(e=r.x1+r.handleWidth*2);const n=Math.round((e-r.x2)/t)*t;return r.x2+n},yt=(e,t,r)=>{const n=Math.round((e-r.x1)/t)*t,a=r.x1+n,i=a+r.x2-r.x1;return[a,i]},ye=(e,t,r,o,n)=>{var i,s;let a=new Date((e-t)/o*n+((i=r==null?void 0:r.getTime)==null?void 0:i.call(r)));return a=new Date(((s=a==null?void 0:a.getTime)==null?void 0:s.call(a))+((a==null?void 0:a.getTimezoneOffset())-(r==null?void 0:r.getTimezoneOffset()))*6e4),a},vt=(e,t,r,o,n,a,i)=>{let s;switch(r.type){case"milestone":s=Sr(e,t,r,o,n,a);break;default:s=vr(e,t,r,o,n,a,i);break}return s},vr=(e,t,r,o,n,a,i)=>{const s=z({},r);let l=!1;switch(t){case"progress":if(i?s.progress=br(e,r):s.progress=mr(e,r),l=s.progress!==r.progress,l){const[d,h]=Ae(s.x1,s.x2,s.progress,i);s.progressWidth=d,s.progressX=h}break;case"start":{const d=xr(e,o,r);if(s.x1=d,l=s.x1!==r.x1,l){i?s.end=ye(d,r.x1,r.end,o,n):s.start=ye(d,r.x1,r.start,o,n);const[h,x]=Ae(s.x1,s.x2,s.progress,i);s.progressWidth=h,s.progressX=x}break}case"end":{const d=yr(e,o,r);if(s.x2=d,l=s.x2!==r.x2,l){i?s.start=ye(d,r.x2,r.start,o,n):s.end=ye(d,r.x2,r.end,o,n);const[h,x]=Ae(s.x1,s.x2,s.progress,i);s.progressWidth=h,s.progressX=x}break}case"move":{const[d,h]=yt(e-a,o,r);if(l=d!==r.x1,l){s.start=ye(d,r.x1,r.start,o,n),s.end=ye(h,r.x2,r.end,o,n),s.x1=d,s.x2=h;const[x,I]=Ae(s.x1,s.x2,s.progress,i);s.progressWidth=x,s.progressX=I}break}}return{isChanged:l,changedTask:s}},Sr=(e,t,r,o,n,a)=>{const i=z({},r);let s=!1;switch(t){case"move":{const[l,d]=yt(e-a,o,r);s=l!==r.x1,s&&(i.start=ye(l,r.x1,r.start,o,n),i.end=i.start,i.x1=l,i.x2=d);break}}return{isChanged:s,changedTask:i}};var G=(e=>(e.Hour="hour",e.QuarterDay="quarterDay",e.HalfDay="halfDay",e.Day="day",e.Week="week",e.Month="month",e.QuarterYear="quarterYear",e.Year="year",e))(G||{});const St={},ke=(e,t={})=>{const r=JSON.stringify([e,t]);let o=St[r];return o||(o=new Intl.DateTimeFormat(e,t),St[r]=o),o},k=(e,t,r)=>new Date(e.getFullYear()+(r==="year"?t:0),e.getMonth()+(r==="month"?t:0),e.getDate()+(r==="day"?t:0),e.getHours()+(r==="hour"?t:0),e.getMinutes()+(r==="minute"?t:0),e.getSeconds()+(r==="second"?t:0),e.getMilliseconds()+(r==="millisecond"?t:0)),j=(e,t)=>{const r=["millisecond","second","minute","hour","day","month","year"],o=a=>{const i=r.indexOf(t);return r.indexOf(a)<=i};return new Date(e==null?void 0:e.getFullYear(),o("year")?0:e.getMonth(),o("month")?1:e.getDate(),o("day")?0:e.getHours(),o("hour")?0:e.getMinutes(),o("minute")?0:e.getSeconds(),o("second")?0:e.getMilliseconds())},wt=(e,t,r)=>{var a,i;let o=((a=e[0])==null?void 0:a.start)||new Date,n=((i=e[0])==null?void 0:i.start)||new Date;for(const s of e)s.start<o&&(o=s.start),s.end>n&&(n=s.end);switch(t){case G.Year:o=k(o,-1,"year"),o=j(o,"year"),n=k(n,1,"year"),n=j(n,"year");break;case G.QuarterYear:o=k(o,-3,"month"),o=j(o,"month"),n=k(n,3,"year"),n=j(n,"year");break;case G.Month:o=k(o,-1*r,"month"),o=j(o,"month"),n=k(n,1,"year"),n=j(n,"year");break;case G.Week:o=j(o,"day"),o=k(wr(o),-7*r,"day"),n=j(n,"day"),n=k(n,1.5,"month");break;case G.Day:o=j(o,"day"),o=k(o,-1*r,"day"),n=j(n,"day"),n=k(n,19,"day");break;case G.QuarterDay:o=j(o,"day"),o=k(o,-1*r,"day"),n=j(n,"day"),n=k(n,66,"hour");break;case G.HalfDay:o=j(o,"day"),o=k(o,-1*r,"day"),n=j(n,"day"),n=k(n,108,"hour");break;case G.Hour:o=j(o,"hour"),o=k(o,-1*r,"hour"),n=j(n,"day"),n=k(n,1,"day");break}return[o,n]},Ct=(e,t,r)=>{let o=new Date(e);const n=[o];for(;o<t;){switch(r){case G.Year:o=k(o,1,"year");break;case G.QuarterYear:o=k(o,3,"month");break;case G.Month:o=k(o,1,"month");break;case G.Week:o=k(o,7,"day");break;case G.Day:o=k(o,1,"day");break;case G.HalfDay:o=k(o,12,"hour");break;case G.QuarterDay:o=k(o,6,"hour");break;case G.Hour:o=k(o,1,"hour");break}n.push(o)}return n},$e=(e,t)=>{let r=ke(t,{month:"long"}).format(e);return r=r.replace(r[0],r[0].toLocaleUpperCase()),r},Tt=(e,t,r)=>{let o=ke(t,{weekday:r}).format(e);return o=o.replace(o[0],o[0].toLocaleUpperCase()),o},wr=e=>{const t=e.getDay(),r=e.getDate()-t+(t===0?-6:1);return new Date(e.setDate(r))},Cr=e=>{const t=new Date(e.valueOf()),r=(t.getDay()+6)%7;t.setDate(t.getDate()-r+3);const o=t.valueOf();t.setMonth(0,1),t.getDay()!==4&&t.setMonth(0,1+(4-t.getDay()+7)%7);const n=(1+Math.ceil((o-t.valueOf())/6048e5)).toString();return n.length===1?`0${n}`:n},Tr=(e,t)=>new Date(t,e+1,0).getDate();function Nr(e){return e.key!==void 0}function Mr(e){const t=e.filter(r=>r.hideChildren&&r.type==="project");if(t.length>0)for(let r=0;t.length>r;r++){const o=t[r],n=Nt(e,o);e=e.filter(a=>n.indexOf(a)===-1)}return e}function Nt(e,t){let r=[];t.type!=="project"?r=e.filter(n=>n.dependencies&&n.dependencies.indexOf(t.id)!==-1):r=e.filter(n=>n.project&&n.project===t.id);const o=[];return r.forEach(n=>{o.push(...Nt(e,n))}),r=r.concat(r,o),r}const Dr=(e,t)=>{const r=e.displayOrder||Number.MAX_VALUE,o=t.displayOrder||Number.MAX_VALUE;return r>o?1:r<o?-1:0},Ce=e=>{var t;return isNaN((t=e==null?void 0:e.getTime)==null?void 0:t.call(e))?0:e.getFullYear()+`/${e.getMonth()+1}/`+e.getDate()},Oe=ze.createStyles(({token:e,css:t})=>({scrollWrapper:t`
2
2
  overflow: auto;
3
3
  position: absolute;
4
4
  bottom: -4px;
@@ -73,7 +73,7 @@
73
73
  },
74
74
  }
75
75
  }
76
- `})),wr=({scroll:e,svgWidth:t,taskListWidth:r,rtl:o,onScroll:n})=>{const{styles:a}=Oe(),s=u.useRef(null);return u.useEffect(()=>{s.current&&(s.current.scrollLeft=e)},[e]),l.jsx("div",{dir:"ltr",style:{margin:o?`0px ${r}px 0px 0px`:`0px 0px 0px ${r}px`},className:N.cx(a.nbGridOther,a.scrollWrapper,"gantt-horizontal-scoll"),onScroll:n,ref:s,children:l.jsx("div",{style:{width:t,height:1},className:"horizontalScroll"})})},Cr=({task:e,rowHeight:t,rtl:r,svgContainerHeight:o,svgContainerWidth:n,scrollX:a,scrollY:s,arrowIndent:i,fontSize:c,fontFamily:d,headerHeight:p,taskListWidth:S,TooltipContent:$})=>{const{styles:v}=Oe(),x=u.useRef(null),[P,g]=u.useState(0),[y,C]=u.useState(0);return u.useEffect(()=>{if(x.current){const M=x.current.offsetHeight*1.1,B=x.current.offsetWidth*1.1;let b=e.index*t-s+p,h;if(r)h=e.x1-i*1.5-B-a,h<0&&(h=e.x2+i*1.5-a),B+h>n&&(h=n-B,b+=t);else{h=e.x2+i*1.5+S-a;const F=B+h,L=S+n;F>L&&(h=e.x1+S-i*1.5-a-B),h<S&&(h=n+S-B,b+=t)}M+b-s>o-s&&(b=o-M),g(b),C(h)}},[x,e,i,a,s,p,S,t,o,n,r]),l.jsx("div",{ref:x,className:N.cx(y?v.tooltipDetailsContainer:v.tooltipDetailsContainerHidden,v.nbGridOther),style:{left:y,top:P},children:l.jsx($,{task:e,fontSize:c,fontFamily:d})})},Tr=({task:e,fontSize:t,fontFamily:r})=>{var a,s,i,c,d,p,S,$;const{styles:o}=Oe(),n={fontSize:t,fontFamily:r};return l.jsxs("div",{className:N.cx(o.nbGridOther,o.tooltipDefaultContainer),"aria-label":"nb-gantt-tooltip",style:n,children:[l.jsxs("b",{style:{fontSize:t},children:[e.name,": ",Ce(e.start)," ~ ",Ce(e.end)]}),((s=(a=e.end)==null?void 0:a.getTime)==null?void 0:s.call(a))-((c=(i=e.start)==null?void 0:i.getTime)==null?void 0:c.call(i))!==0&&l.jsx("p",{className:"tooltipDefaultContainerParagraph",children:`Duration: ${Math.round((((p=(d=e.end)==null?void 0:d.getTime)==null?void 0:p.call(d))-(($=(S=e.start)==null?void 0:S.getTime)==null?void 0:$.call(S)))/(1e3*60*60*24)*10)/10||""} day(s)`}),l.jsx("p",{className:"tooltipDefaultContainerParagraph",children:!!e.progress&&`Progress: ${e.progress}%`})]})},Mr=({scroll:e,ganttHeight:t,ganttFullHeight:r,headerHeight:o,rtl:n,onScroll:a})=>{const{styles:s}=Oe(),i=u.useRef(null);return u.useEffect(()=>{i.current&&(i.current.scrollTop=e)},[e]),l.jsx("div",{style:{maxHeight:t,marginTop:o,marginLeft:n?"":"-1rem"},className:N.cx(s.nbGridOther,"verticalScroll"),onScroll:a,ref:i,children:l.jsx("div",{style:{height:r,width:1}})})},Tt=f.createStyles(({token:e,css:t})=>({ganttverticalcontainer:t`
76
+ `})),Pr=({scroll:e,svgWidth:t,taskListWidth:r,rtl:o,onScroll:n})=>{const{styles:a}=Oe(),i=f.useRef(null);return f.useEffect(()=>{i.current&&(i.current.scrollLeft=e)},[e]),c.jsx("div",{dir:"ltr",style:{margin:o?`0px ${r}px 0px 0px`:`0px 0px 0px ${r}px`},className:M.cx(a.nbGridOther,a.scrollWrapper,"gantt-horizontal-scoll"),onScroll:n,ref:i,children:c.jsx("div",{style:{width:t,height:1},className:"horizontalScroll"})})},Br=({task:e,rowHeight:t,rtl:r,svgContainerHeight:o,svgContainerWidth:n,scrollX:a,scrollY:i,arrowIndent:s,fontSize:l,fontFamily:d,headerHeight:h,taskListWidth:x,TooltipContent:I})=>{const{styles:S}=Oe(),y=f.useRef(null),[B,g]=f.useState(0),[v,C]=f.useState(0);return f.useEffect(()=>{if(y.current){const T=y.current.offsetHeight*1.1,D=y.current.offsetWidth*1.1;let m=e.index*t-i+h,p;if(r)p=e.x1-s*1.5-D-a,p<0&&(p=e.x2+s*1.5-a),D+p>n&&(p=n-D,m+=t);else{p=e.x2+s*1.5+x-a;const F=D+p,H=x+n;F>H&&(p=e.x1+x-s*1.5-a-D),p<x&&(p=n+x-D,m+=t)}T+m-i>o-i&&(m=o-T),g(m),C(p)}},[y,e,s,a,i,h,x,t,o,n,r]),c.jsx("div",{ref:y,className:M.cx(v?S.tooltipDetailsContainer:S.tooltipDetailsContainerHidden,S.nbGridOther),style:{left:v,top:B},children:c.jsx(I,{task:e,fontSize:l,fontFamily:d})})},Fr=({task:e,fontSize:t,fontFamily:r})=>{var a,i,s,l,d,h,x,I;const{styles:o}=Oe(),n={fontSize:t,fontFamily:r};return c.jsxs("div",{className:M.cx(o.nbGridOther,o.tooltipDefaultContainer),"aria-label":"nb-gantt-tooltip",style:n,children:[c.jsxs("b",{style:{fontSize:t},children:[e.name,": ",Ce(e.start)," ~ ",Ce(e.end)]}),((i=(a=e.end)==null?void 0:a.getTime)==null?void 0:i.call(a))-((l=(s=e.start)==null?void 0:s.getTime)==null?void 0:l.call(s))!==0&&c.jsx("p",{className:"tooltipDefaultContainerParagraph",children:`Duration: ${Math.round((((h=(d=e.end)==null?void 0:d.getTime)==null?void 0:h.call(d))-((I=(x=e.start)==null?void 0:x.getTime)==null?void 0:I.call(x)))/(1e3*60*60*24)*10)/10||""} day(s)`}),c.jsx("p",{className:"tooltipDefaultContainerParagraph",children:!!e.progress&&`Progress: ${e.progress}%`})]})},Ar=({scroll:e,ganttHeight:t,ganttFullHeight:r,headerHeight:o,rtl:n,onScroll:a})=>{const{styles:i}=Oe(),s=f.useRef(null);return f.useEffect(()=>{s.current&&(s.current.scrollTop=e)},[e]),c.jsx("div",{style:{maxHeight:t,marginTop:o,marginLeft:n?"":"-1rem"},className:M.cx(i.nbGridOther,"verticalScroll"),onScroll:a,ref:s,children:c.jsx("div",{style:{height:r,width:1}})})},Mt=u.createStyles(({token:e,css:t})=>({ganttverticalcontainer:t`
77
77
  overflow: hidden;
78
78
  font-size: 0;
79
79
  margin: 0;
@@ -106,7 +106,7 @@
106
106
  display: block;
107
107
  }
108
108
  }
109
- `}));function k(e,t){Br(e)&&(e="100%");var r=Dr(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Xe(e){return Math.min(1,Math.max(0,e))}function Br(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Dr(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Mt(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ke(e){return e<=1?"".concat(Number(e)*100,"%"):e}function ye(e){return e.length===1?"0"+e:String(e)}function Nr(e,t,r){return{r:k(e,255)*255,g:k(t,255)*255,b:k(r,255)*255}}function Bt(e,t,r){e=k(e,255),t=k(t,255),r=k(r,255);var o=Math.max(e,t,r),n=Math.min(e,t,r),a=0,s=0,i=(o+n)/2;if(o===n)s=0,a=0;else{var c=o-n;switch(s=i>.5?c/(2-o-n):c/(o+n),o){case e:a=(t-r)/c+(t<r?6:0);break;case t:a=(r-e)/c+2;break;case r:a=(e-t)/c+4;break}a/=6}return{h:a,s,l:i}}function tt(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Pr(e,t,r){var o,n,a;if(e=k(e,360),t=k(t,100),r=k(r,100),t===0)n=r,a=r,o=r;else{var s=r<.5?r*(1+t):r+t-r*t,i=2*r-s;o=tt(i,s,e+1/3),n=tt(i,s,e),a=tt(i,s,e-1/3)}return{r:o*255,g:n*255,b:a*255}}function Dt(e,t,r){e=k(e,255),t=k(t,255),r=k(r,255);var o=Math.max(e,t,r),n=Math.min(e,t,r),a=0,s=o,i=o-n,c=o===0?0:i/o;if(o===n)a=0;else{switch(o){case e:a=(t-r)/i+(t<r?6:0);break;case t:a=(r-e)/i+2;break;case r:a=(e-t)/i+4;break}a/=6}return{h:a,s:c,v:s}}function Fr(e,t,r){e=k(e,360)*6,t=k(t,100),r=k(r,100);var o=Math.floor(e),n=e-o,a=r*(1-t),s=r*(1-n*t),i=r*(1-(1-n)*t),c=o%6,d=[r,s,a,a,i,r][c],p=[i,r,r,s,a,a][c],S=[a,a,i,r,r,s][c];return{r:d*255,g:p*255,b:S*255}}function Nt(e,t,r,o){var n=[ye(Math.round(e).toString(16)),ye(Math.round(t).toString(16)),ye(Math.round(r).toString(16))];return o&&n[0].startsWith(n[0].charAt(1))&&n[1].startsWith(n[1].charAt(1))&&n[2].startsWith(n[2].charAt(1))?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function Ar(e,t,r,o,n){var a=[ye(Math.round(e).toString(16)),ye(Math.round(t).toString(16)),ye(Math.round(r).toString(16)),ye($r(o))];return n&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function $r(e){return Math.round(parseFloat(e)*255).toString(16)}function Pt(e){return W(e)/255}function W(e){return parseInt(e,16)}function Vr(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var rt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Ir(e){var t={r:0,g:0,b:0},r=1,o=null,n=null,a=null,s=!1,i=!1;return typeof e=="string"&&(e=Er(e)),typeof e=="object"&&(ae(e.r)&&ae(e.g)&&ae(e.b)?(t=Nr(e.r,e.g,e.b),s=!0,i=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ae(e.h)&&ae(e.s)&&ae(e.v)?(o=ke(e.s),n=ke(e.v),t=Fr(e.h,o,n),s=!0,i="hsv"):ae(e.h)&&ae(e.s)&&ae(e.l)&&(o=ke(e.s),a=ke(e.l),t=Pr(e.h,o,a),s=!0,i="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=Mt(r),{ok:s,format:e.format||i,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var Lr="[-\\+]?\\d+%?",Hr="[-\\+]?\\d*\\.\\d+%?",he="(?:".concat(Hr,")|(?:").concat(Lr,")"),ot="[\\s|\\(]+(".concat(he,")[,|\\s]+(").concat(he,")[,|\\s]+(").concat(he,")\\s*\\)?"),nt="[\\s|\\(]+(".concat(he,")[,|\\s]+(").concat(he,")[,|\\s]+(").concat(he,")[,|\\s]+(").concat(he,")\\s*\\)?"),K={CSS_UNIT:new RegExp(he),rgb:new RegExp("rgb"+ot),rgba:new RegExp("rgba"+nt),hsl:new RegExp("hsl"+ot),hsla:new RegExp("hsla"+nt),hsv:new RegExp("hsv"+ot),hsva:new RegExp("hsva"+nt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Er(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(rt[e])e=rt[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=K.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=K.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=K.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=K.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=K.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=K.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=K.hex8.exec(e),r?{r:W(r[1]),g:W(r[2]),b:W(r[3]),a:Pt(r[4]),format:t?"name":"hex8"}:(r=K.hex6.exec(e),r?{r:W(r[1]),g:W(r[2]),b:W(r[3]),format:t?"name":"hex"}:(r=K.hex4.exec(e),r?{r:W(r[1]+r[1]),g:W(r[2]+r[2]),b:W(r[3]+r[3]),a:Pt(r[4]+r[4]),format:t?"name":"hex8"}:(r=K.hex3.exec(e),r?{r:W(r[1]+r[1]),g:W(r[2]+r[2]),b:W(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function ae(e){return!!K.CSS_UNIT.exec(String(e))}var zr=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var o;if(t instanceof e)return t;typeof t=="number"&&(t=Vr(t)),this.originalInput=t;var n=Ir(t);this.originalInput=t,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=(o=r.format)!==null&&o!==void 0?o:n.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),r,o,n,a=t.r/255,s=t.g/255,i=t.b/255;return a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),s<=.03928?o=s/12.92:o=Math.pow((s+.055)/1.055,2.4),i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),.2126*r+.7152*o+.0722*n},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=Mt(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=Dt(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=Dt(this.r,this.g,this.b),r=Math.round(t.h*360),o=Math.round(t.s*100),n=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(o,"%, ").concat(n,"%)"):"hsva(".concat(r,", ").concat(o,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=Bt(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=Bt(this.r,this.g,this.b),r=Math.round(t.h*360),o=Math.round(t.s*100),n=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(o,"%, ").concat(n,"%)"):"hsla(".concat(r,", ").concat(o,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Nt(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Ar(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),r=Math.round(this.g),o=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(o,")"):"rgba(".concat(t,", ").concat(r,", ").concat(o,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(k(r,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(r){return Math.round(k(r,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Nt(this.r,this.g,this.b,!1),r=0,o=Object.entries(rt);r<o.length;r++){var n=o[r],a=n[0],s=n[1];if(t===s)return a}return!1},e.prototype.toString=function(t){var r=!!t;t=t!=null?t:this.format;var o=!1,n=this.a<1&&this.a>=0,a=!r&&n&&(t.startsWith("hex")||t==="name");return a?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(o=this.toRgbString()),t==="prgb"&&(o=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(o=this.toHexString()),t==="hex3"&&(o=this.toHexString(!0)),t==="hex4"&&(o=this.toHex8String(!0)),t==="hex8"&&(o=this.toHex8String()),t==="name"&&(o=this.toName()),t==="hsl"&&(o=this.toHslString()),t==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=Xe(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=Xe(r.l),new e(r)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=Xe(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=Xe(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),o=(r.h+t)%360;return r.h=o<0?360+o:o,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var o=this.toRgb(),n=new e(t).toRgb(),a=r/100,s={r:(n.r-o.r)*a+o.r,g:(n.g-o.g)*a+o.g,b:(n.b-o.b)*a+o.b,a:(n.a-o.a)*a+o.a};return new e(s)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var o=this.toHsl(),n=360/r,a=[this];for(o.h=(o.h-(n*t>>1)+720)%360;--t;)o.h=(o.h+n)%360,a.push(new e(o));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var r=this.toHsv(),o=r.h,n=r.s,a=r.v,s=[],i=1/t;t--;)s.push(new e({h:o,s:n,v:a})),a=(a+i)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),o=new e(t).toRgb(),n=r.a+o.a*(1-r.a);return new e({r:(r.r*r.a+o.r*o.a*(1-r.a))/n,g:(r.g*r.a+o.g*o.a*(1-r.a))/n,b:(r.b*r.a+o.b*o.a*(1-r.a))/n,a:n})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),o=r.h,n=[this],a=360/t,s=1;s<t;s++)n.push(new e({h:(o+s*a)%360,s:r.s,l:r.l}));return n},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();const Gr=Ee.createStyles(({token:e,css:t})=>{const r=new zr(e.colorFillAlter).onBackground(e.colorBgContainer).toHexShortString();return{calendarheader:t`
109
+ `}));function X(e,t){$r(e)&&(e="100%");var r=Ir(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Xe(e){return Math.min(1,Math.max(0,e))}function $r(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Ir(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Dt(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Ye(e){return e<=1?"".concat(Number(e)*100,"%"):e}function ve(e){return e.length===1?"0"+e:String(e)}function Vr(e,t,r){return{r:X(e,255)*255,g:X(t,255)*255,b:X(r,255)*255}}function Pt(e,t,r){e=X(e,255),t=X(t,255),r=X(r,255);var o=Math.max(e,t,r),n=Math.min(e,t,r),a=0,i=0,s=(o+n)/2;if(o===n)i=0,a=0;else{var l=o-n;switch(i=s>.5?l/(2-o-n):l/(o+n),o){case e:a=(t-r)/l+(t<r?6:0);break;case t:a=(r-e)/l+2;break;case r:a=(e-t)/l+4;break}a/=6}return{h:a,s:i,l:s}}function tt(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Lr(e,t,r){var o,n,a;if(e=X(e,360),t=X(t,100),r=X(r,100),t===0)n=r,a=r,o=r;else{var i=r<.5?r*(1+t):r+t-r*t,s=2*r-i;o=tt(s,i,e+1/3),n=tt(s,i,e),a=tt(s,i,e-1/3)}return{r:o*255,g:n*255,b:a*255}}function Bt(e,t,r){e=X(e,255),t=X(t,255),r=X(r,255);var o=Math.max(e,t,r),n=Math.min(e,t,r),a=0,i=o,s=o-n,l=o===0?0:s/o;if(o===n)a=0;else{switch(o){case e:a=(t-r)/s+(t<r?6:0);break;case t:a=(r-e)/s+2;break;case r:a=(e-t)/s+4;break}a/=6}return{h:a,s:l,v:i}}function Hr(e,t,r){e=X(e,360)*6,t=X(t,100),r=X(r,100);var o=Math.floor(e),n=e-o,a=r*(1-t),i=r*(1-n*t),s=r*(1-(1-n)*t),l=o%6,d=[r,i,a,a,s,r][l],h=[s,r,r,i,a,a][l],x=[a,a,s,r,r,i][l];return{r:d*255,g:h*255,b:x*255}}function Ft(e,t,r,o){var n=[ve(Math.round(e).toString(16)),ve(Math.round(t).toString(16)),ve(Math.round(r).toString(16))];return o&&n[0].startsWith(n[0].charAt(1))&&n[1].startsWith(n[1].charAt(1))&&n[2].startsWith(n[2].charAt(1))?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function Er(e,t,r,o,n){var a=[ve(Math.round(e).toString(16)),ve(Math.round(t).toString(16)),ve(Math.round(r).toString(16)),ve(zr(o))];return n&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function zr(e){return Math.round(parseFloat(e)*255).toString(16)}function At(e){return _(e)/255}function _(e){return parseInt(e,16)}function Gr(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var rt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function kr(e){var t={r:0,g:0,b:0},r=1,o=null,n=null,a=null,i=!1,s=!1;return typeof e=="string"&&(e=Yr(e)),typeof e=="object"&&(le(e.r)&&le(e.g)&&le(e.b)?(t=Vr(e.r,e.g,e.b),i=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):le(e.h)&&le(e.s)&&le(e.v)?(o=Ye(e.s),n=Ye(e.v),t=Hr(e.h,o,n),i=!0,s="hsv"):le(e.h)&&le(e.s)&&le(e.l)&&(o=Ye(e.s),a=Ye(e.l),t=Lr(e.h,o,a),i=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=Dt(r),{ok:i,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var Or="[-\\+]?\\d+%?",Xr="[-\\+]?\\d*\\.\\d+%?",ge="(?:".concat(Xr,")|(?:").concat(Or,")"),ot="[\\s|\\(]+(".concat(ge,")[,|\\s]+(").concat(ge,")[,|\\s]+(").concat(ge,")\\s*\\)?"),nt="[\\s|\\(]+(".concat(ge,")[,|\\s]+(").concat(ge,")[,|\\s]+(").concat(ge,")[,|\\s]+(").concat(ge,")\\s*\\)?"),J={CSS_UNIT:new RegExp(ge),rgb:new RegExp("rgb"+ot),rgba:new RegExp("rgba"+nt),hsl:new RegExp("hsl"+ot),hsla:new RegExp("hsla"+nt),hsv:new RegExp("hsv"+ot),hsva:new RegExp("hsva"+nt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Yr(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(rt[e])e=rt[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=J.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=J.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=J.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=J.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=J.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=J.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=J.hex8.exec(e),r?{r:_(r[1]),g:_(r[2]),b:_(r[3]),a:At(r[4]),format:t?"name":"hex8"}:(r=J.hex6.exec(e),r?{r:_(r[1]),g:_(r[2]),b:_(r[3]),format:t?"name":"hex"}:(r=J.hex4.exec(e),r?{r:_(r[1]+r[1]),g:_(r[2]+r[2]),b:_(r[3]+r[3]),a:At(r[4]+r[4]),format:t?"name":"hex8"}:(r=J.hex3.exec(e),r?{r:_(r[1]+r[1]),g:_(r[2]+r[2]),b:_(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function le(e){return!!J.CSS_UNIT.exec(String(e))}var jr=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var o;if(t instanceof e)return t;typeof t=="number"&&(t=Gr(t)),this.originalInput=t;var n=kr(t);this.originalInput=t,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=(o=r.format)!==null&&o!==void 0?o:n.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),r,o,n,a=t.r/255,i=t.g/255,s=t.b/255;return a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),i<=.03928?o=i/12.92:o=Math.pow((i+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),.2126*r+.7152*o+.0722*n},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=Dt(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=Bt(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=Bt(this.r,this.g,this.b),r=Math.round(t.h*360),o=Math.round(t.s*100),n=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(o,"%, ").concat(n,"%)"):"hsva(".concat(r,", ").concat(o,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=Pt(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=Pt(this.r,this.g,this.b),r=Math.round(t.h*360),o=Math.round(t.s*100),n=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(o,"%, ").concat(n,"%)"):"hsla(".concat(r,", ").concat(o,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Ft(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Er(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),r=Math.round(this.g),o=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(o,")"):"rgba(".concat(t,", ").concat(r,", ").concat(o,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(X(r,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(r){return Math.round(X(r,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Ft(this.r,this.g,this.b,!1),r=0,o=Object.entries(rt);r<o.length;r++){var n=o[r],a=n[0],i=n[1];if(t===i)return a}return!1},e.prototype.toString=function(t){var r=!!t;t=t!=null?t:this.format;var o=!1,n=this.a<1&&this.a>=0,a=!r&&n&&(t.startsWith("hex")||t==="name");return a?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(o=this.toRgbString()),t==="prgb"&&(o=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(o=this.toHexString()),t==="hex3"&&(o=this.toHexString(!0)),t==="hex4"&&(o=this.toHex8String(!0)),t==="hex8"&&(o=this.toHex8String()),t==="name"&&(o=this.toName()),t==="hsl"&&(o=this.toHslString()),t==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=Xe(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=Xe(r.l),new e(r)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=Xe(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=Xe(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),o=(r.h+t)%360;return r.h=o<0?360+o:o,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var o=this.toRgb(),n=new e(t).toRgb(),a=r/100,i={r:(n.r-o.r)*a+o.r,g:(n.g-o.g)*a+o.g,b:(n.b-o.b)*a+o.b,a:(n.a-o.a)*a+o.a};return new e(i)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var o=this.toHsl(),n=360/r,a=[this];for(o.h=(o.h-(n*t>>1)+720)%360;--t;)o.h=(o.h+n)%360,a.push(new e(o));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var r=this.toHsv(),o=r.h,n=r.s,a=r.v,i=[],s=1/t;t--;)i.push(new e({h:o,s:n,v:a})),a=(a+s)%1;return i},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),o=new e(t).toRgb(),n=r.a+o.a*(1-r.a);return new e({r:(r.r*r.a+o.r*o.a*(1-r.a))/n,g:(r.g*r.a+o.g*o.a*(1-r.a))/n,b:(r.b*r.a+o.b*o.a*(1-r.a))/n,a:n})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),o=r.h,n=[this],a=360/t,i=1;i<t;i++)n.push(new e({h:(o+i*a)%360,s:r.s,l:r.l}));return n},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();const qr=ze.createStyles(({token:e,css:t})=>{const r=new jr(e.colorFillAlter).onBackground(e.colorBgContainer).toHexShortString();return{calendarheader:t`
110
110
  color: ${e.colorText};
111
111
  fill: ${r};
112
112
  stroke-width: 1.4;
@@ -139,7 +139,7 @@
139
139
  font-weight: 500;
140
140
  fill: ${e.colorText};
141
141
  }
142
- `}}),ve=({value:e,x1Line:t,y1Line:r,y2Line:o,xText:n,yText:a})=>l.jsxs("g",{className:"calendarTop",children:[l.jsx("line",{x1:t,y1:r,x2:t,y2:o,className:N.cx("calendarTopTick")},e+"line"),l.jsx("text",{y:a,x:n,className:N.cx("calendarTopText"),children:e},e+"text")]}),Or=({dateSetup:e,locale:t,viewMode:r,rtl:o,headerHeight:n,columnWidth:a,fontFamily:s,fontSize:i})=>{const{styles:c}=Gr(),d=()=>{const C=[],M=[],B=n*.5;for(let b=0;b<e.dates.length;b++){const h=e.dates[b],m=h.getFullYear();if(M.push(l.jsx("text",{y:n*.8,x:a*b+a*.5,className:N.cx("calendarBottomText"),children:m},h.getTime())),b===0||h.getFullYear()!==e.dates[b-1].getFullYear()){const F=h.getFullYear().toString();let L;o?L=(6+b+h.getFullYear()+1)*a:L=(6+b-h.getFullYear())*a,C.push(l.jsx(ve,{value:F,x1Line:a*b,y1Line:0,y2Line:n,xText:L,yText:B*.9},F))}}return[C,M]},p=()=>{const C=[],M=[],B=n*.5;for(let b=0;b<e.dates.length;b++){const h=e.dates[b],m="Q"+Math.floor((h.getMonth()+3)/3);if(M.push(l.jsx("text",{y:n*.8,x:a*b+a*.5,className:N.cx("calendarBottomText"),children:m},h.getTime())),b===0||h.getFullYear()!==e.dates[b-1].getFullYear()){const F=h.getFullYear().toString();let L;o?L=(6+b+h.getMonth()+1)*a:L=(6+b-h.getMonth())*a,C.push(l.jsx(ve,{value:F,x1Line:a*b,y1Line:0,y2Line:B,xText:Math.abs(L),yText:B*.9},F))}}return[C,M]},S=()=>{const C=[],M=[],B=n*.5;for(let b=0;b<e.dates.length;b++){const h=e.dates[b],m=Fe(h,t);if(M.push(l.jsx("text",{y:n*.8,x:a*b+a*.5,className:N.cx("calendarBottomText"),children:m},m+h.getFullYear())),b===0||h.getFullYear()!==e.dates[b-1].getFullYear()){const F=h.getFullYear().toString();let L;o?L=(6+b+h.getMonth()+1)*a:L=(6+b-h.getMonth())*a,C.push(l.jsx(ve,{value:F,x1Line:a*b,y1Line:0,y2Line:B,xText:L,yText:B*.9},F))}}return[C,M]},$=()=>{const C=[],M=[];let B=1;const b=n*.5,h=e.dates;for(let m=h.length-1;m>=0;m--){const F=h[m];let L="";(m===0||F.getMonth()!==h[m-1].getMonth())&&(L=`${Fe(F,t)}, ${F.getFullYear()}`);const Q=`W${mr(F)}`;M.push(l.jsx("text",{y:n*.8,x:a*(m+ +o),className:N.cx("calendarBottomText"),children:Q},F.getTime())),L&&(m!==h.length-1&&C.push(l.jsx(ve,{value:L,x1Line:a*m+B*a,y1Line:0,y2Line:b,xText:a*m+a*B*.5,yText:b*.9},L)),B=0),B++}return[C,M]},v=()=>{const C=[],M=[],B=n*.5,b=e.dates;for(let h=0;h<b.length;h++){const m=b[h],F=`${m.getDate().toString()}`;if(M.push(l.jsx("text",{y:n*.8,x:a*h+a*.5,className:N.cx("calendarBottomText"),children:F},m.getTime())),h+1!==b.length&&m.getMonth()!==b[h+1].getMonth()){const L=Fe(m,t);C.push(l.jsx(ve,{value:L,x1Line:a*(h+1),y1Line:0,y2Line:B,xText:a*(h+1)-xr(m.getMonth(),m.getFullYear())*a*.5,yText:B*.9},L+m.getFullYear()))}}return[C,M]},x=()=>{const C=[],M=[],B=r===z.HalfDay?2:4,b=n*.5,h=e.dates;for(let m=0;m<h.length;m++){const F=h[m],L=Ge(t,{hour:"numeric"}).format(F).replace("时","");if(M.push(l.jsx("text",{y:n*.8,x:a*(m+ +o),className:N.cx("calendarBottomText"),fontFamily:s,children:L},F.getTime())),m===0||F.getDate()!==h[m-1].getDate()){const Q=`${wt(F,t,"short")}, ${F.getDate()} ${Fe(F,t)}`;C.push(l.jsx(ve,{value:Q,x1Line:a*m+B*a,y1Line:0,y2Line:b,xText:a*m+B*a*.5,yText:b*.9},Q+F.getFullYear()))}}return[C,M]},P=()=>{var h;const C=[],M=[],B=n*.5,b=e.dates;for(let m=0;m<b.length;m++){const F=b[m],L=(h=Ge(t,{hour:"numeric"}).format(F))==null?void 0:h.replace("时","");if(M.push(l.jsx("text",{y:n*.8,x:a*(m+ +o),className:N.cx("calendarBottomText"),fontFamily:s,children:L},F.getTime())),m!==0&&F.getDate()!==b[m-1].getDate()){const Q=b[m-1],se=`${wt(Q,t,"long")}, ${Q.getDate()} ${Fe(Q,t)}`,pe=(F.getHours()-24)/2;C.push(l.jsx(ve,{value:se,x1Line:a*m,y1Line:0,y2Line:B,xText:a*(m+pe),yText:B*.9},se+Q.getFullYear()))}}return[C,M]};let g=[],y=[];switch(e.viewMode){case z.Year:[g,y]=d();break;case z.QuarterYear:[g,y]=p();break;case z.Month:[g,y]=S();break;case z.Week:[g,y]=$();break;case z.Day:[g,y]=v();break;case z.QuarterDay:case z.HalfDay:[g,y]=x();break;case z.Hour:[g,y]=P()}return l.jsxs("g",{className:c.nbGanttCalendar,fontSize:i,fontFamily:s,children:[l.jsx("rect",{x:0,y:0,width:a*e.dates.length,height:n,className:c.calendarheader}),y," ",g]})},Xr=Ee.createStyles(({token:e,css:t})=>({gridRow:t`
142
+ `}}),Se=({value:e,x1Line:t,y1Line:r,y2Line:o,xText:n,yText:a})=>c.jsxs("g",{className:"calendarTop",children:[c.jsx("line",{x1:t,y1:r,x2:t,y2:o,className:M.cx("calendarTopTick")},e+"line"),c.jsx("text",{y:a,x:n,className:M.cx("calendarTopText"),children:e},e+"text")]}),Wr=({dateSetup:e,locale:t,viewMode:r,rtl:o,headerHeight:n,columnWidth:a,fontFamily:i,fontSize:s})=>{const{styles:l}=qr(),d=()=>{const C=[],T=[],D=n*.5;for(let m=0;m<e.dates.length;m++){const p=e.dates[m],b=p.getFullYear();if(T.push(c.jsx("text",{y:n*.8,x:a*m+a*.5,className:M.cx("calendarBottomText"),children:b},p.getTime())),m===0||p.getFullYear()!==e.dates[m-1].getFullYear()){const F=p.getFullYear().toString();let H;o?H=(6+m+p.getFullYear()+1)*a:H=(6+m-p.getFullYear())*a,C.push(c.jsx(Se,{value:F,x1Line:a*m,y1Line:0,y2Line:n,xText:H,yText:D*.9},F))}}return[C,T]},h=()=>{const C=[],T=[],D=n*.5;for(let m=0;m<e.dates.length;m++){const p=e.dates[m],b="Q"+Math.floor((p.getMonth()+3)/3);if(T.push(c.jsx("text",{y:n*.8,x:a*m+a*.5,className:M.cx("calendarBottomText"),children:b},p.getTime())),m===0||p.getFullYear()!==e.dates[m-1].getFullYear()){const F=p.getFullYear().toString();let H;o?H=(6+m+p.getMonth()+1)*a:H=(6+m-p.getMonth())*a,C.push(c.jsx(Se,{value:F,x1Line:a*m,y1Line:0,y2Line:D,xText:Math.abs(H),yText:D*.9},F))}}return[C,T]},x=()=>{const C=[],T=[],D=n*.5;for(let m=0;m<e.dates.length;m++){const p=e.dates[m],b=$e(p,t);if(T.push(c.jsx("text",{y:n*.8,x:a*m+a*.5,className:M.cx("calendarBottomText"),children:b},b+p.getFullYear())),m===0||p.getFullYear()!==e.dates[m-1].getFullYear()){const F=p.getFullYear().toString();let H;o?H=(6+m+p.getMonth()+1)*a:H=(6+m-p.getMonth())*a,C.push(c.jsx(Se,{value:F,x1Line:a*m,y1Line:0,y2Line:D,xText:H,yText:D*.9},F))}}return[C,T]},I=()=>{const C=[],T=[];let D=1;const m=n*.5,p=e.dates;for(let b=p.length-1;b>=0;b--){const F=p[b];let H="";(b===0||F.getMonth()!==p[b-1].getMonth())&&(H=`${$e(F,t)}, ${F.getFullYear()}`);const Q=`W${Cr(F)}`;T.push(c.jsx("text",{y:n*.8,x:a*(b+ +o),className:M.cx("calendarBottomText"),children:Q},F.getTime())),H&&(b!==p.length-1&&C.push(c.jsx(Se,{value:H,x1Line:a*b+D*a,y1Line:0,y2Line:m,xText:a*b+a*D*.5,yText:m*.9},H)),D=0),D++}return[C,T]},S=()=>{const C=[],T=[],D=n*.5,m=e.dates;for(let p=0;p<m.length;p++){const b=m[p],F=`${b.getDate().toString()}`;if(T.push(c.jsx("text",{y:n*.8,x:a*p+a*.5,className:M.cx("calendarBottomText"),children:F},b.getTime())),p+1!==m.length&&b.getMonth()!==m[p+1].getMonth()){const H=$e(b,t);C.push(c.jsx(Se,{value:H,x1Line:a*(p+1),y1Line:0,y2Line:D,xText:a*(p+1)-Tr(b.getMonth(),b.getFullYear())*a*.5,yText:D*.9},H+b.getFullYear()))}}return[C,T]},y=()=>{const C=[],T=[],D=r===G.HalfDay?2:4,m=n*.5,p=e.dates;for(let b=0;b<p.length;b++){const F=p[b],H=ke(t,{hour:"numeric"}).format(F).replace("时","");if(T.push(c.jsx("text",{y:n*.8,x:a*(b+ +o),className:M.cx("calendarBottomText"),fontFamily:i,children:H},F.getTime())),b===0||F.getDate()!==p[b-1].getDate()){const Q=`${Tt(F,t,"short")}, ${F.getDate()} ${$e(F,t)}`;C.push(c.jsx(Se,{value:Q,x1Line:a*b+D*a,y1Line:0,y2Line:m,xText:a*b+D*a*.5,yText:m*.9},Q+F.getFullYear()))}}return[C,T]},B=()=>{var p;const C=[],T=[],D=n*.5,m=e.dates;for(let b=0;b<m.length;b++){const F=m[b],H=(p=ke(t,{hour:"numeric"}).format(F))==null?void 0:p.replace("时","");if(T.push(c.jsx("text",{y:n*.8,x:a*(b+ +o),className:M.cx("calendarBottomText"),fontFamily:i,children:H},F.getTime())),b!==0&&F.getDate()!==m[b-1].getDate()){const Q=m[b-1],ce=`${Tt(Q,t,"long")}, ${Q.getDate()} ${$e(Q,t)}`,me=(F.getHours()-24)/2;C.push(c.jsx(Se,{value:ce,x1Line:a*b,y1Line:0,y2Line:D,xText:a*(b+me),yText:D*.9},ce+Q.getFullYear()))}}return[C,T]};let g=[],v=[];switch(e.viewMode){case G.Year:[g,v]=d();break;case G.QuarterYear:[g,v]=h();break;case G.Month:[g,v]=x();break;case G.Week:[g,v]=I();break;case G.Day:[g,v]=S();break;case G.QuarterDay:case G.HalfDay:[g,v]=y();break;case G.Hour:[g,v]=B()}return c.jsxs("g",{className:l.nbGanttCalendar,fontSize:s,fontFamily:i,children:[c.jsx("rect",{x:0,y:0,width:a*e.dates.length,height:n,className:l.calendarheader}),v," ",g]})},Ur=ze.createStyles(({token:e,css:t})=>({gridRow:t`
143
143
  fill: ${e.colorBgContainer};
144
144
  `,gridHeightRow:t`
145
145
  fill: #e6f7ff;
@@ -153,21 +153,21 @@
153
153
  .gridtick: {
154
154
  stroke: ${e.colorBorderSecondary};
155
155
  }
156
- `})),kr=[{id:Ze.uid()},{id:Ze.uid()},{id:Ze.uid()}],Yr=({tasks:e,dates:t,rowHeight:r,svgWidth:o,columnWidth:n,todayColor:a,rtl:s,selectedRowKeys:i})=>{const{styles:c}=Xr(),d=e.length?e:kr;let p=0;const S=[],$=[l.jsx("line",{x:"0",y1:0,x2:o,y2:0,className:N.cx("gridRowLine")},"RowLineFirst")];for(const y of d)S.push(l.jsx("rect",{x:"0",y:p,width:o,height:r,className:i!=null&&i.includes(+y.id)?c.gridHeightRow:c.gridRow},"Row"+y.id)),$.push(l.jsx("line",{x:"0",y1:p+r,x2:o,y2:p+r,className:N.cx("gridRowLine")},"RowLine"+y.id)),p+=r;const v=new Date;let x=0;const P=[];let g=l.jsx("rect",{});for(let y=0;y<t.length;y++){const C=t[y];P.push(l.jsx("line",{x1:x,y1:0,x2:x,y2:p,className:N.cx("gridTick")},C.getTime())),(y+1!==t.length&&C.getTime()<v.getTime()&&t[y+1].getTime()>=v.getTime()||y!==0&&y+1===t.length&&C.getTime()<v.getTime()&&G(C,C.getTime()-t[y-1].getTime(),"millisecond").getTime()>=v.getTime())&&(g=l.jsx("rect",{x,y:0,width:n,height:p,fill:a})),s&&y+1!==t.length&&C.getTime()>=v.getTime()&&t[y+1].getTime()<v.getTime()&&(g=l.jsx("rect",{x:x+n,y:0,width:n,height:p,fill:a})),x+=n}return l.jsxs("g",{className:N.cx("gridBody",c.nbGridbody),children:[l.jsx("g",{className:"rows",children:S}),l.jsx("g",{className:"rowLines",children:$}),l.jsx("g",{className:"ticks",children:P}),l.jsx("g",{className:"today",children:g})]})},jr=e=>l.jsx("g",{className:"grid",children:l.jsx(Yr,E({},e))}),qr=({taskFrom:e,taskTo:t,rowHeight:r,taskHeight:o,arrowIndent:n,rtl:a})=>{let s,i;return a?[s,i]=Wr(e,t,r,o,n):[s,i]=Ur(e,t,r,o,n),l.jsxs("g",{className:"arrow",children:[l.jsx("path",{strokeWidth:"1.5",d:s,fill:"none"}),l.jsx("polygon",{points:i})]})},Ur=(e,t,r,o,n)=>{const a=e.index>t.index?-1:1,s=t.y+o/2,i=e.x2+n*2,c=i<t.x1?"":`H ${t.x1-n}`,d=i>t.x1?n:t.x1-e.x2-n,p=`M ${e.x2} ${e.y+o/2}
156
+ `})),_r=[{id:Ze.uid()},{id:Ze.uid()},{id:Ze.uid()}],Qr=({tasks:e,dates:t,rowHeight:r,svgWidth:o,columnWidth:n,todayColor:a,rtl:i,selectedRowKeys:s})=>{const{styles:l}=Ur(),d=e.length?e:_r;let h=0;const x=[],I=[c.jsx("line",{x:"0",y1:0,x2:o,y2:0,className:M.cx("gridRowLine")},"RowLineFirst")];for(const v of d)x.push(c.jsx("rect",{x:"0",y:h,width:o,height:r,className:s!=null&&s.includes(+v.id)?l.gridHeightRow:l.gridRow},"Row"+v.id)),I.push(c.jsx("line",{x:"0",y1:h+r,x2:o,y2:h+r,className:M.cx("gridRowLine")},"RowLine"+v.id)),h+=r;const S=new Date;let y=0;const B=[];let g=c.jsx("rect",{});for(let v=0;v<t.length;v++){const C=t[v];B.push(c.jsx("line",{x1:y,y1:0,x2:y,y2:h,className:M.cx("gridTick")},C.getTime())),(v+1!==t.length&&C.getTime()<S.getTime()&&t[v+1].getTime()>=S.getTime()||v!==0&&v+1===t.length&&C.getTime()<S.getTime()&&k(C,C.getTime()-t[v-1].getTime(),"millisecond").getTime()>=S.getTime())&&(g=c.jsx("rect",{x:y,y:0,width:n,height:h,fill:a})),i&&v+1!==t.length&&C.getTime()>=S.getTime()&&t[v+1].getTime()<S.getTime()&&(g=c.jsx("rect",{x:y+n,y:0,width:n,height:h,fill:a})),y+=n}return c.jsxs("g",{className:M.cx("gridBody",l.nbGridbody),children:[c.jsx("g",{className:"rows",children:x}),c.jsx("g",{className:"rowLines",children:I}),c.jsx("g",{className:"ticks",children:B}),c.jsx("g",{className:"today",children:g})]})},Kr=e=>c.jsx("g",{className:"grid",children:c.jsx(Qr,z({},e))}),Jr=({taskFrom:e,taskTo:t,rowHeight:r,taskHeight:o,arrowIndent:n,rtl:a})=>{let i,s;return a?[i,s]=Rr(e,t,r,o,n):[i,s]=Zr(e,t,r,o,n),c.jsxs("g",{className:"arrow",children:[c.jsx("path",{strokeWidth:"1.5",d:i,fill:"none"}),c.jsx("polygon",{points:s})]})},Zr=(e,t,r,o,n)=>{const a=e.index>t.index?-1:1,i=t.y+o/2,s=e.x2+n*2,l=s<t.x1?"":`H ${t.x1-n}`,d=s>t.x1?n:t.x1-e.x2-n,h=`M ${e.x2} ${e.y+o/2}
157
157
  h ${n}
158
158
  v ${a*r/2}
159
- ${c}
160
- V ${s}
161
- h ${d}`,S=`${t.x1},${s}
162
- ${t.x1-5},${s-5}
163
- ${t.x1-5},${s+5}`;return[p,S]},Wr=(e,t,r,o,n)=>{const a=e.index>t.index?-1:1,s=t.y+o/2,i=e.x1-n*2,c=i>t.x2?"":`H ${t.x2+n}`,d=i<t.x2?-n:t.x2-e.x1+n,p=`M ${e.x1} ${e.y+o/2}
159
+ ${l}
160
+ V ${i}
161
+ h ${d}`,x=`${t.x1},${i}
162
+ ${t.x1-5},${i-5}
163
+ ${t.x1-5},${i+5}`;return[h,x]},Rr=(e,t,r,o,n)=>{const a=e.index>t.index?-1:1,i=t.y+o/2,s=e.x1-n*2,l=s>t.x2?"":`H ${t.x2+n}`,d=s<t.x2?-n:t.x2-e.x1+n,h=`M ${e.x1} ${e.y+o/2}
164
164
  h ${-n}
165
165
  v ${a*r/2}
166
- ${c}
167
- V ${s}
168
- h ${d}`,S=`${t.x2},${s}
169
- ${t.x2+5},${s+5}
170
- ${t.x2+5},${s-5}`;return[p,S]},Ft=({x:e,y:t,width:r,height:o,barCornerRadius:n,onMouseDown:a})=>l.jsx("rect",{x:e,y:t,width:r,height:o,className:"barHandle",role:"button",ry:n,rx:n,onMouseDown:a}),At=N.css`
166
+ ${l}
167
+ V ${i}
168
+ h ${d}`,x=`${t.x2},${i}
169
+ ${t.x2+5},${i+5}
170
+ ${t.x2+5},${i-5}`;return[h,x]},$t=({x:e,y:t,width:r,height:o,barCornerRadius:n,onMouseDown:a})=>c.jsx("rect",{x:e,y:t,width:r,height:o,className:"barHandle",role:"button",ry:n,rx:n,onMouseDown:a}),It=M.css`
171
171
  cursor: pointer;
172
172
  outline: none;
173
173
  .barHandle {
@@ -180,25 +180,25 @@
180
180
  visibility: visible;
181
181
  opacity: 1;
182
182
  }
183
- `,Qr=N.css`
183
+ `,eo=M.css`
184
184
  user-select: none;
185
185
  stroke-width: 0;
186
186
  opacity: 0.6;
187
- `,$t=({x:e,y:t,color:r,width:o,height:n,isSelected:a,progressX:s,progressWidth:i,barCornerRadius:c,styles:d,onMouseDown:p})=>{const S=()=>r||(a?d.progressSelectedColor:d.progressColor),$=()=>r||(a?d.backgroundSelectedColor:d.backgroundColor);return l.jsxs("g",{onMouseDown:p,children:[l.jsx("rect",{x:e,width:o,y:t,height:n,ry:c,rx:c,fill:$(),className:N.cx(Qr)}),l.jsx("rect",{x:s,width:i,y:t,height:n,ry:c,rx:c,fill:S()})]})},Vt=({progressPoint:e,onMouseDown:t})=>l.jsx("polygon",{className:"barHandle",points:e,onMouseDown:t}),_r=({task:e,isProgressChangeable:t,isDateChangeable:r,rtl:o,onEventStart:n,isSelected:a})=>{const s=bt(+!o*e.progressWidth+e.progressX,e.y,e.height),i=e.height-2;return l.jsxs("g",{className:N.cx(At),"aria-label":"task-bar",tabIndex:0,children:[l.jsx($t,{x:e.x1,y:e.y,color:e.color,width:e.x2-e.x1,height:e.height,progressX:e.progressX,progressWidth:e.progressWidth,barCornerRadius:e.barCornerRadius,styles:e.styles,isSelected:a,onMouseDown:c=>{r&&n("move",e,c)}}),l.jsxs("g",{className:"handleGroup",children:[r&&l.jsxs("g",{children:[l.jsx(Ft,{x:e.x1+1,y:e.y+1,width:e.handleWidth,height:i,barCornerRadius:e.barCornerRadius,onMouseDown:c=>{n("start",e,c)}}),l.jsx(Ft,{x:e.x2-e.handleWidth-1,y:e.y+1,width:e.handleWidth,height:i,barCornerRadius:e.barCornerRadius,onMouseDown:c=>{n("end",e,c)}})]}),t&&l.jsx(Vt,{progressPoint:s,onMouseDown:c=>{n("progress",e,c)}})]})]})},Kr=({task:e,isProgressChangeable:t,isDateChangeable:r,onEventStart:o,isSelected:n})=>{const a=bt(e.progressWidth+e.x1+10,e.y,e.height);return l.jsxs("g",{className:N.cx(At),tabIndex:0,children:[l.jsx($t,{x:e.x1,y:e.y,width:e.x2-e.x1,height:e.height,progressX:e.progressX,progressWidth:e.progressWidth,barCornerRadius:e.barCornerRadius,styles:e.styles,isSelected:n,onMouseDown:s=>{r&&o("move",e,s)}}),l.jsx("g",{className:"handleGroup",children:t&&l.jsx(Vt,{progressPoint:a,onMouseDown:s=>{o("progress",e,s)}})})]})},Jr=N.css`
187
+ `,Vt=({x:e,y:t,color:r,width:o,height:n,isSelected:a,progressX:i,progressWidth:s,barCornerRadius:l,styles:d,onMouseDown:h})=>{const x=()=>r||(a?d.progressSelectedColor:d.progressColor),I=()=>r||(a?d.backgroundSelectedColor:d.backgroundColor);return c.jsxs("g",{onMouseDown:h,children:[c.jsx("rect",{x:e,width:o,y:t,height:n,ry:l,rx:l,fill:I(),className:M.cx(eo)}),c.jsx("rect",{x:i,width:s,y:t,height:n,ry:l,rx:l,fill:x()})]})},Lt=({progressPoint:e,onMouseDown:t})=>c.jsx("polygon",{className:"barHandle",points:e,onMouseDown:t}),to=({task:e,isProgressChangeable:t,isDateChangeable:r,rtl:o,onEventStart:n,isSelected:a})=>{const i=xt(+!o*e.progressWidth+e.progressX,e.y,e.height),s=e.height-2;return c.jsxs("g",{className:M.cx(It),"aria-label":"task-bar",tabIndex:0,children:[c.jsx(Vt,{x:e.x1,y:e.y,color:e.color,width:e.x2-e.x1,height:e.height,progressX:e.progressX,progressWidth:e.progressWidth,barCornerRadius:e.barCornerRadius,styles:e.styles,isSelected:a,onMouseDown:l=>{r&&n("move",e,l)}}),c.jsxs("g",{className:"handleGroup",children:[r&&c.jsxs("g",{children:[c.jsx($t,{x:e.x1+1,y:e.y+1,width:e.handleWidth,height:s,barCornerRadius:e.barCornerRadius,onMouseDown:l=>{n("start",e,l)}}),c.jsx($t,{x:e.x2-e.handleWidth-1,y:e.y+1,width:e.handleWidth,height:s,barCornerRadius:e.barCornerRadius,onMouseDown:l=>{n("end",e,l)}})]}),t&&c.jsx(Lt,{progressPoint:i,onMouseDown:l=>{n("progress",e,l)}})]})]})},ro=({task:e,isProgressChangeable:t,isDateChangeable:r,onEventStart:o,isSelected:n})=>{const a=xt(e.progressWidth+e.x1+10,e.y,e.height);return c.jsxs("g",{className:M.cx(It),tabIndex:0,children:[c.jsx(Vt,{x:e.x1,y:e.y,width:e.x2-e.x1,height:e.height,progressX:e.progressX,progressWidth:e.progressWidth,barCornerRadius:e.barCornerRadius,styles:e.styles,isSelected:n,onMouseDown:i=>{r&&o("move",e,i)}}),c.jsx("g",{className:"handleGroup",children:t&&c.jsx(Lt,{progressPoint:a,onMouseDown:i=>{o("progress",e,i)}})})]})},oo=M.css`
188
188
  cursor: pointer;
189
189
  outline: none;
190
- `,Zr=N.css`
190
+ `,no=M.css`
191
191
  user-select: none;
192
- `,Rr=({task:e,isDateChangeable:t,onEventStart:r,isSelected:o})=>{const n=`rotate(45 ${e.x1+e.height*.356}
193
- ${e.y+e.height*.85})`,a=()=>o?e.styles.backgroundSelectedColor:e.styles.backgroundColor;return l.jsx("g",{tabIndex:0,className:N.cx(Jr),children:l.jsx("rect",{fill:a(),x:e.x1,width:e.height,y:e.y,height:e.height,rx:e.barCornerRadius,ry:e.barCornerRadius,transform:n,className:N.cx(Zr),onMouseDown:s=>{t&&r("move",e,s)}})})},eo=N.css`
192
+ `,ao=({task:e,isDateChangeable:t,onEventStart:r,isSelected:o})=>{const n=`rotate(45 ${e.x1+e.height*.356}
193
+ ${e.y+e.height*.85})`,a=()=>o?e.styles.backgroundSelectedColor:e.styles.backgroundColor;return c.jsx("g",{tabIndex:0,className:M.cx(oo),children:c.jsx("rect",{fill:a(),x:e.x1,width:e.height,y:e.y,height:e.height,rx:e.barCornerRadius,ry:e.barCornerRadius,transform:n,className:M.cx(no),onMouseDown:i=>{t&&r("move",e,i)}})})},so=M.css`
194
194
  cursor: pointer;
195
195
  outline: none;
196
- `,to=N.css`
196
+ `,io=M.css`
197
197
  user-select: none;
198
198
  opacity: 0.6;
199
- `;N.css`
199
+ `;M.css`
200
200
  user-select: none;
201
- `;const ro=({task:e,isSelected:t})=>{const r=t?e.styles.backgroundSelectedColor:e.styles.backgroundColor,o=t?e.styles.progressSelectedColor:e.styles.progressColor,n=e.x2-e.x1;return l.jsxs("g",{tabIndex:0,className:N.cx(eo),children:[l.jsx("rect",{fill:e.color||r,x:e.x1,width:n,y:e.y,height:e.height,rx:e.barCornerRadius,ry:e.barCornerRadius,className:N.cx(to)}),l.jsx("rect",{x:e.progressX,width:e.progressWidth,y:e.y,height:e.height,ry:e.barCornerRadius,rx:e.barCornerRadius,fill:e.color||o})]})},oo=Ee.createStyles(({token:e,css:t})=>({nbganttTaskitem:t`
201
+ `;const lo=({task:e,isSelected:t})=>{const r=t?e.styles.backgroundSelectedColor:e.styles.backgroundColor,o=t?e.styles.progressSelectedColor:e.styles.progressColor,n=e.x2-e.x1;return c.jsxs("g",{tabIndex:0,className:M.cx(so),children:[c.jsx("rect",{fill:e.color||r,x:e.x1,width:n,y:e.y,height:e.height,rx:e.barCornerRadius,ry:e.barCornerRadius,className:M.cx(io)}),c.jsx("rect",{x:e.progressX,width:e.progressWidth,y:e.y,height:e.height,ry:e.barCornerRadius,rx:e.barCornerRadius,fill:e.color||o})]})},co=ze.createStyles(({token:e,css:t})=>({nbganttTaskitem:t`
202
202
  .barLabel: {
203
203
  fill: ${e.colorTextLightSolid},
204
204
  textAnchor: middle,
@@ -234,11 +234,11 @@
234
234
  pointerEvents: none,
235
235
  },
236
236
  }
237
- }`})),no=e=>{const{styles:t}=oo(),{task:r,arrowIndent:o,isDelete:n,taskHeight:a,isSelected:s,rtl:i,onEventStart:c}=E({},e),d=u.useRef(null),[p,S]=u.useState(l.jsx("div",{})),[$,v]=u.useState(!0),x=r.typeInternal==="project";u.useEffect(()=>{switch(r.typeInternal){case"milestone":S(l.jsx(Rr,E({},e)));break;case"project":S(l.jsx(ro,E({},e)));break;case"smalltask":S(l.jsx(Kr,E({},e)));break;default:S(l.jsx(_r,E({},e)));break}},[r,s]),u.useEffect(()=>{d.current&&v(d.current.getBBox().width<r.x2-r.x1)},[d,r]);const P=()=>{const g=r.x2-r.x1,y=r.barChildren.length>0;return $?r.x1+g*.5:i&&d.current?r.x1-d.current.getBBox().width-o*+y-o*.2:r.x1+g+o*+y+o*.2};return l.jsxs("g",{className:N.cx(t.nbganttTaskitem),onKeyDown:g=>{switch(g.key){case"Delete":{n&&c("delete",r,g);break}}g.stopPropagation()},onMouseEnter:g=>{c("mouseenter",r,g)},onMouseLeave:g=>{c("mouseleave",r,g)},onDoubleClick:g=>{c("dblclick",r,g)},onClick:g=>{c("click",r,g)},onFocus:()=>{c("select",r)},children:[p,l.jsx("text",{x:x?r.x1:P(),y:x?r.y-8:$?r.y+a*.5:r.y+a*.65,className:x?N.cx("projectLabel"):$?N.cx("barLabel"):N.cx("barLabelOutside"),ref:d,children:x&&Ce(r.start)&&Ce(r.end)?`${r.name}: ${Ce(r.start)} ~ ${Ce(r.end)}`:r.name})]})};let at=null,Ae=null;const ao=({tasks:e,dates:t,ganttEvent:r,selectedTask:o,rowHeight:n,columnWidth:a,timeStep:s,svg:i,taskHeight:c,arrowColor:d,arrowIndent:p,fontFamily:S,fontSize:$,rtl:v,setGanttEvent:x,setFailedTask:P,setSelectedTask:g,onDateChange:y,onProgressChange:C,onDoubleClick:M,onClick:B,onDelete:b})=>{var R;const h=(R=i==null?void 0:i.current)==null?void 0:R.createSVGPoint(),[m,F]=u.useState(0),[L,Q]=u.useState(0),[se,pe]=u.useState(!1);u.useEffect(()=>{var Y,U,X,ee;const A=((Y=t[1])==null?void 0:Y.getTime())-((U=t[0])==null?void 0:U.getTime())-((X=t[1])==null?void 0:X.getTimezoneOffset())*60*1e3+((ee=t[0])==null?void 0:ee.getTimezoneOffset())*60*1e3,H=s*a/A;F(H)},[a,t,s]),u.useEffect(()=>{const A=Y=>ne(this,null,function*(){var ge;if(!r.changedTask||!h||!(i!=null&&i.current))return;Y.preventDefault(),h.x=Y.clientX;const U=h.matrixTransform((ge=i==null?void 0:i.current.getScreenCTM())==null?void 0:ge.inverse()),{isChanged:X,changedTask:ee}=xt(U.x,r.action,r.changedTask,m,s,L,v);X&&x({action:r.action,changedTask:ee})}),H=Y=>ne(this,null,function*(){var je;const{action:U,originalSelectedTask:X,changedTask:ee}=r;if(!ee||!h||!(i!=null&&i.current)||!X)return;Y.preventDefault(),h.x=Y.clientX;const ge=h.matrixTransform((je=i==null?void 0:i.current.getScreenCTM())==null?void 0:je.inverse()),{changedTask:q}=xt(ge.x,U,ee,m,s,L,v),Be=X.start!==q.start||X.end!==q.end||X.progress!==q.progress;i.current.removeEventListener("mousemove",A),i.current.removeEventListener("mouseup",H),x({action:""}),pe(!1);let ie=!0;if((U==="move"||U==="end"||U==="start")&&y&&Be)try{const te=yield y(q,q.barChildren);te!==void 0&&(ie=te)}catch(te){ie=!1}else if(C&&Be)try{const te=yield C(q,q.barChildren);te!==void 0&&(ie=te)}catch(te){ie=!1}ie||P(X)});!se&&(r.action==="move"||r.action==="end"||r.action==="start"||r.action==="progress")&&(i!=null&&i.current)&&(i.current.addEventListener("mousemove",A),i.current.addEventListener("mouseup",H),pe(!0))},[r,m,L,C,s,y,i,se,h,v,P,x]);const Me=(A,H,Y)=>ne(this,null,function*(){var U;if(!Y)A==="select"&&g(H.id);else if(yr(Y)){if(A==="delete"&&b)try{const X=yield b(H);X!==void 0&&X&&x({action:A,changedTask:H})}catch(X){console.error("Error on Delete. "+X)}}else if(A==="mouseenter")r.action||x({action:A,changedTask:H,originalSelectedTask:H});else if(A==="mouseleave")r.action==="mouseenter"&&setTimeout(()=>{x({action:""})},300);else if(A==="dblclick")M&&M(H);else if(A==="click")B&&B(H);else if(A==="move"){if(!(i!=null&&i.current)||!h)return;h.x=Y.clientX;const X=h.matrixTransform((U=i.current.getScreenCTM())==null?void 0:U.inverse());Q(X.x-H.x1),x({action:A,changedTask:H,originalSelectedTask:H})}else x({action:A,changedTask:H,originalSelectedTask:H})}),st=(A,H,Y)=>{["click"].includes(A)?(!["start","end","progress"].includes(at)&&(!Ae||Ae===H.start)&&Me(A,H,Y),at=null,Ae=null):["move","select"].includes(A)?(Ae=H.start,Me(A,H,Y)):(Ae=H.start,at=A,Me(A,H,Y))};return l.jsxs("g",{className:"content",children:[l.jsx("g",{className:"arrows",fill:d,stroke:d,children:e.map(A=>A.barChildren.map(H=>l.jsx(qr,{taskFrom:A,taskTo:e[H.index],rowHeight:n,taskHeight:c,arrowIndent:p,rtl:v},`Arrow from ${A.id} to ${e[H.index].id}`)))}),l.jsx("g",{className:"bar",fontFamily:S,fontSize:$,children:e.map(A=>l.jsx(no,{task:A,arrowIndent:p,taskHeight:c,isProgressChangeable:!!C&&!A.isDisabled,isDateChangeable:!!y&&!A.isDisabled,isDelete:!A.isDisabled,onEventStart:st,isSelected:!!o&&A.id===o.id,rtl:v},A.id))})]})},so=u.forwardRef(({gridProps:e,calendarProps:t,barProps:r,ganttHeight:o,scrollY:n,scrollX:a},s)=>{const i=u.useRef(null),c=u.useRef(null),d=ue(E({},r),{svg:i}),{styles:p}=Tt();return u.useEffect(()=>{c.current&&(c.current.scrollTop=n)},[n]),u.useEffect(()=>{s.current&&(s.current.scrollLeft=a)},[a]),l.jsxs("div",{className:p.ganttverticalcontainer,ref:s,dir:"ltr",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.svgWidth,height:t.headerHeight,fontFamily:r.fontFamily,className:"ganttHeader",children:l.jsx(Or,E({},t))}),l.jsx("div",{ref:c,className:p.horizontalcontainer,style:o?{maxHeight:o,width:e.svgWidth}:{width:e.svgWidth},children:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.svgWidth,height:r.rowHeight*(r.tasks.length||3),fontFamily:r.fontFamily,ref:i,className:"ganttBody",children:[l.jsx(jr,E({},e)),l.jsx(ao,E({},d))]})})]})}),io=(e,t)=>t/e>50?Math.floor(t/e)+20:50,lo=u.createContext({close:()=>{}}),co=e=>{const{visible:t,setVisible:r,record:o}=e;u.useMemo(()=>Je.createForm(),[o]);const a=O.useFieldSchema().properties.detail,s=u.useCallback(()=>{r(!1)},[]);return a&&l.jsx(lo.Provider,{value:{close:s},children:l.jsx(f.ActionContextProvider,{value:{visible:t,setVisible:r},children:l.jsx(f.RecordProvider,{record:o,children:l.jsx(O.RecursionField,{schema:a,name:a.name})})})})},uo=Z.debounce((e,t,r,o,n)=>ne(this,null,function*(){yield t.update({filterByTk:e.id,values:{[r.start]:e.start,[r.end]:e.end}}),we.message.success(n("Saved successfully")),yield o==null?void 0:o.refresh()}),300),fo=Z.debounce((e,t,r,o,n)=>ne(this,null,function*(){yield t.update({filterByTk:e.id,values:{[r.progress]:e.progress/100}}),we.message.success(n("Saved successfully")),yield o==null?void 0:o.refresh()}),300),Te=e=>{var Wt,Qt,_t;const{styles:t}=Tt(),{token:r}=f.useToken(),a=f.useAPIClient().auth.getOption("theme")==="compact"?45:55.56,{headerHeight:s=((Wt=document.querySelector(".ant-table-thead"))==null?void 0:Wt.clientHeight)||0,listCellWidth:i="155px",rowHeight:c=a,ganttHeight:d=0,preStepsCount:p=1,barFill:S=60,barCornerRadius:$=r.borderRadiusXS,barProgressColor:v=r.colorPrimary,barProgressSelectedColor:x=r.colorPrimary,barBackgroundColor:P=r.colorPrimary,barBackgroundSelectedColor:g=r.colorPrimary,projectProgressColor:y=r.colorPrimary,projectProgressSelectedColor:C=r.colorPrimary,projectBackgroundColor:M=r.colorPrimary,projectBackgroundSelectedColor:B=r.colorPrimary,milestoneBackgroundColor:b="#f1c453",milestoneBackgroundSelectedColor:h="#f29e4c",rtl:m=!1,handleWidth:F=8,timeStep:L=3e5,arrowColor:Q="grey",fontFamily:se="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",fontSize:pe=r.fontSize,arrowIndent:Me=20,todayColor:st="rgba(252, 248, 227, 0.5)",viewDate:R,TooltipContent:A=Tr,onDoubleClick:H,onClick:Y,onDelete:U,onSelect:X,useProps:ee}=e,{onExpanderClick:ge,tasks:q,expandAndCollapseAll:Be}=ee(),ie=fe(),je=f.useCurrentAppInfo(),{t:te}=me.useTranslation(),yo=(Qt=je.data)==null?void 0:Qt.lang,it=f.useTableBlockContext(),{resource:Ht,service:Ve}=f.useBlockRequestContext(),Et=O.useFieldSchema(),{fieldNames:qe}=ee(e),re=qe.range||"day",Se=u.useRef(null),lt=u.useRef(null),zt=u.useRef(null),[le,vo]=u.useState(()=>{const[w,I]=vt(q,re,p);return{viewMode:re,dates:St(w,I,re)}}),[So,Gt]=u.useState(!1),[wo,Co]=u.useState({}),[Ie,Ot]=u.useState(void 0),[Ue,Xt]=u.useState(0),[To,Mo]=u.useState(0),[Bo,kt]=u.useState(d),[oe,We]=u.useState([]),[Le,Yt]=u.useState({action:""}),ct=u.useMemo(()=>c*S/100,[c,S]),[dt,Do]=u.useState(),[Qe,jt]=u.useState(null),[be,ut]=u.useState(0),[ce,He]=u.useState(-1),[qt,De]=u.useState(!1),J=io(le.dates.length,(_t=zt.current)==null?void 0:_t.clientWidth),de=le.dates.length*J,Ne=oe.length*c,{expandFlag:Ut}=it,[No,Po]=u.useState([]);u.useEffect(()=>{it.field.onExpandClick=Io,it.field.onRowSelect=Lo},[]),u.useEffect(()=>{Be==null||Be(!Ut)},[Ut]),u.useEffect(()=>{let w;ge?w=vr(q):w=q,w=w.sort(Sr);const[I,D]=vt(w,re,p);let V=St(I,D,re);m&&(V=V.reverse(),ce===-1&&He(V.length*J)),vo({dates:V,viewMode:re}),We(ir(w,V,J,c,ct,$,F,m,v,x,P,g,y,C,M,B,b,h))},[q,re,p,c,$,J,ct,F,v,x,P,g,y,C,M,B,b,h,m,ce]),u.useEffect(()=>{if(re===le.viewMode&&(R&&!Ie||R&&(Ie==null?void 0:Ie.valueOf())!==R.valueOf())){const w=le.dates,I=w.findIndex((D,V)=>R.valueOf()>=D.valueOf()&&V+1!==w.length&&R.valueOf()<w[V+1].valueOf());if(I===-1)return;Ot(R),He(J*I)}},[R,J,le.dates,le.viewMode,re,Ie,Ot]),u.useEffect(()=>{const{changedTask:w,action:I}=Le;if(w){if(I==="delete")Yt({action:""}),We(oe.filter(D=>D.id!==w.id));else if(I==="move"||I==="end"||I==="start"||I==="progress"){const D=oe.find(V=>V.id===w.id);if(D&&D.start&&D.end&&(D.start.getTime()!==w.start.getTime()||D.end.getTime()!==w.end.getTime()||D.progress!==w.progress)){const V=oe.map(_=>_.id===w.id?w:_);We(V)}}}},[Le,oe]),u.useEffect(()=>{Qe&&(We(oe.map(w=>w.id!==Qe.id?w:Qe)),jt(null))},[Qe,oe]),u.useEffect(()=>{i||Xt(0),lt.current&&Xt(lt.current.offsetWidth)},[lt,i]),u.useEffect(()=>{Se.current&&Mo(Se.current.offsetWidth-Ue)},[Se,Ue]),u.useEffect(()=>{kt(d?d+s:q.length*c+s)},[d,q,s,c]),u.useEffect(()=>{var I;const w=D=>{if(D.shiftKey||D.deltaX){const V=D.deltaX?D.deltaX:D.deltaY;let _=ce+V;_<0?_=0:_>de&&(_=de),He(_),D.preventDefault()}else if(d){let V=be+D.deltaY;V<0?V=0:V>Ne-d&&(V=Ne-d),V!==be&&(ut(V),D.preventDefault())}De(!0)};return(I=Se.current)==null||I.addEventListener("wheel",w,{passive:!1}),()=>{var D;(D=Se.current)==null||D.removeEventListener("wheel",w)}},[Se,be,ce,d,de,m,Ne]);const Fo=w=>{be!==w.currentTarget.scrollTop&&!qt?(ut(w.currentTarget.scrollTop),De(!0)):De(!1)},Ao=w=>{ce!==w.currentTarget.scrollLeft&&!qt?(He(w.currentTarget.scrollLeft),De(!0)):De(!1)},$o=w=>{w.preventDefault();let I=be,D=ce,V=!0;switch(w.key){case"Down":case"ArrowDown":I+=c,V=!1;break;case"Up":case"ArrowUp":I-=c,V=!1;break;case"Left":case"ArrowLeft":D-=J;break;case"Right":case"ArrowRight":D+=J;break}V?(D<0?D=0:D>de&&(D=de),He(D)):(I<0?I=0:I>Ne-d&&(I=Ne-d),ut(I)),De(!0)},Vo=w=>{const I=oe.find(V=>V.id===w),D=oe.find(V=>!!dt&&V.id===dt.id);X&&(D&&X(D,!1),I&&X(I,!0)),Do(I)},Io=(w,I)=>{var V;const D=(V=ie==null?void 0:ie.field)==null?void 0:V.data.find(_=>_.id===I.id+"");ge&&I.children.length&&ge(ue(E({},D),{hideChildren:!w}))},Lo=w=>{Po(w)},Ho=w=>ne(this,null,function*(){fo(w,Ht,qe,Ve,te)}),Eo=w=>ne(this,null,function*(){uo(w,Ht,qe,Ve,te)}),zo=w=>{var _;const I=ft=>ft.reduce((Kt,_e)=>_e.children?Kt.concat([_e,...I(_e.children)]):Kt.concat(_e),[]),D=I((_=Ve==null?void 0:Ve.data)==null?void 0:_.data),V=D==null?void 0:D.find(ft=>ft.id===+w.id);V&&(Co(V),Gt(!0))},Go={columnWidth:J,svgWidth:de,tasks:q,rowHeight:c,dates:le.dates,todayColor:st,rtl:m,selectedRowKeys:No},Oo={dateSetup:le,locale:yo,viewMode:re,headerHeight:s,columnWidth:J,fontFamily:se,fontSize:pe,rtl:m},Xo={tasks:oe,dates:le.dates,ganttEvent:Le,selectedTask:dt,rowHeight:c,taskHeight:ct,columnWidth:J,arrowColor:Q,timeStep:L,fontFamily:se,fontSize:pe,arrowIndent:Me,svgWidth:de,rtl:m,setGanttEvent:Yt,setFailedTask:jt,setSelectedTask:Vo,onDateChange:Eo,onProgressChange:qe.progress&&Ho,onDoubleClick:H,onClick:zo,onDelete:U};return l.jsxs("div",{className:N.cx(N.css`
237
+ }`})),uo=e=>{const{styles:t}=co(),{task:r,arrowIndent:o,isDelete:n,taskHeight:a,isSelected:i,rtl:s,onEventStart:l}=z({},e),d=f.useRef(null),[h,x]=f.useState(c.jsx("div",{})),[I,S]=f.useState(!0),y=r.typeInternal==="project";f.useEffect(()=>{switch(r.typeInternal){case"milestone":x(c.jsx(ao,z({},e)));break;case"project":x(c.jsx(lo,z({},e)));break;case"smalltask":x(c.jsx(ro,z({},e)));break;default:x(c.jsx(to,z({},e)));break}},[r,i]),f.useEffect(()=>{d.current&&S(d.current.getBBox().width<r.x2-r.x1)},[d,r]);const B=()=>{const g=r.x2-r.x1,v=r.barChildren.length>0;return I?r.x1+g*.5:s&&d.current?r.x1-d.current.getBBox().width-o*+v-o*.2:r.x1+g+o*+v+o*.2};return c.jsxs("g",{className:M.cx(t.nbganttTaskitem),onKeyDown:g=>{switch(g.key){case"Delete":{n&&l("delete",r,g);break}}g.stopPropagation()},onMouseEnter:g=>{l("mouseenter",r,g)},onMouseLeave:g=>{l("mouseleave",r,g)},onDoubleClick:g=>{l("dblclick",r,g)},onClick:g=>{l("click",r,g)},onFocus:()=>{l("select",r)},children:[h,c.jsx("text",{x:y?r.x1:B(),y:y?r.y-8:I?r.y+a*.5:r.y+a*.65,className:y?M.cx("projectLabel"):I?M.cx("barLabel"):M.cx("barLabelOutside"),ref:d,children:y&&Ce(r.start)&&Ce(r.end)?`${r.name}: ${Ce(r.start)} ~ ${Ce(r.end)}`:r.name})]})};let at=null,Ie=null;const fo=({tasks:e,dates:t,ganttEvent:r,selectedTask:o,rowHeight:n,columnWidth:a,timeStep:i,svg:s,taskHeight:l,arrowColor:d,arrowIndent:h,fontFamily:x,fontSize:I,rtl:S,setGanttEvent:y,setFailedTask:B,setSelectedTask:g,onDateChange:v,onProgressChange:C,onDoubleClick:T,onClick:D,onDelete:m})=>{var ee;const p=(ee=s==null?void 0:s.current)==null?void 0:ee.createSVGPoint(),[b,F]=f.useState(0),[H,Q]=f.useState(0),[ce,me]=f.useState(!1);f.useEffect(()=>{var Y,U,O,te;const $=((Y=t[1])==null?void 0:Y.getTime())-((U=t[0])==null?void 0:U.getTime())-((O=t[1])==null?void 0:O.getTimezoneOffset())*60*1e3+((te=t[0])==null?void 0:te.getTimezoneOffset())*60*1e3,E=i*a/$;F(E)},[a,t,i]),f.useEffect(()=>{const $=Y=>se(this,null,function*(){var be;if(!r.changedTask||!p||!(s!=null&&s.current))return;Y.preventDefault(),p.x=Y.clientX;const U=p.matrixTransform((be=s==null?void 0:s.current.getScreenCTM())==null?void 0:be.inverse()),{isChanged:O,changedTask:te}=vt(U.x,r.action,r.changedTask,b,i,H,S);O&&y({action:r.action,changedTask:te})}),E=Y=>se(this,null,function*(){var je;const{action:U,originalSelectedTask:O,changedTask:te}=r;if(!te||!p||!(s!=null&&s.current)||!O)return;Y.preventDefault(),p.x=Y.clientX;const be=p.matrixTransform((je=s==null?void 0:s.current.getScreenCTM())==null?void 0:je.inverse()),{changedTask:q}=vt(be.x,U,te,b,i,H,S),Me=O.start!==q.start||O.end!==q.end||O.progress!==q.progress;s.current.removeEventListener("mousemove",$),s.current.removeEventListener("mouseup",E),y({action:""}),me(!1);let de=!0;if((U==="move"||U==="end"||U==="start")&&v&&Me)try{const re=yield v(q,q.barChildren);re!==void 0&&(de=re)}catch(re){de=!1}else if(C&&Me)try{const re=yield C(q,q.barChildren);re!==void 0&&(de=re)}catch(re){de=!1}de||B(O)});!ce&&(r.action==="move"||r.action==="end"||r.action==="start"||r.action==="progress")&&(s!=null&&s.current)&&(s.current.addEventListener("mousemove",$),s.current.addEventListener("mouseup",E),me(!0))},[r,b,H,C,i,v,s,ce,p,S,B,y]);const Ne=($,E,Y)=>se(this,null,function*(){var U;if(!Y)$==="select"&&g(E.id);else if(Nr(Y)){if($==="delete"&&m)try{const O=yield m(E);O!==void 0&&O&&y({action:$,changedTask:E})}catch(O){console.error("Error on Delete. "+O)}}else if($==="mouseenter")r.action||y({action:$,changedTask:E,originalSelectedTask:E});else if($==="mouseleave")r.action==="mouseenter"&&setTimeout(()=>{y({action:""})},300);else if($==="dblclick")T&&T(E);else if($==="click")D&&D(E);else if($==="move"){if(!(s!=null&&s.current)||!p)return;p.x=Y.clientX;const O=p.matrixTransform((U=s.current.getScreenCTM())==null?void 0:U.inverse());Q(O.x-E.x1),y({action:$,changedTask:E,originalSelectedTask:E})}else y({action:$,changedTask:E,originalSelectedTask:E})}),st=($,E,Y)=>{["click"].includes($)?(!["start","end","progress"].includes(at)&&(!Ie||Ie===E.start)&&Ne($,E,Y),at=null,Ie=null):["move","select"].includes($)?(Ie=E.start,Ne($,E,Y)):(Ie=E.start,at=$,Ne($,E,Y))};return c.jsxs("g",{className:"content",children:[c.jsx("g",{className:"arrows",fill:d,stroke:d,children:e.map($=>$.barChildren.map(E=>c.jsx(Jr,{taskFrom:$,taskTo:e[E.index],rowHeight:n,taskHeight:l,arrowIndent:h,rtl:S},`Arrow from ${$.id} to ${e[E.index].id}`)))}),c.jsx("g",{className:"bar",fontFamily:x,fontSize:I,children:e.map($=>c.jsx(uo,{task:$,arrowIndent:h,taskHeight:l,isProgressChangeable:!!C&&!$.isDisabled,isDateChangeable:!!v&&!$.isDisabled,isDelete:!$.isDisabled,onEventStart:st,isSelected:!!o&&$.id===o.id,rtl:S},$.id))})]})},ho=f.forwardRef(({gridProps:e,calendarProps:t,barProps:r,ganttHeight:o,scrollY:n,scrollX:a},i)=>{const s=f.useRef(null),l=f.useRef(null),d=ae(z({},r),{svg:s}),{styles:h}=Mt();return f.useEffect(()=>{l.current&&(l.current.scrollTop=n)},[n]),f.useEffect(()=>{i.current&&(i.current.scrollLeft=a)},[a]),c.jsxs("div",{className:h.ganttverticalcontainer,ref:i,dir:"ltr",children:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.svgWidth,height:t.headerHeight,fontFamily:r.fontFamily,className:"ganttHeader",children:c.jsx(Wr,z({},t))}),c.jsx("div",{ref:l,className:h.horizontalcontainer,style:o?{maxHeight:o,width:e.svgWidth}:{width:e.svgWidth},children:c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.svgWidth,height:r.rowHeight*(r.tasks.length||3),fontFamily:r.fontFamily,ref:s,className:"ganttBody",children:[c.jsx(Kr,z({},e)),c.jsx(fo,z({},d))]})})]})}),po=(e,t)=>t/e>50?Math.floor(t/e)+20:50,go=f.createContext({close:()=>{}}),mo=e=>{const{visible:t,setVisible:r,record:o}=e,n=u.useCollectionParentRecordData(),i=A.useFieldSchema().properties.detail,s=f.useCallback(()=>{r(!1)},[]);return i&&c.jsx(go.Provider,{value:{close:s},children:c.jsx(u.ActionContextProvider,{value:{visible:t,setVisible:r},children:c.jsx(u.RecordProvider,{record:o,parent:n,children:c.jsx(A.RecursionField,{schema:i,name:i.name})})})})},bo=pt.debounce((e,t,r,o,n)=>se(this,null,function*(){yield t.update({filterByTk:e.id,values:{[r.start]:e.start,[r.end]:e.end}}),ht.message.success(n("Saved successfully")),yield o==null?void 0:o.refresh()}),300),xo=pt.debounce((e,t,r,o,n)=>se(this,null,function*(){yield t.update({filterByTk:e.id,values:{[r.progress]:e.progress/100}}),ht.message.success(n("Saved successfully")),yield o==null?void 0:o.refresh()}),300),Te=e=>{var Qt,Kt,Jt;const{styles:t}=Mt(),{token:r}=u.useToken(),a=u.useAPIClient().auth.getOption("theme")==="compact"?45:55.56,{headerHeight:i=((Qt=document.querySelector(".ant-table-thead"))==null?void 0:Qt.clientHeight)||0,listCellWidth:s="155px",rowHeight:l=a,ganttHeight:d=0,preStepsCount:h=1,barFill:x=60,barCornerRadius:I=r.borderRadiusXS,barProgressColor:S=r.colorPrimary,barProgressSelectedColor:y=r.colorPrimary,barBackgroundColor:B=r.colorPrimary,barBackgroundSelectedColor:g=r.colorPrimary,projectProgressColor:v=r.colorPrimary,projectProgressSelectedColor:C=r.colorPrimary,projectBackgroundColor:T=r.colorPrimary,projectBackgroundSelectedColor:D=r.colorPrimary,milestoneBackgroundColor:m="#f1c453",milestoneBackgroundSelectedColor:p="#f29e4c",rtl:b=!1,handleWidth:F=8,timeStep:H=3e5,arrowColor:Q="grey",fontFamily:ce="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",fontSize:me=r.fontSize,arrowIndent:Ne=20,todayColor:st="rgba(252, 248, 227, 0.5)",viewDate:ee,TooltipContent:$=Fr,onDoubleClick:E,onClick:Y,onDelete:U,onSelect:O,useProps:te}=e,{onExpanderClick:be,tasks:q,expandAndCollapseAll:Me}=te(),de=W(),je=u.useCurrentAppInfo(),{t:re}=Be.useTranslation(),yo=(Kt=je.data)==null?void 0:Kt.lang,it=u.useTableBlockContext(),{resource:zt,service:Ve}=u.useBlockRequestContext(),Gt=A.useFieldSchema(),{fieldNames:qe}=te(e),oe=qe.range||"day",we=f.useRef(null),lt=f.useRef(null),kt=f.useRef(null),[ue,vo]=f.useState(()=>{const[w,L]=wt(q,oe,h);return{viewMode:oe,dates:Ct(w,L,oe)}}),[So,Ot]=f.useState(!1),[wo,Co]=f.useState({}),[Le,Xt]=f.useState(void 0),[We,Yt]=f.useState(0),[To,No]=f.useState(0),[Mo,jt]=f.useState(d),[ne,Ue]=f.useState([]),[He,qt]=f.useState({action:""}),ct=f.useMemo(()=>l*x/100,[l,x]),[dt,Do]=f.useState(),[_e,Wt]=f.useState(null),[xe,ut]=f.useState(0),[fe,Ee]=f.useState(-1),[Ut,De]=f.useState(!1),Z=po(ue.dates.length,(Jt=kt.current)==null?void 0:Jt.clientWidth),he=ue.dates.length*Z,Pe=ne.length*l,{expandFlag:_t}=it,[Po,Bo]=f.useState([]);f.useEffect(()=>{it.field.onExpandClick=Vo,it.field.onRowSelect=Lo},[]),f.useEffect(()=>{Me==null||Me(!_t)},[_t]),f.useEffect(()=>{let w;be?w=Mr(q):w=q,w=w.sort(Dr);const[L,P]=wt(w,oe,h);let V=Ct(L,P,oe);b&&(V=V.reverse(),fe===-1&&Ee(V.length*Z)),vo({dates:V,viewMode:oe}),Ue(hr(w,V,Z,l,ct,I,F,b,S,y,B,g,v,C,T,D,m,p))},[q,oe,h,l,I,Z,ct,F,S,y,B,g,v,C,T,D,m,p,b,fe]),f.useEffect(()=>{if(oe===ue.viewMode&&(ee&&!Le||ee&&(Le==null?void 0:Le.valueOf())!==ee.valueOf())){const w=ue.dates,L=w.findIndex((P,V)=>ee.valueOf()>=P.valueOf()&&V+1!==w.length&&ee.valueOf()<w[V+1].valueOf());if(L===-1)return;Xt(ee),Ee(Z*L)}},[ee,Z,ue.dates,ue.viewMode,oe,Le,Xt]),f.useEffect(()=>{const{changedTask:w,action:L}=He;if(w){if(L==="delete")qt({action:""}),Ue(ne.filter(P=>P.id!==w.id));else if(L==="move"||L==="end"||L==="start"||L==="progress"){const P=ne.find(V=>V.id===w.id);if(P&&P.start&&P.end&&(P.start.getTime()!==w.start.getTime()||P.end.getTime()!==w.end.getTime()||P.progress!==w.progress)){const V=ne.map(K=>K.id===w.id?w:K);Ue(V)}}}},[He,ne]),f.useEffect(()=>{_e&&(Ue(ne.map(w=>w.id!==_e.id?w:_e)),Wt(null))},[_e,ne]),f.useEffect(()=>{s||Yt(0),lt.current&&Yt(lt.current.offsetWidth)},[lt,s]),f.useEffect(()=>{we.current&&No(we.current.offsetWidth-We)},[we,We]),f.useEffect(()=>{jt(d?d+i:q.length*l+i)},[d,q,i,l]),f.useEffect(()=>{var L;const w=P=>{if(P.shiftKey||P.deltaX){const V=P.deltaX?P.deltaX:P.deltaY;let K=fe+V;K<0?K=0:K>he&&(K=he),Ee(K),P.preventDefault()}else if(d){let V=xe+P.deltaY;V<0?V=0:V>Pe-d&&(V=Pe-d),V!==xe&&(ut(V),P.preventDefault())}De(!0)};return(L=we.current)==null||L.addEventListener("wheel",w,{passive:!1}),()=>{var P;(P=we.current)==null||P.removeEventListener("wheel",w)}},[we,xe,fe,d,he,b,Pe]);const Fo=w=>{xe!==w.currentTarget.scrollTop&&!Ut?(ut(w.currentTarget.scrollTop),De(!0)):De(!1)},Ao=w=>{fe!==w.currentTarget.scrollLeft&&!Ut?(Ee(w.currentTarget.scrollLeft),De(!0)):De(!1)},$o=w=>{w.preventDefault();let L=xe,P=fe,V=!0;switch(w.key){case"Down":case"ArrowDown":L+=l,V=!1;break;case"Up":case"ArrowUp":L-=l,V=!1;break;case"Left":case"ArrowLeft":P-=Z;break;case"Right":case"ArrowRight":P+=Z;break}V?(P<0?P=0:P>he&&(P=he),Ee(P)):(L<0?L=0:L>Pe-d&&(L=Pe-d),ut(L)),De(!0)},Io=w=>{const L=ne.find(V=>V.id===w),P=ne.find(V=>!!dt&&V.id===dt.id);O&&(P&&O(P,!1),L&&O(L,!0)),Do(L)},Vo=(w,L)=>{var V;const P=(V=de==null?void 0:de.field)==null?void 0:V.data.find(K=>K.id===L.id+"");be&&L.children.length&&be(ae(z({},P),{hideChildren:!w}))},Lo=w=>{Bo(w)},Ho=w=>se(this,null,function*(){xo(w,zt,qe,Ve,re)}),Eo=w=>se(this,null,function*(){bo(w,zt,qe,Ve,re)}),zo=w=>{var K;const L=ft=>ft.reduce((Zt,Qe)=>Qe.children?Zt.concat([Qe,...L(Qe.children)]):Zt.concat(Qe),[]),P=L((K=Ve==null?void 0:Ve.data)==null?void 0:K.data),V=P==null?void 0:P.find(ft=>ft.id===+w.id);V&&(Co(V),Ot(!0))},Go={columnWidth:Z,svgWidth:he,tasks:q,rowHeight:l,dates:ue.dates,todayColor:st,rtl:b,selectedRowKeys:Po},ko={dateSetup:ue,locale:yo,viewMode:oe,headerHeight:i,columnWidth:Z,fontFamily:ce,fontSize:me,rtl:b},Oo={tasks:ne,dates:ue.dates,ganttEvent:He,selectedTask:dt,rowHeight:l,taskHeight:ct,columnWidth:Z,arrowColor:Q,timeStep:H,fontFamily:ce,fontSize:me,arrowIndent:Ne,svgWidth:he,rtl:b,setGanttEvent:qt,setFailedTask:Wt,setSelectedTask:Io,onDateChange:Eo,onProgressChange:qe.progress&&Ho,onDoubleClick:E,onClick:zo,onDelete:U};return c.jsxs("div",{className:M.cx(M.css`
238
238
  .ant-table-container::after {
239
239
  box-shadow: none !important;
240
240
  }
241
241
  .ant-table-row {
242
242
  height: ${a}px;
243
243
  }
244
- `),children:[l.jsx(co,{visible:So,setVisible:Gt,record:wo}),l.jsx(O.RecursionField,{name:"anctionBar",schema:Et.properties.toolBar}),l.jsx(O.RecursionField,{name:"table",schema:Et.properties.table}),l.jsxs("div",{className:t.wrapper,onKeyDown:$o,tabIndex:0,ref:Se,children:[l.jsx(so,{gridProps:Go,calendarProps:Oo,barProps:Xo,ganttHeight:d,scrollY:be,scrollX:ce,ref:zt}),Le.changedTask&&l.jsx(Cr,{arrowIndent:Me,rowHeight:c,svgContainerHeight:Bo,svgContainerWidth:To,fontFamily:se,fontSize:pe,scrollX:ce,scrollY:be,task:Le.changedTask,headerHeight:s,taskListWidth:Ue,TooltipContent:A,rtl:m,svgWidth:de}),l.jsx(Mr,{ganttFullHeight:Ne,ganttHeight:d,headerHeight:s,scroll:be,onScroll:Fo,rtl:m}),l.jsx(wr,{svgWidth:de,taskListWidth:Ue,scroll:ce,rtl:m,onScroll:Ao})]})]})},ho=()=>{const{name:e,title:t}=f.useCollection(),r=f.useSchemaTemplate();return l.jsx(f.GeneralSchemaDesigner,{schemaSettings:"GanttBlockSettings",template:r,title:t||e})},po=O.observer(e=>l.jsx(l.Fragment,{children:e.children}),{displayName:"Event"}),go=new f.SchemaInitializer({name:"GanttActionInitializers",title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"itemGroup",name:"enableActions",title:"{{t('Enable actions')}}",children:[{type:"item",name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{type:"item",title:"{{t('Add new')}}",name:"addNew",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){const e=f.useCollection();return!["view","file","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"item",title:"{{t('Delete')}}",name:"delete",Component:"BulkDestroyActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider"},useVisible(){const e=f.useCollection();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"item",title:"{{t('Refresh')}}",name:"refresh",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"toggle",title:"{{t('Expand/Collapse')}}",Component:"ExpandActionInitializer",schema:{"x-align":"right"},useVisible(){var o;const e=O.useFieldSchema(),t=f.useCollection(),{treeTable:r}=((o=e==null?void 0:e.parent)==null?void 0:o["x-decorator-props"])||{};return t.tree&&r!==!1}}]},{name:"divider",type:"divider",useVisible(){const e=f.useCollection();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"subMenu",name:"customize",title:'{{t("Customize")}}',children:[{type:"item",title:'{{t("Add record")}}',name:"addRecord",Component:"CustomizeAddRecordActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action":"create","x-acl-action-props":{skipScopeCheck:!0}}}],useVisible(){const e=f.useCollection();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}}]}),$e=()=>me.useTranslation("gantt"),Ye=(e="string")=>{var n;const t=f.useCompile(),{fields:r}=f.useCollection();return(n=r==null?void 0:r.filter(a=>a.type===e))==null?void 0:n.map(a=>{var s;return{value:a.name,label:t((s=a==null?void 0:a.uiSchema)==null?void 0:s.title)}})},bo=e=>{const s=e,{collection:t,resource:r,fieldNames:o}=s,n=er(s,["collection","resource","fieldNames"]);return{type:"void","x-acl-action":`${r||t}:list`,"x-decorator":"GanttBlockProvider","x-decorator-props":E({collection:t,resource:r||t,action:"list",fieldNames:E({id:"id"},o),params:{paginate:!1}},n),"x-designer":"Gantt.Designer","x-component":"CardItem",properties:{[or.uid()]:{type:"void","x-component":"Gantt","x-component-props":{useProps:"{{ useGanttBlockProps }}"},properties:{toolBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},"x-initializer":"GanttActionInitializers",properties:{}},table:{type:"array","x-decorator":"div","x-decorator-props":{style:{float:"left",maxWidth:"35%"}},"x-initializer":"TableColumnInitializers","x-component":"TableV2","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useProps:"{{ useTableBlockProps }}",pagination:!1},properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-designer":"TableV2.ActionColumnDesigner","x-initializer":"TableActionColumnInitializers",properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"},properties:{}}}}}},detail:{type:"void","x-component":"Gantt.Event",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{className:"nb-action-popup"},title:'{{ t("View record") }}',properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"TabPaneInitializers",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"RecordBlockInitializers",properties:{}}}}}}}}}}}}}}},mo=()=>{const{insert:e}=f.useSchemaInitializer(),{t}=me.useTranslation(),{getCollectionFields:r}=f.useCollectionManager(),o=u.useContext(O.SchemaOptionsContext),{theme:n}=f.useGlobalTheme(),a=f.useSchemaInitializerItem();return l.jsx(f.DataBlockInitializer,ue(E({},a),{componentType:"Gantt",icon:l.jsx(tr.FormOutlined,{}),onCreateBlockSchema:i=>ne(this,[i],function*({item:s}){var v,x,P;const c=r(s.name),d=(v=c==null?void 0:c.filter(g=>g.type==="string"))==null?void 0:v.map(g=>{var y;return{label:(y=g==null?void 0:g.uiSchema)==null?void 0:y.title,value:g.name}}),p=(x=c==null?void 0:c.filter(g=>g.type==="date"))==null?void 0:x.map(g=>{var y;return{label:(y=g==null?void 0:g.uiSchema)==null?void 0:y.title,value:g.name}}),S=(P=c==null?void 0:c.filter(g=>g.type==="float"))==null?void 0:P.map(g=>{var y;return{label:(y=g==null?void 0:g.uiSchema)==null?void 0:y.title,value:g.name}}),$=yield f.FormDialog(t("Create gantt block"),()=>l.jsx(f.SchemaComponentOptions,{scope:o.scope,components:E({},o.components),children:l.jsx(rr.FormLayout,{layout:"vertical",children:l.jsx(f.SchemaComponent,{schema:{properties:{title:{title:t("Title field"),enum:d,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:t("Start date field"),enum:p,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:t("End date field"),enum:p,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:t("Progress field"),enum:S,"x-component":"Select","x-decorator":"FormItem"},range:{title:t("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})})}),n).open({initialValues:{}});e(bo({collection:s.name,fieldNames:E({},$)}))})}))},xo=new f.SchemaSettings({name:"GanttBlockSettings",items:[{name:"title",Component:f.SchemaSettingsBlockTitleItem},{name:"titleField",Component:f.SchemaSettingsSelectItem,useComponentProps(){var s;const{t:e}=$e(),t=O.useFieldSchema(),r=((s=t==null?void 0:t["x-decorator-props"])==null?void 0:s.fieldNames)||{},{service:o}=fe(),n=O.useField(),{dn:a}=f.useDesignable();return{title:e("Title field"),value:r.title,options:Ye("string"),onChange:i=>{const c=n.decoratorProps.fieldNames||{};c.title=i,n.decoratorProps.params=c,t["x-decorator-props"].params=c,t["x-decorator-props"].fieldNames=c,o.refresh(),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":n.decoratorProps}}),a.refresh()}}}},{name:"timeScale",Component:f.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=$e(),t=O.useFieldSchema(),r=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{},o=O.useField(),{service:n}=fe(),{dn:a}=f.useDesignable(),s=f.useCompile();return{title:e("Time scale"),value:r.range||"day",options:[{label:s('{{t("Hour")}}'),value:"hour",color:"orange"},{label:s('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:s('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:s('{{t("Day")}}'),value:"day",color:"yellow"},{label:s('{{t("Week")}}'),value:"week",color:"pule"},{label:s('{{t("Month")}}'),value:"month",color:"green"},{label:s('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:s('{{t("Year")}}'),value:"year",color:"green"}],onChange:c=>{const d=o.decoratorProps.fieldNames||{};d.range=c,o.decoratorProps.params=d,t["x-decorator-props"].params=d,t["x-decorator-props"].fieldNames=d,n.refresh(),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":o.decoratorProps}}),a.refresh()}}}},{name:"startDateField",Component:f.SchemaSettingsSelectItem,useComponentProps(){var s;const{t:e}=$e(),t=O.useFieldSchema(),r=((s=t==null?void 0:t["x-decorator-props"])==null?void 0:s.fieldNames)||{},o=O.useField(),{dn:n}=f.useDesignable(),{service:a}=fe();return{title:e("Start date field"),value:r.start,options:Ye("date"),onChange:i=>{const c=o.decoratorProps.fieldNames||{};c.start=i,o.decoratorProps.fieldNames=c,t["x-decorator-props"].fieldNames=c,a.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":o.decoratorProps}}),n.refresh()}}}},{name:"endDateField",Component:f.SchemaSettingsSelectItem,useComponentProps(){var s;const{t:e}=$e(),t=O.useFieldSchema(),r=O.useField(),{service:o}=fe(),{dn:n}=f.useDesignable(),a=((s=t==null?void 0:t["x-decorator-props"])==null?void 0:s.fieldNames)||{};return{title:e("End date field"),value:a.end,options:Ye("date"),onChange:i=>{const c=r.decoratorProps.fieldNames||{};c.end=i,r.decoratorProps.fieldNames=c,t["x-decorator-props"].fieldNames=c,o.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":r.decoratorProps}}),n.refresh()}}}},{name:"processField",Component:f.SchemaSettingsSelectItem,useComponentProps(){var s;const{t:e}=$e(),t=O.useFieldSchema(),r=((s=t==null?void 0:t["x-decorator-props"])==null?void 0:s.fieldNames)||{},{service:o}=fe(),{dn:n}=f.useDesignable(),a=O.useField();return{title:e("Progress field"),value:r.progress,options:Ye("float"),onChange:i=>{const c=a.decoratorProps.fieldNames||{};c.progress=i,a.decoratorProps.fieldNames=c,t["x-decorator-props"].fieldNames=c,o.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":a.decoratorProps}}),n.refresh()}}}},{name:"dataScope",Component:f.SchemaSettingsDataScope,useComponentProps(){var s,i;const{name:e}=f.useCollection(),t=O.useFieldSchema(),{form:r}=f.useFormBlockContext(),o=O.useField(),{service:n}=fe(),{dn:a}=f.useDesignable();return{collectionName:e,defaultFilter:((i=(s=t==null?void 0:t["x-decorator-props"])==null?void 0:s.params)==null?void 0:i.filter)||{},form:r,onSubmit:({filter:c})=>{var p;c=f.removeNullCondition(c);const d=o.decoratorProps.params||{};d.filter=c,o.decoratorProps.params=d,t["x-decorator-props"].params=d,n.run(ue(E({},(p=n.params)==null?void 0:p[0]),{filter:c})),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":t["x-decorator-props"]}})}}}},{name:"divider",type:"divider"},{name:"template",Component:f.SchemaSettingsTemplate,useComponentProps(){const{name:e}=f.useCollection();return{componentName:"Gantt",collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]});Te.ActionBar=f.ActionBar,Te.ViewMode=z,Te.Designer=ho,Te.Event=po;const It=u.memo(e=>{const t=u.useContext(f.CollectionManagerContext);return l.jsx(f.CurrentAppInfoProvider,{children:l.jsx(f.SchemaComponentOptions,{components:{Gantt:Te,GanttBlockInitializer:mo,GanttBlockProvider:ar},scope:{useGanttBlockProps:sr},children:l.jsx(f.CollectionManagerContext.Provider,{value:E({},t),children:e.children})})})});It.displayName="GanttProvider";class Lt extends f.Plugin{load(){return ne(this,null,function*(){this.app.use(It),this.app.schemaSettingsManager.add(xo),this.app.schemaInitializerManager.add(go);const t=this.app.schemaInitializerManager.get("BlockInitializers");t==null||t.add("dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer"})})}}T.Gantt=Te,T.GanttPlugin=Lt,T.default=Lt,Object.defineProperties(T,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
244
+ `),children:[c.jsx(mo,{visible:So,setVisible:Ot,record:wo}),c.jsx(A.RecursionField,{name:"anctionBar",schema:Gt.properties.toolBar}),c.jsx(A.RecursionField,{name:"table",schema:Gt.properties.table}),c.jsxs("div",{className:t.wrapper,onKeyDown:$o,tabIndex:0,ref:we,children:[c.jsx(ho,{gridProps:Go,calendarProps:ko,barProps:Oo,ganttHeight:d,scrollY:xe,scrollX:fe,ref:kt}),He.changedTask&&c.jsx(Br,{arrowIndent:Ne,rowHeight:l,svgContainerHeight:Mo,svgContainerWidth:To,fontFamily:ce,fontSize:me,scrollX:fe,scrollY:xe,task:He.changedTask,headerHeight:i,taskListWidth:We,TooltipContent:$,rtl:b,svgWidth:he}),c.jsx(Ar,{ganttFullHeight:Pe,ganttHeight:d,headerHeight:i,scroll:xe,onScroll:Fo,rtl:b}),c.jsx(Pr,{svgWidth:he,taskListWidth:We,scroll:fe,rtl:b,onScroll:Ao})]})]})};Te.ActionBar=u.ActionBar,Te.ViewMode=G,Te.Designer=or,Te.Event=fr;const Ht=f.memo(e=>c.jsx(u.CurrentAppInfoProvider,{children:c.jsx(u.SchemaComponentOptions,{components:{Gantt:Te,GanttBlockInitializer:ur,GanttBlockProvider:ar},scope:{useGanttBlockProps:sr},children:e.children})}));Ht.displayName="GanttProvider";class Et extends u.Plugin{load(){return se(this,null,function*(){this.app.use(Ht),this.app.schemaSettingsManager.add(lr),this.app.schemaSettingsManager.add(cr),this.app.schemaInitializerManager.add(dr);const t=this.app.schemaInitializerManager.get("BlockInitializers");t==null||t.add("dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer"})})}}N.Gantt=Te,N.GanttPlugin=Et,N.default=Et,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,17 +1,16 @@
1
1
  module.exports = {
2
+ "@nocobase/client": "0.20.0-alpha.2",
2
3
  "react": "18.2.0",
3
- "@nocobase/client": "0.19.0-alpha.9",
4
4
  "@formily/react": "2.3.0",
5
5
  "@ant-design/icons": "5.2.6",
6
6
  "@formily/antd-v5": "1.1.9",
7
7
  "react-i18next": "11.18.6",
8
8
  "@formily/shared": "2.3.0",
9
- "@nocobase/server": "0.19.0-alpha.9",
10
- "@nocobase/test": "0.19.0-alpha.9",
9
+ "@nocobase/server": "0.20.0-alpha.2",
10
+ "@nocobase/test": "0.20.0-alpha.2",
11
11
  "@emotion/css": "11.11.2",
12
12
  "antd-style": "3.4.5",
13
- "@formily/core": "2.3.0",
14
13
  "antd": "5.12.8",
15
14
  "lodash": "4.17.21",
16
- "@nocobase/utils": "0.19.0-alpha.9"
15
+ "@nocobase/utils": "0.20.0-alpha.2"
17
16
  };
@@ -0,0 +1,6 @@
1
+ {
2
+ "Title field": "Title field",
3
+ "Time scale": "Time scale",
4
+ "Start date field":"Start date field",
5
+ "Progress field":"Progress field"
6
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Title field": "Campo de título",
3
+ "Time scale": "Escala de tiempo",
4
+ "Start date field": "Campo de fecha de inicio",
5
+ "End date field": "Campo de fecha de final",
6
+ "Progress field": "Campo de progreso"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Title field": "제목 필드",
3
+ "Time scale": "시간 축척",
4
+ "Start date field": "시작 날짜 필드",
5
+ "End date field": "종료 날짜 필드",
6
+ "Progress field": "진행 상태 필드"
7
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "Title field": "Campo de título",
3
+ "Start date field": "Campo de data de início",
4
+ "End date field": "Campo de data de término"
5
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Title field": "标题字段",
3
+ "Time scale": "时间缩放等级",
4
+ "Start date field": "开始日期字段",
5
+ "End date field": "结束日期字段",
6
+ "Progress field": "进度字段"
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-gantt",
3
- "version": "0.19.0-alpha.9",
3
+ "version": "0.20.0-alpha.2",
4
4
  "displayName": "Block: Gantt",
5
5
  "displayName.zh-CN": "区块:甘特图",
6
6
  "description": "Provides Gantt block.",
@@ -17,7 +17,7 @@
17
17
  "@nocobase/server": "0.x",
18
18
  "@nocobase/test": "0.x"
19
19
  },
20
- "gitHead": "975f9c58a1995df6a8d7a4d191a0dc4a9769ebc5",
20
+ "gitHead": "6fb885dfc3554e4b0f29e9a7a1eecbbe85d0eebb",
21
21
  "keywords": [
22
22
  "Blocks"
23
23
  ]