UNPKG

@mescius/spread-sheets-ganttsheet

Version:

SpreadJS GanttSheet Plugin

12 lines 290 kB
/*! * * SpreadJS Library 18.0.7 * * Copyright(c) MESCIUS inc. All rights reserved. * * Licensed under the SpreadJS Commercial License. * us.sales@mescius.com * https://developer.mescius.com/spreadjs * */ !function(t){"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("@mescius/spread-sheets")):"function"==typeof define&&define.amd?define(["@mescius/spread-sheets"],t):"object"==typeof exports?exports.Spread=t(require("@mescius/spread-sheets")):t(GC)}(function(n){!function(){"use strict";var i,e,t;function s(t){var n,n,n=e[t];return void 0!==n||(n=e[t]={exports:{}},i[t].call(n.exports,n,n.exports,s)),n.exports}i={"./dist/plugins/gantt/celltypes/complete.js":function(t,n,i){var e,s,i,r,u,o,i,h,a;function c(){var t=a.call(this)||this;return t.typeName="100",t}e=this&&this.__extends||(h=function(t,n){return(h=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}h(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(n,"__esModule",{value:!0}),n.TaskCompleteCellType=void 0,s=i("Core"),i=i("./dist/plugins/gantt/celltypes/numberInput.base.js"),r=Math.floor,u=Math.ceil,o=Math.round,a=i.NumberInputCellType,e(c,a),c.prototype.getChangedValue=function(t){var n,i,e,t,n,n=t.sheet,i=t.row,e=t.col,t=t.isReservedOnButton,n=n.getValue(i,e);return"Up"===t?n=(5*r(o(100*n)/5)+5)/100:"Down"===t&&(n=(5*u(o(100*n)/5)-5)/100),n=n<0?0:n},n.TaskCompleteCellType=i=c,s.CellTypes.ti[100]=i},"./dist/plugins/gantt/celltypes/date.js":function(t,n,i){var e,o,s,i,i,h,u,i,r,a,c;function f(t,n,i){var t=a.call(this,t)||this;return t.sAi=n,t.rAi=i,t}function l(t){var n=c.call(this)||this;return n.typeName="101",n.hAi=!!t,n}e=this&&this.__extends||(r=function(t,n){return(r=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(n,"__esModule",{value:!0}),n.TaskDateCellType=void 0,o=i("Common"),s=i("Core"),i=i("./dist/plugins/gantt/gantt.ns.js"),i=new o.Common.ResourceManager(i.SR,"GanttSheet"),h=i.getResource.bind(i),a=o.Formatter.GeneralFormatter,e(f,a),f.prototype.parse=function(t){var n,i,e,s,t,n=a.prototype.parse.call(this,t);if(n instanceof Date)if(0===n.getHours()&&0===n.getMinutes()&&0===n.getSeconds()&&0===n.getMilliseconds())try{i=this.sAi,e=t+" ".concat(i.hour,":").concat(i.minute),(s=a.prototype.parse.call(this,e))instanceof Date&&(n=s)}catch(t){}else 1899===n.getFullYear()&&11===n.getMonth()&&30===n.getDate()&&(t=this.rAi,n.setFullYear(t.getFullYear()),n.setMonth(t.getMonth()),n.setDate(t.getDate()));return n},u=f,c=s.CellTypes.Text,e(l,c),Object.defineProperty(l.prototype,"forStartDate",{get:function(){return this.hAi},set:function(t){this.hAi=t},enumerable:!1,configurable:!0}),l.prototype.getDefaultTime=function(t){return this.hAi?{hour:8,minute:0}:{hour:17,minute:0}},l.prototype.getDefaultDate=function(t){return new Date},l.prototype.parse=function(t,n,i){var n,n,e,s,r,u,t,n="string"==typeof n?n:h().DEFAULT_DATE_TIME_FORMAT,n=new o.Formatter.GeneralFormatter(n),e=n.parse(t);if(e instanceof Date&&0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds()&&0===e.getMilliseconds())try{s=this.getDefaultTime(i),r=t+" ".concat(s.hour,":").concat(s.minute),(u=n.parse(r))instanceof Date&&(e=u)}catch(t){}else 1899===e.getFullYear()&&11===e.getMonth()&&30===e.getDate()&&(t=this.getDefaultDate(i),e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(t.getDate()));return e},l.prototype.format=function(t,n,i,e){var n,s,n="string"==typeof n?n:h().DEFAULT_DATE_TIME_FORMAT,s;return new o.Formatter.GeneralFormatter(n).format(t)},l.prototype.je=function(t,n,i,e){var n,n,s,r,n=n.formatter,n="string"==typeof n?n:h().DEFAULT_DATE_TIME_FORMAT,s=this.getDefaultTime(e),r=this.getDefaultDate(e);return t.Ii=new u(n,s,r),this.format(i,n,null,e)},n.TaskDateCellType=i=l,s.CellTypes.ti[101]=i},"./dist/plugins/gantt/celltypes/duration.js":function(t,n,i){var e,s,r,i,i,u,o;function h(t){var t=o.call(this,t=void 0===t?!0:t)||this;return t.typeName="102",t}e=this&&this.__extends||(u=function(t,n){return(u=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}u(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(n,"__esModule",{value:!0}),n.TaskDurationCellType=void 0,s=i("Core"),r=i("./dist/plugins/gantt/project/calendar.js"),i=i("./dist/plugins/gantt/celltypes/numberInput.base.js"),o=i.NumberInputCellType,e(h,o),h.prototype.oAi=function(t){if(t&&t.sheet&&t.sheet.NMi)return t.sheet.NMi.project},h.prototype.cAi=function(t){return t.row},h.prototype.parse=function(t,n,i){var i=this.oAi(i);return i?i.parseDuration(t):t},h.prototype.format=function(t,n,i,e){var e=this.oAi(e);return e?e.formatDuration(t):t},h.prototype.je=function(t,n,i,e){var e=this.oAi(e);return e?e.formatDuration(i):i},h.prototype.getChangedValue=function(t){var n,i,e,s,n=this.oAi(t),i=t.sheet.getValue(t.row,t.col);if(n)return i=(i=n.parseDuration(i))?(e=i.value,s=i.unit,"Up"===t.isReservedOnButton?e=Math.floor(e+1):"Down"===t.isReservedOnButton&&(e=Math.max(Math.ceil(e-1),0)),{value:e,unit:s}):r.DurationHelper.default(n.calendarSettings),i=n.parseDuration(i)},n.TaskDurationCellType=i=h,s.CellTypes.ti[102]=i},"./dist/plugins/gantt/celltypes/numberInput.base.js":function(t,n,i){var e,c,s,r,u,o,h,a,f,l,d,A;function v(t){void 0===t&&(t=!0);var n=A.call(this)||this;return n.showButton=t,n.aAi="None",n.typeName="NumberInput",n}function g(){this.isReservedOnButton="None"}function b(t,n,i,e,s){var r,u,r;if(t.getCellType(n,i,s)instanceof a){e&&t.Ut.do("setValueForKey",n,i,h,!0,s);try{u=t.getCellRect(n,i,s),t.repaint(u)}finally{e&&t.Ut.do("setValueForKey",n,i,h,void 0,s)}}}e=this&&this.__extends||(d=function(t,n){return(d=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}d(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(n,"__esModule",{value:!0}),n.NumberInputCellType=n.NumberInputCellHitInfo=void 0,c=i("Core"),r=3,u=s=5,o=8,h="_leaveCell",A=c.CellTypes.Text,e(v,A),v.prototype.paint=function(t,n,i,e,s,r,u,o){var h,a,h=this.isCurrentCellSelected(o.sheet,o.row,o.col),a=u.hAlign;h&&(u.hAlign=c.HorizontalAlign.left),A.prototype.paint.call(this,t,n,i,e,s,r,u,o),h&&this.showButton&&this.paintButtons(t,i,e,s,r,o),u.hAlign=a},v.prototype.isCurrentCellSelected=function(t,n,i){var e=t.Ut.getValueForKey(n,i,h);return t.getActiveRowIndex()===n&&t.getActiveColumnIndex()===i&&!0!==e},v.prototype.paintButtons=function(t,n,i,e,s,r){this.drawTriangleUp(t,n+e-8-5,i+(s-6-5)/2,5,3,r),this.drawTriangleDown(t,n+e-8-5,i+(s-6-5)/2+3+5,5,3,r)},v.prototype.drawTriangleUp=function(t,n,i,e,s,r){var u="Up"===this.aAi?"black":"gray";t.beginPath(),t.moveTo(n+e/2,i),t.lineTo(n,i+s),t.lineTo(n+e,i+s),t.lineTo(n+e/2,i),t.closePath(),t.strokeStyle=u,t.stroke(),t.fillStyle=u,t.fill()},v.prototype.drawTriangleDown=function(t,n,i,e,s,r){var u="Down"===this.aAi?"black":"gray";t.beginPath(),t.moveTo(n,i),t.lineTo(n+e/2,i+s),t.lineTo(n+e,i),t.lineTo(n,i),t.closePath(),t.strokeStyle=u,t.stroke(),t.fillStyle=u,t.fill()},v.prototype.getButtonHoveredByHitInfo=function(t){var n,i,e,s,n,n=t.cellRect,i=t.x,e=t.y,s=new c.Rect(n.x+n.width-8-5-1,n.y,7,n.height/2),n=new c.Rect(n.x+n.width-8-5-1,n.y+n.height/2,7,n.height/2);return t.sheet.getActiveRowIndex()===t.row&&t.sheet.getActiveColumnIndex()===t.col&&this.showButton?s.contains(i,e)?"Up":n.contains(i,e)?"Down":"None":"None"},v.prototype.refreshButtonHoverEffect=function(t,n,i){(this.aAi!==n||this.fAi&&this.fAi!==i)&&(this.aAi=n,"None"===this.aAi&&this.fAi?(t.repaint(this.fAi),delete this.fAi):(t.repaint(i),this.fAi=i))},v.prototype.getHitInfo=function(t,n,i,e,s){var r,r;if(s&&(null==(r=s.sheetArea)||3===r))return(r={x:t,y:n,row:s.row,col:s.col,cellRect:e,sheetArea:c.SheetArea.viewport,isReservedLocation:!1,sheet:s.sheet,cellStyle:i,isReservedOnButton:"None"}).isReservedOnButton=this.getButtonHoveredByHitInfo(r),r},v.prototype.processMouseMove=function(t){var n;if(t)return n=t.cellRect,this.refreshButtonHoverEffect(t.sheet,t.isReservedOnButton,n),A.prototype.processMouseMove.call(this,t)},v.prototype.getChangedValue=function(t){},v.prototype.processMouseDown=function(t){var n;if(t&&(t.row===t.sheet.getActiveRowIndex()&&t.col===t.sheet.getActiveColumnIndex()&&"None"!==t.isReservedOnButton))return n=this.getChangedValue(t),t.sheet.setValue(t.row,t.col,n),A.prototype.processMouseDown.call(this,t)},v.prototype.processMouseLeave=function(t){return this.refreshButtonHoverEffect(t.sheet,t.isReservedOnButton,t.cellRect),!1},v.prototype.getAutoFitWidth=function(t,n,i,e,s){var r;return A.prototype.getAutoFitWidth.call(this,t,n,i,e,s)+5+16},v.prototype.getAutoFitHeight=function(t,n,i,e,s){var t=A.prototype.getAutoFitHeight.call(this,t,n,i,e,s);return Math.max(t,18)},v.prototype.toJSON=function(){return{typeName:this.typeName}},a=v,n.NumberInputCellType=a,n.NumberInputCellHitInfo=g,c.Worksheet.ch(l="numberInputCellType",{setHost:function(){var i=this;i.bind(c.Events.EnterCell+"."+l,function(t,n){b(i,n.row,n.col,!1,n.sheetArea)}),i.bind(c.Events.LeaveCell+"."+l,function(t,n){b(i,n.row,n.col,!0,n.sheetArea)}),i.bind(c.Events.TopRowChanged+"."+l,function(t,n){b(i,n.row,n.col,!0,n.sheetArea)})},dispose:function(t){var n=this;n.unbind(c.Events.EnterCell+"."+l),n.unbind(c.Events.LeaveCell+"."+l),n.unbind(c.Events.TopRowChanged+"."+l)}})},"./dist/plugins/gantt/celltypes/predecessor.js":function(t,n,i){var e,c,o,i,h,a,i,f,s,r,u,l,d,A,v;function g(){var t=v.call(this)||this;return t.typeName="103",t}function b(t,n){var e=this;this.globalMousedownEventHandler=function(t){var n,i;if(e.rf){for(i=n=t.target;i&&i!==e.Wc;)i=i.parentElement;i||(e.close(),t.stopPropagation(),t.preventDefault())}},this.windowResizeEventHandler=function(){e.rf&&e.close()},this.rf=!1,this.lAi=t,this.LEt=n,this.AAi=this.getOriginalValueMap()}function m(){return{canUndo:!1,execute:function(t,n){var i,t,e,s,r,u,i=(0,c._f)(t,n.sheetName);return!!(i&&t.jg().name()===n.sheetName&&i.NMi instanceof o.GanttSheet)&&(t=n.row,e=n.col,(h(t)||h(e))&&(n.row=t=i.getActiveRowIndex(),n.col=e=i.getActiveColumnIndex()),s=n.sheetArea,h(s)&&(n.sheetArea=s=3),(r=i.getCellType(t,e,s))instanceof a)&&(i.showCell(t,e,c.VerticalPosition.nearest,c.HorizontalPosition.nearest),(u=new d(i.NMi,n)).open(),!0)}}}e=this&&this.__extends||(A=function(t,n){return(A=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}A(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(n,"__esModule",{value:!0}),n.TaskPredecessorCellType=void 0,c=i("Core"),o=i("./dist/plugins/gantt/gantt-sheet.js"),i=i("Common"),h=i.Common.lt.ht,v=c.CellTypes.Text,e(g,v),g.prototype.toJSON=function(){return{typeName:this.typeName}},a=g,n.TaskPredecessorCellType=a,c.CellTypes.ti[103]=a,i="taskPredecessorCellType",f="data-task-number",s="OpenPredecessor",r="ribbon-dropdowngroup-popup",u="_cellButtonParam",l=window.gcGlobal,Object.defineProperty(b.prototype,"sheet",{get:function(){return this.lAi.Mf},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"project",{get:function(){return this.lAi.project},enumerable:!1,configurable:!0}),b.prototype.open=function(){this.rf||(l.ef(),this.bindEvent(),this.render(),this.clearPosition(),this.calcPosition(),this.scrollListToCurrentItem(),this.attachExpandButtonClick(),this.rf=!0,this.Wc.tabIndex=-1,this.Wc.style.cssText+="outline:none",this.Wc.focus())},b.prototype.dispose=function(){var n=this;document.removeEventListener("resize",this.windowResizeEventHandler),"mousedown touchstart MSPointerDown pointerdown".split(" ").forEach(function(t){document.removeEventListener(t,n.globalMousedownEventHandler,!0)}),this.Ti.parentElement.removeChild(this.Ti),this.Ti=null},b.prototype.close=function(){if(this.rf){this.rf=!1;try{this.setValue()}catch(t){}finally{this.dispose(),this.gAi(),l.cf()}}},b.prototype.gAi=function(){var t,n,i,e,e,t=this.LEt.row,n=this.LEt.col,i=this.LEt.sheetArea,e=this.sheet.Il(t,n,i).cellButtons;this.sheet&&e&&0<e.length&&(e=this.sheet.Ut.getValueForKey(t,n,u,i))&&e.isMouseDownReservedLocation&&(e.buttonDownIndex=-1,e.isMouseDownReservedLocation=!1,this.sheet.repaint(this.sheet.getCellRect(t,n)))},b.prototype.bindEvent=function(){var n=this;"mousedown touchstart MSPointerDown pointerdown".split(" ").forEach(function(t){document.addEventListener(t,n.globalMousedownEventHandler,!0)}),document.addEventListener("resize",this.windowResizeEventHandler)},b.prototype.render=function(){this.Ti=document.createElement("div"),this.Ti.style.cssText="position:absolute; z-index:10000; box-shadow:rgba(0, 0, 0, 0.4) 2px 4px 5px; outline:none",this.Ti.classList.add(r),this.Wc=document.createElement("div"),this.renderList(),this.Ti.appendChild(this.Wc),this.sheet.qc().appendChild(this.Ti)},b.prototype.renderList=function(){var t,n;this.Wc.classList.add("gc-list-control"),this.Wc.style.outline="none",(t=document.createElement("div")).className="gc-list-control-container gc-list-alignment-vertical",t.style.maxHeight="300px",t.style.maxWidth="500px",t.style.overflow="auto",this.Wc.appendChild(t),n=this.project.root,this.renderTaskTree(n,t)},b.prototype.scrollListToCurrentItem=function(){var t,t,t,t=this.project.getRowState(this.LEt.row).taskNumber,t=document.querySelector("[".concat(f,'="').concat(t,'"]'));t&&(t=t.parentElement.parentElement.offsetTop,document.querySelector(".gc-list-control-container").scrollTop=t)},b.prototype.attachExpandButtonClick=function(){var i=this;this.Wc.addEventListener("click",function(t){var n=t.target;n.hasAttribute("data-open")&&(i.setButtonExpandStatus(n,"false"===n.getAttribute("data-open")),t.preventDefault(),t.stopImmediatePropagation())})},b.prototype.renderTaskTree=function(t,n){var i,e,s,r,i=this,e=this.project.Pki(t),s=document.createElement("div");s.className="gc-list-control-tree",n.appendChild(s),e||this.renderTaskItem(t,!0,s),(r=document.createElement("div")).className="gc-list-control-tree-content gc-list-alignment-vertical",e||(r.style.marginLeft="1.5em"),s.appendChild(r),t.children.forEach(function(t){0<t.children.length?i.renderTaskTree(t,r):i.renderTaskItem(t,!1,r)})},b.prototype.renderTaskItem=function(t,n,i){var e,s,r,u,n,n,e,n,e=this.project.getRowState(this.LEt.row).task,s=Object.keys(this.AAi).map(function(t){return parseInt(t)}),r=document.createElement("div");r.classList.add("gc-list-control-item"),n&&r.classList.add("gc-list-control-hassubitem"),(u=document.createElement("label")).setAttribute("for","task-".concat(t.taskNumber)),u.className="gc-list-control-tree-text",u.style.display="flex",u.style.alignItems="center",n&&((n=document.createElement("span")).style.display="inline-flex",n.style.transition="0.2s linear",n.style.borderLeft="5px solid transparent",n.style.borderRight="5px solid transparent",n.style.borderTop="6px solid #000",this.setButtonExpandStatus(n,!0),u.appendChild(n)),e&&e.taskNumber===t.taskNumber?((n=document.createElement("span")).id="task-".concat(t.taskNumber),n.style.width="23px",n.style.height="18px",n.style.display="inline-block",n.setAttribute(f,t.taskNumber.toString()),u.appendChild(n),u.style.backgroundColor="#E1E1E1",u.style.cursor="default"):((e=document.createElement("input")).id="task-".concat(t.taskNumber),e.type="checkbox",e.style.marginLeft="5px",e.style.marginRight="5px",e.setAttribute(f,t.taskNumber.toString()),-1<s.indexOf(t.taskNumber)&&(e.checked=!0),u.appendChild(e)),(n=document.createElement("span")).innerText="".concat(t.taskNumber," ").concat(t.name||""),this.setTextSpanEllipsis(n),u.appendChild(n),r.appendChild(u),i.appendChild(r)},b.prototype.setButtonExpandStatus=function(t,n){for(var i=t;i&&!i.classList.contains("gc-list-control-tree");)i=i.parentElement;n?(t.style.removeProperty("transform"),t.setAttribute("data-open","true"),i&&i.classList.remove("hide-children")):(t.style.transform="rotate(-90deg)",t.setAttribute("data-open","false"),i&&i.classList.add("hide-children"))},b.prototype.setTextSpanEllipsis=function(t){t.style.overflow="hidden",t.style.textOverflow="ellipsis",t.style.whiteSpace="nowrap",t.title=t.innerText},b.prototype.clearPosition=function(){this.Ti.style.top=this.Ti.style.bottom=this.Ti.style.left=this.Ti.style.right=""},b.prototype.getTargetRect=function(){var t,n,t,t=1===this.LEt.sheetArea?-1:void 0,n=2===this.LEt.sheetArea?-1:void 0,t=this.sheet.getCellRect(this.LEt.row,this.LEt.col,t,n);return t.x=this.sheet.uw().left+t.x,t.y=this.sheet.uw().top+t.y,t},b.prototype.calcPosition=function(){var t,n,i,n,e,s,e,t=this.calculateDropDownLocation(),n=this.Ti.offsetParent,i=n.getBoundingClientRect(),n=n===document.body,e=document.documentElement,s=(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0),e=(window.pageYOffset||e.scrollTop)-(e.clientTop||0);this.Ti.style.left="".concat(t.x-(n?-s:i.left),"px"),this.Ti.style.top="".concat(t.y-(n?-e:i.top),"px")},b.prototype.calculateDropDownLocation=function(){var t,n,i,e,n,s,r,u,o,h,a,i,t=new c.Rect(0,0,window.innerWidth,window.innerHeight),n=this.getTargetRect(),i=n.x+n.width,e=n.y,n=n.y+n.height,s=t.height-n,r=!0,u=this.Wc.offsetHeight,o=this.Wc.offsetWidth,a=0;return(i=new c.Rect(h=i-o,a=(r=s<u?!1:r)?n:e-u,o,u)).width>t.width?i.x=0:(i.x=Math.max(i.x,0),i.x=Math.min(i.x,t.width-i.width)),i.height>t.height?i.y=0:(i.y=Math.max(i.y,0),i.y=Math.min(i.y,t.height-i.height)),{x:i.x,y:i.y}},b.prototype.getOriginalValueMap=function(){var t,i,e,t=this.sheet.getValue(this.LEt.row,this.LEt.col),i=/^(\d*)[^\d]*$/,e={};return t?(t.split(",").forEach(function(t){var n;t.match(i)&&(n=t.match(i)[1],e[n]=t.match(i)[0])}),e):{}},b.prototype.getSelectedValuesInList=function(){var n,t,i,n=this.AAi,t=this.Wc.querySelectorAll(".gc-list-control-item input:checked"),i=[];return t.forEach(function(t){var t=parseInt(t.getAttribute(f));n[t]?i.push(n[t]):i.push(t.toString())}),i.join(",")},b.prototype.setValue=function(){var t,n,i,e,s,r,u,s,o,s,t=this.sheet,n=this.getSelectedValuesInList(),i=this.LEt.row,e=this.LEt.col,s=this.LEt.sheetArea;t.isEditing()&&t.ci===e&&t.ui===i?(r=t.getCellType(i,e),u={sheet:t,row:i,col:e,sheetArea:s},s=t.Il(i,e,s),o=t.getCellRect(i,e),r.updateEditor(t.li,s,o,u),r.setEditorValue(t.li,n,u)):(s=t.getValue(i,e),h(s)&&""===n||n!==s&&t.setValue(i,e,n))},d=b,c.Workbook.ch(i,{init:function(){this.commandManager().register(s,m())}})},"./dist/plugins/gantt/celltypes/resources.js":function(t,n,i){var e,c,o,i,h,a,i,f,s,r,u,l,d,A,v;function g(){var t=v.call(this)||this;return t.typeName="104",t}function b(t,n){var e=this;this.globalMousedownEventHandler=function(t){var n,i;if(e.rf){for(i=n=t.target;i&&i!==e.Wc;)i=i.parentElement;i||(e.close(),t.stopPropagation(),t.preventDefault())}},this.windowResizeEventHandler=function(){e.rf&&e.close()},this.rf=!1,this.lAi=t,this.LEt=n,this.AAi=this.getOriginalValueMap()}function m(){return{canUndo:!1,execute:function(t,n){var i,t,e,s,r,u,i=(0,c._f)(t,n.sheetName);return!!(i&&t.jg().name()===n.sheetName&&i.NMi instanceof o.GanttSheet)&&(t=n.row,e=n.col,(h(t)||h(e))&&(n.row=t=i.getActiveRowIndex(),n.col=e=i.getActiveColumnIndex()),s=n.sheetArea,h(s)&&(n.sheetArea=s=3),(r=i.getCellType(t,e,s))instanceof a)&&(i.showCell(t,e,c.VerticalPosition.nearest,c.HorizontalPosition.nearest),(u=new d(i.NMi,n)).open(t),!0)}}}e=this&&this.__extends||(A=function(t,n){return(A=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}A(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(n,"__esModule",{value:!0}),n.TaskResourcesCellType=void 0,c=i("Core"),o=i("./dist/plugins/gantt/gantt-sheet.js"),i=i("Common"),h=i.Common.lt.ht,v=c.CellTypes.Text,e(g,v),g.prototype.toJSON=function(){return{typeName:this.typeName}},a=g,n.TaskResourcesCellType=a,c.CellTypes.ti[104]=a,i="taskResourcesCellType",f="data-resource-id",s="OpenResources",r="ribbon-dropdowngroup-popup",u="_cellButtonParam",l=window.gcGlobal,Object.defineProperty(b.prototype,"sheet",{get:function(){return this.lAi.Mf},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"project",{get:function(){return this.lAi.project},enumerable:!1,configurable:!0}),b.prototype.open=function(t){var t,n,i,t;if(!this.rf){if(t=this.lAi.getTaskByRow(t),i=(n=this.project.host.getDataView()).gLt.primaryKey(),t=t.getDataValue(i),h(t))return!1;l.ef(),this.bindEvent(),this.render(),this.clearPosition(),this.calcPosition(),this.rf=!0,this.Wc.tabIndex=-1,this.Wc.style.cssText+="outline:none",this.Wc.focus()}},b.prototype.dispose=function(){var n=this;document.removeEventListener("resize",this.windowResizeEventHandler),"mousedown touchstart MSPointerDown pointerdown".split(" ").forEach(function(t){document.removeEventListener(t,n.globalMousedownEventHandler,!0)}),this.Ti.parentElement.removeChild(this.Ti),this.Ti=null},b.prototype.close=function(){if(this.rf){this.rf=!1;try{this.setValue()}catch(t){}finally{this.dispose(),this.gAi(),l.cf()}}},b.prototype.gAi=function(){var t,n,i,e,e,t=this.LEt.row,n=this.LEt.col,i=this.LEt.sheetArea,e=this.sheet.Il(t,n,i).cellButtons;this.sheet&&e&&0<e.length&&(e=this.sheet.Ut.getValueForKey(t,n,u,i))&&e.isMouseDownReservedLocation&&(e.buttonDownIndex=-1,e.isMouseDownReservedLocation=!1,this.sheet.repaint(this.sheet.getCellRect(t,n)))},b.prototype.bindEvent=function(){var n=this;"mousedown touchstart MSPointerDown pointerdown".split(" ").forEach(function(t){document.addEventListener(t,n.globalMousedownEventHandler,!0)}),document.addEventListener("resize",this.windowResizeEventHandler)},b.prototype.render=function(){this.Ti=document.createElement("div"),this.Ti.style.cssText="position:absolute; z-index:10000; box-shadow:rgba(0, 0, 0, 0.4) 2px 4px 5px; outline:none",this.Ti.classList.add(r),this.Wc=document.createElement("div"),this.renderList(),this.Ti.appendChild(this.Wc),this.sheet.qc().appendChild(this.Ti)},b.prototype.renderList=function(){var t,n,i;for(this.Wc.classList.add("gc-list-control"),this.Wc.style.outline="none",(t=document.createElement("div")).className="gc-list-control-container gc-list-alignment-vertical",t.style.maxHeight="300px",t.style.maxWidth="500px",t.style.overflow="auto",this.Wc.appendChild(t),n=this.project.resourcesManager.resourcesList,i=0;i<n.length;i++)this.renderResource(n[i],t)},b.prototype.renderResource=function(t,n){var i=document.createElement("div");i.className="gc-list-control-tree",n.appendChild(i),this.renderResourceItem(t,!0,i)},b.prototype.renderResourceItem=function(t,n,i){var e,t,s,r,n,u,s,e=t.id,t=t.name,s=Object.keys(this.AAi),r=document.createElement("div");r.classList.add("gc-list-control-item"),n&&r.classList.add("gc-list-control-hassubitem"),(n=document.createElement("label")).setAttribute("for","resource-".concat(e)),n.className="gc-list-control-tree-text",n.style.display="flex",n.style.alignItems="center",(u=document.createElement("input")).id="resource-".concat(e),u.type="checkbox",u.style.marginLeft="5px",u.style.marginRight="5px",u.setAttribute(f,e.toString()||""),-1<s.indexOf(e.toString())&&(u.checked=!0),n.appendChild(u),(s=document.createElement("span")).innerText="".concat(t||""),this.setTextSpanEllipsis(s),n.appendChild(s),r.appendChild(n),i.appendChild(r)},b.prototype.setTextSpanEllipsis=function(t){t.style.overflow="hidden",t.style.textOverflow="ellipsis",t.style.whiteSpace="nowrap",t.title=t.innerText},b.prototype.clearPosition=function(){this.Ti.style.top=this.Ti.style.bottom=this.Ti.style.left=this.Ti.style.right=""},b.prototype.getTargetRect=function(){var t,n,t,t=1===this.LEt.sheetArea?-1:void 0,n=2===this.LEt.sheetArea?-1:void 0,t=this.sheet.getCellRect(this.LEt.row,this.LEt.col,t,n);return t.x=this.sheet.uw().left+t.x,t.y=this.sheet.uw().top+t.y,t},b.prototype.calcPosition=function(){var t,n,i,n,e,s,e,t=this.calculateDropDownLocation(),n=this.Ti.offsetParent,i=n.getBoundingClientRect(),n=n===document.body,e=document.documentElement,s=(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0),e=(window.pageYOffset||e.scrollTop)-(e.clientTop||0);this.Ti.style.left="".concat(t.x-(n?-s:i.left),"px"),this.Ti.style.top="".concat(t.y-(n?-e:i.top),"px")},b.prototype.calculateDropDownLocation=function(){var t,n,i,e,n,s,r,u,o,h,a,i,t=new c.Rect(0,0,window.innerWidth,window.innerHeight),n=this.getTargetRect(),i=n.x+n.width,e=n.y,n=n.y+n.height,s=t.height-n,r=!0,u=this.Wc.offsetHeight,o=this.Wc.offsetWidth,a=0;return(i=new c.Rect(h=i-o,a=(r=s<u?!1:r)?n:e-u,o,u)).width>t.width?i.x=0:(i.x=Math.max(i.x,0),i.x=Math.min(i.x,t.width-i.width)),i.height>t.height?i.y=0:(i.y=Math.max(i.y,0),i.y=Math.min(i.y,t.height-i.height)),{x:i.x,y:i.y}},b.prototype.getOriginalValueMap=function(){var i,t,e,i=this,t=this.sheet.getValue(this.LEt.row,this.LEt.col),e={};return t?(t.forEach(function(t){var n=i.project.resourcesManager.getResourcesByName(t).id;e[n]=t}),e):{}},b.prototype.getSelectedValuesInList=function(){var n,i,t,e,n=this,i=this.AAi,t=this.Wc.querySelectorAll(".gc-list-control-item input:checked"),e=[];return t.forEach(function(t){var t,t,t=parseInt(t.getAttribute(f));i[t]?e.push(i[t]):(t=n.project.resourcesManager.getResourcesById(t),e.push(t.name))}),e},b.prototype.setValue=function(){var t,n,i,e,t=this.sheet,n=this.getSelectedValuesInList(),i=this.LEt.row,e=this.LEt.col;t.setValue(i,e,n)},d=b,c.Workbook.ch(i,{init:function(){this.commandManager().register(s,m())}})},"./dist/plugins/gantt/celltypes/subject.js":function(t,n,i){var e,i,e,s,r;function u(){var t=r.call(this)||this;return t.typeName="105",t}e=this&&this.__extends||(s=function(t,n){return(s=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}s(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(n,"__esModule",{value:!0}),n.TaskSubjectCellType=void 0,i=i("Core"),r=i.CellTypes.Text,e(u,r),u.prototype.cAi=function(t){return t.row},u.prototype.toJSON=function(){return{typeName:this.typeName}},n.TaskSubjectCellType=e=u,i.CellTypes.ti[105]=e},"./dist/plugins/gantt/celltypes/taskbar.js":function(t,n,i){var e,s,c,r,u,o,l,i,i,h,a,i,f,e,d,A;function v(t){this.className=t}function g(t){void 0===t&&(t=0);var n=A.call(this)||this;return n.typeName="106",n.IOProps=["typeName","leftTextStyle","topTextStyle","rightTextStyle","bottomTextStyle","insideTextStyle","showDefaultTips","allowMoveOrResizeTask","allowLinkTask","allowChangeProgress","allowDragNewTask"],n.leftTextStyle={},n.topTextStyle={},n.rightTextStyle={},n.bottomTextStyle={},n.insideTextStyle={},n.showDefaultTips=!0,n.allowMoveOrResizeTask=!0,n.allowLinkTask=!0,n.allowChangeProgress=!0,n.allowDragNewTask=!0,n.dAi=t,n}e=this&&this.__extends||(d=function(t,n){return(d=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}d(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(n,"__esModule",{value:!0}),n.TaskbarCellType=n.TipSettings=void 0,s=i("Common"),c=i("Core"),r=i("./dist/plugins/gantt/utils/util.js"),u=i("./dist/plugins/gantt/gantt-json.js"),o=i("./dist/plugins/gantt/taskbar/action.js"),l=i("./dist/plugins/gantt/gantt.enum.js"),i=i("./dist/plugins/gantt/gantt.ns.js"),i=new s.Common.ResourceManager(i.SR,"GanttSheet"),h=i.getResource.bind(i),a=c.mt.vi,i=c.CellTypes.Base,v.prototype.getContent=function(){return'\n <div class="'.concat(this.className,'" style="padding:4px;font-size:14px;color:black;max-width:500px">\n <div style="overflow:hidden;text-overflow:ellipsis;">\n <div class="gantt-tip-title" style="text-align:center">').concat(r.GanttUtil.encodeHtml(this.title),"</div>\n ").concat(this.getBodyString(),"\n </div>\n </div>")},v.prototype.getBodyString=function(){var t,n,t="";for(n in this.body)this.body.hasOwnProperty(n)&&(t+='<div>\n <span class="gantt-tip-key">'.concat(r.GanttUtil.encodeHtml(this.body[n][0]),'</span>\n <span class="gantt-tip-value">').concat(r.GanttUtil.encodeHtml(this.body[n][1]),"</span>\n </div>"));return t},v.prototype.addTaskTipItems=function(n,t){var i=this;this.body||(this.body=[]),t.forEach(function(t){i.addTaskItemDictionary[t]&&i.addTaskItemDictionary[t](n)})},Object.defineProperty(v.prototype,"addTaskItemDictionary",{get:function(){var n=this;return{name:function(t){n.addNameItem(t)},start:function(t){n.addStartItem(t)},finish:function(t){n.addFinishItem(t)},duration:function(t){n.addDurationItem(t)},"%complete":function(t){n.addCompleteTextItem(t)},completeThrough:function(t){n.addCompleteThroughItem(t)}}},enumerable:!1,configurable:!0}),v.prototype.addNameItem=function(t){t.name?this.body.push([h().GANTT_ACTION_TASK_COLON,t.name]):this.body.push([h().GANTT_ACTION_TASK_COLON,h().GANTT_TASK_BAR_UNNAMED])},v.prototype.addStartItem=function(t){var n=new s.Formatter.GeneralFormatter(t.project.layout.tipDateFormat);this.body.push([h().GANTT_ACTION_TASK_START,n.format(t.startDisplayed)])},v.prototype.addFinishItem=function(t){var n=new s.Formatter.GeneralFormatter(t.project.layout.tipDateFormat);this.body.push([h().GANTT_ACTION_TASK_FINISH,n.format(t.finishDisplayed)])},v.prototype.addDurationItem=function(t){t.duration&&this.body.push([h().GANTT_ACTION_DURATION,t.project.formatDuration(t.duration)])},v.prototype.addCompleteThroughItem=function(t){var n=new s.Formatter.GeneralFormatter(t.project.layout.tipDateFormat);t.completeThrough&&this.body.push([h().GANTT_TASK_BAR_COMPLETE_THROUGH,n.format(t.completeThrough)])},v.prototype.addCompleteTextItem=function(t){var n=new s.Formatter.GeneralFormatter("0%");this.body.push([h().GANTT_TASK_BAR_COMPLETE,n.format(t.complete)])},v.getDefaultTaskHoverTipItems=function(t){switch(t){case"progress":case"manualProgress":return["name","start","completeThrough","duration","%complete"];case"milestone":case"manualMilestone":case"finishOnlyMilestone":case"durationOnlyMilestone":case"finishOnly":return["name","finish"];case"startOnly":case"startOnlyMilestone":return["name","start"];default:return["name","start","finish","duration"]}},f=v,n.TipSettings=f,e(g,A=i),g.prototype.oAi=function(t){if(t&&t.sheet&&t.sheet.NMi)return t.sheet.NMi.project},g.prototype.cAi=function(t){return t.row-this.dAi},g.prototype.An=function(t,n,i){return t.clone()},g.prototype.paintValue=function(t,n,i,e,s,r,u,o){var h,a,c,f,h,h=o.sheet,a=this.oAi(o);t&&a&&0<s&&0<r&&(t.save(),t.rect(i,e,s,r),t.clip(),c=this.cAi(o),f=a.getTaskByRow(c),h=h.NMi.lki,o.offsetX=0,h.paintTask(t,f,i,e,s,r,u,o,this,this.paintTextCore),h.paintLinkLines(t,a,f,c,i,e,s,r),this.barAction&&this.barAction.actionStatus===l.ActionStatus.InProgress&&h.paintActionPending(t,this.barAction),t.restore())},g.prototype.paintTextCore=function(t,n,i,e,s,r,u,o){A.prototype.paintValue.call(this,t,n,i,e,s,r,u,o)},g.prototype.getHitInfo=function(t,n,i,e,s){var r,u,o,h,a,e;return s&&s.sheetArea===c.SheetArea.viewport&&e?(r=s.sheetArea,u=e.x,o=e.x+e.width,h=e.y,a=e.y+e.height,e={x:t,y:n,row:s.row,col:s.col,cellRect:e,sheetArea:r,sheet:s.sheet,cellStyle:i},u<=t&&t<=o&&h<=n&&n<=a&&(e.isReservedLocation=!0),e):null},g.prototype.processMouseDown=function(t){var n,i,e,n=t&&t.sheet;if(!n||!t.isReservedLocation)return!1;(i=this.oAi(t))&&((e=o.BarActionBuilder.getBarHitInfo(i,this,t)).task&&(n.clearSelection(),n.setActiveCell(t.row,t.col),n.addSelection(t.row,0,1,n.getColumnCount()-1)),this.barAction=o.BarActionBuilder.getHitAction(i,this,e),this.barAction)&&this.barAction.start()},g.prototype.processMouseMove=function(t){var n,i,e,s,r,i,e,i,n=t&&t.sheet;if(!n||!t.isReservedLocation)return!1;(i=this.oAi(t))&&!this.barAction&&(s=void 0,(e=o.BarActionBuilder.getBarHitInfo(i,this,t))&&e.task?(o.BarActionBuilder.updateCursorByBarHitInfo(n.Dg(),i,this,e),s=this.bAi(e.task,e.style),r={task:e.task,partName:e.style.name,tip:s},n.ki(l.GanttSheetEvent.Event_HoverOnBar,r),s=r.tip):(o.BarActionBuilder.updateCursorStyle(n.Dg(),l.CursorStyle.Default),(i=this.mAi(t))&&(s=this.pAi(i),n.ki(l.GanttSheetEvent.Event_HoverOnLink,r={dependency:i,tip:s}),s=r.tip)),s&&this.showDefaultTips)&&(e=s.getContent(),(i=n.parent).Tw(e,0,0),i.R3.style.whiteSpace="normal",i.ny(e,t.x-25-i.R3.offsetWidth,t.y-25))},g.prototype.bAi=function(t,n){var i,e;if(t&&n)return(e=new f((i="gc-gantt-hover-on-")+n.name)).title=n.name,e.addTaskTipItems(t,f.getDefaultTaskHoverTipItems(n.name)),e},g.prototype.pAi=function(t){var n,i;if(t)return(i=new f((n="gc-gantt-hover-on-")+"link")).title="",i.body=[[h().GANTT_TASK_BAR_TASK_LINK,this.getDependencyTypeText(t.type)],[h().GANTT_TASK_BAR_FROM,"(ID ".concat(t.from.taskNumber,") ").concat(t.from.name)],[h().GANTT_TASK_BAR_TO,"(ID ".concat(t.to.taskNumber,") ").concat(t.to.name)]],i},g.prototype.getDependencyTypeText=function(t){switch(t){case"FS":return h().GANTT_TASK_BAR_FS;case"FF":return h().GANTT_TASK_BAR_FF;case"SF":return h().GANTT_TASK_BAR_SF;case"SS":return h().GANTT_TASK_BAR_SS}},g.prototype.mAi=function(t){for(var n,i,e,s,r,u,o,h,n,i=(t&&t.sheet).NMi.lki,e=this.cAi(t),s,u=0,o=i.getLinkLines(e,t.cellRect);u<o.length;u++)(h=o[u]).contains({x:t.x,y:t.y})&&(r=h.data);return r},g.prototype.isReservedKey=function(t,n){return 32===t.keyCode&&!t.ctrlKey&&!t.shiftKey&&!t.altKey},g.prototype.getAutoFitWidth=function(t,n,i,e,s){var s,r,u,e,o,h,a,c,f,l,d,h,A,v,g,s=s.sheet,r=s.NMi,u;if(r.gp())return r.wAi()*e;if(e=s.ot().width,o=0,h=s.OF())for(a=0,c=h;a<c.length;a++)o+=l=(f=c[a]).width;if(d=0,h=s.m9())for(A=r.getGanttColumnIndex(),v=0,g=h;v<g.length;v++)(f=g[v]).col!==A&&(d+=l=f.width);return e-o-d},g.prototype.getAutoFitHeight=function(t,n,i,e,s){var r=s.sheet.NMi.lki;return r?r.getBarStyleRowHeight()*e:A.prototype.getAutoFitHeight.call(this,t,n,i,e,s)},g.prototype.QD=function(t){this.isReservedKey(t)&&a(t)},g.prototype.isImeAware=function(t){return!1},g.prototype.jn=function(t){},g.prototype.Ke=function(){},g.prototype.toJSON=function(){return u.GanttSheetJsonConverter.toJSON(this,this.IOProps)},g.prototype.fromJSON=function(t){u.GanttSheetJsonConverter.fromJSON(this,t,this.IOProps)},g.prototype.activeOnClick=function(){return!1},n.TaskbarCellType=e=g,c.CellTypes.ti[106]=e},"./dist/plugins/gantt/celltypes/timescales.js":function(t,n,i){var e,p,d,s,y,A,i,w,r,u,j,o,c,T,v,h,i,a,f;function l(t,n){return v*t*n+5}function g(t,n){this.lAi=t,this.startX=n,this.yAi=!1}function b(){var t=f.call(this)||this;return t.typeName="107",t.marginTop=2,t.marginBottom=2,t.backColor="#f0f0f0",t.topTierTextStyle={},t.middleTierTextStyle={},t.bottomTierTextStyle={},t.allowDragScroll=!0,t.IOProps=["typeName","allowDragScroll","topTierTextStyle","middleTierTextStyle","bottomTierTextStyle"],t}e=this&&this.__extends||(a=function(t,n){return(a=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}a(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(n,"__esModule",{value:!0}),n.TimescaleCellType=n.getTimescaleHeight=void 0,p=i("Core"),d=i("./dist/plugins/gantt/gantt-column.js"),s=i("./dist/plugins/gantt/gantt-json.js"),y=i("./dist/plugins/gantt/project/calendar.js"),A=i("./dist/plugins/gantt/gantt.enum.js"),i=i("Common"),w=i.Common.lt.ht,r=p.mt.vi,u=p.CellTypes.Context,j=p.CellTypes.Base,o=p.GC$,c=null,T=void 0,v=18,n.getTimescaleHeight=l,Object.defineProperty(g.prototype,"sheet",{get:function(){return this.lAi.Mf},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"project",{get:function(){return this.lAi.project},enumerable:!1,configurable:!0}),g.prototype.start=function(){this.jAi=this.project.timescale.currentDateUtc,this.yAi=!1,this.sheet.Dg().style.cursor="grabbing",this.Fg()},g.prototype.Fg=function(){var n=this;o(document).bind("mousemove.ganttSheet.timescale",function(t){n.pg(t)}).bind("mouseup.ganttSheet.timescale",function(t){n.bg(t)})},g.prototype.OAi=function(){o(document).unbind("mousemove.ganttSheet.timescale").unbind("mouseup.ganttSheet.timescale")},g.prototype.pg=function(t){var n,i,t,n,i;this.sheet&&(n=this.sheet.uw(),i=t.pageX-n.left,t=t.pageY-n.top,n=this.sheet.hitTest(i,t),i=this.startX-n.x-this.getScrollDistance(),this.project.timescale.scroll(i))},g.prototype.getScrollDistance=function(){return-this.project.timescale.getOffsetByDateUtc(this.jAi)},g.prototype.bg=function(t){this.OAi(),this.yAi=!0,delete this.jAi},g.prototype.isFinish=function(){return this.yAi},h=g,e(b,f=j),b.prototype.oAi=function(t){if(t&&t.sheet&&t.sheet.NMi)return t.sheet.NMi.project},b.prototype.paintValue=function(t,n,i,e,s,r,u,o){var h,h;t&&0<s&&0<r&&(t.save(),t.rect(i,e,s,r),t.clip(),t.beginPath(),h=void 0,h=this.backColor,t.fillStyle!==h&&(t.fillStyle=h),p.W.setFillStyle(t,h,i,e,s,r,function(){t.fillRect(i,e,s,r)}),this.paintTimescales(t,i,e,s,r,o),t.restore())},b.prototype.paintTimescales=function(t,n,i,e,s,r){var u,o,h,a,c,f,l,u=r.sheet.zoom(),o=v*u+this.marginTop,h=this.oAi(r);if(h)switch(a=h.timescale,c=new p.Style,f=new p.Style,l=new p.Style,this.topTierTextStyle&&(0,d.mergeTextStyle)(this.topTierTextStyle,c),this.middleTierTextStyle&&(0,d.mergeTextStyle)(this.middleTierTextStyle,f),this.bottomTierTextStyle&&(0,d.mergeTextStyle)(this.bottomTierTextStyle,l),r.offsetX=0,a.tierMode){case A.TimescaleTierMode.middle:0<=s-o&&(this.paintSeparatorLine(t,n,i+s-.5,e,a),this.paintTier(t,n,i+s-o,e,o,f,h,a.middleTier,r));break;case A.TimescaleTierMode.middleBottom:0<=s-2*o&&(this.paintSeparatorLine(t,n,i+s-.5,e,a),this.paintTier(t,n,i+s-o,e,o,l,h,a.bottomTier,r),this.paintTier(t,n,i+s-2*o,e,o,f,h,a.middleTier,r));break;case A.TimescaleTierMode.topMiddleBottom:0<=s-3*o&&(this.paintSeparatorLine(t,n,i+s-.5,e,a),this.paintTier(t,n,i+s-o,e,o,l,h,a.bottomTier,r),this.paintTier(t,n,i+s-2*o,e,o,f,h,a.middleTier,r),this.paintSeparatorLine(t,n,i+s-2*o-.5,e,a),this.paintTier(t,n,i+s-3*o,e,o,c,h,a.topTier,r))}},b.prototype.paintTier=function(t,n,i,e,s,r,u,o,h){var a,c,f,l,d,A,v,A,g,b,v,m,a=this;if(!w(o))for(f=c=u.timescale.currentDateUtc,d=o.labelAlign||"Left",(l=r).hAlign="Left"===d?p.HorizontalAlign.left:"Center"===d?p.HorizontalAlign.center:p.HorizontalAlign.right;;){if(v=(A=u.timescale.getDateUtcRange(f,o.unit,o.count))[0],A=A[1],n+e<=(g=n+u.timescale.getOffsetByDateUtc(v)))break;b=n+u.timescale.getOffsetByDateUtc(A)+.5,b=Math.floor(b)+.5,v=o.formatDate(y.Calendar.utcToLocal(v)),j.prototype.paintText.call(a,t,v,g,i,b-g,s,l,h,v,m={},T,T),o.showTickLines&&(t.beginPath(),t.moveTo(b,i),t.lineTo(b,i+s),t.strokeStyle="gray",t.stroke()),f=A}},b.prototype.paintSeparatorLine=function(t,n,i,e,s){s.showScaleSeparator&&(t.beginPath(),t.moveTo(n,i),t.lineTo(n+e,i),t.strokeStyle="gray",t.stroke())},b.prototype.getText=function(t,n){return t},b.prototype.getHitInfo=function(t,n,i,e,s){var r,u,o,h,a,r,e,r=this;return s?(u=s.sheetArea,o=e.x,h=e.x+e.width,a=e.y+r.marginTop,r=e.y+e.height-r.marginBottom,e={x:t,y:n,row:s.row,col:s.col,cellRect:e,sheetArea:u,sheet:s.sheet,cellStyle:i},o<=t&&t<=h&&a<=n&&n<=r&&(e.isReservedLocation=!0),e):c},b.prototype.processMouseDown=function(t){var n,i,n;return!!this.oAi(t)&&!!((i=t&&t.sheet)&&t.isReservedLocation&&this.allowDragScroll)&&(this.TAi=new h(t.sheet.NMi,t.x),this.TAi.start(),!0)},b.prototype.processMouseMove=function(t){this.allowDragScroll&&(this.TAi&&!this.TAi.isFinish()||(t.sheet.Dg().style.cursor="grab"),this.TAi)&&!this.TAi.isFinish()&&(t.sheet.Dg().style.cursor="grabbing")},b.prototype.processKeyDown=function(t,n){return!1},b.prototype.processKeyUp=function(t,n){return!1},b.prototype.isReservedKey=function(t,n){return 32===t.keyCode&&!t.ctrlKey&&!t.shiftKey&&!t.altKey},b.prototype.getAutoFitWidth=function(t,n,i,e,s){return u.Bt(t,n,i,e,s)},b.prototype.getAutoFitHeight=function(t,n,i,e,s){var r=this.oAi(s);return l(r?r.timescale.tierMode:A.TimescaleTierMode.middle,s.sheet.zoom())},b.prototype.QD=function(t){this.isReservedKey(t)&&r(t)},b.prototype.isImeAware=function(t){return!1},b.prototype.jn=function(t){},b.prototype.Ke=function(){},b.prototype.activeOnClick=function(){return!1},b.prototype.toJSON=function(){return s.GanttSheetJsonConverter.toJSON(this,this.IOProps)},b.prototype.fromJSON=function(t){s.GanttSheetJsonConverter.fromJSON(this,t,this.IOProps)},n.TimescaleCellType=i=b,p.CellTypes.ti[107]=i},"./dist/plugins/gantt/gantt-action.js":function(t,n,i){var a,n,e,o,s,d,i,i,h,r;function u(t){return t instanceof o.GanttSheet}function c(e){var t;e.commandManager().addListener("ganttSheetCleanUndo",function(t){var n=t.command,t=t.vM,i=e.Wp.Nmt;0===t&&i&&0<i.length&&u(e.Ofe(n.sheetName))&&i.pop()})}function f(t,n){for(var i,e,i=new Array(t),e=0;e<t;e++)i[e]=n();return i}a=this&&this.__spreadArray||function(t,n,i){if(i||2===arguments.length)for(var e=0,s=n.length,r;e<s;e++)!r&&e in n||((r=r||Array.prototype.slice.call(n,0,e))[e]=n[e]);return t.concat(r||Array.prototype.slice.call(n))},Object.defineProperty(n,"__esModule",{value:!0}),n=i("Common"),e=i("Core"),o=i("./dist/plugins/gantt/gantt-sheet.js"),s=i("./dist/plugins/gantt/gantt.enum.js"),d=i("./dist/plugins/gantt/utils/util.js"),i=i("./dist/plugins/gantt/gantt.ns.js"),i=new n.Common.ResourceManager(i.SR,"GanttSheet"),h=i.getResource.bind(i),r=n.Common.lt.ht,e.Commands[s.GanttCommandNames.GANTTSHEET_TIMESCALE_PAGE_UP]={canUndo:!1,execute:function(t,n){var t,i,i,t,t=d.GanttUtil.getGanttSheet(t);if(t)return(i=t.project)&&(i=i.timescale,t=t.getTaskbarAreaVisibleSize(),i.scroll(-1*t)),!1}},e.Commands[s.GanttCommandNames.GANTTSHEET_TIMESCALE_PAGE_DOWN]={canUndo:!1,execute:function(t,n){var t,i,i,t,t=d.GanttUtil.getGanttSheet(t);if(t)return(i=t.project)&&(i=i.timescale,t=t.getTaskbarAreaVisibleSize(),i.scroll(t)),!1}},e.Commands[s.GanttCommandNames.GANTTSHEET_TIMESCALE_BEGIN]={canUndo:!1,execute:function(t,n){var t,t,t=d.GanttUtil.getGanttSheet(t);if(t)return(t=t.project).timescale.scrollTo(t.startDate,.25),!1}},e.Commands[s.GanttCommandNames.GANTTSHEET_TIMESCALE_END]={canUndo:!1,execute:function(t,n){var t,t,t=d.GanttUtil.getGanttSheet(t);if(t)return(t=t.project).timescale.scrollTo(t.finishDate,.75),!1}},e.Commands[s.GanttCommandNames.GANTTSHEET_TIMESCALE_LEFT]={canUndo:!1,execute:function(t,n){var t,t,i,t=d.GanttUtil.getGanttSheet(t);if(t)return(t=t.project)&&(i=t.timescale).scrollOneTick(!1),!1}},e.Commands[s.GanttCommandNames.GANTTSHEET_TIMESCALE_RIGHT]={canUndo:!1,execute:function(t,n){var t,t,i,t=d.GanttUtil.getGanttSheet(t);if(t)return(t=t.project)&&(i=t.timescale).scrollOneTick(!0),!1}},e.Commands[s.GanttCommandNames.GANTTSHEET_TIMESCALE_ZOOM_IN]={canUndo:!1,execute:function(t,n){var t,i,e,t=d.GanttUtil.getGanttSheet(t);if(t)return e=(i=t.project).timescale,t.uiOptions.allowZoomTimescale&&e.zoomIn(),!1}},e.Commands[s.GanttCommandNames.GANTTSHEET_TIMESCALE_ZOOM_OUT]={canUndo:!1,execute:function(t,n){var t,i,e,t=d.GanttUtil.getGanttSheet(t);if(t)return e=(i=t.project).timescale,t.uiOptions.allowZoomTimescale&&e.zoomOut(),!1}},e.Commands[s.GanttCommandNames.GANTTSHEET_TIMESCALE_ZOOM_CUSTOMER]={canUndo:!0,execute:function(t,n){var t,t,i,n,t=d.GanttUtil.getGanttSheet(t);if(t)return t=t.project,i=n.start,n=n.finish,t.timescale.zoomToRange(i,n),!0}},e.Commands[s.GanttCommandNames.GANTTSHEET_CHANGE_COMPLETE]={canUndo:!0,execute:function(t,n){var i,t,e,s,r,u,i=d.GanttUtil.getGanttSheet(t);if(i){for(t=d.GanttUtil.getSelectedTasks(i),e=n.complete,s=0,r=t;s<r.length;s++)(u=r[s]).complete!==e&&i.project.taskManager.setTaskValue(u,"complete",e);return!0}}},e.Commands[s.GanttCommandNames.GANTTSHEET_INDENT_TASKS]={canUndo:!0,execute:function(t,n){var t,i,t=d.GanttUtil.getGanttSheet(t);if(t)return i=d.GanttUtil.getSelectedTasks(t),t.project.indentTasks(i.map(function(t){return t.taskNumber})),!0}},e.Commands[s.GanttCommandNames.GANTTSHEET_OUTDENT_TASKS]={canUndo:!0,execute:function(t,n){var t,i,t=d.GanttUtil.getGanttSheet(t);if(t)return i=d.GanttUtil.getSelectedTasks(t),t.project.outdentTasks(i.map(function(t){return t.taskNumber})),!0}},e.Commands[s.GanttCommandNames.GANTTSHEET_LINK_TASKS]={canUndo:!0,execute:function(t,n){var t,i,e,s,r,u,o,h,a,c,f,l,f,t=d.GanttUtil.getGanttSheet(t);if(t){for(i=t.project,e=[],s=t.getSelections(),r=-1,u=0;u<s.length;u++){for(o=s[u],-1!==r&&e.push([r,o.row]),h=o.row+1;h<o.row+o.rowCount;h++)e.push([h-1,h]);r=o.row+o.rowCount-1}if(e.length<=0)return!1;for(i.suspendSchedule(),a=0,c=e;a<c.length;a++){l=(f=c[a])[0],f=f[1];try{i.addDependency({fromTaskNumber:l,toTaskNumber:f})}catch(t){}}return i.resumeSchedule(),!0}}},e.Commands[s.GanttCommandNames.GANTTSHEET_UNLINK_TASKS]={canUndo:!0,execute:function(t,n){var t,i,t,e,s,r,u,o,h,t=d.GanttUtil.getGanttSheet(t);if(t){if(i=d.GanttUtil.getSelectedTaskNumbers(t),t=t.project,e=[],1===i.length)s=t.getTaskByRow(i[0]),e=a(a([],s.predecessorDependencies,!0),s.successorDependencies,!0);else{for(r={},u=0,o=i;u<o.length;u++)h=o[u],r[h]=!0;e=t.dependencies.filter(function(t){return r[t.from.taskNumber]&&r[t.to.taskNumber]})}return 1<=e.length&&t.removeDependency(e),!0}}},e.Commands[s.GanttCommandNames.GANTTSHEET_CHANGE_TASK_MODE]={canUndo:!0,execute:function(t,n){var i,n,e,s,r,u,i=n.taskMode,n=t.getActiveSheetTab();if(n&&n instanceof o.GanttSheet){for(s=0,r=e=d.GanttUtil.getSelectedTasks(n);s<r.length;s++)(u=r[s]).setValue("mode",i);return!0}}},e.Commands[s.GanttCommandNames.GANTTSHEET_MOVE_TASK]={canUndo:!0,execute:function(t,n){var t,i,e,s,n,t=d.GanttUtil.getGanttSheet(t);if(t)return i=n.duration,e=n.forward,s=t.project,n=d.GanttUtil.getSelectedTaskNumbers(t),s.suspendSchedule(),n.forEach(function(t){var n,n,t,n,t=s.getTask(t),n=e?null!=(n=i.value)?n:0:-1*(null!=(n=i.value)?n:0);"Week"===i.unit?t.moveInWeeks(n):t.moveInWorkingDays(n)}),s.resumeSchedule(),!0}},e.Commands[s.GanttCommandNames.GANTTSHEET_INSERT_TASK]={canUndo:!0,execute:function(t,n){var t,i,e,s,r,t=d.GanttUtil.getGanttSheet(t);if(t)return i=t.project,e=t.getSelections().map(function(t){return t.rowCount}).reduce(function(t,n){return t+n}),s=Math.min.apply(Math,a(a([],t.getSelections().map(function(t){return t.row}),!1),[i.count],!1)),r=f(e,function(){return{name:h().GANTT_NEW_TASK}}),i.insertTasksByRow(s,r),t.setSelection(s,-1,e,-1),!0}},e.Commands[s.GanttCommandNames.GANTTSHEET_INSERT_SUMMARY_TASK]={canUndo:!0,execute:function(t,n){var i,t,e,s,r,u,o,i=d.GanttUtil.getGanttSheet(t);if(i)return t=i.project,s=(e=i.getSelections()[0]).row,r=i.getTaskNumberByRow(s)||t.count,0===(u=d.GanttUtil.getSelectedRowIndexes(i).map(function(t){return i.getTaskByRow(t)}).filter(function(t){return!!t})).length?(o=t.insertTasks(r,{name:h().GANTT_NEW_SUMMARY_TASK})[0],t.insertTasks(r+1,{name:h().GANTT_NEW_TASK},o.level+1)):(t.insertTasks(r,{name:h().GANTT_NEW_SUMMARY_TASK},u[0].level),t.sorted?t.indentTasks([u[0].taskNumber]):t.indentTasksByRange(e.row+1,e.rowCount)),i.setSelection(s,-1,1,-1),!0}},e.Commands[s.GanttCommandNames.GANTTSHEET_INSERT_MILESTONE]={canUndo:!0,execute:function(t,n){var t,i,e,s,r,t=d.GanttUtil.getGanttSheet(t);if(t)return i=t.project,e=t.getSelections().map(function(t){return t.rowCount}).reduce(function(t,n){return t+n}),s=Math.min.apply(Math,a(a([],t.getSelections().map(function(t){return t.row}),!1),[i.count],!1)),r=f(e,function(){return{name:h().GANTT_NEW_MILESTONE,duration:0}}),i.insertTasksByRow(s,r),t.setSelection(s,-1,e,-1),!0}},e.Commands[s.GanttCommandNames.GANTTSHEET_DELETE_TASK]={canUndo:!0,execute:function(t,n){var t,i,t,t=d.GanttUtil.getGanttSheet(t);if(t)return i=t.project,t=d.GanttUtil.getSelectedTaskNumbers(t),i.removeTasks(t),!0}},e.Commands[s.GanttCommandNames.GANTTSHEET_SCROLL_TO_TASK]={canUndo:!0,execute:function(t,n){var t,i,t=d.GanttUtil.getGanttSheet(t);if(t)return i=t.getActiveTask(),r(i.start)&&r(i.duration)?t.project.timescale.scrollTo(i.finishDisplayed,.25):t.project.timescale.scrollTo(i.startDisplayed,.25),!0}},e.Commands.kAi=function(t){var