@progress/kendo-react-gantt 7.1.0 → 7.1.1-develop.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -2,4 +2,4 @@
2
2
  * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ra=require("react"),u=require("prop-types"),h=require("@progress/kendo-react-common"),y=require("@progress/kendo-date-math"),I=require("@progress/kendo-react-data-tools"),fe=require("@progress/kendo-react-treelist"),J=require("@progress/kendo-react-intl"),pe=require("@progress/kendo-svg-icons"),te=require("@progress/kendo-react-buttons"),xa=require("react-dom"),ee=require("@progress/kendo-react-form"),Ke=require("@progress/kendo-react-dialogs"),de=require("@progress/kendo-react-labels"),Qt=require("@progress/kendo-react-inputs"),Oe=require("@progress/kendo-react-layout"),Ma=require("@progress/kendo-react-dateinputs"),Z=require("@progress/kendo-react-dropdowns"),Te=require("@progress/kendo-react-grid"),Ue=require("@progress/kendo-data-query");function Jt(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return a.default=e,Object.freeze(a)}const t=Jt(Ra),en=Jt(xa),Na=I.TABLE_ROW_INDEX_ATTRIBUTE,Fa=I.TABLE_COL_INDEX_ATTRIBUTE,La=I.TABLE_PREVENT_SELECTION_ELEMENT,$t=new Date().getTime(),tn=7,Va="hh:mm a",mt={skeleton:"MEd"},Aa="MMM",Ga="yyyy",Ve=100,za=6,$e="data-dependency-drag-handle",Ha="start",Pa="finish",qt={[$e]:Ha},Ut={[$e]:Pa},qe="data-task-id",nn={id:"id",start:"start",end:"end",title:"title",percentComplete:"percentComplete",parentId:"parentId",isRollup:"isRollup",isExpanded:"isExpanded",isInEdit:"isInEdit",children:"children",isSelected:"isSelected"},an={id:"id",fromId:"fromId",toId:"toId",type:"type"},Oa=I.orderBy,Wa=I.filterBy,Ae=h.mapTree,_a=h.extendDataItem,Ba=fe.createDataTree,Ka=e=>({fields:{...nn,...e}}),$a=e=>({fields:{...an,...e}}),on=e=>y.getDate(e),Et=(e,a)=>y.getDate(y.addDays(e,a||1)),qa=(e,a,n,r)=>n<a&&e<=r;function Ce(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const ge=4,ut=10,Ua=(e,a,n,r)=>{const s=[];let o=0,l=0;const i=ut,g=Math.floor(n/2),d=e.top<a.top,m=()=>s.push({left:l,top:o});if(r===0||r===3){const c=r===3?"start":"end";o=e.top,l=e[c],m(),l=Math[c==="start"?"min":"max"](e[c],a[c]),l=c==="start"?l-i:l+i,m(),o=a.top,m(),l=c==="start"?a[c]-ge:a[c]+ge,m(),Yt(o,l,s,c!=="start")}else{const c=r===2?"start":"end",f=r===2?"end":"start",k=r===2?e[c]-ut*2>=a[f]:e[c]+ut*2<=a[f];o=e.top,l=e[c],m(),l=c==="start"?l-i:l+i,m(),k||(o=d?o+g:o-g,m(),l=c==="start"?a[f]+i:a[f]-i,m()),o=a.top,m(),l=f==="start"?a[f]-ge:a[f]+ge,m(),Yt(o,l,s,f!=="start")}return s},Yt=(e,a,n,r)=>r?Ya(e,a,n):Za(e,a,n),Ya=(e,a,n)=>{n.push({top:e-ge/2,left:a}),n.push({top:e,left:a-ge+1}),n.push({top:e+ge/2,left:a}),n.push({top:e,left:a})},Za=(e,a,n)=>{n.push({top:e+ge/2,left:a}),n.push({top:e,left:a+ge-1}),n.push({top:e-ge/2,left:a}),n.push({top:e,left:a})},rn=e=>{if(e.workWeekStart===void 0||e.workWeekEnd===void 0)return[];const a=[];let n=e.workWeekStart;for(a.push(n);e.workWeekEnd!==n;)n>6?n-=7:n++,a.push(n);return a},Xa=(e,a)=>{const n=e.getDay();return a.indexOf(n)>-1},sn=(e,{step:a,timezone:n})=>{const r=[],s=y.ZonedDate.fromLocalDate(e.start,n),o=y.ZonedDate.fromLocalDate(e.end,n);let l=s.clone();for(;l.getTime()<o.getTime();){const i=l.clone(),g=i.clone().addTime(a),d=new Date(i.getTime()),c={end:new Date(g.getTime()),start:d,zonedStart:i,zonedEnd:g};r.push(c),l=l.addTime(a)}return r},ja=(e,{timezone:a},n)=>{const r=[],s=y.ZonedDate.fromLocalDate(e.start,a),o=y.ZonedDate.fromLocalDate(e.end,a);for(let l=s.clone(),i=0;l.getTime()<o.getTime();i++){const g=l.clone(),d=Et(y.firstDayInWeek(y.getDate(g),n.firstDay()),tn),m=y.ZonedDate.fromUTCDate(Ce(d),a),c=m.getTime()>o.getTime()?o.clone():m;l=c.clone();const f=new Date(g.getTime()),p={end:new Date(c.getTime()),start:f,zonedStart:g,zonedEnd:c};r.push(p)}return r},Qa=(e,{timezone:a})=>{const n=[],r=y.ZonedDate.fromLocalDate(e.start,a),s=y.ZonedDate.fromLocalDate(e.end,a);for(let o=r.clone(),l=0;o.getTime()<s.getTime();l++){const i=o.clone(),g=y.ZonedDate.fromLocalDate(y.addMonths(new Date(i.getTime()),1),a);o=g.clone();const d=new Date(i.getTime()),c={end:new Date(g.getTime()),start:d,zonedStart:i,zonedEnd:g};n.push(c)}return n},Ja=(e,{timezone:a})=>{const n=[],r=y.ZonedDate.fromLocalDate(e.start,a),s=y.ZonedDate.fromLocalDate(e.end,a);for(let o=r.clone(),l=0;o.getTime()<s.getTime();l++){const i=o.clone(),g=y.ZonedDate.fromLocalDate(y.addMonths(new Date(i.getTime()),12),a);o=g.clone();const d=new Date(i.getTime()),c={end:new Date(g.getTime()),start:d,zonedStart:i,zonedEnd:g};n.push(c)}return n},eo=(e,a,n)=>{const r=n.parseDate(a.workDayStart).getHours(),s=n.parseDate(a.workDayEnd).getHours();return sn(e,{step:y.MS_PER_MINUTE*a.slotDuration,timezone:a.timezone}).map(l=>{const i=l.zonedStart.getHours();return{range:l,isWork:i>=r&&i<s,span:1,text:n.formatDate(l.zonedStart,Va),type:"time"}})},ln=(e,a,n)=>sn(e,{step:y.MS_PER_DAY,timezone:a.timezone}).map(s=>({range:s,isWork:Xa(s.start,a.workDays),span:1,text:n.formatDate(s.zonedStart,mt),type:"day"})),cn=(e,a,n)=>ja(e,{timezone:a.timezone},n).map(s=>{const o=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/y.MS_PER_DAY);return{range:s,isWork:!1,span:o,text:`${n.formatDate(s.zonedStart,mt)} - ${n.formatDate(s.zonedEnd,mt)}`,type:"week"}}),dn=(e,a,n)=>Qa(e,{timezone:a.timezone}).map(s=>{const o=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/y.MS_PER_DAY);return{range:s,isWork:!1,span:o,text:n.formatDate(s.zonedStart,Aa),type:"month"}}),to=(e,a,n)=>Ja(e,{timezone:a.timezone}).map(s=>{const o=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/y.MS_PER_DAY);return{range:s,isWork:!1,span:o,text:n.formatDate(s.zonedStart,Ga),type:"year"}}),no=(e,a,n)=>{const r=n;return t.createElement("table",{className:"k-table k-table-md",ref:a,"aria-hidden":!0},t.createElement("tbody",{className:"k-table-tbody"},e.map((s,o)=>t.createElement("tr",{className:"k-table-row",key:o},s.map((l,i)=>t.createElement("td",{key:l.range.start.getTime(),colSpan:l.span,className:h.classNames("k-table-th",{"k-header":!0,"k-nonwork-hour":!l.isWork})},r?t.createElement(r,{rowIndex:o,index:i,range:l.range,text:l.text,isWork:l.isWork,type:l.type}):l.text))))))},ao=(e,a)=>{const n=e[e.length-1];return t.createElement("table",{className:"k-table k-table-md k-gantt-columns",ref:a,"aria-hidden":!0},t.createElement("tbody",{className:"k-table-tbody"},t.createElement("tr",{className:"k-table-row"},n.map(r=>t.createElement("td",{key:r.range.start.getTime(),colSpan:r.span,className:h.classNames("k-table-td",{"k-nonwork-hour":!r.isWork})})))))},oo=(e,a)=>{const n=e[e.length-1];let r=0,s=0;return n.forEach(o=>{const l=o.span;s+=l,l>r&&(r=l)}),Math.round(s*a/r)},gt=(e,a)=>!!h.getter(a)(e),un=(e,a)=>!!h.getter(a)(e),ro=(e,a)=>n=>gt(n,e)&&un(n,a)?[...h.getter(a)(n)]:[],wt=t.createContext([]),so=()=>t.useContext(wt);wt.displayName="KendoReactGanttTaskDataContext";const vt=t.createContext([]),lo=()=>t.useContext(vt);vt.displayName="KendoReactGanttDependencyDataContext";const Tt=t.createContext(nn),bt=()=>t.useContext(Tt);Tt.displayName="KendoReactGanttTaskModelFieldsContext";const St=t.createContext(an),mn=()=>t.useContext(St);St.displayName="KendoReactGanttDependencyModelFieldsContext";const It=t.createContext({}),Ge=()=>t.useContext(It);It.displayName="KendoReactGanttPropsContext";const Rt=t.createContext({start:new Date,end:new Date,zonedStart:y.ZonedDate.fromLocalDate(new Date),zonedEnd:y.ZonedDate.fromLocalDate(new Date)}),ze=()=>t.useContext(Rt);Rt.displayName="KendoReactGanttDateRangeContext";const xt=t.createContext([]),io=()=>t.useContext(xt);xt.displayName="KendoReactGanttViewsContext";const Mt=t.createContext(["week",h.noop]),gn=()=>t.useContext(Mt);Mt.displayName="KendoReactGanttActiveViewContext";const Nt=t.createContext(0),hn=()=>t.useContext(Nt);Nt.displayName="KendoReactGanttRowHeightContext";const Ft=t.createContext(0),co=()=>t.useContext(Ft);Ft.displayName="KendoReactGanttToolbarHeightContext";const Lt=t.createContext({onDataStateChange:h.noop,onSortChange:h.noop,onFilterChange:h.noop,onColumnMenuFilterChange:h.noop,onExpandChange:h.noop,onRowClick:h.noop,onRowDoubleClick:h.noop,onRowContextMenu:h.noop,onColumnResize:h.noop,onColumnReorder:h.noop,onDependencyCreate:h.noop,onKeyDown:h.noop,onSelectionChange:h.noop,onHeaderSelectionChange:h.noop}),uo=()=>t.useContext(Lt);Lt.displayName="KendoReactGanttEventsContext";const Vt=t.createContext({onTaskClick:h.noop,onTaskDoubleClick:h.noop,onTaskContextMenu:h.noop}),mo=()=>t.useContext(Vt);Vt.displayName="KendoReactGanttTaskEventsContext";const fn=({children:e,taskData:a,dependencyData:n,taskModelFields:r,dependencyModelFields:s,props:o,dateRange:l,views:i,activeView:g,rowHeight:d,toolbarHeight:m,events:c,taskEvents:f})=>t.createElement(It.Provider,{value:o},t.createElement(wt.Provider,{value:a},t.createElement(vt.Provider,{value:n},t.createElement(Tt.Provider,{value:r},t.createElement(St.Provider,{value:s},t.createElement(Rt.Provider,{value:l},t.createElement(xt.Provider,{value:i},t.createElement(Mt.Provider,{value:g},t.createElement(Nt.Provider,{value:d},t.createElement(Ft.Provider,{value:m},t.createElement(Lt.Provider,{value:c},t.createElement(Vt.Provider,{value:f},e))))))))))));fn.displayName="KendoReactGanttContext";const At=t.createContext([{current:{}},h.noop]),pn=()=>t.useContext(At);At.displayName="KendoReactGanttViewContext";const Gt=t.createContext(0),go=()=>t.useContext(Gt);Gt.displayName="KendoReactGanttViewTimelineWidthContext";const zt=t.createContext({onDependencyHandlePress:h.noop,onDependencyHandleDrag:h.noop,onDependencyHandleRelease:h.noop,isEnabled:!1,draggedId:null}),ho=()=>t.useContext(zt);zt.displayName="KendoReactGanttViewDependencyDragContext";const Cn=({children:e,tasksStore:a,timelineWidth:n,dependencyDrag:r})=>t.createElement(At.Provider,{value:a},t.createElement(Gt.Provider,{value:n},t.createElement(zt.Provider,{value:r},e)));Cn.displayName="KendoReactGanttViewContext";var ht=(e=>(e[e.add=0]="add",e[e.remove=1]="remove",e))(ht||{});const fo=()=>{const e=t.useRef({}),a=t.useCallback(n=>{switch(n.type){case 0:e.current[n.id]=n.itemRef;break;case 1:delete e.current[n.id];break}},[]);return[e,a]},po=(e,a,n,r)=>{const s=t.useRef(null),[,o]=pn();t.useImperativeHandle(s,()=>({element:r.current,dataItem:e})),t.useImperativeHandle(n,()=>s.current),t.useLayoutEffect(()=>{const l=s.current;if(l)return o({type:ht.add,itemRef:l,id:a}),()=>{o({type:ht.remove,itemRef:l,id:a})}})},kn=t.forwardRef((e,a)=>{const n=ze(),r=bt(),s=go(),o=ho(),l=mo(),i=t.useRef(null),g=t.useRef(null);po(e.dataItem,h.getter(r.id)(e.dataItem),a,i);const d=t.useRef(null),m=h.getter(r.id)(e.dataItem),c=h.getter(r.start)(e.dataItem),f=h.getter(r.end)(e.dataItem),k=h.getter(r.title)(e.dataItem),p=h.getter(r.percentComplete)(e.dataItem),D=h.getter(r.children)(e.dataItem),v=h.getter(r.isSelected)(e.dataItem),F=c&&c.getTime(),A=f&&f.getTime(),N=D&&D.length,O=!N&&F===A,R=F&&A&&qa(n.start,n.end,c,f),[V,T]=t.useState(!1),b=t.useRef(null),$=t.useRef(null);h.useDraggable(b,{onPress:o.onDependencyHandlePress,onDrag:o.onDependencyHandleDrag,onRelease:o.onDependencyHandleRelease}),h.useDraggable($,{onPress:o.onDependencyHandlePress,onDrag:o.onDependencyHandleDrag,onRelease:o.onDependencyHandleRelease});const W=t.useCallback(S=>{l.onTaskClick&&l.onTaskClick({dataItem:e.dataItem,level:e.level,nativeEvent:S&&S.nativeEvent,syntheticEvent:S,target:null})},[e.dataItem,e.level]),_=t.useCallback(S=>{l.onTaskDoubleClick&&l.onTaskDoubleClick({dataItem:e.dataItem,level:e.level,nativeEvent:S&&S.nativeEvent,syntheticEvent:S,target:null})},[e.dataItem,e.level]),X=t.useCallback(S=>{l.onTaskContextMenu&&l.onTaskContextMenu({dataItem:e.dataItem,level:e.level,nativeEvent:S&&S.nativeEvent,syntheticEvent:S,target:null})},[e.dataItem,e.level]),E=t.useCallback(S=>{l.onTaskRemoveClick&&l.onTaskRemoveClick({dataItem:e.dataItem,level:e.level,nativeEvent:S&&S.nativeEvent,syntheticEvent:S,target:null})},[e.dataItem,e.level]),P=t.useCallback(()=>{const S=n.start,ne=n.end,x=d.current,L=i.current,j=g.current;if(!R||x===null||L===null)return;const ae=x.clientWidth/(ne.getTime()-S.getTime()),B=(c.getTime()-S.getTime())*ae,U=(f.getTime()-c.getTime())*ae,ke=(x.offsetHeight-L.offsetHeight)/2;L.style.left=`${Math.round(O?B-za:B)}px`,L.style.top=`${Math.round(ke)}px`,O||(L.style.width=`${Math.round(U)}px`,j!==null&&(j.style.width=`${Math.round(U*(p||0))}px`)),T(!0)},[n.start.getTime(),n.end.getTime(),F,A,R,p,s]);t.useEffect(P,[P]);const Y={visibility:V?void 0:"hidden",display:R?void 0:"none"},q={userSelect:"none",display:o.draggedId===String(m)?"block":void 0};return t.createElement("td",{ref:d,key:m,role:"presentation"},O?t.createElement("div",{"aria-hidden":!0,className:h.classNames({"k-task":!0,"k-task-milestone":!0,"k-selected":v&&!Array.isArray(v)}),style:Y,ref:i,[qe]:m,onClick:W,onDoubleClick:_,onContextMenu:X},t.createElement("div",{className:"k-task-milestone-content"}),o.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-start",ref:b,style:q,...qt}),o.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-end",ref:$,style:q,...Ut})):t.createElement("div",{"aria-hidden":!0,className:h.classNames({"k-task":!0,"k-task-summary":N,"k-task-single":!N,"k-selected":v&&!Array.isArray(v)}),ref:i,style:Y,[qe]:m,onClick:W,onDoubleClick:_,onContextMenu:X},N?t.createElement("div",{className:"k-task-summary-progress",ref:g},t.createElement("div",{className:"k-task-summary-complete"})):t.createElement("div",{className:"k-task-complete",ref:g}),!N&&t.createElement(t.Fragment,null,t.createElement("div",{className:"k-task-content"},k),l.onTaskRemoveClick?t.createElement("span",{className:"k-task-actions"},t.createElement("span",{onClick:E,className:"k-link k-task-delete","aria-label":"Delete"},t.createElement(h.IconWrap,{name:"x",icon:pe.xIcon}))):null),o.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-start",ref:b,style:q,...qt}),o.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-end",ref:$,style:q,...Ut})))});kn.displayName="KendoReactGanttTask";const Dn=e=>{const{dependency:a}=e,[n]=pn(),r=t.useRef(null),s=mn(),o=hn(),[l,i]=t.useState(!1),g=()=>{if(r.current===null||n.current===null){i(!1);return}const d=n.current[h.getter(s.fromId)(a)],m=n.current[h.getter(s.toId)(a)];if(!d||!m){i(!1);return}const c=d.element,f=m.element;if(!c||!f){i(!1);return}if(l===!1){i(!0);return}const k={top:c.offsetTop+c.offsetHeight/2,start:c.offsetLeft,end:c.offsetLeft+c.offsetWidth},p={top:f.offsetTop+f.offsetHeight/2,start:f.offsetLeft,end:f.offsetLeft+f.offsetWidth},D=h.getter(s.type)(a),v=Ua(k,p,o,D);v&&v.length&&r.current.setAttribute("points",v.map(F=>`${F.left},${F.top}`).join(" "))};return t.useEffect(g),t.createElement("polyline",{ref:r,style:{display:l?void 0:"none"}})};Dn.displayName="KendoReactGanttDependency";class Ht extends t.Component{constructor(a){super(a),this.state={activeId:void 0,level:0},this.tableElement=null,this.tbodyElement=null,this.wrapperScrollLeft=0,this.wrapperScrollTop=0,this.updateOnScroll=!1,this.tbodyOffsetTop=0,this.prevData=[],this.flattedData=[],this.element=null,this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this.scrollIntoView=n=>{if(!this.element)return;const{rowIndex:r=0}=n,{rowHeight:s=0}=this.props;this.element.scroll(0,(r-1)*s)},this.getColumns=n=>{const r=n.filter(o=>o.declarationIndex>=0&&o.parentIndex===-1),s=o=>(o.sort((l,i)=>l.declarationIndex-i.declarationIndex),o.map(l=>{const{declarationIndex:i,parentIndex:g,depth:d,colSpan:m,rowSpan:c,index:f,kFirst:k,groupable:p,children:D,...v}=l;return D.length?{children:s(D),...v}:v}));return s(r)},this.onKeyDown=n=>{if(I.tableKeyboardNavigation.onKeyDown(n,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.props.onKeyDown){const{mode:r,cell:s}=I.getSelectionOptions(this.props.selectable),o={dataItems:this.getLeafDataItems(),mode:r,cell:s,componentId:this.props.treelistId,selectedField:this.props.selectedField,...this.getEventArguments(n)};this.props.onKeyDown.call(void 0,o)}},this.onFocus=n=>{I.tableKeyboardNavigation.onFocus(n,{contextStateRef:this.contextStateRef})},this.onRowDrag=n=>{if(this.props.onRowDrag){const r={...n,target:this};this.props.onRowDrag.call(void 0,r)}},this.onRowDrop=n=>{if(this.props.onRowDrop){const r={...n,target:this};this.props.onRowDrop.call(void 0,r)}},this.onColumnReorder=(n,r,s)=>{const{extendedColumns:o}=this.props,l=o[n].depth,i=m=>{do m++;while(m<o.length&&o[m].depth>l);return m},g=[...o],d=g.splice(n,i(n)-n);if(g.splice(n<r?i(r-d.length):r,0,...d),g.filter(m=>m.declarationIndex>=0).forEach((m,c)=>m.orderIndex=c),this.props.onColumnReorder){const m={target:this,columns:this.getColumns(g),nativeEvent:s};this.props.onColumnReorder.call(void 0,m)}},this.onColumnResize=(n,r,s,o,l)=>{if(this.props.onColumnResize){const i=this.props.extendedColumns.filter(d=>d.children.length===0).reduce((d,m)=>d+=parseFloat(String(m.width)),0);this.tableElement&&(this.tableElement.style.width=i+"px");const g={columns:this.getColumns(this.props.extendedColumns),totalWidth:i,index:n,nativeEvent:o,newWidth:r,oldWidth:s,end:l,target:this};this.props.onColumnResize.call(void 0,g)}},this.onScroll=n=>{const r=n.currentTarget.scrollLeft,s=n.currentTarget.scrollTop,{columnVirtualization:o,scrollable:l,rowHeight:i=0}=this.props,g=i,d=0;let m=!1;o&&Math.abs(this.wrapperScrollLeft-r)>d&&(this.wrapperScrollLeft=r,m=!0),l==="virtual"&&Math.abs(this.wrapperScrollTop-s)>g&&(this.wrapperScrollTop=s,m=!0),m&&(this.updateOnScroll=!0,this.forceUpdate())},this.calculateSizes=n=>{if(!n||this.props.scrollable==="none")return;const r=Array.from(n.childNodes),s=r.find(i=>i.nodeName==="TABLE"),o=this.props.toolbar&&r.find(i=>i.nodeType===1&&i.classList.contains("k-grid-toolbar"));let l=0;if(o){const i=o.style.boxSizing;o.style.boxSizing="border-box",l=parseFloat(String(window.getComputedStyle(o).height))||o.offsetHeight,o.style.boxSizing=i,o.getAttribute("style")||o.removeAttribute("style")}this.tbodyOffsetTop=s.tBodies[0].offsetTop,fe.setHeaderRowsTop(s,l)},this.onItemChange=n=>{if(n.field===this.props.expandField){const r=this.props.onExpandChange;if(r){const s={...this.getEventArguments(n.syntheticEvent),dataItem:n.dataItem,level:n.level,value:n.value};r.call(void 0,s)}return}if(this.props.onItemChange){const r={...this.getEventArguments(n.syntheticEvent),dataItem:n.dataItem,level:n.level,field:n.field,value:n.value};this.props.onItemChange.call(void 0,r)}},this.onHeaderSelectionChange=n=>{if(this.props.onHeaderSelectionChange){const r={field:n.field,nativeEvent:n.syntheticEvent&&n.syntheticEvent.nativeEvent,syntheticEvent:n.syntheticEvent,target:this,dataItems:this.getLeafDataItems()};this.props.onHeaderSelectionChange.call(void 0,r)}},this.selectionRelease=n=>{if(this.props.onSelectionChange){const r={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this.props.treelistId,dataItems:this.getLeafDataItems(),dataItem:null,level:[],...n};this.props.onSelectionChange.call(void 0,r)}},this.onSortChange=(n,r,s)=>{this.onDataStateChange(this.props.onSortChange,{sort:r,field:s},n)},this.onFilterChange=n=>{const{filter:r,field:s}=n;this.onDataStateChange(this.props.onFilterChange,{filter:r,field:s},n.syntheticEvent)},this.onColumnMenuFilterChange=(n,r,s)=>{if(!s)return;const{onColumnMenuFilterChange:o}=this.props;if(!o)return;const l={syntheticEvent:n,filter:r,field:s,target:this,nativeEvent:n.nativeEvent};o.call(void 0,l)},this.onExpandChange=(n,r,s)=>{const{expandField:o,onExpandChange:l}=this.props;if(o&&l){const i={...this.getEventArguments(n),dataItem:r,level:s,value:gt(r,this.props.expandField)};l.call(void 0,i)}},this.onRowClick=(n,r)=>{if(this.props.onRowClick&&n.target.nodeName==="TD"){const s={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowClick.call(void 0,s)}},this.rowDoubleClick=(n,r)=>{if(this.props.onRowDoubleClick&&n.target.nodeName==="TD"){const s={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowDoubleClick.call(void 0,s)}},this.rowContextMenu=(n,r)=>{if(this.props.onRowContextMenu&&n.target.nodeName==="TD"){const s={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowContextMenu.call(void 0,s)}},this.onPageChange=n=>{if(this.props.onPageChange){const r={...this.getEventArguments(n.syntheticEvent),skip:n.skip,take:n.take};this.props.onPageChange.call(void 0,r)}},this.onDataStateChange=(n,r,s)=>{if(n&&n.call(void 0,{...this.getEventArguments(s),...r}),this.props.onDataStateChange){const o={...this.getEventArguments(s),dataState:{...this.getDataState(),...r}};this.props.onDataStateChange.call(void 0,o)}},this.getDataState=()=>({filter:this.props.filter,sort:this.props.sort}),this.getEventArguments=n=>({nativeEvent:n&&n.nativeEvent,syntheticEvent:n,target:this}),this.getLeafDataItems=()=>this.flatData.map(n=>n.dataItem),this.dragLogic=new I.CommonDragLogic(this.onColumnReorder,h.noop,h.noop),this.columnResize=new I.ColumnResize(this.onColumnResize),I.tableKeyboardNavigation.onConstructor({navigatable:!!a.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:a.idPrefix})}get document(){if(h.canUseDOM)return this.element&&this.element.ownerDocument||document}componentDidMount(){this.calculateSizes(this.element),I.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}getSnapshotBeforeUpdate(){return I.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(a){a.columns!==this.props.columns&&this.calculateSizes(this.element),I.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){this.columnResize.columns=[],this.dragLogic.columns=[],this.prevData=[],this.flattedData=[],this.updateOnScroll=!1}render(){const{filterRow:a,scrollable:n="scrollable",resizable:r=!1,reorderable:s=!1,skip:o,take:l,afterContent:i,extendedColumns:g=[],columnsMap:d}=this.props,m=g.some(E=>!!E.filter)||a!==void 0,c=a||I.FilterRow,f=I.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this.columnResize.columns=g,this.columnResize.resizable=r,this.dragLogic.columns=g,this.dragLogic.reorderable=s,this.dragLogic.groupable=!1;const k=g.filter(E=>E.children.length===0),p=t.createElement(I.Header,{headerRow:t.createElement(I.HeaderRow,{sort:this.props.sort,sortable:this.props.sortable,sortChange:this.onSortChange,selectionChange:this.onHeaderSelectionChange,columns:g,columnsMap:d,cellRender:this.props.headerCellRender,columnResize:this.columnResize,columnMenu:this.props.columnMenu,columnMenuFilter:this.props.columnMenuFilter,columnMenuFilterChange:this.onColumnMenuFilterChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler}),filterRow:m&&t.createElement(c,{columns:k,filter:this.props.filter,filterChange:this.onFilterChange,sort:this.props.sort,ariaRowIndex:d.length+1})||void 0,columnResize:this.columnResize}),D=this.props.style||{},{colSpans:v,hiddenColumns:F}=I.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:k,scrollLeft:this.wrapperScrollLeft,tableViewPortWidth:parseFloat((D.width||"").toString())}),A=(E,P,Y,q,S,ne)=>k.map((x,L)=>{if(F[L])return null;const j=x.id?x.id:L,ae=`k-table-td ${x.className?x.className+" ":""}${x.locked?"k-grid-content-sticky":""}`,B={id:I.tableKeyboardNavigationTools.generateNavigatableId(`${Y}-${String(L)}`,f),colSpan:v[L],dataItem:E.dataItem,field:x.field,format:x.format,className:ae||void 0,render:this.props.cellRender,onChange:this.onItemChange,selectionChange:this.props.onSelectionChange?U=>{this.onSelectionChange({event:U,item:E,columnIndex:L,dataIndex:S})}:void 0,level:E.level,expandable:x.expandable,expanded:q,hasChildren:un(E.dataItem,this.props.subItemsField),colIndex:L,ariaColumnIndex:x.ariaColumnIndex,onExpandChange:this.onExpandChange,style:x.left!==void 0&&{left:x.left,right:x.right,borderRightWidth:x.rightBorder?"1px":""}||{},isSelected:Array.isArray(ne)&&ne.indexOf(L)>-1};return P&&x.editCell?t.createElement(x.editCell,{...B,onChange:this.onItemChange,key:j}):x.cell?t.createElement(x.cell,{key:j,...B}):t.createElement(fe.TreeListCell,{key:j,...B})});let N=this.flatData;const O=N.length;o!==void 0&&l!==void 0&&(N=N.slice(o,o+l)),n==="virtual"&&(N=fe.tableRowsVirtualization({rows:N,tableViewPortHeight:parseFloat((D.height||D.maxHeight||"").toString()),scrollTop:this.wrapperScrollTop}),this.updateOnScroll=!1);const R=N.map(E=>E.level),V=d.length+(m?1:0)+1,T=N.length>0&&N.map((E,P)=>{const Y=h.getter(this.props.editField||"")(E.dataItem),q=h.getter(this.props.dataItemKey)(E.dataItem),S=String(q||E.level.join(".")),ne=gt(E.dataItem,this.props.expandField),x=this.props.selectedField?h.getter(this.props.selectedField)(E.dataItem):void 0,L={key:S,level:E.level,levels:R,dataItem:E.dataItem,selectedField:this.props.selectedField,rowHeight:E.height,render:this.props.rowRender,onDrop:this.onRowDrop,onDrag:this.onRowDrag,onClick:U=>this.onRowClick(U,E),onDoubleClick:U=>this.rowDoubleClick(U,E),onContextMenu:U=>this.rowContextMenu(U,E),isAltRow:P%2!==0,expanded:ne,rowIndex:P,ariaRowIndex:V+P,ariaSetSize:E.levelCount,ariaPosInSet:E.level[E.level.length-1]+1,isSelected:typeof x=="boolean"&&x},j=this.props.editRow,ae=this.props.row||fe.TreeListRow,B=A(E,Y,S,ne,P,x);return Y&&j?t.createElement(j,{...L,key:L.key},B):t.createElement(ae,{...L,key:L.key},B)})||t.createElement("tr",{className:"k-table-row k-grid-norecords"},t.createElement("td",{className:"k-table-td",colSpan:k.length},this.props.noRecords||t.createElement(fe.TreeListNoRecords,null))),b=E=>this.props.sort&&this.props.sort.some(P=>P.field===E),$=t.createElement("colgroup",{ref:E=>{this.columnResize.colGroupMain=E}},k.map((E,P)=>t.createElement("col",{key:P.toString(),className:b(E.field)?"k-sorted":void 0,style:E.width!==void 0?{width:E.width}:void 0}))),W=this.props.columnVirtualization||this.props.scrollable==="virtual",_=this.props.selectable&&this.props.selectable.drag?"none":void 0,X=this.props.tableProps||{};return t.createElement(I.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},t.createElement("div",{id:this.props.treelistId,style:this.props.style,className:h.classNames("k-grid k-grid-md",this.props.className,{"k-treelist-scrollable":n!=="none"}),ref:E=>this.element=E,onScroll:W?this.onScroll:void 0,onKeyDown:this.onKeyDown,onFocus:this.onFocus,"aria-rowcount":O,"aria-colcount":k.length,role:"treegrid",...I.tableKeyboardNavigationScopeAttributes},this.props.toolbar,t.createElement(I.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:E=>{this.tableElement=E}},t.createElement("table",{className:"k-table k-table-md",...this.props.tableProps||{},style:{...X.style||{},userSelect:_},role:"presentation"},$,p,t.createElement("tbody",{className:"k-table-tbody",...I.tableKeyboardNavigationBodyAttributes,ref:E=>this.tbodyElement=E,role:"presentation"},T))),this.props.pager&&t.createElement(this.props.pager,{className:"k-grid-pager",total:O,skip:o,take:l,onPageChange:this.onPageChange}),s&&t.createElement(t.Fragment,null,t.createElement(I.DropClue,{ref:this.dragLogic.refDropElementClue}),t.createElement(I.DragClue,{ref:this.dragLogic.refDragElementClue})),i))}get flatData(){const{data:a=[],rowHeight:n=0}=this.props;let r=0;const s=()=>{const l={height:n,offsetTop:r};return r+=l.height,l},o=this.updateOnScroll&&this.prevData===a&&this.tbodyOffsetTop>0&&this.flattedData.length?this.flattedData:a.map(l=>({...l,...s()}));return this.prevData=a,this.flattedData=o,o}onSelectionChange(a){if(this.props.onSelectionChange){const{event:n,item:r,dataIndex:s,columnIndex:o}=a,{mode:l,cell:i}=I.getSelectionOptions(this.props.selectable),g={...this.getEventArguments(n.syntheticEvent),dataItem:r.dataItem,level:r.level,startColIndex:o,endColIndex:o,startRowIndex:s,endRowIndex:s,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:l,cell:i,isDrag:!1,componentId:this.props.treelistId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,g)}}}Ht.propTypes={data:u.array,resizable:u.bool,reorderable:u.bool,sortable:u.oneOfType([u.bool,u.shape({mode:u.oneOf(["single","multiple"]),allowUnsort:u.bool})]),onSortChange:u.func,sort:u.array,columns:u.arrayOf(u.object),columnVirtualization:u.bool,filter:u.array,onFilterChange:u.func,filterRow:u.any,toolbar:u.any,noRecords:u.any,onExpandChange:u.func,expandField:u.string,subItemsField:u.string,selectedField:u.string,onSelectionChange:u.func,onHeaderSelectionChange:u.func,onRowClick:u.func,onItemChange:u.func,editField:u.string,scrollable:u.oneOf(["none","scrollable","virtual"]),rowHeight:u.number,style:u.object,tableProps:u.object,pager:u.any,skip:u.number,take:u.number,onPageChange:u.func,onDataStateChange:u.func,onColumnResize:u.func,onColumnReorder:u.func,extendedColumns:u.arrayOf(u.object),columnsMap:u.arrayOf(u.array),dataItemKey:u.string.isRequired,afterContent:u.any,navigatable:u.bool,idPrefix:u.string,treelistId:u.string};Ht.contextType=I.TableKeyboardNavigationContext;const He=t.forwardRef((e,a)=>{const{slotLevels:n,slotWidth:r,timelineHeaderCell:s}=e,{columns:o,noRecords:l,resizable:i,reorderable:g,sortable:d,sort:m,filter:c,columnMenuFilter:f,columnMenu:k,navigatable:p,row:D,selectable:v}=Ge(),{onDataStateChange:F,onSortChange:A,onFilterChange:N,onColumnMenuFilterChange:O,onExpandChange:R,onRowClick:V,onRowDoubleClick:T,onRowContextMenu:b,onColumnResize:$,onColumnReorder:W,onDependencyCreate:_,onKeyDown:X,onSelectionChange:E,onHeaderSelectionChange:P}=uo(),Y=hn(),q=co(),S=bt(),ne=mn(),x=so(),L=lo(),j=t.useRef(null),ae=t.useRef(null),B=t.useRef(null),U=t.useRef(null),ke=t.useRef(0),De=t.useRef(h.useId()),H=t.useRef(h.useId()),se=t.useRef(null),Se=t.useRef(null),xe=t.useCallback(M=>{B.current&&B.current.scrollIntoView(M)},[]);t.useImperativeHandle(Se,()=>({scrollIntoView:xe})),t.useImperativeHandle(a,()=>Se.current);const ye=t.useRef(0),C=t.useRef(0),G=t.useRef(0),K=t.useRef(0),ue=t.useRef(null),Ee=t.useRef(null),[ce,Me]=t.useState(null),at=no(n,j,s),ot=ao(n,ae),Ie=oo(n,r),{extendedColumns:rt,columnsWidth:st,columnsMap:lt}=t.useMemo(()=>{const M=I.readColumns([...o,{title:"",sortable:!1,resizable:!1,reorderable:!1,width:Ie,headerCell:()=>at,cell:kn,orderIndex:Number.MAX_SAFE_INTEGER,navigatable:!1}],{prevId:0,idPrefix:De.current});let Q=0;return M.forEach((z,oe,le)=>{const re=oe+1===le.length,ve=z.children.length===0;re?z.isAccessible=!1:(z.locked=!0,ve&&(z.width=z.width||Ve)),ve&&(Q+=parseFloat(String(z.width)))}),{extendedColumns:M,columnsWidth:Q,columnsMap:I.mapColumns(M)}},[o,Ie]),[it,ct]=fo(),w=t.useCallback(()=>j.current&&j.current.parentElement,[]),he=()=>{const M=w(),Q=ae.current,z=B.current&&B.current.tbodyElement;if(!M||!Q||!z)return;const oe=z.offsetTop,le=M.offsetLeft,re=Ie;Q.style.top=oe+"px",Q.style.left=le+"px",Q.style.width=re+"px",Q.style.height=z.offsetHeight+"px"},we=()=>{const M=w();M&&(ke.current=M.offsetLeft)};t.useEffect(he),t.useEffect(we);const Ne=t.useCallback(M=>{if(!U.current)return;const Q=M.columns.slice(0,M.columns.length-1);if(M.end)U.current.style.left="0px";else{const z=w();if(!z)return;U.current.style.left=z.offsetLeft-ke.current+"px",he()}$({...M,columns:Q})},[$]),Fe=t.useCallback(M=>{const Q=M.columns.slice(0,M.columns.length-1);W({...M,columns:Q})},[$]),dt=t.useCallback(M=>{const z=(se.current&&se.current.ownerDocument?se.current.ownerDocument:document).elementFromPoint(M.clientX,M.clientY),oe=se.current;if(!z||!z.parentElement||!oe)return;const le=oe.parentElement,re=oe.firstElementChild;if(!le||!re)return;const ve=z.getAttribute($e);if(ve){const wa=oe.offsetTop,va=oe.offsetLeft,Ta=le.offsetTop,ba=le.offsetLeft,Sa=re.scrollTop,Ia=re.scrollLeft;G.current=va+ba,K.current=wa+Ta,ye.current=M.clientX-G.current+Ia,C.current=M.clientY-K.current+Sa,ue.current=z.parentElement.getAttribute(qe),Ee.current=ve}},[]),Re=t.useCallback(M=>{const Q=se.current;if(!Q)return;const z=Q.firstElementChild;if(!z)return;const oe=z.scrollTop,le=z.scrollLeft,re=M.clientX-G.current+le,ve=M.clientY-K.current+oe;Math.abs(ye.current-re)<10&&Math.abs(C.current-ve)<10||Me({startX:ye.current,startY:C.current,endX:re,endY:ve})},[]),Ea=t.useCallback(M=>{const z=(se.current&&se.current.ownerDocument?se.current.ownerDocument:document).elementFromPoint(M.clientX,M.clientY);if(!z||!z.parentElement)return;const oe=z.parentElement.getAttribute(qe),le=z.getAttribute($e);if(le&&oe!==ue.current&&_){let re;Ee.current==="start"?re=le==="start"?3:2:re=le==="start"?1:0,_({fromId:ue.current,toId:oe,type:re})}ye.current=0,C.current=0,G.current=0,K.current=0,ue.current=null,Ee.current=null,Me(null)},[_,Me]);return t.createElement(Cn,{tasksStore:[it,ct],timelineWidth:Ie,dependencyDrag:{isEnabled:!!_,draggedId:ue.current,onDependencyHandlePress:dt,onDependencyHandleDrag:Re,onDependencyHandleRelease:Ea}},t.createElement("div",{className:"k-gantt-content",ref:se,style:{height:`calc(100% - ${q}px)`}},t.createElement(Ht,{treelistId:H.current,ref:B,extendedColumns:rt,columnsMap:lt,dataItemKey:S.id,data:x,idPrefix:De.current,navigatable:p,expandField:S.isExpanded,subItemsField:S.children,editField:S.isInEdit,selectedField:S.isSelected,onDataStateChange:F,onSortChange:A,onFilterChange:N,onExpandChange:R,onRowClick:V,onRowDoubleClick:T,onRowContextMenu:b,onColumnResize:Ne,onColumnReorder:Fe,onColumnMenuFilterChange:O,onKeyDown:X,onSelectionChange:E,onHeaderSelectionChange:P,tableProps:{style:{width:st},className:"k-table k-table-md k-table-layout-fixed"},noRecords:l,rowHeight:Y,resizable:i,reorderable:g,sortable:d,sort:m,filter:c,columnMenuFilter:f,columnMenu:k,row:D,selectable:v,afterContent:t.createElement(t.Fragment,null,t.createElement("svg",{className:"k-gantt-dependencies-svg",ref:U,style:{left:0,top:0}},L.map(M=>t.createElement(Dn,{key:h.getter(ne.id)(M),dependency:M}))),t.createElement("svg",{className:"k-gantt-dependencies-svg",style:{left:0,top:0,zIndex:3}},ce&&t.createElement("polyline",{points:`${ce.startX},${ce.startY} ${ce.endX},${ce.endY}`})),x&&x.length?ot:null)})))});He.displayName="KendoReactGanttBaseView";const ft="gantt.weekViewTitle",pt="gantt.dayViewTitle",Ct="gantt.monthViewTitle",kt="gantt.yearViewTitle",Dt="gantt.filterClearButton",Ye="gantt.filterEqOperator",Ze="gantt.filterNotEqOperator",Xe="gantt.filterIsNullOperator",je="gantt.filterIsNotNullOperator",yn="gantt.filterIsEmptyOperator",En="gantt.filterIsNotEmptyOperator",wn="gantt.filterStartsWithOperator",vn="gantt.filterContainsOperator",Tn="gantt.filterNotContainsOperator",bn="gantt.filterEndsWithOperator",Sn="gantt.filterGteOperator",In="gantt.filterGtOperator",Rn="gantt.filterLteOperator",xn="gantt.filterLtOperator",Mn="gantt.filterIsTrue",Nn="gantt.filterIsFalse",Fn="gantt.filterBooleanAll",Ln="gantt.filterAfterOrEqualOperator",Vn="gantt.filterAfterOperator",An="gantt.filterBeforeOperator",Gn="gantt.filterBeforeOrEqualOperator",Co="gantt.noRecords",zn="gantt.editSave",Pt="gantt.editCancel",Ot="gantt.editAdd",Wt="gantt.editRemove",Hn="gantt.editTabGeneral",Pn="gantt.editTabPredecessors",On="gantt.editTabSuccessors",Wn="gantt.editorTitle",_n="gantt.editorTaskTitle",Bn="gantt.editorTaskStart",Kn="gantt.editorTaskEnd",ko="gantt.editorTaskPlannedStart",Do="gantt.editorTaskPlannedEnd",yo="gantt.editorTaskActualStart",Eo="gantt.editorTaskActualEnd",$n="gantt.editorTaskComplete",qn="gantt.editorTaskParent",Un="gantt.editorValidationRequired",Yn="gantt.editorValidationStart",Zn="gantt.editorValidationEnd",Xn="gantt.editorValidationPercentCompleteRange",yt="gantt.editorDependencyTypesFF",jn="gantt.editorDependencyTypesSF",Qn="gantt.editorDependencyTypesFS",Jn="gantt.editorDependencyTypesSS",ea="gantt.addTask",ta="gantt.addChild",na="gantt.addAbove",aa="gantt.addBelow",oa="gantt.viewSelector",_t="gantt.editorDelete",ra="gantt.deleteConfirmation",sa="gantt.deleteDialogTitle",Bt="gantt.editorDependencyNameLabel",Kt="gantt.editorDependencyTypeLabel",ie={[ft]:"Week",[pt]:"Day",[Ct]:"Month",[kt]:"Year",[Dt]:"Clear",[Ye]:"Is equal to",[Ze]:"Is not equal to",[Xe]:"Is null",[je]:"Is not null",[yn]:"Is empty",[En]:"Is not empty",[wn]:"Starts with",[vn]:"Contains",[Tn]:"Does not contain",[bn]:"Ends with",[Sn]:"Is greater than or equal to",[In]:"Is greater than",[Rn]:"Is less than or equal to",[xn]:"Is less than",[Mn]:"Is true",[Nn]:"Is false",[Fn]:"(All)",[Ln]:"Is after or equal to",[Vn]:"Is after",[An]:"Is before",[Gn]:"Is before or equal to",[Co]:"No records available",[zn]:"Save",[Pt]:"Cancel",[Ot]:"Add",[Wt]:"Remove",[Hn]:"General",[Pn]:"Predecessors",[On]:"Successors",[Wn]:"Edit task",[_n]:"Title",[Bn]:"Start",[Kn]:"End",[ko]:"Planned Start Date",[Do]:"Planned End Date",[yo]:"Actual Start Date",[Eo]:"Actual End Date",[$n]:"Complete",[qn]:"Parent",[Un]:"Field is required.",[Yn]:"Start time must be be before End time.",[Zn]:"End time must be after Start time.",[Xn]:"Value should be between 0 and 100.",[yt]:"Finish-Finish",[Qn]:"Finish-Start",[jn]:"Start-Finish",[Jn]:"Start-Start",[ea]:"Add Task",[ta]:"Add Child",[na]:"Add Above",[aa]:"Add Below",[oa]:"View Selector",[_t]:"Delete",[ra]:"Are you sure you want to delete this event?",[sa]:"Delete Event",[Bt]:"Name",[Kt]:"Type"},Pe=t.forwardRef((e,a)=>{const{slotWidth:n=_e.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:s}=e,{timezone:o}=Ge(),l=J.useInternationalization(),i=t.useRef(null),g=t.useRef(null),d=t.useCallback(p=>{g.current&&g.current.scrollIntoView(p)},[]);t.useImperativeHandle(i,()=>({scrollIntoView:d})),t.useImperativeHandle(a,()=>i.current);const m=ze(),c=e.workWeekStart||_e.workWeekStart,f=e.workWeekEnd||_e.workWeekEnd,k=t.useMemo(()=>{const p=rn({workWeekStart:c,workWeekEnd:f}),D=[],v=cn(m,{timezone:o},l);return v.forEach(F=>{const A=ln(F.range,{workDays:p,timezone:o},l);D.push.apply(D,A)}),r&&D[0]&&(r.current=D[0].range),[v,D]},[o,m.start.getTime(),m.end.getTime(),l,c,f]);return t.createElement(He,{ref:g,slotWidth:n,slotLevels:k,timelineHeaderCell:s})}),wo=({intl:e,tasksStart:a,tasksEnd:n,timezone:r})=>{const s=y.ZonedDate.fromLocalDate(a,r),o=y.ZonedDate.fromLocalDate(n,r),l=on(y.firstDayInWeek(y.getDate(s),e.firstDay())),i=Et(y.firstDayInWeek(y.getDate(o),e.firstDay()),tn),g=y.ZonedDate.fromUTCDate(Ce(l),r),d=y.ZonedDate.fromUTCDate(Ce(i),r);return{start:new Date(g.getTime()),end:new Date(d.getTime()),zonedStart:g,zonedEnd:d}},_e={name:"week",dateRange:wo,title:e=>e.toLanguageString(ft,ie[ft]),slotWidth:Ve,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};Pe.defaultProps=_e;Pe.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number,workWeekStart:u.number,workWeekEnd:u.number,workDayStart:u.string,workDayEnd:u.string};Pe.displayName="KendoReactGanttWeekView";const vo=(e,a,n)=>{const[r,s]=t.useState(a||e),o=t.useCallback((l,i)=>{s(l),n&&n.call(void 0,{...i,value:l})},[n,s]);return[a!==void 0?a:r,o]},la=e=>{const[a,n]=gn(),r=J.useLocalization(),s=t.useMemo(()=>typeof e.view.title=="function"?e.view.title.call(void 0,r):e.view.title,[e.view.title,r]),o=t.useCallback(()=>{e.view.name&&n(e.view.name)},[n,e.view.name]);return t.createElement(te.Button,{role:"button",type:"button",tabIndex:-1,togglable:!0,selected:e.view.name===a,onClick:o},s)};la.displayName="KendoReactGanttViewSelectorItem";const ia=t.forwardRef(()=>{const e=io(),[a,n]=gn(),r=J.useLocalization(),s=l=>r.toLanguageString(l,ie[l]),o=t.useCallback(l=>{n&&(l.preventDefault(),n(l.target.value))},[n]);return t.createElement("div",{className:"k-gantt-views-wrapper"},t.createElement(te.ButtonGroup,{className:"k-gantt-views"},e.map(l=>t.createElement(la,{key:l.props.name,view:l.props}))),t.createElement("select",{value:a,onChange:o,"aria-label":s(oa),className:"k-picker k-picker-solid k-dropdown-list k-dropdown k-views-dropdown k-rounded-md"},e.map(l=>t.createElement("option",{key:l.props.name,value:l.props.name},typeof l.props.title=="function"?l.props.title.call(void 0,r):l.props.title))))});ia.displayName="KendoReactGanttViewSelectorList";const ca=t.forwardRef((e,a)=>{const{className:n,...r}=e,s=t.useRef(null);return t.useImperativeHandle(a,()=>({element:s.current,props:e})),t.createElement(te.ToolbarItem,{ref:o=>{o&&(s.current=o.element)},className:h.classNames("k-gantt-views",n),...r},e.children)});ca.displayName="KendoReactGanttViewSelector";const da=t.forwardRef((e,a)=>{const{className:n,...r}=e,s=t.useRef(null),o=t.useRef(null);t.useImperativeHandle(o,()=>({element:s.current,props:e})),t.useImperativeHandle(a,()=>o.current);const l=t.useMemo(()=>h.classNames("k-gantt-toolbar k-gantt-header",n),[n]);return t.createElement(te.Toolbar,{ref:i=>{i&&(s.current=i.element)},className:l,...r},e.children)});da.displayName="KendoReactGanttToolbar";const Zt={name:"@progress/kendo-react-gantt",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},ua=t.forwardRef((e,a)=>{const n=J.useLocalization(),r=c=>n.toLanguageString(c,ie[c]),s=r(ea),o=r(ta),l=r(na),i=r(aa),g=t.useCallback(c=>{c.syntheticEvent.preventDefault();const f=c.item&&c.item.direction?c.item.direction:"none";e.onClick&&e.onClick({nativeEvent:c.nativeEvent,syntheticEvent:c.syntheticEvent,direction:f})},[e.onClick]),d=t.useCallback(c=>{c.preventDefault(),e.onClick&&e.onClick({nativeEvent:c&&c.nativeEvent,syntheticEvent:c,direction:"none"})},[e.onClick]),m=t.createElement(t.Fragment,null,t.createElement(h.IconWrap,{name:"plus",icon:pe.plusIcon}),s);return e.selectedTask?t.createElement(te.DropDownButton,{className:"k-views-dropdown",onItemClick:g,popupSettings:{popupClass:"k-gantt-toolbar"},textField:"title",items:[{title:o,direction:"child"},{title:l,direction:"above"},{title:i,direction:"below"}],text:m}):t.createElement(te.Button,{onClick:d},m)});ua.displayName="KendoReactGanttAddButton";const Qe=t.forwardRef((e,a)=>{h.validatePackage(Zt);const n=h.shouldShowValidationUI(Zt),{columns:r=Le.columns,taskData:s=Le.taskData,dependencyData:o=Le.dependencyData,style:l,className:i,noRecords:g,timezone:d,rowHeight:m=Le.rowHeight,resizable:c,reorderable:f,sortable:k,sort:p,filter:D,columnMenuFilter:v,columnMenu:F,navigatable:A,toolbar:N,row:O,selectable:R}=e,V=J.useInternationalization(),{fields:T}=t.useMemo(()=>Ka(e.taskModelFields),[e.taskModelFields]),{fields:b}=t.useMemo(()=>$a(e.dependencyModelFields),[e.dependencyModelFields]),$=t.useCallback(ro(T.isExpanded,T.children),[T.isExpanded,T.children]),W=t.useRef(null),_=t.useRef(null),X=t.useRef(null),E=t.useRef(null),P=t.useRef(null),Y=t.useCallback(w=>{const he=h.getter(T.start)(w),we=h.getter(T.end)(w),Ne=h.getter(T.isSelected)(w);(!_.current||he<_.current)&&(_.current=he),(!X.current||we>X.current)&&(X.current=we),Ne&&(E.current=w)},[T.start,T.end]),q=t.useMemo(()=>(_.current=null,X.current=null,E.current=null,fe.flatData(s,$,Y)),[s,$]);(!_.current||!X.current)&&(_.current=new Date($t),X.current=new Date($t));const S=t.Children.toArray(e.children||[t.createElement(Pe,{key:"week",firstSlotRangeRef:P})]),[ne,x]=vo(e.defaultView||S[0].props.name,e.view,e.onViewChange),L=S.find(w=>w.props.name===ne)||S[0],j=typeof L.props.dateRange=="function"?L.props.dateRange.call(void 0,{intl:V,tasksStart:_.current,tasksEnd:X.current,timezone:d}):L.props.dateRange,ae=t.useRef(null),[B,U]=t.useState(0);t.useLayoutEffect(()=>{ae.current&&U(ae.current.element.offsetHeight)},[]);const ke=t.useCallback(w=>{W.current&&W.current.scrollIntoView(w)},[]),De=t.useRef(null),H=t.useRef(null);t.useImperativeHandle(H,()=>({props:e,element:De.current,scrollIntoView:ke})),t.useImperativeHandle(a,()=>H.current);const se=t.useCallback(w=>{e.onDataStateChange&&e.onDataStateChange.call(void 0,{...w,target:H.current})},[e.onDataStateChange]),Se=t.useCallback(w=>{e.onSortChange&&e.onSortChange.call(void 0,{...w,target:H.current})},[e.onSortChange]),xe=t.useCallback(w=>{e.onKeyDown&&e.onKeyDown.call(void 0,{...w,target:H.current})},[e.onKeyDown]),ye=t.useCallback(w=>{e.onSelectionChange&&e.onSelectionChange.call(void 0,{...w,target:H.current})},[e.onSelectionChange]),C=t.useCallback(w=>{e.onHeaderSelectionChange&&e.onHeaderSelectionChange.call(void 0,{...w,target:H.current})},[e.onHeaderSelectionChange]),G=t.useCallback(w=>{e.onFilterChange&&e.onFilterChange.call(void 0,{...w,target:H.current})},[e.onFilterChange]),K=t.useCallback(w=>{e.onColumnMenuFilterChange&&e.onColumnMenuFilterChange.call(void 0,{...w,target:H.current})},[e.onColumnMenuFilterChange]),ue=t.useCallback(w=>{e.onExpandChange&&e.onExpandChange.call(void 0,{...w,target:H.current})},[e.onExpandChange]),Ee=t.useCallback(w=>{e.onAddClick&&e.onAddClick.call(void 0,{...w,target:H.current,selectedDataItem:E.current,slotStart:P.current&&new Date(P.current.start.getTime()),slotEnd:P.current&&new Date(P.current.end.getTime())})},[e.onAddClick]),ce=t.useCallback(w=>{e.onColumnResize&&e.onColumnResize.call(void 0,{...w,target:H.current})},[e.onColumnResize]),Me=t.useCallback(w=>{e.onColumnReorder&&e.onColumnReorder.call(void 0,{...w,target:H.current})},[e.onColumnReorder]),at=t.useCallback(w=>{e.onRowClick&&e.onRowClick.call(void 0,{...w,target:H.current})},[e.onRowClick]),ot=t.useCallback(w=>{e.onRowDoubleClick&&e.onRowDoubleClick.call(void 0,{...w,target:H.current})},[e.onRowClick]),Ie=t.useCallback(w=>{e.onRowContextMenu&&e.onRowContextMenu.call(void 0,{...w,target:H.current})},[e.onRowClick]),rt=t.useCallback(w=>{e.onTaskClick&&e.onTaskClick.call(void 0,{...w,target:H.current})},[e.onTaskClick]),st=t.useCallback(w=>{e.onTaskDoubleClick&&e.onTaskDoubleClick.call(void 0,{...w,target:H.current})},[e.onTaskDoubleClick]),lt=t.useCallback(w=>{e.onTaskContextMenu&&e.onTaskContextMenu.call(void 0,{...w,target:H.current})},[e.onTaskContextMenu]),it=t.useCallback(w=>{e.onTaskRemoveClick&&e.onTaskRemoveClick.call(void 0,{...w,target:H.current})},[e.onTaskRemoveClick]),ct=t.useCallback(w=>{if(e.onDependencyCreate){let he,we;const Ne=h.getter(T.id);for(let Fe=0;Fe<q.length;Fe++){const dt=q[Fe],Re=Ne(dt.dataItem);if(String(Re)===w.fromId&&(he=Re),String(Re)===w.toId&&(we=Re),he&&we)break}e.onDependencyCreate.call(void 0,{fromId:he,toId:we,target:H.current,type:w.type})}},[e.onDependencyCreate,T,q]);return t.createElement(fn,{dateRange:j,taskData:q,dependencyData:o,taskModelFields:T,dependencyModelFields:b,views:S,activeView:[ne,x],rowHeight:m,toolbarHeight:B,props:{columns:r,noRecords:g,timezone:d,resizable:c,reorderable:f,sortable:k,sort:p,filter:D,columnMenuFilter:v,columnMenu:F,navigatable:A,row:O,selectable:R},events:{onDataStateChange:se,onSortChange:Se,onFilterChange:G,onColumnMenuFilterChange:K,onExpandChange:ue,onRowClick:at,onRowDoubleClick:ot,onRowContextMenu:Ie,onColumnResize:ce,onColumnReorder:Me,onDependencyCreate:e.onDependencyCreate&&ct,onKeyDown:xe,onSelectionChange:ye,onHeaderSelectionChange:C},taskEvents:{onTaskClick:rt,onTaskDoubleClick:st,onTaskContextMenu:lt,onTaskRemoveClick:e.onTaskRemoveClick&&it}},t.createElement("div",{ref:De,role:"application",style:l,className:h.classNames("k-gantt",i)},t.createElement(da,{ref:ae},N&&N.addTaskButton?t.createElement(ua,{selectedTask:E.current,onClick:Ee}):null,t.createElement(te.ToolbarSpacer,null),t.createElement(ca,null,t.createElement(ia,null))),L&&t.createElement(L.type,{key:L.props.name,ref:W,...L.props,firstSlotRangeRef:P}),n&&t.createElement(h.WatermarkOverlay,null)))}),Le={taskData:[],dependencyData:[],columns:[],rowHeight:40};Qe.propTypes={taskData:u.array,taskModelFields:u.shape({id:u.string,start:u.string,end:u.string,title:u.string,percentComplete:u.string,parentId:u.string,isRollup:u.string,isExpanded:u.string,children:u.string,isInEdit:u.string}),dependencyData:u.array,dependencyModelFields:u.shape({id:u.string,fromId:u.string,toId:u.string,type:u.string}),columns:u.arrayOf(u.shape({width:u.number,cell:u.any,editCell:u.any,headerCell:u.any,filter:u.any,children:u.any,field:u.string,title:u.string,sortable:u.any,expandable:u.bool,headerSelectionValue:u.bool,format:u.string,headerClassName:u.string,className:u.string,resizable:u.bool,reorderable:u.bool,minResizableWidth:u.number,orderIndex:u.number,columnMenu:u.any})),sort:u.array,filter:u.array,columnMenuFilter:u.array,columnMenu:u.any,style:u.object,className:u.string,children:u.any,timezone:u.string,defaultView:u.string,view:u.string,rowHeight:u.number,navigatable:u.bool,onViewChange:u.func,onDataStateChange:u.func,onSortChange:u.func,onFilterChange:u.func,onExpandChange:u.func,onRowClick:u.func,onColumnResize:u.func,onColumnReorder:u.func};Qe.defaultProps=Le;Qe.displayName="KendoReactGantt";const Je=t.forwardRef((e,a)=>{const{slotWidth:n=be.slotWidth,slotDuration:r=be.slotDuration,firstSlotRangeRef:s,timelineHeaderCell:o}=e,{timezone:l}=Ge(),i=J.useInternationalization(),g=t.useRef(null),d=t.useRef(null),m=t.useCallback(F=>{d.current&&d.current.scrollIntoView(F)},[]);t.useImperativeHandle(g,()=>({scrollIntoView:m})),t.useImperativeHandle(a,()=>g.current);const c=ze(),f=e.workWeekStart||be.workWeekStart,k=e.workWeekEnd||be.workWeekEnd,p=e.workDayStart||be.workDayStart,D=e.workDayEnd||be.workDayEnd,v=t.useMemo(()=>{const F=rn({workWeekStart:f,workWeekEnd:k}),A=[],N=ln(c,{workDays:F,timezone:l},i);return N.forEach(O=>{const R=eo(O.range,{workDayStart:p,workDayEnd:D,timezone:l,slotDuration:r},i);O.span=R.length,A.push.apply(A,R)}),s&&A[0]&&(s.current=A[0].range),[N,A]},[l,c.start.getTime(),c.end.getTime(),i,f,k,p,D]);return t.createElement(He,{ref:d,slotWidth:n,slotLevels:v,timelineHeaderCell:o})}),To=({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=y.ZonedDate.fromLocalDate(e,n),s=y.ZonedDate.fromLocalDate(a,n),o=on(r),l=Et(s),i=y.ZonedDate.fromUTCDate(Ce(o),n),g=y.ZonedDate.fromUTCDate(Ce(l),n);return{start:new Date(i.getTime()),end:new Date(g.getTime()),zonedStart:i,zonedEnd:g}},be={name:"day",dateRange:To,title:e=>e.toLanguageString(pt,ie[pt]),slotWidth:Ve,slotDuration:60,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};Je.defaultProps=be;Je.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number,slotDuration:u.number,workWeekStart:u.number,workWeekEnd:u.number,workDayStart:u.string,workDayEnd:u.string};Je.displayName="KendoReactGanttDayView";const et=t.forwardRef((e,a)=>{const{slotWidth:n=ma.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:s}=e,{timezone:o}=Ge(),l=J.useInternationalization(),i=t.useRef(null),g=t.useRef(null),d=t.useCallback(f=>{g.current&&g.current.scrollIntoView(f)},[]);t.useImperativeHandle(i,()=>({scrollIntoView:d})),t.useImperativeHandle(a,()=>i.current);const m=ze(),c=t.useMemo(()=>{const f=[],k=dn(m,{timezone:o},l);return k.forEach(p=>{const D=cn(p.range,{timezone:o},l);f.push.apply(f,D)}),r&&f[0]&&(r.current=f[0].range),[k,f]},[o,m.start.getTime(),m.end.getTime(),l]);return t.createElement(He,{ref:g,slotWidth:n,slotLevels:c,timelineHeaderCell:s})}),bo=({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=y.ZonedDate.fromLocalDate(e,n),s=y.ZonedDate.fromLocalDate(a,n),o=y.firstDayOfMonth(y.getDate(r)),l=y.addDays(y.lastDayOfMonth(y.getDate(s)),1),i=y.ZonedDate.fromUTCDate(Ce(o),n),g=y.ZonedDate.fromUTCDate(Ce(l),n);return{start:new Date(i.getTime()),end:new Date(g.getTime()),zonedStart:i,zonedEnd:g}},ma={name:"month",dateRange:bo,title:e=>e.toLanguageString(Ct,ie[Ct]),slotWidth:Ve,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};et.defaultProps=ma;et.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number,workWeekStart:u.number,workWeekEnd:u.number,workDayStart:u.string,workDayEnd:u.string};et.displayName="GanttMonthView";const tt=t.forwardRef((e,a)=>{const{slotWidth:n=ga.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:s}=e,{timezone:o}=Ge(),l=J.useInternationalization(),i=t.useRef(null),g=t.useRef(null),d=t.useCallback(f=>{g.current&&g.current.scrollIntoView(f)},[]);t.useImperativeHandle(i,()=>({scrollIntoView:d})),t.useImperativeHandle(a,()=>i.current);const m=ze(),c=t.useMemo(()=>{const f=to(m,{timezone:o},l),k=[];return f.forEach(p=>{const D=dn(p.range,{timezone:o},l);k.push.apply(k,D)}),r&&k[0]&&(r.current=k[0].range),[f,k]},[o,m.start.getTime(),m.end.getTime(),l]);return t.createElement(He,{slotWidth:n,slotLevels:c,timelineHeaderCell:s})}),So=({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=y.ZonedDate.fromLocalDate(e,n),s=y.ZonedDate.fromLocalDate(a,n),o=y.firstDayOfMonth(y.firstMonthOfYear(y.getDate(r))),l=y.addDays(y.lastDayOfMonth(y.lastMonthOfYear(y.getDate(s))),1),i=y.ZonedDate.fromUTCDate(Ce(o),n),g=y.ZonedDate.fromUTCDate(Ce(l),n);return{start:new Date(i.getTime()),end:new Date(g.getTime()),zonedStart:i,zonedEnd:g}},ga={name:"year",dateRange:So,title:e=>e.toLanguageString(kt,ie[kt]),slotWidth:Ve};tt.defaultProps=ga;tt.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number};tt.displayName="GanttYearView";const Io=[{text:vn,operator:"contains"},{text:Tn,operator:"doesnotcontain"},{text:Ye,operator:"eq"},{text:Ze,operator:"neq"},{text:wn,operator:"startswith"},{text:bn,operator:"endswith"},{text:Xe,operator:"isnull"},{text:je,operator:"isnotnull"},{text:yn,operator:"isempty"},{text:En,operator:"isnotempty"}],Ro=[{text:Ye,operator:"eq"},{text:Ze,operator:"neq"},{text:Sn,operator:"gte"},{text:In,operator:"gt"},{text:Rn,operator:"lte"},{text:xn,operator:"lt"},{text:Xe,operator:"isnull"},{text:je,operator:"isnotnull"}],xo=[{text:Ye,operator:"eq"},{text:Ze,operator:"neq"},{text:Ln,operator:"gte"},{text:Vn,operator:"gt"},{text:An,operator:"lt"},{text:Gn,operator:"lte"},{text:Xe,operator:"isnull"},{text:je,operator:"isnotnull"}],Mo=[{text:Fn,operator:""},{text:Mn,operator:!0},{text:Nn,operator:!1}];function nt(e,a){return{clearButtonTitle:e.toLanguageString(Dt,ie[Dt]),operators:a.map(n=>({text:e.toLanguageString(n.text,ie[n.text]),operator:n.operator}))}}const ha=e=>{const{operators:a,...n}=e;return t.createElement(I.TextFilterCell,{ariaLabel:"text filter",...nt(J.useLocalization(),a||Io),...n})};ha.displayName="KendoReactGanttTextFilter";const fa=e=>{const{operators:a,...n}=e;return t.createElement(I.NumericFilterCell,{ariaLabel:"numeric filter",...nt(J.useLocalization(),a||Ro),...n})};fa.displayName="KendoReactGanttNumericFilter";const pa=e=>{const{operators:a,...n}=e;return t.createElement(I.BooleanFilterCell,{ariaLabel:"boolean filter",...nt(J.useLocalization(),a||Mo),...n})};pa.displayName="KendoReactGanttBooleanFilter";const Ca=e=>{const{operators:a,...n}=e;return t.createElement(I.DateFilterCell,{ariaLabel:"date filter",...nt(J.useLocalization(),a||xo),...n})};Ca.displayName="KendoReactGanttDateFilter";const No=e=>{const{dependencyData:a,dependencyModelFields:n,defaultDataItem:r,fromId:s,toId:o,type:l}=e,i=a.map(f=>({...f})),g=h.setter(n.fromId),d=h.setter(n.toId),m=h.setter(n.type),c=r?{...r}:{};return g(c,s),d(c,o),m(c,l),i.push(c),i},Fo=e=>{const{defaultDataItem:a,selectedDataItem:n,direction:r,taskModelFields:s,dataTree:o,slotStart:l,slotEnd:i}=e,g=Ae(o,s.children,v=>({...v})),d=h.setter(s.start),m=h.setter(s.end),c=h.getter(s.start),f=h.getter(s.end),k=h.setter(s.parentId||""),p=a?{...a}:{},D=c(p)&&f(p);if(!n||r==="none")D||(d(p,l),m(p,i)),s.parentId&&k(p,null),g.unshift(p);else{const v=[{task:{[s.children]:g},childrenIndex:0}],F=h.getter(s.id),A=h.getter(s.children),N=h.setter(s.children),O=F(n);for(;v.length>0;){const R=v[v.length-1],V=R.task,T=F(V),b=A(V);if(T&&T===O)break;b&&b.length&&b.length>R.childrenIndex?(v.push({task:b[R.childrenIndex],childrenIndex:0}),R.childrenIndex++):v.pop()}if(v.length>1){const R=v[v.length-1].task,V=v[v.length-2].childrenIndex,b=v[v.length-2].task,$=A(b);switch(r){case"child":{let W=A(R);W||(W=[],N(R,W)),D||(d(p,new Date(c(R).getTime())),m(p,new Date(f(R).getTime()))),W.push(p),k(p,F(R)),Be(v.splice(1,v.length-1).map(_=>_.task),s);break}case"above":{c(b)&&f(b)&&!D?(d(p,new Date(c(R).getTime())),m(p,new Date(f(R).getTime()))):(d(p,l),m(p,i)),$.splice(V-1,0,p),k(p,F(b)),Be(v.splice(1,v.length-2).map(W=>W.task),s);break}case"below":{c(b)&&f(b)&&!D?(d(p,new Date(c(R).getTime())),m(p,new Date(f(R).getTime()))):(d(p,l),m(p,i)),$.splice(V,0,p),k(p,F(b)),Be(v.splice(1,v.length-2).map(W=>W.task),s);break}}}}return g},Lo=e=>{const{updatedDataItem:a,taskModelFields:n,dataTree:r}=e,s=h.getter(n.id),o=h.getter(n.children),l=s(a);let i;const g=Ae(r,n.children,m=>s(m)===l?(i=m,{...a}):{...m});let d=[{task:{[n.children]:g},childrenIndex:0}];for(;d.length>0;){const m=d[d.length-1],c=m.task,f=s(c),k=o(c);if(f&&f===l)break;k&&k.length&&k.length>m.childrenIndex?(d.push({task:k[m.childrenIndex],childrenIndex:0}),m.childrenIndex++):d.pop()}if(d.length>1){d=d.splice(1,d.length-2);const m=h.getter(n.start),c=h.getter(n.end),f=h.getter(n.percentComplete),k=h.getter(n.parentId||"");if(m(i).getTime()!==m(a).getTime()){ka(d.map(D=>D.task),n);const p=m(a).getTime()-m(i).getTime();zo(o(a),n,p)}if(c(i).getTime()!==c(a).getTime()&&Da(d.map(p=>p.task),n),f(i)!==f(a)&&ya(d.map(p=>p.task),n),n.parentId&&k(i)!==k(a)){let p;return d.length?Ao(d.map(D=>D.task),n,i):p=g.filter(D=>s(D)!==s(a)),Go(p||g,n,a)}}return g},Vo=e=>{const{removedDataItem:a,taskModelFields:n,dataTree:r}=e,s=Ae(r,n.children,d=>({...d}));let o=[{task:{[n.children]:s},childrenIndex:0}];const l=h.getter(n.id),i=h.getter(n.children),g=l(a);for(;o.length>0;){const d=o[o.length-1],m=d.task,c=l(m),f=i(m);if(c&&c===g)break;f&&f.length&&f.length>d.childrenIndex?(o.push({task:f[d.childrenIndex],childrenIndex:0}),d.childrenIndex++):o.pop()}if(o.length>1){const d=o[o.length-2],m=d.task;i(m).splice(d.childrenIndex-1,1),o=o.splice(1,o.length-2),Be(o.map(f=>f.task),n)}return s},Be=(e,a)=>{ka(e,a),Da(e,a),ya(e,a)},Ao=(e,a,n)=>{const r=h.getter(a.children),s=h.setter(a.children);for(let o=e.length-1;o>=0;o--){const l=e[o],i=r(l);if(n.parentId===l.id){const g=i.filter(d=>d.parentId===l.id);s(l,g)}}},Go=(e,a,n)=>{const r=h.getter(a.children),s=h.setter(a.children);return n.parentId===null?[...e,n]:(e=Ae(e,a.children,o=>{if(o.id===n.parentId){const l=r(o)||[];s(o,[...l,n])}return{...o}}),e)},ka=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.start),s=h.setter(a.start);for(let o=e.length-1;o>=0;o--){const l=e[o],i=n(l);if(i&&i.length){const g=i.reduce((d,m)=>Math.min(d,r(m).getTime()),r(i[0]).getTime());s(l,new Date(g))}}},Da=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.end),s=h.setter(a.end);for(let o=e.length-1;o>=0;o--){const l=e[o],i=n(l);if(i&&i.length){const g=i.reduce((d,m)=>Math.max(d,r(m).getTime()),r(i[0]).getTime());s(l,new Date(g))}}},ya=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.percentComplete),s=h.setter(a.percentComplete),o=({avg:l,n:i},g)=>({avg:((r(g)||0)+i*l)/(i+1),n:i+1});for(let l=e.length-1;l>=0;l--){const i=e[l],g=n(i);if(g&&g.length){const d=g.reduce(o,{avg:0,n:0}).avg;s(i,d)}}},zo=(e,a,n)=>{if(!e)return;const r=h.getter(a.children),s=h.getter(a.start),o=h.setter(a.start),l=h.getter(a.end),i=h.setter(a.end),g=e.map(d=>({task:d,childrenIndex:0}));for(;g.length>0;){const d=g[g.length-1],m=d.task,c=r(m);c&&c.length&&c.length>d.childrenIndex?(g.push({task:c[d.childrenIndex],childrenIndex:0}),d.childrenIndex++):(g.pop(),o(m,new Date(s(m).getTime()+n)),i(m,new Date(l(m).getTime()+n)))}},Xt=e=>{const{validationMessage:a,touched:n,label:r,id:s,valid:o,disabled:l,hint:i,type:g,optional:d,...m}=e,c=n&&a,f=!c&&i,k=f?`${s}_hint`:"",p=c?`${s}_error`:"";return t.createElement(ee.FieldWrapper,{className:"k-col-span-full"},t.createElement(de.Label,{editorId:s,editorValid:o,editorDisabled:l,optional:d},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(Qt.Input,{valid:o,type:g,id:s,disabled:l,ariaDescribedBy:`${k} ${p}`,...m}),f&&t.createElement(de.Hint,{id:k},i),c&&t.createElement(de.Error,{id:p},a)))},We=e=>{const{validationMessage:a,touched:n,label:r,id:s,valid:o,disabled:l,hint:i,wrapperStyle:g,...d}=e,m=n&&a,c=!m&&i,f=c?`${s}_hint`:"",k=m?`${s}_error`:"",p=r?`${s}_label`:"";return t.createElement(ee.FieldWrapper,{style:g,className:"k-col-span-2"},t.createElement(de.Label,{id:p,editorId:s,editorValid:o,editorDisabled:l},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(Ma.DateTimePicker,{ariaLabelledBy:p,ariaDescribedBy:`${f} ${k}`,valid:o,id:s,disabled:l,...d}),c&&t.createElement(de.Hint,{id:f},i),m&&t.createElement(de.Error,{id:k},a)))},jt=e=>{const{validationMessage:a,visited:n,label:r,id:s,valid:o,disabled:l,hint:i,...g}=e,d=n&&a,m=!d&&i,c=m?`${s}_hint`:"",f=d?`${s}_error`:"";return t.createElement(ee.FieldWrapper,null,t.createElement(de.Label,{editorId:s,editorValid:o,editorDisabled:l},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(Qt.NumericTextBox,{ariaDescribedBy:`${c} ${f}`,valid:o,id:s,disabled:l,format:"p0",step:.01,...g}),m&&t.createElement(de.Hint,{id:c},i),d&&t.createElement(de.Error,{id:f},a)))},Ho=e=>{const{validationMessage:a,touched:n,label:r,id:s,valid:o,disabled:l,hint:i,idField:g,dataItem:d,...m}=e,c={id:null,title:"-None-",parentId:null},f=[],k=n&&a,p=!k&&i,D=p?`${s}_hint`:"",v=k?`${s}_error`:"",F=t.useCallback(V=>{if(!V||!V.children)return e.data;for(const b of V.children)f.push(b),b.children&&F(b);const T=f.map(b=>b.id);return e.data.filter(b=>!T.includes(b.id))},[e.data]),A=F(d),N=t.useMemo(()=>A.map(V=>{const T=new Date(V.start).toLocaleDateString(),b=new Date(V.end).toLocaleDateString();return{...V,title:`${V.title} (${T}-${b})`}}),[F]),O=t.useMemo(()=>Z.findByFieldValue(N,g,e.value),[N,g,e.value]),R=V=>{V.value.id===null?e.onChange({value:null}):e.onChange({value:V.value[g]})};return t.createElement(ee.FieldWrapper,{className:"k-col-span-full"},t.createElement(de.Label,{editorId:s,editorValid:o,editorDisabled:l},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(Z.DropDownList,{textField:"title",ariaDescribedBy:`${D} ${v}`,valid:o,id:s,disabled:l,...m,value:O,data:N,onChange:R,defaultItem:c}),p&&t.createElement(de.Hint,{id:D},i),k&&t.createElement(de.Error,{id:v},a)))},Po=(e,a,n,r)=>{const[s,o]=t.useState(e),l=t.useRef(null),i=c=>{r(a,"fromId",c.target.value.id)},g=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},d=t.useMemo(()=>Z.findByFieldValue(e,"id",a.fromId),[e,a.fromId]),m=c=>{const f=Ue.filterBy(e,c.filter);o(f)};return t.createElement("td",{ref:l,className:h.classNames(g()&&"k-selected")},t.createElement(Z.DropDownList,{textField:"title",data:s,value:d,onChange:i,filterable:!0,onFilterChange:m,required:!0}))},Oo=(e,a,n,r)=>{const s=i=>{r(a,"type",i.target.value.type)},o=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},l=t.useMemo(()=>Z.findByFieldValue(e,"type",a.type),[e,a.type]);return t.createElement("td",{className:h.classNames(o()&&"k-selected")},t.createElement(Z.DropDownList,{textField:"name",data:e,value:l,onChange:s}))},Wo=e=>{var m;const[a,n]=t.useState([]),r=J.useLocalization(),s=c=>r.toLanguageString(c,ie[c]),o=s(Ot),l=s(Wt),i=s(Bt),g=s(Kt),d=t.useMemo(()=>{const c=e.predecessors.map(f=>{const k=Z.findByFieldValue(e.flatTasks,"id",f.fromId),p=Z.findByFieldValue(e.dependencyTypes,"type",f.type);return{...f,taskTitle:k?k.title:"",typeName:p?p.type:""}});return Ue.orderBy(c,a)},[e.predecessors,e.dependencyTypes,e.flatTasks,a]);return t.createElement(Te.Grid,{data:d,sort:a,sortable:!0,onRowClick:e.onSelectRow,onSortChange:c=>{n(c.sort)},style:{height:"23em"}},t.createElement(Te.GridToolbar,null,t.createElement(te.Button,{icon:"plus",svgIcon:pe.plusIcon,onClick:e.addPredecessorsDependency},o),t.createElement(te.Button,{icon:"minus",svgIcon:pe.minusIcon,onClick:e.deleteDependency,disabled:((m=e.selectedItem)==null?void 0:m.id)===void 0},l)),t.createElement(Te.GridColumn,{field:"taskTitle",title:i,cell:c=>Po(e.flatTasks,c.dataItem,e.selectedItem,e.updateDependency)}),t.createElement(Te.GridColumn,{field:"typeName",title:g,cell:c=>Oo(e.dependencyTypes,c.dataItem,e.selectedItem,e.updateDependency)}))},_o=(e,a,n,r)=>{const[s,o]=t.useState(e),l=m=>{r(a,"toId",m.target.value.id)},i=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},g=t.useMemo(()=>Z.findByFieldValue(e,"id",a.toId),[e,a.toId]),d=m=>{const c=Ue.filterBy(e,m.filter);o(c)};return t.createElement("td",{className:h.classNames(i()&&"k-selected")},t.createElement(Z.DropDownList,{textField:"title",data:s,value:g,onChange:l,filterable:!0,onFilterChange:d,required:!0}))},Bo=(e,a,n,r)=>{const s=i=>{r(a,"type",i.target.value.type)},o=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},l=t.useMemo(()=>Z.findByFieldValue(e,"type",a.type),[e,a.type]);return t.createElement("td",{className:h.classNames(o()&&"k-selected")},t.createElement(Z.DropDownList,{textField:"name",data:e,value:l,onChange:s}))},Ko=e=>{var m;const[a,n]=t.useState([]),r=J.useLocalization(),s=c=>r.toLanguageString(c,ie[c]),o=s(Ot),l=s(Wt),i=s(Bt),g=s(Kt),d=t.useMemo(()=>{const c=e.successors.map(f=>{const k=Z.findByFieldValue(e.flatTasks,"id",f.toId),p=Z.findByFieldValue(e.dependencyTypes,"type",f.type);return{...f,taskTitle:k?k.title:"",typeName:p?p.type:""}});return Ue.orderBy(c,a)},[e.successors,e.dependencyTypes,e.flatTasks,a]);return t.createElement(Te.Grid,{data:d,sort:a,sortable:!0,onRowClick:e.onSelectRow,onSortChange:c=>{n(c.sort)},style:{height:"23em"}},t.createElement(Te.GridToolbar,null,t.createElement(te.Button,{icon:"plus",svgIcon:pe.plusIcon,onClick:e.addSuccessorsDependency},o),t.createElement(te.Button,{icon:"minus",svgIcon:pe.minusIcon,onClick:e.deleteDependency,disabled:((m=e.selectedItem)==null?void 0:m.id)===void 0},l)),t.createElement(Te.GridColumn,{field:"taskTitle",title:i,cell:c=>_o(e.flatTasks,c.dataItem,e.selectedItem,e.updateDependency)}),t.createElement(Te.GridColumn,{field:"type",title:g,cell:c=>Bo(e.dependencyTypes,c.dataItem,e.selectedItem,e.updateDependency)}))};var me=(e=>(e[e.FF=0]="FF",e[e.FS=1]="FS",e[e.SF=2]="SF",e[e.SS=3]="SS",e))(me||{});const $o=[{type:me.FF},{type:me.FS},{type:me.SF},{type:me.SS}],qo=e=>{const[a,n]=t.useState(0),[r,s]=t.useState(),[o,l]=t.useState([...e.dependencyData||[]]),[i,g]=t.useState([]),d=bt(),m=J.useLocalization(),c=C=>m.toLanguageString(C,ie[C]),f=c(_n),k=c(Bn),p=c(Kn),D=c($n),v=c(qn),F=c(Hn),A=c(Pn),N=c(On),O=c(Un),R=c(Yn),V=c(Zn),T=c(Xn),b=t.useMemo(()=>fe.flatData(e.taskData||[],C=>C.children||[],C=>{const G={title:C[d.title],id:C[d.id],start:C[d.start],end:C[d.end],parentId:null};return d.parentId&&(G.parentId=C[d.parentId]),G}),[e.taskData,d]),$=t.useMemo(()=>b.filter(C=>C.id!==e.dataItem.id),[b,e.dataItem]),W=t.useMemo(()=>o.filter(C=>C.toId===e.dataItem.id),[o,e.dataItem]),_=t.useMemo(()=>o.filter(C=>C.fromId===e.dataItem.id),[o,e.dataItem]),X=t.useMemo(()=>o.filter(C=>C.id===null).map(C=>({id:C.id,fromId:C.fromId,toId:C.toId,type:C.type})),[o]),E=t.useMemo(()=>o.filter(C=>C.id!==null&&C.uid).map(C=>({id:C.id,fromId:C.fromId,toId:C.toId,type:C.type})),[o]),P=()=>{if(r){if(r.id){const C=o.filter(K=>K.id!==r.id);l(C);const G=o.filter(K=>K.id===r.id);g(K=>[...K,...G])}else{const C=o.filter(K=>K.uid!==r.uid);l(C);const G=o.filter(K=>K.uid===r.uid);g(K=>[...K,...G])}s(void 0)}},Y=t.useCallback(C=>C||C===0?void 0:O,[O]),q=t.useCallback(C=>C||C===0?C>=0&&C<=1?void 0:T:O,[O,T]),S=t.useCallback((C,G)=>C&&G(d.end)&&C.getTime()>G(d.end).getTime()?R:void 0,[d,R]),ne=t.useCallback((C,G)=>C&&G(d.start)&&C.getTime()<G(d.start).getTime()?V:void 0,[d,V]),x=t.useMemo(()=>[Y,S],[Y,S]),L=t.useMemo(()=>[Y,ne],[Y,ne]),j=t.useMemo(()=>Z.findByFieldValue(o,"fromId",null)||Z.findByFieldValue(o,"toId",null),[o]),ae=C=>{j||(n(C.selected),s(void 0))},B=C=>{s(C.dataItem)},U=()=>{const C={uid:h.guid(),id:null,fromId:null,toId:e.dataItem.id,type:me.FS};l([...o,C])},ke=()=>{const C={uid:h.guid(),id:null,fromId:e.dataItem.id,toId:null,type:me.FS};l([...o,C])},De=(C,G,K)=>{const ue={...C,uid:C.uid||h.guid(),[G]:K},Ee=o.findIndex(ce=>ce.id&&ce.id===ue.id||ce.uid&&ce.uid===ue.uid);Ee>-1&&(o.splice(Ee,1,ue),l([...o]))},H=t.useMemo(()=>$o.map(C=>{let G;switch(C.type){case me.FF:G=c(yt);break;case me.FS:G=c(Qn);break;case me.SF:G=c(jn);break;case me.SS:G=c(Jn);break;default:G=c(yt);break}return{...C,name:G}}),[c]);t.useEffect(()=>{e.onDependencyCreate&&e.onDependencyCreate.call(void 0,{createdDependencies:X,updatedDependencies:E,deletedDependencies:i})},[X,E,i,e.onDependencyCreate]);const se=e.dependencyData&&e.taskData,Se=t.createElement(ee.FormElement,{style:{width:400},horizontal:!0},t.createElement(ee.Field,{id:`${d.title}_gantteditor`,name:d.title,label:f,component:Xt,validator:Y}),t.createElement(ee.Field,{id:`${d.start}_gantteditor`,name:d.start,label:k,component:We,validator:x}),t.createElement(ee.Field,{id:`${d.end}_gantteditor`,name:d.end,label:p,component:We,validator:L}),t.createElement(ee.Field,{id:`${d.percentComplete}_gantteditor`,name:d.percentComplete,label:D,component:jt,validator:q})),xe=t.createElement(ee.FormElement,{style:{paddingInline:"4px"}},t.createElement("div",{className:"k-form-fieldset"},t.createElement("div",{className:"k-form-layout k-d-grid k-grid-cols-4 k-gap-x-2"},t.createElement(ee.Field,{id:`${d.title}_gantteditor`,name:d.title,label:f,component:Xt,validator:Y}),t.createElement(ee.Field,{id:`${d.start}_gantteditor`,name:d.start,label:k,component:We,validator:x}),t.createElement(ee.Field,{id:`${d.end}_gantteditor`,name:d.end,label:p,component:We,validator:L}),t.createElement(ee.Field,{id:`${d.percentComplete}_gantteditor`,name:d.percentComplete,label:D,component:jt,validator:q}),d.parentId&&t.createElement(ee.Field,{id:`${d.parentId}_gantteditor`,name:d.parentId||"",idField:d.id,label:v,component:Ho,data:$,dataItem:e.dataItem})))),ye=t.createElement(Oe.TabStrip,{selected:a,onSelect:ae},t.createElement(Oe.TabStripTab,{title:F},xe),t.createElement(Oe.TabStripTab,{title:A},t.createElement(Wo,{flatTasks:b,predecessors:W,dependencyTypes:H,selectedItem:r,onSelectRow:B,addPredecessorsDependency:U,deleteDependency:P,updateDependency:De})),t.createElement(Oe.TabStripTab,{title:N},t.createElement(Ko,{flatTasks:b,successors:_,dependencyTypes:H,selectedItem:r,onSelectRow:B,addSuccessorsDependency:ke,deleteDependency:P,updateDependency:De})));return se?ye:Se},Uo=e=>{const{onCancel:a,onDelete:n,onClose:r,onSubmit:s,...o}=e,l=t.useRef(e.dataItem),[i,g]=t.useState({}),d=J.useLocalization(),m=T=>d.toLanguageString(T,ie[T]),c=m(zn),f=m(Pt),k=m(_t),p=m(Wn),D=t.useCallback(T=>{if(a){const b={syntheticEvent:T,nativeEvent:T.nativeEvent,dataItem:e.dataItem};a.call(void 0,b)}},[a,e.dataItem]),v=t.useCallback(T=>{if(n){const b={syntheticEvent:T,nativeEvent:T.nativeEvent,dataItem:e.dataItem};n.call(void 0,b)}},[n,e.dataItem]),F=t.useCallback(({syntheticEvent:T})=>{if(r){const b={syntheticEvent:T,nativeEvent:T.nativeEvent,dataItem:e.dataItem};r.call(void 0,b)}},[r,e.dataItem]),A=t.useCallback((T,b)=>{if(s){const $={dataItem:T,initialDataItem:l.current,syntheticEvent:b,nativeEvent:b&&b.nativeEvent,dependencies:i};s.call(void 0,$)}},[s,i]),N=t.useMemo(()=>Z.findByFieldValue(i.createdDependencies,"fromId",null)||Z.findByFieldValue(i.createdDependencies,"toId",null),[i]),O=t.useMemo(()=>i.createdDependencies&&i.createdDependencies.length&&N===void 0||i.updatedDependencies&&i.updatedDependencies.length||i.deletedDependencies&&i.deletedDependencies.length,[i,N]),R=t.useCallback(T=>{g(T)},[]),V=t.createElement(ee.Form,{initialValues:e.dataItem,onSubmit:A,render:T=>t.createElement(Ke.Window,{title:p,minWidth:90,width:554,modal:!0,height:0,onClose:F},t.createElement(qo,{taskData:e.taskData,dependencyData:e.dependencyData,dataItem:e.dataItem,onDependencyCreate:R}),t.createElement(Ke.WindowActionsBar,{layout:"start"},t.createElement(te.Button,{disabled:!T.allowSubmit&&!O,onClick:T.allowSubmit?T.onSubmit:b=>A(e.dataItem,b),icon:"save",svgIcon:pe.saveIcon,themeColor:"primary"},c),t.createElement(te.Button,{onClick:D,type:"button",icon:"cancel",svgIcon:pe.cancelIcon},f),t.createElement("div",{className:"k-spacer"}),n&&t.createElement(te.Button,{onClick:v,icon:"trash",svgIcon:pe.trashIcon,fillMode:"flat",themeColor:"primary"},k))),...o});return h.canUseDOM?en.createPortal(V,document&&document.body):null},Yo=e=>{const{onClose:a,onCancel:n,onConfirm:r,dataItem:s}=e,o=J.useLocalization(),l=D=>o.toLanguageString(D,ie[D]),i=l(_t),g=l(Pt),d=l(ra),m=l(sa),c=t.useCallback(({syntheticEvent:D})=>{a&&a.call(void 0,{syntheticEvent:D,nativeEvent:D&&D.nativeEvent,dataItem:null})},[a]),f=t.useCallback(D=>{n&&n.call(void 0,{syntheticEvent:D,nativeEvent:D&&D.nativeEvent,dataItem:null})},[n]),k=t.useCallback(D=>{r&&r.call(void 0,{syntheticEvent:D,nativeEvent:D&&D.nativeEvent,dataItem:s})},[r,s]),p=t.createElement(Ke.Dialog,{title:m,onClose:c},d,t.createElement(Ke.DialogActionsBar,{layout:"end"},t.createElement(te.Button,{themeColor:"primary",onClick:k},i),t.createElement(te.Button,{onClick:f},g)));return h.canUseDOM?en.createPortal(p,document&&document.body):null},Zo=fe.TreeListRow;Object.defineProperty(exports,"getSelectedState",{enumerable:!0,get:()=>I.getSelectedState});Object.defineProperty(exports,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>I.getSelectedStateFromKeyDown});Object.defineProperty(exports,"setSelectedState",{enumerable:!0,get:()=>I.setSelectedState});exports.GANTT_COL_INDEX_ATTRIBUTE=Fa;exports.GANTT_PREVENT_SELECTION_ELEMENT=La;exports.GANTT_ROW_INDEX_ATTRIBUTE=Na;exports.Gantt=Qe;exports.GanttBooleanFilter=pa;exports.GanttDateFilter=Ca;exports.GanttDayView=Je;exports.GanttForm=Uo;exports.GanttMonthView=et;exports.GanttNumericFilter=fa;exports.GanttRemoveDialog=Yo;exports.GanttRow=Zo;exports.GanttTextFilter=ha;exports.GanttWeekView=Pe;exports.GanttYearView=tt;exports.addDependency=No;exports.addTask=Fo;exports.createDataTree=Ba;exports.extendDataItem=_a;exports.filterBy=Wa;exports.mapTree=Ae;exports.orderBy=Oa;exports.removeTask=Vo;exports.updateTask=Lo;
5
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ra=require("react"),u=require("prop-types"),h=require("@progress/kendo-react-common"),y=require("@progress/kendo-date-math"),I=require("@progress/kendo-react-data-tools"),fe=require("@progress/kendo-react-treelist"),J=require("@progress/kendo-react-intl"),pe=require("@progress/kendo-svg-icons"),te=require("@progress/kendo-react-buttons"),xa=require("react-dom"),ee=require("@progress/kendo-react-form"),Ke=require("@progress/kendo-react-dialogs"),de=require("@progress/kendo-react-labels"),Qt=require("@progress/kendo-react-inputs"),Oe=require("@progress/kendo-react-layout"),Ma=require("@progress/kendo-react-dateinputs"),Z=require("@progress/kendo-react-dropdowns"),Te=require("@progress/kendo-react-grid"),Ue=require("@progress/kendo-data-query");function Jt(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return a.default=e,Object.freeze(a)}const t=Jt(Ra),en=Jt(xa),Na=I.TABLE_ROW_INDEX_ATTRIBUTE,Fa=I.TABLE_COL_INDEX_ATTRIBUTE,La=I.TABLE_PREVENT_SELECTION_ELEMENT,$t=new Date().getTime(),tn=7,Va="hh:mm a",mt={skeleton:"MEd"},Aa="MMM",Ga="yyyy",Ve=100,za=6,$e="data-dependency-drag-handle",Ha="start",Pa="finish",qt={[$e]:Ha},Ut={[$e]:Pa},qe="data-task-id",nn={id:"id",start:"start",end:"end",title:"title",percentComplete:"percentComplete",parentId:"parentId",isRollup:"isRollup",isExpanded:"isExpanded",isInEdit:"isInEdit",children:"children",isSelected:"isSelected"},an={id:"id",fromId:"fromId",toId:"toId",type:"type"},Oa=I.orderBy,Wa=I.filterBy,Ae=h.mapTree,_a=h.extendDataItem,Ba=fe.createDataTree,Ka=e=>({fields:{...nn,...e}}),$a=e=>({fields:{...an,...e}}),on=e=>y.getDate(e),Et=(e,a)=>y.getDate(y.addDays(e,a||1)),qa=(e,a,n,r)=>n<a&&e<=r;function Ce(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const ge=4,ut=10,Ua=(e,a,n,r)=>{const s=[];let o=0,l=0;const i=ut,g=Math.floor(n/2),d=e.top<a.top,m=()=>s.push({left:l,top:o});if(r===0||r===3){const c=r===3?"start":"end";o=e.top,l=e[c],m(),l=Math[c==="start"?"min":"max"](e[c],a[c]),l=c==="start"?l-i:l+i,m(),o=a.top,m(),l=c==="start"?a[c]-ge:a[c]+ge,m(),Yt(o,l,s,c!=="start")}else{const c=r===2?"start":"end",f=r===2?"end":"start",k=r===2?e[c]-ut*2>=a[f]:e[c]+ut*2<=a[f];o=e.top,l=e[c],m(),l=c==="start"?l-i:l+i,m(),k||(o=d?o+g:o-g,m(),l=c==="start"?a[f]+i:a[f]-i,m()),o=a.top,m(),l=f==="start"?a[f]-ge:a[f]+ge,m(),Yt(o,l,s,f!=="start")}return s},Yt=(e,a,n,r)=>r?Ya(e,a,n):Za(e,a,n),Ya=(e,a,n)=>{n.push({top:e-ge/2,left:a}),n.push({top:e,left:a-ge+1}),n.push({top:e+ge/2,left:a}),n.push({top:e,left:a})},Za=(e,a,n)=>{n.push({top:e+ge/2,left:a}),n.push({top:e,left:a+ge-1}),n.push({top:e-ge/2,left:a}),n.push({top:e,left:a})},rn=e=>{if(e.workWeekStart===void 0||e.workWeekEnd===void 0)return[];const a=[];let n=e.workWeekStart;for(a.push(n);e.workWeekEnd!==n;)n>6?n-=7:n++,a.push(n);return a},Xa=(e,a)=>{const n=e.getDay();return a.indexOf(n)>-1},sn=(e,{step:a,timezone:n})=>{const r=[],s=y.ZonedDate.fromLocalDate(e.start,n),o=y.ZonedDate.fromLocalDate(e.end,n);let l=s.clone();for(;l.getTime()<o.getTime();){const i=l.clone(),g=i.clone().addTime(a),d=new Date(i.getTime()),c={end:new Date(g.getTime()),start:d,zonedStart:i,zonedEnd:g};r.push(c),l=l.addTime(a)}return r},ja=(e,{timezone:a},n)=>{const r=[],s=y.ZonedDate.fromLocalDate(e.start,a),o=y.ZonedDate.fromLocalDate(e.end,a);for(let l=s.clone(),i=0;l.getTime()<o.getTime();i++){const g=l.clone(),d=Et(y.firstDayInWeek(y.getDate(g),n.firstDay()),tn),m=y.ZonedDate.fromUTCDate(Ce(d),a),c=m.getTime()>o.getTime()?o.clone():m;l=c.clone();const f=new Date(g.getTime()),p={end:new Date(c.getTime()),start:f,zonedStart:g,zonedEnd:c};r.push(p)}return r},Qa=(e,{timezone:a})=>{const n=[],r=y.ZonedDate.fromLocalDate(e.start,a),s=y.ZonedDate.fromLocalDate(e.end,a);for(let o=r.clone(),l=0;o.getTime()<s.getTime();l++){const i=o.clone(),g=y.ZonedDate.fromLocalDate(y.addMonths(new Date(i.getTime()),1),a);o=g.clone();const d=new Date(i.getTime()),c={end:new Date(g.getTime()),start:d,zonedStart:i,zonedEnd:g};n.push(c)}return n},Ja=(e,{timezone:a})=>{const n=[],r=y.ZonedDate.fromLocalDate(e.start,a),s=y.ZonedDate.fromLocalDate(e.end,a);for(let o=r.clone(),l=0;o.getTime()<s.getTime();l++){const i=o.clone(),g=y.ZonedDate.fromLocalDate(y.addMonths(new Date(i.getTime()),12),a);o=g.clone();const d=new Date(i.getTime()),c={end:new Date(g.getTime()),start:d,zonedStart:i,zonedEnd:g};n.push(c)}return n},eo=(e,a,n)=>{const r=n.parseDate(a.workDayStart).getHours(),s=n.parseDate(a.workDayEnd).getHours();return sn(e,{step:y.MS_PER_MINUTE*a.slotDuration,timezone:a.timezone}).map(l=>{const i=l.zonedStart.getHours();return{range:l,isWork:i>=r&&i<s,span:1,text:n.formatDate(l.zonedStart,Va),type:"time"}})},ln=(e,a,n)=>sn(e,{step:y.MS_PER_DAY,timezone:a.timezone}).map(s=>({range:s,isWork:Xa(s.start,a.workDays),span:1,text:n.formatDate(s.zonedStart,mt),type:"day"})),cn=(e,a,n)=>ja(e,{timezone:a.timezone},n).map(s=>{const o=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/y.MS_PER_DAY);return{range:s,isWork:!1,span:o,text:`${n.formatDate(s.zonedStart,mt)} - ${n.formatDate(s.zonedEnd,mt)}`,type:"week"}}),dn=(e,a,n)=>Qa(e,{timezone:a.timezone}).map(s=>{const o=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/y.MS_PER_DAY);return{range:s,isWork:!1,span:o,text:n.formatDate(s.zonedStart,Aa),type:"month"}}),to=(e,a,n)=>Ja(e,{timezone:a.timezone}).map(s=>{const o=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/y.MS_PER_DAY);return{range:s,isWork:!1,span:o,text:n.formatDate(s.zonedStart,Ga),type:"year"}}),no=(e,a,n)=>{const r=n;return t.createElement("table",{className:"k-table k-table-md",ref:a,"aria-hidden":!0},t.createElement("tbody",{className:"k-table-tbody"},e.map((s,o)=>t.createElement("tr",{className:"k-table-row",key:o},s.map((l,i)=>t.createElement("td",{key:l.range.start.getTime(),colSpan:l.span,className:h.classNames("k-table-th",{"k-header":!0,"k-nonwork-hour":!l.isWork})},r?t.createElement(r,{rowIndex:o,index:i,range:l.range,text:l.text,isWork:l.isWork,type:l.type}):l.text))))))},ao=(e,a)=>{const n=e[e.length-1];return t.createElement("table",{className:"k-table k-table-md k-gantt-columns",ref:a,"aria-hidden":!0},t.createElement("tbody",{className:"k-table-tbody"},t.createElement("tr",{className:"k-table-row"},n.map(r=>t.createElement("td",{key:r.range.start.getTime(),colSpan:r.span,className:h.classNames("k-table-td",{"k-nonwork-hour":!r.isWork})})))))},oo=(e,a)=>{const n=e[e.length-1];let r=0,s=0;return n.forEach(o=>{const l=o.span;s+=l,l>r&&(r=l)}),Math.round(s*a/r)},gt=(e,a)=>!!h.getter(a)(e),un=(e,a)=>!!h.getter(a)(e),ro=(e,a)=>n=>gt(n,e)&&un(n,a)?[...h.getter(a)(n)]:[],wt=t.createContext([]),so=()=>t.useContext(wt);wt.displayName="KendoReactGanttTaskDataContext";const vt=t.createContext([]),lo=()=>t.useContext(vt);vt.displayName="KendoReactGanttDependencyDataContext";const Tt=t.createContext(nn),bt=()=>t.useContext(Tt);Tt.displayName="KendoReactGanttTaskModelFieldsContext";const St=t.createContext(an),mn=()=>t.useContext(St);St.displayName="KendoReactGanttDependencyModelFieldsContext";const It=t.createContext({}),Ge=()=>t.useContext(It);It.displayName="KendoReactGanttPropsContext";const Rt=t.createContext({start:new Date,end:new Date,zonedStart:y.ZonedDate.fromLocalDate(new Date),zonedEnd:y.ZonedDate.fromLocalDate(new Date)}),ze=()=>t.useContext(Rt);Rt.displayName="KendoReactGanttDateRangeContext";const xt=t.createContext([]),io=()=>t.useContext(xt);xt.displayName="KendoReactGanttViewsContext";const Mt=t.createContext(["week",h.noop]),gn=()=>t.useContext(Mt);Mt.displayName="KendoReactGanttActiveViewContext";const Nt=t.createContext(0),hn=()=>t.useContext(Nt);Nt.displayName="KendoReactGanttRowHeightContext";const Ft=t.createContext(0),co=()=>t.useContext(Ft);Ft.displayName="KendoReactGanttToolbarHeightContext";const Lt=t.createContext({onDataStateChange:h.noop,onSortChange:h.noop,onFilterChange:h.noop,onColumnMenuFilterChange:h.noop,onExpandChange:h.noop,onRowClick:h.noop,onRowDoubleClick:h.noop,onRowContextMenu:h.noop,onColumnResize:h.noop,onColumnReorder:h.noop,onDependencyCreate:h.noop,onKeyDown:h.noop,onSelectionChange:h.noop,onHeaderSelectionChange:h.noop}),uo=()=>t.useContext(Lt);Lt.displayName="KendoReactGanttEventsContext";const Vt=t.createContext({onTaskClick:h.noop,onTaskDoubleClick:h.noop,onTaskContextMenu:h.noop}),mo=()=>t.useContext(Vt);Vt.displayName="KendoReactGanttTaskEventsContext";const fn=({children:e,taskData:a,dependencyData:n,taskModelFields:r,dependencyModelFields:s,props:o,dateRange:l,views:i,activeView:g,rowHeight:d,toolbarHeight:m,events:c,taskEvents:f})=>t.createElement(It.Provider,{value:o},t.createElement(wt.Provider,{value:a},t.createElement(vt.Provider,{value:n},t.createElement(Tt.Provider,{value:r},t.createElement(St.Provider,{value:s},t.createElement(Rt.Provider,{value:l},t.createElement(xt.Provider,{value:i},t.createElement(Mt.Provider,{value:g},t.createElement(Nt.Provider,{value:d},t.createElement(Ft.Provider,{value:m},t.createElement(Lt.Provider,{value:c},t.createElement(Vt.Provider,{value:f},e))))))))))));fn.displayName="KendoReactGanttContext";const At=t.createContext([{current:{}},h.noop]),pn=()=>t.useContext(At);At.displayName="KendoReactGanttViewContext";const Gt=t.createContext(0),go=()=>t.useContext(Gt);Gt.displayName="KendoReactGanttViewTimelineWidthContext";const zt=t.createContext({onDependencyHandlePress:h.noop,onDependencyHandleDrag:h.noop,onDependencyHandleRelease:h.noop,isEnabled:!1,draggedId:null}),ho=()=>t.useContext(zt);zt.displayName="KendoReactGanttViewDependencyDragContext";const Cn=({children:e,tasksStore:a,timelineWidth:n,dependencyDrag:r})=>t.createElement(At.Provider,{value:a},t.createElement(Gt.Provider,{value:n},t.createElement(zt.Provider,{value:r},e)));Cn.displayName="KendoReactGanttViewContext";var ht=(e=>(e[e.add=0]="add",e[e.remove=1]="remove",e))(ht||{});const fo=()=>{const e=t.useRef({}),a=t.useCallback(n=>{switch(n.type){case 0:e.current[n.id]=n.itemRef;break;case 1:delete e.current[n.id];break}},[]);return[e,a]},po=(e,a,n,r)=>{const s=t.useRef(null),[,o]=pn();t.useImperativeHandle(s,()=>({element:r.current,dataItem:e})),t.useImperativeHandle(n,()=>s.current),h.useIsomorphicLayoutEffect(()=>{const l=s.current;if(l)return o({type:ht.add,itemRef:l,id:a}),()=>{o({type:ht.remove,itemRef:l,id:a})}})},kn=t.forwardRef((e,a)=>{const n=ze(),r=bt(),s=go(),o=ho(),l=mo(),i=t.useRef(null),g=t.useRef(null);po(e.dataItem,h.getter(r.id)(e.dataItem),a,i);const d=t.useRef(null),m=h.getter(r.id)(e.dataItem),c=h.getter(r.start)(e.dataItem),f=h.getter(r.end)(e.dataItem),k=h.getter(r.title)(e.dataItem),p=h.getter(r.percentComplete)(e.dataItem),D=h.getter(r.children)(e.dataItem),v=h.getter(r.isSelected)(e.dataItem),F=c&&c.getTime(),A=f&&f.getTime(),N=D&&D.length,O=!N&&F===A,R=F&&A&&qa(n.start,n.end,c,f),[V,T]=t.useState(!1),b=t.useRef(null),$=t.useRef(null);h.useDraggable(b,{onPress:o.onDependencyHandlePress,onDrag:o.onDependencyHandleDrag,onRelease:o.onDependencyHandleRelease}),h.useDraggable($,{onPress:o.onDependencyHandlePress,onDrag:o.onDependencyHandleDrag,onRelease:o.onDependencyHandleRelease});const W=t.useCallback(S=>{l.onTaskClick&&l.onTaskClick({dataItem:e.dataItem,level:e.level,nativeEvent:S&&S.nativeEvent,syntheticEvent:S,target:null})},[e.dataItem,e.level]),_=t.useCallback(S=>{l.onTaskDoubleClick&&l.onTaskDoubleClick({dataItem:e.dataItem,level:e.level,nativeEvent:S&&S.nativeEvent,syntheticEvent:S,target:null})},[e.dataItem,e.level]),X=t.useCallback(S=>{l.onTaskContextMenu&&l.onTaskContextMenu({dataItem:e.dataItem,level:e.level,nativeEvent:S&&S.nativeEvent,syntheticEvent:S,target:null})},[e.dataItem,e.level]),E=t.useCallback(S=>{l.onTaskRemoveClick&&l.onTaskRemoveClick({dataItem:e.dataItem,level:e.level,nativeEvent:S&&S.nativeEvent,syntheticEvent:S,target:null})},[e.dataItem,e.level]),P=t.useCallback(()=>{const S=n.start,ne=n.end,x=d.current,L=i.current,j=g.current;if(!R||x===null||L===null)return;const ae=x.clientWidth/(ne.getTime()-S.getTime()),B=(c.getTime()-S.getTime())*ae,U=(f.getTime()-c.getTime())*ae,ke=(x.offsetHeight-L.offsetHeight)/2;L.style.left=`${Math.round(O?B-za:B)}px`,L.style.top=`${Math.round(ke)}px`,O||(L.style.width=`${Math.round(U)}px`,j!==null&&(j.style.width=`${Math.round(U*(p||0))}px`)),T(!0)},[n.start.getTime(),n.end.getTime(),F,A,R,p,s]);t.useEffect(P,[P]);const Y={visibility:V?void 0:"hidden",display:R?void 0:"none"},q={userSelect:"none",display:o.draggedId===String(m)?"block":void 0};return t.createElement("td",{ref:d,key:m,role:"presentation"},O?t.createElement("div",{"aria-hidden":!0,className:h.classNames({"k-task":!0,"k-task-milestone":!0,"k-selected":v&&!Array.isArray(v)}),style:Y,ref:i,[qe]:m,onClick:W,onDoubleClick:_,onContextMenu:X},t.createElement("div",{className:"k-task-milestone-content"}),o.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-start",ref:b,style:q,...qt}),o.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-end",ref:$,style:q,...Ut})):t.createElement("div",{"aria-hidden":!0,className:h.classNames({"k-task":!0,"k-task-summary":N,"k-task-single":!N,"k-selected":v&&!Array.isArray(v)}),ref:i,style:Y,[qe]:m,onClick:W,onDoubleClick:_,onContextMenu:X},N?t.createElement("div",{className:"k-task-summary-progress",ref:g},t.createElement("div",{className:"k-task-summary-complete"})):t.createElement("div",{className:"k-task-complete",ref:g}),!N&&t.createElement(t.Fragment,null,t.createElement("div",{className:"k-task-content"},k),l.onTaskRemoveClick?t.createElement("span",{className:"k-task-actions"},t.createElement("span",{onClick:E,className:"k-link k-task-delete","aria-label":"Delete"},t.createElement(h.IconWrap,{name:"x",icon:pe.xIcon}))):null),o.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-start",ref:b,style:q,...qt}),o.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-end",ref:$,style:q,...Ut})))});kn.displayName="KendoReactGanttTask";const Dn=e=>{const{dependency:a}=e,[n]=pn(),r=t.useRef(null),s=mn(),o=hn(),[l,i]=t.useState(!1),g=()=>{if(r.current===null||n.current===null){i(!1);return}const d=n.current[h.getter(s.fromId)(a)],m=n.current[h.getter(s.toId)(a)];if(!d||!m){i(!1);return}const c=d.element,f=m.element;if(!c||!f){i(!1);return}if(l===!1){i(!0);return}const k={top:c.offsetTop+c.offsetHeight/2,start:c.offsetLeft,end:c.offsetLeft+c.offsetWidth},p={top:f.offsetTop+f.offsetHeight/2,start:f.offsetLeft,end:f.offsetLeft+f.offsetWidth},D=h.getter(s.type)(a),v=Ua(k,p,o,D);v&&v.length&&r.current.setAttribute("points",v.map(F=>`${F.left},${F.top}`).join(" "))};return t.useEffect(g),t.createElement("polyline",{ref:r,style:{display:l?void 0:"none"}})};Dn.displayName="KendoReactGanttDependency";class Ht extends t.Component{constructor(a){super(a),this.state={activeId:void 0,level:0},this.tableElement=null,this.tbodyElement=null,this.wrapperScrollLeft=0,this.wrapperScrollTop=0,this.updateOnScroll=!1,this.tbodyOffsetTop=0,this.prevData=[],this.flattedData=[],this.element=null,this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this.scrollIntoView=n=>{if(!this.element)return;const{rowIndex:r=0}=n,{rowHeight:s=0}=this.props;this.element.scroll(0,(r-1)*s)},this.getColumns=n=>{const r=n.filter(o=>o.declarationIndex>=0&&o.parentIndex===-1),s=o=>(o.sort((l,i)=>l.declarationIndex-i.declarationIndex),o.map(l=>{const{declarationIndex:i,parentIndex:g,depth:d,colSpan:m,rowSpan:c,index:f,kFirst:k,groupable:p,children:D,...v}=l;return D.length?{children:s(D),...v}:v}));return s(r)},this.onKeyDown=n=>{if(I.tableKeyboardNavigation.onKeyDown(n,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.props.onKeyDown){const{mode:r,cell:s}=I.getSelectionOptions(this.props.selectable),o={dataItems:this.getLeafDataItems(),mode:r,cell:s,componentId:this.props.treelistId,selectedField:this.props.selectedField,...this.getEventArguments(n)};this.props.onKeyDown.call(void 0,o)}},this.onFocus=n=>{I.tableKeyboardNavigation.onFocus(n,{contextStateRef:this.contextStateRef})},this.onRowDrag=n=>{if(this.props.onRowDrag){const r={...n,target:this};this.props.onRowDrag.call(void 0,r)}},this.onRowDrop=n=>{if(this.props.onRowDrop){const r={...n,target:this};this.props.onRowDrop.call(void 0,r)}},this.onColumnReorder=(n,r,s)=>{const{extendedColumns:o}=this.props,l=o[n].depth,i=m=>{do m++;while(m<o.length&&o[m].depth>l);return m},g=[...o],d=g.splice(n,i(n)-n);if(g.splice(n<r?i(r-d.length):r,0,...d),g.filter(m=>m.declarationIndex>=0).forEach((m,c)=>m.orderIndex=c),this.props.onColumnReorder){const m={target:this,columns:this.getColumns(g),nativeEvent:s};this.props.onColumnReorder.call(void 0,m)}},this.onColumnResize=(n,r,s,o,l)=>{if(this.props.onColumnResize){const i=this.props.extendedColumns.filter(d=>d.children.length===0).reduce((d,m)=>d+=parseFloat(String(m.width)),0);this.tableElement&&(this.tableElement.style.width=i+"px");const g={columns:this.getColumns(this.props.extendedColumns),totalWidth:i,index:n,nativeEvent:o,newWidth:r,oldWidth:s,end:l,target:this};this.props.onColumnResize.call(void 0,g)}},this.onScroll=n=>{const r=n.currentTarget.scrollLeft,s=n.currentTarget.scrollTop,{columnVirtualization:o,scrollable:l,rowHeight:i=0}=this.props,g=i,d=0;let m=!1;o&&Math.abs(this.wrapperScrollLeft-r)>d&&(this.wrapperScrollLeft=r,m=!0),l==="virtual"&&Math.abs(this.wrapperScrollTop-s)>g&&(this.wrapperScrollTop=s,m=!0),m&&(this.updateOnScroll=!0,this.forceUpdate())},this.calculateSizes=n=>{if(!n||this.props.scrollable==="none")return;const r=Array.from(n.childNodes),s=r.find(i=>i.nodeName==="TABLE"),o=this.props.toolbar&&r.find(i=>i.nodeType===1&&i.classList.contains("k-grid-toolbar"));let l=0;if(o){const i=o.style.boxSizing;o.style.boxSizing="border-box",l=parseFloat(String(window.getComputedStyle(o).height))||o.offsetHeight,o.style.boxSizing=i,o.getAttribute("style")||o.removeAttribute("style")}this.tbodyOffsetTop=s.tBodies[0].offsetTop,fe.setHeaderRowsTop(s,l)},this.onItemChange=n=>{if(n.field===this.props.expandField){const r=this.props.onExpandChange;if(r){const s={...this.getEventArguments(n.syntheticEvent),dataItem:n.dataItem,level:n.level,value:n.value};r.call(void 0,s)}return}if(this.props.onItemChange){const r={...this.getEventArguments(n.syntheticEvent),dataItem:n.dataItem,level:n.level,field:n.field,value:n.value};this.props.onItemChange.call(void 0,r)}},this.onHeaderSelectionChange=n=>{if(this.props.onHeaderSelectionChange){const r={field:n.field,nativeEvent:n.syntheticEvent&&n.syntheticEvent.nativeEvent,syntheticEvent:n.syntheticEvent,target:this,dataItems:this.getLeafDataItems()};this.props.onHeaderSelectionChange.call(void 0,r)}},this.selectionRelease=n=>{if(this.props.onSelectionChange){const r={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this.props.treelistId,dataItems:this.getLeafDataItems(),dataItem:null,level:[],...n};this.props.onSelectionChange.call(void 0,r)}},this.onSortChange=(n,r,s)=>{this.onDataStateChange(this.props.onSortChange,{sort:r,field:s},n)},this.onFilterChange=n=>{const{filter:r,field:s}=n;this.onDataStateChange(this.props.onFilterChange,{filter:r,field:s},n.syntheticEvent)},this.onColumnMenuFilterChange=(n,r,s)=>{if(!s)return;const{onColumnMenuFilterChange:o}=this.props;if(!o)return;const l={syntheticEvent:n,filter:r,field:s,target:this,nativeEvent:n.nativeEvent};o.call(void 0,l)},this.onExpandChange=(n,r,s)=>{const{expandField:o,onExpandChange:l}=this.props;if(o&&l){const i={...this.getEventArguments(n),dataItem:r,level:s,value:gt(r,this.props.expandField)};l.call(void 0,i)}},this.onRowClick=(n,r)=>{if(this.props.onRowClick&&n.target.nodeName==="TD"){const s={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowClick.call(void 0,s)}},this.rowDoubleClick=(n,r)=>{if(this.props.onRowDoubleClick&&n.target.nodeName==="TD"){const s={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowDoubleClick.call(void 0,s)}},this.rowContextMenu=(n,r)=>{if(this.props.onRowContextMenu&&n.target.nodeName==="TD"){const s={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowContextMenu.call(void 0,s)}},this.onPageChange=n=>{if(this.props.onPageChange){const r={...this.getEventArguments(n.syntheticEvent),skip:n.skip,take:n.take};this.props.onPageChange.call(void 0,r)}},this.onDataStateChange=(n,r,s)=>{if(n&&n.call(void 0,{...this.getEventArguments(s),...r}),this.props.onDataStateChange){const o={...this.getEventArguments(s),dataState:{...this.getDataState(),...r}};this.props.onDataStateChange.call(void 0,o)}},this.getDataState=()=>({filter:this.props.filter,sort:this.props.sort}),this.getEventArguments=n=>({nativeEvent:n&&n.nativeEvent,syntheticEvent:n,target:this}),this.getLeafDataItems=()=>this.flatData.map(n=>n.dataItem),this.dragLogic=new I.CommonDragLogic(this.onColumnReorder,h.noop,h.noop),this.columnResize=new I.ColumnResize(this.onColumnResize),I.tableKeyboardNavigation.onConstructor({navigatable:!!a.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:a.idPrefix})}get document(){if(h.canUseDOM)return this.element&&this.element.ownerDocument||document}componentDidMount(){this.calculateSizes(this.element),I.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}getSnapshotBeforeUpdate(){return I.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(a){a.columns!==this.props.columns&&this.calculateSizes(this.element),I.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){this.columnResize.columns=[],this.dragLogic.columns=[],this.prevData=[],this.flattedData=[],this.updateOnScroll=!1}render(){const{filterRow:a,scrollable:n="scrollable",resizable:r=!1,reorderable:s=!1,skip:o,take:l,afterContent:i,extendedColumns:g=[],columnsMap:d}=this.props,m=g.some(E=>!!E.filter)||a!==void 0,c=a||I.FilterRow,f=I.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this.columnResize.columns=g,this.columnResize.resizable=r,this.dragLogic.columns=g,this.dragLogic.reorderable=s,this.dragLogic.groupable=!1;const k=g.filter(E=>E.children.length===0),p=t.createElement(I.Header,{headerRow:t.createElement(I.HeaderRow,{sort:this.props.sort,sortable:this.props.sortable,sortChange:this.onSortChange,selectionChange:this.onHeaderSelectionChange,columns:g,columnsMap:d,cellRender:this.props.headerCellRender,columnResize:this.columnResize,columnMenu:this.props.columnMenu,columnMenuFilter:this.props.columnMenuFilter,columnMenuFilterChange:this.onColumnMenuFilterChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler}),filterRow:m&&t.createElement(c,{columns:k,filter:this.props.filter,filterChange:this.onFilterChange,sort:this.props.sort,ariaRowIndex:d.length+1})||void 0,columnResize:this.columnResize}),D=this.props.style||{},{colSpans:v,hiddenColumns:F}=I.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:k,scrollLeft:this.wrapperScrollLeft,tableViewPortWidth:parseFloat((D.width||"").toString())}),A=(E,P,Y,q,S,ne)=>k.map((x,L)=>{if(F[L])return null;const j=x.id?x.id:L,ae=`k-table-td ${x.className?x.className+" ":""}${x.locked?"k-grid-content-sticky":""}`,B={id:I.tableKeyboardNavigationTools.generateNavigatableId(`${Y}-${String(L)}`,f),colSpan:v[L],dataItem:E.dataItem,field:x.field,format:x.format,className:ae||void 0,render:this.props.cellRender,onChange:this.onItemChange,selectionChange:this.props.onSelectionChange?U=>{this.onSelectionChange({event:U,item:E,columnIndex:L,dataIndex:S})}:void 0,level:E.level,expandable:x.expandable,expanded:q,hasChildren:un(E.dataItem,this.props.subItemsField),colIndex:L,ariaColumnIndex:x.ariaColumnIndex,onExpandChange:this.onExpandChange,style:x.left!==void 0&&{left:x.left,right:x.right,borderRightWidth:x.rightBorder?"1px":""}||{},isSelected:Array.isArray(ne)&&ne.indexOf(L)>-1};return P&&x.editCell?t.createElement(x.editCell,{...B,onChange:this.onItemChange,key:j}):x.cell?t.createElement(x.cell,{key:j,...B}):t.createElement(fe.TreeListCell,{key:j,...B})});let N=this.flatData;const O=N.length;o!==void 0&&l!==void 0&&(N=N.slice(o,o+l)),n==="virtual"&&(N=fe.tableRowsVirtualization({rows:N,tableViewPortHeight:parseFloat((D.height||D.maxHeight||"").toString()),scrollTop:this.wrapperScrollTop}),this.updateOnScroll=!1);const R=N.map(E=>E.level),V=d.length+(m?1:0)+1,T=N.length>0&&N.map((E,P)=>{const Y=h.getter(this.props.editField||"")(E.dataItem),q=h.getter(this.props.dataItemKey)(E.dataItem),S=String(q||E.level.join(".")),ne=gt(E.dataItem,this.props.expandField),x=this.props.selectedField?h.getter(this.props.selectedField)(E.dataItem):void 0,L={key:S,level:E.level,levels:R,dataItem:E.dataItem,selectedField:this.props.selectedField,rowHeight:E.height,render:this.props.rowRender,onDrop:this.onRowDrop,onDrag:this.onRowDrag,onClick:U=>this.onRowClick(U,E),onDoubleClick:U=>this.rowDoubleClick(U,E),onContextMenu:U=>this.rowContextMenu(U,E),isAltRow:P%2!==0,expanded:ne,rowIndex:P,ariaRowIndex:V+P,ariaSetSize:E.levelCount,ariaPosInSet:E.level[E.level.length-1]+1,isSelected:typeof x=="boolean"&&x},j=this.props.editRow,ae=this.props.row||fe.TreeListRow,B=A(E,Y,S,ne,P,x);return Y&&j?t.createElement(j,{...L,key:L.key},B):t.createElement(ae,{...L,key:L.key},B)})||t.createElement("tr",{className:"k-table-row k-grid-norecords"},t.createElement("td",{className:"k-table-td",colSpan:k.length},this.props.noRecords||t.createElement(fe.TreeListNoRecords,null))),b=E=>this.props.sort&&this.props.sort.some(P=>P.field===E),$=t.createElement("colgroup",{ref:E=>{this.columnResize.colGroupMain=E}},k.map((E,P)=>t.createElement("col",{key:P.toString(),className:b(E.field)?"k-sorted":void 0,style:E.width!==void 0?{width:E.width}:void 0}))),W=this.props.columnVirtualization||this.props.scrollable==="virtual",_=this.props.selectable&&this.props.selectable.drag?"none":void 0,X=this.props.tableProps||{};return t.createElement(I.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},t.createElement("div",{id:this.props.treelistId,style:this.props.style,className:h.classNames("k-grid k-grid-md",this.props.className,{"k-treelist-scrollable":n!=="none"}),ref:E=>this.element=E,onScroll:W?this.onScroll:void 0,onKeyDown:this.onKeyDown,onFocus:this.onFocus,"aria-rowcount":O,"aria-colcount":k.length,role:"treegrid",...I.tableKeyboardNavigationScopeAttributes},this.props.toolbar,t.createElement(I.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:E=>{this.tableElement=E}},t.createElement("table",{className:"k-table k-table-md",...this.props.tableProps||{},style:{...X.style||{},userSelect:_},role:"presentation"},$,p,t.createElement("tbody",{className:"k-table-tbody",...I.tableKeyboardNavigationBodyAttributes,ref:E=>this.tbodyElement=E,role:"presentation"},T))),this.props.pager&&t.createElement(this.props.pager,{className:"k-grid-pager",total:O,skip:o,take:l,onPageChange:this.onPageChange}),s&&t.createElement(t.Fragment,null,t.createElement(I.DropClue,{ref:this.dragLogic.refDropElementClue}),t.createElement(I.DragClue,{ref:this.dragLogic.refDragElementClue})),i))}get flatData(){const{data:a=[],rowHeight:n=0}=this.props;let r=0;const s=()=>{const l={height:n,offsetTop:r};return r+=l.height,l},o=this.updateOnScroll&&this.prevData===a&&this.tbodyOffsetTop>0&&this.flattedData.length?this.flattedData:a.map(l=>({...l,...s()}));return this.prevData=a,this.flattedData=o,o}onSelectionChange(a){if(this.props.onSelectionChange){const{event:n,item:r,dataIndex:s,columnIndex:o}=a,{mode:l,cell:i}=I.getSelectionOptions(this.props.selectable),g={...this.getEventArguments(n.syntheticEvent),dataItem:r.dataItem,level:r.level,startColIndex:o,endColIndex:o,startRowIndex:s,endRowIndex:s,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:l,cell:i,isDrag:!1,componentId:this.props.treelistId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,g)}}}Ht.propTypes={data:u.array,resizable:u.bool,reorderable:u.bool,sortable:u.oneOfType([u.bool,u.shape({mode:u.oneOf(["single","multiple"]),allowUnsort:u.bool})]),onSortChange:u.func,sort:u.array,columns:u.arrayOf(u.object),columnVirtualization:u.bool,filter:u.array,onFilterChange:u.func,filterRow:u.any,toolbar:u.any,noRecords:u.any,onExpandChange:u.func,expandField:u.string,subItemsField:u.string,selectedField:u.string,onSelectionChange:u.func,onHeaderSelectionChange:u.func,onRowClick:u.func,onItemChange:u.func,editField:u.string,scrollable:u.oneOf(["none","scrollable","virtual"]),rowHeight:u.number,style:u.object,tableProps:u.object,pager:u.any,skip:u.number,take:u.number,onPageChange:u.func,onDataStateChange:u.func,onColumnResize:u.func,onColumnReorder:u.func,extendedColumns:u.arrayOf(u.object),columnsMap:u.arrayOf(u.array),dataItemKey:u.string.isRequired,afterContent:u.any,navigatable:u.bool,idPrefix:u.string,treelistId:u.string};Ht.contextType=I.TableKeyboardNavigationContext;const He=t.forwardRef((e,a)=>{const{slotLevels:n,slotWidth:r,timelineHeaderCell:s}=e,{columns:o,noRecords:l,resizable:i,reorderable:g,sortable:d,sort:m,filter:c,columnMenuFilter:f,columnMenu:k,navigatable:p,row:D,selectable:v}=Ge(),{onDataStateChange:F,onSortChange:A,onFilterChange:N,onColumnMenuFilterChange:O,onExpandChange:R,onRowClick:V,onRowDoubleClick:T,onRowContextMenu:b,onColumnResize:$,onColumnReorder:W,onDependencyCreate:_,onKeyDown:X,onSelectionChange:E,onHeaderSelectionChange:P}=uo(),Y=hn(),q=co(),S=bt(),ne=mn(),x=so(),L=lo(),j=t.useRef(null),ae=t.useRef(null),B=t.useRef(null),U=t.useRef(null),ke=t.useRef(0),De=t.useRef(h.useId()),H=t.useRef(h.useId()),se=t.useRef(null),Se=t.useRef(null),xe=t.useCallback(M=>{B.current&&B.current.scrollIntoView(M)},[]);t.useImperativeHandle(Se,()=>({scrollIntoView:xe})),t.useImperativeHandle(a,()=>Se.current);const ye=t.useRef(0),C=t.useRef(0),G=t.useRef(0),K=t.useRef(0),ue=t.useRef(null),Ee=t.useRef(null),[ce,Me]=t.useState(null),at=no(n,j,s),ot=ao(n,ae),Ie=oo(n,r),{extendedColumns:rt,columnsWidth:st,columnsMap:lt}=t.useMemo(()=>{const M=I.readColumns([...o,{title:"",sortable:!1,resizable:!1,reorderable:!1,width:Ie,headerCell:()=>at,cell:kn,orderIndex:Number.MAX_SAFE_INTEGER,navigatable:!1}],{prevId:0,idPrefix:De.current});let Q=0;return M.forEach((z,oe,le)=>{const re=oe+1===le.length,ve=z.children.length===0;re?z.isAccessible=!1:(z.locked=!0,ve&&(z.width=z.width||Ve)),ve&&(Q+=parseFloat(String(z.width)))}),{extendedColumns:M,columnsWidth:Q,columnsMap:I.mapColumns(M)}},[o,Ie]),[it,ct]=fo(),w=t.useCallback(()=>j.current&&j.current.parentElement,[]),he=()=>{const M=w(),Q=ae.current,z=B.current&&B.current.tbodyElement;if(!M||!Q||!z)return;const oe=z.offsetTop,le=M.offsetLeft,re=Ie;Q.style.top=oe+"px",Q.style.left=le+"px",Q.style.width=re+"px",Q.style.height=z.offsetHeight+"px"},we=()=>{const M=w();M&&(ke.current=M.offsetLeft)};t.useEffect(he),t.useEffect(we);const Ne=t.useCallback(M=>{if(!U.current)return;const Q=M.columns.slice(0,M.columns.length-1);if(M.end)U.current.style.left="0px";else{const z=w();if(!z)return;U.current.style.left=z.offsetLeft-ke.current+"px",he()}$({...M,columns:Q})},[$]),Fe=t.useCallback(M=>{const Q=M.columns.slice(0,M.columns.length-1);W({...M,columns:Q})},[$]),dt=t.useCallback(M=>{const z=(se.current&&se.current.ownerDocument?se.current.ownerDocument:document).elementFromPoint(M.clientX,M.clientY),oe=se.current;if(!z||!z.parentElement||!oe)return;const le=oe.parentElement,re=oe.firstElementChild;if(!le||!re)return;const ve=z.getAttribute($e);if(ve){const wa=oe.offsetTop,va=oe.offsetLeft,Ta=le.offsetTop,ba=le.offsetLeft,Sa=re.scrollTop,Ia=re.scrollLeft;G.current=va+ba,K.current=wa+Ta,ye.current=M.clientX-G.current+Ia,C.current=M.clientY-K.current+Sa,ue.current=z.parentElement.getAttribute(qe),Ee.current=ve}},[]),Re=t.useCallback(M=>{const Q=se.current;if(!Q)return;const z=Q.firstElementChild;if(!z)return;const oe=z.scrollTop,le=z.scrollLeft,re=M.clientX-G.current+le,ve=M.clientY-K.current+oe;Math.abs(ye.current-re)<10&&Math.abs(C.current-ve)<10||Me({startX:ye.current,startY:C.current,endX:re,endY:ve})},[]),Ea=t.useCallback(M=>{const z=(se.current&&se.current.ownerDocument?se.current.ownerDocument:document).elementFromPoint(M.clientX,M.clientY);if(!z||!z.parentElement)return;const oe=z.parentElement.getAttribute(qe),le=z.getAttribute($e);if(le&&oe!==ue.current&&_){let re;Ee.current==="start"?re=le==="start"?3:2:re=le==="start"?1:0,_({fromId:ue.current,toId:oe,type:re})}ye.current=0,C.current=0,G.current=0,K.current=0,ue.current=null,Ee.current=null,Me(null)},[_,Me]);return t.createElement(Cn,{tasksStore:[it,ct],timelineWidth:Ie,dependencyDrag:{isEnabled:!!_,draggedId:ue.current,onDependencyHandlePress:dt,onDependencyHandleDrag:Re,onDependencyHandleRelease:Ea}},t.createElement("div",{className:"k-gantt-content",ref:se,style:{height:`calc(100% - ${q}px)`}},t.createElement(Ht,{treelistId:H.current,ref:B,extendedColumns:rt,columnsMap:lt,dataItemKey:S.id,data:x,idPrefix:De.current,navigatable:p,expandField:S.isExpanded,subItemsField:S.children,editField:S.isInEdit,selectedField:S.isSelected,onDataStateChange:F,onSortChange:A,onFilterChange:N,onExpandChange:R,onRowClick:V,onRowDoubleClick:T,onRowContextMenu:b,onColumnResize:Ne,onColumnReorder:Fe,onColumnMenuFilterChange:O,onKeyDown:X,onSelectionChange:E,onHeaderSelectionChange:P,tableProps:{style:{width:st},className:"k-table k-table-md k-table-layout-fixed"},noRecords:l,rowHeight:Y,resizable:i,reorderable:g,sortable:d,sort:m,filter:c,columnMenuFilter:f,columnMenu:k,row:D,selectable:v,afterContent:t.createElement(t.Fragment,null,t.createElement("svg",{className:"k-gantt-dependencies-svg",ref:U,style:{left:0,top:0}},L.map(M=>t.createElement(Dn,{key:h.getter(ne.id)(M),dependency:M}))),t.createElement("svg",{className:"k-gantt-dependencies-svg",style:{left:0,top:0,zIndex:3}},ce&&t.createElement("polyline",{points:`${ce.startX},${ce.startY} ${ce.endX},${ce.endY}`})),x&&x.length?ot:null)})))});He.displayName="KendoReactGanttBaseView";const ft="gantt.weekViewTitle",pt="gantt.dayViewTitle",Ct="gantt.monthViewTitle",kt="gantt.yearViewTitle",Dt="gantt.filterClearButton",Ye="gantt.filterEqOperator",Ze="gantt.filterNotEqOperator",Xe="gantt.filterIsNullOperator",je="gantt.filterIsNotNullOperator",yn="gantt.filterIsEmptyOperator",En="gantt.filterIsNotEmptyOperator",wn="gantt.filterStartsWithOperator",vn="gantt.filterContainsOperator",Tn="gantt.filterNotContainsOperator",bn="gantt.filterEndsWithOperator",Sn="gantt.filterGteOperator",In="gantt.filterGtOperator",Rn="gantt.filterLteOperator",xn="gantt.filterLtOperator",Mn="gantt.filterIsTrue",Nn="gantt.filterIsFalse",Fn="gantt.filterBooleanAll",Ln="gantt.filterAfterOrEqualOperator",Vn="gantt.filterAfterOperator",An="gantt.filterBeforeOperator",Gn="gantt.filterBeforeOrEqualOperator",Co="gantt.noRecords",zn="gantt.editSave",Pt="gantt.editCancel",Ot="gantt.editAdd",Wt="gantt.editRemove",Hn="gantt.editTabGeneral",Pn="gantt.editTabPredecessors",On="gantt.editTabSuccessors",Wn="gantt.editorTitle",_n="gantt.editorTaskTitle",Bn="gantt.editorTaskStart",Kn="gantt.editorTaskEnd",ko="gantt.editorTaskPlannedStart",Do="gantt.editorTaskPlannedEnd",yo="gantt.editorTaskActualStart",Eo="gantt.editorTaskActualEnd",$n="gantt.editorTaskComplete",qn="gantt.editorTaskParent",Un="gantt.editorValidationRequired",Yn="gantt.editorValidationStart",Zn="gantt.editorValidationEnd",Xn="gantt.editorValidationPercentCompleteRange",yt="gantt.editorDependencyTypesFF",jn="gantt.editorDependencyTypesSF",Qn="gantt.editorDependencyTypesFS",Jn="gantt.editorDependencyTypesSS",ea="gantt.addTask",ta="gantt.addChild",na="gantt.addAbove",aa="gantt.addBelow",oa="gantt.viewSelector",_t="gantt.editorDelete",ra="gantt.deleteConfirmation",sa="gantt.deleteDialogTitle",Bt="gantt.editorDependencyNameLabel",Kt="gantt.editorDependencyTypeLabel",ie={[ft]:"Week",[pt]:"Day",[Ct]:"Month",[kt]:"Year",[Dt]:"Clear",[Ye]:"Is equal to",[Ze]:"Is not equal to",[Xe]:"Is null",[je]:"Is not null",[yn]:"Is empty",[En]:"Is not empty",[wn]:"Starts with",[vn]:"Contains",[Tn]:"Does not contain",[bn]:"Ends with",[Sn]:"Is greater than or equal to",[In]:"Is greater than",[Rn]:"Is less than or equal to",[xn]:"Is less than",[Mn]:"Is true",[Nn]:"Is false",[Fn]:"(All)",[Ln]:"Is after or equal to",[Vn]:"Is after",[An]:"Is before",[Gn]:"Is before or equal to",[Co]:"No records available",[zn]:"Save",[Pt]:"Cancel",[Ot]:"Add",[Wt]:"Remove",[Hn]:"General",[Pn]:"Predecessors",[On]:"Successors",[Wn]:"Edit task",[_n]:"Title",[Bn]:"Start",[Kn]:"End",[ko]:"Planned Start Date",[Do]:"Planned End Date",[yo]:"Actual Start Date",[Eo]:"Actual End Date",[$n]:"Complete",[qn]:"Parent",[Un]:"Field is required.",[Yn]:"Start time must be be before End time.",[Zn]:"End time must be after Start time.",[Xn]:"Value should be between 0 and 100.",[yt]:"Finish-Finish",[Qn]:"Finish-Start",[jn]:"Start-Finish",[Jn]:"Start-Start",[ea]:"Add Task",[ta]:"Add Child",[na]:"Add Above",[aa]:"Add Below",[oa]:"View Selector",[_t]:"Delete",[ra]:"Are you sure you want to delete this event?",[sa]:"Delete Event",[Bt]:"Name",[Kt]:"Type"},Pe=t.forwardRef((e,a)=>{const{slotWidth:n=_e.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:s}=e,{timezone:o}=Ge(),l=J.useInternationalization(),i=t.useRef(null),g=t.useRef(null),d=t.useCallback(p=>{g.current&&g.current.scrollIntoView(p)},[]);t.useImperativeHandle(i,()=>({scrollIntoView:d})),t.useImperativeHandle(a,()=>i.current);const m=ze(),c=e.workWeekStart||_e.workWeekStart,f=e.workWeekEnd||_e.workWeekEnd,k=t.useMemo(()=>{const p=rn({workWeekStart:c,workWeekEnd:f}),D=[],v=cn(m,{timezone:o},l);return v.forEach(F=>{const A=ln(F.range,{workDays:p,timezone:o},l);D.push.apply(D,A)}),r&&D[0]&&(r.current=D[0].range),[v,D]},[o,m.start.getTime(),m.end.getTime(),l,c,f]);return t.createElement(He,{ref:g,slotWidth:n,slotLevels:k,timelineHeaderCell:s})}),wo=({intl:e,tasksStart:a,tasksEnd:n,timezone:r})=>{const s=y.ZonedDate.fromLocalDate(a,r),o=y.ZonedDate.fromLocalDate(n,r),l=on(y.firstDayInWeek(y.getDate(s),e.firstDay())),i=Et(y.firstDayInWeek(y.getDate(o),e.firstDay()),tn),g=y.ZonedDate.fromUTCDate(Ce(l),r),d=y.ZonedDate.fromUTCDate(Ce(i),r);return{start:new Date(g.getTime()),end:new Date(d.getTime()),zonedStart:g,zonedEnd:d}},_e={name:"week",dateRange:wo,title:e=>e.toLanguageString(ft,ie[ft]),slotWidth:Ve,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};Pe.defaultProps=_e;Pe.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number,workWeekStart:u.number,workWeekEnd:u.number,workDayStart:u.string,workDayEnd:u.string};Pe.displayName="KendoReactGanttWeekView";const vo=(e,a,n)=>{const[r,s]=t.useState(a||e),o=t.useCallback((l,i)=>{s(l),n&&n.call(void 0,{...i,value:l})},[n,s]);return[a!==void 0?a:r,o]},la=e=>{const[a,n]=gn(),r=J.useLocalization(),s=t.useMemo(()=>typeof e.view.title=="function"?e.view.title.call(void 0,r):e.view.title,[e.view.title,r]),o=t.useCallback(()=>{e.view.name&&n(e.view.name)},[n,e.view.name]);return t.createElement(te.Button,{role:"button",type:"button",tabIndex:-1,togglable:!0,selected:e.view.name===a,onClick:o},s)};la.displayName="KendoReactGanttViewSelectorItem";const ia=t.forwardRef(()=>{const e=io(),[a,n]=gn(),r=J.useLocalization(),s=l=>r.toLanguageString(l,ie[l]),o=t.useCallback(l=>{n&&(l.preventDefault(),n(l.target.value))},[n]);return t.createElement("div",{className:"k-gantt-views-wrapper"},t.createElement(te.ButtonGroup,{className:"k-gantt-views"},e.map(l=>t.createElement(la,{key:l.props.name,view:l.props}))),t.createElement("select",{value:a,onChange:o,"aria-label":s(oa),className:"k-picker k-picker-solid k-dropdown-list k-dropdown k-views-dropdown k-rounded-md"},e.map(l=>t.createElement("option",{key:l.props.name,value:l.props.name},typeof l.props.title=="function"?l.props.title.call(void 0,r):l.props.title))))});ia.displayName="KendoReactGanttViewSelectorList";const ca=t.forwardRef((e,a)=>{const{className:n,...r}=e,s=t.useRef(null);return t.useImperativeHandle(a,()=>({element:s.current,props:e})),t.createElement(te.ToolbarItem,{ref:o=>{o&&(s.current=o.element)},className:h.classNames("k-gantt-views",n),...r},e.children)});ca.displayName="KendoReactGanttViewSelector";const da=t.forwardRef((e,a)=>{const{className:n,...r}=e,s=t.useRef(null),o=t.useRef(null);t.useImperativeHandle(o,()=>({element:s.current,props:e})),t.useImperativeHandle(a,()=>o.current);const l=t.useMemo(()=>h.classNames("k-gantt-toolbar k-gantt-header",n),[n]);return t.createElement(te.Toolbar,{ref:i=>{i&&(s.current=i.element)},className:l,...r},e.children)});da.displayName="KendoReactGanttToolbar";const Zt={name:"@progress/kendo-react-gantt",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},ua=t.forwardRef((e,a)=>{const n=J.useLocalization(),r=c=>n.toLanguageString(c,ie[c]),s=r(ea),o=r(ta),l=r(na),i=r(aa),g=t.useCallback(c=>{c.syntheticEvent.preventDefault();const f=c.item&&c.item.direction?c.item.direction:"none";e.onClick&&e.onClick({nativeEvent:c.nativeEvent,syntheticEvent:c.syntheticEvent,direction:f})},[e.onClick]),d=t.useCallback(c=>{c.preventDefault(),e.onClick&&e.onClick({nativeEvent:c&&c.nativeEvent,syntheticEvent:c,direction:"none"})},[e.onClick]),m=t.createElement(t.Fragment,null,t.createElement(h.IconWrap,{name:"plus",icon:pe.plusIcon}),s);return e.selectedTask?t.createElement(te.DropDownButton,{className:"k-views-dropdown",onItemClick:g,popupSettings:{popupClass:"k-gantt-toolbar"},textField:"title",items:[{title:o,direction:"child"},{title:l,direction:"above"},{title:i,direction:"below"}],text:m}):t.createElement(te.Button,{onClick:d},m)});ua.displayName="KendoReactGanttAddButton";const Qe=t.forwardRef((e,a)=>{h.validatePackage(Zt);const n=h.shouldShowValidationUI(Zt),{columns:r=Le.columns,taskData:s=Le.taskData,dependencyData:o=Le.dependencyData,style:l,className:i,noRecords:g,timezone:d,rowHeight:m=Le.rowHeight,resizable:c,reorderable:f,sortable:k,sort:p,filter:D,columnMenuFilter:v,columnMenu:F,navigatable:A,toolbar:N,row:O,selectable:R}=e,V=J.useInternationalization(),{fields:T}=t.useMemo(()=>Ka(e.taskModelFields),[e.taskModelFields]),{fields:b}=t.useMemo(()=>$a(e.dependencyModelFields),[e.dependencyModelFields]),$=t.useCallback(ro(T.isExpanded,T.children),[T.isExpanded,T.children]),W=t.useRef(null),_=t.useRef(null),X=t.useRef(null),E=t.useRef(null),P=t.useRef(null),Y=t.useCallback(w=>{const he=h.getter(T.start)(w),we=h.getter(T.end)(w),Ne=h.getter(T.isSelected)(w);(!_.current||he<_.current)&&(_.current=he),(!X.current||we>X.current)&&(X.current=we),Ne&&(E.current=w)},[T.start,T.end]),q=t.useMemo(()=>(_.current=null,X.current=null,E.current=null,fe.flatData(s,$,Y)),[s,$]);(!_.current||!X.current)&&(_.current=new Date($t),X.current=new Date($t));const S=t.Children.toArray(e.children||[t.createElement(Pe,{key:"week",firstSlotRangeRef:P})]),[ne,x]=vo(e.defaultView||S[0].props.name,e.view,e.onViewChange),L=S.find(w=>w.props.name===ne)||S[0],j=typeof L.props.dateRange=="function"?L.props.dateRange.call(void 0,{intl:V,tasksStart:_.current,tasksEnd:X.current,timezone:d}):L.props.dateRange,ae=t.useRef(null),[B,U]=t.useState(0);h.useIsomorphicLayoutEffect(()=>{ae.current&&U(ae.current.element.offsetHeight)},[]);const ke=t.useCallback(w=>{W.current&&W.current.scrollIntoView(w)},[]),De=t.useRef(null),H=t.useRef(null);t.useImperativeHandle(H,()=>({props:e,element:De.current,scrollIntoView:ke})),t.useImperativeHandle(a,()=>H.current);const se=t.useCallback(w=>{e.onDataStateChange&&e.onDataStateChange.call(void 0,{...w,target:H.current})},[e.onDataStateChange]),Se=t.useCallback(w=>{e.onSortChange&&e.onSortChange.call(void 0,{...w,target:H.current})},[e.onSortChange]),xe=t.useCallback(w=>{e.onKeyDown&&e.onKeyDown.call(void 0,{...w,target:H.current})},[e.onKeyDown]),ye=t.useCallback(w=>{e.onSelectionChange&&e.onSelectionChange.call(void 0,{...w,target:H.current})},[e.onSelectionChange]),C=t.useCallback(w=>{e.onHeaderSelectionChange&&e.onHeaderSelectionChange.call(void 0,{...w,target:H.current})},[e.onHeaderSelectionChange]),G=t.useCallback(w=>{e.onFilterChange&&e.onFilterChange.call(void 0,{...w,target:H.current})},[e.onFilterChange]),K=t.useCallback(w=>{e.onColumnMenuFilterChange&&e.onColumnMenuFilterChange.call(void 0,{...w,target:H.current})},[e.onColumnMenuFilterChange]),ue=t.useCallback(w=>{e.onExpandChange&&e.onExpandChange.call(void 0,{...w,target:H.current})},[e.onExpandChange]),Ee=t.useCallback(w=>{e.onAddClick&&e.onAddClick.call(void 0,{...w,target:H.current,selectedDataItem:E.current,slotStart:P.current&&new Date(P.current.start.getTime()),slotEnd:P.current&&new Date(P.current.end.getTime())})},[e.onAddClick]),ce=t.useCallback(w=>{e.onColumnResize&&e.onColumnResize.call(void 0,{...w,target:H.current})},[e.onColumnResize]),Me=t.useCallback(w=>{e.onColumnReorder&&e.onColumnReorder.call(void 0,{...w,target:H.current})},[e.onColumnReorder]),at=t.useCallback(w=>{e.onRowClick&&e.onRowClick.call(void 0,{...w,target:H.current})},[e.onRowClick]),ot=t.useCallback(w=>{e.onRowDoubleClick&&e.onRowDoubleClick.call(void 0,{...w,target:H.current})},[e.onRowClick]),Ie=t.useCallback(w=>{e.onRowContextMenu&&e.onRowContextMenu.call(void 0,{...w,target:H.current})},[e.onRowClick]),rt=t.useCallback(w=>{e.onTaskClick&&e.onTaskClick.call(void 0,{...w,target:H.current})},[e.onTaskClick]),st=t.useCallback(w=>{e.onTaskDoubleClick&&e.onTaskDoubleClick.call(void 0,{...w,target:H.current})},[e.onTaskDoubleClick]),lt=t.useCallback(w=>{e.onTaskContextMenu&&e.onTaskContextMenu.call(void 0,{...w,target:H.current})},[e.onTaskContextMenu]),it=t.useCallback(w=>{e.onTaskRemoveClick&&e.onTaskRemoveClick.call(void 0,{...w,target:H.current})},[e.onTaskRemoveClick]),ct=t.useCallback(w=>{if(e.onDependencyCreate){let he,we;const Ne=h.getter(T.id);for(let Fe=0;Fe<q.length;Fe++){const dt=q[Fe],Re=Ne(dt.dataItem);if(String(Re)===w.fromId&&(he=Re),String(Re)===w.toId&&(we=Re),he&&we)break}e.onDependencyCreate.call(void 0,{fromId:he,toId:we,target:H.current,type:w.type})}},[e.onDependencyCreate,T,q]);return t.createElement(fn,{dateRange:j,taskData:q,dependencyData:o,taskModelFields:T,dependencyModelFields:b,views:S,activeView:[ne,x],rowHeight:m,toolbarHeight:B,props:{columns:r,noRecords:g,timezone:d,resizable:c,reorderable:f,sortable:k,sort:p,filter:D,columnMenuFilter:v,columnMenu:F,navigatable:A,row:O,selectable:R},events:{onDataStateChange:se,onSortChange:Se,onFilterChange:G,onColumnMenuFilterChange:K,onExpandChange:ue,onRowClick:at,onRowDoubleClick:ot,onRowContextMenu:Ie,onColumnResize:ce,onColumnReorder:Me,onDependencyCreate:e.onDependencyCreate&&ct,onKeyDown:xe,onSelectionChange:ye,onHeaderSelectionChange:C},taskEvents:{onTaskClick:rt,onTaskDoubleClick:st,onTaskContextMenu:lt,onTaskRemoveClick:e.onTaskRemoveClick&&it}},t.createElement("div",{ref:De,role:"application",style:l,className:h.classNames("k-gantt",i)},t.createElement(da,{ref:ae},N&&N.addTaskButton?t.createElement(ua,{selectedTask:E.current,onClick:Ee}):null,t.createElement(te.ToolbarSpacer,null),t.createElement(ca,null,t.createElement(ia,null))),L&&t.createElement(L.type,{key:L.props.name,ref:W,...L.props,firstSlotRangeRef:P}),n&&t.createElement(h.WatermarkOverlay,null)))}),Le={taskData:[],dependencyData:[],columns:[],rowHeight:40};Qe.propTypes={taskData:u.array,taskModelFields:u.shape({id:u.string,start:u.string,end:u.string,title:u.string,percentComplete:u.string,parentId:u.string,isRollup:u.string,isExpanded:u.string,children:u.string,isInEdit:u.string}),dependencyData:u.array,dependencyModelFields:u.shape({id:u.string,fromId:u.string,toId:u.string,type:u.string}),columns:u.arrayOf(u.shape({width:u.number,cell:u.any,editCell:u.any,headerCell:u.any,filter:u.any,children:u.any,field:u.string,title:u.string,sortable:u.any,expandable:u.bool,headerSelectionValue:u.bool,format:u.string,headerClassName:u.string,className:u.string,resizable:u.bool,reorderable:u.bool,minResizableWidth:u.number,orderIndex:u.number,columnMenu:u.any})),sort:u.array,filter:u.array,columnMenuFilter:u.array,columnMenu:u.any,style:u.object,className:u.string,children:u.any,timezone:u.string,defaultView:u.string,view:u.string,rowHeight:u.number,navigatable:u.bool,onViewChange:u.func,onDataStateChange:u.func,onSortChange:u.func,onFilterChange:u.func,onExpandChange:u.func,onRowClick:u.func,onColumnResize:u.func,onColumnReorder:u.func};Qe.defaultProps=Le;Qe.displayName="KendoReactGantt";const Je=t.forwardRef((e,a)=>{const{slotWidth:n=be.slotWidth,slotDuration:r=be.slotDuration,firstSlotRangeRef:s,timelineHeaderCell:o}=e,{timezone:l}=Ge(),i=J.useInternationalization(),g=t.useRef(null),d=t.useRef(null),m=t.useCallback(F=>{d.current&&d.current.scrollIntoView(F)},[]);t.useImperativeHandle(g,()=>({scrollIntoView:m})),t.useImperativeHandle(a,()=>g.current);const c=ze(),f=e.workWeekStart||be.workWeekStart,k=e.workWeekEnd||be.workWeekEnd,p=e.workDayStart||be.workDayStart,D=e.workDayEnd||be.workDayEnd,v=t.useMemo(()=>{const F=rn({workWeekStart:f,workWeekEnd:k}),A=[],N=ln(c,{workDays:F,timezone:l},i);return N.forEach(O=>{const R=eo(O.range,{workDayStart:p,workDayEnd:D,timezone:l,slotDuration:r},i);O.span=R.length,A.push.apply(A,R)}),s&&A[0]&&(s.current=A[0].range),[N,A]},[l,c.start.getTime(),c.end.getTime(),i,f,k,p,D]);return t.createElement(He,{ref:d,slotWidth:n,slotLevels:v,timelineHeaderCell:o})}),To=({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=y.ZonedDate.fromLocalDate(e,n),s=y.ZonedDate.fromLocalDate(a,n),o=on(r),l=Et(s),i=y.ZonedDate.fromUTCDate(Ce(o),n),g=y.ZonedDate.fromUTCDate(Ce(l),n);return{start:new Date(i.getTime()),end:new Date(g.getTime()),zonedStart:i,zonedEnd:g}},be={name:"day",dateRange:To,title:e=>e.toLanguageString(pt,ie[pt]),slotWidth:Ve,slotDuration:60,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};Je.defaultProps=be;Je.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number,slotDuration:u.number,workWeekStart:u.number,workWeekEnd:u.number,workDayStart:u.string,workDayEnd:u.string};Je.displayName="KendoReactGanttDayView";const et=t.forwardRef((e,a)=>{const{slotWidth:n=ma.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:s}=e,{timezone:o}=Ge(),l=J.useInternationalization(),i=t.useRef(null),g=t.useRef(null),d=t.useCallback(f=>{g.current&&g.current.scrollIntoView(f)},[]);t.useImperativeHandle(i,()=>({scrollIntoView:d})),t.useImperativeHandle(a,()=>i.current);const m=ze(),c=t.useMemo(()=>{const f=[],k=dn(m,{timezone:o},l);return k.forEach(p=>{const D=cn(p.range,{timezone:o},l);f.push.apply(f,D)}),r&&f[0]&&(r.current=f[0].range),[k,f]},[o,m.start.getTime(),m.end.getTime(),l]);return t.createElement(He,{ref:g,slotWidth:n,slotLevels:c,timelineHeaderCell:s})}),bo=({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=y.ZonedDate.fromLocalDate(e,n),s=y.ZonedDate.fromLocalDate(a,n),o=y.firstDayOfMonth(y.getDate(r)),l=y.addDays(y.lastDayOfMonth(y.getDate(s)),1),i=y.ZonedDate.fromUTCDate(Ce(o),n),g=y.ZonedDate.fromUTCDate(Ce(l),n);return{start:new Date(i.getTime()),end:new Date(g.getTime()),zonedStart:i,zonedEnd:g}},ma={name:"month",dateRange:bo,title:e=>e.toLanguageString(Ct,ie[Ct]),slotWidth:Ve,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};et.defaultProps=ma;et.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number,workWeekStart:u.number,workWeekEnd:u.number,workDayStart:u.string,workDayEnd:u.string};et.displayName="GanttMonthView";const tt=t.forwardRef((e,a)=>{const{slotWidth:n=ga.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:s}=e,{timezone:o}=Ge(),l=J.useInternationalization(),i=t.useRef(null),g=t.useRef(null),d=t.useCallback(f=>{g.current&&g.current.scrollIntoView(f)},[]);t.useImperativeHandle(i,()=>({scrollIntoView:d})),t.useImperativeHandle(a,()=>i.current);const m=ze(),c=t.useMemo(()=>{const f=to(m,{timezone:o},l),k=[];return f.forEach(p=>{const D=dn(p.range,{timezone:o},l);k.push.apply(k,D)}),r&&k[0]&&(r.current=k[0].range),[f,k]},[o,m.start.getTime(),m.end.getTime(),l]);return t.createElement(He,{slotWidth:n,slotLevels:c,timelineHeaderCell:s})}),So=({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=y.ZonedDate.fromLocalDate(e,n),s=y.ZonedDate.fromLocalDate(a,n),o=y.firstDayOfMonth(y.firstMonthOfYear(y.getDate(r))),l=y.addDays(y.lastDayOfMonth(y.lastMonthOfYear(y.getDate(s))),1),i=y.ZonedDate.fromUTCDate(Ce(o),n),g=y.ZonedDate.fromUTCDate(Ce(l),n);return{start:new Date(i.getTime()),end:new Date(g.getTime()),zonedStart:i,zonedEnd:g}},ga={name:"year",dateRange:So,title:e=>e.toLanguageString(kt,ie[kt]),slotWidth:Ve};tt.defaultProps=ga;tt.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number};tt.displayName="GanttYearView";const Io=[{text:vn,operator:"contains"},{text:Tn,operator:"doesnotcontain"},{text:Ye,operator:"eq"},{text:Ze,operator:"neq"},{text:wn,operator:"startswith"},{text:bn,operator:"endswith"},{text:Xe,operator:"isnull"},{text:je,operator:"isnotnull"},{text:yn,operator:"isempty"},{text:En,operator:"isnotempty"}],Ro=[{text:Ye,operator:"eq"},{text:Ze,operator:"neq"},{text:Sn,operator:"gte"},{text:In,operator:"gt"},{text:Rn,operator:"lte"},{text:xn,operator:"lt"},{text:Xe,operator:"isnull"},{text:je,operator:"isnotnull"}],xo=[{text:Ye,operator:"eq"},{text:Ze,operator:"neq"},{text:Ln,operator:"gte"},{text:Vn,operator:"gt"},{text:An,operator:"lt"},{text:Gn,operator:"lte"},{text:Xe,operator:"isnull"},{text:je,operator:"isnotnull"}],Mo=[{text:Fn,operator:""},{text:Mn,operator:!0},{text:Nn,operator:!1}];function nt(e,a){return{clearButtonTitle:e.toLanguageString(Dt,ie[Dt]),operators:a.map(n=>({text:e.toLanguageString(n.text,ie[n.text]),operator:n.operator}))}}const ha=e=>{const{operators:a,...n}=e;return t.createElement(I.TextFilterCell,{ariaLabel:"text filter",...nt(J.useLocalization(),a||Io),...n})};ha.displayName="KendoReactGanttTextFilter";const fa=e=>{const{operators:a,...n}=e;return t.createElement(I.NumericFilterCell,{ariaLabel:"numeric filter",...nt(J.useLocalization(),a||Ro),...n})};fa.displayName="KendoReactGanttNumericFilter";const pa=e=>{const{operators:a,...n}=e;return t.createElement(I.BooleanFilterCell,{ariaLabel:"boolean filter",...nt(J.useLocalization(),a||Mo),...n})};pa.displayName="KendoReactGanttBooleanFilter";const Ca=e=>{const{operators:a,...n}=e;return t.createElement(I.DateFilterCell,{ariaLabel:"date filter",...nt(J.useLocalization(),a||xo),...n})};Ca.displayName="KendoReactGanttDateFilter";const No=e=>{const{dependencyData:a,dependencyModelFields:n,defaultDataItem:r,fromId:s,toId:o,type:l}=e,i=a.map(f=>({...f})),g=h.setter(n.fromId),d=h.setter(n.toId),m=h.setter(n.type),c=r?{...r}:{};return g(c,s),d(c,o),m(c,l),i.push(c),i},Fo=e=>{const{defaultDataItem:a,selectedDataItem:n,direction:r,taskModelFields:s,dataTree:o,slotStart:l,slotEnd:i}=e,g=Ae(o,s.children,v=>({...v})),d=h.setter(s.start),m=h.setter(s.end),c=h.getter(s.start),f=h.getter(s.end),k=h.setter(s.parentId||""),p=a?{...a}:{},D=c(p)&&f(p);if(!n||r==="none")D||(d(p,l),m(p,i)),s.parentId&&k(p,null),g.unshift(p);else{const v=[{task:{[s.children]:g},childrenIndex:0}],F=h.getter(s.id),A=h.getter(s.children),N=h.setter(s.children),O=F(n);for(;v.length>0;){const R=v[v.length-1],V=R.task,T=F(V),b=A(V);if(T&&T===O)break;b&&b.length&&b.length>R.childrenIndex?(v.push({task:b[R.childrenIndex],childrenIndex:0}),R.childrenIndex++):v.pop()}if(v.length>1){const R=v[v.length-1].task,V=v[v.length-2].childrenIndex,b=v[v.length-2].task,$=A(b);switch(r){case"child":{let W=A(R);W||(W=[],N(R,W)),D||(d(p,new Date(c(R).getTime())),m(p,new Date(f(R).getTime()))),W.push(p),k(p,F(R)),Be(v.splice(1,v.length-1).map(_=>_.task),s);break}case"above":{c(b)&&f(b)&&!D?(d(p,new Date(c(R).getTime())),m(p,new Date(f(R).getTime()))):(d(p,l),m(p,i)),$.splice(V-1,0,p),k(p,F(b)),Be(v.splice(1,v.length-2).map(W=>W.task),s);break}case"below":{c(b)&&f(b)&&!D?(d(p,new Date(c(R).getTime())),m(p,new Date(f(R).getTime()))):(d(p,l),m(p,i)),$.splice(V,0,p),k(p,F(b)),Be(v.splice(1,v.length-2).map(W=>W.task),s);break}}}}return g},Lo=e=>{const{updatedDataItem:a,taskModelFields:n,dataTree:r}=e,s=h.getter(n.id),o=h.getter(n.children),l=s(a);let i;const g=Ae(r,n.children,m=>s(m)===l?(i=m,{...a}):{...m});let d=[{task:{[n.children]:g},childrenIndex:0}];for(;d.length>0;){const m=d[d.length-1],c=m.task,f=s(c),k=o(c);if(f&&f===l)break;k&&k.length&&k.length>m.childrenIndex?(d.push({task:k[m.childrenIndex],childrenIndex:0}),m.childrenIndex++):d.pop()}if(d.length>1){d=d.splice(1,d.length-2);const m=h.getter(n.start),c=h.getter(n.end),f=h.getter(n.percentComplete),k=h.getter(n.parentId||"");if(m(i).getTime()!==m(a).getTime()){ka(d.map(D=>D.task),n);const p=m(a).getTime()-m(i).getTime();zo(o(a),n,p)}if(c(i).getTime()!==c(a).getTime()&&Da(d.map(p=>p.task),n),f(i)!==f(a)&&ya(d.map(p=>p.task),n),n.parentId&&k(i)!==k(a)){let p;return d.length?Ao(d.map(D=>D.task),n,i):p=g.filter(D=>s(D)!==s(a)),Go(p||g,n,a)}}return g},Vo=e=>{const{removedDataItem:a,taskModelFields:n,dataTree:r}=e,s=Ae(r,n.children,d=>({...d}));let o=[{task:{[n.children]:s},childrenIndex:0}];const l=h.getter(n.id),i=h.getter(n.children),g=l(a);for(;o.length>0;){const d=o[o.length-1],m=d.task,c=l(m),f=i(m);if(c&&c===g)break;f&&f.length&&f.length>d.childrenIndex?(o.push({task:f[d.childrenIndex],childrenIndex:0}),d.childrenIndex++):o.pop()}if(o.length>1){const d=o[o.length-2],m=d.task;i(m).splice(d.childrenIndex-1,1),o=o.splice(1,o.length-2),Be(o.map(f=>f.task),n)}return s},Be=(e,a)=>{ka(e,a),Da(e,a),ya(e,a)},Ao=(e,a,n)=>{const r=h.getter(a.children),s=h.setter(a.children);for(let o=e.length-1;o>=0;o--){const l=e[o],i=r(l);if(n.parentId===l.id){const g=i.filter(d=>d.parentId===l.id);s(l,g)}}},Go=(e,a,n)=>{const r=h.getter(a.children),s=h.setter(a.children);return n.parentId===null?[...e,n]:(e=Ae(e,a.children,o=>{if(o.id===n.parentId){const l=r(o)||[];s(o,[...l,n])}return{...o}}),e)},ka=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.start),s=h.setter(a.start);for(let o=e.length-1;o>=0;o--){const l=e[o],i=n(l);if(i&&i.length){const g=i.reduce((d,m)=>Math.min(d,r(m).getTime()),r(i[0]).getTime());s(l,new Date(g))}}},Da=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.end),s=h.setter(a.end);for(let o=e.length-1;o>=0;o--){const l=e[o],i=n(l);if(i&&i.length){const g=i.reduce((d,m)=>Math.max(d,r(m).getTime()),r(i[0]).getTime());s(l,new Date(g))}}},ya=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.percentComplete),s=h.setter(a.percentComplete),o=({avg:l,n:i},g)=>({avg:((r(g)||0)+i*l)/(i+1),n:i+1});for(let l=e.length-1;l>=0;l--){const i=e[l],g=n(i);if(g&&g.length){const d=g.reduce(o,{avg:0,n:0}).avg;s(i,d)}}},zo=(e,a,n)=>{if(!e)return;const r=h.getter(a.children),s=h.getter(a.start),o=h.setter(a.start),l=h.getter(a.end),i=h.setter(a.end),g=e.map(d=>({task:d,childrenIndex:0}));for(;g.length>0;){const d=g[g.length-1],m=d.task,c=r(m);c&&c.length&&c.length>d.childrenIndex?(g.push({task:c[d.childrenIndex],childrenIndex:0}),d.childrenIndex++):(g.pop(),o(m,new Date(s(m).getTime()+n)),i(m,new Date(l(m).getTime()+n)))}},Xt=e=>{const{validationMessage:a,touched:n,label:r,id:s,valid:o,disabled:l,hint:i,type:g,optional:d,...m}=e,c=n&&a,f=!c&&i,k=f?`${s}_hint`:"",p=c?`${s}_error`:"";return t.createElement(ee.FieldWrapper,{className:"k-col-span-full"},t.createElement(de.Label,{editorId:s,editorValid:o,editorDisabled:l,optional:d},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(Qt.Input,{valid:o,type:g,id:s,disabled:l,ariaDescribedBy:`${k} ${p}`,...m}),f&&t.createElement(de.Hint,{id:k},i),c&&t.createElement(de.Error,{id:p},a)))},We=e=>{const{validationMessage:a,touched:n,label:r,id:s,valid:o,disabled:l,hint:i,wrapperStyle:g,...d}=e,m=n&&a,c=!m&&i,f=c?`${s}_hint`:"",k=m?`${s}_error`:"",p=r?`${s}_label`:"";return t.createElement(ee.FieldWrapper,{style:g,className:"k-col-span-2"},t.createElement(de.Label,{id:p,editorId:s,editorValid:o,editorDisabled:l},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(Ma.DateTimePicker,{ariaLabelledBy:p,ariaDescribedBy:`${f} ${k}`,valid:o,id:s,disabled:l,...d}),c&&t.createElement(de.Hint,{id:f},i),m&&t.createElement(de.Error,{id:k},a)))},jt=e=>{const{validationMessage:a,visited:n,label:r,id:s,valid:o,disabled:l,hint:i,...g}=e,d=n&&a,m=!d&&i,c=m?`${s}_hint`:"",f=d?`${s}_error`:"";return t.createElement(ee.FieldWrapper,null,t.createElement(de.Label,{editorId:s,editorValid:o,editorDisabled:l},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(Qt.NumericTextBox,{ariaDescribedBy:`${c} ${f}`,valid:o,id:s,disabled:l,format:"p0",step:.01,...g}),m&&t.createElement(de.Hint,{id:c},i),d&&t.createElement(de.Error,{id:f},a)))},Ho=e=>{const{validationMessage:a,touched:n,label:r,id:s,valid:o,disabled:l,hint:i,idField:g,dataItem:d,...m}=e,c={id:null,title:"-None-",parentId:null},f=[],k=n&&a,p=!k&&i,D=p?`${s}_hint`:"",v=k?`${s}_error`:"",F=t.useCallback(V=>{if(!V||!V.children)return e.data;for(const b of V.children)f.push(b),b.children&&F(b);const T=f.map(b=>b.id);return e.data.filter(b=>!T.includes(b.id))},[e.data]),A=F(d),N=t.useMemo(()=>A.map(V=>{const T=new Date(V.start).toLocaleDateString(),b=new Date(V.end).toLocaleDateString();return{...V,title:`${V.title} (${T}-${b})`}}),[F]),O=t.useMemo(()=>Z.findByFieldValue(N,g,e.value),[N,g,e.value]),R=V=>{V.value.id===null?e.onChange({value:null}):e.onChange({value:V.value[g]})};return t.createElement(ee.FieldWrapper,{className:"k-col-span-full"},t.createElement(de.Label,{editorId:s,editorValid:o,editorDisabled:l},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(Z.DropDownList,{textField:"title",ariaDescribedBy:`${D} ${v}`,valid:o,id:s,disabled:l,...m,value:O,data:N,onChange:R,defaultItem:c}),p&&t.createElement(de.Hint,{id:D},i),k&&t.createElement(de.Error,{id:v},a)))},Po=(e,a,n,r)=>{const[s,o]=t.useState(e),l=t.useRef(null),i=c=>{r(a,"fromId",c.target.value.id)},g=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},d=t.useMemo(()=>Z.findByFieldValue(e,"id",a.fromId),[e,a.fromId]),m=c=>{const f=Ue.filterBy(e,c.filter);o(f)};return t.createElement("td",{ref:l,className:h.classNames(g()&&"k-selected")},t.createElement(Z.DropDownList,{textField:"title",data:s,value:d,onChange:i,filterable:!0,onFilterChange:m,required:!0}))},Oo=(e,a,n,r)=>{const s=i=>{r(a,"type",i.target.value.type)},o=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},l=t.useMemo(()=>Z.findByFieldValue(e,"type",a.type),[e,a.type]);return t.createElement("td",{className:h.classNames(o()&&"k-selected")},t.createElement(Z.DropDownList,{textField:"name",data:e,value:l,onChange:s}))},Wo=e=>{var m;const[a,n]=t.useState([]),r=J.useLocalization(),s=c=>r.toLanguageString(c,ie[c]),o=s(Ot),l=s(Wt),i=s(Bt),g=s(Kt),d=t.useMemo(()=>{const c=e.predecessors.map(f=>{const k=Z.findByFieldValue(e.flatTasks,"id",f.fromId),p=Z.findByFieldValue(e.dependencyTypes,"type",f.type);return{...f,taskTitle:k?k.title:"",typeName:p?p.type:""}});return Ue.orderBy(c,a)},[e.predecessors,e.dependencyTypes,e.flatTasks,a]);return t.createElement(Te.Grid,{data:d,sort:a,sortable:!0,onRowClick:e.onSelectRow,onSortChange:c=>{n(c.sort)},style:{height:"23em"}},t.createElement(Te.GridToolbar,null,t.createElement(te.Button,{icon:"plus",svgIcon:pe.plusIcon,onClick:e.addPredecessorsDependency},o),t.createElement(te.Button,{icon:"minus",svgIcon:pe.minusIcon,onClick:e.deleteDependency,disabled:((m=e.selectedItem)==null?void 0:m.id)===void 0},l)),t.createElement(Te.GridColumn,{field:"taskTitle",title:i,cell:c=>Po(e.flatTasks,c.dataItem,e.selectedItem,e.updateDependency)}),t.createElement(Te.GridColumn,{field:"typeName",title:g,cell:c=>Oo(e.dependencyTypes,c.dataItem,e.selectedItem,e.updateDependency)}))},_o=(e,a,n,r)=>{const[s,o]=t.useState(e),l=m=>{r(a,"toId",m.target.value.id)},i=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},g=t.useMemo(()=>Z.findByFieldValue(e,"id",a.toId),[e,a.toId]),d=m=>{const c=Ue.filterBy(e,m.filter);o(c)};return t.createElement("td",{className:h.classNames(i()&&"k-selected")},t.createElement(Z.DropDownList,{textField:"title",data:s,value:g,onChange:l,filterable:!0,onFilterChange:d,required:!0}))},Bo=(e,a,n,r)=>{const s=i=>{r(a,"type",i.target.value.type)},o=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},l=t.useMemo(()=>Z.findByFieldValue(e,"type",a.type),[e,a.type]);return t.createElement("td",{className:h.classNames(o()&&"k-selected")},t.createElement(Z.DropDownList,{textField:"name",data:e,value:l,onChange:s}))},Ko=e=>{var m;const[a,n]=t.useState([]),r=J.useLocalization(),s=c=>r.toLanguageString(c,ie[c]),o=s(Ot),l=s(Wt),i=s(Bt),g=s(Kt),d=t.useMemo(()=>{const c=e.successors.map(f=>{const k=Z.findByFieldValue(e.flatTasks,"id",f.toId),p=Z.findByFieldValue(e.dependencyTypes,"type",f.type);return{...f,taskTitle:k?k.title:"",typeName:p?p.type:""}});return Ue.orderBy(c,a)},[e.successors,e.dependencyTypes,e.flatTasks,a]);return t.createElement(Te.Grid,{data:d,sort:a,sortable:!0,onRowClick:e.onSelectRow,onSortChange:c=>{n(c.sort)},style:{height:"23em"}},t.createElement(Te.GridToolbar,null,t.createElement(te.Button,{icon:"plus",svgIcon:pe.plusIcon,onClick:e.addSuccessorsDependency},o),t.createElement(te.Button,{icon:"minus",svgIcon:pe.minusIcon,onClick:e.deleteDependency,disabled:((m=e.selectedItem)==null?void 0:m.id)===void 0},l)),t.createElement(Te.GridColumn,{field:"taskTitle",title:i,cell:c=>_o(e.flatTasks,c.dataItem,e.selectedItem,e.updateDependency)}),t.createElement(Te.GridColumn,{field:"type",title:g,cell:c=>Bo(e.dependencyTypes,c.dataItem,e.selectedItem,e.updateDependency)}))};var me=(e=>(e[e.FF=0]="FF",e[e.FS=1]="FS",e[e.SF=2]="SF",e[e.SS=3]="SS",e))(me||{});const $o=[{type:me.FF},{type:me.FS},{type:me.SF},{type:me.SS}],qo=e=>{const[a,n]=t.useState(0),[r,s]=t.useState(),[o,l]=t.useState([...e.dependencyData||[]]),[i,g]=t.useState([]),d=bt(),m=J.useLocalization(),c=C=>m.toLanguageString(C,ie[C]),f=c(_n),k=c(Bn),p=c(Kn),D=c($n),v=c(qn),F=c(Hn),A=c(Pn),N=c(On),O=c(Un),R=c(Yn),V=c(Zn),T=c(Xn),b=t.useMemo(()=>fe.flatData(e.taskData||[],C=>C.children||[],C=>{const G={title:C[d.title],id:C[d.id],start:C[d.start],end:C[d.end],parentId:null};return d.parentId&&(G.parentId=C[d.parentId]),G}),[e.taskData,d]),$=t.useMemo(()=>b.filter(C=>C.id!==e.dataItem.id),[b,e.dataItem]),W=t.useMemo(()=>o.filter(C=>C.toId===e.dataItem.id),[o,e.dataItem]),_=t.useMemo(()=>o.filter(C=>C.fromId===e.dataItem.id),[o,e.dataItem]),X=t.useMemo(()=>o.filter(C=>C.id===null).map(C=>({id:C.id,fromId:C.fromId,toId:C.toId,type:C.type})),[o]),E=t.useMemo(()=>o.filter(C=>C.id!==null&&C.uid).map(C=>({id:C.id,fromId:C.fromId,toId:C.toId,type:C.type})),[o]),P=()=>{if(r){if(r.id){const C=o.filter(K=>K.id!==r.id);l(C);const G=o.filter(K=>K.id===r.id);g(K=>[...K,...G])}else{const C=o.filter(K=>K.uid!==r.uid);l(C);const G=o.filter(K=>K.uid===r.uid);g(K=>[...K,...G])}s(void 0)}},Y=t.useCallback(C=>C||C===0?void 0:O,[O]),q=t.useCallback(C=>C||C===0?C>=0&&C<=1?void 0:T:O,[O,T]),S=t.useCallback((C,G)=>C&&G(d.end)&&C.getTime()>G(d.end).getTime()?R:void 0,[d,R]),ne=t.useCallback((C,G)=>C&&G(d.start)&&C.getTime()<G(d.start).getTime()?V:void 0,[d,V]),x=t.useMemo(()=>[Y,S],[Y,S]),L=t.useMemo(()=>[Y,ne],[Y,ne]),j=t.useMemo(()=>Z.findByFieldValue(o,"fromId",null)||Z.findByFieldValue(o,"toId",null),[o]),ae=C=>{j||(n(C.selected),s(void 0))},B=C=>{s(C.dataItem)},U=()=>{const C={uid:h.guid(),id:null,fromId:null,toId:e.dataItem.id,type:me.FS};l([...o,C])},ke=()=>{const C={uid:h.guid(),id:null,fromId:e.dataItem.id,toId:null,type:me.FS};l([...o,C])},De=(C,G,K)=>{const ue={...C,uid:C.uid||h.guid(),[G]:K},Ee=o.findIndex(ce=>ce.id&&ce.id===ue.id||ce.uid&&ce.uid===ue.uid);Ee>-1&&(o.splice(Ee,1,ue),l([...o]))},H=t.useMemo(()=>$o.map(C=>{let G;switch(C.type){case me.FF:G=c(yt);break;case me.FS:G=c(Qn);break;case me.SF:G=c(jn);break;case me.SS:G=c(Jn);break;default:G=c(yt);break}return{...C,name:G}}),[c]);t.useEffect(()=>{e.onDependencyCreate&&e.onDependencyCreate.call(void 0,{createdDependencies:X,updatedDependencies:E,deletedDependencies:i})},[X,E,i,e.onDependencyCreate]);const se=e.dependencyData&&e.taskData,Se=t.createElement(ee.FormElement,{style:{width:400},horizontal:!0},t.createElement(ee.Field,{id:`${d.title}_gantteditor`,name:d.title,label:f,component:Xt,validator:Y}),t.createElement(ee.Field,{id:`${d.start}_gantteditor`,name:d.start,label:k,component:We,validator:x}),t.createElement(ee.Field,{id:`${d.end}_gantteditor`,name:d.end,label:p,component:We,validator:L}),t.createElement(ee.Field,{id:`${d.percentComplete}_gantteditor`,name:d.percentComplete,label:D,component:jt,validator:q})),xe=t.createElement(ee.FormElement,{style:{paddingInline:"4px"}},t.createElement("div",{className:"k-form-fieldset"},t.createElement("div",{className:"k-form-layout k-d-grid k-grid-cols-4 k-gap-x-2"},t.createElement(ee.Field,{id:`${d.title}_gantteditor`,name:d.title,label:f,component:Xt,validator:Y}),t.createElement(ee.Field,{id:`${d.start}_gantteditor`,name:d.start,label:k,component:We,validator:x}),t.createElement(ee.Field,{id:`${d.end}_gantteditor`,name:d.end,label:p,component:We,validator:L}),t.createElement(ee.Field,{id:`${d.percentComplete}_gantteditor`,name:d.percentComplete,label:D,component:jt,validator:q}),d.parentId&&t.createElement(ee.Field,{id:`${d.parentId}_gantteditor`,name:d.parentId||"",idField:d.id,label:v,component:Ho,data:$,dataItem:e.dataItem})))),ye=t.createElement(Oe.TabStrip,{selected:a,onSelect:ae},t.createElement(Oe.TabStripTab,{title:F},xe),t.createElement(Oe.TabStripTab,{title:A},t.createElement(Wo,{flatTasks:b,predecessors:W,dependencyTypes:H,selectedItem:r,onSelectRow:B,addPredecessorsDependency:U,deleteDependency:P,updateDependency:De})),t.createElement(Oe.TabStripTab,{title:N},t.createElement(Ko,{flatTasks:b,successors:_,dependencyTypes:H,selectedItem:r,onSelectRow:B,addSuccessorsDependency:ke,deleteDependency:P,updateDependency:De})));return se?ye:Se},Uo=e=>{const{onCancel:a,onDelete:n,onClose:r,onSubmit:s,...o}=e,l=t.useRef(e.dataItem),[i,g]=t.useState({}),d=J.useLocalization(),m=T=>d.toLanguageString(T,ie[T]),c=m(zn),f=m(Pt),k=m(_t),p=m(Wn),D=t.useCallback(T=>{if(a){const b={syntheticEvent:T,nativeEvent:T.nativeEvent,dataItem:e.dataItem};a.call(void 0,b)}},[a,e.dataItem]),v=t.useCallback(T=>{if(n){const b={syntheticEvent:T,nativeEvent:T.nativeEvent,dataItem:e.dataItem};n.call(void 0,b)}},[n,e.dataItem]),F=t.useCallback(({syntheticEvent:T})=>{if(r){const b={syntheticEvent:T,nativeEvent:T.nativeEvent,dataItem:e.dataItem};r.call(void 0,b)}},[r,e.dataItem]),A=t.useCallback((T,b)=>{if(s){const $={dataItem:T,initialDataItem:l.current,syntheticEvent:b,nativeEvent:b&&b.nativeEvent,dependencies:i};s.call(void 0,$)}},[s,i]),N=t.useMemo(()=>Z.findByFieldValue(i.createdDependencies,"fromId",null)||Z.findByFieldValue(i.createdDependencies,"toId",null),[i]),O=t.useMemo(()=>i.createdDependencies&&i.createdDependencies.length&&N===void 0||i.updatedDependencies&&i.updatedDependencies.length||i.deletedDependencies&&i.deletedDependencies.length,[i,N]),R=t.useCallback(T=>{g(T)},[]),V=t.createElement(ee.Form,{initialValues:e.dataItem,onSubmit:A,render:T=>t.createElement(Ke.Window,{title:p,minWidth:90,width:554,modal:!0,height:0,onClose:F},t.createElement(qo,{taskData:e.taskData,dependencyData:e.dependencyData,dataItem:e.dataItem,onDependencyCreate:R}),t.createElement(Ke.WindowActionsBar,{layout:"start"},t.createElement(te.Button,{disabled:!T.allowSubmit&&!O,onClick:T.allowSubmit?T.onSubmit:b=>A(e.dataItem,b),icon:"save",svgIcon:pe.saveIcon,themeColor:"primary"},c),t.createElement(te.Button,{onClick:D,type:"button",icon:"cancel",svgIcon:pe.cancelIcon},f),t.createElement("div",{className:"k-spacer"}),n&&t.createElement(te.Button,{onClick:v,icon:"trash",svgIcon:pe.trashIcon,fillMode:"flat",themeColor:"primary"},k))),...o});return h.canUseDOM?en.createPortal(V,document&&document.body):null},Yo=e=>{const{onClose:a,onCancel:n,onConfirm:r,dataItem:s}=e,o=J.useLocalization(),l=D=>o.toLanguageString(D,ie[D]),i=l(_t),g=l(Pt),d=l(ra),m=l(sa),c=t.useCallback(({syntheticEvent:D})=>{a&&a.call(void 0,{syntheticEvent:D,nativeEvent:D&&D.nativeEvent,dataItem:null})},[a]),f=t.useCallback(D=>{n&&n.call(void 0,{syntheticEvent:D,nativeEvent:D&&D.nativeEvent,dataItem:null})},[n]),k=t.useCallback(D=>{r&&r.call(void 0,{syntheticEvent:D,nativeEvent:D&&D.nativeEvent,dataItem:s})},[r,s]),p=t.createElement(Ke.Dialog,{title:m,onClose:c},d,t.createElement(Ke.DialogActionsBar,{layout:"end"},t.createElement(te.Button,{themeColor:"primary",onClick:k},i),t.createElement(te.Button,{onClick:f},g)));return h.canUseDOM?en.createPortal(p,document&&document.body):null},Zo=fe.TreeListRow;Object.defineProperty(exports,"getSelectedState",{enumerable:!0,get:()=>I.getSelectedState});Object.defineProperty(exports,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>I.getSelectedStateFromKeyDown});Object.defineProperty(exports,"setSelectedState",{enumerable:!0,get:()=>I.setSelectedState});exports.GANTT_COL_INDEX_ATTRIBUTE=Fa;exports.GANTT_PREVENT_SELECTION_ELEMENT=La;exports.GANTT_ROW_INDEX_ATTRIBUTE=Na;exports.Gantt=Qe;exports.GanttBooleanFilter=pa;exports.GanttDateFilter=Ca;exports.GanttDayView=Je;exports.GanttForm=Uo;exports.GanttMonthView=et;exports.GanttNumericFilter=fa;exports.GanttRemoveDialog=Yo;exports.GanttRow=Zo;exports.GanttTextFilter=ha;exports.GanttWeekView=Pe;exports.GanttYearView=tt;exports.addDependency=No;exports.addTask=Fo;exports.createDataTree=Ba;exports.extendDataItem=_a;exports.filterBy=Wa;exports.mapTree=Ae;exports.orderBy=Oa;exports.removeTask=Vo;exports.updateTask=Lo;