0 && currentScrollTop + scrollOuterHeight >= scrollInnerHeight + 2) {\n\t\t\tscrollTop = 0;\n\t\t}\n\n\t\tif (scrollLeft && !scrollOuterWidth) {\n\t\t\tscrollLeft = 0;\n\t\t} else if (scrollLeft < 0 && !currentScrollLeft) {\n\t\t\tscrollLeft = 0;\n\t\t} else if (scrollLeft > 0 && currentScrollLeft + scrollOuterWidth >= scrollInnerWidth) {\n\t\t\tscrollLeft = 0;\n\t\t}\n\n\t\tvar step = gantt.config.autoscroll_step;\n\n\t\tif (step && step < 2) // limit step value to 2\n\t\t\tstep = 2;\n\n\t\tscrollLeft = scrollLeft * (step || scrollStep);\n\t\tscrollTop = scrollTop * (step || scrollStep);\n\n\t\tif (scrollLeft || scrollTop) {\n\t\t\tscroll(scrollLeft, scrollTop);\n\t\t} \n\n\t}\n\n\tfunction need_scroll(pos, boxSize, startCoord) {\n\t\tif ((pos - scrollRange < 0) && (pos < startCoord))\n\t\t\treturn -1;\n\t\telse if ((pos > boxSize - scrollRange) && (pos > startCoord))\n\t\t\treturn 1;\n\t\treturn 0;\n\t}\n\n\tfunction scroll(left, top) {\n\t\tvar scrollState = gantt.getScrollState();\n\n\t\tvar scrollLeft = null,\n\t\t\tscrollTop = null;\n\n\t\tif (left) {\n\t\t\tscrollLeft = scrollState.x + left;\n\t\t\tscrollLeft = Math.min(scrollState.width, scrollLeft);\n\t\t\tscrollLeft = Math.max(0, scrollLeft);\n\t\t}\n\n\t\tif (top) {\n\t\t\tscrollTop = scrollState.y + top;\n\t\t\tscrollTop = Math.min(scrollState.height, scrollTop);\n\t\t\tscrollTop = Math.max(0, scrollTop);\n\t\t}\n\n\t\tgantt.scrollTo(scrollLeft, scrollTop);\n\t}\n\n\tgantt.attachEvent(\"onGanttReady\", function() {\n\t\tgantt.eventRemove(document.body, \"mousemove\", autoscrollInterval);\n\t\tgantt.event(document.body, \"mousemove\", autoscrollInterval);\n\t});\n\n};\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports) {\n\nfunction createMethod(gantt){\n\tvar methods = {};\n\tvar isActive = false;\n\tfunction disableMethod(methodName, dummyMethod){\n\t\tdummyMethod = typeof dummyMethod == \"function\" ? dummyMethod : function(){};\n\n\t\tif(!methods[methodName]){\n\t\t\tmethods[methodName] = this[methodName];\n\t\t\tthis[methodName] = dummyMethod;\n\t\t}\n\t}\n\tfunction restoreMethod(methodName){\n\t\tif(methods[methodName]){\n\t\t\tthis[methodName] = methods[methodName];\n\t\t\tmethods[methodName] = null;\n\t\t}\n\t}\n\tfunction disableMethods(methodsHash){\n\t\tfor(var i in methodsHash){\n\t\t\tdisableMethod.call(this, i, methodsHash[i]);\n\t\t}\n\t}\n\t function restoreMethods(){\n\t\tfor(var i in methods){\n\t\t\trestoreMethod.call(this, i);\n\t\t}\n\t}\n\n\tfunction batchUpdatePayload(callback){\n\t\ttry{\n\t\t\tcallback();\n\t\t}catch(e){\n\t\t\twindow.console.error(e);\n\t\t}\n\t}\n\n\tvar state = gantt.$services.getService(\"state\");\n\tstate.registerProvider(\"batchUpdate\", function(){\n\t\treturn {\n\t\t\tbatch_update: isActive\n\t\t};\n\t}, true);\n\n\treturn function batchUpdate(callback, noRedraw) {\n\t\tif(isActive){\n\t\t\t// batch mode is already active\n\t\t\tbatchUpdatePayload(callback);\n\t\t\treturn;\n\t\t}\n\n\t\tvar call_dp = (this._dp && this._dp.updateMode != \"off\");\n\t\tvar dp_mode;\n\t\tif (call_dp){\n\t\t\tdp_mode = this._dp.updateMode;\n\t\t\tthis._dp.setUpdateMode(\"off\");\n\t\t}\n\n\t\t// temporary disable some methods while updating multiple tasks\n\t\tvar resetProjects = {};\n\t\tvar methods = {\n\t\t\t\"render\":true,\n\t\t\t\"refreshData\":true,\n\t\t\t\"refreshTask\":true,\n\t\t\t\"refreshLink\":true,\n\t\t\t\"resetProjectDates\":function(task){\n\t\t\t\tresetProjects[task.id] = task;\n\t\t\t}\n\t\t};\n\n\t\tdisableMethods.call(this, methods);\n\n\t\tisActive = true;\n\t\tthis.callEvent(\"onBeforeBatchUpdate\", []);\n\n\t\tbatchUpdatePayload(callback);\n\n\t\tthis.callEvent(\"onAfterBatchUpdate\", []);\n\n\t\trestoreMethods.call(this);\n\n\t\t// do required updates after changes applied\n\t\tfor(var i in resetProjects){\n\t\t\tthis.resetProjectDates(resetProjects[i]);\n\t\t}\n\n\t\tisActive = false;\n\n\t\tif(!noRedraw){\n\t\t\tthis.render();\n\t\t}\n\n\t\tif (call_dp) {\n\t\t\tthis._dp.setUpdateMode(dp_mode);\n\t\t\tthis._dp.setGanttMode(\"tasks\");\n\t\t\tthis._dp.sendData();\n\t\t\tthis._dp.setGanttMode(\"links\");\n\t\t\tthis._dp.sendData();\n\t\t}\n\t};\n\n\n\n}\n\nmodule.exports = function(gantt){\n\tgantt.batchUpdate = createMethod(gantt);\n};\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports) {\n\nvar createWbs = (function(gantt){\n\treturn {\n\t_needRecalc: true,\n\treset: function(){\n\t\tthis._needRecalc = true;\n\t},\n\t_isRecalcNeeded: function(){\n\t\treturn (!this._isGroupSort() && this._needRecalc);\n\t},\n\t_isGroupSort: function() {\n\t\treturn !!(gantt._groups && gantt._groups.is_active());\n\t},\n\t_getWBSCode: function(task) {\n\t\tif(!task) return \"\";\n\n\t\tif(this._isRecalcNeeded()){\n\t\t\tthis._calcWBS();\n\t\t}\n\n\t\tif(task.$virtual) return \"\";\n\t\tif(this._isGroupSort()) return task.$wbs || \"\";\n\n\t\tif(!task.$wbs) {\n\t\t\tthis.reset();\n\t\t\tthis._calcWBS();\n\t\t}\n\t\treturn task.$wbs;\n\t},\n\t_setWBSCode: function(task, value) {\n\t\ttask.$wbs = value;\n\t},\n\tgetWBSCode: function(task) {\n\t\treturn this._getWBSCode(task);\n\t},\n\t_calcWBS: function() {\n\t\tif(!this._isRecalcNeeded()) return;\n\n\t\tvar _isFirst = true;\n\t\tgantt.eachTask(function(ch) {\n\t\t\tif(_isFirst) {\n\t\t\t\t_isFirst = false;\n\t\t\t\tthis._setWBSCode(ch, \"1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar _prevSibling = gantt.getPrevSibling(ch.id);\n\t\t\tif (_prevSibling !== null) {\n\t\t\t\tvar _wbs = gantt.getTask(_prevSibling).$wbs;\n\t\t\t\tif(_wbs) {\n\t\t\t\t\t_wbs = _wbs.split(\".\");\n\t\t\t\t\t_wbs[_wbs.length-1]++;\n\t\t\t\t\tthis._setWBSCode(ch, _wbs.join(\".\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar _parent = gantt.getParent(ch.id);\n\t\t\t\tthis._setWBSCode(ch, gantt.getTask(_parent).$wbs + \".1\");\n\t\t\t}\n\t\t}, gantt.config.root_id, this);\n\n\t\tthis._needRecalc = false;\n\t}\n};\n});\n\nmodule.exports = function(gantt){\n\tvar wbs = createWbs(gantt);\n\tgantt.getWBSCode = function getWBSCode(task) {\n\t\treturn wbs.getWBSCode(task);\n\t};\n\n\tgantt.attachEvent(\"onAfterTaskMove\", function() {\n\t\twbs.reset();\n\t\treturn true;\n\t});\n\n\tgantt.attachEvent(\"onBeforeParse\", function() {\n\t\twbs.reset();\n\t\treturn true;\n\t});\n\n\tgantt.attachEvent(\"onAfterTaskDelete\", function() {\n\t\twbs.reset();\n\t\treturn true;\n\t});\n\n\tgantt.attachEvent(\"onAfterTaskAdd\", function() {\n\t\twbs.reset();\n\t\treturn true;\n\t});\n};\n\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports) {\n\nif (window.jQuery){\n\n\t(function( $ ){\n\n\t\tvar methods = [];\n\t\t$.fn.dhx_gantt = function(config){\n\t\t\tconfig = config || {};\n\t\t\tif (typeof(config) === 'string') {\n\t\t\t\tif (methods[config] ) {\n\t\t\t\t\treturn methods[config].apply(this, []);\n\t\t\t\t}else {\n\t\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_gantt');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar views = [];\n\t\t\t\tthis.each(function() {\n\t\t\t\t\tif (this && this.getAttribute){\n\t\t\t\t\t\tif (!this.gantt && !(window.gantt.$root == this)){\n\n\t\t\t\t\t\t\tvar newgantt = (window.gantt.$container && window.Gantt) ? window.Gantt.getGanttInstance():window.gantt;\n\t\t\t\t\t\t\tfor (var key in config)\n\t\t\t\t\t\t\t\tif (key!=\"data\")\n\t\t\t\t\t\t\t\t\tnewgantt.config[key] = config[key];\n\n\t\t\t\t\t\t\tnewgantt.init(this);\n\t\t\t\t\t\t\tif (config.data)\n\t\t\t\t\t\t\t\tnewgantt.parse(config.data);\n\n\t\t\t\t\t\t\tviews.push(newgantt);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tviews.push(typeof this.gantt == \"object\" ? this.gantt : window.gantt);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\tif (views.length === 1) return views[0];\n\t\t\t\treturn views;\n\t\t\t}\n\t\t};\n\n\t})(jQuery);\n\n}\n\n\nmodule.exports = null;\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports) {\n\nif (window.dhtmlx){\n\n\tif (!dhtmlx.attaches)\n\t\tdhtmlx.attaches = {};\n\n\tdhtmlx.attaches.attachGantt=function(start, end, gantt){\n\t\tvar obj = document.createElement(\"DIV\");\n\n\t\tgantt = gantt || window.gantt;\n\n\t\tobj.id = \"gantt_\"+ gantt.uid();\n\t\tobj.style.width = \"100%\";\n\t\tobj.style.height = \"100%\";\n\t\tobj.cmp = \"grid\";\n\n\t\tdocument.body.appendChild(obj);\n\t\tthis.attachObject(obj.id);\n\t\tthis.dataType = \"gantt\";\n\t\tthis.dataObj = gantt;\n\n\t\tvar that = this.vs[this.av];\n\t\tthat.grid = gantt;\n\n\t\tgantt.init(obj.id, start, end);\n\t\tobj.firstChild.style.border = \"none\";\n\n\t\tthat.gridId = obj.id;\n\t\tthat.gridObj = obj;\n\n\t\tvar method_name=\"_viewRestore\";\n\t\treturn this.vs[this[method_name]()].grid;\n\t};\n\n}\nif (typeof(window.dhtmlXCellObject) != \"undefined\") {\n\n\tdhtmlXCellObject.prototype.attachGantt=function(start, end, gantt){\n\t\tgantt = gantt || window.gantt;\n\n\t\tvar obj = document.createElement(\"DIV\");\n\t\tobj.id = \"gantt_\"+gantt.uid();\n\t\tobj.style.width = \"100%\";\n\t\tobj.style.height = \"100%\";\n\t\tobj.cmp = \"grid\";\n\n\t\tdocument.body.appendChild(obj);\n\t\tthis.attachObject(obj.id);\n\n\t\tthis.dataType = \"gantt\";\n\t\tthis.dataObj = gantt;\n\n\t\tgantt.init(obj.id, start, end);\n\t\tobj.firstChild.style.border = \"none\";\n\t\tvar method_name=\"_viewRestore\";\n\t\tobj = null;\n\t\tthis.callEvent(\"_onContentAttach\",[]);\n\n\t\treturn this.dataObj;\n\t};\n}\n\nmodule.exports = null;\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports) {\n\nfunction createResourceMethods(gantt){\n\n\tvar resourceTaskCache = {},\n\t\tresourceLoadCache = {};\n\n\tgantt.$data.tasksStore.attachEvent(\"onStoreUpdated\", function(){\n\t\tresourceTaskCache = {};\n\t\tresourceLoadCache = {};\n\t});\n\n\tfunction getTaskBy(propertyName, propertyValue){\n\t\tif(typeof propertyName == \"function\"){\n\t\t\treturn filterResourceTasks(propertyName);\n\t\t}else{\n\t\t\tif(propertyValue instanceof Array){\n\t\t\t\treturn getResourceTasks(propertyName, propertyValue);\n\t\t\t}else{\n\t\t\t\treturn getResourceTasks(propertyName, [propertyValue]);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction filterResourceTasks(filter){\n\t\tvar res = [];\n\t\tgantt.eachTask(function (task) {\n\t\t\tif (filter(task)) {\n\t\t\t\tres.push(task);\n\t\t\t}\n\t\t});\n\t\treturn res;\n\t}\n\n\tfunction getResourceTasks(property, resourceIds) {\n\t\tvar res;\n\n\t\tvar cacheKey = resourceIds.join(\"_\") + \"_\" + property;\n\n\t\tvar resourceHash = {};\n\t\tfor(var i = 0; i < resourceIds.length; i++){\n\t\t\tresourceHash[resourceIds[i]] = true;\n\t\t}\n\n\t\tif(!resourceTaskCache[cacheKey]){\n\t\t\tres = resourceTaskCache[cacheKey] = [];\n\t\t\tgantt.eachTask(function (task) {\n\t\t\t\tif (resourceHash[task[property]] && task.type != gantt.config.types.project) {\n\t\t\t\t\tres.push(task);\n\t\t\t\t}\n\t\t\t});\n\t\t}else{\n\t\t\tres = resourceTaskCache[cacheKey];\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tfunction getResourceLoad(resourceId, resourceProperty, scale){\n\t\tvar cacheKey = [resourceId, resourceProperty, scale.unit, scale.step].join(\"_\");\n\t\tvar res;\n\t\tif(!resourceTaskCache[cacheKey]){\n\t\t\tres = resourceTaskCache[cacheKey] = calculateResourceLoad(resourceId, resourceProperty, scale);\n\n\t\t}else{\n\t\t\tres = resourceTaskCache[cacheKey];\n\t\t}\n\t\treturn res;\n\t}\n\n\tfunction calculateResourceLoad(resourceProperty, resourceId, scale) {\n\n\t\tvar tasks = getTaskBy(resourceProperty, resourceId);\n\t\tvar step = scale.unit;\n\t\tvar timegrid = {};\n\n\t\tfor (var i = 0; i < tasks.length; i++) {\n\t\t\tvar task = tasks[i];\n\n\t\t\tvar currDate = gantt.date[step + \"_start\"](new Date(task.start_date));\n\n\t\t\twhile (currDate < task.end_date) {\n\n\t\t\t\tvar date = currDate;\n\t\t\t\tcurrDate = gantt.date.add(currDate, 1, step);\n\n\t\t\t\tif (!gantt.isWorkTime({date: date, task: task})) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar timestamp = date.valueOf();\n\t\t\t\tif (!timegrid[timestamp]){\n\t\t\t\t\ttimegrid[timestamp] = {\n\t\t\t\t\t\ttasks: []\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\ttimegrid[timestamp].tasks.push(task);\n\t\t\t}\n\t\t}\n\n\t\tvar timetable = [];\n\t\tvar start, end;\n\t\tfor (var i in timegrid) {\n\t\t\tstart = new Date(i * 1);\n\t\t\tend = gantt.date.add(start, 1, step);\n\t\t\ttimetable.push({\n\t\t\t\tstart_date: start,\n\t\t\t\tend_date: end,\n\t\t\t\ttasks: timegrid[i].tasks\n\t\t\t});\n\t\t}\n\n\t\treturn timetable;\n\t}\n\n\tfunction renderResourceLine(resource, timeline) {\n\t\tvar config = timeline.$getConfig(),\n\t\t\ttemplates = timeline.$getTemplates();\n\t\tvar timetable = getResourceLoad(config.resource_property, resource.id, timeline.getScale());\n\n\t\tvar cells = [];\n\t\tfor (var i = 0; i < timetable.length; i++) {\n\n\t\t\tvar day = timetable[i];\n\n\t\t\tvar css = templates.resource_cell_class(day.start_date, day.end_date, resource, day.tasks);\n\t\t\tvar content = templates.resource_cell_value(day.start_date, day.end_date, resource, day.tasks);\n\n\t\t\tif(css || content){\n\t\t\t\tvar sizes = timeline.getItemPosition(resource, day.start_date, day.end_date);\n\t\t\t\tvar el = document.createElement('div');\n\t\t\t\tel.className = [\"gantt_resource_marker\", css].join(\" \");\n\n\t\t\t\tel.style.cssText = [\n\t\t\t\t\t'left:' + sizes.left + 'px',\n\t\t\t\t\t'width:' + sizes.width + 'px',\n\t\t\t\t\t'height:' + (config.row_height - 1) + 'px',\n\t\t\t\t\t'line-height:' + (config.row_height - 1) + 'px',\n\t\t\t\t\t'top:' + sizes.top + 'px'\n\t\t\t\t].join(\";\");\n\n\t\t\t\tif(content)\n\t\t\t\t\tel.innerHTML = content;\n\n\t\t\t\tcells.push(el);\n\t\t\t}\n\n\t\t}\n\n\t\tvar row = null;\n\t\tif(cells.length){\n\t\t\trow = document.createElement(\"div\");\n\t\t\tfor(var i = 0; i < cells.length; i++){\n\t\t\t\trow.appendChild(cells[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn row;\n\t}\n\treturn {\n\t\trenderLine: renderResourceLine,\n\t\tfilterTasks: getTaskBy\n\t};\n}\n\nmodule.exports = function(gantt){\n\tvar methods = createResourceMethods(gantt);\n\n\tgantt.getTaskBy = methods.filterTasks;\n\tgantt.$ui.layers.resourceRow = methods.renderLine;\n\tgantt.config.resource_property = \"owner_id\";\n\tgantt.config.resource_store = \"resource\";\n\n\tgantt.templates.resource_cell_class = function(start, end, resource, tasks){\n\t\tvar css = \"\";\n\t\tif (tasks.length <= 1) {\n\t\t\tcss = \"gantt_resource_marker_ok\";\n\t\t} else {\n\t\t\tcss = \"gantt_resource_marker_overtime\";\n\t\t}\n\t\treturn css;\n\t};\n\n\tgantt.templates.resource_cell_value = function(start, end, resource, tasks){\n\t\treturn tasks.length * 8;\n\t};\n};\n\n\n\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\n};\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\n\tgantt.getGridColumn = function (name) {\n\t\tvar columns = gantt.config.columns;\n\n\t\tfor (var i = 0; i < columns.length; i++) {\n\t\t\tif (columns[i].name == name)\n\t\t\t\treturn columns[i];\n\t\t}\n\n\t\treturn null;\n\t};\n};\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt){\n\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\n\n\tfunction stripHTMLLite(htmlText){\n\t\treturn (htmlText + \"\")\n\t\t\t.replace(htmlTags, \" \").\n\t\t\treplace(extraSpaces, \" \");\n\t}\n\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\n\tfunction escapeQuotes(text){\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\n\t}\n\n\tgantt._waiAria = {\n\t\tgetAttributeString: function(attr){\n\t\t\tvar attributes = [\" \"];\n\t\t\tfor(var i in attr){\n\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\n\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\n\t\t\t}\n\t\t\tattributes.push(\" \");\n\t\t\treturn attributes.join(\" \");\n\n\t\t},\n\n\t\tgetTimelineCellAttr:function(dateString){\n\n\t\t\treturn gantt._waiAria.getAttributeString({\"aria-label\": dateString});\n\t\t},\n\n\n\t\t_taskCommonAttr: function(task, div){\n\n\t\t\tif(!(task.start_date && task.end_date))\n\t\t\t\treturn;\n\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(gantt.templates.tooltip_text(task.start_date, task.end_date, task)));\n\n\t\t\tif(gantt.isReadonly(task)){\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\n\n\n\t\t\t}\n\n\t\t\tif(task.$dataprocessor_class){\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\n\t\t\t}\n\n\n\t\t\tdiv.setAttribute(\"aria-selected\",\n\t\t\t\t(gantt.getState().selected_task == task.id || (gantt.isSelectedTask && gantt.isSelectedTask(task.id))) ? \"true\" : \"false\");\n\t\t},\n\n\t\tsetTaskBarAttr: function(task, div){\n\t\t\tthis._taskCommonAttr(task, div);\n\n\t\t\tif(!gantt.isReadonly(task) && gantt.config.drag_move){\n\t\t\t\tif(task.id != gantt.getState().drag_id){\n\t\t\t\t\tdiv.setAttribute(\"aria-grabbed\", false);\n\t\t\t\t}else{\n\t\t\t\t\tdiv.setAttribute(\"aria-grabbed\", true);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\ttaskRowAttr: function(task, div){\n\n\t\t\tthis._taskCommonAttr(task, div);\n\n\t\t\tif(!gantt.isReadonly(task) && gantt.config.order_branch){\n\t\t\t\tdiv.setAttribute(\"aria-grabbed\", false);\n\t\t\t}\n\n\t\t\tdiv.setAttribute(\"role\", \"row\");\n\n\t\t\tdiv.setAttribute(\"aria-level\", task.$level);\n\n\t\t\tif(gantt.hasChild(task.id)){\n\t\t\t\tdiv.setAttribute(\"aria-expanded\", task.$open ? \"true\" : \"false\");\n\t\t\t}\n\t\t},\n\n\t\tlinkAttr: function(link, div){\n\n\t\t\tvar linkTypes = gantt.config.links;\n\n\t\t\tvar toStart = link.type == linkTypes.finish_to_start || link.type == linkTypes.start_to_start;\n\t\t\tvar fromStart = link.type == linkTypes.start_to_start || link.type == linkTypes.start_to_finish;\n\n\t\t\tvar content = gantt.locale.labels.link + \" \" + gantt.templates.drag_link(link.source, fromStart, link.target, toStart);\n\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(content));\n\t\t\tif(gantt.isReadonly(link)){\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\n\t\t\t}\n\t\t},\n\n\t\tgridSeparatorAttr: function(div){\n\t\t\tdiv.setAttribute(\"role\", \"separator\");\n\t\t},\n\n\t\tlightboxHiddenAttr: function(div){\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\n\t\t},\n\n\t\tlightboxVisibleAttr: function(div){\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\n\t\t},\n\n\t\tlightboxAttr: function(div){\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\n\t\t},\n\n\t\tlightboxButtonAttrString:function(buttonName){\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":gantt.locale.labels[buttonName], \"tabindex\":\"0\"});\n\t\t},\n\n\t\tlightboxHeader: function(div, headerText){\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\n\t\t},\n\n\t\tlightboxSelectAttrString: function(time_option){\n\t\t\tvar label = \"\";\n\n\t\t\tswitch (time_option) {\n\t\t\t\tcase \"%Y\":\n\t\t\t\t\tlabel = gantt.locale.labels.years;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"%m\":\n\t\t\t\t\tlabel = gantt.locale.labels.months;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"%d\":\n\t\t\t\t\tlabel = gantt.locale.labels.days;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"%H:%i\":\n\t\t\t\t\tlabel = gantt.locale.labels.hours + gantt.locale.labels.minutes;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn gantt._waiAria.getAttributeString({\"aria-label\": label});\n\t\t},\n\n\t\tlightboxDurationInputAttrString: function(section){\n\t\t\treturn this.getAttributeString({\"aria-label\": gantt.locale.labels.column_duration, \"aria-valuemin\": \"0\"});\n\t\t},\n\n\t\tgridAttrString: function(){\n\t\t\treturn [\" role='treegrid'\", gantt.config.multiselect ? \"aria-multiselectable='true'\" : \"aria-multiselectable='false'\", \" \"].join(\" \");\n\t\t},\n\n\n\t\tgridScaleRowAttrString: function(){\n\t\t\treturn \"role='row'\";\n\t\t},\n\n\t\tgridScaleCellAttrString: function(column, label){\n\t\t\tvar attrs = \"\";\n\t\t\tif(column.name == \"add\"){\n\t\t\t\tattrs = this.getAttributeString({\"role\":\"button\", \"aria-label\": gantt.locale.labels.new_task});\n\t\t\t}else{\n\n\t\t\t\tvar attributes = {\n\t\t\t\t\t\"role\":\"columnheader\",\n\t\t\t\t\t\"aria-label\": label\n\t\t\t\t};\n\n\t\t\t\tif(gantt._sort && gantt._sort.name == column.name){\n\t\t\t\t\tif(gantt._sort.direction == \"asc\"){\n\t\t\t\t\t\tattributes[\"aria-sort\"] = \"ascending\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tattributes[\"aria-sort\"] = \"descending\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tattrs = this.getAttributeString(attributes);\n\t\t\t}\n\t\t\treturn attrs;\n\t\t},\n\n\t\tgridDataAttrString: function(){\n\t\t\treturn \"role='rowgroup'\";\n\t\t},\n\n\t\tgridCellAttrString: function(column, textValue){\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": textValue});\n\t\t},\n\n\t\tgridAddButtonAttrString: function(column){\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\": gantt.locale.labels.new_task});\n\t\t},\n\n\t\tmessageButtonAttrString: function(buttonLabel){\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\n\t\t},\n\n\t\tmessageInfoAttr: function(div){\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\n\t\t},\n\n\t\tmessageModalAttr: function(div, uid){\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\n\t\t\tif(uid){\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\n\t\t\t}\n\n\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\n\t\t},\n\n\t\tquickInfoAttr: function(div){\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\n\t\t},\n\n\t\tquickInfoHeaderAttrString: function(){\n\t\t\treturn \" role='heading' \";\n\t\t},\n\n\t\tquickInfoHeader: function(div, header){\n\t\t\tdiv.setAttribute(\"aria-label\", header);\n\t\t},\n\n\t\tquickInfoButtonAttrString: function(label){\n\t\t\treturn gantt._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\n\t\t},\n\n\t\ttooltipAttr: function(div){\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\n\t\t},\n\n\t\ttooltipVisibleAttr: function(div){\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\n\t\t},\n\n\t\ttooltipHiddenAttr: function(div){\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\n\t\t}\n\t};\n\n\tfunction isDisabled(){\n\t\treturn !gantt.config.wai_aria_attributes;\n\t}\n\n\tfor(var i in gantt._waiAria){\n\t\tgantt._waiAria[i] = (function(payload){\n\t\t\treturn function(){\n\t\t\t\tif(isDisabled()){\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\treturn payload.apply(this, arguments);\n\t\t\t};\n\t\t})(gantt._waiAria[i]);\n\t}\n\n\n};\n\n/***/ }),\n/* 76 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\n\tgantt.isReadonly = function (item) {\n\t\tif (item && item[this.config.editable_property]) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn (item && item[this.config.readonly_property]) || this.config.readonly;\n\t\t}\n\t};\n};\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar utils = __webpack_require__(0);\nvar dateHelper = __webpack_require__(3);\n\nmodule.exports = function(gantt) {\n\n\tgantt.load = function (url, type, callback) {\n\t\tthis._load_url = url;\n\t\tthis.assert(arguments.length, \"Invalid load arguments\");\n\n\t\tvar tp = 'json', cl = null;\n\t\tif (arguments.length >= 3) {\n\t\t\ttp = type;\n\t\t\tcl = callback;\n\t\t} else {\n\t\t\tif (typeof arguments[1] == \"string\")\n\t\t\t\ttp = arguments[1];\n\t\t\telse if (typeof arguments[1] == \"function\")\n\t\t\t\tcl = arguments[1];\n\t\t}\n\n\t\tthis._load_type = tp;\n\n\t\tthis.callEvent(\"onLoadStart\", [url, tp]);\n\n\t\tthis.ajax.get(url, gantt.bind(function (l) {\n\t\t\tthis.on_load(l, tp);\n\t\t\tthis.callEvent(\"onLoadEnd\", [url, tp]);\n\t\t\tif (typeof cl == \"function\")\n\t\t\t\tcl.call(this);\n\t\t}, this));\n\t};\n\tgantt.parse = function (data, type) {\n\t\tthis.on_load({xmlDoc: {responseText: data}}, type);\n\t};\n\n\tgantt.serialize = function (type) {\n\t\ttype = type || \"json\";\n\t\treturn this[type].serialize();\n\t};\n\n\t/*\n\ttasks and relations\n\t{\n\tdata:[\n\t\t{\n\t\t\t\"id\":\"string\",\n\t\t\t\"text\":\"...\",\n\t\t\t\"start_date\":\"Date or string\",\n\t\t\t\"end_date\":\"Date or string\",\n\t\t\t\"duration\":\"number\",\n\t\t\t\"progress\":\"0..1\",\n\t\t\t\"parent_id\":\"string\",\n\t\t\t\"order\":\"number\"\n\t\t},...],\n\tlinks:[\n\t\t{\n\t\t\tid:\"string\",\n\t\t\tsource:\"string\",\n\t\t\ttarget:\"string\",\n\t\t\ttype:\"string\"\n\t\t},...],\n\tcollections:{\n\t\t\tcollectionName:[\n\t\t\t\t{key:, label:, optional:...},...\n\t\t\t],...\n\t\t}\n\t}\n\n\t* */\n\n\tgantt.on_load = function (resp, type) {\n\t\tthis.callEvent(\"onBeforeParse\", []);\n\t\tif (!type)\n\t\t\ttype = \"json\";\n\t\tthis.assert(this[type], \"Invalid data type:'\" + type + \"'\");\n\n\t\tvar raw = resp.xmlDoc.responseText;\n\n\t\tvar data = this[type].parse(raw, resp);\n\t\tthis._process_loading(data);\n\t};\n\n\tgantt._process_loading = function (data) {\n\t\tif(data.collections)\n\t\t\tthis._load_collections(data.collections);\n\n\t\tthis.$data.tasksStore.parse(data.data);\n\t\tvar links = data.links || (data.collections ? data.collections.links : []);\n\t\tthis.$data.linksStore.parse(links);\n\n\t\t//this._sync_links();\n\t\tthis.callEvent(\"onParse\", []);\n\t\tthis.render();\n\t\tif(this.config.initial_scroll){\n\t\t\tvar firstTask = this.getTaskByIndex(0);\n\t\t\tvar id = firstTask ? firstTask.id : this.config.root_id;\n\t\t\tif(this.isTaskExists(id))\n\t\t\t\tthis.showTask(id);\n\t\t}\n\t};\n\n\n\tgantt._load_collections = function (collections) {\n\t\tvar collections_loaded = false;\n\t\tfor (var key in collections) {\n\t\t\tif (collections.hasOwnProperty(key)) {\n\t\t\t\tcollections_loaded = true;\n\t\t\t\tvar collection = collections[key];\n\t\t\t\tvar arr = this.serverList[key];\n\t\t\t\tif (!arr) continue;\n\t\t\t\tarr.splice(0, arr.length); //clear old options\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\n\t\t\t\t\tvar option = collection[j];\n\t\t\t\t\tvar obj = this.copy(option);\n\t\t\t\t\tobj.key = obj.value;// resulting option object\n\n\t\t\t\t\tfor (var option_key in option) {\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tarr.push(obj);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (collections_loaded)\n\t\t\tthis.callEvent(\"onOptionsLoad\", []);\n\t};\n\n\tgantt.attachEvent(\"onBeforeTaskDisplay\", function (id, task) {\n\t\treturn !task.$ignore;\n\t});\n\n\tgantt.json = {\n\t\tparse: function (data) {\n\t\t\tgantt.assert(data, \"Invalid data\");\n\n\t\t\tif (typeof data == \"string\") {\n\t\t\t\tif (window.JSON)\n\t\t\t\t\tdata = JSON.parse(data);\n\t\t\t\telse {\n\t\t\t\t\tgantt.assert(false, \"JSON is not supported\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (data.dhx_security)\n\t\t\t\tgantt.security_key = data.dhx_security;\n\t\t\treturn data;\n\t\t},\n\t\tserializeTask: function (task) {\n\t\t\treturn this._copyObject(task);\n\t\t},\n\t\tserializeLink: function (link) {\n\t\t\treturn this._copyLink(link);\n\t\t},\n\t\t_copyLink: function (obj) {\n\t\t\tvar copy = {};\n\t\t\tfor (var key in obj)\n\t\t\t\tcopy[key] = obj[key];\n\t\t\treturn copy;\n\t\t},\n\t\t_copyObject: function (obj) {\n\t\t\tvar copy = {};\n\t\t\tfor (var key in obj) {\n\t\t\t\tif (key.charAt(0) == \"$\")\n\t\t\t\t\tcontinue;\n\t\t\t\tcopy[key] = obj[key];\n\n\t\t\t\tif (dateHelper.isDate(copy[key])) {\n\t\t\t\t\tcopy[key] = gantt.templates.xml_format(copy[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn copy;\n\t\t},\n\t\tserialize: function () {\n\t\t\tvar tasks = [];\n\t\t\tvar links = [];\n\n\t\t\tgantt.eachTask(function (obj) {\n\t\t\t\tgantt.resetProjectDates(obj);\n\t\t\t\ttasks.push(this.serializeTask(obj));\n\t\t\t}, gantt.config.root_id, this);\n\n\t\t\tvar rawLinks = gantt.getLinks();\n\t\t\tfor (var i = 0; i < rawLinks.length; i++) {\n\t\t\t\tlinks.push(this.serializeLink(rawLinks[i]));\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdata: tasks,\n\t\t\t\tlinks: links\n\t\t\t};\n\t\t}\n\t};\n\n\t/*\n\t\n\t\t\n\t\t\tMy task 1\n\t\t\t16.08.2013\n\t\t\t22.08.2013\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\t*/\n\n\tgantt.xml = {\n\t\t_xmlNodeToJSON: function (node, attrs_only) {\n\t\t\tvar t = {};\n\t\t\tfor (var i = 0; i < node.attributes.length; i++)\n\t\t\t\tt[node.attributes[i].name] = node.attributes[i].value;\n\n\t\t\tif (!attrs_only) {\n\t\t\t\tfor (var i = 0; i < node.childNodes.length; i++) {\n\t\t\t\t\tvar child = node.childNodes[i];\n\t\t\t\t\tif (child.nodeType == 1)\n\t\t\t\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\n\t\t\t\t}\n\n\t\t\t\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\n\t\t\t}\n\n\t\t\treturn t;\n\t\t},\n\t\t_getCollections: function (loader) {\n\t\t\tvar collection = {};\n\t\t\tvar opts = gantt.ajax.xpath(\"//coll_options\", loader);\n\t\t\tfor (var i = 0; i < opts.length; i++) {\n\t\t\t\tvar bind = opts[i].getAttribute(\"for\");\n\t\t\t\tvar arr = collection[bind] = [];\n\t\t\t\tvar itms = gantt.ajax.xpath(\".//item\", opts[i]);\n\t\t\t\tfor (var j = 0; j < itms.length; j++) {\n\t\t\t\t\tvar itm = itms[j];\n\t\t\t\t\tvar attrs = itm.attributes;\n\t\t\t\t\tvar obj = {key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\n\t\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\n\t\t\t\t\t\tvar attr = attrs[k];\n\t\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\n\t\t\t\t\t}\n\t\t\t\t\tarr.push(obj);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn collection;\n\t\t},\n\t\t_getXML: function (text, loader, toptag) {\n\t\t\ttoptag = toptag || \"data\";\n\t\t\tif (!loader.getXMLTopNode) {\n\t\t\t\tloader = gantt.ajax.parse(loader);\n\t\t\t}\n\n\t\t\tvar xml = gantt.ajax.xmltop(toptag, loader.xmlDoc);\n\t\t\tif (!xml || xml.tagName != toptag) throw \"Invalid XML data\";\n\n\t\t\tvar skey = xml.getAttribute(\"dhx_security\");\n\t\t\tif (skey)\n\t\t\t\tgantt.security_key = skey;\n\n\t\t\treturn xml;\n\t\t},\n\t\tparse: function (text, loader) {\n\t\t\tloader = this._getXML(text, loader);\n\t\t\tvar data = {};\n\n\t\t\tvar evs = data.data = [];\n\t\t\tvar xml = gantt.ajax.xpath(\"//task\", loader);\n\n\t\t\tfor (var i = 0; i < xml.length; i++)\n\t\t\t\tevs[i] = this._xmlNodeToJSON(xml[i]);\n\n\t\t\tdata.collections = this._getCollections(loader);\n\t\t\treturn data;\n\t\t},\n\t\t_copyLink: function (obj) {\n\t\t\treturn \" \";\n\t\t},\n\t\t_copyObject: function (obj) {\n\t\t\treturn \"\";\n\t\t},\n\t\tserialize: function () {\n\t\t\tvar tasks = [];\n\t\t\tvar links = [];\n\n\t\t\tvar json = gantt.json.serialize();\n\t\t\tfor (var i = 0, len = json.data.length; i < len; i++) {\n\t\t\t\ttasks.push(this._copyObject(json.data[i]));\n\t\t\t}\n\t\t\tfor (var i = 0, len = json.links.length; i < len; i++) {\n\t\t\t\tlinks.push(this._copyLink(json.links[i]));\n\t\t\t}\n\t\t\treturn \"\" + tasks.join(\"\") + \"\" + links.join(\"\") + \"\";\n\t\t}\n\t};\n\n\n\tgantt.oldxml = {\n\t\tparse: function (text, loader) {\n\t\t\tloader = gantt.xml._getXML(text, loader, \"projects\");\n\t\t\tvar data = {collections: {links: []}};\n\n\t\t\tvar evs = data.data = [];\n\t\t\tvar xml = gantt.ajax.xpath(\"//task\", loader);\n\n\t\t\tfor (var i = 0; i < xml.length; i++) {\n\t\t\t\tevs[i] = gantt.xml._xmlNodeToJSON(xml[i]);\n\t\t\t\tvar parent = xml[i].parentNode;\n\n\t\t\t\tif (parent.tagName == \"project\")\n\t\t\t\t\tevs[i].parent = \"project-\" + parent.getAttribute(\"id\");\n\t\t\t\telse\n\t\t\t\t\tevs[i].parent = parent.parentNode.getAttribute(\"id\");\n\t\t\t}\n\n\t\t\txml = gantt.ajax.xpath(\"//project\", loader);\n\t\t\tfor (var i = 0; i < xml.length; i++) {\n\t\t\t\tvar ev = gantt.xml._xmlNodeToJSON(xml[i], true);\n\t\t\t\tev.id = \"project-\" + ev.id;\n\t\t\t\tevs.push(ev);\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < evs.length; i++) {\n\t\t\t\tvar ev = evs[i];\n\t\t\t\tev.start_date = ev.startdate || ev.est;\n\t\t\t\tev.end_date = ev.enddate;\n\t\t\t\tev.text = ev.name;\n\t\t\t\tev.duration = ev.duration / 8;\n\t\t\t\tev.open = 1;\n\t\t\t\tif (!ev.duration && !ev.end_date) ev.duration = 1;\n\t\t\t\tif (ev.predecessortasks)\n\t\t\t\t\tdata.collections.links.push({\n\t\t\t\t\t\ttarget: ev.id,\n\t\t\t\t\t\tsource: ev.predecessortasks,\n\t\t\t\t\t\ttype: gantt.config.links.finish_to_start\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn data;\n\t\t},\n\t\tserialize: function () {\n\t\t\tgantt.message(\"Serialization to 'old XML' is not implemented\");\n\t\t}\n\t};\n\n\tgantt.serverList = function (name, array) {\n\t\tif (array) {\n\t\t\tthis.serverList[name] = array.slice(0);\n\t\t} else if (!this.serverList[name]) {\n\t\t\tthis.serverList[name] = [];\n\t\t}\n\t\treturn this.serverList[name];\n\t};\n\n};\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar CalendarManager = __webpack_require__(79),\n\tTimeCalculator = __webpack_require__(82),\n\tworktimeFacadeFactory = __webpack_require__(84),\n\tutils = __webpack_require__(0);\n\nmodule.exports = function (gantt) {\n\tvar manager = new CalendarManager(gantt),\n\ttimeCalculator = new TimeCalculator(manager);\n\tvar facade = worktimeFacadeFactory.create(manager, timeCalculator);\n\tutils.mixin(gantt, facade);\n};\n\n\n/***/ }),\n/* 79 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar utils = __webpack_require__(0);\nvar createArgumentsHelper = __webpack_require__(19);\nvar CalendarWorktimeStrategy = __webpack_require__(80);\n\nfunction CalendarManager (gantt){\n\tthis.$gantt = gantt;\n\tthis._calendars = {};\n}\n\nCalendarManager.prototype = {\n\t_calendars: {},\n\t_getDayHoursForMultiple: function (calendars, date) {\n\t\tvar units = [],\n\t\t\ttick = true,\n\t\t\tcurrPos = 0,\n\t\t\tis_work_hour = false,\n\t\t\tstart = this.$gantt.date.day_start(new Date(date));\n\t\tfor (var hour = 0; hour < 24; hour++) {\n\t\t\tis_work_hour = calendars.reduce(function (acc, calendar) {\n\t\t\t\treturn acc && calendar._is_work_hour(start);\n\t\t\t}, true);\n\t\t\tif (is_work_hour) {\n\t\t\t\tif (tick) {\n\t\t\t\t\tunits[currPos] = hour;\n\t\t\t\t\tunits[currPos + 1] = (hour + 1);\n\t\t\t\t\tcurrPos += 2;\n\t\t\t\t} else {\n\t\t\t\t\tunits[currPos - 1] += 1;\n\t\t\t\t}\n\t\t\t\ttick = false;\n\t\t\t} else if (!tick) {\n\t\t\t\ttick = true;\n\t\t\t}\n\t\t\tstart = this.$gantt.date.add(start, 1, \"hour\");\n\t\t}\n\t\tif (!units.length)\n\t\t\tunits = false;\n\t\treturn units;\n\t},\n\tmergeCalendars: function () {\n\t\tvar newCalendar = this.createCalendar(),\n\t\t\tday,\n\t\t\tunits = [];\n\t\tvar calendars = Array.prototype.slice.call(arguments, 0);\n\t\tnewCalendar.worktime.hours = [0, 24];\n\t\tnewCalendar.worktime.dates = {};\n\t\tvar start = this.$gantt.date.day_start(new Date(259200000)); // 1970 day=0\n\t\tfor (day = 0; day < 7; day++) {\n\t\t\tunits = this._getDayHoursForMultiple(calendars, start);\n\t\t\tnewCalendar.worktime.dates[day] = units;\n\t\t\tstart = this.$gantt.date.add(start, 1, \"day\");\n\t\t}\n\t\tfor (var i = 0; i < calendars.length; i++) {\n\t\t\tfor (var value in calendars[i].worktime.dates) if (+value > 10000) {\n\t\t\t\tunits = this._getDayHoursForMultiple(calendars, new Date(+value));\n\t\t\t\tnewCalendar.worktime.dates[value] = units;\n\t\t\t}\n\t\t}\n\t\treturn newCalendar;\n\t},\n\n\t_convertWorktimeSettings: function (settings) {\n\t\tvar days = settings.days;\n\t\tif (days) {\n\t\t\tsettings.dates = settings.dates || {};\n\t\t\tfor (var i = 0; i < days.length; i++) {\n\t\t\t\tsettings.dates[i] = days[i];\n\t\t\t\tif (!(days[i] instanceof Array)) {\n\t\t\t\t\tsettings.dates[i] = !!days[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tdelete settings.days;\n\t\t}\n\t\treturn settings;\n\t},\n\n\tcreateCalendar: function (parentCalendar) {\n\t\tvar settings;\n\n\t\tif (!parentCalendar) {\n\t\t\tparentCalendar = {};\n\t\t}\n\n\t\tif (parentCalendar.worktime) {\n\t\t\tsettings = utils.copy(parentCalendar.worktime);\n\t\t} else {\n\t\t\tsettings = utils.copy(parentCalendar);\n\t\t}\n\n\t\tvar defaults = utils.copy(this.defaults.fulltime.worktime);\n\t\tutils.mixin(settings, defaults);\n\n\t\tvar id = utils.uid();\n\t\tvar calendar = {\n\t\t\tid: id + \"\",\n\t\t\tworktime: this._convertWorktimeSettings(settings)\n\t\t};\n\n\t\tvar apiCore = new CalendarWorktimeStrategy(this.$gantt, createArgumentsHelper(this.$gantt));\n\t\tutils.mixin(apiCore, calendar);\n\n\t\t// validate/check if empty calendar\n\t\tif (!apiCore._tryChangeCalendarSettings(function () {\n\t\t\t})) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn apiCore;\n\t\t}\n\t},\n\n\tgetCalendar: function (id) {\n\t\tid = id || \"global\";\n\t\tthis.createDefaultCalendars();\n\t\treturn this._calendars[id];\n\t},\n\n\tgetCalendars: function () {\n\t\tvar res = [];\n\t\tfor (var i in this._calendars) {\n\t\t\tres.push(this.getCalendar(i));\n\t\t}\n\t\treturn res;\n\t},\n\n\tgetTaskCalendar: function (task) {\n\t\tvar config = this.$gantt.$services.config();\n\t\tif (!task) {\n\t\t\treturn this.getCalendar();\n\t\t} else if (task[config.calendar_property]) {\n\t\t\treturn this.getCalendar(task[config.calendar_property]);\n\t\t} else if (config.resource_calendars) {\n\n\t\t\tfor (var field in config.resource_calendars) {\n\t\t\t\tvar resource = config.resource_calendars[field];\n\t\t\t\tif (task[field]) {\n\t\t\t\t\tvar calendarId = resource[task[field]];\n\t\t\t\t\tif (calendarId) {\n\t\t\t\t\t\treturn this.getCalendar(calendarId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.getCalendar();\n\t},\n\n\taddCalendar: function (calendar) { // puts new calendar to Global Storage - gantt.calendarManager._calendars {}\n\t\tif (!(calendar instanceof CalendarWorktimeStrategy)) {\n\t\t\tvar id = calendar.id;\n\t\t\tcalendar = this.createCalendar(calendar);\n\t\t\tcalendar.id = id;\n\t\t}\n\t\tvar config = this.$gantt.$services.config();\n\n\t\tcalendar.id = calendar.id || utils.uid();\n\t\tthis._calendars[calendar.id] = calendar;\n\t\tif (!config.worktimes)\n\t\t\tconfig.worktimes = {};\n\t\tconfig.worktimes[calendar.id] = calendar.worktime;\n\t\treturn calendar.id;\n\t},\n\n\tdeleteCalendar: function (calendar) {\n\t\tvar config = this.$gantt.$services.config();\n\t\tif (!calendar) return false;\n\t\tif (this._calendars[calendar]) {\n\t\t\tdelete this._calendars[calendar];\n\t\t\tif (config.worktimes && config.worktimes[calendar])\n\t\t\t\tdelete config.worktimes[calendar];\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t},\n\n\trestoreConfigCalendars: function (configs) {\n\t\tfor (var i in configs) {\n\t\t\tif (this._calendars[i])\n\t\t\t\tcontinue;\n\n\t\t\tvar settings = configs[i];\n\t\t\tvar calendar = this.createCalendar(settings);\n\t\t\tcalendar.id = i;\n\t\t\tthis.addCalendar(calendar);\n\t\t}\n\t},\n\n\tdefaults: {\n\t\tglobal: {\n\t\t\tid: \"global\",\n\t\t\tworktime: {\n\t\t\t\thours: [8, 17],\n\t\t\t\tdays: [0, 1, 1, 1, 1, 1, 0]\n\t\t\t}\n\t\t},\n\t\tfulltime: {\n\t\t\tid: \"fulltime\",\n\t\t\tworktime: {\n\t\t\t\thours: [0, 24],\n\t\t\t\tdays: [1, 1, 1, 1, 1, 1, 1]\n\t\t\t}\n\t\t}\n\t},\n\n\tcreateDefaultCalendars: function () {\n\t\tvar config = this.$gantt.$services.config();\n\t\tthis.restoreConfigCalendars(this.defaults);\n\t\tthis.restoreConfigCalendars(config.worktimes);\n\t}\n};\n\nmodule.exports = CalendarManager;\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Cache = __webpack_require__(81),\n\tutils = __webpack_require__(0);\n\nfunction CalendarWorkTimeStrategy(gantt, argumentsHelper){\n\tthis.argumentsHelper = argumentsHelper;\n\tthis.$gantt = gantt;\n\tthis._workingUnitsCache = new Cache();\n}\n\nCalendarWorkTimeStrategy.prototype = {\n\tunits: [\n\t\t\"year\",\n\t\t\"month\",\n\t\t\"week\",\n\t\t\"day\",\n\t\t\"hour\",\n\t\t\"minute\"\n\t],\n\t// cache previously calculated worktime\n\t_getUnitOrder: function (unit) {\n\t\tfor (var i = 0, len = this.units.length; i < len; i++) {\n\t\t\tif (this.units[i] == unit)\n\t\t\t\treturn i;\n\t\t}\n\t},\n\t_timestamp: function (settings) {\n\n\t\tvar timestamp = null;\n\t\tif ((settings.day || settings.day === 0)) {\n\t\t\ttimestamp = settings.day;\n\t\t} else if (settings.date) {\n\t\t\t// store worktime datestamp in utc so it could be recognized in different timezones (e.g. opened locally and sent to the export service in different timezone)\n\t\t\ttimestamp = Date.UTC(settings.date.getFullYear(), settings.date.getMonth(), settings.date.getDate());\n\t\t}\n\t\treturn timestamp;\n\t},\n\t_checkIfWorkingUnit: function (date, unit, order) {\n\t\tif (order === undefined) {\n\t\t\torder = this._getUnitOrder(unit);\n\t\t}\n\n\t\t// disable worktime check for custom time units\n\t\tif (order === undefined) {\n\t\t\treturn true;\n\t\t}\n\t\tif (order) {\n\t\t\t//check if bigger time unit is a work time (hour < day < month...)\n\t\t\t//i.e. don't check particular hour if the whole day is marked as not working\n\t\t\tif (!this._isWorkTime(date, this.units[order - 1], order - 1))\n\t\t\t\treturn false;\n\t\t}\n\t\tif (!this[\"_is_work_\" + unit])\n\t\t\treturn true;\n\t\treturn this[\"_is_work_\" + unit](date);\n\t},\n\t//checkings for particular time units\n\t//methods for month-year-week can be defined, otherwise always return 'true'\n\t_is_work_day: function (date) {\n\t\tvar val = this._getWorkHours(date);\n\n\t\tif (val instanceof Array) {\n\t\t\treturn val.length > 0;\n\t\t}\n\t\treturn false;\n\t},\n\t_is_work_hour: function (date) {\n\t\tvar hours = this._getWorkHours(date); // [7,12] or []\n\t\tvar hour = date.getHours();\n\t\tfor (var i = 0; i < hours.length; i += 2) {\n\t\t\tif (hours[i + 1] === undefined) {\n\t\t\t\treturn hours[i] == hour;\n\t\t\t} else {\n\t\t\t\tif (hour >= hours[i] && hour < hours[i + 1])\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t},\n\t_internDatesPull: {},\n\t_nextDate: function (start, unit, step) {\n\t\tvar dateHelper = this.$gantt.date;\n\t\treturn dateHelper.add(start, step, unit);\n\n\t\t/*var start_value = +start,\n\t\t\tkey = unit + \"_\" + step;\n\t\tvar interned = this._internDatesPull[key];\n\t\tif(!interned){\n\t\t\tinterned = this._internDatesPull[key] = {};\n\t\t}\n\t\tvar calculated;\n\t\tif(!interned[start_value]){\n\t\t\tinterned[start_value] = calculated = dateHelper.add(start, step, unit);\n\t\t\t//interned[start_value] = dateHelper.add(start, step, unit);\n\t\t}\n\t\treturn calculated || interned[start_value];*/\n\t},\n\t_getWorkUnitsBetweenGeneric: function (from, to, unit, step) {\n\t\tvar dateHelper = this.$gantt.date;\n\t\tvar start = new Date(from),\n\t\t\tend = new Date(to);\n\t\tstep = step || 1;\n\t\tvar units = 0;\n\n\n\t\tvar next = null;\n\t\tvar stepStart,\n\t\t\tstepEnd;\n\n\t\t// calculating decimal durations, i.e. 2016-09-20 00:05:00 - 2016-09-20 01:00:00 ~ 0.95 instead of 1\n\t\t// and also 2016-09-20 00:00:00 - 2016-09-20 00:05:00 ~ 0.05 instead of 1\n\t\t// durations must be rounded later\n\t\tvar checkFirst = false;\n\t\tstepStart = dateHelper[unit + \"_start\"](new Date(start));\n\t\tif (stepStart.valueOf() != start.valueOf()) {\n\t\t\tcheckFirst = true;\n\t\t}\n\t\tvar checkLast = false;\n\t\tstepEnd = dateHelper[unit + \"_start\"](new Date(to));\n\t\tif (stepEnd.valueOf() != to.valueOf()) {\n\t\t\tcheckLast = true;\n\t\t}\n\n\t\tvar isLastStep = false;\n\t\twhile (start.valueOf() < end.valueOf()) {\n\t\t\tnext = this._nextDate(start, unit, step);\n\t\t\tisLastStep = (next.valueOf() > end.valueOf());\n\n\t\t\tif (this._isWorkTime(start, unit)) {\n\t\t\t\tif (checkFirst || (checkLast && isLastStep)) {\n\t\t\t\t\tstepStart = dateHelper[unit + \"_start\"](new Date(start));\n\t\t\t\t\tstepEnd = dateHelper.add(stepStart, step, unit);\n\t\t\t\t}\n\n\t\t\t\tif (checkFirst) {\n\t\t\t\t\tcheckFirst = false;\n\t\t\t\t\tnext = this._nextDate(stepStart, unit, step);\n\t\t\t\t\tunits += ((stepEnd.valueOf() - start.valueOf()) / (stepEnd.valueOf() - stepStart.valueOf()));\n\t\t\t\t} else if (checkLast && isLastStep) {\n\t\t\t\t\tcheckLast = false;\n\t\t\t\t\tunits += ((end.valueOf() - start.valueOf()) / (stepEnd.valueOf() - stepStart.valueOf()));\n\n\t\t\t\t} else {\n\t\t\t\t\tunits++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tstart = next;\n\t\t}\n\t\treturn units;\n\t},\n\t_getHoursPerDay: function (date) {\n\t\tvar hours = this._getWorkHours(date);\n\t\tvar res = 0;\n\t\tfor (var i = 0; i < hours.length; i += 2) {\n\t\t\tres += ((hours[i + 1] - hours[i]) || 0);\n\t\t}\n\t\treturn res;\n\t},\n\t_getWorkHoursForRange: function (from, to) {\n\t\tvar hours = 0;\n\t\tvar start = new Date(from),\n\t\t\tend = new Date(to);\n\n\t\twhile (start.valueOf() < end.valueOf()) {\n\t\t\tif (this._isWorkTime(start, \"day\"))\n\t\t\t\thours += this._getHoursPerDay(start);\n\t\t\tstart = this._nextDate(start, \"day\", 1);\n\t\t}\n\t\treturn hours;\n\t},\n\t_getWorkUnitsBetweenHours: function (from, to, unit, step) {\n\t\tvar start = new Date(from),\n\t\t\tend = new Date(to);\n\t\tstep = step || 1;\n\n\t\tvar firstDayStart = new Date(start);\n\t\tvar firstDayEnd = this.$gantt.date.add(this.$gantt.date.day_start(new Date(start)), 1, \"day\");\n\n\t\tif (end.valueOf() <= firstDayEnd.valueOf()) {\n\t\t\treturn this._getWorkUnitsBetweenGeneric(from, to, unit, step);\n\t\t} else {\n\n\t\t\tvar lastDayStart = this.$gantt.date.day_start(new Date(end));\n\t\t\tvar lastDayEnd = end;\n\n\t\t\tvar startPart = this._getWorkUnitsBetweenGeneric(firstDayStart, firstDayEnd, unit, step);\n\t\t\tvar endPart = this._getWorkUnitsBetweenGeneric(lastDayStart, lastDayEnd, unit, step);\n\n\t\t\tvar hourRange = this._getWorkHoursForRange(firstDayEnd, lastDayStart);\n\t\t\thourRange = ((hourRange / step) + startPart + endPart);\n\n\t\t\treturn hourRange;\n\t\t}\n\t},\n\n\t_getCalendar: function () {\n\t\treturn this.worktime;\n\t},\n\t_setCalendar: function (settings) {\n\t\tthis.worktime = settings;\n\t},\n\n\t_tryChangeCalendarSettings: function (payload) {\n\t\tvar backup = JSON.stringify(this._getCalendar());\n\t\tpayload();\n\t\tif (this._isEmptyCalendar(this._getCalendar())) {\n\t\t\tthis.$gantt.assert(false, \"Invalid calendar settings, no worktime available\");\n\t\t\tthis._setCalendar(JSON.parse(backup));\n\t\t\tthis._workingUnitsCache.clear();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\n\t},\n\n\t_isEmptyCalendar: function (settings) {\n\t\tvar result = false,\n\t\t\tdatesArray = [],\n\t\t\tisFullWeekSet = true;\n\t\tfor (var i in settings.dates) {\n\t\t\tresult |= !!settings.dates[i];\n\t\t\tdatesArray.push(i);\n\t\t}\n\n\t\tvar checkFullArray = [];\n\t\tfor (var i = 0; i < datesArray.length; i++) {\n\t\t\tif (datesArray[i] < 10) {\n\t\t\t\tcheckFullArray.push(datesArray[i]);\n\t\t\t}\n\t\t}\n\t\tcheckFullArray.sort();\n\n\t\tfor (var i = 0; i < 7; i++) {\n\t\t\tif (checkFullArray[i] != i)\n\t\t\t\tisFullWeekSet = false;\n\t\t}\n\t\tif (isFullWeekSet)\n\t\t\treturn !result;\n\t\treturn !(result || !!settings.hours); // can still return false if separated dates are set to true\n\t},\n\n\tgetWorkHours: function () {\n\t\tvar config = this.argumentsHelper.getWorkHoursArguments.apply(this.argumentsHelper, arguments);\n\t\treturn this._getWorkHours(config.date);\n\t},\n\t_getWorkHours: function (date) {\n\t\tvar t = this._timestamp({date: date});\n\t\tvar hours = true;\n\t\tvar calendar = this._getCalendar();\n\t\tif (calendar.dates[t] !== undefined) {\n\t\t\thours = calendar.dates[t];//custom day\n\t\t} else if (calendar.dates[date.getDay()] !== undefined) {\n\t\t\thours = calendar.dates[date.getDay()];//week day\n\t\t}\n\t\tif (hours === true) {\n\t\t\treturn calendar.hours;\n\t\t} else if (hours) {\n\t\t\treturn hours;\n\t\t}\n\t\treturn [];\n\t},\n\n\tsetWorkTime: function (settings) {\n\t\treturn this._tryChangeCalendarSettings(utils.bind(function () {\n\t\t\tvar hours = settings.hours !== undefined ? settings.hours : true;\n\t\t\tvar timestamp = this._timestamp(settings);\n\t\t\tif (timestamp !== null) {\n\t\t\t\tthis._getCalendar().dates[timestamp] = hours;\n\t\t\t} else {\n\t\t\t\tthis._getCalendar().hours = hours;\n\t\t\t}\n\t\t\tthis._workingUnitsCache.clear();\n\t\t}, this));\n\t},\n\n\tunsetWorkTime: function (settings) {\n\t\treturn this._tryChangeCalendarSettings(utils.bind(function () {\n\t\t\tif (!settings) {\n\t\t\t\tthis.reset_calendar();\n\t\t\t} else {\n\n\t\t\t\tvar timestamp = this._timestamp(settings);\n\n\t\t\t\tif (timestamp !== null) {\n\t\t\t\t\tdelete this._getCalendar().dates[timestamp];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Clear work units cache\n\t\t\tthis._workingUnitsCache.clear();\n\t\t}, this));\n\t},\n\n\t_isWorkTime: function (date, unit, order) {\n\t\t//Check if this item has in the cache\n\t\tvar is_work_unit = this._workingUnitsCache.get(unit, date);\n\n\t\tif (is_work_unit == -1) {\n\t\t\t// calculate if not cached\n\t\t\tis_work_unit = this._checkIfWorkingUnit(date, unit, order);\n\t\t\tthis._workingUnitsCache.put(unit, date, is_work_unit);\n\t\t}\n\n\t\treturn is_work_unit;\n\t},\n\n\tisWorkTime: function () {\n\t\tvar config = this.argumentsHelper.isWorkTimeArguments.apply( this.argumentsHelper, arguments);\n\t\treturn this._isWorkTime(config.date, config.unit);\n\t},\n\n\tcalculateDuration: function () {\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply( this.argumentsHelper, arguments);\n\n\t\tif (!config.unit) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar res = 0;\n\t\tif (config.unit == \"hour\") {\n\t\t\tres = this._getWorkUnitsBetweenHours(config.start_date, config.end_date, config.unit, config.step);\n\t\t} else {\n\t\t\tres = this._getWorkUnitsBetweenGeneric(config.start_date, config.end_date, config.unit, config.step);\n\t\t}\n\n\t\t// getDuration.. returns decimal durations\n\t\treturn Math.round(res);\n\t},\n\thasDuration: function () {\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply( this.argumentsHelper, arguments);\n\n\t\tvar from = config.start_date,\n\t\t\tto = config.end_date,\n\t\t\tunit = config.unit,\n\t\t\tstep = config.step;\n\n\t\tif (!unit) {\n\t\t\treturn false;\n\t\t}\n\t\tvar start = new Date(from),\n\t\t\tend = new Date(to);\n\t\tstep = step || 1;\n\n\t\twhile (start.valueOf() < end.valueOf()) {\n\t\t\tif (this._isWorkTime(start, unit))\n\t\t\t\treturn true;\n\t\t\tstart = this._nextDate(start, unit, step);\n\t\t}\n\t\treturn false;\n\t},\n\n\tcalculateEndDate: function () {\n\t\tvar config = this.argumentsHelper.calculateEndDateArguments.apply( this.argumentsHelper, arguments);\n\n\t\tvar from = config.start_date,\n\t\t\tduration = config.duration,\n\t\t\tunit = config.unit,\n\t\t\tstep = config.step;\n\n\t\tvar mult = (config.duration >= 0) ? 1 : -1;\n\t\treturn this._calculateEndDate(from, duration, unit, step * mult);\n\t},\n\t_calculateEndDate: function (from, duration, unit, step) {\n\t\tif (!unit)\n\t\t\treturn false;\n\n\t\tvar start = new Date(from),\n\t\t\tadded = 0;\n\t\tstep = step || 1;\n\t\tduration = Math.abs(duration * 1);\n\n\t\twhile (added < duration) {\n\t\t\tvar next = this._nextDate(start, unit, step);\n\t\t\t//if(this.isWorkTime(step > 0 ? start : next, unit))\n\t\t\tif (this._isWorkTime(step > 0 ? new Date(next.valueOf() - 1) : new Date(next.valueOf() + 1), unit))\n\t\t\t\tadded++;\n\t\t\tstart = next;\n\t\t}\n\t\treturn start;\n\t},\n\n\tgetClosestWorkTime: function () {\n\t\tvar config = this.argumentsHelper.getClosestWorkTimeArguments.apply( this.argumentsHelper, arguments);\n\t\treturn this._getClosestWorkTime(config);\n\t},\n\n\t_getClosestWorkTime: function (settings) {\n\t\tif (this._isWorkTime(settings.date, settings.unit))\n\t\t\treturn settings.date;\n\n\t\tvar unit = settings.unit;\n\n\t\tvar curr = this.$gantt.date[unit + '_start'](settings.date);\n\n\t\tvar future_target = new Date(curr),\n\t\t\tprev_target = new Date(curr),\n\t\t\ttick = true,\n\t\t\tmaximum_loop = 3000,//be extra sure we won't fall into infinite loop, 3k seems big enough\n\t\t\tcount = 0,\n\t\t\tboth_directins = (settings.dir == 'any' || !settings.dir);\n\n\t\tvar inc = 1;\n\t\tif (settings.dir == 'past')\n\t\t\tinc = -1;\n\n\t\t//will seek closest working hour in future or in past, one step in one direction per iteration\n\t\twhile (!this._isWorkTime(curr, unit)) {\n\n\t\t\tif (both_directins) {\n\t\t\t\tcurr = tick ? future_target : prev_target;\n\t\t\t\tinc = inc * (-1);\n\t\t\t}\n\t\t\tvar tzOffset = curr.getTimezoneOffset();\n\t\t\tcurr = this.$gantt.date.add(curr, inc, unit);\n\n\t\t\tcurr = this.$gantt._correct_dst_change(curr, tzOffset, inc, unit);\n\t\t\tif (this.$gantt.date[unit + '_start'])\n\t\t\t\tcurr = this.$gantt.date[unit + '_start'](curr);\n\n\t\t\tif (both_directins) {\n\t\t\t\tif (tick) {\n\t\t\t\t\tfuture_target = curr;\n\t\t\t\t} else {\n\t\t\t\t\tprev_target = curr;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttick = !tick;\n\t\t\tcount++;\n\t\t\tif (count > maximum_loop) {\n\t\t\t\tthis.$gantt.assert(false, \"Invalid working time check\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (curr == prev_target || settings.dir == 'past') {\n\t\t\tcurr = this.$gantt.date.add(curr, 1, unit);\n\t\t}\n\n\t\treturn curr;\n\t}\n};\n\nmodule.exports = CalendarWorkTimeStrategy;\n\n/***/ }),\n/* 81 */\n/***/ (function(module, exports) {\n\nfunction WorkUnitsCache() {\n\tthis._cache = {};\n}\n\nWorkUnitsCache.prototype = {\n\t// cache previously calculated worktime\n\tget: function (unit, date) {\n\t\tvar result = -1;// default value (if not existed in the cache)\n\n\t\tvar cache = this._cache;\n\t\tif (cache && cache[unit]) {\n\t\t\tvar units = cache[unit];\n\t\t\tvar time = date.getTime();\n\t\t\tif (units[time] !== undefined)\n\t\t\t\tresult = units[time];\n\t\t}\n\t\treturn result;\n\t},\n\n\tput: function (unit, date, value) {\n\t\tif (!unit || !date) return false;\n\n\t\tvar cache = this._cache;\n\n\t\tvar time = date.getTime();\n\n\t\tvalue = !!value;\n\n\t\tif (!cache) return false;\n\t\tif (!cache[unit]) cache[unit] = {};\n\t\tcache[unit][time] = value;\n\t\treturn true;\n\t},\n\n\tclear: function () {\n\t\tthis._cache = {};\n\t}\n};\n\nmodule.exports = WorkUnitsCache;\n\n/***/ }),\n/* 82 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar createArgumentsHelper = __webpack_require__(19),\n\tNoWorkTimeCalendar = __webpack_require__(83);\n\nfunction TimeCalculator(calendarManager){\n\n\tthis.$gantt = calendarManager.$gantt;\n\tthis.argumentsHelper = createArgumentsHelper(this.$gantt);\n\tthis.calendarManager = calendarManager;\n\tthis.$disabledCalendar = new NoWorkTimeCalendar(this.$gantt, this.argumentsHelper);\n}\n\nTimeCalculator.prototype = {\n\t_getCalendar: function (config) {\n\t\tvar calendar;\n\t\tif (!this.$gantt.$services.config().work_time) {\n\t\t\tcalendar = this.$disabledCalendar;\n\t\t} else {\n\t\t\tvar manager = this.calendarManager;\n\t\t\tif (config.task) {\n\t\t\t\tcalendar = manager.getTaskCalendar(config.task);\n\t\t\t} else if (config.id) {\n\t\t\t\tcalendar = manager.getTaskCalendar(config);\n\t\t\t} else if (config.calendar) {\n\t\t\t\tcalendar = config.calendar;\n\t\t\t}\n\t\t\tif (!calendar) {\n\t\t\t\tcalendar = manager.getTaskCalendar();\n\t\t\t}\n\t\t}\n\t\treturn calendar;\n\t},\n\n\tgetWorkHours: function (config) {\n\t\tconfig = this.argumentsHelper.getWorkHoursArguments.apply(this.argumentsHelper, arguments);\n\n\t\tvar calendar = this._getCalendar(config);\n\n\t\treturn calendar.getWorkHours(config.date);\n\t},\n\n\tsetWorkTime: function (config, calendar) {\n\t\tconfig = this.argumentsHelper.setWorkTimeArguments.apply(this.argumentsHelper, arguments);\n\n\t\tif (!calendar)\n\t\t\tcalendar = this.calendarManager.getCalendar(); // Global\n\t\treturn calendar.setWorkTime(config);\n\t},\n\n\tunsetWorkTime: function (config, calendar) {\n\t\tconfig = this.argumentsHelper.unsetWorkTimeArguments.apply(this.argumentsHelper, arguments);\n\n\t\tif (!calendar)\n\t\t\tcalendar = this.calendarManager.getCalendar(); // Global\n\t\treturn calendar.unsetWorkTime(config);\n\t},\n\tisWorkTime: function (date, unit, task, calendar) {\n\t\tvar config = this.argumentsHelper.isWorkTimeArguments.apply(this.argumentsHelper, arguments);\n\n\t\tcalendar = this._getCalendar(config);\n\t\treturn calendar.isWorkTime(config);\n\t},\n\tgetClosestWorkTime: function (config) {\n\t\tconfig = this.argumentsHelper.getClosestWorkTimeArguments.apply(this.argumentsHelper, arguments);\n\n\t\tvar calendar = this._getCalendar(config);\n\n\t\treturn calendar.getClosestWorkTime(config);\n\t},\n\n\tcalculateDuration: function () { // start_date_date, end_date, task\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments);\n\n\n\t\tvar calendar = this._getCalendar(config);\n\t\treturn calendar.calculateDuration(config);\n\t},\n\thasDuration: function () {\n\t\tvar config = this.argumentsHelper.hasDurationArguments.apply(this.argumentsHelper, arguments);\n\n\t\tvar calendar = this._getCalendar(config);\n\n\t\treturn calendar.hasDuration(config);\n\t},\n\tcalculateEndDate: function (config) { // start_date, duration, unit, task\n\t\tvar config = this.argumentsHelper.calculateEndDateArguments.apply(this.argumentsHelper, arguments);\n\n\t\tvar calendar = this._getCalendar(config);\n\t\treturn calendar.calculateEndDate(config);\n\t}\n};\n\nmodule.exports = TimeCalculator;\n\n\n\n/***/ }),\n/* 83 */\n/***/ (function(module, exports) {\n\nfunction CalendarDisabledTimeStrategy(gantt, argumentsHelper){\n\tthis.argumentsHelper = argumentsHelper;\n\tthis.$gantt = gantt;\n}\n\nCalendarDisabledTimeStrategy.prototype = {\n\tgetWorkHours: function () {\n\t\treturn [0, 24];\n\t},\n\tsetWorkTime: function () {\n\t\treturn true;\n\t},\n\tunsetWorkTime: function () {\n\t\treturn true;\n\t},\n\tisWorkTime: function () {\n\t\treturn true;\n\t},\n\tgetClosestWorkTime: function (config) {\n\t\tvar config = this.argumentsHelper.getClosestWorkTimeArguments.apply(this.argumentsHelper, arguments);\n\t\treturn config.date;\n\t},\n\n\tcalculateDuration: function () {\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments);\n\t\tvar from = config.start_date,\n\t\t\tto = config.end_date,\n\t\t\tunit = config.unit,\n\t\t\tstep = config.step;\n\n\t\treturn this._calculateDuration(from, to, unit, step);\n\t},\n\t_calculateDuration: function (start, end, unit, step) {\n\t\tvar dateHelper = this.$gantt.date;\n\t\tvar fixedUnits = {\n\t\t\t\"week\": 1000 * 60 * 60 * 24 * 7,\n\t\t\t\"day\": 1000 * 60 * 60 * 24,\n\t\t\t\"hour\": 1000 * 60 * 60,\n\t\t\t\"minute\": 1000 * 60\n\t\t};\n\n\t\tvar res = 0;\n\t\tif (fixedUnits[unit]) {\n\t\t\tres = Math.round((end - start) / (step * fixedUnits[unit]));\n\t\t} else {\n\t\t\tvar from = new Date(start),\n\t\t\t\tto = new Date(end);\n\t\t\twhile (from.valueOf() < to.valueOf()) {\n\t\t\t\tres += 1;\n\t\t\t\tfrom = dateHelper.add(from, step, unit);\n\t\t\t}\n\n\t\t\tif (from.valueOf() != end.valueOf()) {\n\t\t\t\tres += (to - from) / (dateHelper.add(from, step, unit) - from);\n\t\t\t}\n\t\t}\n\n\t\treturn Math.round(res);\n\t},\n\n\thasDuration: function () {\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments);\n\t\tvar from = config.start_date,\n\t\t\tto = config.end_date,\n\t\t\tunit = config.unit,\n\t\t\tstep = config.step;\n\n\t\tif (!unit) {\n\t\t\treturn false;\n\t\t}\n\t\tfrom = new Date(from);\n\t\tto = new Date(to);\n\n\t\treturn (from.valueOf() < to.valueOf());\n\t},\n\n\tcalculateEndDate: function () {\n\t\tvar config = this.argumentsHelper.calculateEndDateArguments.apply(this.argumentsHelper, arguments);\n\n\t\tvar start = config.start_date,\n\t\t\tduration = config.duration,\n\t\t\tunit = config.unit,\n\t\t\tstep = config.step;\n\n\t\treturn this.$gantt.date.add(start, step * duration, unit);\n\t}\n};\n\nmodule.exports = CalendarDisabledTimeStrategy;\n\n/***/ }),\n/* 84 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// TODO: rework public api for date methods\nvar utils = __webpack_require__(0);\n\nvar createWorktimeFacade = function(calendarManager, timeCalculator){\n\treturn {\n\t\tgetWorkHours: function (date) {\n\t\t\treturn timeCalculator.getWorkHours(date);\n\t\t},\n\n\t\tsetWorkTime: function (config) {\n\t\t\treturn timeCalculator.setWorkTime(config);\n\t\t},\n\n\t\tunsetWorkTime: function (config) {\n\t\t\ttimeCalculator.unsetWorkTime(config);\n\t\t},\n\n\t\tisWorkTime: function (date, unit, task) {\n\t\t\treturn timeCalculator.isWorkTime(date, unit, task);\n\t\t},\n\n\t\tgetClosestWorkTime: function (config) {\n\t\t\treturn timeCalculator.getClosestWorkTime(config);\n\t\t},\n\n\t\tcalculateDuration: function (start_date, end_date, task) {\n\t\t\treturn timeCalculator.calculateDuration(start_date, end_date, task);\n\t\t},\n\t\t_hasDuration: function (start_date, end_date, task) {\n\t\t\treturn timeCalculator.hasDuration(start_date, end_date, task);\n\t\t},\n\n\t\tcalculateEndDate: function (start, duration, unit, task) {\n\t\t\treturn timeCalculator.calculateEndDate(start, duration, unit, task);\n\t\t},\n\n\t\tcreateCalendar: utils.bind(calendarManager.createCalendar, calendarManager),\n\t\taddCalendar: utils.bind(calendarManager.addCalendar, calendarManager),\n\t\tgetCalendar: utils.bind(calendarManager.getCalendar, calendarManager),\n\t\tgetCalendars: utils.bind(calendarManager.getCalendars, calendarManager),\n\t\tgetTaskCalendar: utils.bind(calendarManager.getTaskCalendar, calendarManager),\n\t\tdeleteCalendar: utils.bind(calendarManager.deleteCalendar, calendarManager)\n\t};\n};\n\n\nmodule.exports = { create: createWorktimeFacade };\n\n\n/***/ }),\n/* 85 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dateHelper = __webpack_require__(3),\n\thelpers = __webpack_require__(6);\n\nmodule.exports = function(gantt) {\n\n\tgantt.isUnscheduledTask = function (task) {\n\t\treturn (!!task.unscheduled || !task.start_date);\n\t};\n\n\tgantt._isAllowedUnscheduledTask = function (task) {\n\t\treturn !!(task.unscheduled && gantt.config.show_unscheduled);\n\t};\n\n\tgantt.isTaskVisible = function (id) {\n\t\tif (!this.isTaskExists(id))\n\t\t\treturn false;\n\n\t\tvar task = this.getTask(id),\n\t\t\ttype = this.getTaskType(task.type);\n\n\t\tif (!((+task.start_date <= +this._max_date && +task.end_date >= +this._min_date) || gantt._isAllowedUnscheduledTask(task))){\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !!(gantt.getGlobalTaskIndex(id) >= 0);\n\t};\n\n\tgantt._defaultTaskDate = function (item, parent_id) {\n\t\tvar parent = (parent_id && parent_id != this.config.root_id) ? this.getTask(parent_id) : false,\n\t\t\tstartDate = '';\n\t\tif (parent) {\n\t\t\tstartDate = parent.start_date;\n\t\t} else {\n\t\t\tvar first = this.getTaskByIndex(0);\n\t\t\tstartDate = first ? (first.start_date ? first.start_date : (first.end_date ? this.calculateEndDate({\n\t\t\t\tstart_date: first.end_date,\n\t\t\t\tduration: -this.config.duration_step\n\t\t\t}) : '')) : this.config.start_date || this.getState().min_date;\n\t\t}\n\t\tgantt.assert(startDate, \"Invalid dates\");\n\t\treturn new Date(startDate);\n\t};\n\n\tgantt._set_default_task_timing = function (task) {\n\t\ttask.start_date = task.start_date || gantt._defaultTaskDate(task, this.getParent(task));\n\t\ttask.duration = task.duration || this.config.duration_step;\n\t\ttask.end_date = task.end_date || this.calculateEndDate(task);\n\t};\n\n\tgantt.createTask = function (item, parent, index) {\n\t\titem = item || {};\n\t\tif (!gantt.defined(item.id))\n\t\t\titem.id = gantt.uid();\n\n\t\tif (!item.start_date) {\n\t\t\titem.start_date = gantt._defaultTaskDate(item, parent);\n\t\t}\n\t\tif (item.text === undefined) {\n\t\t\titem.text = gantt.locale.labels.new_task;\n\t\t}\n\t\tif (item.duration === undefined) {\n\t\t\titem.duration = 1;\n\t\t}\n\n\t\tif (parent) {\n\t\t\tthis.setParent(item, parent, true);\n\t\t\tvar parentObj = this.getTask(parent);\n\t\t\tparentObj.$open = true;\n\t\t}\n\n\t\tif (!this.callEvent(\"onTaskCreated\", [item])) {\n\t\t\treturn null;\n\t\t}\n\t\tif (this.config.details_on_create) {\n\t\t\titem.$new = true;\n\t\t\tthis.silent(function(){\n\t\t\t\tgantt.$data.tasksStore.addItem(item, index);\n\t\t\t});\n\t\t\tthis.selectTask(item.id);\n\t\t\tthis.refreshData();\n\t\t\tthis.showLightbox(item.id);\n\t\t} else {\n\t\t\tif (this.addTask(item, parent, index)) {\n\t\t\t\tthis.showTask(item.id);\n\t\t\t\tthis.selectTask(item.id);\n\t\t\t}\n\t\t}\n\t\treturn item.id;\n\t};\n\n\tgantt._update_flags = function (oldid, newid) {\n\t\t// TODO: need a proper way to update all possible flags\n\t\tvar store = gantt.$data.tasksStore;\n\t\tif (oldid === undefined) {\n\t\t\tthis._lightbox_id = null;\n\n\t\t\tstore.silent(function(){\n\t\t\t\tstore.unselect();\n\t\t\t});\n\n\t\t\tif (this._tasks_dnd && this._tasks_dnd.drag) {\n\t\t\t\tthis._tasks_dnd.drag.id = null;\n\t\t\t}\n\t\t} else {\n\t\t\tif (this._lightbox_id == oldid)\n\t\t\t\tthis._lightbox_id = newid;\n\n\t\t\tif (store.getSelectedId() == oldid) {\n\t\t\t\tstore.silent(function(){\n\t\t\t\t\tstore.unselect(oldid);\n\t\t\t\t\tstore.select(newid);\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (this._tasks_dnd && this._tasks_dnd.drag && this._tasks_dnd.drag.id == oldid) {\n\t\t\t\tthis._tasks_dnd.drag.id = newid;\n\t\t\t}\n\t\t}\n\t};\n\n\tgantt._get_task_timing_mode = function (task, force) {\n\t\tvar task_type = this.getTaskType(task.type);\n\n\t\tvar state = {\n\t\t\ttype: task_type,\n\t\t\t$no_start: false,\n\t\t\t$no_end: false\n\t\t};\n\n\t\tif (!force && task_type == task.$rendered_type) {\n\t\t\tstate.$no_start = task.$no_start;\n\t\t\tstate.$no_end = task.$no_end;\n\t\t\treturn state;\n\t\t}\n\n\t\tif (task_type == this.config.types.project) {\n\t\t\t//project duration is always defined by children duration\n\t\t\tstate.$no_end = state.$no_start = true;\n\t\t} else if (task_type != this.config.types.milestone) {\n\t\t\t//tasks can have fixed duration, children duration(as projects), or one date fixed, and other defined by nested items\n\t\t\tstate.$no_end = !(task.end_date || task.duration);\n\t\t\tstate.$no_start = !task.start_date;\n\n\t\t\tif (this._isAllowedUnscheduledTask(task)) {\n\t\t\t\tstate.$no_end = state.$no_start = false;\n\t\t\t}\n\t\t}\n\n\t\treturn state;\n\t};\n\n\tgantt._init_task_timing = function (task) {\n\t\tvar task_mode = gantt._get_task_timing_mode(task, true);\n\n\t\tvar dirty = task.$rendered_type != task_mode.type;\n\n\t\tvar task_type = task_mode.type;\n\n\t\tif (dirty) {\n\t\t\ttask.$no_start = task_mode.$no_start;\n\t\t\ttask.$no_end = task_mode.$no_end;\n\t\t\ttask.$rendered_type = task_mode.type;\n\t\t}\n\n\t\tif (dirty && task_type != this.config.types.milestone) {\n\t\t\tif (task_type == this.config.types.project) {\n\t\t\t\t//project duration is always defined by children duration\n\t\t\t\tthis._set_default_task_timing(task);\n\t\t\t}\n\t\t}\n\n\t\tif (task_type == this.config.types.milestone) {\n\t\t\ttask.end_date = task.start_date;\n\t\t}\n\t\tif (task.start_date && task.end_date) {\n\t\t\ttask.duration = this.calculateDuration(task);\n\t\t}\n\t\ttask.duration = task.duration || 0;\n\t};\n\n\tgantt.isSummaryTask = function (task) {\n\t\tvar mode = gantt._get_task_timing_mode(task);\n\n\t\treturn !!(mode.$no_end || mode.$no_start);\n\t};\n\n// downward calculation of project duration\n\tgantt.resetProjectDates = function (task) {\n\t\tvar taskMode = this._get_task_timing_mode(task);\n\t\tif (taskMode.$no_end || taskMode.$no_start) {\n\t\t\tvar dates = this.getSubtaskDates(task.id);\n\t\t\tthis._assign_project_dates(task, dates.start_date, dates.end_date);\n\t\t}\n\t};\n\n\tgantt.getSubtaskDuration = function (task_id) {\n\t\tvar res = 0,\n\t\t\troot = task_id !== undefined ? task_id : gantt.config.root_id;\n\n\t\tthis.eachTask(function (child) {\n\t\t\tif (this.getTaskType(child.type) == gantt.config.types.project || this.isUnscheduledTask(child))\n\t\t\t\treturn;\n\n\t\t\tres += child.duration;\n\t\t}, root);\n\n\t\treturn res;\n\t};\n\n\tgantt.getSubtaskDates = function (task_id) {\n\t\tvar min = null,\n\t\t\tmax = null,\n\t\t\troot = task_id !== undefined ? task_id : gantt.config.root_id;\n\n\t\tthis.eachTask(function (child) {\n\t\t\tif (this.getTaskType(child.type) == gantt.config.types.project || this.isUnscheduledTask(child))\n\t\t\t\treturn;\n\n\t\t\tif ((child.start_date && !child.$no_start) && (!min || min > child.start_date.valueOf()))\n\t\t\t\tmin = child.start_date.valueOf();\n\t\t\tif ((child.end_date && !child.$no_end) && (!max || max < child.end_date.valueOf()))\n\t\t\t\tmax = child.end_date.valueOf();\n\t\t}, root);\n\n\t\treturn {\n\t\t\tstart_date: min ? new Date(min) : null,\n\t\t\tend_date: max ? new Date(max) : null\n\t\t};\n\t};\n\n\tgantt._assign_project_dates = function (task, from, to) {\n\t\tvar taskTiming = this._get_task_timing_mode(task);\n\t\tif (taskTiming.$no_start) {\n\t\t\tif (from && from != Infinity) {\n\t\t\t\ttask.start_date = new Date(from);\n\t\t\t} else {\n\t\t\t\ttask.start_date = this._defaultTaskDate(task, this.getParent(task));\n\t\t\t}\n\t\t}\n\n\t\tif (taskTiming.$no_end) {\n\t\t\tif (to && to != -Infinity) {\n\t\t\t\ttask.end_date = new Date(to);\n\t\t\t} else {\n\t\t\t\ttask.end_date = this.calculateEndDate({\n\t\t\t\t\tstart_date: task.start_date,\n\t\t\t\t\tduration: this.config.duration_step,\n\t\t\t\t\ttask: task\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (taskTiming.$no_start || taskTiming.$no_end) {\n\t\t\tthis._init_task_timing(task);\n\t\t}\n\t};\n\n// upward calculation of project duration\n\tgantt._update_parents = function (taskId, silent) {\n\t\tif (!taskId) return;\n\n\t\tvar task = this.getTask(taskId);\n\t\tvar pid = this.getParent(task);\n\n\t\tvar taskTiming = this._get_task_timing_mode(task);\n\n\t\tvar has_changed = true;\n\n\t\tif (taskTiming.$no_start || taskTiming.$no_end) {\n\t\t\tvar oldStart = task.start_date.valueOf(),\n\t\t\t\toldEnd = task.end_date.valueOf();\n\n\t\t\tgantt.resetProjectDates(task);\n\n\t\t\t// not refresh parent projects if dates hasn't changed\n\t\t\tif (oldStart == task.start_date.valueOf() && oldEnd == task.end_date.valueOf()) {\n\t\t\t\thas_changed = false;\n\t\t\t}\n\n\t\t\tif (has_changed && !silent) {\n\t\t\t\tthis.refreshTask(task.id, true);\n\t\t\t}\n\t\t}\n\n\n\t\tif (has_changed && pid && this.isTaskExists(pid)) {\n\t\t\tthis._update_parents(pid, silent);\n\t\t}\n\t};\n\n\tgantt.roundDate = function (config) {\n\t\tif (dateHelper.isDate(config)) {\n\t\t\tconfig = {\n\t\t\t\tdate: config,\n\t\t\t\tunit: gantt.getScale().unit,\n\t\t\t\tstep: gantt.getScale().step\n\t\t\t};\n\t\t}\n\t\tvar date = config.date,\n\t\t\tsteps = config.step,\n\t\t\tunit = config.unit;\n\n\t\tvar scale = gantt.getScale();\n\t\tvar upper, lower, colIndex;\n\t\tif (unit == scale.unit && steps == scale.step &&\n\t\t\t+date >= +gantt._min_date && +date <= +gantt._max_date) {\n\t\t\t//find date in time scale config\n\t\t\tcolIndex = Math.floor(gantt.columnIndexByDate(date));\n\n\t\t\tif (!gantt.getScale().trace_x[colIndex]) {\n\t\t\t\tcolIndex -= 1;// end of time scale\n\t\t\t\tif(scale.rtl){\n\t\t\t\t\tcolIndex = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlower = new Date(gantt.getScale().trace_x[colIndex]);\n\t\t\tupper = gantt.date.add(lower, steps, unit);\n\t\t} else {\n\t\t\tcolIndex = Math.floor(gantt.columnIndexByDate(date));\n\n\t\t\tupper = gantt.date[unit + \"_start\"](new Date(this._min_date));\n\t\t\tif (scale.trace_x[colIndex]) {\n\t\t\t\tupper = gantt.date[unit + \"_start\"](scale.trace_x[colIndex]);// end of time scale\n\t\t\t}\n\n\t\t\twhile (+upper < +date) {\n\t\t\t\tupper = gantt.date[unit + \"_start\"](gantt.date.add(upper, steps, unit));\n\n\t\t\t\tvar tzOffset = upper.getTimezoneOffset();\n\n\t\t\t\tupper = gantt._correct_dst_change(upper, tzOffset, upper, unit);\n\t\t\t\tif (gantt.date[unit + '_start'])\n\t\t\t\t\tupper = gantt.date[unit + '_start'](upper);\n\t\t\t}\n\n\t\t\tlower = gantt.date.add(upper, -1 * steps, unit);\n\n\t\t}\n\t\tif (config.dir && config.dir == 'future')\n\t\t\treturn upper;\n\t\tif (config.dir && config.dir == 'past')\n\t\t\treturn lower;\n\n\t\tif (Math.abs(date - lower) < Math.abs(upper - date)) {\n\t\t\treturn lower;\n\t\t} else {\n\t\t\treturn upper;\n\t\t}\n\n\t};\n\n\tgantt.correctTaskWorkTime = function (task) {\n\t\tif (gantt.config.work_time && gantt.config.correct_work_time) {\n\t\t\tif (!this.isWorkTime(task.start_date, undefined, task)) {\n\t\t\t\ttask.start_date = this.getClosestWorkTime({date: task.start_date, dir: 'future', task: task});\n\t\t\t\ttask.end_date = this.calculateEndDate(task);\n\t\t\t} else if (!this.isWorkTime(new Date(+task.end_date - 1), undefined, task)) {\n\t\t\t\ttask.end_date = this.calculateEndDate(task);\n\t\t\t}\n\t\t}\n\t};\n\n\tgantt.attachEvent(\"onBeforeTaskUpdate\", function (id, task) {\n\t\tgantt._init_task_timing(task);\n\t\treturn true;\n\t});\n\tgantt.attachEvent(\"onBeforeTaskAdd\", function (id, task) {\n\t\tgantt._init_task_timing(task);\n\t\treturn true;\n\t});\n\n};\n\n/***/ }),\n/* 86 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = function(gantt) {\n\tvar domHelpers = __webpack_require__(1),\n\t\thelpers = __webpack_require__(6);\n\n\tgantt._lightbox_methods = {};\n\tgantt._lightbox_template = \"
\";\n\n\n\t//TODO: gantt._lightbox_id is changed from data.js and accessed from autoscheduling, check if it can be removed from gantt object\n\tvar state = gantt.$services.getService(\"state\");\n\tstate.registerProvider(\"lightbox\", function(){\n\t\treturn {\n\t\t\tlightbox: gantt._lightbox_id\n\t\t};\n\t});\n\n\tgantt.showLightbox = function (id) {\n\t\tif (!id || gantt.isReadonly(this.getTask(id))) return;\n\t\tif (!this.callEvent(\"onBeforeLightbox\", [id])) return;\n\n\t\tvar task = this.getTask(id);\n\n\t\tvar box = this.getLightbox(this.getTaskType(task.type));\n\t\tthis._center_lightbox(box);\n\t\tthis.showCover();\n\t\tthis._fill_lightbox(id, box);\n\n\t\tthis._waiAria.lightboxVisibleAttr(box);\n\n\t\tthis.callEvent(\"onLightbox\", [id]);\n\t};\n\n\tfunction _is_chart_visible(gantt) {\n\t\tvar timeline = gantt.$ui.getView(\"timeline\");\n\t\tif(timeline && timeline.isVisible()){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tgantt._get_timepicker_step = function () {\n\t\tif (this.config.round_dnd_dates) {\n\t\t\tvar scale = gantt.getScale(),\n\t\t\t\tstep = (helpers.getSecondsInUnit(scale.unit) * scale.step) / 60;//timepicker step is measured in minutes\n\t\t\tif (step >= 60 * 24 || !_is_chart_visible(this)) {\n\t\t\t\tstep = this.config.time_step;\n\t\t\t}\n\t\t\treturn step;\n\t\t}\n\t\treturn this.config.time_step;\n\t};\n\tgantt.getLabel = function (property, key) {\n\t\tvar sections = this._get_typed_lightbox_config();\n\t\tfor (var i = 0; i < sections.length; i++) {\n\t\t\tif (sections[i].map_to == property) {\n\t\t\t\tvar options = sections[i].options;\n\t\t\t\tfor (var j = 0; j < options.length; j++) {\n\t\t\t\t\tif (options[j].key == key) {\n\t\t\t\t\t\treturn options[j].label;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t};\n\n\tgantt.updateCollection = function (list_name, collection) {\n\t\tcollection = collection.slice(0);\n\t\tvar list = gantt.serverList(list_name);\n\t\tif (!list) return false;\n\t\tlist.splice(0, list.length);\n\t\tlist.push.apply(list, collection || []);\n\t\tgantt.resetLightbox();\n\t};\n\tgantt.getLightboxType = function () {\n\t\treturn this.getTaskType(this._lightbox_type);\n\t};\n\tgantt.getLightbox = function (type) {\n\t\tif (type === undefined)\n\t\t\ttype = this.getLightboxType();\n\n\t\tif (!this._lightbox || this.getLightboxType() != this.getTaskType(type)) {\n\t\t\tthis._lightbox_type = this.getTaskType(type);\n\t\t\tvar d = document.createElement(\"DIV\");\n\t\t\td.className = \"gantt_cal_light\";\n\n\t\t\tvar full_width = this._is_lightbox_timepicker();\n\t\t\tif (gantt.config.wide_form || full_width)\n\t\t\t\td.className += \" gantt_cal_light_wide\";\n\n\t\t\tif (full_width) {\n\t\t\t\tgantt.config.wide_form = true;\n\t\t\t\td.className += \" gantt_cal_light_full\";\n\t\t\t}\n\n\n\t\t\td.style.visibility = \"hidden\";\n\n\t\t\tvar html = this._lightbox_template;\n\n\t\t\tvar ariaAttr;\n\t\t\tvar buttons = this.config.buttons_left;\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\n\t\t\t\t// needed to migrate from 'dhx_something' to 'gantt_something' naming in a lightbox\n\t\t\t\tvar button = this.config._migrate_buttons[buttons[i]] ? this.config._migrate_buttons[buttons[i]] : buttons[i];\n\n\t\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(button);\n\t\t\t\thtml += \"\";\n\n\t\t\t}\n\t\t\tbuttons = this.config.buttons_right;\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\n\t\t\t\tvar button = this.config._migrate_buttons[buttons[i]] ? this.config._migrate_buttons[buttons[i]] : buttons[i];\n\t\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(button);\n\n\t\t\t\thtml += \"\";\n\n\t\t\t}\n\t\t\thtml += \"\";\n\t\t\td.innerHTML = html;\n\n\t\t\tgantt._waiAria.lightboxAttr(d);\n\n\t\t\tif (gantt.config.drag_lightbox) {\n\t\t\t\td.firstChild.onmousedown = gantt._ready_to_dnd;\n\t\t\t\td.firstChild.onselectstart = function () {\n\t\t\t\t\treturn false;\n\t\t\t\t};\n\t\t\t\td.firstChild.style.cursor = \"pointer\";\n\t\t\t\tgantt._init_dnd_events();\n\n\t\t\t}\n\n\t\t\tdocument.body.insertBefore(d, document.body.firstChild);\n\t\t\tthis._lightbox = d;\n\n\t\t\tvar sns = this._get_typed_lightbox_config(type);\n\t\t\thtml = this._render_sections(sns);\n\n\t\t\tvar ds = d.getElementsByTagName(\"div\");\n\t\t\tfor (var i = 0; i < ds.length; i++) {\n\t\t\t\tvar t_ds = ds[i];\n\t\t\t\tif (t_ds.className == \"gantt_cal_larea\") {\n\t\t\t\t\tt_ds.innerHTML = html;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// bind labels to lightbox inputs\n\t\t\tfor (var i = 0; i < sns.length; i++) {\n\t\t\t\tvar section = sns[i];\n\t\t\t\tif (!section.id || !document.getElementById(section.id))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar labelBlock = document.getElementById(section.id);\n\t\t\t\tvar label = labelBlock.querySelector(\"label\");\n\t\t\t\tvar inputBlock = labelBlock.nextSibling;\n\t\t\t\tif (!inputBlock)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar input = inputBlock.querySelector(\"input, select, textarea\");\n\t\t\t\tif (input) {\n\t\t\t\t\tsection.inputId = input.id || \"input_\" + gantt.uid();\n\t\t\t\t\tif (!input.id)\n\t\t\t\t\t\tinput.id = section.inputId;\n\n\t\t\t\t\tlabel.setAttribute(\"for\", section.inputId);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//sizes\n\t\t\tthis.resizeLightbox();\n\n\t\t\tthis._init_lightbox_events(this);\n\t\t\td.style.display = \"none\";\n\t\t\td.style.visibility = \"visible\";\n\t\t}\n\t\treturn this._lightbox;\n\t};\n\n\tgantt._render_sections = function (sns) {\n\t\tvar html = \"\";\n\t\tfor (var i = 0; i < sns.length; i++) {\n\t\t\tvar block = this.form_blocks[sns[i].type];\n\t\t\tif (!block) continue; //ignore incorrect blocks\n\t\t\tsns[i].id = \"area_\" + this.uid();\n\n\t\t\tvar display = sns[i].hidden ? \" style='display:none'\" : \"\";\n\t\t\tvar button = \"\";\n\t\t\tif (sns[i].button) {\n\t\t\t\tbutton = \"\";\n\t\t\t}\n\t\t\tif (this.config.wide_form) {\n\t\t\t\thtml += \"\";\n\t\t\t}\n\t\t\thtml += \"
\" + block.render.call(this, sns[i]);\n\t\t\thtml += \"
\";\n\t\t}\n\t\treturn html;\n\t};\n\n\n\tgantt.resizeLightbox = function () {\n\t\tvar d = this._lightbox;\n\t\tif (!d) return;\n\n\t\tvar con = d.childNodes[1];\n\t\tcon.style.height = \"0px\";\n\t\tcon.style.height = con.scrollHeight + \"px\";\n\t\td.style.height = con.scrollHeight + this.config.lightbox_additional_height + \"px\";\n\t\tcon.style.height = con.scrollHeight + \"px\"; //it is incredible , how ugly IE can be\n\n\n\t};\n\n\tgantt._center_lightbox = function (box) {\n\t\tif (box) {\n\t\t\tbox.style.display = \"block\";\n\n\t\t\tvar scroll_top = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;\n\t\t\tvar scroll_left = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;\n\n\t\t\tvar view_height = window.innerHeight || document.documentElement.clientHeight;\n\n\t\t\tif (scroll_top) // if vertical scroll on window\n\t\t\t\tbox.style.top = Math.round(scroll_top + Math.max((view_height - box.offsetHeight) / 2, 0)) + \"px\";\n\t\t\telse // vertical scroll on body\n\t\t\t\tbox.style.top = Math.round(Math.max(((view_height - box.offsetHeight) / 2), 0) + 9) + \"px\"; // +9 for compatibility with auto tests\n\n\t\t\t// not quite accurate but used for compatibility reasons\n\t\t\tif (document.documentElement.scrollWidth > document.body.offsetWidth) // if horizontal scroll on the window\n\t\t\t\tbox.style.left = Math.round(scroll_left + (document.body.offsetWidth - box.offsetWidth) / 2) + \"px\";\n\t\t\telse // horizontal scroll on the body\n\t\t\t\tbox.style.left = Math.round((document.body.offsetWidth - box.offsetWidth) / 2) + \"px\";\n\t\t}\n\t};\n\tgantt.showCover = function () {\n\t\tif (this._cover) return;\n\n\t\tthis._cover = document.createElement(\"DIV\");\n\t\tthis._cover.className = \"gantt_cal_cover\";\n\t\tvar _document_height = ((document.height !== undefined) ? document.height : document.body.offsetHeight);\n\t\tvar _scroll_height = ((document.documentElement) ? document.documentElement.scrollHeight : 0);\n\t\tthis._cover.style.height = Math.max(_document_height, _scroll_height) + 'px';\n\t\tdocument.body.appendChild(this._cover);\n\t};\n\n\n\tgantt._init_lightbox_events = function () {\n\t\tgantt.lightbox_events = {};\n\n\n\t\tgantt.lightbox_events[\"gantt_save_btn\"] = function (e) {\n\t\t\tgantt._save_lightbox();\n\t\t};\n\n\n\t\tgantt.lightbox_events[\"gantt_delete_btn\"] = function (e) {\n\t\t\tif (!gantt.callEvent(\"onLightboxDelete\", [gantt._lightbox_id]))\n\t\t\t\treturn;\n\n\t\t\tif (gantt.isTaskExists(gantt._lightbox_id)) {\n\t\t\t\tgantt.$click.buttons[\"delete\"](gantt._lightbox_id);\n\t\t\t} else {\n\t\t\t\tgantt.hideLightbox();\n\t\t\t}\n\n\t\t};\n\n\n\t\tgantt.lightbox_events[\"gantt_cancel_btn\"] = function (e) {\n\t\t\tgantt._cancel_lightbox();\n\t\t};\n\n\n\t\tgantt.lightbox_events[\"default\"] = function (e, src) {\n\t\t\tif (src.getAttribute(\"dhx_button\")) {\n\t\t\t\tgantt.callEvent(\"onLightboxButton\", [src.className, src, e]);\n\t\t\t} else {\n\t\t\t\tvar index, block, sec;\n\n\t\t\t\tvar className = domHelpers.getClassName(src);\n\t\t\t\tif (className.indexOf(\"gantt_custom_button\") != -1) {\n\t\t\t\t\tif (className.indexOf(\"gantt_custom_button_\") != -1) {\n\t\t\t\t\t\tindex = src.parentNode.getAttribute(\"index\");\n\t\t\t\t\t\tsec = src;\n\t\t\t\t\t\twhile (sec && domHelpers.getClassName(sec).indexOf(\"gantt_cal_lsection\") == -1) {\n\t\t\t\t\t\t\tsec = sec.parentNode;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tindex = src.getAttribute(\"index\");\n\t\t\t\t\t\tsec = src.parentNode;\n\t\t\t\t\t\tsrc = src.firstChild;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar sections = gantt._get_typed_lightbox_config();\n\n\t\t\t\tif (index) {\n\t\t\t\t\tindex = index * 1;\n\t\t\t\t\tblock = gantt.form_blocks[sections[index * 1].type];\n\t\t\t\t\tblock.button_click(index, src, sec, sec.nextSibling);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.event(gantt.getLightbox(), \"click\", function (e) {\n\t\t\te = e || window.event;\n\t\t\tvar src = e.target ? e.target : e.srcElement;\n\n\t\t\tvar className = domHelpers.getClassName(src);\n\t\t\tif (!className) {\n\t\t\t\tsrc = src.previousSibling;\n\t\t\t\tclassName = domHelpers.getClassName(src);\n\t\t\t}\n\t\t\tif (src && className && className.indexOf(\"gantt_btn_set\") === 0) {\n\t\t\t\tsrc = src.firstChild;\n\t\t\t\tclassName = domHelpers.getClassName(src);\n\t\t\t}\n\t\t\tif (src && className) {\n\t\t\t\tvar func = gantt.defined(gantt.lightbox_events[src.className]) ? gantt.lightbox_events[src.className] : gantt.lightbox_events[\"default\"];\n\t\t\t\treturn func(e, src);\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\n\t\tgantt.getLightbox().onkeydown = function (e) {\n\t\t\tvar event = e || window.event;\n\t\t\tvar target = e.target || e.srcElement;\n\t\t\tvar buttonTarget = !!(domHelpers.getClassName(target).indexOf(\"gantt_btn_set\") > -1);\n\n\t\t\tswitch ((e || event).keyCode) {\n\t\t\t\tcase 32: {//space\n\t\t\t\t\tif ((e || event).shiftKey) return;\n\t\t\t\t\tif (buttonTarget && target.click) {\n\t\t\t\t\t\ttarget.click();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase gantt.keys.edit_save:\n\t\t\t\t\tif ((e || event).shiftKey) return;\n\t\t\t\t\tif (buttonTarget && target.click) {\n\t\t\t\t\t\ttarget.click();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgantt._save_lightbox();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase gantt.keys.edit_cancel:\n\t\t\t\t\tgantt._cancel_lightbox();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t};\n\n\tgantt._cancel_lightbox = function () {\n\t\tvar task = this.getLightboxValues();\n\t\tthis.callEvent(\"onLightboxCancel\", [this._lightbox_id, task.$new]);\n\t\tif (gantt.isTaskExists(task.id) && task.$new) {\n\t\t\tthis.silent(function(){\n\t\t\t\tgantt.$data.tasksStore.removeItem(task.id);\n\t\t\t\tgantt._update_flags(task.id, null);\n\t\t\t});\n\t\t}\n\n\t\tthis.refreshData();\n\t\tthis.hideLightbox();\n\t};\n\n\tgantt._save_lightbox = function () {\n\t\tvar task = this.getLightboxValues();\n\t\tif (!this.callEvent(\"onLightboxSave\", [this._lightbox_id, task, !!task.$new]))\n\t\t\treturn;\n\n\t\tif (task.$new) {\n\t\t\tdelete task.$new;\n\t\t\tthis.addTask(task);\n\t\t}else if(this.isTaskExists(task.id)){\n\t\t\tthis.mixin(this.getTask(task.id), task, true);\n\t\t\tthis.refreshTask(task.id);\n\t\t\tthis.updateTask(task.id);\n\t\t}\n\t\tthis.refreshData();\n\n\t\t// TODO: do we need any blockable events here to prevent closing lightbox?\n\t\tthis.hideLightbox();\n\t};\n\n\tgantt._resolve_default_mapping = function (section) {\n\t\tvar mapping = section.map_to;\n\t\tvar time_controls = {\"time\": true, \"time_optional\": true, \"duration\": true, \"duration_optional\": true};\n\t\tif (time_controls[section.type]) {\n\t\t\tif (section.map_to == 'auto') {\n\t\t\t\tmapping = {start_date: \"start_date\", end_date: \"end_date\", duration: \"duration\"};\n\t\t\t} else if (typeof(section.map_to) === \"string\") {\n\t\t\t\tmapping = {start_date: section.map_to};\n\t\t\t}\n\t\t}\n\n\t\treturn mapping;\n\t};\n\n\tgantt.getLightboxValues = function () {\n\t\tvar task = {};\n\n\t\tif (gantt.isTaskExists(this._lightbox_id)) {\n\t\t\ttask = this.mixin({}, this.getTask(this._lightbox_id));\n\t\t}\n\n\t\tvar sns = this._get_typed_lightbox_config();\n\t\tfor (var i = 0; i < sns.length; i++) {\n\t\t\tvar node = document.getElementById(sns[i].id);\n\t\t\tnode = (node ? node.nextSibling : node);\n\t\t\tvar block = this.form_blocks[sns[i].type];\n\t\t\tif (!block) continue;\n\t\t\tvar res = block.get_value.call(this, node, task, sns[i]);\n\t\t\tvar map_to = gantt._resolve_default_mapping(sns[i]);\n\t\t\tif (typeof map_to == \"string\" && map_to != \"auto\") {\n\t\t\t\ttask[map_to] = res;\n\t\t\t} else if (typeof map_to == \"object\") {\n\t\t\t\tfor (var property in map_to) {\n\t\t\t\t\tif (map_to[property])\n\t\t\t\t\t\ttask[map_to[property]] = res[property];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn task;\n\t};\n\n\n\tgantt.hideLightbox = function () {\n\t\tvar box = this.getLightbox();\n\t\tif (box) box.style.display = \"none\";\n\n\t\tthis._waiAria.lightboxHiddenAttr(box);\n\t\tthis._lightbox_id = null;\n\n\t\tthis.hideCover();\n\t\tthis.callEvent(\"onAfterLightbox\", []);\n\t};\n\tgantt.hideCover = function () {\n\t\tif (this._cover)\n\t\t\tthis._cover.parentNode.removeChild(this._cover);\n\t\tthis._cover = null;\n\t};\n\n\tgantt.resetLightbox = function () {\n\t\tif (gantt._lightbox && !gantt._custom_lightbox)\n\t\t\tgantt._lightbox.parentNode.removeChild(gantt._lightbox);\n\t\tgantt._lightbox = null;\n\t};\n\tgantt._set_lightbox_values = function (data, box) {\n\t\tvar task = data;\n\t\tvar s = box.getElementsByTagName(\"span\");\n\t\tvar lightboxHeader = [];\n\t\tif (gantt.templates.lightbox_header) {\n\t\t\tlightboxHeader.push(\"\");\n\t\t\tlightboxHeader.push(gantt.templates.lightbox_header(task.start_date, task.end_date, task));\n\t\t\ts[1].innerHTML = \"\";\n\t\t\ts[2].innerHTML = gantt.templates.lightbox_header(task.start_date, task.end_date, task);\n\t\t} else {\n\t\t\tlightboxHeader.push(this.templates.task_time(task.start_date, task.end_date, task));\n\t\t\tlightboxHeader.push((this.templates.task_text(task.start_date, task.end_date, task) || \"\").substr(0, 70)); //IE6 fix\n\t\t\ts[1].innerHTML = this.templates.task_time(task.start_date, task.end_date, task);\n\t\t\ts[2].innerHTML = (this.templates.task_text(task.start_date, task.end_date, task) || \"\").substr(0, 70); //IE6 fix\n\t\t}\n\t\ts[1].innerHTML = lightboxHeader[0];\n\t\ts[2].innerHTML = lightboxHeader[1];\n\n\t\tgantt._waiAria.lightboxHeader(box, lightboxHeader.join(\" \"));\n\n\t\tvar sns = this._get_typed_lightbox_config(this.getLightboxType());\n\t\tfor (var i = 0; i < sns.length; i++) {\n\t\t\tvar section = sns[i];\n\n\t\t\tif (!this.form_blocks[section.type]) {\n\t\t\t\tcontinue;//skip incorrect sections, same check is done during rendering\n\t\t\t}\n\n\n\t\t\tvar node = document.getElementById(section.id).nextSibling;\n\t\t\tvar block = this.form_blocks[section.type];\n\t\t\tvar map_to = gantt._resolve_default_mapping(sns[i]);\n\t\t\tvar value = this.defined(task[map_to]) ? task[map_to] : section.default_value;\n\t\t\tblock.set_value.call(gantt, node, value, task, section);\n\n\t\t\tif (section.focus)\n\t\t\t\tblock.focus.call(gantt, node);\n\t\t}\n\t\tif (data.id)\n\t\t\tgantt._lightbox_id = data.id;\n\t};\n\tgantt._fill_lightbox = function (id, box) {\n\t\tvar task = this.getTask(id);\n\t\tthis._set_lightbox_values(task, box);\n\t};\n\n\n\tgantt.getLightboxSection = function (name) {\n\t\tvar config = this._get_typed_lightbox_config();\n\t\tvar i = 0;\n\t\tfor (i; i < config.length; i++)\n\t\t\tif (config[i].name == name)\n\t\t\t\tbreak;\n\t\tvar section = config[i];\n\t\tif (!section)\n\t\t\treturn null;\n\n\t\tif (!this._lightbox)\n\t\t\tthis.getLightbox();\n\t\tvar header = document.getElementById(section.id);\n\t\tvar node = header.nextSibling;\n\n\t\tvar result = {\n\t\t\tsection: section,\n\t\t\theader: header,\n\t\t\tnode: node,\n\t\t\tgetValue: function (ev) {\n\t\t\t\treturn gantt.form_blocks[section.type].get_value.call(gantt, node, (ev || {}), section);\n\t\t\t},\n\t\t\tsetValue: function (value, ev) {\n\t\t\t\treturn gantt.form_blocks[section.type].set_value.call(gantt, node, value, (ev || {}), section);\n\t\t\t}\n\t\t};\n\n\t\tvar handler = this._lightbox_methods[\"get_\" + section.type + \"_control\"];\n\t\treturn handler ? handler(result) : result;\n\t};\n\n\tgantt._lightbox_methods.get_template_control = function (result) {\n\t\tresult.control = result.node;\n\t\treturn result;\n\t};\n\tgantt._lightbox_methods.get_select_control = function (result) {\n\t\tresult.control = result.node.getElementsByTagName('select')[0];\n\t\treturn result;\n\t};\n\tgantt._lightbox_methods.get_textarea_control = function (result) {\n\t\tresult.control = result.node.getElementsByTagName('textarea')[0];\n\t\treturn result;\n\t};\n\tgantt._lightbox_methods.get_time_control = function (result) {\n\t\tresult.control = result.node.getElementsByTagName('select'); // array\n\t\treturn result;\n\t};\n\n\n\tgantt._init_dnd_events = function () {\n\t\tthis.event(document.body, \"mousemove\", gantt._move_while_dnd);\n\t\tthis.event(document.body, \"mouseup\", gantt._finish_dnd);\n\t\tgantt._init_dnd_events = function () {\n\t\t};\n\t};\n\tgantt._move_while_dnd = function (e) {\n\t\tif (gantt._dnd_start_lb) {\n\t\t\tif (!document.gantt_unselectable) {\n\t\t\t\tdocument.body.className += \" gantt_unselectable\";\n\t\t\t\tdocument.gantt_unselectable = true;\n\t\t\t}\n\t\t\tvar lb = gantt.getLightbox();\n\t\t\tvar now = (e && e.target) ? [e.pageX, e.pageY] : [event.clientX, event.clientY];\n\t\t\tlb.style.top = gantt._lb_start[1] + now[1] - gantt._dnd_start_lb[1] + \"px\";\n\t\t\tlb.style.left = gantt._lb_start[0] + now[0] - gantt._dnd_start_lb[0] + \"px\";\n\t\t}\n\t};\n\tgantt._ready_to_dnd = function (e) {\n\t\tvar lb = gantt.getLightbox();\n\t\tgantt._lb_start = [parseInt(lb.style.left, 10), parseInt(lb.style.top, 10)];\n\t\tgantt._dnd_start_lb = (e && e.target) ? [e.pageX, e.pageY] : [event.clientX, event.clientY];\n\t};\n\tgantt._finish_dnd = function () {\n\t\tif (gantt._lb_start) {\n\t\t\tgantt._lb_start = gantt._dnd_start_lb = false;\n\t\t\tdocument.body.className = document.body.className.replace(\" gantt_unselectable\", \"\");\n\t\t\tdocument.gantt_unselectable = false;\n\t\t}\n\t};\n\n\n\tgantt._focus = function (node, select) {\n\t\tif (node && node.focus) {\n\t\t\tif (gantt.config.touch) {\n\t\t\t\t//do not focus editor, to prevent auto-zoom\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tif (select && node.select) node.select();\n\t\t\t\t\tnode.focus();\n\t\t\t\t} catch (e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\n\tgantt.form_blocks = {\n\t\tgetTimePicker: function (sns, hidden) {\n\t\t\tvar time_format = sns.time_format;\n\t\t\tif (!time_format) {\n\t\t\t\t// default order\n\t\t\t\tvar time_format = [\"%d\", \"%m\", \"%Y\"];\n\t\t\t\tif (helpers.getSecondsInUnit(gantt.getScale().unit) < helpers.getSecondsInUnit(\"day\")) {\n\t\t\t\t\ttime_format.push(\"%H:%i\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// map: default order => real one\n\t\t\tsns._time_format_order = {size: 0};\n\n\n\t\t\tvar cfg = this.config;\n\t\t\tvar dt = this.date.date_part(new Date(gantt._min_date.valueOf()));\n\t\t\tvar last = 24 * 60, first = 0;\n\t\t\tif (gantt.config.limit_time_select) {\n\t\t\t\tlast = 60 * cfg.last_hour + 1;\n\t\t\t\tfirst = 60 * cfg.first_hour;\n\t\t\t\tdt.setHours(cfg.first_hour);\n\t\t\t}\n\t\t\tvar html = \"\";\n\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\n\t\t\t\tvar time_option = time_format[p];\n\n\t\t\t\t// adding spaces between selects\n\t\t\t\tif (p > 0) {\n\t\t\t\t\thtml += \" \";\n\t\t\t\t}\n\n\t\t\t\tvar options = '';\n\t\t\t\tswitch (time_option) {\n\t\t\t\t\tcase \"%Y\":\n\t\t\t\t\t\tsns._time_format_order[2] = p;\n\t\t\t\t\t\tsns._time_format_order.size++;\n\t\t\t\t\t\t//year\n\n\t\t\t\t\t\tvar range, offset, start_year, end_year;\n\n\t\t\t\t\t\tif (sns.year_range) {\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\n\t\t\t\t\t\t\t\trange = sns.year_range;\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\n\t\t\t\t\t\t\t\t// if\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trange = range || 10;\n\t\t\t\t\t\toffset = offset || Math.floor(range / 2);\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\n\t\t\t\t\t\tend_year = end_year || start_year + range;\n\n\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\n\t\t\t\t\t\t\toptions += \"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%m\":\n\t\t\t\t\t\tsns._time_format_order[1] = p;\n\t\t\t\t\t\tsns._time_format_order.size++;\n\t\t\t\t\t\t//month\n\t\t\t\t\t\tfor (var i = 0; i < 12; i++)\n\t\t\t\t\t\t\toptions += \"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%d\":\n\t\t\t\t\t\tsns._time_format_order[0] = p;\n\t\t\t\t\t\tsns._time_format_order.size++;\n\t\t\t\t\t\t//days\n\t\t\t\t\t\tfor (var i = 1; i < 32; i++)\n\t\t\t\t\t\t\toptions += \"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%H:%i\":\n\t\t\t\t\t\t// var last = 24*60, first = 0;\n\t\t\t\t\t\tsns._time_format_order[3] = p;\n\t\t\t\t\t\tsns._time_format_order.size++;\n\t\t\t\t\t\t//hours\n\t\t\t\t\t\tvar i = first;\n\t\t\t\t\t\tvar tdate = dt.getDate();\n\t\t\t\t\t\tsns._time_values = [];\n\n\t\t\t\t\t\twhile (i < last) {\n\t\t\t\t\t\t\tvar time = this.templates.time_picker(dt);\n\t\t\t\t\t\t\toptions += \"\";\n\t\t\t\t\t\t\tsns._time_values.push(i);\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf() + this._get_timepicker_step() * 60 * 1000);\n\t\t\t\t\t\t\tvar diff = (dt.getDate() != tdate) ? 1 : 0; // moved or not to the next day\n\t\t\t\t\t\t\ti = diff * 24 * 60 + dt.getHours() * 60 + dt.getMinutes();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (options) {\n\n\t\t\t\t\tvar ariaAttrs = gantt._waiAria.lightboxSelectAttrString(time_option);\n\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\n\t\t\t\t\tvar display = hidden ? \" style='display:none' \" : \"\";\n\t\t\t\t\thtml += \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn html;\n\t\t},\n\t\t_fill_lightbox_select: function (s, i, d, map, cfg) {\n\t\t\ts[i + map[0]].value = d.getDate();\n\t\t\ts[i + map[1]].value = d.getMonth();\n\t\t\ts[i + map[2]].value = d.getFullYear();\n\t\t\tif (gantt.defined(map[3])) {\n\t\t\t\tvar v = d.getHours() * 60 + d.getMinutes();\n\t\t\t\tv = Math.round(v / gantt._get_timepicker_step()) * gantt._get_timepicker_step();\n\t\t\t\tvar input = s[i + map[3]];\n\t\t\t\tinput.value = v;\n\t\t\t\t//in case option not shown\n\t\t\t\tinput.setAttribute('data-value', v);\n\t\t\t}\n\t\t},\n\t\ttemplate: {\n\t\t\trender: function (sns) {\n\t\t\t\tvar height = (sns.height || \"30\") + \"px\";\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tset_value: function (node, value, ev, config) {\n\t\t\t\tnode.innerHTML = value || \"\";\n\t\t\t},\n\t\t\tget_value: function (node, ev, config) {\n\t\t\t\treturn node.innerHTML || \"\";\n\t\t\t},\n\t\t\tfocus: function (node) {\n\t\t\t}\n\t\t},\n\t\ttextarea: {\n\t\t\trender: function (sns) {\n\t\t\t\tvar height = (sns.height || \"130\") + \"px\";\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tset_value: function (node, value, ev) {\n\t\t\t\tthis.form_blocks.textarea._get_input(node).value = value || \"\";\n\t\t\t},\n\t\t\tget_value: function (node, ev) {\n\t\t\t\treturn this.form_blocks.textarea._get_input(node).value;\n\t\t\t},\n\t\t\tfocus: function (node) {\n\t\t\t\tvar a = this.form_blocks.textarea._get_input(node);\n\t\t\t\tgantt._focus(a, true);\n\t\t\t},\n\t\t\t_get_input: function (node) {\n\t\t\t\treturn node.querySelector(\"textarea\");\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\trender: function (sns) {\n\t\t\t\tvar height = (sns.height || \"23\") + \"px\";\n\t\t\t\tvar html = \"\";\n\t\t\t\treturn html;\n\t\t\t},\n\t\t\tset_value: function (node, value, ev, sns) {\n\t\t\t\tvar select = node.firstChild;\n\t\t\t\tif (!select._dhx_onchange && sns.onchange) {\n\t\t\t\t\tselect.onchange = sns.onchange;\n\t\t\t\t\tselect._dhx_onchange = true;\n\t\t\t\t}\n\t\t\t\tif (typeof value == \"undefined\")\n\t\t\t\t\tvalue = (select.options[0] || {}).value;\n\t\t\t\tselect.value = value || \"\";\n\t\t\t},\n\t\t\tget_value: function (node, ev) {\n\t\t\t\treturn node.firstChild.value;\n\t\t\t},\n\t\t\tfocus: function (node) {\n\t\t\t\tvar a = node.firstChild;\n\t\t\t\tgantt._focus(a, true);\n\t\t\t}\n\t\t},\n\t\ttime: {\n\t\t\trender: function (sns) {\n\t\t\t\tvar time = this.form_blocks.getTimePicker.call(this, sns);\n\t\t\t\tvar parts = [\"\"];\n\t\t\t\tparts.push(time);\n\n\t\t\t\tif (sns.single_date) {\n\t\t\t\t\ttime = this.form_blocks.getTimePicker.call(this, sns, true);\n\t\t\t\t\tparts.push(\"\");\n\t\t\t\t} else {\n\t\t\t\t\tparts.push(\" – \");\n\t\t\t\t}\n\n\t\t\t\tparts.push(time);\n\t\t\t\tparts.push(\"
\");\n\t\t\t\treturn parts.join('');\n\t\t\t},\n\t\t\tset_value: function (node, value, ev, config) {\n\t\t\t\tvar cfg = config;\n\t\t\t\tvar s = node.getElementsByTagName(\"select\");\n\n\t\t\t\tvar map = config._time_format_order;\n\t\t\t\tvar map_size = config._time_format_size;\n\n\t\t\t\tif (cfg.auto_end_date) {\n\t\t\t\t\tvar _update_lightbox_select = function () {\n\t\t\t\t\t\tstart_date = new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, 0, 0);\n\t\t\t\t\t\tend_date = gantt.calculateEndDate({start_date: start_date, duration: 1, task: ev});\n\t\t\t\t\t\tthis.form_blocks._fill_lightbox_select(s, map.size, end_date, map, cfg);\n\t\t\t\t\t};\n\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\ts[i].onchange = _update_lightbox_select;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar mapping = gantt._resolve_default_mapping(config);\n\n\t\t\t\tif (typeof(mapping) === \"string\") mapping = {start_date: mapping};\n\n\t\t\t\tvar start_date = ev[mapping.start_date] || new Date();\n\t\t\t\tvar end_date = ev[mapping.end_date] || gantt.calculateEndDate({\n\t\t\t\t\tstart_date: start_date,\n\t\t\t\t\tduration: 1,\n\t\t\t\t\ttask: ev\n\t\t\t\t});\n\n\t\t\t\tthis.form_blocks._fill_lightbox_select(s, 0, start_date, map, cfg);\n\t\t\t\tthis.form_blocks._fill_lightbox_select(s, map.size, end_date, map, cfg);\n\t\t\t},\n\n\t\t\tget_value: function (node, ev, config) {\n\t\t\t\tvar s = node.getElementsByTagName(\"select\");\n\t\t\t\tvar map = config._time_format_order;\n\n\t\t\t\tvar hours = 0, minutes = 0;\n\t\t\t\tif (gantt.defined(map[3])) {\n\t\t\t\t\tvar time = parseInt(s[map[3]].value, 10);\n\t\t\t\t\thours = Math.floor(time / 60);\n\t\t\t\t\tminutes = time % 60;\n\t\t\t\t}\n\t\t\t\tvar start_date = new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, hours, minutes);\n\n\t\t\t\thours = minutes = 0;\n\t\t\t\tif (gantt.defined(map[3])) {\n\t\t\t\t\tvar time = parseInt(s[map.size + map[3]].value, 10);\n\t\t\t\t\thours = Math.floor(time / 60);\n\t\t\t\t\tminutes = time % 60;\n\t\t\t\t}\n\t\t\t\tvar end_date = new Date(s[map[2] + map.size].value, s[map[1] + map.size].value, s[map[0] + map.size].value, hours, minutes);\n\n\t\t\t\tif (end_date <= start_date)\n\t\t\t\t\tend_date = gantt.date.add(start_date, gantt._get_timepicker_step(), \"minute\");\n\n\t\t\t\tvar mapped_fields = gantt._resolve_default_mapping(config);\n\n\t\t\t\tvar res = {\n\t\t\t\t\tstart_date: new Date(start_date),\n\t\t\t\t\tend_date: new Date(end_date)\n\t\t\t\t};\n\t\t\t\tif (typeof mapped_fields == \"string\") {\n\t\t\t\t\treturn res.start_date;\n\t\t\t\t} else {\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t},\n\t\t\tfocus: function (node) {\n\t\t\t\tgantt._focus(node.getElementsByTagName(\"select\")[0]);\n\t\t\t}\n\t\t},\n\t\tduration: {\n\t\t\trender: function (sns) {\n\t\t\t\tvar time = this.form_blocks.getTimePicker.call(this, sns);\n\t\t\t\ttime = \"\" + time + \"
\";\n\t\t\t\tvar label = this.locale.labels[this.config.duration_unit + \"s\"];\n\n\t\t\t\tvar singleDate = sns.single_date ? ' style=\"display:none\"' : \"\";\n\t\t\t\tvar readonly = sns.readonly ? \" disabled='disabled'\" : \"\";\n\n\t\t\t\tvar ariaAttr = this._waiAria.lightboxDurationInputAttrString(sns);\n\n\t\t\t\tvar duration = \"\" +\n\t\t\t\t\t\"\" +\n\t\t\t\t\t\"\" +\n\t\t\t\t\t\" \" + label + \" \" +\n\t\t\t\t\t\"
\";\n\t\t\t\tvar html = \"\" + time + \" \" + duration + \"
\";\n\t\t\t\treturn html;\n\t\t\t},\n\t\t\tset_value: function (node, value, ev, config) {\n\t\t\t\tvar cfg = config;\n\t\t\t\tvar s = node.getElementsByTagName(\"select\");\n\t\t\t\tvar inps = node.getElementsByTagName(\"input\");\n\n\t\t\t\tvar duration = inps[1];\n\t\t\t\tvar btns = [inps[0], inps[2]];\n\t\t\t\tvar endspan = node.getElementsByTagName(\"span\")[0];\n\n\t\t\t\tvar map = config._time_format_order;\n\n\t\t\t\tfunction _calc_date() {\n\t\t\t\t\tvar start_date = gantt.form_blocks.duration._get_start_date.call(gantt, node, config);\n\t\t\t\t\tvar duration = gantt.form_blocks.duration._get_duration.call(gantt, node, config);\n\t\t\t\t\tvar end_date = gantt.calculateEndDate({start_date: start_date, duration: duration, task: ev});\n\n\t\t\t\t\tendspan.innerHTML = gantt.templates.task_date(end_date);\n\t\t\t\t}\n\n\t\t\t\tfunction _change_duration(step) {\n\t\t\t\t\tvar value = duration.value;\n\t\t\t\t\tvalue = parseInt(value, 10);\n\t\t\t\t\tif (window.isNaN(value))\n\t\t\t\t\t\tvalue = 0;\n\t\t\t\t\tvalue += step;\n\t\t\t\t\tif (value < 1) value = 1;\n\t\t\t\t\tduration.value = value;\n\t\t\t\t\t_calc_date();\n\t\t\t\t}\n\n\t\t\t\tbtns[0].onclick = gantt.bind(function () {\n\t\t\t\t\t_change_duration(-1 * this.config.duration_step);\n\t\t\t\t}, this);\n\t\t\t\tbtns[1].onclick = gantt.bind(function () {\n\t\t\t\t\t_change_duration(1 * this.config.duration_step);\n\t\t\t\t}, this);\n\t\t\t\ts[0].onchange = _calc_date;\n\t\t\t\ts[1].onchange = _calc_date;\n\t\t\t\ts[2].onchange = _calc_date;\n\t\t\t\tif (s[3]) s[3].onchange = _calc_date;\n\t\t\t\tduration.onkeydown = gantt.bind(function (e) {\n\t\t\t\t\te = e || window.event;\n\t\t\t\t\t// up\n\t\t\t\t\tvar code = (e.charCode || e.keyCode || e.which);\n\n\t\t\t\t\tif (code == 40) {\n\t\t\t\t\t\t_change_duration(-1 * this.config.duration_step);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t// down\n\t\t\t\t\tif (code == 38) {\n\t\t\t\t\t\t_change_duration(1 * this.config.duration_step);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\twindow.setTimeout(function (e) {\n\t\t\t\t\t\t_calc_date();\n\t\t\t\t\t}, 1);\n\t\t\t\t}, this);\n\n\t\t\t\tduration.onchange = gantt.bind(function (e) {\n\t\t\t\t\t_calc_date();\n\t\t\t\t}, this);\n\n\t\t\t\tvar mapping = gantt._resolve_default_mapping(config);\n\t\t\t\tif (typeof(mapping) === \"string\") mapping = {start_date: mapping};\n\n\t\t\t\tvar start_date = ev[mapping.start_date] || new Date();\n\t\t\t\tvar end_date = ev[mapping.end_date] || gantt.calculateEndDate({\n\t\t\t\t\tstart_date: start_date,\n\t\t\t\t\tduration: 1,\n\t\t\t\t\ttask: ev\n\t\t\t\t});\n\t\t\t\tvar duration_val = Math.round(ev[mapping.duration]) || gantt.calculateDuration({\n\t\t\t\t\tstart_date: start_date,\n\t\t\t\t\tend_date: end_date,\n\t\t\t\t\ttask: ev\n\t\t\t\t});\n\n\t\t\t\tgantt.form_blocks._fill_lightbox_select(s, 0, start_date, map, cfg);\n\t\t\t\tduration.value = duration_val;\n\t\t\t\t_calc_date();\n\t\t\t},\n\n\t\t\t_get_start_date: function (node, config) {\n\t\t\t\tvar s = node.getElementsByTagName(\"select\");\n\t\t\t\tvar map = config._time_format_order;\n\t\t\t\tvar hours = 0;\n\t\t\t\tvar minutes = 0;\n\t\t\t\tif (gantt.defined(map[3])) {\n\t\t\t\t\tvar input = s[map[3]];\n\t\t\t\t\tvar time = parseInt(input.value, 10);\n\t\t\t\t\tif (isNaN(time) && input.hasAttribute(\"data-value\")) {\n\t\t\t\t\t\ttime = parseInt(input.getAttribute(\"data-value\"), 10);\n\t\t\t\t\t}\n\n\t\t\t\t\thours = Math.floor(time / 60);\n\t\t\t\t\tminutes = time % 60;\n\t\t\t\t}\n\t\t\t\treturn new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, hours, minutes);\n\t\t\t},\n\t\t\t_get_duration: function (node, config) {\n\t\t\t\tvar duration = node.getElementsByTagName(\"input\")[1];\n\t\t\t\tduration = parseInt(duration.value, 10);\n\t\t\t\tif (!duration || window.isNaN(duration)) duration = 1;\n\t\t\t\tif (duration < 0) duration *= -1;\n\t\t\t\treturn duration;\n\t\t\t},\n\n\t\t\tget_value: function (node, ev, config) {\n\t\t\t\tvar start_date = gantt.form_blocks.duration._get_start_date(node, config);\n\t\t\t\tvar duration = gantt.form_blocks.duration._get_duration(node, config);\n\n\t\t\t\tvar end_date = gantt.calculateEndDate({start_date: start_date, duration: duration, task: ev});\n\t\t\t\tvar mapped_fields = gantt._resolve_default_mapping(config);\n\t\t\t\tvar res = {\n\t\t\t\t\tstart_date: new Date(start_date),\n\t\t\t\t\tend_date: new Date(end_date),\n\t\t\t\t\tduration: duration\n\t\t\t\t};\n\t\t\t\tif (typeof mapped_fields == \"string\") {\n\t\t\t\t\treturn res.start_date;\n\t\t\t\t} else {\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t},\n\t\t\tfocus: function (node) {\n\t\t\t\tgantt._focus(node.getElementsByTagName(\"select\")[0]);\n\t\t\t}\n\t\t},\n\t\tparent: {\n\t\t\t_filter: function (options, config, item_id) {\n\t\t\t\tvar filter = config.filter || function () {\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\toptions = options.slice(0);\n\n\t\t\t\tfor (var i = 0; i < options.length; i++) {\n\t\t\t\t\tvar task = options[i];\n\t\t\t\t\tif (task.id == item_id || gantt.isChildOf(task.id, item_id) || filter(task.id, task) === false) {\n\t\t\t\t\t\toptions.splice(i, 1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn options;\n\t\t\t},\n\n\t\t\t_display: function (config, item_id) {\n\t\t\t\tvar tasks = [],\n\t\t\t\t\toptions = [];\n\t\t\t\tif (item_id) {\n\t\t\t\t\ttasks = gantt.getTaskByTime();\n\t\t\t\t\tif (config.allow_root) {\n\t\t\t\t\t\ttasks.unshift({id: gantt.config.root_id, text: config.root_label || \"\"});\n\t\t\t\t\t}\n\t\t\t\t\ttasks = this._filter(tasks, config, item_id);\n\t\t\t\t\tif (config.sort) {\n\t\t\t\t\t\ttasks.sort(config.sort);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar text = config.template || gantt.templates.task_text;\n\t\t\t\tfor (var i = 0; i < tasks.length; i++) {\n\t\t\t\t\tvar label = text.apply(gantt, [tasks[i].start_date, tasks[i].end_date, tasks[i]]);\n\t\t\t\t\tif (label === undefined) {\n\t\t\t\t\t\tlabel = \"\";\n\t\t\t\t\t}\n\t\t\t\t\toptions.push({\n\t\t\t\t\t\tkey: tasks[i].id,\n\t\t\t\t\t\tlabel: label\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconfig.options = options;\n\t\t\t\tconfig.map_to = config.map_to || \"parent\";\n\t\t\t\treturn gantt.form_blocks.select.render.apply(this, arguments);\n\t\t\t},\n\t\t\trender: function (sns) {\n\t\t\t\treturn gantt.form_blocks.parent._display(sns, false);\n\t\t\t},\n\t\t\tset_value: function (node, value, ev, config) {\n\t\t\t\tvar tmpDom = document.createElement(\"div\");\n\t\t\t\ttmpDom.innerHTML = gantt.form_blocks.parent._display(config, ev.id);\n\t\t\t\tvar newOptions = tmpDom.removeChild(tmpDom.firstChild);\n\t\t\t\tnode.onselect = null;\n\t\t\t\tnode.parentNode.replaceChild(newOptions, node);\n\n\t\t\t\treturn gantt.form_blocks.select.set_value.apply(gantt, [newOptions, value, ev, config]);\n\t\t\t},\n\t\t\tget_value: function () {\n\t\t\t\treturn gantt.form_blocks.select.get_value.apply(gantt, arguments);\n\t\t\t},\n\t\t\tfocus: function () {\n\t\t\t\treturn gantt.form_blocks.select.focus.apply(gantt, arguments);\n\t\t\t}\n\t\t}\n\t};\n\n\tgantt._is_lightbox_timepicker = function () {\n\t\tvar s = this._get_typed_lightbox_config();\n\t\tfor (var i = 0; i < s.length; i++)\n\t\t\tif (s[i].name == \"time\" && s[i].type == \"time\")\n\t\t\t\treturn true;\n\t\treturn false;\n\t};\n\n\tgantt._dhtmlx_confirm = function (message, title, callback, ok) {\n\t\tif (!message)\n\t\t\treturn callback();\n\t\tvar opts = {text: message};\n\t\tif (title)\n\t\t\topts.title = title;\n\t\tif (ok) {\n\t\t\topts.ok = ok;\n\t\t}\n\t\tif (callback) {\n\t\t\topts.callback = function (result) {\n\t\t\t\tif (result)\n\t\t\t\t\tcallback();\n\t\t\t};\n\t\t}\n\t\tgantt.confirm(opts);\n\t};\n\n\tfunction _get_type_name(type_value) {\n\t\tfor (var i in this.config.types) {\n\t\t\tif (this.config.types[i] == type_value) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn \"task\";\n\t}\n\n\tgantt._get_typed_lightbox_config = function (type) {\n\t\tif (type === undefined) {\n\t\t\ttype = this.getLightboxType();\n\t\t}\n\n\t\tvar field = _get_type_name.call(this, type);\n\n\t\tif (gantt.config.lightbox[field + \"_sections\"]) {\n\t\t\treturn gantt.config.lightbox[field + \"_sections\"];\n\t\t} else {\n\t\t\treturn gantt.config.lightbox.sections;\n\t\t}\n\t};\n\n\tgantt._silent_redraw_lightbox = function (type) {\n\t\tvar oldType = this.getLightboxType();\n\n\t\tif (this.getState().lightbox) {\n\t\t\tvar taskId = this.getState().lightbox;\n\t\t\tvar formData = this.getLightboxValues(),\n\t\t\t\ttask = this.copy(this.getTask(taskId));\n\n\t\t\tthis.resetLightbox();\n\n\t\t\tvar updTask = this.mixin(task, formData, true);\n\t\t\tvar box = this.getLightbox(type ? type : undefined);\n\t\t\tthis._center_lightbox(this.getLightbox());\n\t\t\tthis._set_lightbox_values(updTask, box);\n\t\t} else {\n\t\t\tthis.resetLightbox();\n\t\t\tthis.getLightbox(type ? type : undefined);\n\t\t}\n\t\tthis.callEvent(\"onLightboxChange\", [oldType, this.getLightboxType()]);\n\t};\n\n};\n\n/***/ }),\n/* 87 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\n\n\tgantt._extend_to_optional = function (lightbox_block) {\n\n\t\tvar duration = lightbox_block;\n\t\tvar optional_time = {\n\t\t\trender: duration.render,\n\t\t\tfocus: duration.focus,\n\t\t\tset_value: function (node, value, task, section) {\n\t\t\t\tvar mapping = gantt._resolve_default_mapping(section);\n\t\t\t\tif (!task[mapping.start_date] || (mapping.start_date == \"start_date\" && this._isAllowedUnscheduledTask(task))) {\n\t\t\t\t\toptional_time.disable(node, section);\n\t\t\t\t\tvar val = {};\n\n\t\t\t\t\tfor (var i in mapping) {\n\t\t\t\t\t\t//take default values from the time control from task start/end dates\n\t\t\t\t\t\tval[mapping[i]] = task[i];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn duration.set_value.call(gantt, node, value, val, section);//set default value\n\t\t\t\t} else {\n\t\t\t\t\toptional_time.enable(node, section);\n\t\t\t\t\treturn duration.set_value.call(gantt, node, value, task, section);\n\t\t\t\t}\n\t\t\t},\n\t\t\tget_value: function (node, task, section) {\n\t\t\t\tif (section.disabled) {\n\t\t\t\t\treturn {start_date: null};\n\t\t\t\t} else {\n\t\t\t\t\treturn duration.get_value.call(gantt, node, task, section);\n\t\t\t\t}\n\t\t\t},\n\t\t\tupdate_block: function (node, section) {\n\t\t\t\tgantt.callEvent(\"onSectionToggle\", [gantt._lightbox_id, section]);\n\t\t\t\tnode.style.display = section.disabled ? \"none\" : \"block\";\n\n\t\t\t\tif (section.button) {\n\t\t\t\t\tvar button = node.previousSibling.querySelector(\".gantt_custom_button_label\"),\n\t\t\t\t\t\tlabels = gantt.locale.labels;\n\n\t\t\t\t\tvar button_text = section.disabled ? labels[section.name + \"_enable_button\"] : labels[section.name + \"_disable_button\"];\n\n\t\t\t\t\tbutton.innerHTML = button_text;\n\t\t\t\t}\n\t\t\t\tgantt.resizeLightbox();\n\t\t\t},\n\t\t\tdisable: function (node, section) {\n\t\t\t\tsection.disabled = true;\n\t\t\t\toptional_time.update_block(node, section);\n\n\t\t\t},\n\t\t\tenable: function (node, section) {\n\t\t\t\tsection.disabled = false;\n\t\t\t\toptional_time.update_block(node, section);\n\t\t\t},\n\t\t\tbutton_click: function (index, el, section, container) {\n\t\t\t\tif (gantt.callEvent(\"onSectionButton\", [gantt._lightbox_id, section]) === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar config = gantt._get_typed_lightbox_config()[index];\n\t\t\t\tif (config.disabled) {\n\t\t\t\t\toptional_time.enable(container, config);\n\t\t\t\t} else {\n\t\t\t\t\toptional_time.disable(container, config);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn optional_time;\n\t};\n\n\tgantt.form_blocks.duration_optional = gantt._extend_to_optional(gantt.form_blocks.duration);\n\tgantt.form_blocks.time_optional = gantt._extend_to_optional(gantt.form_blocks.time);\n\n};\n\n/***/ }),\n/* 88 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\n\n\tgantt.getTaskType = function (type) {\n\t\treturn \"task\";\n\t};\n};\n\n/***/ }),\n/* 89 */\n/***/ (function(module, exports) {\n\n/*\n reuse results of functions that can be recalculated during rendering\n greatly increases the rendering speed when critical path enabled\n Sample - 94_dev/critical_path.html\n\n */\nmodule.exports = function(gantt){\n\ngantt._cached_functions = {\n\tcache: {},\n\tmode: false,\n\tcritical_path_mode: false,\n\twrap_methods : function(methods, object){\n\t\tif(object._prefetch_originals){\n\t\t\tfor(var i in object._prefetch_originals){\n\t\t\t\tobject[i] = object._prefetch_originals[i];\n\t\t\t}\n\t\t}\n\t\tobject._prefetch_originals = {};\n\t\tfor(var i = 0; i < methods.length; i++)\n\t\t\tthis.prefetch(methods[i], object);\n\n\t},\n\tprefetch : function(methodname, host){\n\t\tvar original = host[methodname];\n\t\tif(original){\n\t\t\tvar optimizer = this;\n\n\t\t\thost._prefetch_originals[methodname] = original;\n\t\t\thost[methodname] = function get_prefetched_value(){\n\n\t\t\t\tvar argumentsArray = new Array(arguments.length);\n\t\t\t\tfor (var i = 0, l = arguments.length; i < l; i++) {\n\t\t\t\t\targumentsArray[i] = arguments[i];\n\t\t\t\t}\n\n\t\t\t\tif(optimizer.active){\n\t\t\t\t\tvar args = optimizer.get_arguments_hash(Array.prototype.slice.call(argumentsArray));\n\t\t\t\t\tif(!optimizer.cache[methodname]){\n\t\t\t\t\t\toptimizer.cache[methodname] = {};\n\t\t\t\t\t}\n\n\t\t\t\t\tvar cached_values = optimizer.cache[methodname];\n\n\t\t\t\t\tif(optimizer.has_cached_value(cached_values, args)){\n\t\t\t\t\t\treturn optimizer.get_cached_value(cached_values, args);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tvar value = original.apply(this, argumentsArray);\n\t\t\t\t\t\toptimizer.cache_value(cached_values, args, value);\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn original.apply(this, argumentsArray);\n\t\t\t};\n\t\t}\n\t\treturn original;\n\t},\n\tcache_value: function(cache, arguments_hash, value){\n\t\tif(this.is_date(value))\n\t\t\tvalue = new Date(value);\n\t\tcache[arguments_hash] = value;\n\t},\n\thas_cached_value: function(cache, arguments_hash){\n\t\treturn cache.hasOwnProperty(arguments_hash);\n\t},\n\tget_cached_value: function(cache, arguments_hash){\n\t\tvar data = cache[arguments_hash];\n\n\t\t//for cached dates - return copy\n\t\tif(this.is_date(data)){\n\t\t\tdata = new Date(data);\n\t\t}\n\t\treturn data;\n\t},\n\tis_date: function(value){\n\t\treturn (value && value.getUTCDate);\n\t},\n\tget_arguments_hash:function(args){\n\t\tvar values = [];\n\t\tfor(var i = 0; i < args.length; i++){\n\t\t\tvalues.push(this.stringify_argument(args[i]));\n\t\t}\n\t\treturn \"(\" + values.join(\";\") + \")\";\n\t},\n\tstringify_argument: function(value){\n\t\t//expecting task or link, or any other data entries, dates and primitive values\n\t\tvar ret = \"\";\n\t\tif(value.id){\n\t\t\tret = value.id;\n\t\t}else if(this.is_date(value)){\n\t\t\tret = value.valueOf();\n\t\t}else{\n\t\t\tret = value;\n\t\t}\n\t\treturn ret + \"\";\n\t},\n\tactivate: function(){\n\t\tthis.clear();\n\t\tthis.active = true;\n\t},\n\tdeactivate: function(){\n\t\tthis.clear();\n\t\tthis.active = false;\n\t},\n\tclear: function(){\n\t\tthis.cache = {};\n\t},\n\n\tsetup: function(gantt){\n\t\tvar override_gantt = [];\n\n\t\tvar gantt_methods = [\n\t\t\t'_isCriticalTask',\n\t\t\t'isCriticalLink',\n\t\t\t'_isProjectEnd',\n\t\t\t'_getProjectEnd',\n\t\t\t'_getSlack'\n\t\t];\n\n\n\n\t\tif(this.mode == 'auto'){\n\t\t\tif(gantt.config.highlight_critical_path){\n\t\t\t\toverride_gantt = gantt_methods;\n\t\t\t}\n\t\t}else if(this.mode === true){\n\t\t\toverride_gantt = gantt_methods;\n\t\t}\n\n\t\tthis.wrap_methods(override_gantt, gantt);\n\n\t},\n\tupdate_if_changed: function(gantt){\n\t\tvar changed = (this.critical_path_mode != gantt.config.highlight_critical_path ||\n\t\t\t\t\t\tthis.mode !== gantt.config.optimize_render);\n\t\tif(changed){\n\t\t\tthis.critical_path_mode = gantt.config.highlight_critical_path;\n\t\t\tthis.mode = gantt.config.optimize_render;\n\t\t\tthis.setup(gantt);\n\t\t}\n\t}\n};\n\nfunction activate(){\n\tgantt._cached_functions.update_if_changed(gantt);\n\tif(!gantt._cached_functions.active){\n\t\tgantt._cached_functions.activate();\n\t}\n\treturn true;\n}\ngantt.attachEvent(\"onBeforeGanttRender\", activate);\ngantt.attachEvent(\"onBeforeDataRender\", activate);\ngantt.attachEvent(\"onBeforeSmartRender\", function(){\n\tactivate();\n});\ngantt.attachEvent(\"onBeforeParse\", activate);\ngantt.attachEvent(\"onDataRender\", function(){\n\tgantt._cached_functions.deactivate();\n});\nvar deactivTimeout = null;\ngantt.attachEvent(\"onSmartRender\", function(){\n\tif(deactivTimeout)\n\t\tclearTimeout(deactivTimeout);\n\tdeactivTimeout = setTimeout(function(){\n\t\tgantt._cached_functions.deactivate();\n\t}, 1000);\n});\n\ngantt.attachEvent(\"onBeforeGanttReady\", function(){\n\tgantt._cached_functions.update_if_changed(gantt);\n\treturn true;\n});\n\n};\n\n/***/ }),\n/* 90 */\n/***/ (function(module, exports) {\n\nfunction _configure(col, data, force) {\n\tfor (var key in data)\n\t\tif (typeof col[key] == \"undefined\" || force)\n\t\t\tcol[key] = data[key];\n}\n\nfunction _get_skin(force, gantt) {\n\tvar skin = gantt.skin;\n\tif (!skin || force) {\n\t\tvar links = document.getElementsByTagName(\"link\");\n\t\tfor (var i = 0; i < links.length; i++) {\n\t\t\tvar res = links[i].href.match(\"dhtmlxgantt_([a-z\\_]+).css\");\n\t\t\tif (res) {\n\t\t\t\tif (gantt.skins[res[1]] || !skin) {\n\t\t\t\t\tskin = res[1];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tgantt.skin = skin || \"terrace\";\n\tvar skinset = gantt.skins[gantt.skin] || gantt.skins[\"terrace\"];\n\n\t//apply skin related settings\n\t_configure(gantt.config, skinset.config, force);\n\n\tvar config = gantt.getGridColumns();\n\tif (config[1] && !gantt.defined(config[1].width))\n\t\tconfig[1].width = skinset._second_column_width;\n\tif (config[2] && !gantt.defined(config[2].width))\n\t\tconfig[2].width = skinset._third_column_width;\n\t\n\tfor (var i=0; i column.width) ? column.min_width : column.width;\n\t\t\t\tcolumn.width = (column.max_width && column.max_width < column.width) ? column.max_width : column.width;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (skinset.config.task_height)\n\t\tgantt.config.task_height = skinset.config.task_height || \"full\"; \n\n\tif (skinset._lightbox_template)\n\t\tgantt._lightbox_template = skinset._lightbox_template;\n\n\tif (skinset._redefine_lightbox_buttons) {\n\t\tgantt.config.buttons_right = skinset._redefine_lightbox_buttons[\"buttons_right\"];\n\t\tgantt.config.buttons_left = skinset._redefine_lightbox_buttons[\"buttons_left\"];\n\t}\n\n\n\tgantt.resetLightbox();\n}\n\nmodule.exports = function(gantt) {\n\tif(!gantt.resetSkin){\n\t\tgantt.resetSkin = function () {\n\t\t\tthis.skin = \"\";\n\t\t\t_get_skin(true, this);\n\t\t};\n\t\tgantt.skins = {};\n\n\t\tgantt.attachEvent(\"onGanttLayoutReady\", function(){\n\t\t\t_get_skin(false, this);\n\t\t});\n\t}\n};\n\n/***/ }),\n/* 91 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\ngantt.skins.skyblue = {\n\tconfig:{\n\t\tgrid_width:350,\n\t\trow_height: 27,\n\t\tscale_height: 27,\n\t\tlink_line_width:1,\n\t\tlink_arrow_size:8,\n\t\tlightbox_additional_height:75\n\t},\n\t_second_column_width:95,\n\t_third_column_width:80\n};\n\n};\n\n/***/ }),\n/* 92 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\ngantt.skins.meadow = {\n\tconfig:{\n\t\tgrid_width:350,\n\t\trow_height: 27,\n\t\tscale_height: 30,\n\t\tlink_line_width:2,\n\t\tlink_arrow_size:6,\n\t\tlightbox_additional_height:72\n\t},\n\t_second_column_width:95,\n\t_third_column_width:80\n};\n\n};\n\n/***/ }),\n/* 93 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\ngantt.skins.terrace = {\n\tconfig:{\n\t\tgrid_width:360,\n\t\trow_height: 35,\n\t\tscale_height: 35,\n\t\tlink_line_width:2,\n\t\tlink_arrow_size:6,\n\t\tlightbox_additional_height:75\n\t},\n\t_second_column_width:90,\n\t_third_column_width:70\t\t\n};\n\n};\n\n/***/ }),\n/* 94 */\n/***/ (function(module, exports) {\n\n\n\nmodule.exports = function(gantt) {\n\tgantt.skins.broadway = {\n\t\tconfig: {\n\t\t\tgrid_width: 360,\n\t\t\trow_height: 35,\n\t\t\tscale_height: 35,\n\t\t\tlink_line_width: 1,\n\t\t\tlink_arrow_size: 7,\n\t\t\tlightbox_additional_height: 86\n\t\t},\n\t\t_second_column_width: 90,\n\t\t_third_column_width: 80,\n\n\t\t_lightbox_template: \"\",\n\t\t_config_buttons_left: {},\n\t\t_config_buttons_right: {\n\t\t\t\"gantt_delete_btn\": \"icon_delete\",\n\t\t\t\"gantt_save_btn\": \"icon_save\"\n\t\t}\n\t};\n};\n\n/***/ }),\n/* 95 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\n\tgantt.skins.material = {\n\t\tconfig: {\n\t\t\tgrid_width: 411,\n\t\t\trow_height: 34,\n\t\t\ttask_height_offset: 6,\n\t\t\tscale_height: 36,\n\t\t\tlink_line_width: 2,\n\t\t\tlink_arrow_size: 6,\n\t\t\tlightbox_additional_height: 80\n\t\t},\n\t\t_second_column_width: 110,\n\t\t_third_column_width: 75,\n\t\t_redefine_lightbox_buttons: {\n\t\t\t\"buttons_left\": [\"dhx_delete_btn\"],\n\t\t\t\"buttons_right\": [\"dhx_save_btn\", \"dhx_cancel_btn\"]\n\t\t}\n\t};\n\n\tgantt.attachEvent(\"onAfterTaskDrag\", function (id) {\n\t\tvar t = gantt.getTaskNode(id);\n\t\tif (t) {\n\t\t\tt.className += \" gantt_drag_animation\";\n\t\t\tsetTimeout(function () {\n\t\t\t\tvar indx = t.className.indexOf(\" gantt_drag_animation\");\n\t\t\t\tif (indx > -1) {\n\t\t\t\t\tt.className = t.className.slice(0, indx);\n\t\t\t\t}\n\t\t\t}, 200);\n\t\t}\n\t});\n\n};\n\n/***/ }),\n/* 96 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\ngantt.skins[\"contrast_black\"] = {\n\tconfig:{\n\t\tgrid_width:360,\n\t\trow_height: 35,\n\t\tscale_height: 35,\n\t\tlink_line_width:2,\n\t\tlink_arrow_size:6,\n\t\tlightbox_additional_height:75\n\t},\n\t_second_column_width:100,\n\t_third_column_width:80\n};\n\n};\n\n/***/ }),\n/* 97 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\ngantt.skins[\"contrast_white\"] = {\n\tconfig:{\n\t\tgrid_width:360,\n\t\trow_height: 35,\n\t\tscale_height: 35,\n\t\tlink_line_width:2,\n\t\tlink_arrow_size:6,\n\t\tlightbox_additional_height:75\n\t},\n\t_second_column_width:100,\n\t_third_column_width:80\n};\n\n};\n\n/***/ }),\n/* 98 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\n\n\tgantt.config.touch_drag = 500; //nearly immediate dnd\n\tgantt.config.touch = true;\n\tgantt.config.touch_feedback = true;\n\tgantt.config.touch_feedback_duration = 1;\n\tgantt._prevent_touch_scroll = false;\n\n\n\tgantt._touch_feedback = function () {\n\t\tif (gantt.config.touch_feedback) {\n\t\t\tif (navigator.vibrate)\n\t\t\t\tnavigator.vibrate(gantt.config.touch_feedback_duration);\n\t\t}\n\t};\n\n\tgantt.attachEvent(\"onGanttReady\", gantt.bind(function(){\n\t\tif (this.config.touch != \"force\")\n\t\t\tthis.config.touch = this.config.touch &&\n\t\t\t\t((navigator.userAgent.indexOf(\"Mobile\") != -1) ||\n\t\t\t\t\t(navigator.userAgent.indexOf(\"iPad\") != -1) ||\n\t\t\t\t\t(navigator.userAgent.indexOf(\"Android\") != -1) ||\n\t\t\t\t\t(navigator.userAgent.indexOf(\"Touch\") != -1));\n\n\t\tif (this.config.touch) {\n\n\t\t\tvar touchEventsSupported = true;\n\t\t\ttry {\n\t\t\t\tdocument.createEvent(\"TouchEvent\");\n\t\t\t} catch (e) {\n\t\t\t\ttouchEventsSupported = false;\n\t\t\t}\n\n\t\t\tif (touchEventsSupported) {\n\t\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\n\t\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\n\t\t\t\t\tif (ev.touches[0])\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttarget: ev.target,\n\t\t\t\t\t\t\tpageX: ev.touches[0].pageX,\n\t\t\t\t\t\t\tpageY: ev.touches[0].pageY,\n\t\t\t\t\t\t\tclientX: ev.touches[0].clientX,\n\t\t\t\t\t\t\tclientY: ev.touches[0].clientY\n\t\t\t\t\t\t};\n\t\t\t\t\telse\n\t\t\t\t\t\treturn ev;\n\t\t\t\t}, function () {\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t} else if (window.navigator.pointerEnabled) {\n\t\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\n\t\t\t\t\tif (ev.pointerType == \"mouse\") return null;\n\t\t\t\t\treturn ev;\n\t\t\t\t}, function (ev) {\n\t\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\n\t\t\t\t});\n\t\t\t} else if (window.navigator.msPointerEnabled) {\n\t\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\n\t\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\n\t\t\t\t\treturn ev;\n\t\t\t\t}, function (ev) {\n\t\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\n\t\t\t\t});\n\t\t\t}\n\n\t\t}\n\t}, gantt));\n\n\n\tfunction getTaskDND(){\n\t\tvar _tasks_dnd;\n\t\tif(gantt.$ui.getView(\"timeline\")){\n\t\t\t_tasks_dnd = gantt.$ui.getView(\"timeline\")._tasks_dnd;\n\t\t}\n\t\treturn _tasks_dnd;\n\t}\n\n\tvar touchHandlers = [];\n\n//we can't use native scrolling, as we need to sync momentum between different parts\n//so we will block native scroll and use the custom one\n//in future we can add custom momentum\n\tgantt._touch_events = function (names, accessor, ignore) {\n\t\t//webkit on android need to be handled separately\n\t\tvar dblclicktime = 0;\n\t\tvar action_mode = false;\n\t\tvar scroll_mode = false;\n\t\tvar dblclick_timer = 0;\n\t\tvar action_start = null;\n\t\tvar scroll_state;\n\t\tvar long_tap_timer = null;\n\t\tvar current_target = null;\n\n\n\n\t\tfor(var i = 0; i < touchHandlers.length; i++){\n\t\t\tgantt.eventRemove(touchHandlers[i][0], touchHandlers[i][1], touchHandlers[i][2]);\n\t\t}\n\t\ttouchHandlers = [];\n\n\t\t//touch move\n\t\ttouchHandlers.push([gantt.$container, names[0], function (e) {\n\t\t\tvar _tasks_dnd = getTaskDND();\n\n\t\t\t\tif (ignore(e)) return;\n\n\t\t\t\t//ignore common and scrolling moves\n\t\t\t\tif (!action_mode) return;\n\n\t\t\t\tif (long_tap_timer) clearTimeout(long_tap_timer);\n\n\t\t\t\tvar source = accessor(e);\n\t\t\t\tif (_tasks_dnd && (_tasks_dnd.drag.id || _tasks_dnd.drag.start_drag)) {\n\t\t\t\t\t_tasks_dnd.on_mouse_move(source);\n\t\t\t\t\tif (e.preventDefault)\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.cancelBubble = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (!gantt._prevent_touch_scroll) {\n\t\t\t\t\tif (source && action_start) {\n\t\t\t\t\t\tvar dx = action_start.pageX - source.pageX;\n\t\t\t\t\t\tvar dy = action_start.pageY - source.pageY;\n\t\t\t\t\t\tif (!scroll_mode && (Math.abs(dx) > 5 || Math.abs(dy) > 5)) {\n\t\t\t\t\t\t\tgantt._touch_scroll_active = scroll_mode = true;\n\t\t\t\t\t\t\tdblclicktime = 0;\n\t\t\t\t\t\t\tscroll_state = gantt.getScrollState();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (scroll_mode) {\n\t\t\t\t\t\t\tgantt.scrollTo(scroll_state.x + dx, scroll_state.y + dy);\n\t\t\t\t\t\t\tvar new_scroll_state = gantt.getScrollState();\n\n\t\t\t\t\t\t\tif ((scroll_state.x != new_scroll_state.x && dy > 2 * dx) ||\n\t\t\t\t\t\t\t\t(scroll_state.y != new_scroll_state.y && dx > 2 * dy )) {\n\t\t\t\t\t\t\t\treturn block_action(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn block_action(e);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}]);\n\n\n\t\t//block touch context menu in IE10\n\t\ttouchHandlers.push([this.$container, \"contextmenu\", function (e) {\n\t\t\tif (action_mode)\n\t\t\t\treturn block_action(e);\n\t\t}]);\n\n\t\t//touch start\n\t\ttouchHandlers.push([this.$container, names[1], function (e) {\n\t\t\tif (ignore(e)) return;\n\t\t\tif (e.touches && e.touches.length > 1) {\n\t\t\t\taction_mode = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taction_start = accessor(e);\n\t\t\tif (!gantt._locate_css(action_start, \"gantt_hor_scroll\") && !gantt._locate_css(action_start, \"gantt_ver_scroll\")) {\n\t\t\t\taction_mode = true;\n\t\t\t}\n\t\t\tvar _tasks_dnd = getTaskDND();\n\n\t\t\t//long tap\n\t\t\tlong_tap_timer = setTimeout(function () {\n\t\t\t\tvar taskId = gantt.locate(action_start);\n\t\t\t\tif (_tasks_dnd && (taskId && !gantt._locate_css(action_start, \"gantt_link_control\") && !gantt._locate_css(action_start, \"gantt_grid_data\"))) {\n\t\t\t\t\t_tasks_dnd.on_mouse_down(action_start);\n\n\t\t\t\t\tif (_tasks_dnd.drag && _tasks_dnd.drag.start_drag) {\n\t\t\t\t\t\tcloneTaskRendered(taskId);\n\t\t\t\t\t\t_tasks_dnd._start_dnd(action_start);\n\t\t\t\t\t\tgantt._touch_drag = true;\n\n\t\t\t\t\t\tgantt.refreshTask(taskId);\n\n\t\t\t\t\t\tgantt._touch_feedback();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tlong_tap_timer = null;\n\t\t\t}, gantt.config.touch_drag);\n\t\t}]);\n\n\t\t//touch end\n\t\ttouchHandlers.push([this.$container, names[2], function (e) {\n\t\t\tif (ignore(e)) return;\n\t\t\tif (long_tap_timer) clearTimeout(long_tap_timer);\n\t\t\tgantt._touch_drag = false;\n\t\t\taction_mode = false;\n\t\t\tvar source = accessor(e);\n\n\t\t\tvar _tasks_dnd = getTaskDND();\n\n\t\t\tif(_tasks_dnd)\n\t\t\t\t_tasks_dnd.on_mouse_up(source);\n\n\t\t\tif (current_target) {\n\t\t\t\tgantt.refreshTask(gantt.locate(current_target));\n\t\t\t\tif (current_target.parentNode) {\n\t\t\t\t\tcurrent_target.parentNode.removeChild(current_target);\n\t\t\t\t\tgantt._touch_feedback();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgantt._touch_scroll_active = action_mode = scroll_mode = false;\n\t\t\tcurrent_target = null;\n\n\t\t\t//dbl-tap handling\n\t\t\tif (action_start && dblclicktime) {\n\t\t\t\tvar now = new Date();\n\t\t\t\tif ((now - dblclicktime) < 500) {\n\n\t\t\t\t\tvar mouseEvents = gantt.$services.getService(\"mouseEvents\");\n\t\t\t\t\tmouseEvents.onDoubleClick(action_start);\n\t\t\t\t\tblock_action(e);\n\t\t\t\t} else\n\t\t\t\t\tdblclicktime = now;\n\t\t\t} else {\n\t\t\t\tdblclicktime = new Date();\n\t\t\t}\n\t\t}]);\n\n\t\tfor(var i = 0; i < touchHandlers.length; i++){\n\t\t\tgantt.event(touchHandlers[i][0], touchHandlers[i][1], touchHandlers[i][2]);\n\t\t}\n\n\t\t//common helper, prevents event\n\t\tfunction block_action(e) {\n\t\t\tif (e && e.preventDefault)\n\t\t\t\te.preventDefault();\n\t\t\t(e || event).cancelBubble = true;\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction cloneTaskRendered(taskId) {\n\t\t\tvar renders = gantt._getTaskLayers();\n\t\t\tvar task = gantt.getTask(taskId);\n\t\t\tif (task && gantt.isTaskVisible(taskId)) {\n\t\t\t\tfor (var i = 0; i < renders.length; i++) {\n\t\t\t\t\ttask = renders[i].rendered[taskId];\n\t\t\t\t\tif (task && task.getAttribute(\"task_id\") && task.getAttribute(\"task_id\") == taskId) {\n\t\t\t\t\t\tvar copy = task.cloneNode(true);\n\t\t\t\t\t\tcurrent_target = task;\n\t\t\t\t\t\trenders[i].rendered[taskId] = copy;\n\t\t\t\t\t\ttask.style.display = \"none\";\n\t\t\t\t\t\tcopy.className += \" gantt_drag_move \";\n\t\t\t\t\t\ttask.parentNode.appendChild(copy);\n\t\t\t\t\t\t//return copy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n};\n\n/***/ }),\n/* 99 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt) {\n\tgantt.locale = {\n\t\tdate: {\n\t\t\tmonth_full: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n\t\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n\t\t\tday_full: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n\t\t\tday_short: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\n\t\t},\n\t\tlabels: {\n\t\t\tnew_task: \"New task\",\n\t\t\ticon_save: \"Save\",\n\t\t\ticon_cancel: \"Cancel\",\n\t\t\ticon_details: \"Details\",\n\t\t\ticon_edit: \"Edit\",\n\t\t\ticon_delete: \"Delete\",\n\t\t\tconfirm_closing: \"\",//Your changes will be lost, are you sure?\n\t\t\tconfirm_deleting: \"Task will be deleted permanently, are you sure?\",\n\t\t\tsection_description: \"Description\",\n\t\t\tsection_time: \"Time period\",\n\t\t\tsection_type: \"Type\",\n\n\t\t\t/* grid columns */\n\t\t\tcolumn_wbs: \"WBS\",\n\t\t\tcolumn_text: \"Task name\",\n\t\t\tcolumn_start_date: \"Start time\",\n\t\t\tcolumn_duration: \"Duration\",\n\t\t\tcolumn_add: \"\",\n\n\t\t\t/* link confirmation */\n\t\t\tlink: \"Link\",\n\t\t\tconfirm_link_deleting: \"will be deleted\",\n\t\t\tlink_start: \" (start)\",\n\t\t\tlink_end: \" (end)\",\n\n\t\t\ttype_task: \"Task\",\n\t\t\ttype_project: \"Project\",\n\t\t\ttype_milestone: \"Milestone\",\n\n\t\t\tminutes: \"Minutes\",\n\t\t\thours: \"Hours\",\n\t\t\tdays: \"Days\",\n\t\t\tweeks: \"Week\",\n\t\t\tmonths: \"Months\",\n\t\t\tyears: \"Years\",\n\n\t\t\t/* message popup */\n\t\t\tmessage_ok: \"OK\",\n\t\t\tmessage_cancel: \"Cancel\"\n\n\t\t}\n\t};\n};\n\n\n\n/***/ }),\n/* 100 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar domHelpers = __webpack_require__(1),\n\thelpers = __webpack_require__(6);\n\nmodule.exports = function(gantt){\n\tvar calculateScaleRange = __webpack_require__(17);\n\n\tgantt.assert = __webpack_require__(101)(gantt);\n\n//initial initialization\n\tgantt.init = function(node, from, to){\n\t\tif(from && to){\n\t\t\tthis.config.start_date = this._min_date = new Date(from);\n\t\t\tthis.config.end_date = this._max_date = new Date(to);\n\t\t}\n\t\tthis.date.init();\n\n\t\tif (!this.config.scroll_size)\n\t\t\tthis.config.scroll_size = domHelpers.getScrollSize() || 1;\n\n\t\tvar resizeDelay;\n\t\tgantt.event(window, \"resize\", function(){\n\t\t\tclearTimeout(resizeDelay);\n\t\t\tresizeDelay = setTimeout(function(){\n\t\t\t\tgantt.render();\n\t\t\t}, 300);\n\t\t});\n\n\t\t//can be called only once\n\t\tthis.init = function(node){\n\t\t\tif (this.$container && this.$container.parentNode){\n\t\t\t\tthis.$container.parentNode.removeChild(this.$container);\n\t\t\t\tthis.$container = null;\n\t\t\t}\n\n\t\t\tif(this.$layout){\n\t\t\t\tthis.$layout.clear();\n\t\t\t}\n\t\t\tthis._reinit(node);\n\t\t};\n\n\t\tthis._reinit(node);\n\t};\n\n\tgantt._reinit = function(node){\n\t\tthis.callEvent(\"onBeforeGanttReady\", []);\n\t\t//this._init_tasks_range();\n\t\tthis.resetLightbox();\n\t\tthis._update_flags();\n\n\n\t\tvar config = this.$services.getService(\"templateLoader\");\n\t\tconfig.initTemplates(this);\n\n\t\tthis._clearTaskLayers();\n\t\tthis._clearLinkLayers();\n\n\t\t//this.clear\n\t\tif(this.$layout){\n\t\t\tthis.$layout.destructor();\n\t\t\tthis.$ui.reset();\n\t\t}\n\n\t\tthis.$root = domHelpers.toNode(node);\n\t\tif(this.$root){\n\t\t\tthis.$root.innerHTML = \"\";\n\t\t}\n\t\tthis.$root.gantt = this;\n\t\tcalculateScaleRange(this);\n\t\tthis.config.layout.id = \"main\";\n\t\tthis.$layout = this.$ui.createView(\"layout\", node, this.config.layout);\n\n\t\tthis.$layout.attachEvent(\"onBeforeResize\", function(){\n\t\t\tvar storeNames = gantt.$services.getService(\"datastores\");\n\t\t\tfor(var i = 0; i < storeNames.length; i++){\n\t\t\t\tgantt.getDatastore(storeNames[i]).filter();\n\t\t\t}\n\t\t});\n\n\t\tthis.$layout.attachEvent(\"onResize\", function(){\n\t\t\tgantt.refreshData();\n\t\t});\n\n\t\tthis.callEvent(\"onGanttLayoutReady\", []);\n\t\tthis.$layout.render();\n\n\t\tgantt.$container = this.$layout.$container.firstChild;\n\t\tthis.callEvent(\"onTemplatesReady\",[]);\n\t\tthis.$mouseEvents.reset(this.$root);\n\t\tthis.callEvent(\"onGanttReady\", []);\n\n\t\tthis.render();\n\t};\n\n\tgantt.$click={\n\t\tbuttons:{\n\t\t\t\"edit\":function(id){\n\t\t\t\tgantt.showLightbox(id);\n\t\t\t},\n\t\t\t\"delete\":function(id){\n\t\t\t\tvar question = gantt.locale.labels.confirm_deleting;\n\t\t\t\tvar title = gantt.locale.labels.confirm_deleting_title;\n\n\t\t\t\tgantt._dhtmlx_confirm(question, title, function(){\n\t\t\t\t\tif(!gantt.isTaskExists(id)){\n\t\t\t\t\t\tgantt.hideLightbox();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar task = gantt.getTask(id);\n\t\t\t\t\tif(task.$new){\n\t\t\t\t\t\tgantt.silent(function(){\n\t\t\t\t\t\t\tgantt.deleteTask(id, true);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tgantt.refreshData();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tgantt.deleteTask(id);\n\t\t\t\t\t}\n\n\t\t\t\t\tgantt.hideLightbox();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n\tgantt.getScrollState = function(){\n\t\tvar state = this._scroll_state();\n\t\treturn { x:state.x_pos, y:state.y_pos, inner_width:state.x, inner_height:state.y, width: state.x_inner, height: state.y_inner };\n\t};\n\n\tgantt.scrollTo = function(left, top){\n\t\tvar vertical = this._getVerticalScrollbar();\n\t\tvar horizontal = this._getHorizontalScrollbar();\n\n\t\tvar oldV = vertical.getScrollState(),\n\t\t\toldH = horizontal.getScrollState();\n\n\t\tif (left*1 == left){\n\t\t\thorizontal.scroll(left);\n\t\t}\n\t\tif(top*1 == top){\n\t\t\tvertical.scroll(top);\n\t\t}\n\n\t\tvar newV = vertical.getScrollState(),\n\t\t\tnewH = horizontal.getScrollState();\n\n\t\tthis.callEvent(\"onGanttScroll\", [oldH.position, oldV.position, newH.position, newV.position]);\n\t};\n\n\tgantt.showDate = function(date){\n\t\tvar date_x = this.posFromDate(date);\n\t\tvar scroll_to = Math.max(date_x - this.config.task_scroll_offset, 0);\n\t\tthis.scrollTo(scroll_to);\n\t};\n\tgantt.showTask = function(id) {\n\t\tvar pos = this.getTaskPosition(this.getTask(id));\n\n\t\tvar left = Math.max(pos.left - this.config.task_scroll_offset, 0);\n\n\t\tvar dataHeight = this._scroll_state().y;\n\t\tvar top;\n\t\tif(!dataHeight){\n\t\t\ttop = pos.top;\n\t\t}else{\n\t\t\ttop = pos.top - (dataHeight - this.config.row_height)/2;\n\t\t}\n\n\t\tthis.scrollTo(left, top);\n\t};\n\n//renders self\n\tgantt.render = function(){\n\t\tthis.callEvent(\"onBeforeGanttRender\", []);\n\n\t\tvar pos = this.getScrollState();\n\t\tvar posX = pos ? pos.x : 0;\n\t\tif(this._getHorizontalScrollbar()){\n\t\t\tvar scrollbar = this._getHorizontalScrollbar();\n\t\t\tposX = scrollbar.$config.codeScrollLeft || posX || 0;\n\t\t}\n\n\n\t\tvar visible_date = null;\n\t\tif(posX){\n\t\t\tvisible_date = gantt.dateFromPos(posX + this.config.task_scroll_offset);\n\t\t}\n\t\tcalculateScaleRange(this);\n\n\t\tthis.$layout.$config.autosize = this.config.autosize;\n\t\tthis.$layout.resize();\n\n\t\tif(this.config.preserve_scroll && pos){\n\n\t\t\tif(posX){\n\t\t\t\tvar new_pos = gantt.getScrollState();\n\t\t\t\tvar new_date = gantt.dateFromPos(new_pos.x);\n\t\t\t\tif(!(+visible_date == +new_date && new_pos.y == pos.y)){\n\t\t\t\t\tif(visible_date){\n\t\t\t\t\t\tthis.showDate(visible_date);\n\t\t\t\t\t}\n\t\t\t\t\tif(pos.y)\n\t\t\t\t\t\tgantt.scrollTo(undefined, pos.y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.callEvent(\"onGanttRender\", []);\n\t};\n\n\t//TODO: add layout.resize method that wouldn't trigger data repaint\n\tgantt.setSizes = gantt.render;\n\n\tgantt._scroll_state = function(){\n\t\tvar result = {\n\t\t\tx: false,\n\t\t\ty: false,\n\t\t\tx_pos: 0,\n\t\t\ty_pos: 0,\n\t\t\tscroll_size: this.config.scroll_size + 1,//1px for inner content\n\t\t\tx_inner: 0,\n\t\t\ty_inner: 0\n\t\t};\n\n\t\tvar scrollVer = gantt._getVerticalScrollbar(),\n\t\t\tscrollHor = gantt._getHorizontalScrollbar();\n\t\tif(scrollHor){\n\t\t\tvar horState = scrollHor.getScrollState();\n\t\t\tif(horState.visible){\n\t\t\t\tresult.x = horState.size;\n\t\t\t\tresult.x_inner = horState.scrollSize;\n\t\t\t}\n\t\t\tresult.x_pos = horState.position || 0;\n\t\t}\n\n\t\tif(scrollVer){\n\t\t\tvar verState = scrollVer.getScrollState();\n\t\t\tif(verState.visible){\n\t\t\t\tresult.y = verState.size;\n\n\t\t\t\tresult.y_inner = verState.scrollSize;\n\t\t\t}\n\t\t\tresult.y_pos = verState.position || 0;\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tgantt.locate = function(e) {\n\t\tvar trg = domHelpers.getTargetNode(e);\n\n\t\t//ignore empty cells\n\t\tvar className = domHelpers.getClassName(trg);\n\t\tif ((className || \"\").indexOf(\"gantt_task_cell\") >= 0) return null;\n\n\t\tvar targetAttribute = arguments[1] || this.config.task_attribute;\n\n\t\tvar node = domHelpers.locateAttribute(trg, targetAttribute);\n\t\tif(node){\n\t\t\treturn node.getAttribute(targetAttribute);\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t};\n\n\tgantt._locate_css = function(e, classname, strict){\n\t\treturn domHelpers.locateClassName(e, classname, strict);\n\t};\n\n\tgantt._locateHTML = function(e, attribute) {\n\t\treturn domHelpers.locateAttribute(e, attribute || this.config.task_attribute);\n\t};\n\n\tgantt.getTaskRowNode = function(id) {\n\t\tvar els = this.$grid_data.childNodes;\n\t\tvar attribute = this.config.task_attribute;\n\t\tfor (var i = 0; i < els.length; i++) {\n\t\t\tif (els[i].getAttribute) {\n\t\t\t\tvar value = els[i].getAttribute(attribute);\n\t\t\t\tif (value == id) return els[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t};\n\n\tgantt.changeLightboxType = function(type){\n\t\tif(this.getLightboxType() == type)\n\t\t\treturn true;\n\t\tgantt._silent_redraw_lightbox(type);\n\t};\n\n\n\tgantt._get_link_type = function (from_start, to_start) {\n\t\tvar type = null;\n\t\tif (from_start && to_start) {\n\t\t\ttype = gantt.config.links.start_to_start;\n\t\t} else if (!from_start && to_start) {\n\t\t\ttype = gantt.config.links.finish_to_start;\n\t\t} else if (!from_start && !to_start) {\n\t\t\ttype = gantt.config.links.finish_to_finish;\n\t\t} else if (from_start && !to_start) {\n\t\t\ttype = gantt.config.links.start_to_finish;\n\t\t}\n\t\treturn type;\n\t};\n\n\tgantt.isLinkAllowed = function (from, to, from_start, to_start) {\n\t\tvar link = null;\n\t\tif (typeof(from) == \"object\") {\n\t\t\tlink = from;\n\t\t} else {\n\t\t\tlink = {source: from, target: to, type: this._get_link_type(from_start, to_start)};\n\t\t}\n\n\t\tif (!link) return false;\n\t\tif (!(link.source && link.target && link.type)) return false;\n\t\tif (link.source == link.target) return false;\n\n\t\tvar res = true;\n\t\t//any custom rules\n\t\tif (this.checkEvent(\"onLinkValidation\"))\n\t\t\tres = this.callEvent(\"onLinkValidation\", [link]);\n\n\t\treturn res;\n\t};\n\n\n\tgantt._correct_dst_change = function(date, prevOffset, step, unit){\n\t\tvar time_unit = helpers.getSecondsInUnit(unit) * step;\n\t\tif(time_unit > 60*60 && time_unit < 60*60*24){\n\t\t\t//correct dst change only if current unit is more than one hour and less than day (days have own checking), e.g. 12h\n\t\t\tvar offsetChanged = date.getTimezoneOffset() - prevOffset;\n\t\t\tif(offsetChanged){\n\t\t\t\tdate = gantt.date.add(date, offsetChanged, \"minute\");\n\t\t\t}\n\t\t}\n\t\treturn date;\n\t};\n\n\tgantt.getGridColumns = function(){\n\t\treturn gantt.config.columns.slice();\n\t};\n\n\tgantt._is_icon_open_click = function(e) {\n\t\tif (!e)\n\t\t\treturn false;\n\t\tvar target = e.target || e.srcElement;\n\t\tif (!(target && target.className))\n\t\t\treturn false;\n\t\tvar className = domHelpers.getClassName(target);\n\t\tif (className.indexOf(\"gantt_tree_icon\") !== -1 && (className.indexOf(\"gantt_close\") !== -1 || className.indexOf(\"gantt_open\") !== -1))\n\t\t\treturn true;\n\t\treturn false;\n\t};\n\n};\n\n/***/ }),\n/* 101 */\n/***/ (function(module, exports) {\n\n/*\n \tasserts will be removed in final code, so you can place them anythere\n\twithout caring about performance impacts\n*/\n\nmodule.exports = function(gantt){\n\treturn function assert(check, message){\n\t\t//jshint -W087\n\t\tif (!check){\n\t\t\tif(gantt.config.show_errors && gantt.callEvent(\"onError\",[message]) !== false) {\n\t\t\t\tgantt.message({type: \"error\", text: message, expire: -1});\n\t\t\t\tdebugger;\n\t\t\t}\n\t\t}\n\t};\n};\n\n/***/ }),\n/* 102 */\n/***/ (function(module, exports) {\n\nfunction extend(gantt){\n\n\tgantt.destructor = function(){\n\t\tgantt.callEvent(\"onDestroy\", []);\n\n\t\tthis.clearAll();\n\t\tthis.detachAllEvents();\n\n\t\tif(this.$root){\n\t\t\tdelete this.$root.gantt;\n\t\t}\n\n\t\tthis._eventRemoveAll();\n\t\tif(this.$layout){\n\t\t\tthis.$layout.destructor();\n\t\t}\n\n\t\tthis.resetLightbox();\n\n\t\tif(this._dp && this._dp.destructor){\n\t\t\tthis._dp.destructor();\n\t\t}\n\n\t\tthis.$services.destructor();\n\n\t\tfor(var i in this){\n\t\t\tif(i.indexOf(\"$\") === 0){\n\t\t\t\tdelete this[i];\n\t\t\t}\n\t\t}\n\t};\n}\n\nmodule.exports = extend;\n\n\n/***/ }),\n/* 103 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(gantt){\n\n\tfunction deprecated(badCode, goodCode) {\n\n\t\tvar formatting = gantt.env.isIE ? \"\" : \"%c\";\n\n\n\t\tvar message = [\n\t\t\tformatting, \"\\\"\", badCode, \"\\\"\", formatting,\n\t\t\t\" has been deprecated in dhtmlxGantt v4.0 and will stop working in v6.0. Use \",\n\t\t\tformatting, \"\\\"\", goodCode, \"\\\"\", formatting,\n\t\t\t\" instead. \\nSee more details at http://docs.dhtmlx.com/gantt/migrating.html \"\n\t\t].join(\"\");\n\n\t\tvar log = window.console.warn || window.console.log;\n\n\t\tvar args = [message];\n\t\tif(!gantt.env.isIE){\n\t\t\targs = args.concat([\"font-weight:bold\", \"font-weight:normal\", \"font-weight:bold\", \"font-weight:normal\"]);\n\t\t}\n\n\t\tlog.apply(window.console, args);\n\t}\n\n\tfunction wrapDeprecated(method) {\n\t\treturn function () {\n\t\t\tdeprecated(\"dhtmlx.\" + method, \"gantt.\" + method);\n\t\t\treturn gantt[method].apply(gantt, arguments);\n\t\t};\n\t}\n\n\t/* dhtmlx */\n\n\n\tif (!window.dhtmlx)\n\t\twindow.dhtmlx = {};\n\n\tvar dhtmlxMethods = [\n\t\t\"message\",\n\t\t\"alert\",\n\t\t\"confirm\",\n\t\t\"modalbox\",\n\t\t\"uid\",\n\t\t\"copy\",\n\t\t\"mixin\",\n\t\t\"defined\",\n\t\t\"bind\",\n\t\t\"assert\"\n\t];\n\n\tvar dynMethods = [];\n\n\tfor(var i = 0; i < dhtmlxMethods.length; i++){\n\t\t// wrap dhtmlx methods with 'deprecated' warnings\n\t\t// do not wrap if methods are defined by dhtmlxSuite\n\t\tif(!window.dhtmlx[dhtmlxMethods[i]]){\n\t\t\tdynMethods.push(dhtmlxMethods[i]);\n\t\t\tdhtmlx[dhtmlxMethods[i]] = wrapDeprecated(dhtmlxMethods[i]);\n\t\t}\n\t}\n\n\tgantt.attachEvent(\"onDestroy\", function(){\n\t\tfor(var i = 0; i < dynMethods.length; i++){\n\t\t\tdelete window.dhtmlx[dynMethods[i]];\n\t\t}\n\t\tdynMethods = null;\n\n\t});\n\n\t/* global functions */\n\n\n\tif (!window.dataProcessor) {\n\t\twindow.dataProcessor = function (url) {\n\t\t\tdeprecated(\"new dataProcessor(url)\", \"new gantt.dataProcessor(url)\");\n\t\t\treturn new gantt.dataProcessor(url);\n\t\t};\n\t\tgantt.attachEvent(\"onDestroy\", function(){\n\t\t\twindow.dataProcessor = null;\n\t\t});\n\t}\n\n};\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// dhtmlxgantt.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 20);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 63867f230ca27ef26312","var dateHelper = require(\"./date_helpers\");\n\nfunction copy(object) {\n\tvar i, t, result; // iterator, types array, result\n\n\tif (object && typeof object == \"object\") {\n\t\tresult = {};\n\t\tt = [Array,Number,String,Boolean];\n\t\tfor (i=0; i= 0);\n}\n\nfunction hasHref(node){\n\tvar canHaveHref = {\"a\": true, \"area\": true};\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\n\t\treturn !!node.getAttribute(\"href\");\n\t}\n\treturn true;\n}\n\nfunction isEnabled(node){\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\n\tif(canDisable[node.nodeName.toLowerCase()]){\n\t\treturn !node.hasAttribute(\"disabled\");\n\t}\n\n\treturn true;\n}\n\nfunction getFocusableNodes(root){\n\tvar nodes = root.querySelectorAll([\n\t\t\"a[href]\",\n\t\t\"area[href]\",\n\t\t\"input\",\n\t\t\"select\",\n\t\t\"textarea\",\n\t\t\"button\",\n\t\t\"iframe\",\n\t\t\"object\",\n\t\t\"embed\",\n\t\t\"[tabindex]\",\n\t\t\"[contenteditable]\"\n\t].join(\", \"));\n\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\n\tfor(var i = 0; i < nodesArray.length; i++){\n\t\tvar node = nodesArray[i];\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\n\t\tif(!isValid){\n\t\t\tnodesArray.splice(i, 1);\n\t\t\ti--;\n\t\t}\n\t}\n\treturn nodesArray;\n}\n\nfunction getScrollSize(){\n\tvar div = document.createElement(\"div\");\n\tdiv.style.cssText=\"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\n\n\tdocument.body.appendChild(div);\n\tvar width = div.offsetWidth-div.clientWidth;\n\tdocument.body.removeChild(div);\n\n\treturn width;\n}\n\nfunction getClassName(node){\n\tif(!node) return \"\";\n\n\tvar className = node.className || \"\";\n\tif(className.baseVal)//'className' exist but not a string - IE svg element in DOM\n\t\tclassName = className.baseVal;\n\n\tif(!className.indexOf)\n\t\tclassName = '';\n\n\treturn _trimString(className);\n}\n\nfunction addClassName(node, className){\n\tif (className && node.className.indexOf(className) === -1) {\n\t\tnode.className += \" \" + className;\n\t}\n}\n\nfunction removeClassName(node, name) {\n\tname = name.split(\" \");\n\tfor (var i = 0; i < name.length; i++) {\n\t\tvar regEx = new RegExp('\\\\s?\\\\b' + name[i] + '\\\\b(?![-_\\.])', \"\");\n\t\tnode.className = node.className.replace(regEx, \"\");\n\t}\n}\n\nfunction toNode(node) {\n\tif (typeof node === \"string\") {\n\t\treturn (document.getElementById(node) || document.querySelector(node) || document.body);\n\t}\n\treturn node || document.body;\n}\n\nvar _slave = document.createElement(\"div\");\nfunction insert(node, newone) {\n\t_slave.innerHTML = newone;\n\tvar child = _slave.firstChild;\n\tnode.appendChild(child);\n\treturn child;\n}\n\nfunction remove(node) {\n\tif (node && node.parentNode) {\n\t\tnode.parentNode.removeChild(node);\n\t}\n}\n\nfunction getChildren(node, css) {\n\tvar ch = node.childNodes;\n\tvar len = ch.length;\n\tvar out = [];\n\tfor (var i = 0; i < len; i++) {\n\t\tvar obj = ch[i];\n\t\tif (obj.className && obj.className.indexOf(css) !== -1) {\n\t\t\tout.push(obj);\n\t\t}\n\t}\n\treturn out;\n}\n\nfunction getTargetNode(e){\n\tvar trg;\n\tif (e.tagName)\n\t\ttrg = e;\n\telse {\n\t\te=e||window.event;\n\t\ttrg=e.target||e.srcElement;\n\t}\n\treturn trg;\n}\n\nfunction locateAttribute(e, attribute) {\n\tif(!attribute) return;\n\n\tvar trg = getTargetNode(e);\n\n\twhile (trg){\n\t\tif (trg.getAttribute){\t//text nodes has not getAttribute\n\t\t\tvar test = trg.getAttribute(attribute);\n\t\t\tif (test) return trg;\n\t\t}\n\t\ttrg=trg.parentNode;\n\t}\n\treturn null;\n}\n\nfunction _trimString(str){\n\tvar func = String.prototype.trim || function(){ return this.replace(/^\\s+|\\s+$/g, \"\"); };\n\treturn func.apply(str);\n}\n\nfunction locateClassName(e, classname, strict){\n\tif(strict === undefined)\n\t\tstrict = true;\n\n\tvar trg = getTargetNode(e);\n\tvar css = '';\n\tvar test = false;\n\twhile (trg){\n\t\tcss = getClassName(trg);\n\n\t\tif(css){\n\t\t\tvar ind = css.indexOf(classname);\n\t\t\tif (ind >= 0){\n\t\t\t\tif (!strict)\n\t\t\t\t\treturn trg;\n\n\t\t\t\t//check that we have exact match\n\t\t\t\tvar left = (ind === 0) || (!_trimString(css.charAt(ind - 1)));\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!_trimString(css.charAt(ind + classname.length)));\n\n\t\t\t\tif (left && right)\n\t\t\t\t\treturn trg;\n\t\t\t}\n\t\t}\n\n\t\ttrg=trg.parentNode;\n\t}\n\treturn null;\n}\n\n/*\nevent position relatively to DOM element\n */\nfunction getRelativeEventPosition(ev, node){\n\tif (ev.pageX || ev.pageY)\n\t\tvar pos = {x: ev.pageX, y: ev.pageY};\n\n\tvar d = document.documentElement;\n\tvar pos = {\n\t\tx: ev.clientX + d.scrollLeft - d.clientLeft,\n\t\ty: ev.clientY + d.scrollTop - d.clientTop\n\t};\n\n\tvar box = elementPosition(node);\n\tpos.x = pos.x - box.x + node.scrollLeft;\n\tpos.y = pos.y - box.y + node.scrollTop;\n\treturn pos;\n}\n\n\nfunction isChildOf(child, parent){\n\twhile(child && child != parent) {\n\t\tchild = child.parentNode;\n\t}\n\treturn child == parent;\n}\n\nmodule.exports = {\n\tgetNodePosition: elementPosition,\n\tgetFocusableNodes: getFocusableNodes,\n\tgetScrollSize: getScrollSize,\n\tgetClassName: getClassName,\n\taddClassName: addClassName,\n\tremoveClassName: removeClassName,\n\tinsertNode: insert,\n\tremoveNode: remove,\n\tgetChildNodes: getChildren,\n\ttoNode: toNode,\n\tlocateClassName:locateClassName,\n\tlocateAttribute: locateAttribute,\n\tgetTargetNode: getTargetNode,\n\tgetRelativeEventPosition: getRelativeEventPosition,\n\tisChildOf: isChildOf,\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/utils/dom_helpers.js\n// module id = 1\n// module chunks = 0","var EventHost = function(){\n\tthis._connected = [];\n\tthis._silent_mode = false;\n};\n\nEventHost.prototype = {\n\t_silentStart: function() {\n\t\tthis._silent_mode = true;\n\t},\n\t_silentEnd: function() {\n\t\tthis._silent_mode = false;\n\t}\n};\n\nvar\tcreateEventStorage = function(obj) {\n\tvar dhx_catch = [];\n\tvar z = function(){\n\t\tvar res = true;\n\t\tfor (var i = 0; i < dhx_catch.length; i++){\n\t\t\tif (dhx_catch[i]){\n\t\t\t\tvar zr = dhx_catch[i].apply(obj, arguments);\n\t\t\t\tres=res&&zr;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t};\n\tz.addEvent=function(ev){\n\t\tif (typeof (ev) == \"function\")\n\t\t\treturn dhx_catch.push(ev)-1;\n\t\treturn false;\n\t};\n\tz.removeEvent=function(id){\n\t\tdhx_catch[id]=null;\n\t};\n\treturn z;\n};\n\nfunction makeEventable(obj){\n\n\tvar eventHost = new EventHost();\n\tobj.attachEvent=function(name, catcher, callObj){\n\t\tname='ev_'+name.toLowerCase();\n\t\tif (!eventHost[name])\n\t\t\teventHost[name] = createEventStorage(callObj||this);\n\n\t\treturn(name+':'+eventHost[name].addEvent(catcher)); //return ID (event name & event ID)\n\t};\n\tobj.attachAll = function(callback, callObj){\n\t\tthis.attachEvent('listen_all', callback, callObj);\n\t};\n\n\tobj.callEvent=function(name, arg0, callObj){\n\t\tif (eventHost._silent_mode) return true;\n\n\t\tvar handlerName = 'ev_'+name.toLowerCase();\n\n\t\tif (eventHost['ev_listen_all']){\n\t\t\teventHost['ev_listen_all'].apply(callObj || this, [name].concat(arg0));\n\t\t}\n\n\t\tif (eventHost[handlerName])\n\t\t\treturn eventHost[handlerName].apply(callObj || this, arg0);\n\t\treturn true;\n\t};\n\tobj.checkEvent=function(name){\n\t\treturn (!!eventHost['ev_'+name.toLowerCase()]);\n\t};\n\tobj.detachEvent=function(id){\n\t\tif (id){\n\t\t\tvar list = id.split(':'); //get EventName and ID\n\t\t\teventHost[list[0]].removeEvent(list[1]); //remove event\n\t\t}\n\t};\n\tobj.detachAllEvents = function(){\n\t\tfor (var name in eventHost){\n\t\t\tif (name.indexOf(\"ev_\") === 0)\n\t\t\t\tdelete eventHost[name];\n\t\t}\n\t};\n\n}\n\nmodule.exports = makeEventable;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/utils/eventable.js\n// module id = 2\n// module chunks = 0","function isDate(obj) {\n\tvar fields = [\n\t\t\"getFullYear\",\n\t\t\"getMonth\",\n\t\t\"getDate\"\n\t];\n\t\n\tif (obj && typeof obj == \"object\") {\n\t\tfor (var i=0; i topSize.maxWidth) {\n\t\t\tx = topSize.maxWidth;\n\t\t}\n\t\tif (y < topSize.minHeight) {\n\t\t\ty = topSize.minHeight;\n\t\t}\n\t\tif (y > topSize.maxHeight) {\n\t\t\ty = topSize.maxHeight;\n\t\t}\n\t\tthis.setSize(x, y);\n\n\t\tvar self = this;\n\n\t\tif(!this.$preResize){\n\t\t//\tself.callEvent(\"onResize\", [x, y]);\n\t\t}\n\t\tthis.$preResize = false;\n\t};\n\n\tCell.prototype.hide = function () {\n\t\tthis._hide(true);\n\t\tthis.resize();\n\t};\n\tCell.prototype.show = function (force) {\n\t\tthis._hide(false);\n\t\tif (force && this.$parent) {\n\t\t\tthis.$parent.show();\n\t\t}\n\t\tthis.resize();\n\t};\n\tCell.prototype._hide = function (mode) {\n\t\tif (mode === true && this.$view.parentNode) {\n\t\t\tthis.$view.parentNode.removeChild(this.$view);\n\t\t}\n\t\telse if (mode === false && !this.$view.parentNode) {\n\t\t\tvar index = this.$parent.cellIndex(this.$id);\n\t\t\tthis.$parent.moveView(this, index);\n\t\t}\n\t\tthis.$config.hidden = mode;\n\t};\n\tCell.prototype.$toHTML = function (content, css) {\n\t\tif (content === void 0) { content = \"\"; }\n\t\tcss = [(css || \"\"), (this.$config.css || \"\")].join(\" \");\n\t\tvar obj = this.$config;\n\t\tvar header = \"\";\n\t\tif (obj.raw) {\n\t\t\tcontent = typeof obj.raw === \"string\" ? obj.raw : \"\";\n\t\t}\n\t\telse {\n\t\t\tif (!content) {\n\t\t\t\tcontent = \"\" + (obj.html || \"\") + \"
\";\n\t\t\t}\n\t\t\tif (obj.header) {\n\t\t\t\tvar collapseIcon = obj.canCollapse ? \"\" : \"\";\n\t\t\t\theader = \"\";\n\t\t\t}\n\t\t}\n\t\treturn \"\" + header + content + \"
\";\n\t};\n\tCell.prototype.$fill = function (node, parent) {\n\t\tthis.$view = node;\n\t\tthis.$parent = parent;\n\t\tthis.init();\n\t};\n\tCell.prototype.getNode = function () {\n\t\treturn (this.$view.querySelector(\"gantt_layout_cell\") || this.$view);\n\t};\n\tCell.prototype.init = function () {\n\t\t// [NOT-GOOD] code is executed for each component, while it still has only one handler, it is no good\n\n\t\tvar self = this;\n\n\t\tthis._headerClickHandler = function(e){\n\t\t\tvar cellId = domHelpers.locateAttribute(e, \"data-cell-id\");\n\t\t\tif(cellId == self.$id){\n\t\t\t\tself.toggle();\n\t\t\t}\n\t\t};\n\n\t\tvar mouse = this.$gantt.$services.getService(\"mouseEvents\");\n\t\tmouse.delegate(\"click\", \"gantt_header_arrow\", this._headerClickHandler);\n\n\t\tthis.callEvent(\"onReady\", []);\n\t};\n\tCell.prototype.toggle = function () {\n\t\tthis.$config.collapsed = !this.$config.collapsed;\n\t\tthis.resize();\n\t};\n\tCell.prototype.getSize = function () {\n\t\tvar size = {\n\t\t\theight: this.$config.height || 0,\n\t\t\twidth: this.$config.width || 0,\n\t\t\tgravity: this.$config.gravity || 1,\n\t\t\tminHeight: this.$config.minHeight || 0,\n\t\t\tminWidth: this.$config.minWidth || 0,\n\t\t\tmaxHeight: this.$config.maxHeight || 100000,\n\t\t\tmaxWidth: this.$config.maxWidth || 100000\n\t\t};\n\t\tif (this.$config.collapsed) {\n\t\t\tvar mode = this.$config.mode === \"x\";\n\t\t\tsize[mode ? \"width\" : \"height\"] = size[mode ? \"maxWidth\" : \"maxHeight\"] = this.$config.headerHeight;\n\t\t}\n\t\treturn size;\n\t};\n\n\tCell.prototype.getContentSize = function(){\n\n\t\tvar width = this.$lastSize.contentX;\n\t\tif(width !== width*1){\n\t\t\twidth = this.$lastSize.width;\n\t\t}\n\n\t\tvar height = this.$lastSize.contentY;\n\t\tif(height !== height*1){\n\t\t\theight = this.$lastSize.height;\n\t\t}\n\n\t\treturn {\n\t\t\twidth: width,\n\t\t\theight: height\n\t\t};\n\t};\n\n\tCell.prototype._getBorderSizes = function(){\n\t\tvar borders = {\n\t\t\ttop: 0,\n\t\t\tright: 0,\n\t\t\tbottom: 0,\n\t\t\tleft: 0,\n\t\t\thorizontal: 0,\n\t\t\tvertical: 0\n\t\t};\n\t\tif(this._currentBorders){\n\t\t\tif(this._currentBorders[this._borders.left]){\n\t\t\t\tborders.left = 1;\n\t\t\t\tborders.horizontal++;\n\t\t\t}\n\n\t\t\tif(this._currentBorders[this._borders.right]){\n\t\t\t\tborders.right = 1;\n\t\t\t\tborders.horizontal++;\n\t\t\t}\n\n\t\t\tif(this._currentBorders[this._borders.top]){\n\t\t\t\tborders.top = 1;\n\t\t\t\tborders.vertical++;\n\t\t\t}\n\n\t\t\tif(this._currentBorders[this._borders.bottom]){\n\t\t\t\tborders.bottom = 1;\n\t\t\t\tborders.vertical++;\n\t\t\t}\n\t\t}\n\n\t\treturn borders;\n\n\t};\n\n\tCell.prototype.setSize = function (x, y) {\n\t\tthis.$view.style.width = x + \"px\";\n\t\tthis.$view.style.height = y + \"px\";\n\n\t\tvar borders = this._getBorderSizes();\n\t\tvar contentY = y - borders.vertical;\n\t\tvar contentX = x - borders.horizontal;\n\n\t\tthis.$lastSize = { x: x, y: y, contentX: contentX, contentY: contentY };\n\t\tif (this.$config.header) {\n\t\t\tthis._sizeHeader();\n\t\t}else{\n\t\t\tthis._sizeContent();\n\t\t}\n\t};\n\n\tCell.prototype._borders = {\n\t\t\"left\":\"gantt_layout_cell_border_left\",\n\t\t\"right\":\"gantt_layout_cell_border_right\",\n\t\t\"top\":\"gantt_layout_cell_border_top\",\n\t\t\"bottom\":\"gantt_layout_cell_border_bottom\"\n\t};\n\n\tCell.prototype._setBorders = function(css, view){\n\t\tif(!view) {\n\t\t\tview = this;\n\t\t}\n\t\tvar node = view.$view;\n\n\t\tfor( var i in this._borders){\n\t\t\tdomHelpers.removeClassName(node, this._borders[i]);\n\t\t}\n\n\t\tif(typeof css == \"string\"){\n\t\t\tcss = [css];\n\t\t}\n\n\t\tvar cssHash = {};\n\n\t\tfor(var i = 0; i < css.length; i++){\n\t\t\tdomHelpers.addClassName(node, css[i]);\n\t\t\tcssHash[css[i]] = true;\n\t\t}\n\n\t\tview._currentBorders = cssHash;\n\t};\n\n\n\tCell.prototype._sizeContent = function(){\n\t\tvar content = this.$view.childNodes[0];\n\t\tif(content.className == \"gantt_layout_content\"){\n\t\t\tcontent.style.height = this.$lastSize.contentY + \"px\";\n\t\t}\n\t};\n\n\tCell.prototype._sizeHeader = function () {\n\t\tvar size = this.$lastSize;\n\t\tsize.contentY -= this.$config.headerHeight;\n\t\tvar header = this.$view.childNodes[0];\n\t\tvar content = this.$view.childNodes[1];\n\t\tvar xLayout = this.$config.mode === \"x\";\n\t\tif (this.$config.collapsed) {\n\t\t\tcontent.style.display = \"none\";\n\t\t\tif (xLayout) {\n\t\t\t\theader.className = \"gantt_layout_header collapsed_x\";\n\t\t\t\theader.style.width = size.y + \"px\";\n\t\t\t\tvar d = Math.floor(size.y / 2 - size.x / 2);\n\t\t\t\theader.style.transform = \"rotate(90deg) translate(\" + d + \"px, \" + d + \"px)\";\n\t\t\t\tcontent.style.display = \"none\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\theader.className = \"gantt_layout_header collapsed_y\";\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (xLayout) {\n\t\t\t\theader.className = \"gantt_layout_header\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\theader.className = \"gantt_layout_header vertical\";\n\t\t\t}\n\t\t\theader.style.width = 'auto';\n\t\t\theader.style.transform = '';\n\t\t\tcontent.style.display = \"\";\n\t\t\tcontent.style.height = size.contentY + \"px\";\n\t\t}\n\t\theader.style.height = this.$config.headerHeight + \"px\";\n\t};\n\treturn Cell;\n}());\n\nmodule.exports = Cell;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/layout/cell.js\n// module id = 4\n// module chunks = 0","module.exports = function (d, b) {\n\tfor (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\tfunction __() { this.constructor = d; }\n\td.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/utils/extends.js\n// module id = 5\n// module chunks = 0","var units = {\n\t\"second\": 1,\n\t\"minute\": 60,\n\t\"hour\": 60 * 60,\n\t\"day\": 60 * 60 * 24,\n\t\"week\": 60 * 60 * 24 * 7,\n\t\"month\": 60 * 60 * 24 * 30,\n\t\"quarter\": 60 * 60 * 24 * 30 * 3,\n\t\"year\": 60 * 60 * 24 * 365\n};\nfunction getSecondsInUnit(unit){\n\treturn units[unit] || unit.hour;\n}\n\nfunction forEach(arr, callback){\n\tvar workArray = arr.slice();\n\tfor(var i = 0; i < workArray.length; i++){\n\t\tcallback(workArray[i], i);\n\t}\n}\n\nfunction arrayMap(arr, callback){\n\tvar workArray = arr.slice();\n\tvar resArray = [];\n\n\tfor(var i = 0; i < workArray.length; i++){\n\t\tresArray.push(callback(workArray[i], i));\n\t}\n\n\treturn resArray;\n}\n\nmodule.exports = {\n\tgetSecondsInUnit: getSecondsInUnit,\n\tforEach: forEach,\n\tarrayMap: arrayMap\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/utils/helpers.js\n// module id = 6\n// module chunks = 0","var env = {\n\tisIE: (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\n\tisIE6: (!window.XMLHttpRequest && navigator.userAgent.indexOf(\"MSIE\") >= 0),\n\tisIE7: (navigator.userAgent.indexOf(\"MSIE 7.0\") >= 0 && navigator.userAgent.indexOf(\"Trident\") < 0),\n\tisIE8: (navigator.userAgent.indexOf(\"MSIE 8.0\") >= 0 && navigator.userAgent.indexOf(\"Trident\") >= 0),\n\tisOpera: (navigator.userAgent.indexOf(\"Opera\") >= 0),\n\tisChrome: (navigator.userAgent.indexOf(\"Chrome\") >= 0),\n\tisKHTML: (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\n\tisFF: (navigator.userAgent.indexOf(\"Firefox\") >= 0),\n\tisIPad: (navigator.userAgent.search(/iPad/gi) >= 0),\n\tisEdge: (navigator.userAgent.indexOf(\"Edge\")!=-1)\n};\n\nmodule.exports = env;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/utils/env.js\n// module id = 7\n// module chunks = 0","function create(gantt){\n\tvar events = [];\n\n\treturn {\n\t\tdelegate:function(event, className, handler, root) {\n\t\t\tevents.push([event, className, handler, root]);\n\n\t\t\tvar helper = gantt.$services.getService(\"mouseEvents\");\n\t\t\thelper.delegate(event, className, handler, root);\n\t\t},\n\t\tdestructor: function(){\n\t\t\tvar mouseEvents = gantt.$services.getService(\"mouseEvents\");\n\t\t\tfor(var i = 0; i < events.length; i++){\n\t\t\t\tvar h = events[i];\n\t\t\t\tmouseEvents.detach(h[0], h[1], h[2], h[3]);\n\t\t\t}\n\t\t\tevents = [];\n\t\t}\n\t};\n}\n\nmodule.exports = create;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/mouse_event_container.js\n// module id = 8\n// module chunks = 0","function checkTimeout(host, updPerSecond){\n\tif (!updPerSecond)\n\t\treturn true;\n\t\n\tif (host._on_timeout)\n\t\treturn false;\n\t\n\tvar timeout = Math.ceil(1000/updPerSecond);\n\tif (timeout < 2) return true;\n\n\tsetTimeout(function(){\n\t\tdelete host._on_timeout;\n\t}, timeout);\n\n\thost._on_timeout = true;\n\treturn true;\n}\n\nmodule.exports = checkTimeout;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/utils/timeout.js\n// module id = 9\n// module chunks = 0","var utils = require(\"./utils\");\n\nfunction createScope(addEvent, removeEvent){\n\taddEvent = addEvent || utils.event;\n\tremoveEvent = removeEvent || utils.eventRemove;\n\n\tvar handlers = [];\n\n\treturn {\n\t\tattach: function(el, event, handler, capture){\n\t\t\thandlers.push({element: el, event:event, callback: handler, capture: capture});\n\t\t\taddEvent(el, event, handler, capture);\n\t\t},\n\t\tdetach: function(el, event, handler, capture){\n\t\t\tremoveEvent(el, event, handler, capture);\n\t\t\tfor(var i = 0; i < handlers.length; i++){\n\t\t\t\tvar handler = handlers[i];\n\t\t\t\tif(handler.element === el && handler.event === event && handler.callback === handler && handler.capture === capture){\n\t\t\t\t\thandlers.splice(i, 1);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tdetachAll: function(){\n\t\t\tfor(var i = 0; i < handlers.length; i++){\n\t\t\t\tremoveEvent(handlers[i].element, handlers[i].event, handlers[i].callback, handlers[i].capture);\n\t\t\t\tremoveEvent(handlers[i].element, handlers[i].event, handlers[i].callback, undefined);\n\t\t\t\tremoveEvent(handlers[i].element, handlers[i].event, handlers[i].callback, false);\n\t\t\t\tremoveEvent(handlers[i].element, handlers[i].event, handlers[i].callback, true);\n\t\t\t}\n\t\t\thandlers = [];\n\t\t},\n\t\textend: function(){\n\t\t\treturn createScope(this.event, this.eventRemove);\n\t\t}\n\t};\n}\n\nmodule.exports = createScope;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/utils/dom_event_scope.js\n// module id = 10\n// module chunks = 0","var __extends = require(\"../../../utils/extends\"),\n\tdomHelpers = require(\"../../../utils/dom_helpers\"),\n\tutils = require(\"../../../utils/utils\"),\n\tCell = require(\"./cell\");\n\nvar Layout = (function (_super) {\n\t\"use strict\";\n\n\t__extends(Layout, _super);\n\tfunction Layout(parent, config, factory) {\n\t\tvar _this = _super.apply(this, arguments) || this;\n\n\t\tif(parent)\n\t\t\t_this.$root = true;\n\n\t\t_this._parseConfig(config);\n\t\t_this.$name = \"layout\";\n\t\treturn _this;\n\t}\n\n\tLayout.prototype.destructor = function () {\n\t\tif (this.$container && this.$view) {\n\t\t\tdomHelpers.removeNode(this.$view);\n\t\t}\n\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\n\t\t\tvar child = this.$cells[i];\n\t\t\tchild.destructor();\n\t\t}\n\t\tthis.$cells = [];\n\n\t\t_super.prototype.destructor.call(this);\n\t};\n\n\tLayout.prototype._resizeScrollbars = function(autosize, scrollbars){\n\t\tvar scrollChanged = false;\n\t\tvar visibleScrollbars = [],\n\t\t\thiddenSrollbars = [];\n\n\t\tfunction showScrollbar(scrollbar){\n\t\t\tscrollbar.$parent.show();\n\t\t\tscrollChanged = true;\n\t\t\tvisibleScrollbars.push(scrollbar);\n\t\t}\n\t\tfunction hideScrollbar(scrollbar){\n\t\t\tscrollbar.$parent.hide();\n\t\t\tscrollChanged = true;\n\t\t\thiddenSrollbars.push(scrollbar);\n\t\t}\n\n\t\tvar scrollbar;\n\t\tfor(var i = 0; i < scrollbars.length; i++){\n\t\t\tscrollbar = scrollbars[i];\n\n\t\t\tif(autosize[scrollbar.$config.scroll]) {\n\t\t\t\thideScrollbar(scrollbar);\n\t\t\t}else if(scrollbar.shouldHide()){\n\t\t\t\thideScrollbar(scrollbar);\n\t\t\t}else if(scrollbar.shouldShow()){\n\t\t\t\tshowScrollbar(scrollbar);\n\t\t\t}else{\n\t\t\t\tif(scrollbar.isVisible()){\n\t\t\t\t\tvisibleScrollbars.push(scrollbar);\n\t\t\t\t}else{\n\t\t\t\t\thiddenSrollbars.push(scrollbar);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar visibleGroups = {};\n\t\tfor(var i = 0; i < visibleScrollbars.length; i++){\n\t\t\tif(visibleScrollbars[i].$config.group){\n\t\t\t\tvisibleGroups[visibleScrollbars[i].$config.group] = true;\n\t\t\t}\n\t\t}\n\n\t\tfor(var i = 0; i < hiddenSrollbars.length; i++){\n\t\t\tscrollbar = hiddenSrollbars[i];\n\n\t\t\tif(scrollbar.$config.group && visibleGroups[scrollbar.$config.group]){\n\t\t\t\tshowScrollbar(scrollbar);\n\t\t\t}\n\t\t}\n\n\t\treturn scrollChanged;\n\t};\n\n\tLayout.prototype._syncCellSizes = function(groupName, newSize){\n\t\tif(!groupName)\n\t\t\treturn;\n\n\t\tvar groups = {};\n\n\t\tthis._eachChild(function(cell){\n\t\t\tif(cell.$config.group && cell.$name != \"scrollbar\" && cell.$name != \"resizer\"){\n\t\t\t\tif(!groups[cell.$config.group]){\n\t\t\t\t\tgroups[cell.$config.group] = [];\n\t\t\t\t}\n\t\t\t\tgroups[cell.$config.group].push(cell);\n\t\t\t}\n\t\t});\n\n\t\tif(groups[groupName]){\n\t\t\tthis._syncGroupSize(groups[groupName], newSize);\n\t\t}\n\t\treturn groups[groupName];\n\t};\n\n\tLayout.prototype._syncGroupSize = function(cells, newSize){\n\t\tif(!cells.length) return;\n\n\t\tvar property = cells[0].$parent._xLayout ? \"width\" : \"height\";\n\t\tvar direction = cells[0].$parent.getNextSibling(cells[0].$id) ? 1 : -1;\n\n\t\tfor(var i = 0; i < cells.length; i++){\n\t\t\tvar ownSize = cells[i].getSize();\n\n\t\t\tvar resizeSibling = direction > 0 ? cells[i].$parent.getNextSibling(cells[i].$id) : cells[i].$parent.getPrevSibling(cells[i].$id);\n\t\t\tif(resizeSibling.$name == \"resizer\"){\n\t\t\t\tresizeSibling = direction > 0 ? resizeSibling.$parent.getNextSibling(resizeSibling.$id) : resizeSibling.$parent.getPrevSibling(resizeSibling.$id);\n\t\t\t}\n\t\t\tvar siblingSize = resizeSibling.getSize();\n\n\t\t\tif(resizeSibling[property]){\n\t\t\t\tvar totalGravity = ownSize.gravity + siblingSize.gravity;\n\t\t\t\tvar totalSize = ownSize[property] + siblingSize[property];\n\t\t\t\tvar k = totalGravity / totalSize;\n\t\t\t\tcells[i].$config.gravity = k * newSize;\n\n\t\t\t\tresizeSibling.$config[property] = totalSize - newSize;\n\t\t\t\tresizeSibling.$config.gravity = totalGravity - k * newSize;\n\t\t\t}else{\n\n\n\t\t\t\tcells[i].$config[property] = newSize;\n\t\t\t}\n\n\t\t\tvar mainGrid = this.$gantt.$ui.getView(\"grid\");\n\t\t\tif(mainGrid && cells[i].$content === mainGrid && !mainGrid.$config.scrollable){\n\t\t\t\tthis.$gantt.config.grid_width = newSize;\n\t\t\t}\n\t\t}\n\t};\n\n\tLayout.prototype.resize = function(startStage){\n\t\tvar mainCall = false;\n\t\tif(this.$root && !this._resizeInProgress){\n\t\t\tthis.callEvent(\"onBeforeResize\", []);\n\t\t\tmainCall = true;\n\t\t\tthis._resizeInProgress = true;\n\t\t}\n\n\t\t_super.prototype.resize.call(this, true);\n\t\t_super.prototype.resize.call(this, false);\n\n\t\tif(mainCall){\n\n\t\t\tvar contentViews = [];\n\t\t\tcontentViews = contentViews.concat(this.getCellsByType(\"viewCell\"));\n\t\t\tcontentViews = contentViews.concat(this.getCellsByType(\"viewLayout\"));\n\t\t\tcontentViews = contentViews.concat(this.getCellsByType(\"hostCell\"));\n\n\t\t\tvar scrollbars = this.getCellsByType(\"scroller\");\n\n\t\t\tfor(var i = 0; i < contentViews.length; i++){\n\t\t\t\tif(!contentViews[i].$config.hidden)\n\t\t\t\t\tcontentViews[i].setContentSize();\n\t\t\t}\n\n\t\t\tvar autosize = this._getAutosizeMode(this.$config.autosize);\n\n\t\t\tvar scrollChanged = this._resizeScrollbars(autosize, scrollbars);\n\n\t\t\tif(this.$config.autosize){\n\t\t\t\tthis.autosize(this.$config.autosize);\n\t\t\t\tscrollChanged = true;\n\t\t\t}\n\n\t\t\tif(scrollChanged){\n\t\t\t\tthis.resize();\n\t\t\t\tfor(var i = 0; i < contentViews.length; i++){\n\t\t\t\t\tif(!contentViews[i].$config.hidden)\n\t\t\t\t\t\tcontentViews[i].setContentSize();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.callEvent(\"onResize\", []);\n\t\t}\n\t\tif(mainCall){\n\t\t\tthis._resizeInProgress = false;\n\t\t}\n\t};\n\n\tLayout.prototype._eachChild = function(code, cell){\n\t\tcell = cell || this;\n\t\tcode(cell);\n\t\tif(cell.$cells){\n\t\t\tfor(var i = 0; i < cell.$cells.length; i++){\n\t\t\t\tthis._eachChild(code, cell.$cells[i]);\n\t\t\t}\n\t\t}\n\t};\n\n\tLayout.prototype.getCellsByType = function(type){\n\t\tvar res = [];\n\t\tif(type === this.$name){\n\t\t\tres.push(this);\n\t\t}\n\n\t\tif(this.$content && this.$content.$name == type){\n\t\t\tres.push(this.$content);\n\t\t}\n\n\t\tif(this.$cells){\n\t\t\tfor(var i = 0; i < this.$cells.length; i++){\n\t\t\t\tvar children = Layout.prototype.getCellsByType.call(this.$cells[i], type);\n\t\t\t\tif(children.length){\n\t\t\t\t\tres.push.apply(res, children);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t};\n\n\tLayout.prototype.getNextSibling = function(cellId){\n\t\tvar index = this.cellIndex(cellId);\n\t\tif(index >= 0 && this.$cells[index + 1]){\n\t\t\treturn this.$cells[index + 1];\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t};\n\n\tLayout.prototype.getPrevSibling = function(cellId){\n\t\tvar index = this.cellIndex(cellId);\n\t\tif(index >= 0 && this.$cells[index - 1]){\n\t\t\treturn this.$cells[index - 1];\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t};\n\n\n\tLayout.prototype.cell = function (id) {\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\n\t\t\tvar child = this.$cells[i];\n\t\t\tif (child.$id === id) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t\tvar sub = child.cell(id);\n\t\t\tif (sub) {\n\t\t\t\treturn sub;\n\t\t\t}\n\t\t}\n\t};\n\tLayout.prototype.cellIndex = function (id) {\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\n\t\t\tif (this.$cells[i].$id === id) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n\tLayout.prototype.moveView = function (view, ind) {\n\t\tif (this.$cells[ind] !== view) {\n\t\t\treturn window.alert(\"Not implemented\");\n\t\t}\n\t\telse {\n\t\t\tind += this.$config.header ? 1 : 0;\n\t\t\tvar node = this.$view;\n\t\t\tif (ind >= node.childNodes.length) {\n\t\t\t\tnode.appendChild(view.$view);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnode.insertBefore(view.$view, node.childNodes[ind]);\n\t\t\t}\n\t\t}\n\t};\n\tLayout.prototype._parseConfig = function (config) {\n\t\tthis.$cells = [];\n\t\tthis._xLayout = !config.rows;\n\t\tvar cells = config.rows || config.cols || config.views;\n\t\tfor (var i = 0; i < cells.length; i++) {\n\t\t\tvar cell = cells[i];\n\t\t\tcell.mode = this._xLayout ? \"x\" : \"y\";\n\t\t\tvar $content = this.$factory.initUI(cell, this);\n\t\t\tif(!$content){\n\t\t\t\tcells.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t}else{\n\t\t\t\t$content.$parent = this;\n\t\t\t\tthis.$cells.push($content);\n\t\t\t}\n\t\t}\n\t};\n\tLayout.prototype.getCells = function () {\n\t\treturn this.$cells;\n\t};\n\tLayout.prototype.render = function () {\n\t\tvar view = domHelpers.insertNode(this.$container, this.$toHTML());\n\t\tthis.$fill(view, null);\n\t\tthis.callEvent(\"onReady\", []);\n\t\tthis.resize();\n\n\t\t// do simple repaint after the first call\n\t\tthis.render = this.resize;\n\t};\n\tLayout.prototype.$fill = function (node, parent) {\n\t\tthis.$view = node;\n\t\tthis.$parent = parent;\n\t\tvar cells = domHelpers.getChildNodes(node, \"gantt_layout_cell\");\n\t\tfor (var i = cells.length - 1; i >= 0; i--) {\n\t\t\tvar sub = this.$cells[i];\n\t\t\tsub.$fill(cells[i], this);\n\t\t\t// initially hidden cell\n\t\t\tif (sub.$config.hidden) {\n\t\t\t\tsub.$view.parentNode.removeChild(sub.$view);\n\t\t\t}\n\t\t}\n\t};\n\tLayout.prototype.$toHTML = function () {\n\t\tvar mode = this._xLayout ? \"x\" : \"y\";\n\t\tvar html = [];\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\n\t\t\thtml.push(this.$cells[i].$toHTML());\n\t\t}\n\t\treturn _super.prototype.$toHTML.call(this, html.join(\"\"), (this.$root ? \"gantt_layout_root \" : \"\") + \"gantt_layout gantt_layout_\" + mode);\n\t};\n\n\tLayout.prototype.getContentSize = function(mode){\n\t\tvar contentWidth = 0,\n\t\t\tcontentHeight = 0;\n\n\t\tvar cellSize, cell, borders;\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\n\t\t\tcell = this.$cells[i];\n\t\t\tif(cell.$config.hidden)\n\t\t\t\tcontinue;\n\n\t\t\tcellSize = cell.getContentSize(mode);\n\n\t\t\tif(cell.$config.view === \"scrollbar\" && mode[cell.$config.scroll]){\n\t\t\t\tcellSize.height = 0;\n\t\t\t\tcellSize.width = 0;\n\t\t\t}\n\n\t\t\tif(cell.$config.resizer){\n\t\t\t\tif(this._xLayout){\n\t\t\t\t\tcellSize.height = 0;\n\t\t\t\t}else{\n\t\t\t\t\tcellSize.width = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tborders = cell._getBorderSizes();\n\n\t\t\tif(this._xLayout){\n\t\t\t\tcontentWidth += (cellSize.width + borders.horizontal);\n\t\t\t\tcontentHeight = Math.max(contentHeight, (cellSize.height + borders.vertical));\n\t\t\t}else{\n\t\t\t\tcontentWidth = Math.max(contentWidth, cellSize.width + borders.horizontal);\n\t\t\t\tcontentHeight += cellSize.height + borders.vertical;\n\t\t\t}\n\t\t}\n\n\t\tborders = this._getBorderSizes();\n\t\tcontentWidth += borders.horizontal;\n\t\tcontentHeight += borders.vertical;\n\n\t\tif(this.$root){\n\t\t\tcontentWidth += 1;\n\t\t\tcontentHeight += 1;\n\t\t}\n\n\t\treturn {\n\t\t\twidth: contentWidth,\n\t\t\theight: contentHeight\n\t\t};\n\t};\n\n\tLayout.prototype._cleanElSize = function(value){\n\t\treturn ((value || \"\").toString().replace(\"px\", \"\") * 1 || 0);\n\t};\n\tLayout.prototype._getBoxStyles = function(div){\n\t\tvar computed = null;\n\t\tif(window.getComputedStyle){\n\t\t\tcomputed = window.getComputedStyle(div, null);\n\t\t}else{\n\t\t\t//IE with elem.currentStyle does not calculate sizes from %, so will use the default approach\n\t\t\tcomputed = {\n\t\t\t\t\"width\":div.clientWidth,\n\t\t\t\t\"height\":div.clientHeight\n\t\t\t};\n\t\t}\n\t\tvar properties = [\n\t\t\t\"width\",\n\t\t\t\"height\",\n\n\t\t\t\"paddingTop\",\n\t\t\t\"paddingBottom\",\n\t\t\t\"paddingLeft\",\n\t\t\t\"paddingRight\",\n\n\t\t\t\"borderLeftWidth\",\n\t\t\t\"borderRightWidth\",\n\t\t\t\"borderTopWidth\",\n\t\t\t\"borderBottomWidth\"\n\t\t];\n\t\tvar styles = {\n\t\t\tboxSizing:(computed.boxSizing == \"border-box\")\n\t\t};\n\n\t\tif(computed.MozBoxSizing){\n\t\t\tstyles.boxSizing = (computed.MozBoxSizing == \"border-box\");\n\t\t}\n\t\tfor(var i =0; i < properties.length; i++){\n\t\t\tstyles[properties[i]] = computed[properties[i]] ? this._cleanElSize(computed[properties[i]]) : 0;\n\t\t}\n\n\n\t\tvar box = {\n\t\t\thorPaddings : (styles.paddingLeft + styles.paddingRight + styles.borderLeftWidth + styles.borderRightWidth),\n\t\t\tvertPaddings : (styles.paddingTop + styles.paddingBottom + styles.borderTopWidth + styles.borderBottomWidth),\n\t\t\tborderBox: styles.boxSizing,\n\t\t\tinnerWidth : styles.width,\n\t\t\tinnerHeight : styles.height,\n\t\t\touterWidth : styles.width,\n\t\t\touterHeight : styles.height\n\t\t};\n\n\n\t\tif(box.borderBox){\n\t\t\tbox.innerWidth -= box.horPaddings;\n\t\t\tbox.innerHeight -= box.vertPaddings;\n\t\t}else{\n\t\t\tbox.outerWidth += box.horPaddings;\n\t\t\tbox.outerHeight += box.vertPaddings;\n\t\t}\n\n\t\treturn box;\n\t};\n\n\tLayout.prototype._getAutosizeMode = function(config){\n\t\tvar res = {x:false, y:false};\n\t\tif(config === \"xy\"){\n\t\t\tres.x = res.y = true;\n\t\t}else if(config === \"y\" || config === true){\n\t\t\tres.y = true;\n\t\t}else if(config === \"x\"){\n\t\t\tres.x = true;\n\t\t}\n\t\treturn res;\n\t};\n\n\tLayout.prototype.autosize = function(mode) {\n\t\tvar res = this._getAutosizeMode(mode);\n\t\tvar boxSizes = this._getBoxStyles(this.$container);\n\t\tvar contentSizes = this.getContentSize(mode);\n\n\t\tvar node = this.$container;\n\t\tif(res.x){\n\t\t\tif(boxSizes.borderBox){\n\t\t\t\tcontentSizes.width += boxSizes.horPaddings;\n\t\t\t}\n\t\t\tnode.style.width = contentSizes.width + \"px\";\n\t\t}\n\t\tif(res.y){\n\t\t\tif(boxSizes.borderBox){\n\t\t\t\tcontentSizes.height += boxSizes.vertPaddings;\n\t\t\t}\n\t\t\tnode.style.height = contentSizes.height + \"px\";\n\t\t}\n\t};\n\n\tLayout.prototype.getSize = function () {\n\t\tthis._sizes = [];\n\t\tvar width = 0;\n\t\tvar minWidth = 0;\n\t\tvar maxWidth = 100000;\n\t\tvar height = 0;\n\t\tvar maxHeight = 100000;\n\t\tvar minHeight = 0;\n\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\n\n\t\t\tvar size = this._sizes[i] = this.$cells[i].getSize();\n\t\t\tif (this.$cells[i].$config.hidden) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (this._xLayout) {\n\t\t\t\tif (!size.width && size.minWidth) {\n\t\t\t\t\twidth += size.minWidth;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\twidth += size.width;\n\t\t\t\t}\n\t\t\t\tmaxWidth += size.maxWidth;\n\t\t\t\tminWidth += size.minWidth;\n\t\t\t\theight = Math.max(height, size.height);\n\t\t\t\tmaxHeight = Math.min(maxHeight, size.maxHeight); // min of maxHeight\n\t\t\t\tminHeight = Math.max(minHeight, size.minHeight); // max of minHeight\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!size.height && size.minHeight) {\n\t\t\t\t\theight += size.minHeight;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\theight += size.height;\n\t\t\t\t}\n\t\t\t\tmaxHeight += size.maxHeight;\n\t\t\t\tminHeight += size.minHeight;\n\t\t\t\twidth = Math.max(width, size.width);\n\t\t\t\tmaxWidth = Math.min(maxWidth, size.maxWidth); // min of maxWidth\n\t\t\t\tminWidth = Math.max(minWidth, size.minWidth); // max of minWidth\n\t\t\t}\n\t\t}\n\t\tvar self = _super.prototype.getSize.call(this);\n\t\t// maxWidth\n\t\tif (self.maxWidth >= 100000) {\n\t\t\tself.maxWidth = maxWidth;\n\t\t}\n\t\t// maxHeight\n\t\tif (self.maxHeight >= 100000) {\n\t\t\tself.maxHeight = maxHeight;\n\t\t}\n\t\t// minWidth\n\t\tself.minWidth = self.minWidth !== self.minWidth ? 0 : self.minWidth;// || self.width || Math.max(minWidth, width);\n\t\t// minHeight\n\t\tself.minHeight = self.minHeight !== self.minHeight ? 0 : self.minHeight;//self.minHeight || self.height || Math.max(minHeight, height);\n\t\t// sizes with paddings and margins\n\t\tif (this._xLayout) {\n\t\t\tself.minWidth += this.$config.margin * (this.$cells.length) || 0;\n\t\t\tself.minWidth += this.$config.padding * 2 || 0;\n\t\t\tself.minHeight += (this.$config.padding * 2) || 0;\n\t\t}\n\t\telse {\n\t\t\tself.minHeight += this.$config.margin * (this.$cells.length) || 0;\n\t\t\tself.minHeight += (this.$config.padding * 2) || 0;\n\t\t}\n\t\t\n\t\treturn self;\n\t};\n\t// calc total gravity and free space\n\tLayout.prototype._calcFreeSpace = function (s, cell, xLayout) {\n\t\tvar min = xLayout ? cell.minWidth : cell.minHeight;\n\t\tvar max = xLayout ? cell.maxWidth : cell.maxWidth;\n\t\tvar side = s;\n\t\tif (!side) {\n\t\t\tside = Math.floor(this._free / this._gravity * cell.gravity);\n\t\t\tif (side > max) {\n\t\t\t\tside = max;\n\t\t\t\tthis._free -= side;\n\t\t\t\tthis._gravity -= cell.gravity;\n\t\t\t}\n\t\t\tif (side < min) {\n\t\t\t\tside = min;\n\t\t\t\tthis._free -= side;\n\t\t\t\tthis._gravity -= cell.gravity;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (side > max) {\n\t\t\t\tside = max;\n\t\t\t}\n\t\t\tif (side < min) {\n\t\t\t\tside = min;\n\t\t\t}\n\t\t\tthis._free -= side;\n\t\t}\n\t\treturn side;\n\t};\n\tLayout.prototype._calcSize = function (s, size, xLayout) {\n\t\tvar side = s;\n\t\tvar min = xLayout ? size.minWidth : size.minHeight;\n\t\tvar max = xLayout ? size.maxWidth : size.maxHeight;\n\t\tif (!side) {\n\t\t\tside = Math.floor(this._free / this._gravity * size.gravity);\n\t\t}\n\t\tif (side > max) {\n\t\t\tside = max;\n\t\t}\n\t\tif (side < min) {\n\t\t\tside = min;\n\t\t}\n\t\treturn side;\n\t};\n\n\tLayout.prototype._configureBorders = function(){\n\t\tif(this.$root){\n\t\t\tthis._setBorders([\n\t\t\t\tthis._borders.left,\n\t\t\t\tthis._borders.top,\n\t\t\t\tthis._borders.right,\n\t\t\t\tthis._borders.bottom\n\t\t\t],\n\t\t\tthis);\n\t\t}\n\n\t\tvar borderClass = this._xLayout ? this._borders.right : this._borders.bottom;\n\n\t\tvar cells = this.$cells;\n\n\t\tvar lastVisibleIndex = cells.length - 1;\n\t\tfor(var i = lastVisibleIndex; i >= 0; i--){\n\t\t\tif (!cells[i].$config.hidden) {\n\t\t\t\tlastVisibleIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tfor (var i = 0; i < cells.length; i++) {\n\t\t\tif (cells[i].$config.hidden) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar lastCell = i >= lastVisibleIndex;\n\t\t\tvar borderColorClass = \"\";\n\t\t\tif(!lastCell && cells[i + 1]){\n\t\t\t\tif(cells[i + 1].$config.view == \"scrollbar\"){\n\t\t\t\t\tif(this._xLayout){\n\t\t\t\t\t\tlastCell = true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tborderColorClass = \"gantt_layout_cell_border_transparent\";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tthis._setBorders(lastCell ? [] : [borderClass, borderColorClass], cells[i]);\n\t\t}\n\t};\n\n\tLayout.prototype._updateCellVisibility = function(){\n\t\tvar oldVisibleCells = this._visibleCells || {};\n\t\tvar firstCall = !this._visibleCells;\n\t\tvar visibleCells = {};\n\t\tvar cell;\n\t\tfor (var i = 0; i < this._sizes.length; i++) {\n\t\t\tcell = this.$cells[i];\n\n\t\t\tif (!firstCall && cell.$config.hidden && oldVisibleCells[cell.$id]) {\n\t\t\t\tcell._hide(true);\n\t\t\t}else if(!cell.$config.hidden && !oldVisibleCells[cell.$id]){\n\t\t\t\tcell._hide(false);\n\t\t\t}\n\n\t\t\tif(!cell.$config.hidden){\n\t\t\t\tvisibleCells[cell.$id] = true;\n\t\t\t}\n\t\t}\n\t\tthis._visibleCells = visibleCells;\n\t};\n\n\tLayout.prototype.setSize = function (x, y) {\n\t\tthis._configureBorders();\n\t\t_super.prototype.setSize.call(this, x, y);\n\t\ty = this.$lastSize.contentY;\n\t\tx = this.$lastSize.contentX;\n\n\t\tvar padding = (this.$config.padding || 0);\n\t\tthis.$view.style.padding = padding + \"px\";\n\t\tthis._gravity = 0;\n\t\tthis._free = this._xLayout ? x : y;\n\t\tthis._free -= padding * 2;\n\t\t// calc all gravity\n\n\t\tvar cell,\n\t\t\tsize;\n\n\t\tthis._updateCellVisibility();\n\n\t\tfor (var i = 0; i < this._sizes.length; i++) {\n\t\t\tcell = this.$cells[i];\n\n\t\t\tif (cell.$config.hidden) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar margin = (this.$config.margin || 0);\n\t\t\tif(cell.$name == \"resizer\" && !margin){\n\t\t\t\tmargin = -1;\n\t\t\t}\n\n\t\t\t// set margins to child cell\n\t\t\tvar cellView = cell.$view;\n\n\t\t\tvar marginSide = this._xLayout ? \"marginRight\" : \"marginBottom\";\n\t\t\tif (i !== this.$cells.length - 1) {\n\t\t\t\tcellView.style[marginSide] = margin + \"px\";\n\t\t\t\tthis._free -= margin; // calc free space without margin\n\t\t\t}\n\t\t\tsize = this._sizes[i];\n\t\t\tif (this._xLayout) {\n\t\t\t\tif (!size.width) {\n\t\t\t\t\tthis._gravity += size.gravity;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!size.height) {\n\t\t\t\t\tthis._gravity += size.gravity;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (var i = 0; i < this._sizes.length; i++) {\n\t\t\tcell = this.$cells[i];\n\n\t\t\tif (cell.$config.hidden) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tsize = this._sizes[i];\n\t\t\tvar width = size.width;\n\t\t\tvar height = size.height;\n\t\t\tif (this._xLayout) {\n\t\t\t\tthis._calcFreeSpace(width, size, true);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._calcFreeSpace(height, size, false);\n\t\t\t}\n\t\t}\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\n\t\t\tcell = this.$cells[i];\n\n\t\t\tif (cell.$config.hidden) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tsize = this._sizes[i];\n\t\t\tvar dx = void 0;\n\t\t\tvar dy = void 0;\n\t\t\tif (this._xLayout) {\n\t\t\t\tdx = this._calcSize(size.width, size, true);\n\t\t\t\tdy = y - padding * 2; // layout height without paddings\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdx = x - padding * 2; // layout width without paddings\n\t\t\t\tdy = this._calcSize(size.height, size, false);\n\t\t\t}\n\n\t\t\tcell.setSize(dx, dy);\n\t\t}\n\n\t\t/*if(this.$root && !this._updatingScrollbars){\n\t\t\tthis._updatingScrollbars = true;\n\t\t\teachCell(function(cell){\n\t\t\t\tif(cell.$content && cell.$content.$name == \"scroller\"){\n\t\t\t\t\tcell.$content.toggleVisibility();\n\t\t\t\t}\n\t\t\t}, this);\n\t\t\tthis._updatingScrollbars = false;\n\t\t}*/\n\n\t};\n\n\tfunction eachCell(code, root){\n\t\tif(root.$cells){\n\t\t\tfor(var i = 0; i < root.$cells.length; i++){\n\t\t\t\tcode(root.$cells[i]);\n\t\t\t\teachCell(code, root.$cells[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\n\treturn Layout;\n}(Cell));\n\nmodule.exports = Layout;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/layout/layout.js\n// module id = 11\n// module chunks = 0","var ScaleHelper = require(\"./scales_ignore\");\nvar eventable = require(\"../../../utils/eventable\");\nvar utils = require(\"../../../utils/utils\");\n\nvar canvasRender = require(\"./tasks_canvas_render\");\n\nvar Timeline = function(parent, config, factory, gantt){\n\tthis.$config = utils.mixin({}, config || {});\n\tthis.$scaleHelper = new ScaleHelper(gantt);\n\tthis.$gantt = gantt;\n\teventable(this);\n};\n\nTimeline.prototype = {\n\tinit: function(container){\n\t\tcontainer.innerHTML += \"\";\n\t\tthis.$task = container.childNodes[0];\n\n\t\tthis.$task.innerHTML = \"\";\n\t\tthis.$task_scale = this.$task.childNodes[0];\n\n\t\tthis.$task_data = this.$task.childNodes[1];\n\t\tthis.$task_data.innerHTML = \"\";\n\t\tthis.$task_bg = this.$task_data.childNodes[0];\n\t\tthis.$task_links = this.$task_data.childNodes[1];\n\t\tthis.$task_bars = this.$task_data.childNodes[2];\n\n\t\tthis._tasks = {\n\t\t\tcol_width: 0,\n\t\t\twidth: [], // width of each column\n\t\t\tfull_width: 0, // width of all columns\n\t\t\ttrace_x: [],\n\t\t\trendered: {}\n\t\t};\n\n\t\tvar config = this.$getConfig();\n\t\tvar attr = config[this.$config.bind + \"_attribute\"];\n\t\tvar linksAttr = config[this.$config.bindLinks + \"_attribute\"];\n\t\tif(!attr && this.$config.bind){\n\t\t\tattr = this.$config.bind + \"_id\";\n\t\t}\n\t\tif(!linksAttr && this.$config.bindLinks){\n\t\t\tlinksAttr = this.$config.bindLinks + \"_id\";\n\t\t}\n\t\tthis.$config.item_attribute = attr || null;\n\t\tthis.$config.link_attribute = linksAttr || null;\n\n\t\tvar layers = this._createLayerConfig();\n\t\tif(!this.$config.layers){\n\t\t\tthis.$config.layers = layers.tasks;\n\t\t}\n\t\tif(!this.$config.linkLayers){\n\t\t\tthis.$config.linkLayers = layers.links;\n\t\t}\n\n\t\tthis._attachLayers(this.$gantt);\n\t\tthis.callEvent(\"onReady\", []);\n\t\t//this.refresh();\n\t},\n\n\tsetSize: function(width, height){\n\t\tvar config = this.$getConfig();\n\n\t\tif(width*1 === width){\n\t\t\tthis.$config.width = width;\n\t\t}\n\t\tif(height*1 === height){\n\n\t\t\tthis.$config.height = height;\n\t\t\tvar dataHeight = Math.max(this.$config.height - config.scale_height);\n\t\t\tthis.$task_data.style.height = dataHeight + 'px';\n\t\t}\n\n\t\tthis.refresh();\n\t\tthis.$task_bg.style.backgroundImage = \"\";\n\n\t\tif(config.smart_rendering && this.$config.rowStore){\n\t\t\tvar store = this.$config.rowStore;\n\t\t\tthis.$task_bg.style.height = config.row_height * store.countVisible() +\"px\";\n\t\t}else{\n\t\t\tthis.$task_bg.style.height = \"\";\n\t\t}\n\n\t\tvar scale = this._tasks;\n\t\t//timeline area layers\n\t\tvar data_els = this.$task_data.childNodes;\n\t\tfor(var i= 0, len = data_els.length; i < len; i++){\n\t\t\tvar el = data_els[i];\n\t\t\tif(el.hasAttribute(\"data-layer\") && el.style)\n\t\t\t\tel.style.width = scale.full_width + \"px\";\n\t\t}\n\t},\n\n\tisVisible: function(){\n\t\tif(this.$parent && this.$parent.$config){\n\t\t\treturn !this.$parent.$config.hidden;\n\t\t}else{\n\t\t\treturn this.$task.offsetWidth;\n\t\t}\n\t},\n\n\tgetSize: function(){\n\t\tvar config = this.$getConfig();\n\t\tvar store = this.$config.rowStore;\n\n\t\tvar contentHeight = store ? config.row_height * store.countVisible() : 0,\n\t\t\tcontentWidth = this._tasks.full_width;\n\n\t\treturn {\n\t\t\tx: this.$config.width,\n\t\t\ty: this.$config.height,\n\t\t\tcontentX: this.isVisible() ? contentWidth : 0,\n\t\t\tcontentY: this.isVisible() ? (config.scale_height + contentHeight) : 0,\n\t\t\tscrollHeight: this.isVisible() ? contentHeight : 0,\n\t\t\tscrollWidth: this.isVisible() ? contentWidth : 0\n\t\t};\n\t},\n\n\tscrollTo: function(left, top){\n\t\tif(!this.isVisible())\n\t\t\treturn;\n\n\t\tif(top*1 === top){\n\t\t\tthis.$config.scrollTop = top;\n\t\t\tthis.$task_data.scrollTop = this.$config.scrollTop;\n\t\t}\n\t\tif (left*1 === left){\n\t\t\tthis.$task.scrollLeft = left;\n\t\t\tthis.$config.scrollLeft = this.$task.scrollLeft;\n\t\t\tthis._refreshScales();\n\t\t}\n\t},\n\n\t_refreshScales: function _refreshScales() {\n\t\tif(!this.isVisible())\n\t\t\treturn;\n\n\t\tvar config = this.$getConfig();\n\t\tif (!config.smart_scales) return;\n\n\t\tvar x = this.$config.scrollLeft;\n\t\tvar width = this.$config.width;\n\n\t\tvar scales = this._scales;\n\t\tthis.$task_scale.innerHTML = this._getScaleChunkHtml(scales, x, x + width);\n\t},\n\t_createLayerConfig: function(){\n\t\tvar self = this;\n\t\tvar taskFilter = function(){\n\t\t\treturn self.isVisible();\n\t\t};\n\n\t\tvar taskLayers = [\n\t\t\t{\n\t\t\t\texpose: true,\n\t\t\t\trenderer: this.$gantt.$ui.layers.taskBar,\n\t\t\t\tcontainer: this.$task_bars,\n\t\t\t\tfilter: [taskFilter]\n\t\t\t},\n\t\t\t{\n\t\t\t\trenderer: this.$gantt.$ui.layers.taskBg,\n\t\t\t\tcontainer: this.$task_bg,\n\t\t\t\tfilter: [\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\treturn !self.$getConfig().static_background;\n\t\t\t\t\t},\n\t\t\t\t\ttaskFilter\n\t\t\t\t]\n\t\t\t}\n\t\t];\n\n\t\tvar linkLayers = [\n\t\t\t{\n\t\t\t\texpose: true,\n\t\t\t\trenderer: this.$gantt.$ui.layers.link,\n\t\t\t\tcontainer: this.$task_links,\n\t\t\t\tfilter: [taskFilter]\n\t\t\t}\n\t\t];\n\n\t\treturn {\n\t\t\ttasks: taskLayers,\n\t\t\tlinks: linkLayers\n\t\t};\n\n\t},\n\n\t_attachLayers: function(gantt){\n\t\tthis._taskLayers = [];\n\t\tthis._linkLayers = [];\n\n\t\tvar self = this;\n\n\t\tvar layers = this.$gantt.$services.getService(\"layers\");\n\n\t\tif(this.$config.bind){\n\n\t\t\tself.$config.rowStore = self.$gantt.getDatastore(self.$config.bind);\n\n\t\t\tvar taskRenderer = layers.getDataRender(this.$config.bind);\n\n\t\t\tif(!taskRenderer){\n\t\t\t\ttaskRenderer = layers.createDataRender({\n\t\t\t\t\tname: this.$config.bind,\n\t\t\t\t\tdefaultContainer: function(){ return self.$task_data;}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\ttaskRenderer.container = function(){ return self.$task_data;};\n\n\t\t\tvar taskLayers = this.$config.layers;\n\t\t\tfor(var i = 0; taskLayers && i < taskLayers.length; i++){\n\t\t\t\tvar layer = taskLayers[i];\n\n\t\t\t\tif(typeof layer == \"string\"){\n\t\t\t\t\tlayer = this.$gantt.$ui.layers[layer];\n\t\t\t\t}\n\n\t\t\t\tif(typeof layer == \"function\"){\n\t\t\t\t\tlayer = {renderer: layer};\n\t\t\t\t}\n\n\t\t\t\tlayer.host = this;\n\t\t\t\tvar bar_layer = taskRenderer.addLayer(layer);\n\t\t\t\tthis._taskLayers.push(bar_layer);\n\t\t\t\tif(layer.expose){\n\t\t\t\t\tthis._taskRenderer = taskRenderer.getLayer(bar_layer);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._initStaticBackgroundRender();\n\t\t}\n\n\t\tif(this.$config.bindLinks){\n\t\t\tself.$config.linkStore = self.$gantt.getDatastore(self.$config.bindLinks);\n\n\t\t\tvar linkRenderer = layers.getDataRender(this.$config.bindLinks);\n\n\t\t\tif(!linkRenderer){\n\t\t\t\tlinkRenderer = layers.createDataRender({\n\t\t\t\t\tname: this.$config.bindLinks,\n\t\t\t\t\tdefaultContainer: function(){ return self.$task_data;}\n\t\t\t\t});\n\t\t\t}\n\t\t\tvar linkLayers = this.$config.linkLayers;\n\t\t\tfor(var i = 0; linkLayers && i < linkLayers.length; i++){\n\n\t\t\t\tif(typeof layer == \"string\"){\n\t\t\t\t\tlayer = this.$gantt.$ui.layers[layer];\n\t\t\t\t}\n\n\t\t\t\tvar layer = linkLayers[i];\n\t\t\t\tlayer.host = this;\n\t\t\t\tvar linkLayer = linkRenderer.addLayer(layer);\n\t\t\t\tthis._taskLayers.push(linkLayer);\n\t\t\t\tif(linkLayers[i].expose){\n\t\t\t\t\tthis._linkRenderer = linkRenderer.getLayer(linkLayer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t_initStaticBackgroundRender: function(){\n\t\tvar self = this;\n\t\tvar staticRender = canvasRender.create();\n\t\tvar store = self.$config.rowStore;\n\t\tif(!store) return;\n\n\t\tthis._staticBgHandler = store.attachEvent(\"onStoreUpdated\", function(id, item, mode){\n\t\t\tif(id !== null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(!self.isVisible())\n\t\t\t\treturn;\n\t\t\tvar config = self.$getConfig();\n\t\t\tif(config.static_background) {\n\t\t\t\tvar store = self.$gantt.getDatastore(self.$config.bind);\n\t\t\t\tif (store) {\n\t\t\t\t\tstaticRender.render(self.$task_bg, config, self.getScale(), config.row_height * store.countVisible());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis._initStaticBackgroundRender = function(){};//init once\n\t},\n\n\t_clearLayers: function(gantt){\n\t\tvar layers = this.$gantt.$services.getService(\"layers\");\n\t\tvar taskRenderer = layers.getDataRender(this.$config.bind);\n\t\tvar linkRenderer = layers.getDataRender(this.$config.bindLinks);\n\n\t\tfor(var i = 0; i < this._taskLayers.length; i++){\n\t\t\ttaskRenderer.removeLayer(this._taskLayers[i]);\n\t\t}\n\t\tfor(var i = 0; i < this._linkLayers.length; i++){\n\t\t\tlinkRenderer.removeLayer(this._linkLayers[i]);\n\t\t}\n\n\t\tthis._linkLayers = [];\n\t\tthis._taskLayers = [];\n\t},\n\n\t_render_tasks_scales: function _render_tasks_scales() {\n\t\tvar config = this.$getConfig();\n\n\t\tvar scales_html = \"\",\n\t\t\touter_width = 0,\n\t\t\tscale_height = 0;\n\n\t\tvar state = this.$gantt.getState();\n\n\t\tif (this.isVisible()) {\n\t\t\tvar helpers = this.$scaleHelper;\n\t\t\tvar scales = this._getScales();\n\t\t\tscale_height = config.scale_height;\n\n\t\t\tvar availWidth = this.$config.width;\n\t\t\tif(config.autosize == \"x\" || config.autosize == \"xy\"){\n\t\t\t\tavailWidth = Math.max(config.autosize_min_width, 0);\n\t\t\t}\n\n\t\t\tvar cfgs = helpers.prepareConfigs(scales, config.min_column_width, availWidth, scale_height - 1, state.min_date, state.max_date, config.rtl);\n\t\t\tvar cfg = this._tasks = cfgs[cfgs.length - 1];\n\t\t\tthis._scales = cfgs;\n\n\t\t\tscales_html = this._getScaleChunkHtml(cfgs, 0, this.$config.width);\n\n\t\t\touter_width = cfg.full_width + \"px\";//cfg.full_width + (this._scroll_sizes().y ? scrollSizes.scroll_size : 0) + \"px\";\n\t\t\tscale_height += \"px\";\n\t\t}\n\n\t\tthis.$task_scale.style.height = scale_height;\n\n\t\tthis.$task_data.style.width =\n\t\t\tthis.$task_scale.style.width = outer_width;\n\n\t\tthis.$task_scale.innerHTML = scales_html;\n\n\t},\n\n\t_getScaleChunkHtml: function _get_scale_chunk_html (scales, fromPos, toPos) {\n\t\tvar templates = this.$gantt.$services.templates();\n\t\tvar html = [];\n\n\t\tvar css = templates.scale_row_class;\n\t\tfor (var i = 0; i < scales.length; i++) {\n\t\t\tvar cssClass = \"gantt_scale_line\";\n\t\t\tvar tplClass = css(scales[i]);\n\t\t\tif (tplClass) {\n\t\t\t\tcssClass += \" \" + tplClass;\n\t\t\t}\n\n\t\t\thtml.push(\"\" + this._prepareScaleHtml(scales[i], fromPos, toPos) + \"
\");\n\t\t}\n\n\t\treturn html.join(\"\");\n\t},\n\t_prepareScaleHtml: function _prepare_scale_html(config, fromPos, toPos) {\n\t\tvar globalConfig = this.$getConfig();\n\t\tvar globalTemplates = this.$gantt.$services.templates();\n\n\t\tvar cells = [];\n\t\tvar date = null, content = null, css = null;\n\n\t\tif (config.template || config.date) {\n\t\t\tcontent = config.template || this.$gantt.date.date_to_str(config.date);\n\t\t}\n\n\t\tvar startIndex = 0,\n\t\t\tendIndex = config.count;\n\n\t\tif (globalConfig.smart_scales && (!isNaN(fromPos) && !isNaN(toPos))) {\n\t\t\tstartIndex = _findBinary(config.left, fromPos);\n\t\t\tendIndex = _findBinary(config.left, toPos) + 1;\n\t\t}\n\n\t\tcss = config.css || function () {\n\t\t\t};\n\t\tif (!config.css && globalConfig.inherit_scale_class) {\n\t\t\tcss = globalTemplates.scale_cell_class;\n\t\t}\n\n\t\tfor (var i = startIndex; i < endIndex; i++) {\n\t\t\tif (!config.trace_x[i]) break;\n\n\t\t\tdate = new Date(config.trace_x[i]);\n\t\t\tvar value = content.call(this, date),\n\t\t\t\twidth = config.width[i],\n\t\t\t\theight = config.height,\n\t\t\t\tleft = config.left[i],\n\t\t\t\tstyle = \"\",\n\t\t\t\ttemplate = \"\",\n\t\t\t\tcssclass = \"\";\n\n\t\t\tif (width) {\n\t\t\t\tvar position = globalConfig.smart_scales ? (\"position:absolute;left:\" + left + \"px\") : \"\";\n\n\t\t\t\tstyle = \"width:\" + (width) + \"px;height:\" + height + \"px;\" + position;\n\t\t\t\tcssclass = \"gantt_scale_cell\" + (i == config.count - 1 ? \" gantt_last_cell\" : \"\");\n\n\t\t\t\ttemplate = css.call(this, date);\n\t\t\t\tif (template) cssclass += \" \" + template;\n\n\t\t\t\tvar ariaAttr = this.$gantt._waiAria.getTimelineCellAttr(value);\n\t\t\t\tvar cell = \"\" + value + \"
\";\n\t\t\t\tcells.push(cell);\n\t\t\t} else {\n\t\t\t\t//do not render ignored cells\n\t\t\t}\n\n\t\t}\n\t\treturn cells.join(\"\");\n\t},\n\tdateFromPos: function dateFromPos(x) {\n\t\tvar scale = this._tasks;\n\t\tif (x < 0 || x > scale.full_width || !scale.full_width) {\n\t\t\treturn null;\n\t\t}\n\n\t\tvar ind = _findBinary(this._tasks.left, x);\n\t\tvar summ = this._tasks.left[ind];\n\n\t\tvar col_width = scale.width[ind] || scale.col_width;\n\t\tvar part = 0;\n\t\tif (col_width) {\n\t\t\tpart = (x - summ) / col_width;\n\t\t\tif(scale.rtl){\n\t\t\t\tpart = 1 - part;\n\t\t\t}\n\n\t\t}\n\n\t\tvar unit = 0;\n\t\tif (part) {\n\t\t\tunit = this._getColumnDuration(scale, scale.trace_x[ind]);\n\t\t}\n\n\t\tvar date = new Date(scale.trace_x[ind].valueOf() + Math.round(part * unit));\n\t\treturn date;\n\t},\n\tposFromDate: function posFromDate(date) {\n\t\tif (!this.isVisible())\n\t\t\treturn 0;\n\n\t\tvar ind = this.columnIndexByDate(date);\n\t\tthis.$gantt.assert(ind >= 0, \"Invalid day index\");\n\n\t\tvar wholeCells = Math.floor(ind);\n\t\tvar partCell = ind % 1;\n\n\t\tvar pos = this._tasks.left[Math.min(wholeCells, this._tasks.width.length - 1)];\n\t\tif (wholeCells == this._tasks.width.length)\n\t\t\tpos += this._tasks.width[this._tasks.width.length - 1];\n\t\t//for(var i=1; i <= wholeCells; i++)\n\t\t//\tpos += gantt._tasks.width[i-1];\n\n\t\tif (partCell) {\n\t\t\tif (wholeCells < this._tasks.width.length) {\n\t\t\t\tpos += this._tasks.width[wholeCells] * (partCell % 1);\n\t\t\t} else {\n\t\t\t\tpos += 1;\n\t\t\t}\n\n\t\t}\n\t\treturn Math.round(pos);\n\t},\n\tcolumnIndexByDate: function columnIndexByDate(date) {\n\t\tvar pos = new Date(date).valueOf();\n\t\tvar days = this._tasks.trace_x_ascending,\n\t\t\tignores = this._tasks.ignore_x;\n\n\t\tvar state = this.$gantt.getState();\n\n\t\tif (pos <= state.min_date) {\n\t\t\tif(this._tasks.rtl){\n\t\t\t\treturn days.length;\n\t\t\t}else{\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t}\n\n\t\tif (pos >= state.max_date) {\n\t\t\tif(this._tasks.rtl){\n\t\t\t\treturn 0;\n\t\t\t}else{\n\t\t\t\treturn days.length;\n\t\t\t}\n\t\t}\n\n\t\t/*var day = null;\n\t\t for (var xind = 0, length = days.length-1; xind < length; xind++) {\n\t\t // | 8:00, 8:30 | 8:15 should be checked against 8:30\n\t\t // clicking at the most left part of the cell, say 8:30 should create event in that cell, not previous one\n\t\t day = +days[xind+1];\n\t\t if (pos < day && !ignores[day])\n\t\t break;\n\t\t }*/\n\n\t\tvar day_ind = _findBinary(days, pos);\n\t\tvar day = +days[day_ind];\n\t\twhile (ignores[day]) {\n\t\t\tday = days[++day_ind];\n\t\t}\n\n\t\tvar transition = this._tasks.trace_index_transition;\n\t\tvar index = day_ind;\n\t\tif(!day){\n\t\t\tif(transition){\n\t\t\t\treturn transition[0];\n\t\t\t}else{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tvar part = ((date - days[day_ind]) / this._getColumnDuration(this._tasks, days[day_ind]));\n\t\tif(transition){\n\t\t\treturn transition[index] + (1 - part);\n\t\t}else{\n\t\t\treturn index + part;\n\t\t}\n\n\t\t//return day_ind + ((date - days[day_ind]) / this._getColumnDuration(this._tasks, days[day_ind]));\n\t},\n\tgetItemPosition:function (task, start_date, end_date) {\n\t\tvar xLeft, xRight, width;\n\t\tif(this._tasks.rtl){\n\t\t\txRight = this.posFromDate(start_date || task.start_date);\n\t\t\txLeft = this.posFromDate(end_date || task.end_date);\n\t\t}else{\n\t\t\txLeft = this.posFromDate(start_date || task.start_date);\n\t\t\txRight = this.posFromDate(end_date || task.end_date);\n\t\t}\n\t\twidth = Math.max((xRight - xLeft), 0);\n\n\t\tvar y = this.getItemTop(task.id);\n\t\tvar height = this.getItemHeight();\n\t\treturn {\n\t\t\tleft: xLeft,\n\t\t\ttop: y,\n\t\t\theight: height,\n\t\t\twidth: width\n\t\t};\n\t},\n\n\tgetItemHeight: function(){\n\t\tvar config = this.$getConfig();\n\n\t\t// height of the bar item\n\t\tvar height = config.task_height;\n\n\t\tif (height == \"full\") {\n\t\t\tvar offset = config.task_height_offset || 5;\n\t\t\theight = config.row_height - offset;\n\t\t}\n\t\t//item height cannot be bigger than row height\n\t\theight = Math.min(height, config.row_height);\n\t\treturn Math.max(height, 0);\n\t},\n\n\tgetRowTop: function(index){\n\t\treturn index * this.$getConfig().row_height;\n\t},\n\n\tgetItemTop: function (task_id) {\n\t\tif(this.$config.rowStore){\n\t\t\tvar store = this.$config.rowStore;\n\t\t\tif(!store) return 0;\n\n\t\t\treturn store.getIndexById(task_id) * this.$getConfig().row_height;\n\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\n\t},\n\n\tgetScale: function(){\n\t\treturn this._tasks;\n\t},\n\n\t_getScales: function _get_scales() {\n\t\tvar config = this.$getConfig();\n\t\tvar helpers = this.$scaleHelper;\n\t\tvar scales = [helpers.primaryScale()].concat(config.subscales);\n\n\t\thelpers.sortScales(scales);\n\t\treturn scales;\n\t},\n\n\t_getColumnDuration: function _get_coll_duration(scale, date) {\n\t\treturn this.$gantt.date.add(date, scale.step, scale.unit) - date;\n\t},\n\n\trefresh: function(){\n\t\tif(this.$config.bind) {\n\t\t\tthis.$config.rowStore = this.$gantt.getDatastore(this.$config.bind);\n\t\t}\n\n\t\tif(this.$config.bindLinks) {\n\t\t\tthis.$config.linkStore = this.$gantt.getDatastore(this.$config.bindLinks);\n\t\t}\n\n\t\tthis._initStaticBackgroundRender();\n\t\tthis._render_tasks_scales();\n\t},\n\n\tdestructor: function(){\n\t\tvar gantt = this.$gantt;\n\t\tthis._clearLayers(gantt);\n\n\t\tthis.$task = null;\n\t\tthis.$task_scale = null;\n\t\tthis.$task_data = null;\n\t\tthis.$task_bg = null;\n\t\tthis.$task_links = null;\n\t\tthis.$task_bars = null;\n\n\t\tthis.$gantt = null;\n\n\t\tif(this.$config.rowStore){\n\t\t\tthis.$config.rowStore.detachEvent(this._staticBgHandler);\n\t\t\tthis.$config.rowStore = null;\n\t\t}\n\t\tif(this.$config.linkStore){\n\t\t\tthis.$config.linkStore = null;\n\t\t}\n\n\t\tthis.callEvent(\"onDestroy\", []);\n\t\tthis.detachAllEvents();\n\n\t}\n};\n\nmodule.exports = Timeline;\n\nfunction _findBinary(array, target) {\n\t// modified binary search, target value not exactly match array elements, looking for closest one\n\n\tvar low = 0, high = array.length - 1, i, item, prev;\n\twhile (low <= high) {\n\n\t\ti = Math.floor((low + high) / 2);\n\t\titem = +array[i];\n\t\tprev = +array[i - 1];\n\t\tif (item < target) {\n\t\t\tlow = i + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (item > target) {\n\t\t\tif (!(!isNaN(prev) && prev < target)) {\n\t\t\t\thigh = i - 1;\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t// if target is between 'i' and 'i-1' return 'i - 1'\n\t\t\t\treturn i - 1;\n\t\t\t}\n\n\t\t}\n\t\twhile (+array[i] == +array[i + 1]) i++;\n\n\t\treturn i;\n\t}\n\treturn array.length - 1;\n}\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/timeline/timeline.js\n// module id = 12\n// module chunks = 0","var utils = require(\"../../../utils/utils\");\n\nfunction ScaleHelper(gantt){\n\tvar dateHelper = gantt.date;\n\tvar services = gantt.$services;\n\n\treturn {\n\t\tgetSum: function (sizes, from, to) {\n\t\t\tif (to === undefined)\n\t\t\t\tto = sizes.length - 1;\n\t\t\tif (from === undefined)\n\t\t\t\tfrom = 0;\n\n\t\t\tvar summ = 0;\n\t\t\tfor (var i = from; i <= to; i++)\n\t\t\t\tsumm += sizes[i];\n\n\t\t\treturn summ;\n\t\t},\n\t\tsetSumWidth: function (sum_width, scale, from, to) {\n\t\t\tvar parts = scale.width;\n\n\t\t\tif (to === undefined)\n\t\t\t\tto = parts.length - 1;\n\t\t\tif (from === undefined)\n\t\t\t\tfrom = 0;\n\t\t\tvar length = to - from + 1;\n\n\t\t\tif (from > parts.length - 1 || length <= 0 || to > parts.length - 1)\n\t\t\t\treturn;\n\n\t\t\tvar oldWidth = this.getSum(parts, from, to);\n\n\t\t\tvar diff = sum_width - oldWidth;\n\n\t\t\tthis.adjustSize(diff, parts, from, to);\n\t\t\tthis.adjustSize(-diff, parts, to + 1);\n\n\t\t\tscale.full_width = this.getSum(parts);\n\t\t},\n\t\tsplitSize: function (width, count) {\n\t\t\tvar arr = [];\n\t\t\tfor (var i = 0; i < count; i++) arr[i] = 0;\n\n\t\t\tthis.adjustSize(width, arr);\n\t\t\treturn arr;\n\n\t\t},\n\t\tadjustSize: function (width, parts, from, to) {\n\t\t\tif (!from)\n\t\t\t\tfrom = 0;\n\t\t\tif (to === undefined)\n\t\t\t\tto = parts.length - 1;\n\n\t\t\tvar length = to - from + 1;\n\n\t\t\tvar full = this.getSum(parts, from, to);\n\n\t\t\tvar shared = 0;\n\n\t\t\tfor (var i = from; i <= to; i++) {\n\t\t\t\tvar share = Math.floor(width * (full ? (parts[i] / full) : (1 / length)));\n\n\t\t\t\tfull -= parts[i];\n\t\t\t\twidth -= share;\n\t\t\t\tlength--;\n\n\t\t\t\tparts[i] += share;\n\t\t\t\tshared += share;\n\t\t\t}\n\t\t\tparts[parts.length - 1] += width;\n\t\t\t//parts[parts.length - 1] += width - shared;\n\t\t},\n\t\tsortScales: function (scales) {\n\t\t\tfunction cellSize(unit, step) {\n\t\t\t\tvar d = new Date(1970, 0, 1);\n\t\t\t\treturn dateHelper.add(d, step, unit) - d;\n\t\t\t}\n\n\t\t\tscales.sort(function (a, b) {\n\t\t\t\tif (cellSize(a.unit, a.step) < cellSize(b.unit, b.step)) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (cellSize(a.unit, a.step) > cellSize(b.unit, b.step)) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tfor (var i = 0; i < scales.length; i++) {\n\t\t\t\tscales[i].index = i;\n\t\t\t}\n\t\t},\n\t\tprimaryScale: function () {\n\n\t\t\tvar config = services.getService(\"templateLoader\");\n\t\t\tconfig.initTemplate(\"date_scale\", undefined, undefined, services.config(), services.templates());\n\n\t\t\treturn {\n\t\t\t\tunit: services.config().scale_unit,\n\t\t\t\tstep: services.config().step,\n\t\t\t\ttemplate: services.templates().date_scale,\n\t\t\t\tdate: services.config().date_scale,\n\t\t\t\tcss: services.templates().scale_cell_class\n\t\t\t};\n\t\t},\n\n\t\tprepareConfigs: function (scales, min_coll_width, container_width, scale_height, minDate, maxDate, rtl) {\n\t\t\tvar heights = this.splitSize(scale_height, scales.length);\n\t\t\tvar full_width = container_width;\n\n\t\t\tvar configs = [];\n\t\t\tfor (var i = scales.length - 1; i >= 0; i--) {\n\t\t\t\tvar main_scale = (i == scales.length - 1);\n\t\t\t\tvar cfg = this.initScaleConfig(scales[i], minDate, maxDate);\n\t\t\t\tif (main_scale) {\n\t\t\t\t\tthis.processIgnores(cfg);\n\t\t\t\t}\n\n\t\t\t\tthis.initColSizes(cfg, min_coll_width, full_width, heights[i]);\n\t\t\t\tthis.limitVisibleRange(cfg);\n\n\t\t\t\tif (main_scale) {\n\t\t\t\t\tfull_width = cfg.full_width;\n\t\t\t\t}\n\n\t\t\t\tconfigs.unshift(cfg);\n\t\t\t}\n\n\n\t\t\tfor (var i = 0; i < configs.length - 1; i++) {\n\t\t\t\tthis.alineScaleColumns(configs[configs.length - 1], configs[i]);\n\t\t\t}\n\t\t\tfor (var i = 0; i < configs.length; i++) {\n\n\t\t\t\tif(rtl){\n\t\t\t\t\tthis.reverseScale(configs[i]);\n\t\t\t\t}\n\t\t\t\tthis.setPosSettings(configs[i]);\n\t\t\t}\n\t\t\treturn configs;\n\n\t\t},\n\n\t\treverseScale: function(scale){\n\t\t\tscale.width = scale.width.reverse();\n\t\t\tscale.trace_x = scale.trace_x.reverse();\n\n\t\t\tvar indexes = scale.trace_indexes;\n\t\t\tscale.trace_indexes = {};\n\t\t\tscale.trace_index_transition = {};\n\t\t\tscale.rtl = true;\n\t\t\tfor(var i = 0; i < scale.trace_x.length; i++){\n\t\t\t\tscale.trace_indexes[scale.trace_x[i].valueOf()] = i;\n\t\t\t\tscale.trace_index_transition[indexes[scale.trace_x[i].valueOf()]] = i;\n\t\t\t}\n\t\t\treturn scale;\n\t\t},\n\n\t\tsetPosSettings: function (config) {\n\t\t\tfor (var i = 0, len = config.trace_x.length; i < len; i++) {\n\t\t\t\tconfig.left.push((config.width[i - 1] || 0) + (config.left[i - 1] || 0));\n\t\t\t}\n\t\t},\n\n\t\t_ignore_time_config: function (date, scale) {\n\n\t\t\tif (services.config().skip_off_time) {\n\t\t\t\tvar skip = true;\n\t\t\t\tvar probe = date;\n\n\t\t\t\t// check dates in case custom scale unit, e.g. {unit: \"month\", step: 3}\n\t\t\t\tfor (var i = 0; i < scale.step; i++) {\n\t\t\t\t\tif (i) {\n\t\t\t\t\t\tprobe = dateHelper.add(date, i, scale.unit);\n\t\t\t\t\t}\n\n\t\t\t\t\tskip = skip && !this.isWorkTime(probe, scale.unit);\n\t\t\t\t}\n\n\t\t\t\treturn skip;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\t//defined in an extension\n\t\tprocessIgnores: function (config) {\n\t\t\tconfig.ignore_x = {};\n\t\t\tconfig.display_count = config.count;\n\t\t},\n\t\tinitColSizes: function (config, min_col_width, full_width, line_height) {\n\t\t\tvar cont_width = full_width;\n\n\t\t\tconfig.height = line_height;\n\n\t\t\tvar column_count = config.display_count === undefined ? config.count : config.display_count;\n\n\t\t\tif (!column_count)\n\t\t\t\tcolumn_count = 1;\n\n\t\t\tconfig.col_width = Math.floor(cont_width / column_count);\n\n\t\t\tif (min_col_width) {\n\t\t\t\tif (config.col_width < min_col_width) {\n\t\t\t\t\tconfig.col_width = min_col_width;\n\t\t\t\t\tcont_width = config.col_width * column_count;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconfig.width = [];\n\t\t\tvar ignores = config.ignore_x || {};\n\t\t\tfor (var i = 0; i < config.trace_x.length; i++) {\n\t\t\t\tif (ignores[config.trace_x[i].valueOf()] || (config.display_count == config.count)) {\n\t\t\t\t\tconfig.width[i] = 0;\n\t\t\t\t} else {\n\t\t\t\t\t// width of month columns should be proportional month duration\n\t\t\t\t\tvar width = 1;\n\t\t\t\t\tif (config.unit == \"month\") {\n\t\t\t\t\t\tvar days = Math.round((dateHelper.add(config.trace_x[i], config.step, config.unit) - config.trace_x[i]) / (1000 * 60 * 60 * 24));\n\t\t\t\t\t\twidth = days;\n\t\t\t\t\t}\n\t\t\t\t\tconfig.width[i] = width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.adjustSize(cont_width - this.getSum(config.width)/* 1 width per column from the code above */, config.width);\n\t\t\tconfig.full_width = this.getSum(config.width);\n\t\t},\n\t\tinitScaleConfig: function (config, min_date, max_date) {\n\t\t\tvar cfg = utils.mixin({\n\t\t\t\tcount: 0,\n\t\t\t\tcol_width: 0,\n\t\t\t\tfull_width: 0,\n\t\t\t\theight: 0,\n\t\t\t\twidth: [],\n\t\t\t\tleft: [],\n\t\t\t\ttrace_x: [],\n\t\t\t\ttrace_indexes: {},\n\t\t\t\tmin_date: new Date(min_date),\n\t\t\t\tmax_date: new Date(max_date)\n\t\t\t}, config);\n\n\t\t\tthis.eachColumn(config.unit, config.step, min_date, max_date, function (date) {\n\t\t\t\tcfg.count++;\n\t\t\t\tcfg.trace_x.push(new Date(date));\n\t\t\t\tcfg.trace_indexes[date.valueOf()] = cfg.trace_x.length - 1;\n\t\t\t});\n\n\t\t\tcfg.trace_x_ascending = cfg.trace_x.slice();\n\t\t\treturn cfg;\n\t\t},\n\t\titerateScales: function (lower_scale, upper_scale, from, to, callback) {\n\t\t\tvar upper_dates = upper_scale.trace_x;\n\t\t\tvar lower_dates = lower_scale.trace_x;\n\n\t\t\tvar prev = from || 0;\n\t\t\tvar end = to || (lower_dates.length - 1);\n\t\t\tvar prevUpper = 0;\n\n\n\t\t\tfor (var up = 1; up < upper_dates.length; up++) {\n\t\t\t\tvar target_index = (lower_scale.trace_indexes[+upper_dates[up]]);\n\t\t\t\tif (target_index !== undefined && target_index <= end) {\n\t\t\t\t\tif (callback) {\n\t\t\t\t\t\tcallback.apply(this, [prevUpper, up, prev, target_index]);\n\t\t\t\t\t}\n\t\t\t\t\tprev = target_index;\n\t\t\t\t\tprevUpper = up;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\talineScaleColumns: function (lower_scale, upper_scale, from, to) {\n\t\t\tthis.iterateScales(lower_scale, upper_scale, from, to, function (upper_start, upper_end, lower_start, lower_end) {\n\t\t\t\tvar targetWidth = this.getSum(lower_scale.width, lower_start, lower_end - 1);\n\t\t\t\tvar actualWidth = this.getSum(upper_scale.width, upper_start, upper_end - 1);\n\t\t\t\tif (actualWidth != targetWidth) {\n\t\t\t\t\tthis.setSumWidth(targetWidth, upper_scale, upper_start, upper_end - 1);\n\t\t\t\t}\n\n\t\t\t});\n\t\t},\n\n\t\teachColumn: function (unit, step, min_date, max_date, callback) {\n\t\t\tvar start = new Date(min_date),\n\t\t\t\tend = new Date(max_date);\n\t\t\tif (dateHelper[unit + \"_start\"]) {\n\t\t\t\tstart = dateHelper[unit + \"_start\"](start);\n\t\t\t}\n\n\t\t\tvar curr = new Date(start);\n\t\t\tif (+curr >= +end) {\n\t\t\t\tend = dateHelper.add(curr, step, unit);\n\t\t\t}\n\t\t\twhile (+curr < +end) {\n\t\t\t\tcallback.call(this, new Date(curr));\n\t\t\t\tvar tzOffset = curr.getTimezoneOffset();\n\t\t\t\tcurr = dateHelper.add(curr, step, unit);\n\t\t\t\tcurr = gantt._correct_dst_change(curr, tzOffset, step, unit);\n\t\t\t\tif (dateHelper[unit + '_start'])\n\t\t\t\t\tcurr = dateHelper[unit + \"_start\"](curr);\n\t\t\t}\n\t\t},\n\t\tlimitVisibleRange: function (cfg) {\n\t\t\tvar dates = cfg.trace_x;\n\n\t\t\tvar left = 0, right = cfg.width.length - 1;\n\t\t\tvar diff = 0;\n\t\t\tif (+dates[0] < +cfg.min_date && left != right) {\n\t\t\t\tvar width = Math.floor(cfg.width[0] * ((dates[1] - cfg.min_date) / (dates[1] - dates[0])));\n\t\t\t\tdiff += cfg.width[0] - width;\n\t\t\t\tcfg.width[0] = width;\n\n\t\t\t\tdates[0] = new Date(cfg.min_date);\n\t\t\t}\n\n\t\t\tvar last = dates.length - 1;\n\t\t\tvar lastDate = dates[last];\n\t\t\tvar outDate = dateHelper.add(lastDate, cfg.step, cfg.unit);\n\t\t\tif (+outDate > +cfg.max_date && last > 0) {\n\t\t\t\tvar width = cfg.width[last] - Math.floor(cfg.width[last] * ((outDate - cfg.max_date) / (outDate - lastDate)));\n\t\t\t\tdiff += cfg.width[last] - width;\n\t\t\t\tcfg.width[last] = width;\n\t\t\t}\n\n\t\t\tif (diff) {\n\t\t\t\tvar full = this.getSum(cfg.width);\n\t\t\t\tvar shared = 0;\n\t\t\t\tfor (var i = 0; i < cfg.width.length; i++) {\n\t\t\t\t\tvar share = Math.floor(diff * (cfg.width[i] / full));\n\t\t\t\t\tcfg.width[i] += share;\n\t\t\t\t\tshared += share;\n\t\t\t\t}\n\t\t\t\tthis.adjustSize(diff - shared, cfg.width);\n\t\t\t}\n\n\t\t}\n\t};\n}\n\nmodule.exports = ScaleHelper;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/timeline/scales.js\n// module id = 13\n// module chunks = 0","var domHelpers = require(\"../../../utils/dom_helpers\"),\n\tutils = require(\"../../../utils/utils\"),\n\teventable = require(\"../../../utils/eventable\"),\n\tgridResize = require(\"./grid_resize\");\n\nvar Grid = function(parent, config, factory, gantt){\n\tthis.$config = utils.mixin({}, config || {});\n\tthis.$gantt = gantt;\n\tthis.$parent = parent;\n\teventable(this);\n\tthis.$state = {};\n};\n\nGrid.prototype = {\n\tinit: function(container){\n\t\tvar gantt = this.$gantt;\n\t\tvar gridAriaAttr = gantt._waiAria.gridAttrString();\n\t\tvar gridDataAriaAttr = gantt._waiAria.gridDataAttrString();\n\n\t\tcontainer.innerHTML = \"\";\n\t\tthis.$grid = container.childNodes[0];\n\n\t\tthis.$grid.innerHTML = \"\";\n\n\t\tthis.$grid_scale = this.$grid.childNodes[0];\n\t\tthis.$grid_data = this.$grid.childNodes[1];\n\n\t\tvar attr = this.$getConfig()[this.$config.bind + \"_attribute\"];\n\t\tif(!attr && this.$config.bind){\n\t\t\tattr = this.$config.bind + \"_id\";\n\t\t}\n\t\tthis.$config.item_attribute = attr || null;\n\t\t\n\t\tif(!this.$config.layers){\n\t\t\tvar layers = this._createLayerConfig();\n\t\t\tthis.$config.layers = layers;\n\t\t}\n\n\t\tvar resizer = gridResize(gantt, this);\n\t\tresizer.init();\n\t\tthis._renderHeaderResizers = resizer.doOnRender;\n\t\tthis._mouseDelegates = require(\"../mouse_event_container\")(gantt);\n\n\t\tthis._addLayers(this.$gantt);\n\t\tthis._initEvents();\n\t\tthis.callEvent(\"onReady\", []);\n\t\t//this.refresh();\n\t},\n\tsetSize: function(width, height){\n\t\tthis.$config.width = this.$state.width = width;\n\t\tthis.$state.height = height;\n\n\t\t// TODO: maybe inherit and override in a subclass instead of extending here\n\n\t\tvar columns = this.getGridColumns(),\n\t\t\tinnerWidth = 0;\n\n\t\tfor (var i = 0, l = columns.length; i < l; i++) {\n\t\t\tinnerWidth += columns[i].width*1;\n\t\t}\n\n\t\tvar outerWidth;\n\t\tif(isNaN(innerWidth) || !this.$config.scrollable){\n\t\t\touterWidth = this._setColumnsWidth(width + 1);\n\t\t\tinnerWidth = outerWidth;\n\t\t}\n\n\t\tif(this.$config.scrollable){\n\t\t\tthis.$grid_scale.style.width = innerWidth + \"px\";\n\t\t\tthis.$grid_data.style.width = innerWidth + \"px\";\n\t\t}else{\n\t\t\tthis.$grid_scale.style.width = \"inherit\";\n\t\t\tthis.$grid_data.style.width = \"inherit\";\n\t\t}\n\t\tthis.$config.width -= 1;\n\n\t\tvar config = this.$getConfig();\n\t\tif(outerWidth !== width){\n\t\t\tconfig.grid_width = outerWidth;\n\t\t\tthis.$config.width = outerWidth - 1;\n\t\t}\n\n\t\tvar dataHeight = Math.max(this.$state.height - config.scale_height, 0);\n\t\tthis.$grid_data.style.height = dataHeight + \"px\";\n\t\tthis.refresh();\n\t},\n\tgetSize: function(){\n\n\t\tvar config = this.$getConfig();\n\n\t\tvar store = this.$config.rowStore;\n\n\t\tvar contentHeight = store ? config.row_height * store.countVisible() : 0,\n\t\t\tcontentWidth = this._getGridWidth();\n\n\t\tvar size = {\n\t\t\tx: this.$state.width,\n\t\t\ty: this.$state.height,\n\t\t\tcontentX: this.isVisible() ? contentWidth: 0,\n\t\t\tcontentY: this.isVisible() ? (config.scale_height + contentHeight) : 0,\n\t\t\tscrollHeight: this.isVisible() ? contentHeight: 0,\n\t\t\tscrollWidth: this.isVisible() ? contentWidth : 0\n\t\t};\n\n\t\treturn size;\n\t},\n\trefresh: function(){\n\t\tif(this.$config.bind)\n\t\t\tthis.$config.rowStore = this.$gantt.getDatastore(this.$config.bind);\n\n\t\tthis._initSmartRenderingPlaceholder();\n\n\t\tthis._calculateGridWidth();\n\t\tthis._renderGridHeader();\n\t},\n\tscrollTo: function(left, top){\n\t\tif(!this.isVisible())\n\t\t\treturn;\n\n\t\tif (left*1 == left){\n\t\t\tthis.$state.scrollLeft = this.$grid.scrollLeft = left;\n\t\t}\n\n\t\t// var config = this.$getConfig();\n\t\tif(top*1 == top){\n\t\t\tthis.$state.scrollTop = this.$grid_data.scrollTop = top;\n\t\t}\n\t},\n\tgetGridColumns: function(){\n\t\tvar config = this.$getConfig();\n\t\treturn config.columns.slice();\n\t},\n\tisVisible: function(){\n\t\tif(this.$parent && this.$parent.$config){\n\t\t\treturn !this.$parent.$config.hidden;\n\t\t}else{\n\t\t\treturn this.$grid.offsetWidth;\n\t\t}\n\t},\n\n\tgetItemTop: function(id){\n\t\tif(this.$config.rowStore){\n\t\t\tvar store = this.$config.rowStore;\n\t\t\tif(!store) return 0;\n\n\t\t\treturn store.getIndexById(id) * this.$getConfig().row_height;\n\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t},\n\n\t_createLayerConfig: function(){\n\t\tvar gantt = this.$gantt;\n\t\tvar self = this;\n\t\tvar layers = [\n\t\t\t{\n\t\t\t\trenderer: gantt.$ui.layers.gridLine,\n\t\t\t\tcontainer: this.$grid_data,\n\t\t\t\tfilter: [function(){\n\t\t\t\t\treturn self.isVisible();\n\t\t\t\t}]\n\t\t\t}\n\t\t];\n\t\treturn layers;\n\t},\n\n\t_addLayers: function(gantt){\n\t\tif(!this.$config.bind)\n\t\t\treturn;\n\n\t\tthis._taskLayers = [];\n\n\t\tvar self = this;\n\n\t\tvar layers = this.$gantt.$services.getService(\"layers\");\n\t\tvar taskRenderer = layers.getDataRender(this.$config.bind);\n\n\t\tif(!taskRenderer){\n\t\t\ttaskRenderer = layers.createDataRender({\n\t\t\t\tname: this.$config.bind,\n\t\t\t\tdefaultContainer: function(){ return self.$grid_data;}\n\t\t\t});\n\t\t}\n\n\t\tvar taskLayers = this.$config.layers;\n\t\tfor(var i = 0; taskLayers && i < taskLayers.length; i++){\n\t\t\tvar layer = taskLayers[i];\n\t\t\tlayer.host = this;\n\t\t\tvar bar_layer = taskRenderer.addLayer(layer);\n\t\t\tthis._taskLayers.push(bar_layer);\n\t\t}\n\n\t\tif(this.$config.bind)\n\t\t\tthis.$config.rowStore = this.$gantt.getDatastore(this.$config.bind);\n\n\t\tthis._initSmartRenderingPlaceholder();\n\t},\n\n\t_initSmartRenderingPlaceholder: function(){\n\t\tvar self = this;\n\t\tvar store = this.$config.rowStore;\n\t\tif(!store){\n\t\t\treturn;\n\t\t}else{\n\t\t\tthis._initSmartRenderingPlaceholder = function(){};\n\t\t}\n\t\tthis._staticBgHandler = store.attachEvent(\"onStoreUpdated\", function(id, item, mode){\n\t\t\tif(id !== null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(!self.isVisible())\n\t\t\t\treturn;\n\t\t\tvar config = self.$getConfig();\n\t\t\tif(config.smart_rendering) {\n\t\t\t\tvar contentHeight = store ? config.row_height * store.countVisible() : 0;\n\t\t\t\tif(contentHeight){\n\t\t\t\t\tif(self.$rowsPlaceholder && self.$rowsPlaceholder.parentNode){\n\t\t\t\t\t\tself.$rowsPlaceholder.parentNode.removeChild(self.$rowsPlaceholder);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar placeholder = self.$rowsPlaceholder = document.createElement(\"div\");\n\t\t\t\t\tplaceholder.style.visibility = \"hidden\";\n\t\t\t\t\tplaceholder.style.height = contentHeight + \"px\";\n\t\t\t\t\tplaceholder.style.width = \"1px\";\n\t\t\t\t\tself.$grid_data.appendChild(placeholder);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n\n\t_initEvents: function(){\n\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_close\", gantt.bind(function (e, id, trg) {\n\t\t\tvar store = this.$config.rowStore;\n\t\t\tif(!store) return true;\n\n\t\t\tvar target = domHelpers.locateAttribute(e, this.$config.item_attribute);\n\t\t\tif(target){\n\t\t\t\tstore.close(target.getAttribute(this.$config.item_attribute));\n\n\t\t\t}\n\t\t\treturn false;\n\t\t}, this), this.$grid);\n\n\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_open\", gantt.bind(function (e, id, trg) {\n\t\t\tvar store = this.$config.rowStore;\n\t\t\tif(!store) return true;\n\n\t\t\tvar target = domHelpers.locateAttribute(e, this.$config.item_attribute);\n\t\t\tif(target){\n\t\t\t\tstore.open(target.getAttribute(this.$config.item_attribute));\n\n\t\t\t}\n\t\t\treturn false;\n\t\t}, this), this.$grid);\n\t},\n\n\t_clearLayers: function(gantt){\n\t\tvar layers = this.$gantt.$services.getService(\"layers\");\n\t\tvar taskRenderer = layers.getDataRender(this.$config.bind);\n\n\t\tfor(var i = 0; i < this._taskLayers.length; i++){\n\t\t\ttaskRenderer.removeLayer(this._taskLayers[i]);\n\t\t}\n\n\t\tthis._taskLayers = [];\n\t},\n\n\t_getColumnWidth: function(column, config, width) {\n\t\tvar min_width = column.min_width || config.min_grid_column_width;\n\t\tvar new_width = Math.max(width, min_width || 10);\n\t\tif (column.max_width)\n\t\t\tnew_width = Math.min(new_width, column.max_width);\n\t\treturn new_width;\n\t},\n\t// return min and max possible grid width according to restricts\n\t_getGridWidthLimits: function() {\n\t\tvar config = this.$getConfig(),\n\t\t\tcolumns = this.getGridColumns(),\n\t\t\tmin_limit = 0,\n\t\t\tmax_limit = 0;\n\n\t\t\tfor (var i=0; i col.max_width)\n\t\t\t\tshare = col.max_width - col.width;\n\n\t\t\tcolumns_width -= col.width;\n\t\t\tcol.width += share;\n\t\t\textra_width -= share;\n\n\t\t}\n\n\t\tvar iterator = extra_width > 0 ? 1 : -1;\n\t\twhile ((extra_width > 0 && iterator === 1) || (extra_width < 0 && iterator === -1)) {\n\t\t\tvar curExtra = extra_width;\n\t\t\tfor (i = start_index+1; i -1) {\n\t\t\tvar new_width = columns[start_index].width + extra_width;\n\t\t\tif (new_width == this._getColumnWidth(columns[start_index], config, new_width))\n\t\t\t\tcolumns[start_index].width = new_width;\n\t\t}\n\n\t\t//if (this.callEvent(\"onGridResizeEnd\", [config.grid_width, final_width]) === false)\n\t\t//\treturn;\n\n\t\treturn this._getColsTotalWidth();\n\t},\n\n\t_getColsTotalWidth: function(){\n\t\tvar columns = this.getGridColumns();\n\t\tvar cols_width = 0;\n\n\t\tfor (var i = 0; i < columns.length; i++) {\n\t\t\tvar v = parseFloat(columns[i].width);\n\t\t\tif (window.isNaN(v)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcols_width += v;\n\t\t}\n\t\treturn cols_width;\n\t},\n\t_calculateGridWidth: function() {\n\t\tvar config = this.$getConfig();\n\t\tvar columns = this.getGridColumns();\n\t\tvar cols_width = 0;\n\t\tvar unknown = [];\n\t\tvar width = [];\n\n\t\tfor (var i = 0; i < columns.length; i++) {\n\t\t\tvar v = parseFloat(columns[i].width);\n\t\t\tif (window.isNaN(v)) {\n\t\t\t\tv = config.min_grid_column_width || 10;\n\t\t\t\tunknown.push(i);\n\t\t\t}\n\t\t\twidth[i] = v;\n\t\t\tcols_width += v;\n\t\t}\n\t\tvar gridWidth = this._getGridWidth() + 1;\n\t\tif (config.autofit || unknown.length) {\n\t\t\tvar diff = gridWidth - cols_width;\n\t\t\t// TODO: logic may be improved for proportional changing of width\n\t\t\tif (config.autofit) {\n\t\t\t\t// delta must be added for all columns\n\t\t\t\tfor (var i = 0; i < width.length; i++) {\n\t\t\t\t\tvar delta = Math.round(diff / (width.length-i));\n\t\t\t\t\twidth[i] += delta;\n\t\t\t\t\tvar new_width = this._getColumnWidth(columns[i], config, width[i]);\n\t\t\t\t\t\n\t\t\t\t\tif (new_width != width[i]) {\n\t\t\t\t\t\tdelta = new_width - width[i];\n\t\t\t\t\t\twidth[i] = new_width;\n\t\t\t\t\t}\n\t\t\t\t\tdiff -= delta;\n\t\t\t\t}\n\t\t\t} else if (unknown.length) {\n\t\t\t\t// there are several columns with undefined width\n\t\t\t\tfor (var i = 0; i < unknown.length; i++) {\n\t\t\t\t\tvar delta = Math.round(diff / (unknown.length-i)); // no float values, just integer\n\t\t\t\t\tvar index = unknown[i];\n\t\t\t\t\twidth[index] += delta;\n\t\t\t\t\tvar new_width = this._getColumnWidth(columns[index], config, width[index]);\n\t\t\t\t\tif (new_width != width[index]) {\n\t\t\t\t\t\tdelta = new_width - width[index];\n\t\t\t\t\t\twidth[index] = new_width;\n\t\t\t\t\t}\n\t\t\t\t\tdiff -= delta;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < width.length; i++) {\n\t\t\t\tcolumns[i].width = width[i];\n\t\t\t}\n\t\t} else {\n\t\t\tvar changed = (gridWidth != cols_width);\n\t\t\tthis.$config.width = cols_width - 1;\n\t\t\tconfig.grid_width = cols_width;\n\t\t\tif(changed){\n\t\t\t\tthis.$parent._setContentSize(this.$config.width, this.$config.height);\n//\t\t\t\tthis.$parent.$config.width = cols_width;\n\t\t\t}\n\t\t}\n\n\t},\n\n\t_renderGridHeader: function(){\n\t\tvar gantt = this.$gantt;\n\t\tvar config = this.$getConfig();\n\t\tvar locale = this.$gantt.locale;\n\t\tvar templates = this.$gantt.templates;\n\n\t\tvar columns = this.getGridColumns();\n\t\tif(config.rtl){\n\t\t\tcolumns = columns.reverse();\n\t\t}\n\t\tvar cells = [];\n\t\tvar width = 0,\n\t\t\tlabels = locale.labels;\n\n\t\tvar lineHeigth = config.scale_height - 1;\n\n\t\tfor (var i = 0; i < columns.length; i++) {\n\t\t\tvar last = i == columns.length - 1;\n\t\t\tvar col = columns[i];\n\n\t\t\t// ensure columns have non-empty names\n\t\t\tif (!col.name) {\n\t\t\t\tcol.name = gantt.uid() + \"\";\n\t\t\t}\n\n\t\t\tvar colWidth = col.width * 1;\n\n\t\t\tvar gridWidth = this._getGridWidth();\n\t\t\tif (last && gridWidth > width + colWidth)\n\t\t\t\tcol.width = colWidth = gridWidth - width;\n\t\t\twidth += colWidth;\n\t\t\tvar sort = (gantt._sort && col.name == gantt._sort.name) ? (\"\") : \"\";\n\t\t\tvar cssClass = [\"gantt_grid_head_cell\",\n\t\t\t\t(\"gantt_grid_head_\" + col.name),\n\t\t\t\t(last ? \"gantt_last_cell\" : \"\"),\n\t\t\t\ttemplates.grid_header_class(col.name, col)].join(\" \");\n\n\t\t\tvar style = \"width:\" + (colWidth - (last ? 1 : 0)) + \"px;\";\n\t\t\tvar label = (col.label || labels[\"column_\" + col.name]);\n\t\t\tlabel = label || \"\";\n\n\t\t\tvar ariaAttrs = gantt._waiAria.gridScaleCellAttrString(col, label);\n\n\t\t\tvar cell = \"\" + label + sort + \"
\";\n\t\t\tcells.push(cell);\n\t\t}\n\t\tthis.$grid_scale.style.height = (config.scale_height) + \"px\";\n\t\tthis.$grid_scale.style.lineHeight = lineHeigth + \"px\";\n\t\t//this.$grid_scale.style.width = \"inherit\";\n\t\tthis.$grid_scale.innerHTML = cells.join(\"\");\n\n\t\tif(this._renderHeaderResizers){\n\t\t\tthis._renderHeaderResizers();\n\t\t}\n\t},\n\n\t_getGridWidth: function(){\n\t\t// TODO: refactor/remove/comment some of _getGridWidth/this.$config.width/this.$state.width, it's not clear what they do\n\t\treturn this.$config.width;\n\t},\n\n\tdestructor: function(){\n\t\tthis._clearLayers(this.$gantt);\n\t\tthis._mouseDelegates.destructor();\n\t\tthis._mouseDelegates = null;\n\t\tthis.$grid = null;\n\t\tthis.$grid_scale = null;\n\t\tthis.$grid_data = null;\n\t\tthis.$gantt = null;\n\n\t\tif(this.$config.rowStore){\n\t\t\tthis.$config.rowStore.detachEvent(this._staticBgHandler);\n\t\t\tthis.$config.rowStore = null;\n\t\t}\n\n\t\tthis.callEvent(\"onDestroy\", []);\n\t\tthis.detachAllEvents();\n\t}\n};\n\nmodule.exports = Grid;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/grid/grid.js\n// module id = 14\n// module chunks = 0","var powerArray = require(\"./power_array\");\nvar utils = require(\"../../utils/utils\");\nvar eventable = require(\"../../utils/eventable\");\n\nvar DataStore = function(config){\n\tthis.pull = {};\n\tthis.$initItem = config.initItem;\n\tthis.visibleOrder = powerArray.$create();\n\tthis.fullOrder = powerArray.$create();\n\tthis._skip_refresh = false;\n\tthis._filterRule = null;\n\tthis._searchVisibleOrder = {};\n\teventable(this);\n\treturn this;\n};\nDataStore.prototype = {\n\n\t_parseInner: function(data){\n\t\tvar item = null,\n\t\t\tloaded = [];\n\t\tfor(var i = 0, len = data.length; i< len; i++){\n\t\t\titem = data[i];\n\t\t\tif(this.$initItem){\n\t\t\t\titem = this.$initItem(item);\n\t\t\t}\n\t\t\tif(this.callEvent(\"onItemLoading\", [item])){\n\t\t\t\tif (!this.pull.hasOwnProperty(item.id)) {\n\t\t\t\t\tthis.fullOrder.push(item.id);\n\t\t\t\t\tloaded.push(item);\n\t\t\t\t}\n\t\t\t\tthis.pull[item.id] = item;\n\t\t\t}\n\t\t}\n\t\treturn loaded;\n\t},\n\tparse: function(data){\n\t\tthis.callEvent(\"onBeforeParse\", [data]);\n\t\tvar loaded = this._parseInner(data);\n\t\tthis.refresh();\n\t\tthis.callEvent(\"onParse\", [loaded]);\n\t},\n\tgetItem: function(id){\n\t\treturn this.pull[id];\n\t},\n\n\t_updateOrder: function(code){\n\t\tcode.call(this.visibleOrder);\n\t\tcode.call(this.fullOrder);\n\t},\n\tupdateItem: function(id, item){\n\t\tif (!utils.defined(item)) item = this.getItem(id);\n\n\t\tif (!this._skip_refresh) {\n\t\t\tif (this.callEvent(\"onBeforeUpdate\", [item.id, item]) === false) return false;\n\t\t}\n\t\tthis.pull[id]=item;\n\t\tif (!this._skip_refresh) {\n\t\t\tthis.callEvent(\"onAfterUpdate\", [item.id, item]);\n\t\t\tthis.callEvent(\"onStoreUpdated\", [item.id, item, \"update\"]);\n\t\t}\n\t},\n\n\t_removeItemInner: function(id){\n\t\t//clear from collections\n\t\t//this.visibleOrder.$remove(id);\n\t\tthis._updateOrder(function(){ this.$remove(id);});\n\t\tdelete this.pull[id];\n\t},\n\n\tremoveItem: function(id){\n\t\t//utils.assert(this.exists(id), \"Not existing ID in remove command\"+id);\n\n\t\tvar obj = this.getItem(id);\t//save for later event\n\t\tif (!this._skip_refresh) {\n\t\t\tif (this.callEvent(\"onBeforeDelete\", [obj.id, obj]) === false) return false;\n\t\t}\n\n\t\tthis._removeItemInner(id);\n\n\t\tif (!this._skip_refresh) {\n\t\t\tthis.filter();\n\t\t\tthis.callEvent(\"onAfterDelete\", [obj.id, obj]);\n\t\t\t//repaint signal\n\t\t\tthis.callEvent(\"onStoreUpdated\", [obj.id, obj, \"delete\"]);\n\t\t}\n\t},\n\n\t_addItemInner: function(item, index){\n\t\t//in case of treetable order is sent as 3rd parameter\n\t\t//var order = index;\n\n\t\tif(this.exists(item.id)){\n\t\t\tthis.silent(function(){this.updateItem(item.id, item);});\n\t\t}else{\n\t\t\tvar order = this.visibleOrder;\n\n\t\t\t//by default item is added to the end of the list\n\t\t\tvar data_size = order.length;\n\n\t\t\tif (!utils.defined(index) || index < 0)\n\t\t\t\tindex = data_size;\n\t\t\t//check to prevent too big indexes\n\t\t\tif (index > data_size){\n\t\t\t\t//dhx.log(\"Warning\",\"DataStore:add\",\"Index of out of bounds\");\n\t\t\t\tindex = Math.min(order.length,index);\n\t\t\t}\n\t\t}\n\n\n\t\t//gantt.assert(!this.exists(id), \"Not unique ID\");\n\n\t\tthis.pull[item.id]=item;\n\t\tif (!this._skip_refresh){\n\t\t\tthis._updateOrder(function(){ this.$insertAt(item.id,index);});\n\t\t}\n\n\t\t//order.$insertAt(item.id,index);\n\t},\n\n\n\tisVisible: function(id){\n\t\treturn this.visibleOrder.$find(id) > -1;\n\t},\n\tgetVisibleItems: function(){\n\t\treturn this.getIndexRange();\n\t},\n\n\taddItem: function(item, index){\n\t\tif (!utils.defined(item.id))\n\t\t\titem.id = utils.uid();\n\n\t\tif(this.$initItem){\n\t\t\titem = this.$initItem(item);\n\t\t}\n\n\t\tif (!this._skip_refresh){\n\t\t\tif (this.callEvent(\"onBeforeAdd\", [item.id, item]) === false) return false;\n\t\t}\n\n\n\t\tthis._addItemInner(item, index);\n\n\t\tif (!this._skip_refresh){\n\t\t\tthis.callEvent(\"onAfterAdd\",[item.id, item]);\n\t\t\t//repaint signal\n\t\t\tthis.callEvent(\"onStoreUpdated\",[item.id,item,\"add\"]);\n\t\t}\n\t\treturn item.id;\n\t},\n\n\t_changeIdInner: function(oldId, newId){\n\t\tif(this.pull[oldId])\n\t\t\tthis.pull[newId] = this.pull[oldId];\n\n\t\tthis.pull[newId].id = newId;\n\t\tthis._updateOrder(function(){\n\t\t\tthis[this.$find(oldId)] = newId;\n\t\t});\n\t\tthis._searchVisibleOrder[newId] = this._searchVisibleOrder[oldId];\n\t\tdelete this._searchVisibleOrder[oldId];\n\n\t\t//this.visibleOrder[this.visibleOrder.$find(oldId)]=newId;\n\t\tdelete this.pull[oldId];\n\t},\n\tchangeId: function(oldId, newId){\n\t\tthis._changeIdInner(oldId, newId);\n\n\t\tthis.callEvent(\"onIdChange\", [oldId, newId]);\n\n\t},\n\texists: function(id){\n\t\treturn !!(this.pull[id]);\n\t},\n\n\t_moveInner: function(sindex, tindex){\n\t\tvar id = this.getIdByIndex(sindex);\n\n\t\tthis._updateOrder(function(){\n\t\t\tthis.$removeAt(sindex);\n\t\t\tthis.$insertAt(id,Math.min(this.length, tindex));\n\t\t});\n\t\t//this.visibleOrder.$removeAt(sindex);\t//remove at old position\n\t\t//if (sindex=0 && tindex>=0, \"DataStore::move\",\"Incorrect indexes\");\n\n\t\tvar id = this.getIdByIndex(sindex);\n\t\tvar obj = this.getItem(id);\n\t\tthis._moveInner(sindex, tindex);\n\n\n\t\tif (!this._skip_refresh) {\n\t\t\t//repaint signal\n\t\t\tthis.callEvent(\"onStoreUpdated\", [obj.id, obj, \"move\"]);\n\t\t}\n\t},\n\tclearAll: function(){\n\t\tthis.pull = {};\n\t\tthis.visibleOrder = powerArray.$create();\n\t\tthis.fullOrder = powerArray.$create();\n\t\tif (this._skip_refresh) return;\n\t\tthis.callEvent(\"onClearAll\",[]);\n\t\tthis.refresh();\n\t},\n\n\tsilent:function(code, master){\n\t\tthis._skip_refresh = true;\n\t\tcode.call(master||this);\n\t\tthis._skip_refresh = false;\n\t},\n\n\tarraysEqual: function (arr1, arr2) {\n\t\tif(arr1.length !== arr2.length)\n\t\t\treturn false;\n\t\tfor(var i = 0; i < arr1.length; i++) {\n\t\t\tif(arr1[i] !== arr2[i])\n\t\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\n\trefresh: function(id, quick){\n\t\tif (this._skip_refresh) return;\n\n\t\tif(id){\n\t\t\t// if item changes visible order (e.g. expand-collapse branch) - do a complete repaint\n\t\t\tif(!quick){\n\t\t\t\tvar oldOrder = this.visibleOrder;\n\t\t\t\tthis.filter();\n\t\t\t\tif(!this.arraysEqual(oldOrder, this.visibleOrder)){\n\t\t\t\t\tid = undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}else{\n\t\t\tthis.filter();\n\t\t}\n\n\t\tif (id)\n\t\t\tthis.callEvent(\"onStoreUpdated\",[id, this.pull[id], \"paint\"]);\n\t\telse\n\t\t\tthis.callEvent(\"onStoreUpdated\",[null,null,null]);\n\t},\n\n\tcount: function(){\n\t\treturn this.fullOrder.length;\n\t},\n\tcountVisible: function(){\n\t\treturn this.visibleOrder.length;\n\t},\n\n\tsort: function(sort){},\n\n\tserialize: function(){},\n\n\teachItem: function(code){\n\t\tfor (var i=0; i=0) this.splice(pos,(len||1));\n\t},\n\t//find element in collection and remove it\n\t$remove:function(value){\n\t\tthis.$removeAt(this.$find(value));\n\t},\n\t//add element to collection at specific position\n\t$insertAt:function(data,pos){\n\t\tif (!pos && pos!==0) \t//add to the end by default\n\t\t\tthis.push(data);\n\t\telse {\n\t\t\tvar b = this.splice(pos,(this.length-pos));\n\t\t\tthis[pos] = data;\n\t\t\tthis.push.apply(this,b); //reconstruct array without loosing this pointer\n\t\t}\n\t},\n\t//return index of element, -1 if it doesn't exists\n\t$find:function(data){\n\t\tfor (var i=0; i=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\n\t\t\t}\n\n\t\t\tt.open(method, url, async);\n\n\t\t\tif (headers){\n\t\t\t\tfor (var key in headers)\n\t\t\t\t\tt.setRequestHeader(key, headers[key]);\n\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\n\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\t\t} else if (method == \"GET\") {\n\t\t\t\tpostData = null;\n\t\t\t}\n\n\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n\n\t\t\tt.send(postData);\n\n\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\n\n\t\t},\n\t\turlSeparator: function(str){\n\t\t\tif (str.indexOf(\"?\") != -1)\n\t\t\t\treturn \"&\";\n\t\t\telse\n\t\t\t\treturn \"?\";\n\t\t}\n\t};\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/common/ajax.js\n// module id = 26\n// module chunks = 0","/*\n %d - the day as a number with a leading zero ( 01 to 31 );\n %j - the day as a number without a leading zero ( 1 to 31 );\n %D - the day as an abbreviation ( Sun to Sat );\n %l - the day as a full name ( Sunday to Saturday );\n %W - the ISO-8601 week number of the year. Weeks start on Monday; 1)\n %m - the month as a number without a leading zero ( 1 to 12 );\n %n - the month as a number with a leading zero ( 01 to 12);\n %M - the month as an abbreviation ( Jan to Dec );\n %F - the month as a full name ( January to December );\n %y - the year as a two-digit number ( 00 to 99 );\n %Y - the year as a four-digit number ( 1900–9999 );\n %h - the hour based on the 12-hour clock ( 00 to 11 );\n %H - the hour based on the 24-hour clock ( 00 to 23 );\n %i - the minute as a number with a leading zero ( 00 to 59 );\n %s - the second as a number without a leading zero ( 00 to 59 ); 2)\n %a - displays am (for times from midnight until noon) and pm (for times from noon until midnight);\n %A - displays AM (for times from midnight until noon) and PM (for times from noon until midnight).\n*/\n\nmodule.exports = function(gantt) {\n\tvar dateHelper = {\n\t\tinit: function () {\n\t\t\tvar locale = gantt.locale;\n\n\t\t\tvar s = locale.date.month_short;\n\t\t\tvar t = locale.date.month_short_hash = {};\n\t\t\tfor (var i = 0; i < s.length; i++)\n\t\t\t\tt[s[i]] = i;\n\n\t\t\tvar s = locale.date.month_full;\n\t\t\tvar t = locale.date.month_full_hash = {};\n\t\t\tfor (var i = 0; i < s.length; i++)\n\t\t\t\tt[s[i]] = i;\n\t\t},\n\t\tdate_part: function (date) {\n\t\t\tvar old = new Date(date);\n\t\t\tdate.setHours(0);\n\t\t\tthis.hour_start(date);\n\t\t\tif (date.getHours() && //shift to yesterday on dst\n\t\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()))\n\t\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\n\t\t\treturn date;\n\t\t},\n\t\ttime_part: function (date) {\n\t\t\treturn (date.valueOf() / 1000 - date.getTimezoneOffset() * 60) % 86400;\n\t\t},\n\t\tweek_start: function (date) {\n\t\t\tvar shift = date.getDay();\n\t\t\tif (gantt.config.start_on_monday) {\n\t\t\t\tif (shift === 0) shift = 6;\n\t\t\t\telse shift--;\n\t\t\t}\n\t\t\treturn this.date_part(this.add(date, -1 * shift, \"day\"));\n\t\t},\n\t\tmonth_start: function (date) {\n\t\t\tdate.setDate(1);\n\t\t\treturn this.date_part(date);\n\t\t},\n\t\tquarter_start: function (date) {\n\t\t\tthis.month_start(date);\n\t\t\tvar m = date.getMonth(),\n\t\t\t\tres_month;\n\n\t\t\tif (m >= 9) {\n\t\t\t\tres_month = 9;\n\t\t\t} else if (m >= 6) {\n\t\t\t\tres_month = 6;\n\t\t\t} else if (m >= 3) {\n\t\t\t\tres_month = 3;\n\t\t\t} else {\n\t\t\t\tres_month = 0;\n\t\t\t}\n\n\t\t\tdate.setMonth(res_month);\n\t\t\treturn date;\n\t\t},\n\t\tyear_start: function (date) {\n\t\t\tdate.setMonth(0);\n\t\t\treturn this.month_start(date);\n\t\t},\n\t\tday_start: function (date) {\n\t\t\treturn this.date_part(date);\n\t\t},\n\t\thour_start: function (date) {\n\t\t\tif (date.getMinutes())\n\t\t\t\tdate.setMinutes(0);\n\t\t\tthis.minute_start(date);\n\n\t\t\treturn date;\n\t\t},\n\t\tminute_start: function (date) {\n\t\t\tif (date.getSeconds())\n\t\t\t\tdate.setSeconds(0);\n\t\t\tif (date.getMilliseconds())\n\t\t\t\tdate.setMilliseconds(0);\n\t\t\treturn date;\n\t\t},\n\t\t_add_days: function (date, inc) {\n\t\t\tvar ndate = new Date(date.valueOf());\n\n\t\t\tndate.setDate(ndate.getDate() + inc);\n\t\t\tif (inc >= 0 && (!date.getHours() && ndate.getHours()) &&//shift to yesterday on dst\n\t\t\t\t(ndate.getDate() <= date.getDate() || ndate.getMonth() < date.getMonth() || ndate.getFullYear() < date.getFullYear()))\n\t\t\t\tndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));\n\t\t\treturn ndate;\n\t\t},\n\n\t\tadd: function (date, inc, mode) {\n\t\t\t/*jsl:ignore*/\n\t\t\tvar ndate = new Date(date.valueOf());\n\t\t\tswitch (mode) {\n\t\t\t\tcase \"day\":\n\t\t\t\t\tndate = this._add_days(ndate, inc);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"week\":\n\t\t\t\t\tndate = this._add_days(ndate, inc * 7);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"month\":\n\t\t\t\t\tndate.setMonth(ndate.getMonth() + inc);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"year\":\n\t\t\t\t\tndate.setYear(ndate.getFullYear() + inc);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"hour\":\n\t\t\t\t\t/*\n\t\t\t\t\t\tadding hours/minutes via setHour(getHour() + inc) gives weird result when\n\t\t\t\t\t\tadding one hour to the time before switch to a Daylight Saving time\n\n\t\t\t\t\t\texample: //Sun Mar 30 2014 01:00:00 GMT+0100 (W. Europe Standard Time)\n\t\t\t\t\t\tnew Date(2014, 02, 30, 1).setHours(2)\n\t\t\t\t\t\t>>Sun Mar 30 2014 01:00:00 GMT+0100 (W. Europe Standard Time)\n\n\t\t\t\t\t\tsetTime seems working as expected\n\t\t\t\t\t */\n\t\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"minute\":\n\n\t\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn this[\"add_\" + mode](date, inc, mode);\n\t\t\t}\n\t\t\treturn ndate;\n\t\t\t/*jsl:end*/\n\t\t},\n\t\tadd_quarter: function (date, inc) {\n\t\t\treturn this.add(date, inc * 3, \"month\");\n\t\t},\n\n\t\tto_fixed: function (num) {\n\t\t\tif (num < 10) return \"0\" + num;\n\t\t\treturn num;\n\t\t},\n\t\tcopy: function (date) {\n\t\t\treturn new Date(date.valueOf());\n\t\t},\n\t\tdate_to_str: function (format, utc) {\n\t\t\tformat = format.replace(/%[a-zA-Z]/g, function (a) {\n\t\t\t\tswitch (a) {\n\t\t\t\t\tcase \"%d\":\n\t\t\t\t\t\treturn \"\\\"+to_fixed(date.getDate())+\\\"\";\n\t\t\t\t\tcase \"%m\":\n\t\t\t\t\t\treturn \"\\\"+to_fixed((date.getMonth()+1))+\\\"\";\n\t\t\t\t\tcase \"%j\":\n\t\t\t\t\t\treturn \"\\\"+date.getDate()+\\\"\";\n\t\t\t\t\tcase \"%n\":\n\t\t\t\t\t\treturn \"\\\"+(date.getMonth()+1)+\\\"\";\n\t\t\t\t\tcase \"%y\":\n\t\t\t\t\t\treturn \"\\\"+to_fixed(date.getFullYear()%100)+\\\"\";\n\t\t\t\t\tcase \"%Y\":\n\t\t\t\t\t\treturn \"\\\"+date.getFullYear()+\\\"\";\n\t\t\t\t\tcase \"%D\":\n\t\t\t\t\t\treturn \"\\\"+locale.date.day_short[date.getDay()]+\\\"\";\n\t\t\t\t\tcase \"%l\":\n\t\t\t\t\t\treturn \"\\\"+locale.date.day_full[date.getDay()]+\\\"\";\n\t\t\t\t\tcase \"%M\":\n\t\t\t\t\t\treturn \"\\\"+locale.date.month_short[date.getMonth()]+\\\"\";\n\t\t\t\t\tcase \"%F\":\n\t\t\t\t\t\treturn \"\\\"+locale.date.month_full[date.getMonth()]+\\\"\";\n\t\t\t\t\tcase \"%h\":\n\t\t\t\t\t\treturn \"\\\"+to_fixed((date.getHours()+11)%12+1)+\\\"\";\n\t\t\t\t\tcase \"%g\":\n\t\t\t\t\t\treturn \"\\\"+((date.getHours()+11)%12+1)+\\\"\";\n\t\t\t\t\tcase \"%G\":\n\t\t\t\t\t\treturn \"\\\"+date.getHours()+\\\"\";\n\t\t\t\t\tcase \"%H\":\n\t\t\t\t\t\treturn \"\\\"+to_fixed(date.getHours())+\\\"\";\n\t\t\t\t\tcase \"%i\":\n\t\t\t\t\t\treturn \"\\\"+to_fixed(date.getMinutes())+\\\"\";\n\t\t\t\t\tcase \"%a\":\n\t\t\t\t\t\treturn \"\\\"+(date.getHours()>11?\\\"pm\\\":\\\"am\\\")+\\\"\";\n\t\t\t\t\tcase \"%A\":\n\t\t\t\t\t\treturn \"\\\"+(date.getHours()>11?\\\"PM\\\":\\\"AM\\\")+\\\"\";\n\t\t\t\t\tcase \"%s\":\n\t\t\t\t\t\treturn \"\\\"+to_fixed(date.getSeconds())+\\\"\";\n\t\t\t\t\tcase \"%W\":\n\t\t\t\t\t\treturn \"\\\"+to_fixed(getISOWeek(date))+\\\"\";\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (utc) format = format.replace(/date\\.get/g, \"date.getUTC\");\n\t\t\tvar dateToStr = new Function(\"date\", \"to_fixed\", \"locale\", \"getISOWeek\", \"return \\\"\" + format + \"\\\";\");\n\n\t\t\treturn function (date) {\n\t\t\t\treturn dateToStr(date, dateHelper.to_fixed, gantt.locale, dateHelper.getISOWeek);\n\t\t\t};\n\t\t},\n\t\tstr_to_date: function (format, utc) {\n\t\t\tvar splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\n\t\t\tvar mask = format.match(/%[a-zA-Z]/g);\n\t\t\tfor (var i = 0; i < mask.length; i++) {\n\t\t\t\tswitch (mask[i]) {\n\t\t\t\t\tcase \"%j\":\n\t\t\t\t\tcase \"%d\":\n\t\t\t\t\t\tsplt += \"set[2]=temp[\" + i + \"]||1;\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%n\":\n\t\t\t\t\tcase \"%m\":\n\t\t\t\t\t\tsplt += \"set[1]=(temp[\" + i + \"]||1)-1;\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%y\":\n\t\t\t\t\t\tsplt += \"set[0]=temp[\" + i + \"]*1+(temp[\" + i + \"]>50?1900:2000);\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%g\":\n\t\t\t\t\tcase \"%G\":\n\t\t\t\t\tcase \"%h\":\n\t\t\t\t\tcase \"%H\":\n\t\t\t\t\t\tsplt += \"set[3]=temp[\" + i + \"]||0;\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%i\":\n\t\t\t\t\t\tsplt += \"set[4]=temp[\" + i + \"]||0;\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%Y\":\n\t\t\t\t\t\tsplt += \"set[0]=temp[\" + i + \"]||0;\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%a\":\n\t\t\t\t\tcase \"%A\":\n\t\t\t\t\t\tsplt += \"set[3]=set[3]%12+((temp[\" + i + \"]||'').toLowerCase()=='am'?0:12);\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%s\":\n\t\t\t\t\t\tsplt += \"set[5]=temp[\" + i + \"]||0;\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%M\":\n\t\t\t\t\t\tsplt += \"set[1]=locale.date.month_short_hash[temp[\" + i + \"]]||0;\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%F\":\n\t\t\t\t\t\tsplt += \"set[1]=locale.date.month_full_hash[temp[\" + i + \"]]||0;\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\n\t\t\tif (utc) code = \" Date.UTC(\" + code + \")\";\n\t\t\tvar strToDate = new Function(\"date\", \"locale\", \"var set=[0,0,1,0,0,0]; \" + splt + \" return new Date(\" + code + \");\");\n\n\t\t\treturn function (dateString) {\n\t\t\t\treturn strToDate(dateString, gantt.locale);\n\t\t\t};\n\t\t},\n\t\tgetISOWeek: function (ndate) {\n\t\t\tif (!ndate) return false;\n\t\t\tvar nday = ndate.getDay();\n\t\t\tif (nday === 0) {\n\t\t\t\tnday = 7;\n\t\t\t}\n\t\t\tvar first_thursday = new Date(ndate.valueOf());\n\t\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\n\t\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\n\t\t\tvar ordinal_date = Math.round((first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\n\t\t\tvar week_number = 1 + Math.floor(ordinal_date / 7);\n\t\t\treturn week_number;\n\t\t},\n\t\tgetUTCISOWeek: function (ndate) {\n\t\t\treturn this.getISOWeek(ndate);\n\t\t},\n\t\tconvert_to_utc: function (date) {\n\t\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\n\t\t},\n\t\tparseDate: function (date, format) {\n\t\t\t// raw date may be of type string, number (timestamp) or something else\n\t\t\t// do not check for instanceof Date explicitly, since we may swap native date with different date implementation at some point\n\t\t\tif (date && !date.getFullYear) {\n\t\t\t\tif (gantt.defined(format)) {\n\t\t\t\t\tif (typeof(format) == \"string\")\n\t\t\t\t\t\tformat = gantt.defined(gantt.templates[format]) ? gantt.templates[format] : gantt.date.str_to_date(format);\n\t\t\t\t\telse\n\t\t\t\t\t\tformat = gantt.templates.xml_date;\n\t\t\t\t}\n\t\t\t\tif (date)\n\t\t\t\t\tdate = format(date);\n\t\t\t\telse\n\t\t\t\t\tdate = null;\n\t\t\t}\n\t\t\treturn date;\n\t\t}\n\t};\n\treturn dateHelper;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/common/date.js\n// module id = 27\n// module chunks = 0","var eventable = require(\"../../utils/eventable\");\nvar utils = require(\"../../utils/utils\");\nvar timeout = require(\"../../utils/timeout\");\n\nmodule.exports = function(gantt){\n\n\tfunction copyDomEvent(e){\n\t\treturn {\n\t\t\ttarget: e.target || e.srcElement,\n\t\t\tpageX: e.pageX,\n\t\t\tpageY: e.pageY,\n\t\t\tclientX: e.clientX,\n\t\t\tclientY: e.clientY,\n\t\t\tmetaKey: e.metaKey,\n\t\t\tshiftKey: e.shiftKey,\n\t\t\tctrlKey: e.ctrlKey,\n\t\t\taltKey: e.altKey\n\t\t};\n\t}\n\n\tfunction DnD(obj, config) {\n\t\tthis._obj = obj;\n\t\tthis._settings = config || {};\n\t\teventable(this);\n\n\t\tvar inputMethods = this.getInputMethods();\n\n\t\tthis._drag_start_timer = null;\n\t\tgantt.attachEvent(\"onGanttScroll\", utils.bind(function (left, top) {\n\t\t\tthis.clearDragTimer();\n\t\t}, this));\n\n\t\tfor(var i = 0; i < inputMethods.length; i++){\n\t\t\t(utils.bind(function(input){\n\n\t\t\t\tgantt.event(obj, input.down, utils.bind(function (e) {\n\t\t\t\t\tif(!input.accessor(e)){\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._settings.original_target = copyDomEvent(e);\n\n\t\t\t\t\tif (gantt.config.touch) {\n\t\t\t\t\t\tthis.clearDragTimer();\n\n\t\t\t\t\t\tthis._drag_start_timer = setTimeout(utils.bind(function () {\n\t\t\t\t\t\t\tthis.dragStart(obj, e, input);\n\t\t\t\t\t\t}, this), gantt.config.touch_drag);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.dragStart(obj, e, input);\n\t\t\t\t\t}\n\t\t\t\t}, this));\n\n\t\t\t\tgantt.event(document.body, input.up, utils.bind(function (e) {\n\t\t\t\t\tif(!input.accessor(e)){\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis.clearDragTimer();\n\t\t\t\t}, this));\n\n\t\t\t}, this))(inputMethods[i]);\n\t\t}\n\t}\n\n\tDnD.prototype = {\n\t\ttraceDragEvents: function (domElement, inputMethod) {\n\t\t\tvar mousemove = utils.bind(function (e) {\n\t\t\t\treturn this.dragMove(domElement, e, inputMethod.accessor);\n\t\t\t}, this);\n\t\t\tvar scroll = utils.bind(function (e) {\n\t\t\t\treturn this.dragScroll(domElement, e);\n\t\t\t}, this);\n\n\t\t\tvar limited_mousemove = utils.bind(function (e) {\n\t\t\t\tif (e && e.preventDefault) //Cancel default action on DND\n\t\t\t\t\te.preventDefault();\n\t\t\t\t(e || event).cancelBubble = true;\n\t\t\t\tif (utils.defined(this.config.updates_per_second)) {\n\t\t\t\t\tif (!timeout(this, this.config.updates_per_second))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn mousemove(e);\n\t\t\t}, this);\n\n\t\t\tvar mouseup = utils.bind(function (e) {\n\t\t\t\tgantt.eventRemove(document.body, inputMethod.move, limited_mousemove);\n\t\t\t\tgantt.eventRemove(document.body, inputMethod.up, mouseup);\n\t\t\t\treturn this.dragEnd(domElement);\n\t\t\t}, this);\n\n\n\t\t\tgantt.event(document.body, inputMethod.move, limited_mousemove);\n\t\t\tgantt.event(document.body, inputMethod.up, mouseup);\n\t\t},\n\t\tcheckPositionChange: function (pos) {\n\t\t\tvar diff_x = pos.x - this.config.pos.x;\n\t\t\tvar diff_y = pos.y - this.config.pos.y;\n\t\t\tvar distance = Math.sqrt(Math.pow(Math.abs(diff_x), 2) + Math.pow(Math.abs(diff_y), 2));\n\n\t\t\tif (distance > this.config.sensitivity) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tinitDnDMarker: function () {\n\t\t\t// create dnd placeholder and put it in dom\n\t\t\tvar marker = this.config.marker = document.createElement(\"div\");\n\t\t\tmarker.className = \"gantt_drag_marker\";\n\t\t\tmarker.innerHTML = \"Dragging object\";\n\t\t\tdocument.body.appendChild(marker);\n\t\t},\n\t\tbackupEventTarget: function (domEvent, getEvent) {\n\t\t\tif (!gantt.config.touch) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// keep original event target in DOM in order to keep dnd on touchmove event\n\t\t\tvar e = getEvent(domEvent);\n\n\t\t\tvar el = e.target || e.srcElement;\n\t\t\tvar copy = el.cloneNode(true);\n\t\t\t//this.config.target.target = copy;\n\t\t\tthis.config.original_target = copyDomEvent(e);\n\t\t\tthis.config.original_target.target = copy;\n\t\t\tthis.config.backup_element = el;\n\t\t\tel.parentNode.appendChild(copy);\n\n\t\t\tel.style.display = \"none\";\n\t\t\tdocument.body.appendChild(el);\n\t\t},\n\t\tgetInputMethods: function () {\n\t\t\t// bind actions to browser events\n\t\t\tvar inputMethods = [];\n\n\t\t\tinputMethods.push({\n\t\t\t\t\"move\": \"mousemove\",\n\t\t\t\t\"down\": \"mousedown\",\n\t\t\t\t\"up\": \"mouseup\",\n\t\t\t\t\"accessor\": function (e) {\n\t\t\t\t\treturn e;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (gantt.config.touch) {\n\n\t\t\t\tvar touchEventsSupported = true;\n\t\t\t\ttry{\n\t\t\t\t\tdocument.createEvent(\"TouchEvent\");\n\t\t\t\t}catch (e){\n\t\t\t\t\ttouchEventsSupported = false;\n\t\t\t\t}\n\n\t\t\t\tif(touchEventsSupported){\n\t\t\t\t\tinputMethods.push({\n\t\t\t\t\t\t\"move\": \"touchmove\",\n\t\t\t\t\t\t\"down\": \"touchstart\",\n\t\t\t\t\t\t\"up\": \"touchend\",\n\t\t\t\t\t\t\"accessor\": function (ev) {\n\t\t\t\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\n\t\t\t\t\t\t\tif (ev.touches[0])\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\ttarget: document.elementFromPoint(ev.touches[0].clientX, ev.touches[0].clientY),\n\t\t\t\t\t\t\t\t\tpageX: ev.touches[0].pageX,\n\t\t\t\t\t\t\t\t\tpageY: ev.touches[0].pageY,\n\t\t\t\t\t\t\t\t\tclientX: ev.touches[0].clientX,\n\t\t\t\t\t\t\t\t\tclientY: ev.touches[0].clientY\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn ev;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}else if(window.navigator.pointerEnabled){\n\t\t\t\t\tinputMethods.push({\n\t\t\t\t\t\t\"move\": \"pointermove\",\n\t\t\t\t\t\t\"down\": \"pointerdown\",\n\t\t\t\t\t\t\"up\": \"pointerup\",\n\t\t\t\t\t\t\"accessor\": function (ev) {\n\t\t\t\t\t\t\tif (ev.pointerType == \"mouse\") return null;\n\t\t\t\t\t\t\treturn ev;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t}else if (window.navigator.msPointerEnabled){\n\t\t\t\t\tinputMethods.push({\n\t\t\t\t\t\t\"move\": \"MSPointerMove\",\n\t\t\t\t\t\t\"down\": \"MSPointerDown\",\n\t\t\t\t\t\t\"up\": \"MSPointerUp\",\n\t\t\t\t\t\t\"accessor\": function (ev) {\n\t\t\t\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\n\t\t\t\t\t\t\treturn ev;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn inputMethods;\n\t\t},\n\t\tclearDragTimer: function () {\n\t\t\tif (this._drag_start_timer) {\n\t\t\t\tclearTimeout(this._drag_start_timer);\n\t\t\t\tthis._drag_start_timer = null;\n\t\t\t}\n\t\t},\n\t\tdragStart: function (obj, e, inputMethod) {\n\t\t\tthis.config = {\n\t\t\t\tobj: obj,\n\t\t\t\tmarker: null,\n\t\t\t\tstarted: false,\n\t\t\t\tpos: this.getPosition(e),\n\t\t\t\tsensitivity: 4\n\t\t\t};\n\t\t\tif (this._settings)\n\t\t\t\tutils.mixin(this.config, this._settings, true);\n\n\n\t\t\tthis.traceDragEvents(obj, inputMethod);\n\n\t\t\tgantt._prevent_touch_scroll = true;\n\t\t\tdocument.body.className += \" gantt_noselect\";\n\n\t\t\tif (gantt.config.touch) {\n\t\t\t\tthis.dragMove(obj, e, inputMethod.accessor);\n\t\t\t}\n\n\t\t},\n\t\tdragMove: function (obj, e, getEvent) {\n\t\t\tvar source = getEvent(e);\n\t\t\tif (!source) return;\n\n\t\t\tif (!this.config.marker && !this.config.started) {\n\t\t\t\tvar pos = this.getPosition(source);\n\n\t\t\t\tif (gantt.config.touch || this.checkPositionChange(pos)) {\n\t\t\t\t\t// real drag starts here,\n\t\t\t\t\t// when user moves mouse at first time after onmousedown\n\t\t\t\t\tthis.config.started = true;\n\t\t\t\t\tthis.config.ignore = false;\n\t\t\t\t\tif (this.callEvent(\"onBeforeDragStart\", [obj, this.config.original_target]) === false) {\n\t\t\t\t\t\tthis.config.ignore = true;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tthis.backupEventTarget(e, getEvent);\n\t\t\t\t\tthis.initDnDMarker();\n\t\t\t\t\tgantt._touch_feedback();\n\t\t\t\t\tthis.callEvent(\"onAfterDragStart\", [obj, this.config.original_target]);\n\t\t\t\t} else {\n\t\t\t\t\tthis.config.ignore = true;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tif (!this.config.ignore) {\n\t\t\t\tsource.pos = this.getPosition(source);\n\t\t\t\tthis.config.marker.style.left = source.pos.x + \"px\";\n\t\t\t\tthis.config.marker.style.top = source.pos.y + \"px\";\n\t\t\t\tthis.callEvent(\"onDragMove\", [obj, source]);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\n\t\tdragEnd: function (obj) {\n\t\t\tvar target = this.config.backup_element;\n\t\t\tif (target && target.parentNode) {\n\t\t\t\ttarget.parentNode.removeChild(target);\n\t\t\t}\n\t\t\tgantt._prevent_touch_scroll = false;\n\t\t\tif (this.config.marker) {\n\t\t\t\tthis.config.marker.parentNode.removeChild(this.config.marker);\n\t\t\t\tthis.config.marker = null;\n\n\t\t\t\tthis.callEvent(\"onDragEnd\", []);\n\t\t\t}\n\t\t\tdocument.body.className = document.body.className.replace(\" gantt_noselect\", \"\");\n\t\t},\n\n\t\tgetPosition: function (e) {\n\t\t\tvar x = 0, y = 0;\n\t\t\te = e || window.event;\n\t\t\tif (e.pageX || e.pageY) {\n\t\t\t\tx = e.pageX;\n\t\t\t\ty = e.pageY;\n\t\t\t} else if (e.clientX || e.clientY) {\n\t\t\t\tx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\n\t\t\t\ty = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;\n\t\t\t}\n\t\t\treturn {x: x, y: y};\n\t\t}\n\t};\n\n\treturn DnD;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/common/dnd.js\n// module id = 28\n// module chunks = 0","module.exports = function(gantt) {\n\n\tvar regTemplates = {};\n\n\tfunction initTemplate(name, initial, template_name) {\n\t\ttemplate_name = template_name || name;\n\t\tvar config = gantt.config,\n\t\t\ttemplates = gantt.templates;\n\n\t\tif (gantt.config[name] && regTemplates[template_name] != config[name]) {\n\t\t\tif (!(initial && templates[template_name])) {\n\t\t\t\ttemplates[template_name] = gantt.date.date_to_str(config[name]);\n\t\t\t\tregTemplates[template_name] = config[name];\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction initTemplates() {\n\t\tvar labels = gantt.locale.labels;\n\t\tlabels.gantt_save_btn = labels.icon_save;\n\t\tlabels.gantt_cancel_btn = labels.icon_cancel;\n\t\tlabels.gantt_delete_btn = labels.icon_delete;\n\n\n\t\tvar date = gantt.date;\n\n\t\t//build configuration based templates\n\t\tvar d = date.date_to_str;\n\t\tvar c = gantt.config;\n\t\tinitTemplate(\"date_scale\", true, undefined, gantt.config, gantt.templates);\n\t\tinitTemplate(\"date_grid\", true, \"grid_date_format\", gantt.config, gantt.templates);\n\t\tinitTemplate(\"task_date\", true, undefined, gantt.config, gantt.templates);\n\n\t\tgantt.mixin(gantt.templates, {\n\t\t\txml_date: date.str_to_date(c.xml_date, c.server_utc),\n\t\t\txml_format: d(c.xml_date, c.server_utc),\n\t\t\tapi_date: date.str_to_date(c.api_date),\n\t\t\tprogress_text: function (start, end, task) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tgrid_header_class: function (column, config) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\n\t\t\ttask_text: function (start, end, task) {\n\t\t\t\treturn task.text;\n\t\t\t},\n\t\t\ttask_class: function (start, end, task) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tgrid_row_class: function (start, end, task) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\ttask_row_class: function (start, end, task) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\ttask_cell_class: function (item, date) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tscale_cell_class: function (date) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tscale_row_class: function (date) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\n\t\t\tgrid_indent: function (item) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tgrid_folder: function (item) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tgrid_file: function (item) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tgrid_open: function (item) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tgrid_blank: function (item) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tdate_grid: function (date, item) {\n\t\t\t\tif (item && gantt.isUnscheduledTask(item) && gantt.config.show_unscheduled) {\n\t\t\t\t\treturn gantt.templates.task_unscheduled_time(item);\n\t\t\t\t} else {\n\t\t\t\t\treturn gantt.templates.grid_date_format(date);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\ttask_time: function (start, end, ev) {\n\t\t\t\tif (gantt.isUnscheduledTask(ev) && gantt.config.show_unscheduled) {\n\t\t\t\t\treturn gantt.templates.task_unscheduled_time(ev);\n\t\t\t\t} else {\n\t\t\t\t\treturn gantt.templates.task_date(start) + \" - \" + gantt.templates.task_date(end);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\ttask_unscheduled_time: function (task) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\n\t\t\ttime_picker: d(c.time_picker),\n\t\t\tlink_class: function (link) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tlink_description: function (link) {\n\t\t\t\tvar from = gantt.getTask(link.source),\n\t\t\t\t\tto = gantt.getTask(link.target);\n\n\t\t\t\treturn \"\" + from.text + \" – \" + to.text + \"\";\n\t\t\t},\n\n\t\t\tdrag_link: function (from, from_start, to, to_start) {\n\t\t\t\tfrom = gantt.getTask(from);\n\t\t\t\tvar labels = gantt.locale.labels;\n\n\t\t\t\tvar text = \"\" + from.text + \" \" + (from_start ? labels.link_start : labels.link_end) + \"
\";\n\t\t\t\tif (to) {\n\t\t\t\t\tto = gantt.getTask(to);\n\t\t\t\t\ttext += \" \" + to.text + \" \" + (to_start ? labels.link_start : labels.link_end) + \"
\";\n\t\t\t\t}\n\t\t\t\treturn text;\n\t\t\t},\n\t\t\tdrag_link_class: function (from, from_start, to, to_start) {\n\t\t\t\tvar add = \"\";\n\n\t\t\t\tif (from && to) {\n\t\t\t\t\tvar allowed = gantt.isLinkAllowed(from, to, from_start, to_start);\n\t\t\t\t\tadd = \" \" + (allowed ? \"gantt_link_allow\" : \"gantt_link_deny\");\n\t\t\t\t}\n\n\t\t\t\treturn \"gantt_link_tooltip\" + add;\n\t\t\t},\n\n\t\t\t/* used for aria-labels of bar elements and for tooltip.js */\n\t\t\ttooltip_date_format: date.date_to_str(\"%Y-%m-%d\"),\n\t\t\ttooltip_text: function (start, end, event) {\n\t\t\t\treturn \"Task: \" + event.text + \"
Start date: \" + gantt.templates.tooltip_date_format(start) + \"
End date: \" + gantt.templates.tooltip_date_format(end);\n\t\t\t}\n\t\t});\n\t}\n\n\treturn {\n\t\tinitTemplates: initTemplates,\n\t\tinitTemplate: initTemplate\n\t};\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/common/templates.js\n// module id = 29\n// module chunks = 0","var utils = require(\"../../utils/utils\");\n\nvar StateService = (function(){\n\tvar stateProviders = {};\n\n\tfunction getState(name){\n\t\tif(name){\n\t\t\treturn stateProviders[name].method();\n\t\t}else{\n\t\t\tvar res = {};\n\t\t\tfor(var i in stateProviders){\n\t\t\t\tif(!stateProviders[i].internal)\n\t\t\t\t\tutils.mixin(res, stateProviders[i].method(), true);\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\t}\n\n\tfunction registerProvider(name, provider, internal){\n\t\tstateProviders[name] = { method: provider, internal: internal};\n\t}\n\n\tfunction unregisterProvider(name){\n\t\tdelete stateProviders[name];\n\t}\n\n\treturn {\n\t\tgetState: getState,\n\t\tregisterProvider: registerProvider,\n\t\tunregisterProvider: unregisterProvider\n\t};\n});\n\nmodule.exports = StateService;\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/common/state.js\n// module id = 30\n// module chunks = 0","var utils = require(\"../utils/utils\");\nvar domHelpers = require(\"../utils/dom_helpers\");\n\nmodule.exports = function(gantt) {\n\n\tvar _dhx_msg_cfg = null;\n\n\tfunction callback(config, result) {\n\t\tvar usercall = config.callback;\n\t\tmodalBox.hide(config.box);\n\n\t\t_dhx_msg_cfg = config.box = null;\n\t\tif (usercall)\n\t\t\tusercall(result);\n\t}\n\n\tfunction modal_key(e) {\n\t\tif (_dhx_msg_cfg) {\n\t\t\te = e || event;\n\t\t\tvar code = e.which || event.keyCode;\n\t\t\tvar preventDefault = false;\n\n\t\t\tif (messageBox.keyboard) {\n\t\t\t\tif (code == 13 || code == 32) {\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\n\t\t\t\t\tvar target = e.target || e.srcElement;\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"gantt_popup_button\") > -1 && target.click) {\n\t\t\t\t\t\ttarget.click();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\n\t\t\t\t\t\tpreventDefault = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (code == 27) {\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (preventDefault) {\n\t\t\t\tif (e.preventDefault)\n\t\t\t\t\te.preventDefault();\n\t\t\t\treturn !(e.cancelBubble = true);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}\n\n\tgantt.event(document, \"keydown\", modal_key, true);\n\n\tfunction modality(mode) {\n\t\tif (!modality.cover) {\n\t\t\tmodality.cover = document.createElement(\"DIV\");\n\t\t\t//necessary for IE only\n\t\t\tmodality.cover.onkeydown = modal_key;\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\n\t\t\tdocument.body.appendChild(modality.cover);\n\t\t}\n\t\tvar height = document.body.scrollHeight;\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\n\t}\n\n\tfunction button(text, className, result) {\n\t\tvar buttonAriaAttrs = gantt._waiAria.messageButtonAttrString(text);\n\t\tvar name = className.toLowerCase().replace(/ /g, \"_\");\n\t\tvar button_css = \"gantt_\" + name + \"_button\" + \" dhtmlx_\" + name + \"_button\"; // dhtmlx_ok_button, dhtmlx_click_me_button\n\t\treturn \"\";\n\t}\n\n\tfunction info(text) {\n\t\tif (!messageBox.area) {\n\t\t\tmessageBox.area = document.createElement(\"DIV\");\n\t\t\tmessageBox.area.className = \"gantt_message_area dhtmlx_message_area\";\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\n\t\t\tdocument.body.appendChild(messageBox.area);\n\t\t}\n\n\t\tmessageBox.hide(text.id);\n\t\tvar message = document.createElement(\"DIV\");\n\t\tmessage.innerHTML = \"\" + text.text + \"
\";\n\t\tmessage.className = \"gantt-info dhtmlx-info gantt-\" + text.type + \" dhtmlx-\" + text.type;\n\t\tmessage.onclick = function () {\n\t\t\tmessageBox.hide(text.id);\n\t\t\ttext = null;\n\t\t};\n\n\t\tgantt._waiAria.messageInfoAttr(message);\n\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\n\t\telse\n\t\t\tmessageBox.area.appendChild(message);\n\n\t\tif (text.expire > 0)\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\n\t\t\t\tmessageBox.hide(text.id);\n\t\t\t}, text.expire);\n\n\t\tmessageBox.pull[text.id] = message;\n\t\tmessage = null;\n\n\t\treturn text.id;\n\t}\n\n\tfunction getFirstDefined() {\n\t\tvar values = [].slice.apply(arguments, [0]);\n\n\t\tfor (var i = 0; i < values.length; i++) {\n\t\t\tif (values[i]) {\n\t\t\t\treturn values[i];\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfunction _boxStructure(config, ok, cancel) {\n\t\tvar box = document.createElement(\"DIV\");\n\n\t\tvar locale = gantt.locale;\n\n\t\tvar contentId = utils.uid();\n\t\tgantt._waiAria.messageModalAttr(box, contentId);\n\n\n\t\tbox.className = \" gantt_modal_box dhtmlx_modal_box gantt-\" + config.type + \" dhtmlx-\" + config.type;\n\t\tbox.setAttribute(\"dhxbox\", 1);\n\n\t\tvar inner = '';\n\n\t\tif (config.width)\n\t\t\tbox.style.width = config.width;\n\t\tif (config.height)\n\t\t\tbox.style.height = config.height;\n\t\tif (config.title)\n\t\t\tinner += '';\n\t\tinner += '';\n\t\tbox.innerHTML = inner;\n\n\t\tif (config.content) {\n\t\t\tvar node = config.content;\n\t\t\tif (typeof node == \"string\")\n\t\t\t\tnode = document.getElementById(node);\n\t\t\tif (node.style.display == 'none')\n\t\t\t\tnode.style.display = \"\";\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\n\t\t}\n\n\t\tbox.onclick = function (e) {\n\t\t\te = e || event;\n\t\t\tvar source = e.target || e.srcElement;\n\t\t\tif (!source.className) source = source.parentNode;\n\t\t\tif (source.className.split(\" \")[0] == \"gantt_popup_button\") {\n\t\t\t\tvar result = source.getAttribute(\"result\");\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\n\t\t\t\tcallback(config, result);\n\t\t\t}\n\t\t};\n\t\tconfig.box = box;\n\t\tif (ok || cancel)\n\t\t\t_dhx_msg_cfg = config;\n\n\t\treturn box;\n\t}\n\n\tfunction _createBox(config, ok, cancel) {\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\n\n\t\tif (!config.hidden)\n\t\t\tmodality(true);\n\t\tdocument.body.appendChild(box);\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\n\t\tif (config.position == \"top\")\n\t\t\tbox.style.top = \"-3px\";\n\t\telse\n\t\t\tbox.style.top = y + 'px';\n\t\tbox.style.left = x + 'px';\n\t\t//necessary for IE only\n\t\tbox.onkeydown = modal_key;\n\n\t\tmodalBox.focus(box);\n\n\t\tif (config.hidden)\n\t\t\tmodalBox.hide(box);\n\n\t\tgantt.callEvent(\"onMessagePopup\", [box]);\n\t\treturn box;\n\t}\n\n\tfunction alertPopup(config) {\n\t\treturn _createBox(config, true, false);\n\t}\n\n\tfunction confirmPopup(config) {\n\t\treturn _createBox(config, true, true);\n\t}\n\n\tfunction boxPopup(config) {\n\t\treturn _createBox(config);\n\t}\n\n\tfunction box_params(text, type, callback) {\n\t\tif (typeof text != \"object\") {\n\t\t\tif (typeof type == \"function\") {\n\t\t\t\tcallback = type;\n\t\t\t\ttype = \"\";\n\t\t\t}\n\t\t\ttext = {text: text, type: type, callback: callback};\n\t\t}\n\t\treturn text;\n\t}\n\n\tfunction params(text, type, expire, id) {\n\t\tif (typeof text != \"object\")\n\t\t\ttext = {text: text, type: type, expire: expire, id: id};\n\t\ttext.id = text.id || utils.uid();\n\t\ttext.expire = text.expire || messageBox.expire;\n\t\treturn text;\n\t}\n\n\tvar alertBox = function () {\n\t\tvar text = box_params.apply(this, arguments);\n\t\ttext.type = text.type || \"confirm\";\n\t\treturn alertPopup(text);\n\t};\n\tvar confirmBox = function () {\n\t\tvar text = box_params.apply(this, arguments);\n\t\ttext.type = text.type || \"alert\";\n\t\treturn confirmPopup(text);\n\t};\n\tvar modalBox = function () {\n\t\tvar text = box_params.apply(this, arguments);\n\t\ttext.type = text.type || \"alert\";\n\t\treturn boxPopup(text);\n\t};\n\tmodalBox.hide = function (node) {\n\t\twhile (node && node.getAttribute && !node.getAttribute(\"dhxbox\"))\n\t\t\tnode = node.parentNode;\n\t\tif (node) {\n\t\t\tnode.parentNode.removeChild(node);\n\t\t\tmodality(false);\n\n\t\t\tgantt.callEvent(\"onAfterMessagePopup\", [node]);\n\t\t}\n\t};\n\n\tvar domHelpers = require(\"../utils/dom_helpers\");\n\n\tmodalBox.focus = function (node) {\n\t\tsetTimeout(function () {\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\n\t\t\tif (focusable.length) {\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\n\t\t\t}\n\t\t}, 1);\n\t};\n\n\tvar messageBox = function (text, type, expire, id) {\n\t\ttext = params.apply(this, arguments);\n\t\ttext.type = text.type || \"info\";\n\n\t\tvar subtype = text.type.split(\"-\")[0];\n\t\tswitch (subtype) {\n\t\t\tcase \"alert\":\n\t\t\t\treturn alertPopup(text);\n\t\t\tcase \"confirm\":\n\t\t\t\treturn confirmPopup(text);\n\t\t\tcase \"modalbox\":\n\t\t\t\treturn boxPopup(text);\n\t\t\tdefault:\n\t\t\t\treturn info(text);\n\t\t}\n\t};\n\n\tmessageBox.seed = (new Date()).valueOf();\n\tmessageBox.uid = utils.uid;\n\tmessageBox.expire = 4000;\n\tmessageBox.keyboard = true;\n\tmessageBox.position = \"top\";\n\tmessageBox.pull = {};\n\tmessageBox.timers = {};\n\n\tmessageBox.hideAll = function () {\n\t\tfor (var key in messageBox.pull)\n\t\t\tmessageBox.hide(key);\n\t};\n\tmessageBox.hide = function (id) {\n\t\tvar obj = messageBox.pull[id];\n\t\tif (obj && obj.parentNode) {\n\t\t\twindow.setTimeout(function () {\n\t\t\t\tobj.parentNode.removeChild(obj);\n\t\t\t\tobj = null;\n\t\t\t}, 2000);\n\t\t\tobj.className += \" hidden\";\n\n\t\t\tif (messageBox.timers[id])\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\n\t\t\tdelete messageBox.pull[id];\n\t\t}\n\t};\n\n\tvar popups = [];\n\tgantt.attachEvent(\"onMessagePopup\", function(box){\n\t\tpopups.push(box);\n\t});\n\tgantt.attachEvent(\"onAfterMessagePopup\", function(box){\n\t\tfor(var i = 0; i < popups.length; i++){\n\t\t\tif(popups[i] === box){\n\t\t\t\tpopups.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t});\n\n\tgantt.attachEvent(\"onDestroy\", function(){\n\t\tif(modality.cover && modality.cover.parentNode){\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\n\t\t}\n\n\t\tfor(var i = 0; i < popups.length; i++){\n\t\t\tif(popups[i].parentNode){\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\n\t\t\t}\n\t\t}\n\t\tpopups = null;\n\n\t\tif(messageBox.area && messageBox.area.parentNode){\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\n\t\t}\n\t\tmessageBox = null;\n\t});\n\n\treturn {\n\t\talert: alertBox,\n\t\tconfirm: confirmBox,\n\t\tmessage: messageBox,\n\t\tmodalbox: modalBox\n\t};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/message.js\n// module id = 31\n// module chunks = 0","var uiFactory = require(\"./ui_factory\"),\n\tmouseEvents = require(\"./mouse\"),\n\tcreateLayers = require(\"./gantt_layers\"),\n\tCell = require(\"./layout/cell\"),\n\tLayout = require(\"./layout/layout\"),\n\tViewLayout = require(\"./layout/view_layout\"),\n\tViewCell = require(\"./layout/view_cell\"),\n\tResizer = require(\"./layout/resizer_cell\"),\n\tScrollbar = require(\"./layout/scrollbar_cell\"),\n\tTimeline = require(\"./timeline/timeline\"),\n\tGrid = require(\"./grid/grid\"),\n\tResourceGrid = require(\"./grid/resource_grid\"),\n\tResourceTimeline = require(\"./timeline/resource_timeline\");\n\nvar renderTaskBar = require(\"./render/task_bar_render\"),\n\trenderTaskBg = require(\"./render/task_bg_render\"),\n\trenderLink = require(\"./render/link_render\"),\n\tgridRenderer = require(\"./render/task_grid_line_render\");\n\nvar mainGridInitializer = require(\"./grid/main_grid_initializer\");\nvar mainTimelineInitializer = require(\"./timeline/main_timeline_initializer\");\nvar mainLayoutInitializer = require(\"./main_layout_initializer\");\n\nfunction initUI(gantt){\n\tfunction inheritGridConfig(id){\n\t\treturn {\n\t\t\t//width: gantt.config.grid_width\n\t\t};\n\t}\n\n\tfunction attachInitializer(view, initializer){\n\t\tvar ext = initializer(gantt);\n\t\tif(ext.onCreated)\n\t\t\text.onCreated(view);\n\t\tview.attachEvent(\"onReady\", function(){\n\t\t\tif(ext.onInitialized)\n\t\t\t\text.onInitialized(view);\n\t\t});\n\t\tview.attachEvent(\"onDestroy\", function(){\n\t\t\tif(ext.onDestroyed)\n\t\t\t\text.onDestroyed(view);\n\t\t});\n\t}\n\n\tvar factory = uiFactory.createFactory(gantt);\n\tfactory.registerView(\"cell\", Cell);\n\tfactory.registerView(\"resizer\", Resizer);\n\tfactory.registerView(\"scrollbar\", Scrollbar);\n\tfactory.registerView(\"layout\", Layout, function(view){\n\t\tvar id = view.$config ? view.$config.id : null;\n\t\tif(id === \"main\"){\n\t\t\tattachInitializer(view, mainLayoutInitializer);\n\t\t}\n\t});\n\tfactory.registerView(\"viewcell\", ViewCell);\n\tfactory.registerView(\"multiview\", ViewLayout);\n\tfactory.registerView(\"timeline\", Timeline, function(view){\n\t\tvar id = view.$config ? view.$config.id : null;\n\t\tif(id === \"timeline\" || view.$config.bind == \"task\"){\n\t\t\tattachInitializer(view, mainTimelineInitializer);\n\t\t}\n\t});\n\tfactory.registerView(\"grid\", Grid, function(view){\n\t\tvar id = view.$config ? view.$config.id : null;\n\t\tif(id === \"grid\" || view.$config.bind == \"task\"){\n\t\t\tattachInitializer(view, mainGridInitializer);\n\t\t}\n\t});\n\n\tfactory.registerView(\"resourceGrid\", ResourceGrid);\n\tfactory.registerView(\"resourceTimeline\", ResourceTimeline);\n\n\tvar layersEngine = createLayers(gantt);\n\n\treturn {\n\t\tfactory:factory,\n\t\tmouseEvents: mouseEvents.init(gantt),\n\t\tlayersApi: layersEngine.init(),\n\t\trender:{\n\t\t\tgridLine: gridRenderer(gantt),\n\t\t\ttaskBg: renderTaskBg(gantt),\n\t\t\ttaskBar: renderTaskBar(gantt),\n\t\t\tlink: renderLink(gantt)\n\t\t},\n\t\tlayersService: {\n\t\t\tgetDataRender: function(name){\n\t\t\t\treturn layersEngine.getDataRender(name, gantt);\n\t\t\t},\n\t\t\tcreateDataRender: function(config){\n\t\t\t\treturn layersEngine.createDataRender(config, gantt);\n\t\t\t}\n\t\t}\n\t};\n}\n\nmodule.exports = {\n\tinit: initUI\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/index.js\n// module id = 32\n// module chunks = 0","var utils = require(\"../../utils/utils\"),\n\tconfigurable = require(\"./configurable\");\n\nvar uiFactory = function createFactory(gantt){\n\tvar views = {};\n\n\tfunction ui(cell, parentView) {\n\t\tvar content;\n\t\tvar view = \"cell\";\n\t\tif (cell.view){\n\t\t\tview = \"viewcell\";\n\t\t}else if (cell.resizer) {\n\t\t\tview = \"resizer\";\n\t\t}\n\t\telse if (cell.rows || cell.cols) {\n\t\t\tview = \"layout\";\n\t\t}\n\t\telse if (cell.views) {\n\t\t\tview = \"multiview\";\n\t\t}\n\n\t\tcontent = createView.call(this, view, null, cell, parentView);\n\t\treturn content;\n\t}\n\t\n\tvar createdViews = {};\n\n\tfunction createView(name, parent, config, parentView) {\n\t\tvar creator = views[name];\n\n\t\tif(!creator || !creator.create)\n\t\t\treturn false;\n\n\t\tif(name == \"resizer\" && !config.mode){\n\t\t\tif(parentView.$config.cols){\n\t\t\t\tconfig.mode = \"x\";\n\t\t\t}else{\n\t\t\t\tconfig.mode = \"y\";\n\t\t\t}\n\t\t}\n\n\t\tif(name == \"viewcell\" && config.view == \"scrollbar\" && !config.scroll){\n\t\t\tif(parentView.$config.cols){\n\t\t\t\tconfig.scroll = \"y\";\n\t\t\t}else{\n\t\t\t\tconfig.scroll = \"x\";\n\t\t\t}\n\t\t}\n\n\t\tvar config = utils.copy(config);\n\n\t\tif(!config.id && !createdViews[config.view]){\n\t\t\tconfig.id = config.view;\n\t\t}\n\n\t\tif(config.id && !config.css){\n\t\t\tconfig.css = config.id+\"_cell\";\n\t\t}\n\n\t\tvar view = new creator.create(parent, config, this, gantt);\n\n\t\tif(creator.configure){\n\t\t\tcreator.configure(view);\n\t\t}\n\n\t\tconfigurable(view, parentView);\n\t\tif(!view.$id){\n\t\t\tview.$id = config.id || gantt.uid();\n\t\t}\n\n\t\tif(!view.$parent && typeof parent == \"object\"){\n\t\t\tview.$parent = parent;\n\t\t}\n\t\tif(!view.$config){\n\t\t\tview.$config = config;\n\t\t}\n\n\t\tif(createdViews[view.$id]){\n\t\t\tview.$id = gantt.uid();\n\t\t}\n\n\t\tcreatedViews[view.$id] = view;\n\n\t\treturn view;\n\t}\n\n\tfunction reset(){\n\t\tcreatedViews = {};\n\t}\n\n\tfunction register(name, viewConstructor, configure){\n\t\tviews[name] = {create: viewConstructor, configure: configure};\n\t}\n\n\tfunction getView(id){\n\t\treturn createdViews[id];\n\t}\n\n\tvar factory = {\n\t\tinitUI:ui,\n\t\treset: reset,\n\t\tregisterView: register,\n\t\tcreateView: createView,\n\t\tgetView: getView\n\t};\n\n\treturn factory;\n};\n\nmodule.exports = {\n\tcreateFactory: uiFactory\n};\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/ui_factory.js\n// module id = 33\n// module chunks = 0","var utils = require(\"../../utils/utils\");\n\nfunction ViewSettings(config){\n\tutils.mixin(this, config, true);\n}\n\n\nfunction extendSettings (store, parentSettings){\n\tvar own = this.$config[store];\n\n\tif(own){\n\t\tif(own instanceof ViewSettings){\n\t\t\treturn own;\n\t\t}else{\n\t\t\tViewSettings.prototype = parentSettings;\n\t\t\tthis.$config[store] = new ViewSettings(own);\n\t\t\treturn this.$config[store];\n\t\t}\n\t}else{\n\t\treturn parentSettings;\n\t}\n}\n\nvar configurable = function(parentView){\n\tvar parentConfig,\n\t\tparentTemplates;\n\n\treturn {\n\t\t$getConfig: function(){\n\t\t\tif(!parentConfig){\n\t\t\t\tparentConfig = parentView ? parentView.$getConfig() : this.$gantt.config;\n\t\t\t}\n\n\t\t\treturn extendSettings.call(this, \"config\", parentConfig);\n\t\t},\n\t\t$getTemplates: function(){\n\t\t\tif(!parentTemplates){\n\t\t\t\tparentTemplates = parentView ? parentView.$getTemplates() : this.$gantt.templates;\n\t\t\t}\n\n\t\t\treturn extendSettings.call(this, \"templates\", parentTemplates);\n\t\t}\n\t};\n};\n\nmodule.exports = function(obj, parent){\n\tutils.mixin(obj, configurable(parent));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/configurable.js\n// module id = 34\n// module chunks = 0","var domHelpers = require(\"../../utils/dom_helpers\");\n\nvar createMouseHandler = (function(domHelpers) {\n\treturn function (gantt) {\n\t\tvar eventHandlers = {\n\t\t\t\"click\": {},\n\t\t\t\"doubleclick\": {},\n\t\t\t\"contextMenu\": {}\n\t\t};\n\n\t\tfunction addEventTarget(event, className, handler, root) {\n\t\t\tif(!eventHandlers[event][className]){\n\t\t\t\teventHandlers[event][className] = [];\n\t\t\t}\n\n\t\t\teventHandlers[event][className].push({\n\t\t\t\thandler: handler,\n\t\t\t\troot: root\n\t\t\t});\n\t\t}\n\n\t\tfunction callHandler(eventName, className, root, args) {\n\t\t\tvar handlers = eventHandlers[eventName][className];\n\t\t\tif(handlers){\n\t\t\t\tfor(var i = 0; i < handlers.length; i++){\n\t\t\t\t\tif(!(root || handlers[i].root) || handlers[i].root === root){\n\t\t\t\t\t\thandlers[i].handler.apply(this, args);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onClick(e) {\n\t\t\te = e || window.event;\n\t\t\tvar trg = e.target || e.srcElement;\n\t\t\tvar id = gantt.locate(e);\n\n\t\t\tvar handlers = findEventHandlers(e, eventHandlers.click);\n\t\t\tvar res = true;\n\t\t\tif (id !== null) {\n\t\t\t\tres = !gantt.checkEvent(\"onTaskClick\") || gantt.callEvent(\"onTaskClick\", [id, e]);\n\t\t\t} else {\n\t\t\t\tgantt.callEvent(\"onEmptyClick\", [e]);\n\t\t\t}\n\n\t\t\tif (res) {\n\t\t\t\tvar default_action = callEventHandlers(handlers, e, id);\n\t\t\t\tif (!default_action)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (id && gantt.getTask(id) && gantt.config.select_task && !gantt.config.multiselect) {\n\t\t\t\t\tgantt.selectTask(id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onContextMenu(e) {\n\t\t\te = e || window.event;\n\t\t\tvar src = e.target || e.srcElement,\n\t\t\t\ttaskId = gantt.locate(src),\n\t\t\t\tlinkId = gantt.locate(src, gantt.config.link_attribute);\n\n\t\t\tvar res = !gantt.checkEvent(\"onContextMenu\") || gantt.callEvent(\"onContextMenu\", [taskId, linkId, e]);\n\t\t\tif (!res) {\n\t\t\t\tif (e.preventDefault)\n\t\t\t\t\te.preventDefault();\n\t\t\t\telse\n\t\t\t\t\te.returnValue = false;\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\n\t\tfunction findEventHandlers(e, hash){\n\t\t\tvar trg = e.target || e.srcElement;\n\t\t\tvar handlers = [];\n\t\t\twhile (trg) {\n\t\t\t\tvar css = domHelpers.getClassName(trg);\n\t\t\t\tif (css) {\n\t\t\t\t\tcss = css.split(\" \");\n\t\t\t\t\tfor (var i = 0; i < css.length; i++) {\n\t\t\t\t\t\tif (!css[i]) continue;\n\t\t\t\t\t\tif (hash[css[i]]) {\n\t\t\t\t\t\t\tvar delegateHandlers = hash[css[i]];\n\n\t\t\t\t\t\t\tfor(var h = 0; h < delegateHandlers.length; h++){\n\t\t\t\t\t\t\t\tif(delegateHandlers[h].root){\n\t\t\t\t\t\t\t\t\tif(!domHelpers.isChildOf(trg, delegateHandlers[h].root)){\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thandlers.push(delegateHandlers[h].handler);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttrg = trg.parentNode;\n\t\t\t}\n\t\t\treturn handlers;\n\t\t}\n\n\t\tfunction callEventHandlers(handlers, e, id){\n\t\t\tvar res = true;\n\n\t\t\tfor(var i = 0; i < handlers.length; i++){\n\t\t\t\tvar handlerResult = handlers[i].call(gantt, e, id, e.target || e.srcElement);\n\t\t\t\tres = res && !(typeof handlerResult != \"undefined\" && handlerResult !== true);\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\n\t\tfunction onDoubleClick(e) {\n\t\t\te = e || window.event;\n\t\t\tvar trg = e.target || e.srcElement;\n\t\t\tvar id = gantt.locate(e);\n\n\t\t\tvar handlers = findEventHandlers(e, eventHandlers.doubleclick);\n\t\t\tvar res = !gantt.checkEvent(\"onTaskDblClick\") || gantt.callEvent(\"onTaskDblClick\", [id, e]);\n\t\t\tif (res) {\n\t\t\t\tvar default_action = callEventHandlers(handlers, e, id);\n\t\t\t\tif (!default_action)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (id !== null && gantt.getTask(id)) {\n\t\t\t\t\tif (res && gantt.config.details_on_dblclick) {\n\t\t\t\t\t\tgantt.showLightbox(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onMouseMove(e) {\n\t\t\tif (gantt.checkEvent(\"onMouseMove\")) {\n\t\t\t\tvar id = gantt.locate(e);\n\t\t\t\tgantt._last_move_event = e;\n\t\t\t\tgantt.callEvent(\"onMouseMove\", [id, e]);\n\t\t\t}\n\t\t}\n\n\t\tfunction detach(eventName, className, handler, root) {\n\t\t\tif (eventHandlers[eventName]) {\n\t\t\t\tfor(var i = 0; i < eventHandlers[eventName].length; i++){\n\t\t\t\t\tif(eventHandlers[eventName][i].root == root){\n\t\t\t\t\t\teventHandlers[eventName].splice(i, 1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar domEvents = gantt._createDomEventScope();\n\n\t\tfunction reset(node){\n\n\t\t\tdomEvents.detachAll();\n\n\t\t\tif(node){\n\t\t\t\tdomEvents.attach(node, \"click\", onClick);\n\t\t\t\tdomEvents.attach(node, \"dblclick\", onDoubleClick);\n\t\t\t\tdomEvents.attach(node, \"mousemove\", onMouseMove);\n\t\t\t\tdomEvents.attach(node, \"contextmenu\", onContextMenu);\n\t\t\t}\n\t\t}\n\n\n\n\t\treturn {\n\t\t\treset: reset,\n\t\t\tglobal: function(event, classname, handler){\n\t\t\t\taddEventTarget(event, classname, handler, null);\n\t\t\t},\n\t\t\tdelegate: addEventTarget,\n\t\t\tdetach: detach,\n\t\t\tcallHandler: callHandler,\n\t\t\tonDoubleClick: onDoubleClick,\n\t\t\tonMouseMove: onMouseMove,\n\t\t\tonContextMenu: onContextMenu,\n\t\t\tonClick: onClick,\n\t\t\tdestructor: function(){\n\t\t\t\treset();\n\t\t\t\teventHandlers = null;\n\t\t\t\tdomEvents = null;\n\t\t\t}\n\n\t\t};\n\t};\n\n})(domHelpers);\n\n\nmodule.exports = {\n\tinit:createMouseHandler\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/mouse.js\n// module id = 35\n// module chunks = 0","var createLayerFactory = require(\"./render/layer_engine\");\n\nvar createLayerEngine = function(gantt){\n\tvar factory = createLayerFactory(gantt);\n\treturn {\n\t\tgetDataRender: function(name){\n\t\t\treturn gantt.$services.getService(\"layer:\" + name) || null;\n\t\t},\n\t\tcreateDataRender: function(config){\n\t\t\tvar name = config.name,\n\t\t\t\tdefaultContainer = config.defaultContainer,\n\t\t\t\tpreviusSiblingContainer = config.defaultContainerSibling;\n\n\t\t\tvar layers = factory.createGroup(\n\t\t\t\tdefaultContainer,\n\t\t\t\tpreviusSiblingContainer,\n\t\t\t\tfunction(itemId, item){\n\t\t\t\t\tif(layers.filters){\n\t\t\t\t\t\tfor(var i = 0; i < layers.filters.length; i++){\n\t\t\t\t\t\t\tif(layers.filters[i](itemId, item) === false){\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tgantt.$services.setService(\"layer:\" + name, function(){\n\t\t\t\treturn layers;\n\t\t\t});\n\n\t\t\tgantt.attachEvent(\"onGanttReady\", function () {\n\t\t\t\tlayers.addLayer();// init layers on start\n\t\t\t});\n\n\t\t\treturn layers;\n\t\t},\n\t\tinit: function(){\n\t\t\tvar taskLayers = this.createDataRender({\n\t\t\t\tname: \"task\",\n\t\t\t\tdefaultContainer: function(){\n\t\t\t\t\tif(gantt.$task_data){\n\t\t\t\t\t\treturn gantt.$task_data;\n\t\t\t\t\t}else if(gantt.$ui.getView(\"timeline\")){\n\t\t\t\t\t\treturn gantt.$ui.getView(\"timeline\").$task_data;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tdefaultContainerSibling: function(){\n\t\t\t\t\tif(gantt.$task_links){\n\t\t\t\t\t\treturn gantt.$task_links;\n\t\t\t\t\t}else if(gantt.$ui.getView(\"timeline\")){\n\t\t\t\t\t\treturn gantt.$ui.getView(\"timeline\").$task_links;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tfilter: function(item){\n\n\t\t\t\t}\n\t\t\t}, gantt);\n\n\t\t\tvar linkLayers = this.createDataRender({\n\t\t\t\tname: \"link\",\n\t\t\t\tdefaultContainer: function(){\n\t\t\t\t\tif(gantt.$task_data){\n\t\t\t\t\t\treturn gantt.$task_data;\n\t\t\t\t\t}else if(gantt.$ui.getView(\"timeline\")){\n\t\t\t\t\t\treturn gantt.$ui.getView(\"timeline\").$task_data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, gantt);\n\n\t\t\treturn {\n\t\t\t\taddTaskLayer: function(config){\n\t\t\t\t\treturn taskLayers.addLayer(config);\n\t\t\t\t},\n\n\t\t\t\t/*getTaskLayer: function(id){\n\t\t\t\t\treturn taskLayers.getLayer(id);\n\t\t\t\t},*/\n\n\t\t\t\t_getTaskLayers: function(){\n\t\t\t\t\treturn taskLayers.getLayers();\n\t\t\t\t},\n\t\t\t\tremoveTaskLayer: function(id){\n\t\t\t\t\ttaskLayers.removeLayer(id);\n\t\t\t\t},\n\t\t\t\t/*eachTaskLayer: function(code){\n\t\t\t\t\ttaskLayers.eachLayer(code);\n\t\t\t\t},*/\n\t\t\t\t_clearTaskLayers: function(){\n\t\t\t\t\ttaskLayers.clear();\n\t\t\t\t},\n\t\t\t\taddLinkLayer: function(config){\n\t\t\t\t\treturn linkLayers.addLayer(config);\n\t\t\t\t},\n\t\t\t\t/*getLinkLayer: function(id){\n\t\t\t\t\treturn linkLayers.getLayer(id);\n\t\t\t\t},*/\n\t\t\t\t_getLinkLayers: function(){\n\t\t\t\t\treturn linkLayers.getLayers();\n\t\t\t\t},\n\t\t\t\tremoveLinkLayer: function(id){\n\t\t\t\t\tlinkLayers.removeLayer(id);\n\t\t\t\t},\n\t\t\t\t/*eachLinkLayer: function(code){\n\t\t\t\t\tlinkLayers.eachLayer(code);\n\t\t\t\t},*/\n\t\t\t\t_clearLinkLayers: function(){\n\t\t\t\t\tlinkLayers.clear();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n};\n\nmodule.exports = createLayerEngine;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/gantt_layers.js\n// module id = 36\n// module chunks = 0","var renderFactoryProvider = require(\"./render_factory\");\nvar utils = require(\"../../../utils/utils\");\n\nvar layerFactory = function(gantt){\n\n\tvar renderFactory = renderFactoryProvider(gantt);\n\treturn {\n\tcreateGroup: function (get_container, rel_root, defaultFilters) {\n\n\t\tvar renderGroup = {\n\t\t\ttempCollection: [],\n\t\t\trenderers: {},\n\t\t\tcontainer: get_container,\n\t\t\tfilters: [],\n\t\t\tgetLayers: function () {\n\t\t\t\tvar res = [];\n\t\t\t\tfor (var i in this.renderers) {\n\t\t\t\t\tres.push(this.renderers[i]);\n\t\t\t\t}\n\t\t\t\treturn res;\n\t\t\t},\n\t\t\tgetLayer: function (id) {\n\t\t\t\treturn this.renderers[id];\n\t\t\t},\n\t\t\t_add: function (layer) {\n\t\t\t\tif (layer) {\n\t\t\t\t\tlayer.id = layer.id || utils.uid();\n\t\t\t\t\tthis.tempCollection.push(layer);\n\t\t\t\t}\n\n\t\t\t\tif (!this.container()) return;\n\n\t\t\t\tvar container = this.container();\n\n\t\t\t\tvar pending = this.tempCollection;\n\t\t\t\tfor (var i = 0; i < pending.length; i++) {\n\t\t\t\t\tlayer = pending[i];\n\n\n\t\t\t\t\tvar node = layer.container,\n\t\t\t\t\t\tid = layer.id,\n\t\t\t\t\t\ttopmost = layer.topmost;\n\t\t\t\t\tif (!node.parentNode) {\n\t\t\t\t\t\t//insert on top or below the tasks\n\t\t\t\t\t\tif (topmost) {\n\t\t\t\t\t\t\tcontainer.appendChild(node);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar rel = rel_root ? rel_root() : container.firstChild;\n\t\t\t\t\t\t\tif (rel)\n\t\t\t\t\t\t\t\tcontainer.insertBefore(node, rel);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tcontainer.appendChild(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.renderers[id] = renderFactory.getRenderer(\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tlayer,\n\t\t\t\t\t\tnode\n\t\t\t\t\t);\n\t\t\t\t\tthis.tempCollection.splice(i, 1);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t},\n\t\t\taddLayer: function (config) {\n\t\t\t\t//config = prepareConfig(config);\n\t\t\t\tif(config){\n\t\t\t\t\tif(typeof config == \"function\"){\n\t\t\t\t\t\tconfig = {renderer: config};\n\t\t\t\t\t}\n\n\t\t\t\t\tif(config.filter === undefined){\n\t\t\t\t\t\tconfig.filter = mergeFilters(defaultFilters || []);\n\t\t\t\t\t}else if(config.filter instanceof Array){\n\t\t\t\t\t\tconfig.filter.push(defaultFilters);\n\t\t\t\t\t\tconfig.filter = mergeFilters(config.filter);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!config.container){\n\t\t\t\t\t\tconfig.container = document.createElement(\"div\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._add(config);\n\t\t\t\treturn (config ? config.id : undefined);\n\t\t\t},\n\t\t\teachLayer: function(code){\n\t\t\t\tfor (var i in this.renderers) {\n\t\t\t\t\tcode(this.renderers[i]);\n\t\t\t\t}\n\t\t\t},\n\t\t\tremoveLayer: function (id) {\n\t\t\t\tif(!this.renderers[id])\n\t\t\t\t\treturn;\n\t\t\t\tthis.renderers[id].destructor();\n\t\t\t\tdelete this.renderers[id];\n\t\t\t},\n\t\t\tclear: function () {\n\t\t\t\tfor (var i in this.renderers) {\n\t\t\t\t\tthis.renderers[i].destructor();\n\t\t\t\t}\n\t\t\t\tthis.renderers = {};\n\t\t\t}//,\n\t\t\t//prepareConfig: prepareConfig\n\t\t};\n\n\t\tgantt.attachEvent(\"onDestroy\", function(){\n\t\t\trenderGroup.clear();\n\t\t\trenderGroup = null;\n\t\t});\n\n\t\treturn renderGroup;\n\t}\n};};\n\n\nfunction mergeFilters(filter_methods){\n\tif(!(filter_methods instanceof Array)){\n\t\tfilter_methods = Array.prototype.slice.call(arguments, 0);\n\t}\n\n\treturn function(obj){\n\t\tvar res = true;\n\t\tfor(var i = 0, len = filter_methods.length; i < len; i++){\n\t\t\tvar filter_method = filter_methods[i];\n\t\t\tif(filter_method){\n\t\t\t\tres = res && (filter_method(obj.id, obj) !== false);\n\t\t\t}\n\t\t}\n\n\t\treturn res;\n\t};\n}\n\n\nmodule.exports = layerFactory;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/render/layer_engine.js\n// module id = 37\n// module chunks = 0","var rendererFactory = function(gantt){\n\tvar services = gantt.$services;\n\n\t//hash of dom elements is needed to redraw single bar/link\n\tvar task_area_pulls = {},\n\t\ttask_area_renderers = {};\n\n\tfunction getRenderer(id, layer, node) {\n\n\t\tif (task_area_renderers[id])\n\t\t\treturn task_area_renderers[id];\n\n\t\tif (!layer.renderer)\n\t\t\tgantt.assert(false, \"Invalid renderer call\");\n\n\t\tvar renderOne = function(item){\n\t\t\treturn layer.renderer.call(this, item, layer.host);\n\t\t} ;\n\n\t\tvar filter = layer.filter;\n\n\t\tif (node)\n\t\t\tnode.setAttribute(services.config().layer_attribute, true);\n\n\t\ttask_area_renderers[id] = {\n\t\t\trender_item: function (item, container) {\n\t\t\t\tcontainer = container || node;\n\n\t\t\t\tif (filter) {\n\t\t\t\t\tif (!filter(item)) {\n\t\t\t\t\t\tthis.remove_item(item.id);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar dom = renderOne.call(gantt, item);\n\t\t\t\tthis.append(item, dom, container);\n\n\t\t\t},\n\n\t\t\tclear: function (container) {\n\t\t\t\tthis.rendered = task_area_pulls[id] = {};\n\t\t\t\tthis.clear_container(container);\n\t\t\t},\n\t\t\tclear_container: function (container) {\n\t\t\t\tcontainer = container || node;\n\t\t\t\tif (container)\n\t\t\t\t\tcontainer.innerHTML = \"\";\n\t\t\t},\n\t\t\trender_items: function (items, container) {\n\t\t\t\tcontainer = container || node;\n\n\t\t\t\tvar buffer = document.createDocumentFragment();\n\t\t\t\tthis.clear(container);\n\t\t\t\tfor (var i = 0, vis = items.length; i < vis; i++) {\n\t\t\t\t\tthis.render_item(items[i], buffer);\n\t\t\t\t}\n\n\t\t\t\tcontainer.appendChild(buffer);\n\t\t\t},\n\t\t\tappend: function (item, node, container) {\n\t\t\t\tif (!node) {\n\t\t\t\t\tif (this.rendered[item.id]) {\n\t\t\t\t\t\tthis.remove_item(item.id);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.rendered[item.id] && this.rendered[item.id].parentNode) {\n\t\t\t\t\tthis.replace_item(item.id, node);\n\t\t\t\t} else {\n\t\t\t\t\tcontainer.appendChild(node);\n\t\t\t\t}\n\t\t\t\tthis.rendered[item.id] = node;\n\n\t\t\t},\n\t\t\treplace_item: function (item_id, newNode) {\n\t\t\t\tvar item = this.rendered[item_id];\n\t\t\t\tif (item && item.parentNode) {\n\t\t\t\t\titem.parentNode.replaceChild(newNode, item);\n\t\t\t\t}\n\t\t\t\tthis.rendered[item_id] = newNode;\n\t\t\t},\n\t\t\tremove_item: function (item_id) {\n\t\t\t\tthis.hide(item_id);\n\t\t\t\tdelete this.rendered[item_id];\n\t\t\t},\n\t\t\thide: function (item_id) {\n\t\t\t\tvar item = this.rendered[item_id];\n\t\t\t\tif (item && item.parentNode) {\n\t\t\t\t\titem.parentNode.removeChild(item);\n\t\t\t\t}\n\t\t\t},\n\t\t\trestore: function (item) {\n\t\t\t\tvar dom = this.rendered[item.id];\n\t\t\t\tif (dom) {\n\t\t\t\t\tif (!dom.parentNode) {\n\t\t\t\t\t\tthis.append(item, dom, node);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.render_item(item, node);\n\t\t\t\t}\n\t\t\t},\n\t\t\tchange_id: function (oldid, newid) {\n\t\t\t\tthis.rendered[newid] = this.rendered[oldid];\n\t\t\t\tdelete this.rendered[oldid];\n\t\t\t},\n\t\t\trendered: task_area_pulls[id],\n\t\t\tnode: node,\n\t\t\tdestructor: function () {\n\t\t\t\tthis.clear();\n\t\t\t\tdelete task_area_renderers[id];\n\t\t\t\tdelete task_area_pulls[id];\n\t\t\t}\n\t\t};\n\n\t\treturn task_area_renderers[id];\n\t}\n\n\n\tfunction clearRenderers() {\n\t\tfor (var i in task_area_renderers) {\n\t\t\tgetRenderer(i).destructor();\n\t\t}\n\t}\n\n\treturn {\n\t\tgetRenderer: getRenderer,\n\t\tclearRenderers: clearRenderers\n\t};\n\n};\n\nmodule.exports = rendererFactory;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/render/render_factory.js\n// module id = 38\n// module chunks = 0","var __extends = require(\"../../../utils/extends\"),\n\tLayout = require(\"./layout\"),\n\tCell = require(\"./cell\");\n\nvar ViewLayout = (function (_super) {\n\t\"use strict\";\n\n\t__extends(ViewLayout, _super);\n\tfunction ViewLayout(parent, config, factory) {\n\t\tvar _this = _super.apply(this, arguments) || this;\n\t\tfor (var i = 0; i < _this.$cells.length; i++) {\n\t\t\t_this.$cells[i].$config.hidden = (i !== 0);\n\t\t}\n\t\t_this.$cell = _this.$cells[0];\n\t\t_this.$name = \"viewLayout\";\n\n\t\treturn _this;\n\t}\n\tViewLayout.prototype.cell = function (id) {\n\t\tvar cell = _super.prototype.cell.call(this, id);\n\t\tif (!cell.$view) {\n\t\t\tthis.$fill(null, this);\n\t\t}\n\t\treturn cell;\n\t};\n\tViewLayout.prototype.moveView = function (view) {\n\t\tvar body = this.$view;\n\t\tif (this.$cell) {\n\t\t\tthis.$cell.$config.hidden = true;\n\t\t\tbody.removeChild(this.$cell.$view);\n\t\t}\n\t\tthis.$cell = view;\n\t\tbody.appendChild(view.$view);\n\t};\n\tViewLayout.prototype.setSize = function (x, y) {\n\t\tCell.prototype.setSize.call(this, x, y);\n\t};\n\n\tViewLayout.prototype.setContentSize = function(){\n\t\tvar size = this.$lastSize;\n\t\tthis.$cell.setSize(size.contentX, size.contentY);\n\t};\n\n\tViewLayout.prototype.getSize = function () {\n\t\tvar sizes = _super.prototype.getSize.call(this);\n\t\tif (this.$cell) {\n\t\t\tvar cellSize = this.$cell.getSize();\n\t\t\tif (this.$config.byMaxSize) {\n\t\t\t\tfor (var i = 0; i < this.$cells.length; i++) {\n\t\t\t\t\tvar otherCell = this.$cells[i].getSize();\n\t\t\t\t\tfor (var cell in cellSize) {\n\t\t\t\t\t\tcellSize[cell] = Math.max(cellSize[cell], otherCell[cell]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var size in sizes) {\n\t\t\t\tsizes[size] = sizes[size] || cellSize[size];\n\t\t\t}\n\t\t\tsizes.gravity = Math.max(sizes.gravity, cellSize.gravity);\n\t\t}\n\t\treturn sizes;\n\t};\n\treturn ViewLayout;\n}(Layout));\n\nmodule.exports = ViewLayout;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/layout/view_layout.js\n// module id = 39\n// module chunks = 0","var __extends = require(\"../../../utils/extends\"),\n\tutils = require(\"../../../utils/utils\"),\n\tCell = require(\"./cell\");\n\nvar ViewCell = (function (_super) {\n\t\"use strict\";\n\n\t__extends(ViewCell, _super);\n\tfunction ViewCell(parent, config, factory) {\n\n\t\tvar _this = _super.apply(this, arguments) || this;\n\n\t\tif(config.view){\n\t\t\tif(config.id){\n\t\t\t\t// pass id to the nested view\n\t\t\t\tthis.$id = utils.uid();\n\t\t\t}\n\t\t\tvar childConfig = utils.copy(config);\n\t\t\tdelete childConfig.config;\n\t\t\tdelete childConfig.templates;\n\n\t\t\tthis.$content = this.$factory.createView(config.view, this, childConfig, this);\n\t\t\tif(!this.$content)\n\t\t\t\treturn false;\n\t\t}\n\n\t\t_this.$name = \"viewCell\";\n\t\treturn _this;\n\t}\n\n\tViewCell.prototype.destructor = function(){\n\t\tthis.clear();\n\t\t_super.prototype.destructor.call(this);\n\t};\n\n\tViewCell.prototype.clear = function(){\n\n\t\tthis.$initialized = false;\n\n\t\t// call destructor\n\t\tif (this.$content){\n\t\t\tvar method = this.$content.unload || this.$content.destructor;\n\t\t\tif (method){\n\t\t\t\tmethod.call(this.$content);\n\t\t\t}\n\t\t}\n\n\t\t_super.prototype.clear.call(this);\n\n\t};\n\n\tViewCell.prototype.scrollTo = function(left, top){\n\n\t\tif(this.$content && this.$content.scrollTo){\n\t\t\tthis.$content.scrollTo(left, top);\n\t\t}else{\n\t\t\t_super.prototype.scrollTo.call(this, left, top);\n\t\t}\n\t};\n\n\tViewCell.prototype._setContentSize = function(x, y){\n\t\tvar borders = this._getBorderSizes();\n\t\tvar outerX = x + borders.horizontal;\n\t\tvar outerY = y + borders.vertical;\n\t\tthis.$config.width = outerX;\n\t\tthis.$config.height = outerY;\n\t};\n\n\tViewCell.prototype.setSize = function(x, y){\n\t\t_super.prototype.setSize.call(this, x, y);\n\n\t\tif(!this.$preResize && this.$content) {\n\t\t\tif (!this.$initialized) {\n\t\t\t\tthis.$initialized = true;\n\t\t\t\tvar header = this.$view.childNodes[0];\n\t\t\t\tvar content = this.$view.childNodes[1];\n\t\t\t\tif(!content) content = header;\n\n\t\t\t\t/*if(this.$content.$config){\n\t\t\t\t\tthis.$content.$config.width = this.$lastSize.contentX;\n\t\t\t\t\tthis.$content.$config.height = this.$lastSize.contentY;\n\t\t\t\t}*/\n\t\t\t\tthis.$content.init(content);\n\t\t\t}\n\t\t}\n\t};\n\n\tViewCell.prototype.setContentSize = function(){\n\t\tif(!this.$preResize && this.$content) {\n\t\t\tif (this.$initialized) {\n\t\t\t\tthis.$content.setSize(this.$lastSize.contentX, this.$lastSize.contentY);\n\t\t\t}\n\t\t}\n\t};\n\n\n\tViewCell.prototype.getContentSize = function(){\n\t\tvar size = _super.prototype.getContentSize.call(this);\n\n\t\tif(this.$content && this.$initialized){\n\t\t\tvar childSize = this.$content.getSize();\n\t\t\tsize.width = childSize.contentX === undefined ? childSize.width : childSize.contentX;\n\t\t\tsize.height = childSize.contentY === undefined ? childSize.height : childSize.contentY;\n\t\t}\n\n\t\tvar borders = this._getBorderSizes();\n\t\tsize.width += borders.horizontal;\n\t\tsize.height += borders.vertical;\n\n\t\treturn size;\n\t};\n\n\treturn ViewCell;\n}(Cell));\n\nmodule.exports = ViewCell;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/layout/view_cell.js\n// module id = 40\n// module chunks = 0","module.exports = null;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/layout/resizer_cell.gpl.js\n// module id = 41\n// module chunks = 0","var __extends = require(\"../../../utils/extends\"),\n\tdomHelpers = require(\"../../../utils/dom_helpers\"),\n\tutils = require(\"../../../utils/utils\"),\n\tenv = require(\"../../../utils/env\"),\n\teventable = require(\"../../../utils/eventable\"),\n\tCell = require(\"./cell\");\n\nvar ScrollbarCell = (function (_super) {\n\t\"use strict\";\n\n\t__extends(ScrollbarCell, _super);\n\tfunction ScrollbarCell(parent, config, factory, gantt) {\n\n\t\tvar _this = _super.apply(this, arguments) || this;\n\t\tthis.$config = utils.mixin(config, {scroll: \"x\"});\n\t\t_this._scrollHorizontalHandler = utils.bind(_this._scrollHorizontalHandler, _this);\n\t\t_this._scrollVerticalHandler = utils.bind(_this._scrollVerticalHandler, _this);\n\t\t_this._outerScrollVerticalHandler = utils.bind(_this._outerScrollVerticalHandler, _this);\n\t\t_this._outerScrollHorizontalHandler = utils.bind(_this._outerScrollHorizontalHandler, _this);\n\t\t_this._mouseWheelHandler = utils.bind(_this._mouseWheelHandler, _this);\n\n\t\tthis.$config.hidden = true;\n\t\tvar size = gantt.config.scroll_size;\n\n\t\tif(gantt.env.isIE){\n\t\t\t// full element height/width must be bigger than just a browser scrollbar,\n\t\t\t// otherwise the scrollbar element won't be scrolled on click\n\t\t\tsize += 1;\n\t\t}\n\n\t\tif(this._isHorizontal()){\n\t\t\t_this.$config.height = size;\n\t\t\t_this.$parent.$config.height = size;\n\t\t}else{\n\t\t\t_this.$config.width = size;\n\t\t\t_this.$parent.$config.width = size;\n\t\t}\n\n\t\tthis.$config.scrollPosition = 0;\n\n\t\t_this.$name = \"scroller\";\n\t\treturn _this;\n\t}\n\n\tScrollbarCell.prototype.init = function(container){\n\t\tcontainer.innerHTML = this.$toHTML();\n\t\tthis.$view = container.firstChild;\n\n\t\tif(!this.$view){\n\t\t\tthis.init();\n\t\t}\n\t\tif(this._isVertical()){\n\t\t\tthis._initVertical();\n\t\t}else{\n\t\t\tthis._initHorizontal();\n\t\t}\n\t\tthis._initMouseWheel();\n\t\tthis._initLinkedViews();\n\t};\n\n\tScrollbarCell.prototype.$toHTML = function () {\n\t\tvar className = this._isHorizontal() ? \"gantt_hor_scroll\" : \"gantt_ver_scroll\";\n\t\treturn \"\";\n\t};\n\n\tScrollbarCell.prototype._getRootParent = function(){\n\t\tvar parent = this.$parent;\n\t\twhile(parent && parent.$parent){\n\t\t\tparent = parent.$parent;\n\t\t}\n\t\tif(parent){\n\t\t\treturn parent;\n\t\t}\n\t};\n\n\n\tfunction eachCell(root, res){\n\t\tres.push(root);\n\t\tif(root.$cells){\n\t\t\tfor(var i = 0; i < root.$cells.length; i++){\n\t\t\t\teachCell(root.$cells[i], res);\n\t\t\t}\n\t\t}\n\t}\n\tScrollbarCell.prototype._eachView = function(){\n\t\tvar res = [];\n\t\teachCell(this._getRootParent(), res);\n\t\treturn res;\n\t};\n\n\tScrollbarCell.prototype._getLinkedViews = function(){\n\t\tvar views = this._eachView();\n\t\tvar res = [];\n\t\tfor(var i = 0; i < views.length; i++){\n\t\t\tif(views[i].$config && ((this._isVertical() && views[i].$config.scrollY == this.$id) || (this._isHorizontal() && views[i].$config.scrollX == this.$id)) ){\n\t\t\t\tres.push(views[i]);\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t};\n\n\n\tScrollbarCell.prototype._initHorizontal = function(){\n\t\tthis.$scroll_hor = this.$view;\n\t\tthis.$domEvents.attach(this.$view, \"scroll\", this._scrollHorizontalHandler);\n\n\t};\n\n\tScrollbarCell.prototype._initLinkedViews = function(){\n\t\tvar views = this._getLinkedViews();\n\t\tvar css = this._isVertical() ?\"gantt_layout_outer_scroll gantt_layout_outer_scroll_vertical\" : \"gantt_layout_outer_scroll gantt_layout_outer_scroll_horizontal\";\n\t\tfor(var i = 0; i < views.length; i++){\n\t\t\t//views[i].$config.css = [views[i].$config.css || \"\", css].join(\" \");\n\t\t\tdomHelpers.addClassName(views[i].$view || views[i].getNode(), css);\n\t\t}\n\t};\n\n\tScrollbarCell.prototype._initVertical = function(){\n\t\tthis.$scroll_ver = this.$view;\n\t\tthis.$domEvents.attach(this.$view, \"scroll\", this._scrollVerticalHandler);\n\t};\n\n\tScrollbarCell.prototype._updateLinkedViews = function(){\n\t\tvar root = this._getRootParent();\n\t};\n\n\tScrollbarCell.prototype._initMouseWheel = function(){\n\t\tvar ff = env.isFF;\n\t\tif (ff)\n\t\t\tthis.$domEvents.attach(this._getRootParent().$view, \"wheel\", this._mouseWheelHandler);\n\t\telse\n\t\t\tthis.$domEvents.attach(this._getRootParent().$view, \"mousewheel\", this._mouseWheelHandler);\n\t};\n\n\n\n\n\tScrollbarCell.prototype.scrollHorizontally = function(left){\n\t\tif(this._scrolling) return;\n\t\tthis._scrolling = true;\n\n\t\tthis.$scroll_hor.scrollLeft = left;\n\t\tthis.$config.codeScrollLeft = left;\n\t\tleft = this.$scroll_hor.scrollLeft;\n\n\t\tvar views = this._getLinkedViews();\n\t\tfor(var i = 0; i < views.length; i++){\n\t\t\tif(views[i].scrollTo){\n\t\t\t\tviews[i].scrollTo(left, undefined);\n\t\t\t}\n\t\t}\n\t\tvar oldSize = this.$config.scrollPosition;\n\t\tthis.$config.scrollPosition = left;\n\t\tthis.callEvent(\"onScroll\", [oldSize, left, this.$config.scroll]);\n\t\tthis._scrolling = false;\n\t};\n\tScrollbarCell.prototype.scrollVertically = function(top){\n\t\tif(this._scrolling) return;\n\t\tthis._scrolling = true;\n\n\t\tthis.$scroll_ver.scrollTop = top;\n\t\ttop = this.$scroll_ver.scrollTop;\n\n\t\tvar views = this._getLinkedViews();\n\n\t\tfor(var i = 0; i < views.length; i++){\n\t\t\tif(views[i].scrollTo){\n\t\t\t\tviews[i].scrollTo(undefined, top);\n\t\t\t}\n\t\t}\n\t\tvar oldSize = this.$config.scrollPosition;\n\t\tthis.$config.scrollPosition = top;\n\t\tthis.callEvent(\"onScroll\", [oldSize, top, this.$config.scroll]);\n\t\tthis._scrolling = false;\n\t};\n\n\tScrollbarCell.prototype._isVertical = function(){\n\t\treturn this.$config.scroll == \"y\";\n\t};\n\tScrollbarCell.prototype._isHorizontal = function(){\n\t\treturn this.$config.scroll == \"x\";\n\t};\n\tScrollbarCell.prototype._scrollHorizontalHandler = function (e) {\n\t\tif(this._isVertical() || this._scrolling){\n\t\t\treturn;\n\t\t}\n\n\t\t//in safari we can catch previous onscroll after setting new value from mouse-wheel event\n\t\t//set delay to prevent value drifiting\n\t\tif ((new Date()) - ( this._wheel_time || 0 ) < 100) return true;\n\t\tif (this.$gantt._touch_scroll_active) return;\n\t\tvar left = this.$scroll_hor.scrollLeft;\n\n\t\tthis.scrollHorizontally(left);\n\n\t\tthis._oldLeft = this.$scroll_hor.scrollLeft;\n\t};\n\tScrollbarCell.prototype._outerScrollHorizontalHandler = function(e){\n\t\tif(this._isVertical()){\n\t\t\treturn;\n\t\t}\n\t};\n\n\tScrollbarCell.prototype.show = function(){\n\t\tthis.$parent.show();\n\t};\n\tScrollbarCell.prototype.hide = function(){\n\t\tthis.$parent.hide();\n\t};\n\n\tScrollbarCell.prototype._getScrollSize = function(){\n\t\tvar scrollSize = 0;\n\t\tvar outerSize = 0;\n\t\tvar isHorizontal = this._isHorizontal();\n\n\t\tvar linked = this._getLinkedViews();\n\t\tvar view;\n\t\tvar scrollProperty = isHorizontal ? \"scrollWidth\" : \"scrollHeight\",\n\t\t\tinnerSizeProperty = isHorizontal ? \"contentX\" : \"contentY\";\n\t\tvar outerProperty = isHorizontal ? \"x\" : \"y\";\n\t\tvar offset = this._getScrollOffset();\n\n\t\tfor(var i = 0; i < linked.length; i++){\n\t\t\tview = linked[i];\n\t\t\tif(!(view && view.$content && view.$content.getSize)) continue;\n\n\t\t\tvar sizes = view.$content.getSize();\n\t\t\tvar cellScrollSize;\n\t\t\tif(sizes.hasOwnProperty(scrollProperty)){\n\t\t\t\tcellScrollSize = sizes[scrollProperty];\n\t\t\t}else{\n\t\t\t\tcellScrollSize = sizes[innerSizeProperty];\n\t\t\t}\n\n\t\t\tif(offset){\n\t\t\t\t// precalculated vertical/horizontal offsets of scrollbar to emulate 4.x look\n\t\t\t\tif(sizes[innerSizeProperty] > sizes[outerProperty] && sizes[innerSizeProperty] > scrollSize && (cellScrollSize > (sizes[outerProperty] - offset + 2))){\n\t\t\t\t\tscrollSize = cellScrollSize + (isHorizontal ? 0 : 2);\n\t\t\t\t\touterSize = sizes[outerProperty];\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tvar nonScrollableSize = Math.max(sizes[innerSizeProperty] - cellScrollSize, 0);\n\t\t\t\tvar scrollableViewPortSize = Math.max(sizes[outerProperty] - nonScrollableSize, 0);\n\t\t\t\tcellScrollSize = cellScrollSize + nonScrollableSize;\n\n\t\t\t\tif(cellScrollSize > scrollableViewPortSize && (cellScrollSize > scrollSize) ){\n\t\t\t\t\t//|| (cellScrollSize === scrollSize && sizes[outerProperty] < outerSize) // same scroll width but smaller scrollable view port\n\n\t\t\t\t\tscrollSize = cellScrollSize;\n\t\t\t\t\touterSize = sizes[outerProperty];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\touterScroll: outerSize,\n\t\t\tinnerScroll: scrollSize\n\t\t};\n\t};\n\n\tScrollbarCell.prototype.scroll = function(position){\n\t\tif(this._isHorizontal()){\n\t\t\tthis.scrollHorizontally(position);\n\t\t}else{\n\t\t\tthis.scrollVertically(position);\n\t\t}\n\t};\n\n\tScrollbarCell.prototype.getScrollState = function(){\n\t\treturn {\n\t\t\tvisible: this.isVisible(),\n\t\t\tdirection: this.$config.scroll,\n\t\t\tsize: this.$config.outerSize,\n\t\t\tscrollSize: this.$config.scrollSize || 0,\n\t\t\tposition: this.$config.scrollPosition || 0\n\t\t};\n\t};\n\n\tScrollbarCell.prototype.setSize = function(width, height){\n\t\t_super.prototype.setSize.apply(this, arguments);\n\n\t\tvar scrollSizes = this._getScrollSize();\n\n\t\tvar ownSize = (this._isVertical() ? height : width) - this._getScrollOffset() + (this._isHorizontal() ? 1 : 0);\n\n\t\tif(scrollSizes.innerScroll && ownSize > scrollSizes.outerScroll){\n\t\t\tscrollSizes.innerScroll += (ownSize - scrollSizes.outerScroll);\n\t\t}\n\t\tthis.$config.scrollSize = scrollSizes.innerScroll;\n\n\t\tthis.$config.width = width;\n\t\tthis.$config.height = height;\n\t\tthis._setScrollSize(scrollSizes.innerScroll);\n\t};\n\n\tScrollbarCell.prototype.isVisible = function(){\n\t\treturn !!(this.$parent && this.$parent.$view.parentNode);\n\t};\n\n\tScrollbarCell.prototype.shouldShow = function(){\n\t\tvar scrollSizes = this._getScrollSize();\n\t\tif(!scrollSizes.innerScroll && (this.$parent && this.$parent.$view.parentNode)){\n\t\t\treturn false;\n\t\t}else if(scrollSizes.innerScroll && !(this.$parent && this.$parent.$view.parentNode)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tScrollbarCell.prototype.shouldHide = function(){\n\t\tvar scrollSizes = this._getScrollSize();\n\t\tif(!scrollSizes.innerScroll && (this.$parent && this.$parent.$view.parentNode)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t};\n\n\n\tScrollbarCell.prototype.toggleVisibility = function(){\n\t\tif(this.shouldHide()){\n\t\t\tthis.hide();\n\t\t}else if(this.shouldShow()){\n\t\t\tthis.show();\n\t\t}\n\t};\n\t\n\tScrollbarCell.prototype._getScaleOffset = function(view){\n\t\tvar offset = 0;\n\t\tif(view && (view.$config.view == \"timeline\" || view.$config.view == \"grid\")){\n\t\t\toffset = view.$content.$getConfig().scale_height;\n\t\t}\n\t\treturn offset;\n\t};\n\n\tScrollbarCell.prototype._getScrollOffset = function(){\n\t\tvar offset = 0;\n\t\tif(this._isVertical()){\n\t\t\tvar parentLayout = this.$parent.$parent;\n\t\t\toffset = Math.max(\n\t\t\t\tthis._getScaleOffset(parentLayout.getPrevSibling(this.$parent.$id)),\n\t\t\t\tthis._getScaleOffset(parentLayout.getNextSibling(this.$parent.$id))\n\t\t\t\t);\n\t\t}else{\n\t\t\tvar linked = this._getLinkedViews();\n\n\t\t\tfor (var i = 0; i < linked.length; i++) {\n\t\t\t\tvar view = linked[i],\n\t\t\t\t\tvparent = view.$parent;\n\t\t\t\tvar cells = vparent.$cells;\n\n\t\t\t\tvar last = cells[cells.length - 1];\n\n\t\t\t\tif (last && last.$config.view == \"scrollbar\" && last.$config.hidden === false) {\n\t\t\t\t\toffset = last.$config.width;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn offset || 0;\n\t};\n\n\tScrollbarCell.prototype._setScrollSize = function(size){\n\t\tvar property = this._isHorizontal() ? \"width\" : \"height\";\n\t\tvar scrollbar = this._isHorizontal() ? this.$scroll_hor : this.$scroll_ver;\n\n\t\tvar offset = this._getScrollOffset();\n\n\t\tvar node = scrollbar.firstChild;\n\n\t\tif(offset){\n\t\t\tif(this._isVertical()){\n\n\t\t\t\tthis.$config.outerSize = (this.$config.height - offset + 3);\n\t\t\t\tscrollbar.style.height = this.$config.outerSize + \"px\";\n\t\t\t\tscrollbar.style.top = (offset-1) + \"px\";\n\t\t\t\tdomHelpers.addClassName(scrollbar, this.$parent._borders.top);\n\t\t\t\tdomHelpers.addClassName(scrollbar.parentNode, \"gantt_task_vscroll\");\n\t\t\t}else{\n\t\t\t\tthis.$config.outerSize = (this.$config.width - offset + 1);\n\t\t\t\tscrollbar.style.width = this.$config.outerSize + \"px\";\n\t\t\t\t//domHelpers.addClassName(scrollbar, this.$parent._borders.right);\n\t\t\t}\n\t\t}else{\n\t\t\tscrollbar.style.top = \"auto\";\n\t\t\tdomHelpers.removeClassName(scrollbar, this.$parent._borders.top);\n\t\t\tdomHelpers.removeClassName(scrollbar.parentNode, \"gantt_task_vscroll\");\n\t\t}\n\n\t\tnode.style[property] = size + \"px\";\n\t};\n\n\tScrollbarCell.prototype._scrollVerticalHandler = function (e) {\n\t\tif(this._scrollHorizontalHandler() || this._scrolling){\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.$gantt._touch_scroll_active) return;\n\t\tvar top = this.$scroll_ver.scrollTop;\n\t\tvar prev = this._oldTop;\n\t\tif(top == prev) return;\n\n\t\tthis.scrollVertically(top);\n\n\t\tthis._oldTop = this.$scroll_ver.scrollTop;\n\n\t};\n\tScrollbarCell.prototype._outerScrollVerticalHandler = function(e){\n\t\tif(this._scrollHorizontalHandler()){\n\t\t\treturn;\n\t\t}\n\t};\n\n\tScrollbarCell.prototype._checkWheelTarget = function(targetNode){\n\t\tvar connectedViews = this._getLinkedViews().concat(this);\n\n\t\tfor(var i = 0; i < connectedViews.length; i++){\n\t\t\tvar node = connectedViews[i].$view;\n\t\t\tif(domHelpers.isChildOf(targetNode, node)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tScrollbarCell.prototype._mouseWheelHandler = function(e){\n\t\tvar target = e.target || e.srcElement;\n\n\t\tif(!this._checkWheelTarget(target))\n\t\t\treturn;\n\n\t\tthis._wheel_time = new Date();\n\n\t\tvar res = {};\n\t\tvar ff = env.isFF;\n\t\tvar wx = ff ? (e.deltaX*-20) : e.wheelDeltaX*2;\n\t\tvar wy = ff ? (e.deltaY*-40) : e.wheelDelta;\n\n\t\tif(e.shiftKey && !(e.deltaX || e.wheelDeltaX)){\n\t\t\t// shift+mousewheel for horizontal scroll\n\t\t\twx = wy*2;\n\t\t\twy = 0;\n\t\t}\n\n\t\tif (wx && Math.abs(wx) > Math.abs(wy)){\n\t\t\tif(this._isVertical()){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(res.x) return true;//no horisontal scroll, must not block scrolling\n\t\t\tif(!this.$scroll_hor || !this.$scroll_hor.offsetWidth) return true;\n\n\t\t\tvar dir = wx/-40;\n\t\t\tvar oldLeft = this._oldLeft;\n\t\t\tvar left = oldLeft+dir*30;\n\t\t\tthis.scrollHorizontally(left);\n\t\t\tthis.$scroll_hor.scrollLeft = left;\n\t\t\t// not block scroll if position hasn't changed\n\t\t\tif(oldLeft == this.$scroll_hor.scrollLeft){\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tthis._oldLeft = this.$scroll_hor.scrollLeft;\n\t\t} else {\n\t\t\tif(this._isHorizontal()){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(res.y) return true;//no vertical scroll, must not block scrolling\n\t\t\tif(!this.$scroll_ver || !this.$scroll_ver.offsetHeight) return true;\n\n\t\t\tvar dir = wy/-40;\n\t\t\tif (typeof wy == \"undefined\")\n\t\t\t\tdir = e.detail;\n\n\t\t\tvar oldTop = this._oldTop;\n\t\t\tvar top = this.$scroll_ver.scrollTop+dir*30;\n\n\t\t\t//if(!this.$gantt.config.prevent_default_scroll &&\n\t\t\t//\t(this.$gantt._cached_scroll_pos && ((this.$gantt._cached_scroll_pos.y == top) || (this.$gantt._cached_scroll_pos.y <= 0 && top <= 0)))) return true;\n\n\n\t\t\tthis.scrollVertically(top);\n\t\t\tthis.$scroll_ver.scrollTop = top;\n\n\t\t\t// not block scroll if position hasn't changed\n\t\t\tif(oldTop == this.$scroll_ver.scrollTop){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tthis._oldTop = this.$scroll_ver.scrollTop;\n\t\t}\n\n\t\tif (e.preventDefault)\n\t\t\te.preventDefault();\n\t\te.cancelBubble=true;\n\t\treturn false;\n\t};\n\n\treturn ScrollbarCell;\n})(Cell);\n\nmodule.exports = ScrollbarCell;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/layout/scrollbar_cell.js\n// module id = 42\n// module chunks = 0","var createStaticBgHelper = function(){\n\treturn {\n\t\trender: function(){}\n\t};\n};\n\nmodule.exports = {\n\tcreate: function(){\n\t\treturn createStaticBgHelper();\n\t}\n};\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/timeline/tasks_canvas_render.gpl.js\n// module id = 43\n// module chunks = 0","function createResizer(gantt, grid){\n\treturn {\n\t\tinit: function(){},\n\t\tdoOnRender: function(){}\n\t};\n}\n\nmodule.exports = createResizer;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/grid/grid_resize.gpl.js\n// module id = 44\n// module chunks = 0","function createTaskRenderer(gantt){\n\n\tfunction _render_task_element(task, view) {\n\t\tvar config = view.$getConfig();\n\t\tvar painters = config.type_renderers;\n\t\tvar renderer = painters[gantt.getTaskType(task.type)],\n\t\t\tdefaultRenderer = _task_default_render;\n\n\t\tif (!renderer) {\n\t\t\treturn defaultRenderer.call(gantt, task, view);\n\t\t}else{\n\t\t\treturn renderer.call(gantt, task, function(task){ return defaultRenderer.call(gantt, task, view);}, view);\n\t\t}\n\t}\n\n\tfunction _task_default_render(task, view) {\n\t\tif (gantt._isAllowedUnscheduledTask(task))\n\t\t\treturn;\n\n\n\t\tvar pos = view.getItemPosition(task);\n\n\t\tvar cfg = view.$getConfig(),\n\t\t\ttemplates = view.$getTemplates();\n\t\tvar height = view.getItemHeight();\n\n\t\tvar taskType = gantt.getTaskType(task.type);\n\n\t\tvar padd = Math.floor((gantt.config.row_height - height) / 2);\n\t\tif (taskType == cfg.types.milestone && cfg.link_line_width > 1) {\n\t\t\t//little adjust milestone position, so horisontal corners would match link arrow when thickness of link line is more than 1px\n\t\t\tpadd += 1;\n\t\t}\n\n\t\tif (taskType == cfg.types.milestone){\n\t\t\tpos.left -= Math.round(height / 2);\n\t\t\tpos.width = height;\n\t\t}\n\n\t\tvar div = document.createElement(\"div\");\n\n\t\tvar width = Math.round(pos.width);\n\n\t\tif(view.$config.item_attribute){\n\t\t\tdiv.setAttribute(view.$config.item_attribute, task.id);\n\t\t}\n\n\t\tif (cfg.show_progress && taskType != cfg.types.milestone) {\n\t\t\t_render_task_progress(task, div, width, cfg, templates);\n\t\t}\n\n\t\t//use separate div to display content above progress bar\n\t\tvar content = _render_task_content(task, width, templates);\n\t\tif (task.textColor) {\n\t\t\tcontent.style.color = task.textColor;\n\t\t}\n\t\tdiv.appendChild(content);\n\n\t\tvar css = _combine_item_class(\"gantt_task_line\",\n\t\t\ttemplates.task_class(task.start_date, task.end_date, task),\n\t\t\ttask.id,\n\t\t\tview);\n\t\tif (task.color || task.progressColor || task.textColor) {\n\t\t\tcss += \" gantt_task_inline_color\";\n\t\t}\n\t\tdiv.className = css;\n\n\t\tvar styles = [\n\t\t\t\"left:\" + pos.left + \"px\",\n\t\t\t\"top:\" + (padd + pos.top) + 'px',\n\t\t\t\"height:\" + height + 'px',\n\t\t\t\"line-height:\" + (Math.max(height < 30 ? height - 2 : height, 0)) + 'px',\n\t\t\t\"width:\" + width + 'px'\n\t\t];\n\t\tif (task.color) {\n\t\t\tstyles.push(\"background-color:\" + task.color);\n\t\t}\n\t\tif (task.textColor) {\n\t\t\tstyles.push(\"color:\" + task.textColor);\n\t\t}\n\n\t\tdiv.style.cssText = styles.join(\";\");\n\t\tvar side = _render_leftside_content(task, cfg, templates);\n\t\tif (side) div.appendChild(side);\n\n\t\tside = _render_rightside_content(task, cfg, templates);\n\t\tif (side) div.appendChild(side);\n\n\t\tgantt._waiAria.setTaskBarAttr(task, div);\n\n\t\tvar state = gantt.getState();\n\n\t\tif (!gantt.isReadonly(task)) {\n\t\t\tif (cfg.drag_resize && !gantt.isSummaryTask(task) && taskType != cfg.types.milestone) {\n\t\t\t\t_render_pair(div, \"gantt_task_drag\", task, function (css) {\n\t\t\t\t\tvar el = document.createElement(\"div\");\n\t\t\t\t\tel.className = css;\n\t\t\t\t\treturn el;\n\t\t\t\t}, cfg);\n\t\t\t}\n\t\t\tif (cfg.drag_links && cfg.show_links) {\n\t\t\t\t_render_pair(div, \"gantt_link_control\", task, function (css) {\n\t\t\t\t\tvar outer = document.createElement(\"div\");\n\t\t\t\t\touter.className = css;\n\t\t\t\t\touter.style.cssText = [\n\t\t\t\t\t\t\"height:\" + height + 'px',\n\t\t\t\t\t\t\"line-height:\" + height + 'px'\n\t\t\t\t\t].join(\";\");\n\t\t\t\t\tvar inner = document.createElement(\"div\");\n\t\t\t\t\tinner.className = \"gantt_link_point\";\n\n\t\t\t\t\tvar showLinkPoints = false;\n\t\t\t\t\tif(state.link_source_id && cfg.touch){\n\t\t\t\t\t\tshowLinkPoints = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tinner.style.display = showLinkPoints ? \"block\" : \"\";\n\t\t\t\t\touter.appendChild(inner);\n\t\t\t\t\treturn outer;\n\t\t\t\t}, cfg);\n\t\t\t}\n\t\t}\n\t\treturn div;\n\t}\n\n\tfunction _render_side_content(task, template, cssClass) {\n\t\tif (!template) return null;\n\n\t\tvar text = template(task.start_date, task.end_date, task);\n\t\tif (!text) return null;\n\t\tvar content = document.createElement(\"div\");\n\t\tcontent.className = \"gantt_side_content \" + cssClass;\n\t\tcontent.innerHTML = text;\n\t\treturn content;\n\t}\n\n\tfunction _render_leftside_content(task, cfg, templates) {\n\t\tvar css = \"gantt_left \" + _get_link_crossing_css(!cfg.rtl ? true : false, task, cfg);\n\t\treturn _render_side_content(task, templates.leftside_text, css);\n\t}\n\n\tfunction _render_rightside_content(task, cfg, templates) {\n\t\tvar css = \"gantt_right \" + _get_link_crossing_css(!cfg.rtl ? false : true, task, cfg);\n\t\treturn _render_side_content(task, templates.rightside_text, css);\n\t}\n\n\tfunction _get_link_crossing_css(left, task) {\n\t\tvar cond = _get_conditions(left);\n\n\t\tfor (var i in cond) {\n\t\t\tvar links = task[i];\n\t\t\tfor (var ln = 0; ln < links.length; ln++) {\n\t\t\t\tvar link = gantt.getLink(links[ln]);\n\n\t\t\t\tfor (var tp = 0; tp < cond[i].length; tp++) {\n\t\t\t\t\tif (link.type == cond[i][tp]) {\n\t\t\t\t\t\treturn \"gantt_link_crossing\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}\n\n\n\tfunction _render_task_content(task, width, templates) {\n\t\tvar content = document.createElement(\"div\");\n\t\tif (gantt.getTaskType(task.type) != gantt.config.types.milestone)\n\t\t\tcontent.innerHTML = templates.task_text(task.start_date, task.end_date, task);\n\t\tcontent.className = \"gantt_task_content\";\n\t\t//content.style.width = width + 'px';\n\t\treturn content;\n\t}\n\n\tfunction _render_task_progress(task, element, maxWidth, cfg, templates) {\n\t\tvar done = task.progress * 1 || 0;\n\n\t\tmaxWidth = Math.max(maxWidth - 2, 0);//2px for borders\n\t\tvar pr = document.createElement(\"div\");\n\t\tvar width = Math.round(maxWidth * done);\n\n\t\twidth = Math.min(maxWidth, width);\n\t\tif (task.progressColor) {\n\t\t\tpr.style.backgroundColor = task.progressColor;\n\t\t\tpr.style.opacity = 1;\n\t\t}\n\t\tpr.style.width = width + 'px';\n\t\tpr.className = \"gantt_task_progress\";\n\t\tpr.innerHTML = templates.progress_text(task.start_date, task.end_date, task);\n\n\t\tif(cfg.rtl){\n\t\t\tpr.style.position = \"absolute\";\n\t\t\tpr.style.right = \"0px\";\n\t\t}\n\n\t\tvar wrapper = document.createElement(\"div\");\n\t\twrapper.className = \"gantt_task_progress_wrapper\";\n\t\twrapper.appendChild(pr);\n\t\telement.appendChild(wrapper);\n\n\t\tif (gantt.config.drag_progress && !gantt.isReadonly(task)) {\n\t\t\tvar drag = document.createElement(\"div\");\n\n\t\t\tvar markerPos = width;\n\t\t\tif(cfg.rtl){\n\t\t\t\tmarkerPos = maxWidth - width;\n\t\t\t}\n\n\t\t\tdrag.style.left = markerPos + 'px';\n\t\t\tdrag.className = \"gantt_task_progress_drag\";\n\t\t\tpr.appendChild(drag);\n\t\t\telement.appendChild(drag);\n\t\t}\n\t}\n\n\tfunction _get_conditions(leftside) {\n\t\tif (leftside) {\n\t\t\treturn {\n\t\t\t\t$source: [\n\t\t\t\t\tgantt.config.links.start_to_start\n\t\t\t\t],\n\t\t\t\t$target: [\n\t\t\t\t\tgantt.config.links.start_to_start,\n\t\t\t\t\tgantt.config.links.finish_to_start\n\t\t\t\t]\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\t$source: [\n\t\t\t\t\tgantt.config.links.finish_to_start,\n\t\t\t\t\tgantt.config.links.finish_to_finish\n\t\t\t\t],\n\t\t\t\t$target: [\n\t\t\t\t\tgantt.config.links.finish_to_finish\n\t\t\t\t]\n\t\t\t};\n\t\t}\n\t}\n\n\tfunction _combine_item_class(basic, template, itemId, view) {\n\t\tvar cfg = view.$getConfig();\n\t\tvar css = [basic];\n\t\tif (template)\n\t\t\tcss.push(template);\n\n\t\tvar state = gantt.getState();\n\n\t\tvar task = gantt.getTask(itemId);\n\n\t\tif (gantt.getTaskType(task.type) == cfg.types.milestone) {\n\t\t\tcss.push(\"gantt_milestone\");\n\t\t}\n\n\t\tif (gantt.getTaskType(task.type) == cfg.types.project) {\n\t\t\tcss.push(\"gantt_project\");\n\t\t}\n\n\t\tif (gantt.isSummaryTask(task))\n\t\t\tcss.push(\"gantt_dependent_task\");\n\n\t\tif (cfg.select_task && itemId == state.selected_task)\n\t\t\tcss.push(\"gantt_selected\");\n\n\t\tif (itemId == state.drag_id) {\n\t\t\tcss.push(\"gantt_drag_\" + state.drag_mode);\n\t\t\tif (state.touch_drag) {\n\t\t\t\tcss.push(\"gantt_touch_\" + state.drag_mode);\n\t\t\t}\n\t\t}\n\n\t\tif (state.link_source_id == itemId)\n\t\t\tcss.push(\"gantt_link_source\");\n\n\t\tif (state.link_target_id == itemId)\n\t\t\tcss.push(\"gantt_link_target\");\n\n\n\t\tif (cfg.highlight_critical_path && gantt.isCriticalTask) {\n\t\t\tif (gantt.isCriticalTask(task))\n\t\t\t\tcss.push(\"gantt_critical_task\");\n\t\t}\n\n\t\tif (state.link_landing_area &&\n\t\t\t(state.link_target_id && state.link_source_id) &&\n\t\t\t(state.link_target_id != state.link_source_id)) {\n\n\t\t\tvar from_id = state.link_source_id;\n\t\t\tvar from_start = state.link_from_start;\n\t\t\tvar to_start = state.link_to_start;\n\n\t\t\tvar allowDrag = gantt.isLinkAllowed(from_id, itemId, from_start, to_start);\n\n\t\t\tvar dragClass = \"\";\n\t\t\tif (allowDrag) {\n\t\t\t\tif (to_start)\n\t\t\t\t\tdragClass = \"link_start_allow\";\n\t\t\t\telse\n\t\t\t\t\tdragClass = \"link_finish_allow\";\n\t\t\t} else {\n\t\t\t\tif (to_start)\n\t\t\t\t\tdragClass = \"link_start_deny\";\n\t\t\t\telse\n\t\t\t\t\tdragClass = \"link_finish_deny\";\n\t\t\t}\n\t\t\tcss.push(dragClass);\n\t\t}\n\t\treturn css.join(\" \");\n\t}\n\n\tfunction _render_pair(parent, css, task, content, config) {\n\t\tvar state = gantt.getState();\n\t\tvar className, element;\n\t\tif (+task.start_date >= +state.min_date) {\n\t\t\tclassName = [css, config.rtl ? \"task_right\" : \"task_left\", \"task_start_date\"];\n\t\t\telement = content(className.join(\" \"));\n\t\t\telement.setAttribute(\"data-bind-property\", \"start_date\");\n\t\t\tparent.appendChild(element);\n\t\t}\n\n\t\tif (+task.end_date <= +state.max_date){\n\t\t\tclassName = [css, config.rtl ? \"task_left\" : \"task_right\", \"task_end_date\"];\n\t\t\telement = content(className.join(\" \"));\n\t\t\telement.setAttribute(\"data-bind-property\", \"end_date\");\n\t\t\tparent.appendChild(element);\n\t\t}\n\n\t}\n\n\treturn _render_task_element;\n}\n\nmodule.exports = createTaskRenderer;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/render/task_bar_render.js\n// module id = 45\n// module chunks = 0","function createTaskBgRender(gantt){\n\t//this.getTaskTop\n\tfunction _render_bg_line(item, view) {\n\t\tvar config = view.$getConfig(),\n\t\t\ttemplates = view.$getTemplates();\n\t\tvar cfg = view.getScale();\n\t\tvar count = cfg.count;\n\t\tvar row = document.createElement(\"div\");\n\t\tif (config.show_task_cells) {\n\t\t\tfor (var j = 0; j < count; j++) {\n\t\t\t\tvar width = cfg.width[j],\n\t\t\t\t\tcssclass = \"\";\n\n\t\t\t\tif (width > 0) {//do not render skipped columns\n\t\t\t\t\tvar cell = document.createElement(\"div\");\n\t\t\t\t\tcell.style.width = (width) + \"px\";\n\n\t\t\t\t\tcssclass = \"gantt_task_cell\" + (j == count - 1 ? \" gantt_last_cell\" : \"\");\n\t\t\t\t\tcssTemplate = templates.task_cell_class(item, cfg.trace_x[j]);\n\t\t\t\t\tif (cssTemplate)\n\t\t\t\t\t\tcssclass += \" \" + cssTemplate;\n\t\t\t\t\tcell.className = cssclass;\n\n\t\t\t\t\trow.appendChild(cell);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tvar odd = gantt.getGlobalTaskIndex(item.id) % 2 !== 0;\n\t\tvar cssTemplate = templates.task_row_class(item.start_date, item.end_date, item);\n\t\tvar css = \"gantt_task_row\" + (odd ? \" odd\" : \"\") + (cssTemplate ? ' ' + cssTemplate : '');\n\n\t\tvar store = view.$config.rowStore;\n\t\tif(store.getSelectedId() == item.id) {\n\t\t\tcss += \" gantt_selected\";\n\t\t}\n\n\t\t//var row = \"\" + cells.join(\"\") + \"
\";\n\n\t\trow.className = css;\n\n\t\tif (config.smart_rendering) {\n\t\t\trow.style.position = \"absolute\";\n\t\t\trow.style.top = view.getItemTop(item.id) + \"px\";\n\t\t\trow.style.width = \"100%\";\n\t\t}\n\t\trow.style.height = (config.row_height) + \"px\";\n\n\t\tif(view.$config.item_attribute){\n\t\t\trow.setAttribute(view.$config.item_attribute, item.id);\n\t\t}\n\n\t\treturn row;\n\t}\n\n\treturn _render_bg_line;\n}\n\nmodule.exports = createTaskBgRender;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/render/task_bg_render.js\n// module id = 46\n// module chunks = 0","\nfunction createLinkRender(gantt){\n\nfunction _render_link_element(link, view) {\n\tvar config = view.$getConfig();\n\tvar dots = path_builder.get_points(link, view);\n\tvar lines = drawer.get_lines(dots, view);\n\n\tvar div = document.createElement(\"div\");\n\n\tvar css = \"gantt_task_link\";\n\n\tif (link.color) {\n\t\tcss += \" gantt_link_inline_color\";\n\t}\n\tvar cssTemplate = gantt.templates.link_class ? gantt.templates.link_class(link) : \"\";\n\tif (cssTemplate) {\n\t\tcss += \" \" + cssTemplate;\n\t}\n\n\tif (config.highlight_critical_path && gantt.isCriticalLink) {\n\t\tif (gantt.isCriticalLink(link))\n\t\t\tcss += \" gantt_critical_link\";\n\t}\n\n\tdiv.className = css;\n\n\tif(view.$config.link_attribute){\n\t\tdiv.setAttribute(view.$config.link_attribute, link.id);\n\t}\n\n\tfor (var i = 0; i < lines.length; i++) {\n\t\tif (i == lines.length - 1) {\n\t\t\tlines[i].size -= config.link_arrow_size;\n\t\t}\n\t\tvar el = drawer.render_line(lines[i], lines[i + 1], view);\n\t\tif (link.color) {\n\t\t\tel.firstChild.style.backgroundColor = link.color;\n\t\t}\n\t\tdiv.appendChild(el);\n\t}\n\n\tvar direction = lines[lines.length - 1].direction;\n\tvar endpoint = _render_link_arrow(dots[dots.length - 1], direction, view);\n\tif (link.color) {\n\t\tendpoint.style.borderColor = link.color;\n\t}\n\tdiv.appendChild(endpoint);\n\n\tgantt._waiAria.linkAttr(link, div);\n\n\treturn div;\n}\n\nfunction _render_link_arrow(point, direction, view) {\n\tvar config = view.$getConfig();\n\tvar div = document.createElement(\"div\");\n\tvar top = point.y;\n\tvar left = point.x;\n\n\tvar size = config.link_arrow_size;\n\tvar line_width = config.row_height;\n\tvar className = \"gantt_link_arrow gantt_link_arrow_\" + direction;\n\tswitch (direction) {\n\t\tcase drawer.dirs.right:\n\t\t\ttop -= (size - line_width) / 2;\n\t\t\tleft -= size;\n\t\t\tbreak;\n\t\tcase drawer.dirs.left:\n\t\t\ttop -= (size - line_width) / 2;\n\t\t\tbreak;\n\t\tcase drawer.dirs.up:\n\t\t\tleft -= size;\n\t\t\tbreak;\n\t\tcase drawer.dirs.down:\n\t\t\ttop += size * 2;\n\t\t\tleft -= size;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\tdiv.style.cssText = [\n\t\t\"top:\" + top + \"px\",\n\t\t\"left:\" + left + 'px'].join(';');\n\tdiv.className = className;\n\n\treturn div;\n}\n\n\nvar drawer = {\n\tcurrent_pos: null,\n\tdirs: {\"left\": 'left', \"right\": 'right', \"up\": 'up', \"down\": 'down'},\n\tpath: [],\n\tclear: function () {\n\t\tthis.current_pos = null;\n\t\tthis.path = [];\n\t},\n\tpoint: function (pos) {\n\t\tthis.current_pos = gantt.copy(pos);\n\t},\n\tget_lines: function (dots) {\n\t\tthis.clear();\n\t\tthis.point(dots[0]);\n\t\tfor (var i = 1; i < dots.length; i++) {\n\t\t\tthis.line_to(dots[i]);\n\t\t}\n\t\treturn this.get_path();\n\t},\n\tline_to: function (pos) {\n\t\tvar next = gantt.copy(pos);\n\t\tvar prev = this.current_pos;\n\n\t\tvar line = this._get_line(prev, next);\n\t\tthis.path.push(line);\n\t\tthis.current_pos = next;\n\t},\n\tget_path: function () {\n\t\treturn this.path;\n\t},\n\tget_wrapper_sizes: function (v, view) {\n\t\tvar config = view.$getConfig();\n\t\tvar res,\n\t\t\twrapper_size = config.link_wrapper_width,\n\t\t\tline_size = config.link_line_width,\n\t\t\ty = v.y + (config.row_height - wrapper_size) / 2;\n\t\tswitch (v.direction) {\n\t\t\tcase this.dirs.left:\n\t\t\t\tres = {\n\t\t\t\t\ttop: y,\n\t\t\t\t\theight: wrapper_size,\n\t\t\t\t\tlineHeight: wrapper_size,\n\t\t\t\t\tleft: v.x - v.size - wrapper_size / 2,\n\t\t\t\t\twidth: v.size + wrapper_size\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase this.dirs.right:\n\t\t\t\tres = {\n\t\t\t\t\ttop: y,\n\t\t\t\t\tlineHeight: wrapper_size,\n\t\t\t\t\theight: wrapper_size,\n\t\t\t\t\tleft: v.x - wrapper_size / 2,\n\t\t\t\t\twidth: v.size + wrapper_size\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase this.dirs.up:\n\t\t\t\tres = {\n\t\t\t\t\ttop: y - v.size,\n\t\t\t\t\tlineHeight: v.size + wrapper_size,\n\t\t\t\t\theight: v.size + wrapper_size,\n\t\t\t\t\tleft: v.x - wrapper_size / 2,\n\t\t\t\t\twidth: wrapper_size\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase this.dirs.down:\n\t\t\t\tres = {\n\t\t\t\t\ttop: y /*- wrapper_size/2*/,\n\t\t\t\t\tlineHeight: v.size + wrapper_size,\n\t\t\t\t\theight: v.size + wrapper_size,\n\t\t\t\t\tleft: v.x - wrapper_size / 2,\n\t\t\t\t\twidth: wrapper_size\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn res;\n\t},\n\tget_line_sizes: function (v, view) {\n\t\tvar config = view.$getConfig();\n\t\tvar res,\n\t\t\tline_size = config.link_line_width,\n\t\t\twrapper_size = config.link_wrapper_width,\n\t\t\tsize = v.size + line_size;\n\t\tswitch (v.direction) {\n\t\t\tcase this.dirs.left:\n\t\t\tcase this.dirs.right:\n\t\t\t\tres = {\n\t\t\t\t\theight: line_size,\n\t\t\t\t\twidth: size,\n\t\t\t\t\tmarginTop: (wrapper_size - line_size) / 2,\n\t\t\t\t\tmarginLeft: (wrapper_size - line_size) / 2\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase this.dirs.up:\n\t\t\tcase this.dirs.down:\n\t\t\t\tres = {\n\t\t\t\t\theight: size,\n\t\t\t\t\twidth: line_size,\n\t\t\t\t\tmarginTop: (wrapper_size - line_size) / 2,\n\t\t\t\t\tmarginLeft: (wrapper_size - line_size) / 2\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\treturn res;\n\t},\n\trender_line: function (v, end, view) {\n\t\tvar pos = this.get_wrapper_sizes(v, view);\n\t\tvar wrapper = document.createElement(\"div\");\n\t\twrapper.style.cssText = [\n\t\t\t\"top:\" + pos.top + \"px\",\n\t\t\t\"left:\" + pos.left + \"px\",\n\t\t\t\"height:\" + pos.height + \"px\",\n\t\t\t\"width:\" + pos.width + \"px\"\n\t\t].join(';');\n\t\twrapper.className = \"gantt_line_wrapper\";\n\n\t\tvar innerPos = this.get_line_sizes(v, view);\n\t\tvar inner = document.createElement(\"div\");\n\t\tinner.style.cssText = [\n\t\t\t\"height:\" + innerPos.height + \"px\",\n\t\t\t\"width:\" + innerPos.width + \"px\",\n\t\t\t\"margin-top:\" + innerPos.marginTop + \"px\",\n\t\t\t\"margin-left:\" + innerPos.marginLeft + \"px\"\n\t\t].join(\";\");\n\n\t\tinner.className = \"gantt_link_line_\" + v.direction;\n\t\twrapper.appendChild(inner);\n\n\t\treturn wrapper;\n\t},\n\t_get_line: function (from, to) {\n\t\tvar direction = this.get_direction(from, to);\n\t\tvar vect = {\n\t\t\tx: from.x,\n\t\t\ty: from.y,\n\t\t\tdirection: this.get_direction(from, to)\n\t\t};\n\t\tif (direction == this.dirs.left || direction == this.dirs.right) {\n\t\t\tvect.size = Math.abs(from.x - to.x);\n\t\t} else {\n\t\t\tvect.size = Math.abs(from.y - to.y);\n\t\t}\n\t\treturn vect;\n\t},\n\tget_direction: function (from, to) {\n\t\tvar direction = 0;\n\t\tif (to.x < from.x) {\n\t\t\tdirection = this.dirs.left;\n\t\t} else if (to.x > from.x) {\n\t\t\tdirection = this.dirs.right;\n\t\t} else if (to.y > from.y) {\n\t\t\tdirection = this.dirs.down;\n\t\t} else {\n\t\t\tdirection = this.dirs.up;\n\t\t}\n\t\treturn direction;\n\t}\n\n};\n\nvar path_builder = {\n\n\tpath: [],\n\tclear: function () {\n\t\tthis.path = [];\n\t},\n\tcurrent: function () {\n\t\treturn this.path[this.path.length - 1];\n\t},\n\tpoint: function (next) {\n\t\tif (!next)\n\t\t\treturn this.current();\n\n\t\tthis.path.push(gantt.copy(next));\n\t\treturn next;\n\t},\n\tpoint_to: function (direction, diff, point) {\n\t\tif (!point)\n\t\t\tpoint = gantt.copy(this.point());\n\t\telse\n\t\t\tpoint = {x: point.x, y: point.y};\n\t\tvar dir = drawer.dirs;\n\t\tswitch (direction) {\n\t\t\tcase (dir.left):\n\t\t\t\tpoint.x -= diff;\n\t\t\t\tbreak;\n\t\t\tcase (dir.right):\n\t\t\t\tpoint.x += diff;\n\t\t\t\tbreak;\n\t\t\tcase (dir.up):\n\t\t\t\tpoint.y -= diff;\n\t\t\t\tbreak;\n\t\t\tcase (dir.down):\n\t\t\t\tpoint.y += diff;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\treturn this.point(point);\n\t},\n\tget_points: function (link, view) {\n\t\tvar pt = this.get_endpoint(link, view);\n\t\tvar xy = gantt.config;\n\n\t\tvar dy = pt.e_y - pt.y;\n\t\tvar dx = pt.e_x - pt.x;\n\n\t\tvar dir = drawer.dirs;\n\n\t\tthis.clear();\n\t\tthis.point({x: pt.x, y: pt.y});\n\n\t\tvar shiftX = 2 * xy.link_arrow_size;//just random size for first line\n\t\tvar lineType = this.get_line_type(link, view.$getConfig());\n\n\t\tvar forward = (pt.e_x > pt.x);\n\t\tif (lineType.from_start && lineType.to_start) {\n\t\t\tthis.point_to(dir.left, shiftX);\n\t\t\tif (forward) {\n\t\t\t\tthis.point_to(dir.down, dy);\n\t\t\t\tthis.point_to(dir.right, dx);\n\t\t\t} else {\n\t\t\t\tthis.point_to(dir.right, dx);\n\t\t\t\tthis.point_to(dir.down, dy);\n\t\t\t}\n\t\t\tthis.point_to(dir.right, shiftX);\n\n\t\t} else if (!lineType.from_start && lineType.to_start) {\n\t\t\tforward = (pt.e_x > (pt.x + 2 * shiftX));\n\t\t\tthis.point_to(dir.right, shiftX);\n\t\t\tif (forward) {\n\t\t\t\tdx -= shiftX;\n\t\t\t\tthis.point_to(dir.down, dy);\n\t\t\t\tthis.point_to(dir.right, dx);\n\t\t\t} else {\n\t\t\t\tdx -= 2 * shiftX;\n\t\t\t\tvar sign = dy > 0 ? 1 : -1;\n\n\t\t\t\tthis.point_to(dir.down, sign * (xy.row_height / 2));\n\t\t\t\tthis.point_to(dir.right, dx);\n\t\t\t\tthis.point_to(dir.down, sign * ( Math.abs(dy) - (xy.row_height / 2)));\n\t\t\t\tthis.point_to(dir.right, shiftX);\n\t\t\t}\n\n\t\t} else if (!lineType.from_start && !lineType.to_start) {\n\t\t\tthis.point_to(dir.right, shiftX);\n\t\t\tif (forward) {\n\t\t\t\tthis.point_to(dir.right, dx);\n\t\t\t\tthis.point_to(dir.down, dy);\n\t\t\t} else {\n\t\t\t\tthis.point_to(dir.down, dy);\n\t\t\t\tthis.point_to(dir.right, dx);\n\t\t\t}\n\t\t\tthis.point_to(dir.left, shiftX);\n\t\t} else if (lineType.from_start && !lineType.to_start) {\n\n\t\t\tforward = (pt.e_x > (pt.x - 2 * shiftX));\n\t\t\tthis.point_to(dir.left, shiftX);\n\n\t\t\tif (!forward) {\n\t\t\t\tdx += shiftX;\n\t\t\t\tthis.point_to(dir.down, dy);\n\t\t\t\tthis.point_to(dir.right, dx);\n\t\t\t} else {\n\t\t\t\tdx += 2 * shiftX;\n\t\t\t\tvar sign = dy > 0 ? 1 : -1;\n\t\t\t\tthis.point_to(dir.down, sign * (xy.row_height / 2));\n\t\t\t\tthis.point_to(dir.right, dx);\n\t\t\t\tthis.point_to(dir.down, sign * ( Math.abs(dy) - (xy.row_height / 2)));\n\t\t\t\tthis.point_to(dir.left, shiftX);\n\t\t\t}\n\n\t\t}\n\n\t\treturn this.path;\n\t},\n\tget_line_type: function(link, config){\n\t\tvar types = config.links;\n\t\tvar from_start = false, to_start = false;\n\t\tif (link.type == types.start_to_start) {\n\t\t\tfrom_start = to_start = true;\n\t\t} else if (link.type == types.finish_to_finish) {\n\t\t\tfrom_start = to_start = false;\n\t\t} else if (link.type == types.finish_to_start) {\n\t\t\tfrom_start = false;\n\t\t\tto_start = true;\n\t\t} else if (link.type == types.start_to_finish) {\n\t\t\tfrom_start = true;\n\t\t\tto_start = false;\n\t\t} else {\n\t\t\tgantt.assert(false, \"Invalid link type\");\n\t\t}\n\n\t\tif(config.rtl){\n\t\t\tfrom_start = !from_start;\n\t\t\tto_start = !to_start;\n\t\t}\n\n\t\treturn {from_start: from_start, to_start: to_start};\n\t},\n\n\tget_endpoint: function (link, view) {\n\t\tvar config = view.$getConfig();\n\t\tvar types = config.links;\n\n\t\tvar lineType = this.get_line_type(link, config);\n\t\tvar from_start = lineType.from_start,\n\t\t\tto_start = lineType.to_start;\n\n\t\tvar source = gantt.getTask(link.source);\n\t\tvar target = gantt.getTask(link.target);\n\n\t\tvar from = getMilestonePosition(source, view),\n\t\t\tto = getMilestonePosition(target, view);\n\n\t\treturn {\n\t\t\tx: from_start ? from.left : (from.left + from.width),\n\t\t\te_x: to_start ? to.left : (to.left + to.width),\n\t\t\ty: from.top,\n\t\t\te_y: to.top\n\t\t};\n\t}\n};\n\nfunction getMilestonePosition(task, view){\n\tvar config = view.$getConfig();\n\tvar pos = view.getItemPosition(task);\n\tif(gantt.getTaskType(task.type) == config.types.milestone){\n\t\tvar milestoneHeight = gantt.getTaskHeight();\n\t\tvar milestoneWidth = Math.sqrt(2*milestoneHeight*milestoneHeight);\n\t\tpos.left -= milestoneWidth / 2;\n\t\tpos.width = milestoneWidth;\n\t}\n\treturn pos;\n}\n\nreturn _render_link_element;\n\n}\n\nmodule.exports = createLinkRender;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/render/link_render.js\n// module id = 47\n// module chunks = 0","var dateHelper = require(\"../../../utils/date_helpers\");\n\nfunction createGridLineRender(gantt){\n\tfunction _render_grid_item(item, view) {\n\t\t//if (!_is_grid_visible.call(this))\n\t\t//\treturn null;\n\n\t\tvar columns = view.getGridColumns();\n\t\tvar config = view.$getConfig(),\n\t\t\ttemplates = view.$getTemplates();\n\n\t\tvar store = view.$config.rowStore;\n\n\t\tif(config.rtl){\n\t\t\tcolumns = columns.reverse();\n\t\t}\n\n\t\tvar cells = [];\n\t\tvar width = 0;\n\t\tvar has_child;\n\t\tfor (var i = 0; i < columns.length; i++) {\n\t\t\tvar last = i == columns.length - 1;\n\t\t\tvar col = columns[i];\n\t\t\tvar cell;\n\n\t\t\tvar value;\n\t\t\tvar textValue;\n\t\t\tif (col.name == \"add\") {\n\t\t\t\tvar aria = gantt._waiAria.gridAddButtonAttrString(col);\n\n\t\t\t\tvalue = \"\";\n\t\t\t\ttextValue = \"\";\n\t\t\t} else {\n\t\t\t\tif (col.template)\n\t\t\t\t\tvalue = col.template(item);\n\t\t\t\telse\n\t\t\t\t\tvalue = item[col.name];\n\n\t\t\t\tif (dateHelper.isDate(value))\n\t\t\t\t\tvalue = templates.date_grid(value, item);\n\t\t\t\ttextValue = value;\n\t\t\t\tvalue = \"\" + value + \"
\";\n\t\t\t}\n\t\t\tvar css = \"gantt_cell\" + (last ? \" gantt_last_cell\" : \"\");\n\n\t\t\tvar tree = [];\n\t\t\tif (col.tree) {\n\t\t\t\tfor (var j = 0; j < item.$level; j++)\n\t\t\t\t\ttree.push(templates.grid_indent(item));\n\n\t\t\t\thas_child = store.hasChild(item.id);\n\t\t\t\tif (has_child) {\n\t\t\t\t\ttree.push(templates.grid_open(item));\n\t\t\t\t\ttree.push(templates.grid_folder(item));\n\t\t\t\t} else {\n\t\t\t\t\ttree.push(templates.grid_blank(item));\n\t\t\t\t\ttree.push(templates.grid_file(item));\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar style = \"width:\" + (col.width - (last ? 1 : 0)) + \"px;\";\n\t\t\tif (this.defined(col.align))\n\t\t\t\tstyle += \"text-align:\" + col.align + \";\";\n\n\t\t\tvar aria = gantt._waiAria.gridCellAttrString(col, textValue);\n\n\t\t\ttree.push(value);\n\t\t\tif(config.rtl){\n\t\t\t\ttree = tree.reverse();\n\t\t\t}\n\t\t\tcell = \"\" + tree.join(\"\") + \"
\";\n\t\t\tcells.push(cell);\n\t\t}\n\t\tvar css = gantt.getGlobalTaskIndex(item.id) % 2 === 0 ? \"\" : \" odd\";\n\t\tcss += (item.$transparent) ? \" gantt_transparent\" : \"\";\n\n\t\tcss += (item.$dataprocessor_class ? \" \" + item.$dataprocessor_class : \"\");\n\n\t\tif (templates.grid_row_class) {\n\t\t\tvar css_template = templates.grid_row_class.call(gantt, item.start_date, item.end_date, item);\n\t\t\tif (css_template)\n\t\t\t\tcss += \" \" + css_template;\n\t\t}\n\n\t\tif(store.getSelectedId() == item.id) {\n\t\t\tcss += \" gantt_selected\";\n\t\t}\n\n\t\tvar el = document.createElement(\"div\");\n\t\tel.className = \"gantt_row\" + css;\n\t\tel.style.height = config.row_height + \"px\";\n\t\tel.style.lineHeight = (config.row_height) + \"px\";\n\n\t\tif(config.smart_rendering){\n\t\t\tel.style.position = \"absolute\";\n\t\t\tel.style.left = \"0px\";\n\t\t\tel.style.top = view.getItemTop(item.id) + \"px\";\n\t\t}\n\n\t\tif(view.$config.item_attribute){\n\t\t\tel.setAttribute(view.$config.item_attribute, item.id);\n\t\t}\n\n\t\tgantt._waiAria.taskRowAttr(item, el);\n\n\t\tel.innerHTML = cells.join(\"\");\n\t\treturn el;\n\t}\n\n\treturn _render_grid_item;\n}\n\nmodule.exports = createGridLineRender;\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/render/task_grid_line_render.js\n// module id = 48\n// module chunks = 0","var utils = require(\"../../../utils/utils\");\nvar rowDnd = require(\"./tasks_grid_dnd\");\n\nvar initializer = (function(){\n\treturn function(gantt){\n\t\treturn {\n\t\t\tonCreated: function (grid) {\n\t\t\t\tgrid.$config = utils.mixin(grid.$config, {\n\t\t\t\t\tbind: \"task\"\n\t\t\t\t});\n\t\t\t\tif(grid.$config.id == \"grid\") {\n\t\t\t\t\tthis.extendGantt(grid);\n\t\t\t\t}\n\n\t\t\t\tthis._mouseDelegates = require(\"../mouse_event_container\")(gantt);\n\t\t\t},\n\t\t\tonInitialized: function (grid) {\n\t\t\t\tvar config = grid.$getConfig();\n\t\t\t\tif (config.order_branch) {\n\t\t\t\t\trowDnd.init(grid.$gantt, grid);\n\t\t\t\t}\n\n\t\t\t\tthis.initEvents(grid, gantt);\n\t\t\t\tif(grid.$config.id == \"grid\") {\n\t\t\t\t\tthis.extendDom(grid);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDestroyed: function (grid) {\n\t\t\t\tthis.clearEvents(grid, gantt);\n\t\t\t},\n\n\t\t\tinitEvents: function (grid, gantt) {\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_row\", gantt.bind(function (e, id, trg) {\n\t\t\t\t\tvar config = grid.$getConfig();\n\t\t\t\t\tif (id !== null) {\n\t\t\t\t\t\tvar task = this.getTask(id);\n\t\t\t\t\t\tif (config.scroll_on_click && !gantt._is_icon_open_click(e))\n\t\t\t\t\t\t\tthis.showDate(task.start_date);\n\t\t\t\t\t\tgantt.callEvent(\"onTaskRowClick\", [id, trg]);\n\t\t\t\t\t}\n\t\t\t\t}, gantt), grid.$grid);\n\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_grid_head_cell\", gantt.bind(function (e, id, trg) {\n\t\t\t\t\tvar column = trg.getAttribute(\"column_id\");\n\n\t\t\t\t\tif (!gantt.callEvent(\"onGridHeaderClick\", [column, e]))\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tvar config = grid.$getConfig();\n\n\t\t\t\t\tif (column == \"add\") {\n\t\t\t\t\t\tvar mouseEvents = gantt.$services.getService(\"mouseEvents\");\n\t\t\t\t\t\tmouseEvents.callHandler(\"click\", \"gantt_add\", grid.$grid, [e, config.root_id]);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (config.sort) {\n\t\t\t\t\t\tvar sorting_method = column,\n\t\t\t\t\t\t\tconf;\n\n\t\t\t\t\t\tfor (var i = 0; i < config.columns.length; i++) {\n\t\t\t\t\t\t\tif (config.columns[i].name == column) {\n\t\t\t\t\t\t\t\tconf = config.columns[i];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (conf && conf.sort !== undefined && conf.sort !== true) {\n\t\t\t\t\t\t\tsorting_method = conf.sort;\n\n\t\t\t\t\t\t\tif (!sorting_method) { // column sort property 'false', no sorting\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar sort = (this._sort && this._sort.direction && this._sort.name == column) ? this._sort.direction : \"desc\";\n\t\t\t\t\t\t// invert sort direction\n\t\t\t\t\t\tsort = (sort == \"desc\") ? \"asc\" : \"desc\";\n\t\t\t\t\t\tthis._sort = {\n\t\t\t\t\t\t\tname: column,\n\t\t\t\t\t\t\tdirection: sort\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.sort(sorting_method, sort == \"desc\");\n\t\t\t\t\t}\n\t\t\t\t}, gantt), grid.$grid);\n\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_add\", gantt.bind(function (e, id, trg) {\n\t\t\t\t\tvar config = grid.$getConfig();\n\t\t\t\t\tif (config.readonly) return;\n\n\t\t\t\t\tvar item = {};\n\t\t\t\t\tthis.createTask(item, id ? id : gantt.config.root_id);\n\n\t\t\t\t\treturn false;\n\t\t\t\t}, gantt), grid.$grid);\n\n\t\t\t},\n\n\t\t\tclearEvents: function(grid, gantt){\n\t\t\t\tthis._mouseDelegates.destructor();\n\t\t\t\tthis._mouseDelegates = null;\n\t\t\t},\n\n\t\t\textendDom: function(grid){\n\t\t\t\tgantt.$grid = grid.$grid;\n\t\t\t\tgantt.$grid_scale = grid.$grid_scale;\n\t\t\t\tgantt.$grid_data = grid.$grid_data;\n\t\t\t},\n\t\t\textendGantt: function(grid){\n\n\t\t\t\tgantt.getGridColumns = gantt.bind(grid.getGridColumns, grid);\n\n\t\t\t\tgrid.attachEvent(\"onColumnResizeStart\", function(){\n\t\t\t\t\treturn gantt.callEvent(\"onColumnResizeStart\", arguments);\n\t\t\t\t});\n\t\t\t\tgrid.attachEvent(\"onColumnResize\", function(){\n\t\t\t\t\treturn gantt.callEvent(\"onColumnResize\", arguments);\n\t\t\t\t});\n\t\t\t\tgrid.attachEvent(\"onColumnResizeEnd\", function(){\n\t\t\t\t\treturn gantt.callEvent(\"onColumnResizeEnd\", arguments);\n\t\t\t\t});\n\n\t\t\t\tgrid.attachEvent(\"onColumnResizeComplete\", function(columns, totalWidth){\n\t\t\t\t\tgantt.config.grid_width = totalWidth;\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t};\n})();\n\nmodule.exports = initializer;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/grid/main_grid_initializer.js\n// module id = 49\n// module chunks = 0","var domHelpers = require(\"../../../utils/dom_helpers\");\n\nfunction _init_dnd(gantt, grid) {\n\tvar DnD = gantt.$services.getService(\"dnd\");\n\n\tif(!grid.$config.bind || !gantt.getDatastore(grid.$config.bind)){\n\t\treturn;\n\t}\n\n\tfunction locate(e){\n\t\treturn domHelpers.locateAttribute(e, grid.$config.item_attribute);\n\t}\n\n\tfunction getStore(){\n\t\treturn gantt.getDatastore(grid.$config.bind);\n\t}\n\n\tvar dnd = new DnD(grid.$grid_data, {updates_per_second: 60});\n\tif (gantt.defined(grid.$getConfig().dnd_sensitivity))\n\t\tdnd.config.sensitivity = grid.$getConfig().dnd_sensitivity;\n\n\tdnd.attachEvent(\"onBeforeDragStart\", gantt.bind(function (obj, e) {\n\t\tvar el = locate(e);\n\t\tif (!el) return false;\n\t\tif (gantt.hideQuickInfo) gantt._hideQuickInfo();\n\n\t\tvar id = el.getAttribute(grid.$config.item_attribute);\n\n\t\tvar datastore = getStore();\n\n\t\tvar task = datastore.getItem(id);\n\n\t\tif (gantt.isReadonly(task))\n\t\t\treturn false;\n\n\t\tdnd.config.initial_open_state = task.$open;\n\t\tif (!gantt.callEvent(\"onRowDragStart\", [id, e.target || e.srcElement, e])) {\n\t\t\treturn false;\n\t\t}\n\n\t}, gantt));\n\n\tdnd.attachEvent(\"onAfterDragStart\", gantt.bind(function (obj, e) {\n\t\tvar el = locate(e);\n\t\tdnd.config.marker.innerHTML = el.outerHTML;\n\t\tvar element = dnd.config.marker.firstChild;\n\t\tif(element){\n\t\t\telement.style.position = \"static\";\n\t\t}\n\n\t\tdnd.config.id = el.getAttribute(grid.$config.item_attribute);\n\n\t\tvar store = getStore();\n\n\t\tvar task = store.getItem(dnd.config.id);\n\t\tdnd.config.index = store.getBranchIndex(dnd.config.id);\n\t\tdnd.config.parent = task.parent;\n\t\ttask.$open = false;\n\t\ttask.$transparent = true;\n\t\tthis.refreshData();\n\t}, gantt));\n\n\tdnd.lastTaskOfLevel = function (level) {\n\t\tvar last_item = null;\n\t\tvar store = getStore();\n\t\tvar tasks = store.getItems();\n\t\tfor (var i = 0, len = tasks.length; i < len; i++) {\n\t\t\tif (tasks[i].$level == level) {\n\t\t\t\tlast_item = tasks[i];\n\t\t\t}\n\t\t}\n\t\treturn last_item ? last_item.id : null;\n\t};\n\tdnd._getGridPos = gantt.bind(function (e) {\n\t\tvar pos = domHelpers.getNodePosition(grid.$grid_data);\n\t\tvar store = getStore();\n\t\t// row offset\n\t\tvar x = pos.x;\n\t\tvar y = e.pos.y - 10;\n\n\t\tvar config = grid.$getConfig();\n\t\t// prevent moving row out of grid_data container\n\t\tif (y < pos.y) y = pos.y;\n\t\tvar gridHeight = store.countVisible() * config.row_height;\n\t\tif (y > pos.y + gridHeight - config.row_height) y = pos.y + gridHeight - config.row_height;\n\n\t\tpos.x = x;\n\t\tpos.y = y;\n\t\treturn pos;\n\t}, gantt);\n\tdnd._getTargetY = gantt.bind(function (e) {\n\t\tvar pos = domHelpers.getNodePosition(grid.$grid_data);\n\n\t\tvar y = e.pageY - pos.y + (grid.$state.scrollTop || 0);\n\t\tif (y < 0)\n\t\t\ty = 0;\n\t\treturn y;\n\t}, gantt);\n\tdnd._getTaskByY = gantt.bind(function (y, dropIndex) {\n\n\t\tvar config = grid.$getConfig(),\n\t\t\tstore = getStore();\n\n\t\ty = y || 0;\n\n\t\tvar index = Math.floor(y / config.row_height);\n\t\tindex = dropIndex < index ? index - 1 : index;\n\n\t\tif (index > store.countVisible() - 1)\n\t\t\treturn null;\n\n\t\treturn store.getIdByIndex(index);\n\t}, gantt);\n\tdnd.attachEvent(\"onDragMove\", gantt.bind(function (obj, e) {\n\t\tvar dd = dnd.config;\n\t\tvar pos = dnd._getGridPos(e);\n\n\t\tvar config = grid.$getConfig(),\n\t\t\tstore = getStore();\n\n\t\t// setting position of row\n\t\tdd.marker.style.left = pos.x + 10 + \"px\";\n\t\tdd.marker.style.top = pos.y + \"px\";\n\n\t\t// highlight row when mouseover\n\t\tvar item = store.getItem(dnd.config.id);\n\t\tvar targetY = dnd._getTargetY(e);\n\t\tvar el = dnd._getTaskByY(targetY, store.getIndexById(item.id));\n\n\t\tif (!store.exists(el)) {\n\t\t\tel = dnd.lastTaskOfLevel(config.order_branch_free ? item.$level : 0);\n\t\t\tif (el == dnd.config.id) {\n\t\t\t\tel = null;\n\t\t\t}\n\t\t}\n\n\t\tfunction allowedLevel(next, item) {\n\t\t\treturn (!(store.isChildOf(over.id, item.id)) && (next.$level == item.$level || config.order_branch_free));\n\t\t}\n\n\t\tif (store.exists(el)) {\n\t\t\tvar over = store.getItem(el);\n\n\t\t\tif (store.getIndexById(over.id) * config.row_height + config.row_height / 2 < targetY) {\n\t\t\t\t//hovering over bottom part of item, check can be drop to bottom\n\t\t\t\tvar index = store.getIndexById(over.id);\n\t\t\t\tvar nextId = store.getNext(over.id);//adds +1 when hovering over placeholder\n\t\t\t\tvar next = store.getItem(nextId);\n\t\t\t\tif (next) {\n\t\t\t\t\tif (next.id != item.id) {\n\t\t\t\t\t\tover = next; //there is a valid target\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (config.order_branch_free) {\n\t\t\t\t\t\t\tif (!(store.isChildOf(item.id, over.id) && store.getChildren(over.id).length == 1))\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tstore.move(item.id, store.getBranchIndex(over.id) + 1, store.getParent(over.id));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//we at end of the list, check and drop at the end of list\n\t\t\t\t\tnextId = store.getIdByIndex(index);\n\t\t\t\t\tnext = store.getItem(nextId);\n\n\t\t\t\t\tif (allowedLevel(next, item) && next.id != item.id) {\n\t\t\t\t\t\tstore.move(item.id, -1, store.getParent(next.id));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (config.order_branch_free) {\n\t\t\t\tif (over.id != item.id && allowedLevel(over, item)) {\n\t\t\t\t\tif (!store.hasChild(over.id)) {\n\t\t\t\t\t\tover.$open = true;\n\t\t\t\t\t\tstore.move(item.id, -1, over.id);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (store.getIndexById(over.id) || config.row_height / 3 < targetY) return;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if item is on different level, check the one before it\n\t\t\tvar index = store.getIndexById(over.id),\n\t\t\t\tprevId = store.getIdByIndex(index - 1);\n\n\t\t\tvar prev = store.getItem(prevId);\n\n\t\t\tvar shift = 1;\n\t\t\twhile ((!prev || prev.id == over.id) && index - shift >= 0) {\n\n\t\t\t\tprevId = store.getIdByIndex(index - shift);\n\t\t\t\tprev = store.getItem(prevId);\n\t\t\t\tshift++;\n\t\t\t}\n\n\t\t\tif (item.id == over.id) return;\n\t\t\t//replacing item under cursor\n\t\t\tif (allowedLevel(over, item) && item.id != over.id) {\n\t\t\t\tstore.move(item.id, 0, 0, over.id);\n\n\t\t\t} else if (over.$level == item.$level - 1 && !store.getChildren(over.id).length) {\n\t\t\t\tstore.move(item.id, 0, over.id);\n\n\t\t\t} else if (prev && (allowedLevel(prev, item)) && (item.id != prev.id)) {\n\t\t\t\tstore.move(item.id, -1, store.getParent(prev.id));\n\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}, gantt));\n\n\tdnd.attachEvent(\"onDragEnd\", gantt.bind(function () {\n\t\tvar store = getStore();\n\t\tvar task = store.getItem(dnd.config.id);\n\t\ttask.$transparent = false;\n\t\ttask.$open = dnd.config.initial_open_state;\n\n\t\tif (this.callEvent(\"onBeforeRowDragEnd\", [dnd.config.id, dnd.config.parent, dnd.config.index]) === false) {\n\t\t\tstore.move(dnd.config.id, dnd.config.index, dnd.config.parent);\n\t\t\ttask.$drop_target = null;\n\t\t} else {\n\t\t\tthis.callEvent(\"onRowDragEnd\", [dnd.config.id, task.$drop_target]);\n\t\t}\n\n\t\tstore.refresh(task.id);\n\t\t//this.refreshData();\n\t}, gantt));\n}\n\nmodule.exports = {\n\tinit: _init_dnd\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/grid/tasks_grid_dnd.js\n// module id = 50\n// module chunks = 0","var utils = require(\"../../../utils/utils\"),\n\ttaskDnD = require(\"./tasks_dnd\"),\n\tlinkDnD = require(\"./links_dnd\"),\n\tdomHelpers = require(\"../../../utils/dom_helpers\");\n\nvar initializer = (function(){\n\treturn function(gantt){\n\t\tvar services = gantt.$services;\n\t\treturn {\n\t\t\tonCreated: function (timeline) {\n\t\t\t\tvar config = timeline.$config;\n\t\t\t\tconfig.bind = utils.defined(config.bind) ? config.bind : \"task\";\n\t\t\t\tconfig.bindLinks = utils.defined(config.bindLinks) ? config.bindLinks : \"link\";\n\n\t\t\t\ttimeline._linksDnD = linkDnD.createLinkDND();\n\t\t\t\ttimeline._tasksDnD = taskDnD.createTaskDND();\n\t\t\t\ttimeline._tasksDnD.extend(timeline);\n\n\t\t\t\tif(timeline.$config.id == \"timeline\") {\n\t\t\t\t\tthis.extendGantt(timeline);\n\t\t\t\t}\n\n\t\t\t\tthis._mouseDelegates = require(\"../mouse_event_container\")(gantt);\n\t\t\t},\n\t\t\tonInitialized: function (timeline) {\n\t\t\t\tthis._attachDomEvents(gantt);\n\n\t\t\t\tthis._attachStateProvider(gantt, timeline);\n\n\t\t\t\ttimeline._tasksDnD.init(timeline, gantt);\n\t\t\t\ttimeline._linksDnD.init(timeline, gantt);\n\n\t\t\t\tif(timeline.$config.id == \"timeline\"){\n\t\t\t\t\tthis.extendDom(timeline);\n\t\t\t\t}\n\n\t\t\t},\n\t\t\tonDestroyed: function (timeline) {\n\t\t\t\tthis._clearDomEvents(gantt);\n\t\t\t\tthis._clearStateProvider(gantt);\n\t\t\t},\n\t\t\textendDom: function(timeline){\n\t\t\t\tgantt.$task = timeline.$task;\n\t\t\t\tgantt.$task_scale = timeline.$task_scale;\n\t\t\t\tgantt.$task_data = timeline.$task_data;\n\t\t\t\tgantt.$task_bg = timeline.$task_bg;\n\t\t\t\tgantt.$task_links = timeline.$task_links;\n\t\t\t\tgantt.$task_bars = timeline.$task_bars;\n\t\t\t},\n\n\t\t\textendGantt: function(timeline){\n\t\t\t\tgantt.dateFromPos = gantt.bind(timeline.dateFromPos, timeline);\n\t\t\t\tgantt.posFromDate = gantt.bind(timeline.posFromDate, timeline);\n\t\t\t\tgantt.getRowTop = gantt.bind(timeline.getRowTop, timeline);\n\t\t\t\tgantt.getTaskTop = gantt.bind(timeline.getItemTop, timeline);\n\t\t\t\tgantt.getTaskPosition = gantt.bind(timeline.getItemPosition, timeline);\n\t\t\t\tgantt.getTaskHeight = gantt.bind(timeline.getItemHeight, timeline);\n\t\t\t\tgantt.columnIndexByDate = gantt.bind(timeline.columnIndexByDate, timeline);\n\t\t\t\tgantt.roundTaskDates = gantt.bind(timeline.roundTaskDates, timeline);\n\t\t\t\tgantt.getScale = gantt.bind(timeline.getScale, timeline);\n\t\t\t\tgantt.getTaskNode = function (id) {\n\t\t\t\t\treturn timeline._taskRenderer.rendered[id];\n\t\t\t\t};\n\t\t\t\tgantt.getLinkNode = function (id) {\n\t\t\t\t\treturn timeline._linkRenderer.rendered[id];\n\t\t\t\t};\n\n\t\t\t},\n\n\t\t\t_clearDomEvents: function(){\n\t\t\t\tthis._mouseDelegates.destructor();\n\t\t\t\tthis._mouseDelegates = null;\n\t\t\t},\n\n\t\t\t_attachDomEvents: function(gantt){\n\t\t\t\tfunction _delete_link_handler(id, e) {\n\t\t\t\t\tif (id && this.callEvent(\"onLinkDblClick\", [id, e])) {\n\n\t\t\t\t\t\tvar link = this.getLink(id);\n\t\t\t\t\t\tif (this.isReadonly(link)) return;\n\n\t\t\t\t\t\tvar title = \"\";\n\t\t\t\t\t\tvar question = this.locale.labels.link + \" \" + this.templates.link_description(this.getLink(id)) + \" \" + this.locale.labels.confirm_link_deleting;\n\n\t\t\t\t\t\twindow.setTimeout(function () {\n\t\t\t\t\t\t\tgantt._dhtmlx_confirm(question, title, function () {\n\t\t\t\t\t\t\t\tgantt.deleteLink(id);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}, (this.config.touch ? 300 : 1));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_task_link\", gantt.bind(function (e, trg) {\n\t\t\t\t\tvar id = this.locate(e, this.config.link_attribute);\n\t\t\t\t\tif (id) {\n\t\t\t\t\t\tthis.callEvent(\"onLinkClick\", [id, e]);\n\t\t\t\t\t}\n\t\t\t\t}, gantt), this.$task);\n\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_scale_cell\", gantt.bind(function (e, trg) {\n\t\t\t\t\tvar pos = domHelpers.getRelativeEventPosition(e, gantt.$task_data);\n\t\t\t\t\tvar date = gantt.dateFromPos(pos.x);\n\t\t\t\t\tvar coll = Math.floor(gantt.columnIndexByDate(date));\n\n\t\t\t\t\tvar coll_date = gantt.getScale().trace_x[coll];\n\n\t\t\t\t\tgantt.callEvent(\"onScaleClick\", [e, coll_date]);\n\t\t\t\t}, gantt), this.$task);\n\n\t\t\t\tthis._mouseDelegates.delegate(\"doubleclick\", \"gantt_task_link\", gantt.bind(function (e, id, trg) {\n\t\t\t\t\tvar id = this.locate(e, gantt.config.link_attribute);\n\t\t\t\t\t_delete_link_handler.call(this, id, e);\n\t\t\t\t}, gantt), this.$task);\n\n\t\t\t\tthis._mouseDelegates.delegate(\"doubleclick\", \"gantt_link_point\", gantt.bind(function (e, id, trg) {\n\t\t\t\t\tvar id = this.locate(e),\n\t\t\t\t\t\ttask = this.getTask(id);\n\n\t\t\t\t\tvar link = null;\n\t\t\t\t\tif (trg.parentNode && domHelpers.getClassName(trg.parentNode)) {\n\t\t\t\t\t\tif (domHelpers.getClassName(trg.parentNode).indexOf(\"_left\") > -1) {\n\t\t\t\t\t\t\tlink = task.$target[0];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlink = task.$source[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (link)\n\t\t\t\t\t\t_delete_link_handler.call(this, link, e);\n\t\t\t\t\treturn false;\n\t\t\t\t}, gantt), this.$task);\n\t\t\t},\n\n\t\t\t_attachStateProvider: function(gantt, timeline){\n\t\t\t\tvar self = timeline;\n\t\t\t\tvar state = services.getService(\"state\");\n\t\t\t\tstate.registerProvider(\"tasksTimeline\", function(){\n\t\t\t\t\treturn {\n\t\t\t\t\t\tscale_unit: self._tasks ? self._tasks.unit : undefined,\n\t\t\t\t\t\tscale_step: self._tasks ? self._tasks.step : undefined\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t_clearStateProvider: function(){\n\t\t\t\tvar state = services.getService(\"state\");\n\t\t\t\tstate.unregisterProvider(\"tasksTimeline\");\n\t\t\t}\n\t\t};\n\t};\n\n})();\n\nmodule.exports = initializer;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/timeline/main_timeline_initializer.js\n// module id = 51\n// module chunks = 0","var domHelpers = require(\"../../../utils/dom_helpers\"),\n\tutils = require(\"../../../utils/utils\");\nvar timeout = require(\"../../../utils/timeout\");\n\nfunction createTaskDND(timeline, gantt){\n\tvar services = gantt.$services;\n\treturn {\n\t\tdrag: null,\n\t\tdragMultiple: {},\n\t\t_events: {\n\t\t\tbefore_start: {},\n\t\t\tbefore_finish: {},\n\t\t\tafter_finish: {}\n\t\t},\n\t\t_handlers: {},\n\t\tinit: function () {\n\t\t\tthis._domEvents = gantt._createDomEventScope();\n\t\t\tthis.clear_drag_state();\n\t\t\tvar drag = gantt.config.drag_mode;\n\t\t\tthis.set_actions();\n\n\t\t\tvar stateService = services.getService(\"state\");\n\t\t\tstateService.registerProvider(\"tasksDnd\", utils.bind(function(){\n\t\t\t\treturn {\n\t\t\t\t\tdrag_id : this.drag ? this.drag.id : undefined,\n\t\t\t\t\tdrag_mode : this.drag ? this.drag.mode : undefined,\n\t\t\t\t\tdrag_from_start : this.drag ? this.drag.left : undefined\n\t\t\t\t};\n\t\t\t}, this));\n\n\t\t\tvar evs = {\n\t\t\t\t\"before_start\": \"onBeforeTaskDrag\",\n\t\t\t\t\"before_finish\": \"onBeforeTaskChanged\",\n\t\t\t\t\"after_finish\": \"onAfterTaskDrag\"\n\t\t\t};\n\t\t\t//for now, all drag operations will trigger the same events\n\t\t\tfor (var stage in this._events) {\n\t\t\t\tfor (var mode in drag) {\n\t\t\t\t\tthis._events[stage][mode] = evs[stage];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._handlers[drag.move] = this._move;\n\t\t\tthis._handlers[drag.resize] = this._resize;\n\t\t\tthis._handlers[drag.progress] = this._resize_progress;\n\t\t},\n\t\tset_actions: function () {\n\t\t\tvar data = timeline.$task_data;\n\t\t\tthis._domEvents.attach(data, \"mousemove\", gantt.bind(function (e) {\n\t\t\t\tthis.on_mouse_move(e || event);\n\t\t\t}, this));\n\t\t\tthis._domEvents.attach(data, \"mousedown\", gantt.bind(function (e) {\n\t\t\t\tthis.on_mouse_down(e || event);\n\t\t\t}, this));\n\t\t\tthis._domEvents.attach(data, \"mouseup\", gantt.bind(function (e) {\n\t\t\t\tthis.on_mouse_up(e || event);\n\t\t\t}, this));\n\t\t},\n\n\t\tclear_drag_state: function () {\n\t\t\tthis.drag = {\n\t\t\t\tid: null,\n\t\t\t\tmode: null,\n\t\t\t\tpos: null,\n\t\t\t\tstart_x: null,\n\t\t\t\tstart_y: null,\n\t\t\t\tobj: null,\n\t\t\t\tleft: null\n\t\t\t};\n\t\t\tthis.dragMultiple = {};\n\t\t},\n\t\t_resize: function (ev, shift, drag) {\n\t\t\tvar cfg = timeline.$getConfig();\n\t\t\tvar coords_x = this._drag_task_coords(ev, drag);\n\t\t\tif (drag.left) {\n\t\t\t\tev.start_date = gantt.dateFromPos(coords_x.start + shift);\n\t\t\t\tif (!ev.start_date) {\n\t\t\t\t\tev.start_date = new Date(gantt.getState().min_date);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tev.end_date = gantt.dateFromPos(coords_x.end + shift);\n\t\t\t\tif (!ev.end_date) {\n\t\t\t\t\tev.end_date = new Date(gantt.getState().max_date);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (ev.end_date - ev.start_date < cfg.min_duration) {\n\t\t\t\tif (drag.left)\n\t\t\t\t\tev.start_date = gantt.calculateEndDate({start_date: ev.end_date, duration: -1, task: ev});\n\t\t\t\telse\n\t\t\t\t\tev.end_date = gantt.calculateEndDate({start_date: ev.start_date, duration: 1, task: ev});\n\t\t\t}\n\t\t\tgantt._init_task_timing(ev);\n\t\t},\n\t\t_resize_progress: function (ev, shift, drag) {\n\t\t\tvar coords_x = this._drag_task_coords(ev, drag);\n\n\t\t\tvar config = timeline.$getConfig();\n\t\t\tvar diffValue = !config.rtl ? (drag.pos.x - coords_x.start) : (coords_x.start - drag.pos.x);\n\n\t\t\tvar diff = Math.max(0, diffValue);\n\t\t\tev.progress = Math.min(1, diff / Math.abs(coords_x.end - coords_x.start));\n\t\t},\n\n\t\t_find_max_shift: function(dragItems, shift){\n\t\t\tvar correctShift;\n\t\t\tfor(var i in dragItems){\n\t\t\t\tvar drag = dragItems[i];\n\t\t\t\tvar ev = gantt.getTask(drag.id);\n\n\t\t\t\tvar coords_x = this._drag_task_coords(ev, drag);\n\t\t\t\tvar minX = gantt.posFromDate( new Date(gantt.getState().min_date)),\n\t\t\t\t\tmaxX = gantt.posFromDate( new Date(gantt.getState().max_date));\n\n\t\t\t\tif(coords_x.end + shift > maxX){\n\t\t\t\t\tvar maxShift = maxX - coords_x.end;\n\t\t\t\t\tif(maxShift < correctShift || correctShift === undefined){\n\t\t\t\t\t\tcorrectShift = maxShift;\n\t\t\t\t\t}\n\t\t\t\t}else if(coords_x.start + shift < minX){\n\t\t\t\t\tvar minShift = minX - coords_x.start;\n\t\t\t\t\tif(minShift < correctShift || correctShift === undefined){\n\t\t\t\t\t\tcorrectShift = minShift;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn correctShift;\n\t\t},\n\t\t_move: function (ev, shift, drag) {\n\t\t\tvar coords_x = this._drag_task_coords(ev, drag);\n\t\t\tvar new_start = gantt.dateFromPos(coords_x.start + shift),\n\t\t\t\tnew_end = gantt.dateFromPos(coords_x.end + shift);\n\t\t\tif (!new_start) {\n\t\t\t\tev.start_date = new Date(gantt.getState().min_date);\n\t\t\t\tev.end_date = gantt.dateFromPos(gantt.posFromDate(ev.start_date) + (coords_x.end - coords_x.start));\n\t\t\t} else if (!new_end) {\n\t\t\t\tev.end_date = new Date(gantt.getState().max_date);\n\t\t\t\tev.start_date = gantt.dateFromPos(gantt.posFromDate(ev.end_date) - (coords_x.end - coords_x.start));\n\t\t\t} else {\n\t\t\t\tev.start_date = new_start;\n\t\t\t\tev.end_date = new_end;\n\t\t\t}\n\t\t},\n\t\t_drag_task_coords: function (t, drag) {\n\t\t\tvar start = drag.obj_s_x = drag.obj_s_x || gantt.posFromDate(t.start_date);\n\t\t\tvar end = drag.obj_e_x = drag.obj_e_x || gantt.posFromDate(t.end_date);\n\t\t\treturn {\n\t\t\t\tstart: start,\n\t\t\t\tend: end\n\t\t\t};\n\t\t},\n\t\t_mouse_position_change: function (oldPos, newPos) {\n\t\t\tvar dx = oldPos.x - newPos.x,\n\t\t\t\tdy = oldPos.y - newPos.y;\n\t\t\treturn Math.sqrt(dx * dx + dy * dy);\n\t\t},\n\t\t_is_number: function (n) {\n\t\t\treturn !isNaN(parseFloat(n)) && isFinite(n);\n\t\t},\n\n\t\ton_mouse_move: function (e) {\n\t\t\tif (this.drag.start_drag) {\n\t\t\t\tvar pos = domHelpers.getRelativeEventPosition(e, gantt.$task_data);\n\n\t\t\t\tvar sX = this.drag.start_drag.start_x,\n\t\t\t\t\tsY = this.drag.start_drag.start_y;\n\n\t\t\t\tif ((Date.now() - this.drag.timestamp > 50) ||\n\t\t\t\t\t(this._is_number(sX) && this._is_number(sY) && this._mouse_position_change({\n\t\t\t\t\t\tx: sX,\n\t\t\t\t\t\ty: sY\n\t\t\t\t\t}, pos) > 20)) {\n\t\t\t\t\tthis._start_dnd(e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar drag = this.drag;\n\n\t\t\tif (drag.mode) {\n\t\t\t\tif (!timeout(this, 40))//limit update frequency\n\t\t\t\t\treturn;\n\n\t\t\t\tthis._update_on_move(e);\n\n\t\t\t}\n\t\t},\n\n\t\t_update_item_on_move: function(shift, id, mode, drag, e){\n\t\t\tvar ev = gantt.getTask(id);\n\t\t\tvar original = gantt.mixin({}, ev);\n\t\t\tvar copy = gantt.mixin({}, ev);\n\t\t\tthis._handlers[mode].apply(this, [copy, shift, drag]);\n\t\t\tgantt.mixin(ev, copy, true);\n\t\t\t//gantt._update_parents(drag.id, true);\n\t\t\tgantt.callEvent(\"onTaskDrag\", [ev.id, mode, copy, original, e]);\n\t\t\tgantt.mixin(ev, copy, true);\n\t\t\tgantt.refreshTask(id);\n\t\t},\n\n\t\t_update_on_move: function (e) {\n\t\t\tvar drag = this.drag;\n\t\t\tvar config = timeline.$getConfig();\n\t\t\tif (drag.mode) {\n\t\t\t\tvar pos = domHelpers.getRelativeEventPosition(e, timeline.$task_data);\n\t\t\t\tif (drag.pos && drag.pos.x == pos.x)\n\t\t\t\t\treturn;\n\n\t\t\t\tdrag.pos = pos;\n\n\t\t\t\tvar curr_date = gantt.dateFromPos(pos.x);\n\t\t\t\tif (!curr_date || isNaN(curr_date.getTime()))\n\t\t\t\t\treturn;\n\n\n\t\t\t\tvar shift = pos.x - drag.start_x;\n\t\t\t\tvar ev = gantt.getTask(drag.id);\n\n\t\t\t\tif (this._handlers[drag.mode]) {\n\n\t\t\t\t\tif(gantt.isSummaryTask(ev) && gantt.config.drag_project && drag.mode == config.drag_mode.move){\n\n\t\t\t\t\t\tvar initialDrag = {};\n\t\t\t\t\t\tinitialDrag[drag.id] = utils.copy(drag);\n\t\t\t\t\t\tvar maxShift = this._find_max_shift(utils.mixin(initialDrag, this.dragMultiple), shift);\n\t\t\t\t\t\tif(maxShift !== undefined){\n\t\t\t\t\t\t\tshift = maxShift;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._update_item_on_move(shift, drag.id, drag.mode, drag, e);\n\t\t\t\t\t\tfor(var i in this.dragMultiple){\n\t\t\t\t\t\t\tvar childDrag = this.dragMultiple[i];\n\t\t\t\t\t\t\tthis._update_item_on_move(shift, childDrag.id, childDrag.mode, childDrag, e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthis._update_item_on_move(shift, drag.id, drag.mode, drag, e);\n\t\t\t\t\t}\n\t\t\t\t\tgantt._update_parents(drag.id);\n\t\t\t\t}\n\n\t\t\t}\n\t\t},\n\n\t\ton_mouse_down: function (e, src) {\n\t\t\t// on Mac we do not get onmouseup event when clicking right mouse button leaving us in dnd state\n\t\t\t// let's ignore right mouse button then\n\t\t\tif (e.button == 2 && e.button !== undefined)\n\t\t\t\treturn;\n\n\t\t\tvar config = timeline.$getConfig();\n\t\t\tvar id = gantt.locate(e);\n\t\t\tvar task = null;\n\t\t\tif (gantt.isTaskExists(id)) {\n\t\t\t\ttask = gantt.getTask(id);\n\t\t\t}\n\n\t\t\tif (gantt.isReadonly(task) || this.drag.mode) return;\n\n\t\t\tthis.clear_drag_state();\n\n\t\t\tsrc = src || (e.target || e.srcElement);\n\n\t\t\tvar className = domHelpers.getClassName(src);\n\t\t\tvar drag = this._get_drag_mode(className, src);\n\n\t\t\tif (!className || !drag) {\n\t\t\t\tif (src.parentNode)\n\t\t\t\t\treturn this.on_mouse_down(e, src.parentNode);\n\t\t\t\telse\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!drag) {\n\t\t\t\tif (gantt.checkEvent(\"onMouseDown\") && gantt.callEvent(\"onMouseDown\", [className.split(\" \")[0]])) {\n\t\t\t\t\tif (src.parentNode)\n\t\t\t\t\t\treturn this.on_mouse_down(e, src.parentNode);\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (drag.mode && drag.mode != config.drag_mode.ignore && config[\"drag_\" + drag.mode]) {\n\t\t\t\t\tid = gantt.locate(src);\n\t\t\t\t\ttask = gantt.copy(gantt.getTask(id) || {});\n\n\t\t\t\t\tif (gantt.isReadonly(task)) {\n\t\t\t\t\t\tthis.clear_drag_state();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((gantt.isSummaryTask(task) && !config.drag_project) && drag.mode != config.drag_mode.progress) {//only progress drag is allowed for tasks with flexible duration\n\t\t\t\t\t\tthis.clear_drag_state();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdrag.id = id;\n\t\t\t\t\tvar pos = domHelpers.getRelativeEventPosition(e, gantt.$task_data);\n\n\t\t\t\t\tdrag.start_x = pos.x;\n\t\t\t\t\tdrag.start_y = pos.y;\n\t\t\t\t\tdrag.obj = task;\n\t\t\t\t\tthis.drag.start_drag = drag;\n\t\t\t\t\tthis.drag.timestamp = Date.now();\n\n\t\t\t\t} else\n\t\t\t\t\tthis.clear_drag_state();\n\t\t\t}\n\t\t},\n\t\t_fix_dnd_scale_time: function (task, drag) {\n\t\t\tvar config = timeline.$getConfig();\n\t\t\tvar unit = gantt.getScale().unit,\n\t\t\t\tstep = gantt.getScale().step;\n\t\t\tif (!config.round_dnd_dates) {\n\t\t\t\tunit = 'minute';\n\t\t\t\tstep = config.time_step;\n\t\t\t}\n\n\t\t\tfunction fixStart(task) {\n\t\t\t\tif (!gantt.config.correct_work_time)\n\t\t\t\t\treturn;\n\t\t\t\tvar config = timeline.$getConfig();\n\t\t\t\tif (!gantt.isWorkTime(task.start_date, undefined, task))\n\t\t\t\t\ttask.start_date = gantt.calculateEndDate({\n\t\t\t\t\t\tstart_date: task.start_date,\n\t\t\t\t\t\tduration: -1,\n\t\t\t\t\t\tunit: config.duration_unit,\n\t\t\t\t\t\ttask: task\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction fixEnd(task) {\n\t\t\t\tif (!gantt.config.correct_work_time)\n\t\t\t\t\treturn;\n\t\t\t\tvar config = timeline.$getConfig();\n\t\t\t\tif (!gantt.isWorkTime(new Date(task.end_date - 1), undefined, task))\n\t\t\t\t\ttask.end_date = gantt.calculateEndDate({\n\t\t\t\t\t\tstart_date: task.end_date,\n\t\t\t\t\t\tduration: 1,\n\t\t\t\t\t\tunit: config.duration_unit,\n\t\t\t\t\t\ttask: task\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (drag.mode == config.drag_mode.resize) {\n\t\t\t\tif (drag.left) {\n\t\t\t\t\ttask.start_date = gantt.roundDate({date: task.start_date, unit: unit, step: step});\n\t\t\t\t\tfixStart(task);\n\t\t\t\t} else {\n\t\t\t\t\ttask.end_date = gantt.roundDate({date: task.end_date, unit: unit, step: step});\n\t\t\t\t\tfixEnd(task);\n\t\t\t\t}\n\t\t\t} else if (drag.mode == config.drag_mode.move) {\n\t\t\t\ttask.start_date = gantt.roundDate({date: task.start_date, unit: unit, step: step});\n\t\t\t\tfixStart(task);\n\t\t\t\ttask.end_date = gantt.calculateEndDate(task);\t\t\t\t\n\t\t\t}\n\t\t},\n\t\t_fix_working_times: function (task, drag) {\n\t\t\tvar config = timeline.$getConfig();\n\t\t\tvar drag = drag || {mode: config.drag_mode.move};\n\t\t\t\n\t\t\tif (drag.mode == config.drag_mode.resize) {\n\t\t\t\tif (drag.left) {\n\t\t\t\t\ttask.start_date = gantt.getClosestWorkTime({date: task.start_date, dir: 'future', task: task});\n\t\t\t\t} else {\n\t\t\t\t\ttask.end_date = gantt.getClosestWorkTime({date: task.end_date, dir: 'past', task: task});\n\t\t\t\t}\n\t\t\t} else if (drag.mode == config.drag_mode.move) {\n\t\t\t\tgantt.correctTaskWorkTime(task);\n\t\t\t}\n\t\t},\n\n\t\t_finalize_mouse_up: function(taskId, config, drag, e){\n\t\t\tvar ev = gantt.getTask(taskId);\n\n\t\t\tif (config.work_time && config.correct_work_time) {\n\t\t\t\tthis._fix_working_times(ev, drag);\n\t\t\t}\n\n\t\t\tthis._fix_dnd_scale_time(ev, drag);\n\n\t\t\tif (!this._fireEvent(\"before_finish\", drag.mode, [taskId, drag.mode, gantt.copy(drag.obj), e])) {\n\t\t\t\t//drag.obj._dhx_changed = false;\n\t\t\t\tthis.clear_drag_state();\n\t\t\t\tif(taskId == drag.id){\n\t\t\t\t\tdrag.obj._dhx_changed = false;\n\t\t\t\t\tgantt.mixin(ev, drag.obj, true);\n\t\t\t\t}\n\n\n\t\t\t\tgantt.refreshTask(ev.id);\n\t\t\t} else {\n\t\t\t\tvar drag_id = taskId;\n\n\t\t\t\tgantt._init_task_timing(ev);\n\n\t\t\t\tthis.clear_drag_state();\n\t\t\t\tgantt.updateTask(ev.id);\n\t\t\t\tthis._fireEvent(\"after_finish\", drag.mode, [drag_id, drag.mode, e]);\n\t\t\t}\n\n\t\t},\n\n\t\ton_mouse_up: function (e) {\n\n\t\t\tvar drag = this.drag;\n\t\t\tif (drag.mode && drag.id) {\n\t\t\t\tvar config = timeline.$getConfig();\n\t\t\t\t//drop\n\t\t\t\tvar ev = gantt.getTask(drag.id);\n\n\t\t\t\tvar dragMultiple = this.dragMultiple;\n\t\t\t\tthis._finalize_mouse_up(drag.id, config, drag, e);\n\t\t\t\tif(gantt.isSummaryTask(ev) && config.drag_project && drag.mode == config.drag_mode.move){\n\t\t\t\t\tfor(var i in dragMultiple){\n\t\t\t\t\t\tthis._finalize_mouse_up(dragMultiple[i].id, config, dragMultiple[i], e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.clear_drag_state();\n\t\t},\n\t\t_get_drag_mode: function (className, el) {\n\t\t\tvar config = timeline.$getConfig();\n\t\t\tvar modes = config.drag_mode;\n\t\t\tvar classes = (className || \"\").split(\" \");\n\t\t\tvar classname = classes[0];\n\t\t\tvar drag = {mode: null, left: null};\n\t\t\tswitch (classname) {\n\t\t\t\tcase \"gantt_task_line\":\n\t\t\t\tcase \"gantt_task_content\":\n\t\t\t\t\tdrag.mode = modes.move;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"gantt_task_drag\":\n\t\t\t\t\tdrag.mode = modes.resize;\n\n\t\t\t\t\tvar dragProperty = el.getAttribute(\"data-bind-property\");\n\n\t\t\t\t\tif (dragProperty == \"start_date\") {\n\t\t\t\t\t\tdrag.left = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdrag.left = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"gantt_task_progress_drag\":\n\t\t\t\t\tdrag.mode = modes.progress;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"gantt_link_control\":\n\t\t\t\tcase \"gantt_link_point\":\n\t\t\t\t\tdrag.mode = modes.ignore;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tdrag = null;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn drag;\n\n\t\t},\n\n\t\t_start_dnd: function (e) {\n\t\t\tvar drag = this.drag = this.drag.start_drag;\n\t\t\tdelete drag.start_drag;\n\n\t\t\tvar cfg = timeline.$getConfig();\n\t\t\tvar id = drag.id;\n\t\t\tif (!cfg[\"drag_\" + drag.mode] || !gantt.callEvent(\"onBeforeDrag\", [id, drag.mode, e]) || !this._fireEvent(\"before_start\", drag.mode, [id, drag.mode, e])) {\n\t\t\t\tthis.clear_drag_state();\n\t\t\t} else {\n\t\t\t\tdelete drag.start_drag;\n\n\t\t\t\tvar task = gantt.getTask(id);\n\t\t\t\tif(gantt.isSummaryTask(task) && gantt.config.drag_project && drag.mode == cfg.drag_mode.move){\n\t\t\t\t\tgantt.eachTask(function(child){\n\t\t\t\t\t\tthis.dragMultiple[child.id] = gantt.mixin({\n\t\t\t\t\t\t\tid: child.id,\n\t\t\t\t\t\t\tobj: child\n\t\t\t\t\t\t}, this.drag);\n\t\t\t\t\t}, task.id, this);\n\t\t\t\t}\n\n\t\t\t\tgantt.callEvent(\"onTaskDragStart\", []);\n\t\t\t}\n\n\t\t},\n\t\t_fireEvent: function (stage, mode, params) {\n\t\t\tgantt.assert(this._events[stage], \"Invalid stage:{\" + stage + \"}\");\n\n\t\t\tvar trigger = this._events[stage][mode];\n\n\t\t\tgantt.assert(trigger, \"Unknown after drop mode:{\" + mode + \"}\");\n\t\t\tgantt.assert(params, \"Invalid event arguments\");\n\n\n\t\t\tif (!gantt.checkEvent(trigger))\n\t\t\t\treturn true;\n\n\t\t\treturn gantt.callEvent(trigger, params);\n\t\t},\n\n\t\tround_task_dates: function(task){\n\t\t\tvar drag_state = this.drag;\n\t\t\tvar config = timeline.$getConfig();\n\t\t\tif (!drag_state) {\n\t\t\t\tdrag_state = {mode: config.drag_mode.move};\n\t\t\t}\n\t\t\tthis._fix_dnd_scale_time(task, drag_state);\n\t\t},\n\t\tdestructor: function(){\n\t\t\tthis._domEvents.detachAll();\n\t\t}\n\t};\n}\n\nfunction initTaskDND() {\n\tvar _tasks_dnd;\n\treturn {\n\t\textend: function(timeline){\n\t\t\ttimeline.roundTaskDates = function (task) {\n\t\t\t\t_tasks_dnd.round_task_dates(task);\n\t\t\t};\n\n\t\t},\n\t\tinit: function(timeline, gantt){\n\t\t\t_tasks_dnd = createTaskDND(timeline, gantt);\n\t\t\t// TODO: entry point for touch handlers, move touch to timeline\n\t\t\ttimeline._tasks_dnd = _tasks_dnd;\n\t\t\treturn _tasks_dnd.init(gantt);\n\t\t},\n\t\tdestructor: function(){\n\t\t\t_tasks_dnd.destructor();\n\t\t\t_tasks_dnd = null;\n\t\t}\n\t};\n}\n\nmodule.exports = {\n\tcreateTaskDND: initTaskDND\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/timeline/tasks_dnd.js\n// module id = 52\n// module chunks = 0","var domHelpers = require(\"../../../utils/dom_helpers\");\n\nvar initLinksDND = function(timeline, gantt) {\n\tvar _link_landing,\n\t\t_link_target_task,\n\t\t_link_target_task_start,\n\t\t_link_source_task,\n\t\t_link_source_task_start;\n\n\n\tfunction getVisibleMilestoneWidth() {\n\t\tvar origWidth = timeline.getItemHeight();//m-s have square shape\n\t\treturn Math.round(Math.sqrt(2 * origWidth * origWidth)) - 2;\n\t}\n\n\tfunction isMilestone(task) {\n\t\treturn gantt.getTaskType(task.type) == gantt.config.types.milestone;\n\t}\n\n\tfunction getDndState(){\n\t\treturn {\n\t\t\tlink_source_id : _link_source_task,\n\t\t\tlink_target_id : _link_target_task,\n\t\t\tlink_from_start : _link_source_task_start,\n\t\t\tlink_to_start : _link_target_task_start,\n\t\t\tlink_landing_area : _link_landing\n\t\t};\n\t}\n\n\tvar services = gantt.$services;\n\n\tvar state = services.getService(\"state\");\n\tvar DnD = services.getService(\"dnd\");\n\n\tstate.registerProvider(\"linksDnD\", getDndState);\n\n\tvar dnd = new DnD(timeline.$task_bars, { sensitivity : 0, updates_per_second : 60 }),\n\t\tstart_marker = \"task_start_date\",\n\t\tend_marker = \"task_end_date\",\n\t\tlink_edge_marker = \"gantt_link_point\",\n\t\tlink_landing_hover_area = \"gantt_link_control\";\n\n\tdnd.attachEvent(\"onBeforeDragStart\", gantt.bind(function(obj,e) {\n\t\tvar target = (e.target||e.srcElement);\n\t\tresetDndState();\n\t\tif(gantt.getState().drag_id)\n\t\t\treturn false;\n\n\t\tif(domHelpers.locateClassName(target, link_edge_marker)){\n\t\t\tif(domHelpers.locateClassName(target, start_marker))\n\t\t\t\t_link_source_task_start = true;\n\n\t\t\tvar sid = gantt.locate(e);\n\t\t\t_link_source_task = sid;\n\n\t\t\tvar t = gantt.getTask(sid);\n\t\t\tif(gantt.isReadonly(t)){\n\t\t\t\tresetDndState();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar shift = 0;\n\n\t\t\tthis._dir_start = getLinePos(t, !!_link_source_task_start, shift, timeline.$getConfig(), true);\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\n\t}, this));\n\n\tdnd.attachEvent(\"onAfterDragStart\", gantt.bind(function(obj,e) {\n\t\tif(gantt.config.touch) {\n\t\t\tgantt.refreshData();\n\t\t}\n\t\tupdateMarkedHtml(dnd.config.marker);\n\t}, this));\n\n\tfunction getLinePos(task, to_start, shift, cfg, isStart){\n\t\tvar taskPos = getMilestonePosition(task, function(task){ return gantt.getTaskPosition(task);}, cfg);\n\n\t\tvar pos = {x: taskPos.x, y: taskPos.y};\n\t\tif(!to_start){\n\t\t\tpos.x = taskPos.xEnd;\n\t\t}\n\n\t\t//var pos = gantt._get_task_pos(task, !!to_start);\n\t\tpos.y += gantt.config.row_height/2;\n\n\t\tvar offset = isMilestone(task) && isStart ? 2 : 0;\n\n\t\tshift = shift || 0;\n\t\tif(cfg.rtl)\n\t\t\tshift = shift * -1;\n\n\t\tpos.x += (to_start ? -1 : 1)*shift - offset;\n\t\treturn pos;\n\t}\n\n\tfunction getMilestonePosition(task, getTaskPosition, cfg){\n\t\tvar pos = getTaskPosition(task);\n\n\t\tvar res = {\n\t\t\tx: pos.left,\n\t\t\ty: pos.top,\n\t\t\twidth: pos.width,\n\t\t\theight: pos.height\n\t\t};\n\n\t\tif(cfg.rtl){\n\t\t\tres.xEnd = res.x;\n\t\t\tres.x = res.xEnd + res.width;\n\t\t}else{\n\t\t\tres.xEnd = res.x + res.width;\n\t\t}\n\t\tres.yEnd = res.y + res.height;\n\n\t\tif(gantt.getTaskType(task.type) == gantt.config.types.milestone){\n\t\t\tvar milestoneWidth = getVisibleMilestoneWidth();\n\n\t\t\tres.x += (!cfg.rtl ? -1 : 1)*(milestoneWidth / 2);\n\t\t\tres.xEnd += (!cfg.rtl ? 1 : -1)*(milestoneWidth / 2);\n\n\t\t\t//pos.x -= milestoneWidth / 2;\n\t\t\t//pos.xEnd += milestoneWidth / 2;\n\t\t\tres.width = pos.xEnd - pos.x;\n\t\t}\n\n\n\t\treturn res;\n\t}\n\n\tdnd.attachEvent(\"onDragMove\", gantt.bind(function(obj,e) {\n\t\tvar dd = dnd.config;\n\t\tvar pos = dnd.getPosition(e);\n\t\tadvanceMarker(dd.marker, pos);\n\t\tvar landing = !!domHelpers.locateClassName(e, link_landing_hover_area);\n\n\t\tvar prevTarget = _link_target_task;\n\t\tvar prevLanding = _link_landing;\n\t\tvar prevToStart = _link_target_task_start;\n\n\t\tvar targ = gantt.locate(e),\n\t\t\tto_start = true;\n\t\tif(landing){\n\t\t\t//refreshTask\n\t\t\tto_start = !domHelpers.locateClassName(e, end_marker);\n\t\t\tlanding = !!targ;\n\t\t}\n\n\t\t_link_target_task = targ;\n\t\t_link_landing = landing;\n\t\t_link_target_task_start = to_start;\n\n\t\tif(landing){\n\t\t\tvar t = gantt.getTask(targ);\n\n\t\t\tvar config = timeline.$getConfig();\n\t\t\tvar node = domHelpers.locateClassName(e, link_landing_hover_area);\n\t\t\tvar shift = 0;\n\t\t\tif(node){\n\t\t\t\tshift = Math.floor(node.offsetWidth / 2);\n\t\t\t}\n\n\t\t\tthis._dir_end = getLinePos(t, !!_link_target_task_start,shift, config);\n\t\t}else{\n\t\t\tthis._dir_end = domHelpers.getRelativeEventPosition(e, timeline.$task_data);\n\t\t}\n\n\t\tvar targetChanged = !(prevLanding == landing && prevTarget == targ && prevToStart == to_start);\n\t\tif(targetChanged){\n\t\t\tif(prevTarget)\n\t\t\t\tgantt.refreshTask(prevTarget, false);\n\t\t\tif(targ)\n\t\t\t\tgantt.refreshTask(targ, false);\n\t\t}\n\n\t\tif(targetChanged){\n\t\t\tupdateMarkedHtml(dd.marker);\n\t\t}\n\n\t\tshowDirectingLine(this._dir_start.x, this._dir_start.y, this._dir_end.x, this._dir_end.y);\n\n\t\treturn true;\n\t}, this));\n\n\n\tdnd.attachEvent(\"onDragEnd\", gantt.bind(function() {\n\t\tvar drag = getDndState();\n\n\t\tif(drag.link_source_id && drag.link_target_id && drag.link_source_id != drag.link_target_id){\n\t\t\tvar type = gantt._get_link_type(drag.link_from_start, drag.link_to_start);\n\n\t\t\tvar link = {source : drag.link_source_id, target: drag.link_target_id, type:type};\n\t\t\tif(link.type && gantt.isLinkAllowed(link))\n\t\t\t\tgantt.addLink(link);\n\t\t}\n\n\t\tresetDndState();\n\n\t\tif(gantt.config.touch) {\n\t\t\tgantt.refreshData();\n\t\t}\n\t\telse {\n\t\t\tif (drag.link_source_id)\n\t\t\t\tgantt.refreshTask(drag.link_source_id, false);\n\t\t\tif (drag.link_target_id)\n\t\t\t\tgantt.refreshTask(drag.link_target_id, false);\n\t\t}\n\t\tremoveDirectionLine();\n\t}, this));\n\n\tfunction updateMarkedHtml(marker){\n\t\tvar link = getDndState();\n\n\t\tvar css = [\"gantt_link_tooltip\"];\n\t\tif(link.link_source_id && link.link_target_id){\n\t\t\tif(gantt.isLinkAllowed(link.link_source_id, link.link_target_id, link.link_from_start, link.link_to_start)){\n\t\t\t\tcss.push(\"gantt_allowed_link\");\n\t\t\t}else{\n\t\t\t\tcss.push(\"gantt_invalid_link\");\n\t\t\t}\n\t\t}\n\n\t\tvar className = gantt.templates.drag_link_class(link.link_source_id, link.link_from_start, link.link_target_id, link.link_to_start);\n\t\tif(className)\n\t\t\tcss.push(className);\n\n\t\tvar html = \"\" +\n\t\t\tgantt.templates.drag_link(link.link_source_id, link.link_from_start, link.link_target_id, link.link_to_start) +\n\t\t\t\"
\";\n\t\tmarker.innerHTML = html;\n\t}\n\n\tfunction advanceMarker(marker, pos){\n\t\tmarker.style.left = pos.x + 5 + \"px\";\n\t\tmarker.style.top = pos.y + 5 + \"px\";\n\t}\n\n\tfunction resetDndState(){\n\t\t_link_source_task =\n\t\t\t_link_source_task_start =\n\t\t\t\t_link_target_task = null;\n\t\t_link_target_task_start = true;\n\t}\n\tfunction showDirectingLine(s_x, s_y, e_x, e_y){\n\t\tvar div = getDirectionLine();\n\n\t\tvar link = getDndState();\n\n\t\tvar css = [\"gantt_link_direction\"];\n\t\tif(gantt.templates.link_direction_class){\n\t\t\tcss.push(gantt.templates.link_direction_class(link.link_source_id, link.link_from_start, link.link_target_id, link.link_to_start));\n\t\t}\n\n\t\tvar dist =Math.sqrt( (Math.pow(e_x - s_x, 2)) + (Math.pow(e_y - s_y, 2)) );\n\t\tdist = Math.max(0, dist - 3);\n\t\tif(!dist)\n\t\t\treturn;\n\n\t\tdiv.className = css.join(\" \");\n\t\tvar tan = (e_y - s_y)/(e_x - s_x),\n\t\t\tangle = Math.atan(tan);\n\n\t\tif(coordinateCircleQuarter(s_x, e_x, s_y, e_y) == 2){\n\t\t\tangle += Math.PI;\n\t\t}else if(coordinateCircleQuarter(s_x, e_x, s_y, e_y) == 3){\n\t\t\tangle -= Math.PI;\n\t\t}\n\n\n\n\t\tvar sin = Math.sin(angle),\n\t\t\tcos = Math.cos(angle),\n\t\t\ttop = Math.round(s_y),\n\t\t\tleft = Math.round(s_x);\n\n\n\t\tvar style = [\n\t\t\t\"-webkit-transform: rotate(\"+angle+\"rad)\",\n\t\t\t\"-moz-transform: rotate(\"+angle+\"rad)\",\n\t\t\t\"-ms-transform: rotate(\"+angle+\"rad)\",\n\t\t\t\"-o-transform: rotate(\"+angle+\"rad)\",\n\t\t\t\"transform: rotate(\"+angle+\"rad)\",\n\t\t\t\"width:\" + Math.round(dist) + \"px\"\n\t\t];\n\n\t\tif(window.navigator.userAgent.indexOf(\"MSIE 8.0\") != -1){\n\t\t\t//ms-filter breaks styles in ie9, so add it only for 8th\n\t\t\tstyle.push(\"-ms-filter: \\\"\" + ieTransform(sin, cos) + \"\\\"\");\n\n\t\t\tvar shiftLeft = Math.abs(Math.round(s_x - e_x)),\n\t\t\t\tshiftTop = Math.abs(Math.round(e_y - s_y));\n\t\t\t//fix rotation axis\n\t\t\tswitch(coordinateCircleQuarter(s_x, e_x, s_y, e_y)){\n\t\t\t\tcase 1:\n\t\t\t\t\ttop -= shiftTop;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tleft -= shiftLeft;\n\t\t\t\t\ttop -= shiftTop;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tleft -= shiftLeft;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t\tstyle.push(\"top:\" + top + \"px\");\n\t\tstyle.push(\"left:\" + left + \"px\");\n\n\t\tdiv.style.cssText = style.join(\";\");\n\t}\n\n\tfunction ieTransform(sin, cos){\n\t\treturn \"progid:DXImageTransform.Microsoft.Matrix(\"+\n\t\t\t\"M11 = \"+cos+\",\"+\n\t\t\t\"M12 = -\"+sin+\",\"+\n\t\t\t\"M21 = \"+sin+\",\"+\n\t\t\t\"M22 = \"+cos+\",\"+\n\t\t\t\"SizingMethod = 'auto expand'\"+\n\t\t\")\";\n\t}\n\tfunction coordinateCircleQuarter(sX, eX, sY, eY){\n\t\tif(eX >= sX){\n\t\t\tif(eY <= sY){\n\t\t\t\treturn 1;\n\t\t\t}else{\n\t\t\t\treturn 4;\n\t\t\t}\n\t\t}else{\n\t\t\tif(eY <= sY){\n\t\t\t\treturn 2;\n\t\t\t}else{\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}\n\n\t}\n\tfunction getDirectionLine(){\n\t\tif(!dnd._direction){\n\t\t\tdnd._direction = document.createElement(\"div\");\n\t\t\ttimeline.$task_links.appendChild(dnd._direction);\n\t\t}\n\t\treturn dnd._direction;\n\t}\n\tfunction removeDirectionLine(){\n\t\tif(dnd._direction){\n\t\t\tif (dnd._direction.parentNode)\t//the event line can be detached because of data refresh\n\t\t\t\tdnd._direction.parentNode.removeChild(dnd._direction);\n\n\t\t\tdnd._direction = null;\n\t\t}\n\t}\n};\n\nmodule.exports = {\n\tcreateLinkDND: function(){\n\t\treturn {\n\t\t\tinit: initLinksDND\n\t\t};\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/timeline/links_dnd.js\n// module id = 53\n// module chunks = 0","var initializer = (function() {\n\treturn function (gantt) {\n\t\treturn {\n\n\t\t\tgetVerticalScrollbar: function(){\n\t\t\t\treturn gantt.$ui.getView(\"scrollVer\");\n\t\t\t},\n\t\t\tgetHorizontalScrollbar: function(){\n\t\t\t\treturn gantt.$ui.getView(\"scrollHor\");\n\t\t\t},\n\n\t\t\t_legacyGridResizerClass: function(layout){\n\t\t\t\tvar resizers = layout.getCellsByType(\"resizer\");\n\t\t\t\tfor(var i = 0; i < resizers.length; i++){\n\t\t\t\t\tvar r = resizers[i];\n\t\t\t\t\tvar gridResizer = false;\n\n\t\t\t\t\tvar prev = r.$parent.getPrevSibling(r.$id);\n\t\t\t\t\tif(prev && prev.$config && prev.$config.id === \"grid\"){\n\t\t\t\t\t\tgridResizer= true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tvar next = r.$parent.getNextSibling(r.$id);\n\t\t\t\t\t\tif(next && next.$config && next.$config.id === \"grid\"){\n\t\t\t\t\t\t\tgridResizer= true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(gridResizer){\n\t\t\t\t\t\tr.$config.css = (r.$config.css ? r.$config.css + \" \" : \"\") + \"gantt_grid_resize_wrap\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tonCreated: function (layout) {\n\t\t\t\tvar first = true;\n\n\t\t\t\tthis._legacyGridResizerClass(layout);\n\n\t\t\t\tlayout.attachEvent(\"onBeforeResize\", function(){\n\t\t\t\t\tvar mainTimeline = gantt.$ui.getView(\"timeline\");\n\t\t\t\t\tif(mainTimeline)\n\t\t\t\t\t\tmainTimeline.$config.hidden = mainTimeline.$parent.$config.hidden = !gantt.config.show_chart;\n\n\t\t\t\t\tvar mainGrid = gantt.$ui.getView(\"grid\");\n\t\t\t\t\tif(!mainGrid)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tvar showGrid = gantt.config.show_grid;\n\t\t\t\t\tif(first) {\n\t\t\t\t\t\tvar colsWidth = mainGrid._getColsTotalWidth();\n\t\t\t\t\t\tif(colsWidth !== false){\n\t\t\t\t\t\t\tgantt.config.grid_width = colsWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tshowGrid = showGrid && !!gantt.config.grid_width;\n\t\t\t\t\t\tgantt.config.show_grid = showGrid;\n\t\t\t\t\t}\n\t\t\t\t\tmainGrid.$config.hidden = mainGrid.$parent.$config.hidden = !showGrid;\n\n\t\t\t\t\tif(!mainGrid.$config.hidden){\n\t\t\t\t\t\t/* restrict grid width due to min_width, max_width, min_grid_column_width */\n\t\t\t\t\t\tvar grid_limits = mainGrid._getGridWidthLimits();\n\t\t\t\t\t\tif (grid_limits[0] && gantt.config.grid_width < grid_limits[0])\n\t\t\t\t\t\t\tgantt.config.grid_width = grid_limits[0];\n\t\t\t\t\t\tif (grid_limits[1] && gantt.config.grid_width > grid_limits[1])\n\t\t\t\t\t\t\tgantt.config.grid_width = grid_limits[1];\n\t\t\t\t\t\t\n\t\t\t\t\t\tmainGrid.$config.width = gantt.config.grid_width - 1;\n\t\t\t\t\t\tif(!first){\n\t\t\t\t\t\t\tmainGrid.$parent._setContentSize(mainGrid.$config.width, mainGrid.$config.height);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tmainGrid.$parent.$config.width = gantt.config.grid_width;\n\n\t\t\t\t\t\t\tif(mainGrid.$parent.$config.group){\n\t\t\t\t\t\t\t\tgantt.$layout._syncCellSizes(mainGrid.$parent.$config.group, mainGrid.$parent.$config.width);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfirst = false;\n\n\t\t\t\t});\n\n\t\t\t\tgantt._getVerticalScrollbar = this.getVerticalScrollbar;\n\t\t\t\tgantt._getHorizontalScrollbar = this.getHorizontalScrollbar;\n\n\t\t\t\tvar vertical = this.getVerticalScrollbar();\n\t\t\t\tvar horizontal = this.getHorizontalScrollbar();\n\t\t\t\tif(vertical){\n\t\t\t\t\tvertical.attachEvent(\"onScroll\", function(oldPos, newPos, dir){\n\t\t\t\t\t\tvar scrollState = gantt.getScrollState();\n\t\t\t\t\t\tgantt.callEvent(\"onGanttScroll\", [scrollState.x, oldPos, scrollState.x, newPos]);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif(horizontal){\n\t\t\t\t\thorizontal.attachEvent(\"onScroll\", function(oldPos, newPos, dir){\n\t\t\t\t\t\tvar scrollState = gantt.getScrollState();\n\t\t\t\t\t\tgantt.callEvent(\"onGanttScroll\", [oldPos, scrollState.y, newPos, scrollState.y]);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tlayout.attachEvent(\"onResize\", function(){\n\t\t\t\t\tif(vertical && !gantt.$scroll_ver){\n\t\t\t\t\t\tgantt.$scroll_ver = vertical.$scroll_ver;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(horizontal && !gantt.$scroll_hor){\n\t\t\t\t\t\tgantt.$scroll_hor = horizontal.$scroll_hor;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t},\n\t\t\tonInitialized: function (layout) {\n\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\n\t\t\t\tif(!(grid && grid.$parent && grid.$parent.$parent && grid.$parent.$parent._xLayout)){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar parent = grid.$parent.$parent;\n\n\t\t\t\t//TODO: can't bind resizer to a grid in complex layouts\n\t\t\t\tvar next = parent.getNextSibling(grid.$parent.$id);\n\t\t\t\tvar gridFirst = true;\n\t\t\t\tif(!(next && next.$name == \"resizer\")){\n\t\t\t\t\tnext = parent.getPrevSibling(grid.$parent.$id);\n\t\t\t\t\tgridFirst = false;\n\t\t\t\t}\n\t\t\t\t// expose grid resize events\n\t\t\t\tif(next && next.$name == \"resizer\"){\n\t\t\t\t\tvar initialWidth;\n\t\t\t\t\tnext.attachEvent(\"onResizeStart\", function(prevCellWidth, nextCellWidth){\n\n\t\t\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\n\t\t\t\t\t\tvar viewCell = grid ? grid.$parent : null;\n\t\t\t\t\t\tif(viewCell){\n\t\t\t\t\t\t\tvar limits = grid._getGridWidthLimits();\n\n\t\t\t\t\t\t\t// min grid width is defined by min widths of its columns, unless grid has horizontal scroll\n\t\t\t\t\t\t\tif(!grid.$config.scrollable)\n\t\t\t\t\t\t\t\tviewCell.$config.minWidth = limits[0];\n\n\t\t\t\t\t\t\tviewCell.$config.maxWidth = limits[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinitialWidth = gridFirst ? prevCellWidth : nextCellWidth;\n\t\t\t\t\t\treturn gantt.callEvent(\"onGridResizeStart\", [initialWidth]);\n\t\t\t\t\t});\n\t\t\t\t\tnext.attachEvent(\"onResize\", function(newBehindSize, newFrontSize){\n\t\t\t\t\t\tvar newSize = gridFirst ? newBehindSize : newFrontSize;\n\t\t\t\t\t\treturn gantt.callEvent(\"onGridResize\", [initialWidth, newSize]);\n\t\t\t\t\t});\n\t\t\t\t\tnext.attachEvent(\"onResizeEnd\", function(oldBackSize, oldFrontSize, newBackSize, newFrontSize){\n\n\t\t\t\t\t\tvar oldSize = gridFirst ? oldBackSize : oldFrontSize;\n\t\t\t\t\t\tvar newSize = gridFirst ? newBackSize : newFrontSize;\n\t\t\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\n\t\t\t\t\t\tvar viewCell = grid ? grid.$parent : null;\n\t\t\t\t\t\tif(viewCell){\n\t\t\t\t\t\t\tviewCell.$config.minWidth = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar res = gantt.callEvent(\"onGridResizeEnd\", [oldSize, newSize]);\n\t\t\t\t\t\tif(res){\n\t\t\t\t\t\t\tgantt.config.grid_width = newSize;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t},\n\t\t\tonDestroyed: function (timeline) {\n\n\t\t\t}\n\t\t};\n\t};\n})();\n\nmodule.exports = initializer;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/ui/main_layout_initializer.js\n// module id = 54\n// module chunks = 0","module.exports = function(gantt) {\n\tdelete gantt.addTaskLayer;\n\tdelete gantt.addLinkLayer;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/data_task_layers.gpl.js\n// module id = 55\n// module chunks = 0","var utils = require(\"../../utils/utils\");\nvar facadeFactory = require(\"./../facades/datastore\");\nvar calculateScaleRange = require(\"../gantt_data_range\");\nfunction initDataStores(gantt){\n\n\tvar facade = facadeFactory.create();\n\tutils.mixin(gantt, facade);\n\tvar tasksStore = gantt.createDatastore({\n\t\tname: \"task\",\n\t\ttype: \"treeDatastore\",\n\t\trootId: function(){return gantt.config.root_id;},\n\t\tinitItem: utils.bind(_init_task, gantt)\n\t});\n\n\tvar linksStore = gantt.createDatastore({\n\t\tname: \"link\",\n\t\tinitItem: utils.bind(_init_link, gantt)\n\t});\n\n\ttasksStore.attachEvent(\"onBeforeRefreshAll\", function(){\n\n\t\tvar order = tasksStore.getVisibleItems();\n\n\t\tfor(var i=0; i < order.length; i++){\n\t\t\tvar item = order[i];\n\t\t\titem.$index = i;\n\t\t\tgantt.resetProjectDates(item);\n\t\t}\n\n\t});\n\n\ttasksStore.attachEvent(\"onFilterItem\", function(id, task){\n\t\tvar min = null, max = null;\n\t\tif (gantt.config.start_date && gantt.config.end_date) {\n\t\t\tif (gantt._isAllowedUnscheduledTask(task)) return true;\n\t\t\tmin = gantt.config.start_date.valueOf();\n\t\t\tmax = gantt.config.end_date.valueOf();\n\n\t\t\tif (+task.start_date > max || +task.end_date < +min)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\ttasksStore.attachEvent(\"onIdChange\", function(oldId, newId){\n\t\tgantt._update_flags(oldId, newId);\n\t});\n\n\ttasksStore.attachEvent(\"onAfterUpdate\", function(id){\n\t\tgantt._update_parents(id);\n\t});\n\n\ttasksStore.attachEvent(\"onAfterItemMove\", function(sid, parent, tindex){\n\t\tvar source = gantt.getTask(sid);\n\n\t\tif(this.getNextSibling(sid) !== null){\n\t\t\tsource.$drop_target = this.getNextSibling(sid);\n\t\t} else if(this.getPrevSibling(sid) !== null){\n\t\t\tsource.$drop_target = \"next:\" + this.getPrevSibling(sid);\n\t\t}else{\n\t\t\tsource.$drop_target = \"next:null\";\n\t\t}\n\n\t\treturn true;\n\t});\n\n\ttasksStore.attachEvent(\"onStoreUpdated\", function(id, item, action){\n\t\tif(action == \"delete\"){\n\t\t\tgantt._update_flags(id, null);\n\t\t}\n\n\t\tvar state = gantt.$services.getService(\"state\");\n\t\tif(state.getState(\"batchUpdate\").batch_update){\n\t\t\treturn;\n\t\t}\n\n\t\tif(gantt.config.fit_tasks && action !== \"paint\"){\n\t\t\tvar oldState = gantt.getState();\n\t\t\tcalculateScaleRange(gantt);\n\t\t\tvar newState = gantt.getState();\n\n\t\t\t//this._init_tasks_range();\n\t\t\tif (+oldState.min_date != +newState.min_date || +oldState.max_date != +newState.max_date) {\n\t\t\t\tgantt.render();\n\n\t\t\t\tgantt.callEvent(\"onScaleAdjusted\", []);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}\n\n\t\tif(action == \"add\" || action == \"move\" || action == \"delete\"){\n\t\t\tgantt.$layout.resize();\n\t\t}else if(!id){\n\t\t\tlinksStore.refresh();\n\t\t}\n\n\t});\n\n\tlinksStore.attachEvent(\"onAfterAdd\", function(id, link){\n\t\tsync_link(link);\n\t});\n\tlinksStore.attachEvent(\"onAfterUpdate\", function(id, link){\n\t\tsync_links();\n\t});\n\tlinksStore.attachEvent(\"onAfterDelete\", function(id, link){\n\t\tsync_link_delete(link);\n\t});\n\tlinksStore.attachEvent(\"onIdChange\", function(oldId, newId){\n\t\tsync_link_delete(gantt.mixin({id:oldId}, gantt.$data.linksStore.getItem(newId)));\n\t\tsync_link(gantt.$data.linksStore.getItem(newId));\n\t});\n\n\tlinksStore.attachEvent(\"onFilterItem\", function(id, link){\n\t\tif (!gantt.config.show_links) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!(gantt.isTaskVisible(link.source) && gantt.isTaskVisible(link.target)) ||\n\t\t\tgantt._isAllowedUnscheduledTask(gantt.getTask(link.source)) || gantt._isAllowedUnscheduledTask(gantt.getTask(link.target)))\n\t\t\treturn false;\n\n\t\treturn gantt.callEvent(\"onBeforeLinkDisplay\", [id, link]);\n\t});\n\n\n\t(function(){\n\t\t// delete all connected links after task is deleted\n\t\tvar treeHelper = require(\"../../utils/task_tree_helpers\");\n\t\tvar deletedLinks = {};\n\n\t\tgantt.attachEvent(\"onBeforeTaskDelete\", function(id, item){\n \t\t\tdeletedLinks[id] = treeHelper.getSubtreeLinks(gantt, id);\n\t\t\treturn true;\n\t\t});\n\n\t\tgantt.attachEvent(\"onAfterTaskDelete\", function(id, item) {\n\t\t\tif(deletedLinks[id]){\n\t\t\t\tgantt.$data.linksStore.silent(function(){\n\t\t\t\t\tfor(var i in deletedLinks[id]){\n\t\t\t\t\t\tgantt.$data.linksStore.removeItem(i);\n\t\t\t\t\t\tsync_link_delete(deletedLinks[id][i]);\n\t\t\t\t\t}\n\n\t\t\t\t\tdeletedLinks[id] = null;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t})();\n\n\tgantt.attachEvent(\"onAfterLinkDelete\", function(id, link) {\n\t\tgantt.refreshTask(link.source);\n\t\tgantt.refreshTask(link.target);\n\t});\n\n\tgantt.attachEvent(\"onParse\", sync_links);\n\n\tmapEvents({\n\t\tsource: linksStore,\n\t\ttarget: gantt,\n\t\tevents:{\n\t\t\t\"onItemLoading\":\"onLinkLoading\",\n\t\t\t\"onBeforeAdd\":\"onBeforeLinkAdd\",\n\t\t\t\"onAfterAdd\":\"onAfterLinkAdd\",\n\t\t\t\"onBeforeUpdate\":\"onBeforeLinkUpdate\",\n\t\t\t\"onAfterUpdate\":\"onAfterLinkUpdate\",\n\t\t\t\"onBeforeDelete\":\"onBeforeLinkDelete\",\n\t\t\t\"onAfterDelete\":\"onAfterLinkDelete\",\n\t\t\t\"onIdChange\":\"onLinkIdChange\"\n\t\t}\n\t});\n\n\tmapEvents({\n\t\tsource: tasksStore,\n\t\ttarget: gantt,\n\t\tevents:{\n\t\t\t\"onItemLoading\":\"onTaskLoading\",\n\t\t\t\"onBeforeAdd\":\"onBeforeTaskAdd\",\n\t\t\t\"onAfterAdd\":\"onAfterTaskAdd\",\n\t\t\t\"onBeforeUpdate\":\"onBeforeTaskUpdate\",\n\t\t\t\"onAfterUpdate\":\"onAfterTaskUpdate\",\n\t\t\t\"onBeforeDelete\":\"onBeforeTaskDelete\",\n\t\t\t\"onAfterDelete\":\"onAfterTaskDelete\",\n\t\t\t\"onIdChange\":\"onTaskIdChange\",\n\t\t\t\"onBeforeItemMove\":\"onBeforeTaskMove\",\n\t\t\t\"onAfterItemMove\":\"onAfterTaskMove\",\n\t\t\t\"onFilterItem\":\"onBeforeTaskDisplay\",\n\t\t\t\"onItemOpen\":\"onTaskOpened\",\n\t\t\t\"onItemClose\":\"onTaskClosed\",\n\t\t\t\"onBeforeSelect\":\"onBeforeTaskSelected\",\n\t\t\t\"onAfterSelect\":\"onTaskSelected\",\n\t\t\t\"onAfterUnselect\":\"onTaskUnselected\"\n\t\t}\n\t});\n\n\tgantt.$data = {\n\t\ttasksStore: tasksStore,\n\t\tlinksStore: linksStore\n\t};\n\n\tfunction sync_link(link){\n\t\tif(gantt.isTaskExists(link.source)){\n\t\t\tvar sourceTask = gantt.getTask(link.source);\n\t\t\tsourceTask.$source = sourceTask.$source || [];\n\t\t\tsourceTask.$source.push(link.id);\n\t\t}\n\t\tif(gantt.isTaskExists(link.target)){\n\t\t\tvar targetTask = gantt.getTask(link.target);\n\t\t\ttargetTask.$target = targetTask.$target || [];\n\t\t\ttargetTask.$target.push(link.id);\n\t\t}\n\t}\n\n\tfunction sync_link_delete(link){\n\t\tif(gantt.isTaskExists(link.source)){\n\t\t\tvar sourceTask = gantt.getTask(link.source);\n\t\t\tfor(var i = 0; i < sourceTask.$source.length; i++){\n\t\t\t\tif(sourceTask.$source[i] == link.id){\n\t\t\t\t\tsourceTask.$source.splice(i, 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(gantt.isTaskExists(link.target)){\n\t\t\tvar targetTask = gantt.getTask(link.target);\n\t\t\tfor(var i = 0; i < targetTask.$target.length; i++){\n\t\t\t\tif(targetTask.$target[i] == link.id){\n\t\t\t\t\ttargetTask.$target.splice(i, 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction sync_links() {\n\t\tvar task = null;\n\t\tvar tasks = gantt.$data.tasksStore.getItems();\n\n\t\tfor(var i = 0, len = tasks.length; i < len; i++){\n\t\t\ttask = tasks[i];\n\t\t\ttask.$source = [];\n\t\t\ttask.$target = [];\n\t\t}\n\n\t\tvar links = gantt.$data.linksStore.getItems();\n\t\tfor (var i = 0, len = links.length; i < len; i++) {\n\n\t\t\tvar link = links[i];\n\t\t\tsync_link(link);\n\t\t}\n\t}\n\n\tfunction mapEvents(conf){\n\t\tvar mapFrom = conf.source;\n\t\tvar mapTo = conf.target;\n\t\tfor(var i in conf.events){\n\t\t\t(function(sourceEvent, targetEvent){\n\t\t\t\tmapFrom.attachEvent(sourceEvent, function(){\n\t\t\t\t\treturn mapTo.callEvent(targetEvent, Array.prototype.slice.call(arguments));\n\t\t\t\t}, targetEvent);\n\t\t\t})(i, conf.events[i]);\n\t\t}\n\t}\n\n\tfunction _init_task(task) {\n\t\tif (!this.defined(task.id))\n\t\t\ttask.id = this.uid();\n\n\t\tif (task.start_date)\n\t\t\ttask.start_date = gantt.date.parseDate(task.start_date, \"xml_date\");\n\t\tif (task.end_date)\n\t\t\ttask.end_date = gantt.date.parseDate(task.end_date, \"xml_date\");\n\n\n\t\tvar duration = null;\n\t\tif (task.duration || task.duration === 0) {\n\t\t\ttask.duration = duration = task.duration * 1;\n\t\t}\n\n\t\tif (duration) {\n\t\t\tif (task.start_date && !task.end_date) {\n\t\t\t\ttask.end_date = this.calculateEndDate(task);\n\t\t\t} else if (!task.start_date && task.end_date) {\n\t\t\t\ttask.start_date = this.calculateEndDate({\n\t\t\t\t\tstart_date: task.end_date,\n\t\t\t\t\tduration: -task.duration,\n\t\t\t\t\ttask: task\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\n\t\tif (this._isAllowedUnscheduledTask(task)) {\n\t\t\tthis._set_default_task_timing(task);\n\t\t}\n\t\tthis._init_task_timing(task);\n\t\tif (task.start_date && task.end_date)\n\t\t\tthis.correctTaskWorkTime(task);\n\n\t\ttask.$source = [];\n\t\ttask.$target = [];\n\t\tif (task.parent === undefined) {\n\t\t\tthis.setParent(task, this.config.root_id);\n\t\t}\n\n\t\treturn task;\n\t}\n\n\tfunction _init_link(link) {\n\t\tif (!this.defined(link.id))\n\t\t\tlink.id = this.uid();\n\t\treturn link;\n\t}\n}\n\n\nmodule.exports = initDataStores;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/datastore/datastore_hooks.js\n// module id = 56\n// module chunks = 0","var utils = require(\"../../utils/utils\");\nvar createTasksFacade = require(\"./datastore_tasks\"),\n\tcreateLinksFacade = require(\"./datastore_links\"),\n\tDataStore = require(\"../datastore/datastore\"),\n\tTreeDataStore = require(\"../datastore/treedatastore\"),\n\tcreateDatastoreSelect = require(\"../datastore/select\");\nvar datastoreRender = require(\"../datastore/datastore_render\");\n\nfunction getDatastores(){\n\tvar storeNames = this.$services.getService(\"datastores\");\n\tvar res = [];\n\tfor(var i = 0; i < storeNames.length; i++){\n\t\tres.push(this.getDatastore(storeNames[i]));\n\t}\n\treturn res;\n}\n\nvar createDatastoreFacade = function(){\n\treturn {\n\tcreateDatastore: function(config){\n\n\t\tvar $StoreType = (config.type || \"\").toLowerCase() == \"treedatastore\" ? TreeDataStore : DataStore;\n\n\t\tif(config){\n\t\t\tvar self = this;\n\t\t\tconfig.openInitially = function(){ return self.config.open_tree_initially; };\n\t\t}\n\n\t\tvar store = new $StoreType(config);\n\t\tthis.mixin(store, createDatastoreSelect());\n\n\t\tif(config.name){\n\n\t\t\tthis.$services.setService(\"datastore:\" + config.name, function(){return store;});\n\t\t\tvar storeList = this.$services.getService(\"datastores\");\n\t\t\tif(!storeList){\n\t\t\t\tstoreList = [];\n\t\t\t\tthis.$services.setService(\"datastores\", function(){return storeList;});\n\t\t\t}\n\t\t\tstoreList.push(config.name);\n\n\t\t\tdatastoreRender.bindDataStore(config.name, this);\n\t\t}\n\n\t\treturn store;\n\t},\n\tgetDatastore: function(name){\n\t\treturn this.$services.getService(\"datastore:\" + name);\n\t},\n\n\trefreshData: function () {\n\t\tvar scrollState = this.getScrollState();\n\t\tthis.callEvent(\"onBeforeDataRender\", []);\n\n\t\tvar stores = getDatastores.call(this);\n\t\tfor(var i = 0; i < stores.length; i++){\n\t\t\tstores[i].refresh();\n\t\t}\n\n\t\tif(scrollState.x || scrollState.y){\n\t\t\tthis.scrollTo(scrollState.x, scrollState.y);\n\t\t}\n\t\tthis.callEvent(\"onDataRender\", []);\n\t},\n\n\tisChildOf: function(childId, parentId){\n\t\treturn this.$data.tasksStore.isChildOf(childId, parentId);\n\t},\n\n\trefreshTask: function (taskId, refresh_links) {\n\t\tvar task = this.getTask(taskId);\n\t\tif (task && this.isTaskVisible(taskId)) {\n\n\t\t\tthis.$data.tasksStore.refresh(taskId, !!this.getState().drag_id);// do quick refresh during drag and drop\n\n\t\t\tif (refresh_links !== undefined && !refresh_links)\n\t\t\t\treturn;\n\t\t\tfor (var i = 0; i < task.$source.length; i++) {\n\t\t\t\tthis.refreshLink(task.$source[i]);\n\t\t\t}\n\t\t\tfor (var i = 0; i < task.$target.length; i++) {\n\t\t\t\tthis.refreshLink(task.$target[i]);\n\t\t\t}\n\t\t}\n\n\t},\n\trefreshLink: function (linkId) {\n\t\tthis.$data.linksStore.refresh(linkId);\n\t},\n\n\tsilent: function(code){\n\t\tvar gantt = this;\n\t\tgantt.$data.tasksStore.silent(function(){\n\t\t\tgantt.$data.linksStore.silent(function(){\n\t\t\t\tcode();\n\t\t\t});\n\t\t});\n\t},\n\n\tclearAll: function () {\n\t\tvar stores = getDatastores.call(this);\n\t\tfor(var i = 0; i < stores.length; i++){\n\t\t\tstores[i].clearAll();\n\t\t}\n\n\t\tthis._update_flags();\n\t\tthis.userdata = {};\n\t\tthis.callEvent(\"onClear\", []);\n\t\tthis.render();\n\t},\n\t_clear_data: function () {\n\t\tthis.$data.tasksStore.clearAll();\n\t\tthis.$data.linksStore.clearAll();\n\t\tthis._update_flags();\n\t\tthis.userdata = {};\n\t},\n\n\tselectTask: function(id){\n\t\tvar store = this.$data.tasksStore;\n\t\tif(!this.config.select_task)\n\t\t\treturn false;\n\t\tif (id){\n\n\t\t\tstore.select(id);\n\t\t}\n\t\treturn store.getSelectedId();\n\t},\n\tunselectTask: function(id){\n\t\tvar store = this.$data.tasksStore;\n\t\tstore.unselect(id);\n\t},\n\tgetSelectedId: function() {\n\t\treturn this.$data.tasksStore.getSelectedId();\n\t}\n};\n};\n\nfunction createFacade(){\n\tvar res = utils.mixin({}, createDatastoreFacade());\n\tutils.mixin(res, createTasksFacade());\n\tutils.mixin(res, createLinksFacade());\n\treturn res;\n}\n\n\n\n\nmodule.exports = {create: createFacade};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/facades/datastore.js\n// module id = 57\n// module chunks = 0","var utils = require(\"../../utils/utils\");\n\nvar createTasksDatastoreFacade = function(){\n\treturn {\n\tgetTask: function (id) {\n\t\tthis.assert(id, \"Invalid argument for gantt.getTask\");\n\t\tvar task = this.$data.tasksStore.getItem(id);\n\t\tthis.assert(task, \"Task not found id=\" + id);\n\t\treturn task;\n\t},\n\tgetTaskByTime: function (from, to) {\n\t\tvar p = this.$data.tasksStore.getItems();\n\n\t\tvar res = [];\n\n\t\tif (!(from || to)) {\n\t\t\tres = p;\n\t\t} else {\n\t\t\tfrom = +from || -Infinity;\n\t\t\tto = +to || Infinity;\n\t\t\tfor (var t = 0; t < p.length; t++){\n\t\t\t\tvar task = p[t];\n\t\t\t\tif (+task.start_date < to && +task.end_date > from)\n\t\t\t\t\tres.push(task);\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t},\n\tisTaskExists: function (id) {\n\t\treturn this.$data.tasksStore.exists(id);\n\t},\n\tupdateTask: function (id, item) {\n\t\tif (!utils.defined(item)) item = this.getTask(id);\n\t\tthis.$data.tasksStore.updateItem(id, item);\n\t\tthis.refreshTask(id);\n\t},\n\taddTask: function (item, parent, index) {\n\t\tif (!utils.defined(item.id))\n\t\t\titem.id = utils.uid();\n\n\t\tif (!utils.defined(parent)) parent = this.getParent(item) || 0;\n\t\tif (!this.isTaskExists(parent)) parent = 0;\n\t\tthis.setParent(item, parent);\n\n\t\treturn this.$data.tasksStore.addItem(item, index, parent);\n\t},\n\tdeleteTask: function (id) {\n\t\treturn this.$data.tasksStore.removeItem(id);\n\t},\n\tgetTaskCount: function () {\n\t\treturn this.$data.tasksStore.count();\n\t},\n\tgetVisibleTaskCount: function () {\n\t\treturn this.$data.tasksStore.countVisible();\n\t},\n\tgetTaskIndex: function (id) {\n\t\treturn this.$data.tasksStore.getBranchIndex(id);\n\t},\n\tgetGlobalTaskIndex: function (id) {\n\t\tthis.assert(id, \"Invalid argument\");\n\t\treturn this.$data.tasksStore.getIndexById(id);\n\t},\n\teachTask: function (code, parent, master) {\n\t\treturn this.$data.tasksStore.eachItem(utils.bind(code, master||this), parent);\n\t},\n\teachParent: function (callback, startTask, master) {\n\t\treturn this.$data.tasksStore.eachParent(utils.bind(callback, master || this), startTask);\n\t},\n\tchangeTaskId: function (oldid, newid) {\n\t\tthis.$data.tasksStore.changeId(oldid, newid);\n\t\tvar task = this.$data.tasksStore.getItem(newid);\n\n\t\tvar links = [];\n\n\t\tif (task.$source) {\n\t\t\tlinks = links.concat(task.$source);\n\t\t}\n\t\tif (task.$target) {\n\t\t\tlinks = links.concat(task.$target);\n\t\t}\n\n\t\tfor (var i = 0; i < links.length; i++) {\n\t\t\tvar link = this.getLink(links[i]);\n\t\t\tif (link.source == oldid) {\n\t\t\t\tlink.source = newid;\n\t\t\t}\n\t\t\tif (link.target == oldid) {\n\t\t\t\tlink.target = newid;\n\t\t\t}\n\t\t}\n\t},\n\tcalculateTaskLevel: function (item) {\n\t\treturn this.$data.tasksStore.calculateItemLevel(item);\n\t},\n\tgetNext: function (id) {\n\t\treturn this.$data.tasksStore.getNext(id);\n\t},\n\tgetPrev: function (id) {\n\t\treturn this.$data.tasksStore.getPrev(id);\n\t},\n\tgetParent: function (id) {\n\t\treturn this.$data.tasksStore.getParent(id);\n\t},\n\tsetParent: function (task, new_pid, silent) {\n\t\treturn this.$data.tasksStore.setParent(task, new_pid, silent);\n\t},\n\tgetSiblings: function (id) {\n\t\treturn this.$data.tasksStore.getSiblings(id).slice();\n\t},\n\tgetNextSibling: function (id) {\n\t\treturn this.$data.tasksStore.getNextSibling(id);\n\t},\n\tgetPrevSibling: function (id) {\n\t\treturn this.$data.tasksStore.getPrevSibling(id);\n\t},\n\tgetTaskByIndex: function(index){\n\t\tvar id = this.$data.tasksStore.getIdByIndex(index);\n\t\tif(this.isTaskExists(id)){\n\t\t\treturn this.getTask(id);\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t},\n\tgetChildren: function (id) {\n\t\treturn this.$data.tasksStore.getChildren(id).slice();\n\t},\n\thasChild: function (id) {\n\t\treturn this.$data.tasksStore.hasChild(id);\n\t},\n\topen: function (id) {\n\t\tthis.$data.tasksStore.open(id);\n\t},\n\tclose: function (id) {\n\t\tthis.$data.tasksStore.close(id);\n\t},\n\tmoveTask: function (sid, tindex, parent) {\n\t\tthis.$data.tasksStore.move.apply(this.$data.tasksStore, arguments);\n\t},\n\tsort: function(field, desc, parent, silent) {\n\t\tvar render = !silent;//4th argument to cancel redraw after sorting\n\t\tthis.$data.tasksStore.sort(field, desc, parent);\n\t\tif (render) {\n\t\t\tthis.render();\n\t\t}\n\t}\n};\n};\n\nmodule.exports = createTasksDatastoreFacade;\n\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/facades/datastore_tasks.js\n// module id = 58\n// module chunks = 0","var utils = require(\"../../utils/utils\");\n\n\nvar createLinksStoreFacade = function(){\n\treturn {\n\tgetLinkCount: function () {\n\t\treturn this.$data.linksStore.count();\n\t},\n\n\tgetLink : function (id) {\n\t\treturn this.$data.linksStore.getItem(id);\n\t},\n\n\tgetLinks : function () {\n\t\treturn this.$data.linksStore.getItems();\n\t},\n\n\tisLinkExists : function (id) {\n\t\treturn this.$data.linksStore.exists(id);\n\t},\n\n\taddLink : function (link) {\n\t\treturn this.$data.linksStore.addItem(link);\n\t},\n\n\tupdateLink : function (id, data) {\n\t\tif (!utils.defined(data))\n\t\t\tdata = this.getLink(id);\n\t\tthis.$data.linksStore.updateItem(id, data);\n\t},\n\n\tdeleteLink : function (id) {\n\t\treturn this.$data.linksStore.removeItem(id);\n\t},\n\n\tchangeLinkId : function (oldid, newid) {\n\t\treturn this.$data.linksStore.changeId(oldid, newid);\n\t}\n};\n};\n\nmodule.exports = createLinksStoreFacade;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/facades/datastore_links.js\n// module id = 59\n// module chunks = 0","var powerArray = require(\"./power_array\");\nvar utils = require(\"../../utils/utils\");\nvar eventable = require(\"../../utils/eventable\");\nvar DataStore = require(\"./datastore\");\n\nvar TreeDataStore = function(config){\n\tthis._branches = {};\n\n\tthis.pull = {};\n\tthis.$initItem = config.initItem;\n\tthis.$parentProperty = config.parentProperty || \"parent\";\n\n\tif(typeof config.rootId !== \"function\"){\n\t\tthis.$getRootId = (function(val){\n\t\t\treturn function(){return val;};\n\t\t})(config.rootId || 0);\n\t}else{\n\t\tthis.$getRootId = config.rootId;\n\t}\n\n\t// TODO: replace with live reference to gantt config\n\tthis.$openInitially = config.openInitially;\n\n\tthis.visibleOrder = powerArray.$create();\n\tthis.fullOrder = powerArray.$create();\n\tthis._searchVisibleOrder = {};\n\tthis._skip_refresh = false;\n\n\teventable(this);\n\n\tthis.attachEvent(\"onFilterItem\", function(id, item){\n\t\tvar open = true;\n\t\tthis.eachParent(function(parent){\n\t\t\topen = open && parent.$open;\n\t\t}, item);\n\t\treturn !!open;\n\t});\n\n\treturn this;\n};\n\nTreeDataStore.prototype = utils.mixin({\n\n\t\t_buildTree: function(data){\n\t\t\tvar item = null;\n\t\t\tvar rootId = this.$getRootId();\n\t\t\tfor (var i = 0, len = data.length; i < len; i++){\n\t\t\t\titem = data[i];\n\t\t\t\tthis.setParent(item, this.getParent(item) || rootId);\n\t\t\t}\n\n\t\t\t// calculating $level for each item\n\t\t\tfor (var i = 0, len = data.length; i < len; i++){\n\t\t\t\titem = data[i];\n\t\t\t\tthis._add_branch(item);\n\t\t\t\titem.$level = this.calculateItemLevel(item);\n\n\t\t\t\tif (!utils.defined(item.$open)) {\n\t\t\t\t\titem.$open = utils.defined(item.open) ? item.open : this.$openInitially();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tthis._updateOrder();\n\t\t},\n\n\t\tparse: function(data){\n\t\t\tthis.callEvent(\"onBeforeParse\", [data]);\n\t\t\tvar loaded = this._parseInner(data);\n\t\t\tthis._buildTree(loaded);\n\t\t\tthis.filter();\n\t\t\tthis.callEvent(\"onParse\", [loaded]);\n\t\t},\n\n\t\t_addItemInner: function(item, index){\n\n\t\t\tvar parent = this.getParent(item);\n\n\t\t\tif(!utils.defined(parent)){\n\t\t\t\tparent = this.$getRootId();\n\t\t\t\tthis.setParent(item, parent);\n\t\t\t}\n\n\t\t\tvar parentIndex = this.getIndexById(parent);\n\t\t\tvar targetIndex = parentIndex + Math.min(Math.max(index, 0), this.visibleOrder.length);\n\n\t\t\tif(targetIndex*1 !== targetIndex){\n\t\t\t\ttargetIndex = undefined;\n\t\t\t}\n\t\t\tDataStore.prototype._addItemInner.call(this, item, targetIndex);\n\t\t\tthis.setParent(item, parent);\n\n\t\t\tif(item.hasOwnProperty(\"$rendered_parent\")){\n\t\t\t\tthis._move_branch(item, item.$rendered_parent);\n\t\t\t}\n\t\t\tthis._add_branch(item, index);\n\t\t},\n\t\t_changeIdInner: function(oldId, newId){\n\n\t\t\tvar children = this.getChildren(newId);\n\t\t\tDataStore.prototype._changeIdInner.call(this, oldId, newId);\n\n\t\t\tvar parent = this.getParent(newId);\n\n\t\t\tthis._replace_branch_child(parent, oldId, newId);\n\t\t\tfor(var i = 0; i < children.length; i++){\n\t\t\t\tthis.setParent(this.getItem[children[i]], newId);\n\t\t\t}\n\t\t},\n\n\t\t_traverseBranches: function(code, parent){\n\t\t\tparent = parent || this.$getRootId();\n\t\t\tvar branch = this._branches[parent];\n\t\t\tif (branch) {\n\t\t\t\tfor (var i = 0; i < branch.length; i++) {\n\t\t\t\t\tvar itemId = branch[i];\n\t\t\t\t\tcode.call(this, itemId);\n\t\t\t\t\tif (this._branches[itemId])\n\t\t\t\t\t\tthis._traverseBranches(code, itemId);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t_updateOrder: function(code){\n\t\t\tif(code)\n\t\t\t\tDataStore.prototype._updateOrder.call(this, code);\n\t\t\tthis.fullOrder = powerArray.$create();\n\t\t\tthis._traverseBranches(function(taskId){\n\t\t\t\tthis.fullOrder.push(taskId);\n\t\t\t});\n\t\t},\n\n\t\t_removeItemInner: function(id){\n\n\t\t\tvar items = [];\n\t\t\tthis.eachItem(function(child){\n\t\t\t\titems.push(child);\n\t\t\t}, id);\n\n\t\t\titems.push(this.getItem(id));\n\n\t\t\tfor(var i = 0; i < items.length; i++){\n\n\t\t\t\tthis._move_branch(items[i], this.getParent(items[i]), null);\n\t\t\t\tDataStore.prototype._removeItemInner.call(this, items[i].id);\n\t\t\t\tthis._move_branch(items[i], this.getParent(items[i].id), null);\n\t\t\t}\n\t\t},\n\n\t\tmove: function(sid, tindex, parent){\n\t\t\t//target id as 4th parameter\n\t\t\tvar id = arguments[3];\n\t\t\tif (id) {\n\t\t\t\tif (id === sid) return;\n\n\t\t\t\tparent = this.getParent(id);\n\t\t\t\ttindex = this.getBranchIndex(id);\n\t\t\t}\n\t\t\tif(sid == parent){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tparent = parent || this.$getRootId();\n\t\t\tvar source = this.getItem(sid);\n\t\t\tvar source_pid = this.getParent(source.id);\n\t\t\tvar sbranch = this.getChildren(this.getParent(source.id));\n\n\t\t\tvar tbranch = this.getChildren(parent);\n\t\t\tif (tindex == -1)\n\t\t\t\ttindex = tbranch.length + 1;\n\t\t\tif (source_pid == parent) {\n\t\t\t\tvar sindex = this.getBranchIndex(sid);\n\t\t\t\tif (sindex == tindex) return;\n\t\t\t}\n\n\t\t\tif(this.callEvent(\"onBeforeItemMove\", [sid, parent, tindex]) === false)\n\t\t\t\treturn;\n\n\t\t\tthis._replace_branch_child(source_pid, sid);\n\t\t\ttbranch = this.getChildren(parent);\n\n\t\t\tvar tid = tbranch[tindex];\n\t\t\tif (!tid) //adding as last element\n\t\t\t\ttbranch.push(sid);\n\t\t\telse\n\t\t\t\ttbranch = tbranch.slice(0, tindex).concat([ sid ]).concat(tbranch.slice(tindex));\n\n\t\t\tthis.setParent(source, parent);\n\t\t\tthis._branches[parent] = tbranch;\n\n\t\t\tvar diff = this.calculateItemLevel(source) - source.$level;\n\t\t\tsource.$level += diff;\n\t\t\tthis.eachItem(function(item){\n\t\t\t\titem.$level += diff;\n\t\t\t}, source.id, this);\n\n\n\t\t\tthis._moveInner(this.getIndexById(sid), this.getIndexById(parent) + tindex);\n\n\t\t\tif(!this.callEvent(\"onAfterItemMove\", [sid, parent, tindex]))\n\t\t\t\treturn;\n\t\t\tthis.refresh();\n\t\t},\n\n\t\tgetBranchIndex: function(id){\n\t\t\tvar branch = this.getChildren(this.getParent(id));\n\t\t\tfor (var i = 0; i < branch.length; i++)\n\t\t\t\tif (branch[i] == id)\n\t\t\t\t\treturn i;\n\n\t\t\treturn -1;\n\t\t},\n\t\thasChild: function(id){\n\t\t\treturn (utils.defined(this._branches[id]) && this._branches[id].length);\n\t\t},\n\t\tgetChildren: function(id){\n\t\t\treturn utils.defined(this._branches[id]) ? this._branches[id] : powerArray.$create();\n\t\t},\n\n\t\tisChildOf: function(childId, parentId){\n\t\t\tif (!this.exists(childId))\n\t\t\t\treturn false;\n\t\t\tif (parentId === this.$getRootId())\n\t\t\t\treturn true;\n\n\t\t\tvar item = this.getItem(childId);\n\t\t\tvar pid = this.getParent(childId);\n\n\t\t\twhile (item && this.exists(pid)) {\n\t\t\t\titem = this.getItem(pid);\n\n\t\t\t\tif (item && item.id == parentId)\n\t\t\t\t\treturn true;\n\t\t\t\tpid = this.getParent(item);\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\n\t\tgetSiblings: function(id){\n\t\t\tif(!this.exists(id)){\n\t\t\t\treturn powerArray.$create();\n\t\t\t}\n\t\t\tvar parent = this.getParent(id);\n\t\t\treturn this.getChildren(parent);\n\n\t\t},\n\t\tgetNextSibling: function(id){\n\t\t\tvar siblings = this.getSiblings(id);\n\t\t\tfor(var i= 0, len = siblings.length; i < len; i++){\n\t\t\t\tif(siblings[i] == id)\n\t\t\t\t\treturn siblings[i+1] || null;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tgetPrevSibling: function(id){\n\t\t\tvar siblings = this.getSiblings(id);\n\t\t\tfor(var i= 0, len = siblings.length; i < len; i++){\n\t\t\t\tif(siblings[i] == id)\n\t\t\t\t\treturn siblings[i-1] || null;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tgetParent: function(id){\n\t\t\tvar item = null;\n\t\t\tif(id.id !== undefined){\n\t\t\t\titem = id;\n\t\t\t}else{\n\t\t\t\titem = this.getItem(id);\n\t\t\t}\n\n\t\t\tvar parent = this.$getRootId();\n\t\t\tif(item){\n\t\t\t\tparent = item[this.$parentProperty];\n\t\t\t}\n\t\t\treturn parent;\n\n\t\t},\n\n\t\tclearAll: function(){\n\t\t\tthis._branches = {};\n\t\t\tDataStore.prototype.clearAll.call(this);\n\t\t},\n\n\t\tcalculateItemLevel: function(item){\n\t\t\tvar level = 0;\n\t\t\tthis.eachParent(function(){\n\t\t\t\tlevel++;\n\t\t\t}, item);\n\t\t\treturn level;\n\t\t},\n\n\t\t_setParentInner: function(item, new_pid, silent){\n\t\t\tif(!silent){\n\t\t\t\tif(item.hasOwnProperty(\"$rendered_parent\")){\n\t\t\t\t\tthis._move_branch(item, item.$rendered_parent, new_pid);\n\t\t\t\t}else{\n\t\t\t\t\tthis._move_branch(item, item[this.$parentProperty], new_pid);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tsetParent: function(item, new_pid, silent){\n\t\t\tthis._setParentInner(item, new_pid, silent);\n\n\t\t\titem[this.$parentProperty] = new_pid;\n\t\t},\n\t\teachItem: function(code, parent){\n\t\t\tparent = parent || this.$getRootId();\n\n\n\t\t\tvar branch = this.getChildren(parent);\n\t\t\tif (branch)\n\t\t\t\tfor (var i=0; i b[field];\n\t\t\t\treturn result ? 1 : -1;\n\t\t\t}) : field;\n\n\t\t\tif (desc) {\n\t\t\t\tvar original_criteria = criteria;\n\t\t\t\tcriteria = function (a, b) {\n\t\t\t\t\treturn original_criteria(b, a);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tvar els = this.getChildren(parent);\n\t\t\tif (els){\n\t\t\t\tvar temp = [];\n\t\t\t\tfor (var i = els.length - 1; i >= 0; i--)\n\t\t\t\t\ttemp[i] = this.getItem(els[i]);\n\n\t\t\t\ttemp.sort(criteria);\n\n\t\t\t\tfor (var i = 0; i < temp.length; i++) {\n\t\t\t\t\tels[i] = temp[i].id;\n\t\t\t\t\tthis.sort(field, desc, els[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tfilter: function(rule){\n\t\t\tfor(var i in this.pull){\n\t\t\t\tif(this.pull[i].$rendered_parent !== this.getParent(this.pull[i])){\n\t\t\t\t\tthis._move_branch(this.pull[i], this.pull[i].$rendered_parent, this.getParent(this.pull[i]));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn DataStore.prototype.filter.apply(this, arguments);\n\t\t},\n\n\t\topen: function(id){\n\t\t\tif(this.exists(id)){\n\t\t\t\tthis.getItem(id).$open = true;\n\t\t\t\tthis.callEvent(\"onItemOpen\", [id]);\n\t\t\t}\n\t\t},\n\n\t\tclose: function(id){\n\t\t\tif(this.exists(id)){\n\t\t\t\tthis.getItem(id).$open = false;\n\t\t\t\tthis.callEvent(\"onItemClose\", [id]);\n\t\t\t}\n\t\t},\n\n\t\tdestructor: function(){\n\t\t\tDataStore.prototype.destructor.call(this);\n\t\t\tthis._branches = null;\n\t\t}\n\t},\n\tDataStore.prototype\n);\n\nmodule.exports = TreeDataStore;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/datastore/treedatastore.js\n// module id = 60\n// module chunks = 0","\nfunction createDataStoreSelectMixin(){\n\tvar selectedId = null;\n\treturn {\n\t\tselect: function(id){\n\t\t\tif (id){\n\n\t\t\t\tif(selectedId == id)\n\t\t\t\t\treturn selectedId;\n\n\t\t\t\tif(!this._skip_refresh) {\n\t\t\t\t\tif (!this.callEvent(\"onBeforeSelect\", [id])) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.unselect();\n\n\t\t\t\tselectedId = id;\n\n\t\t\t\tif(!this._skip_refresh) {\n\t\t\t\t\tthis.refresh(id);\n\t\t\t\t\tthis.callEvent(\"onAfterSelect\", [id]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn selectedId;\n\t\t},\n\t\tgetSelectedId: function(){\n\t\t\treturn selectedId;\n\t\t},\n\t\tunselect: function(id){\n\t\t\tvar id = id || selectedId;\n\t\t\tif(!id)\n\t\t\t\treturn;\n\t\t\tselectedId = null;\n\t\t\tif(!this._skip_refresh){\n\t\t\t\tthis.refresh(id);\n\t\t\t\tthis.callEvent(\"onAfterUnselect\", [id]);\n\t\t\t}\n\t\t}\n\t};\n}\n\nmodule.exports = createDataStoreSelectMixin;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/datastore/select.js\n// module id = 61\n// module chunks = 0","var storeRenderCreator = function(name, gantt){\n\tvar store = gantt.getDatastore(name);\n\n\tvar itemRepainter = {\n\t\trenderItem: function(id, renderer){\n\n\t\t\tvar renders = renderer.getLayers();\n\n\t\t\tvar item = store.getItem(id);\n\t\t\tif(item && store.isVisible(id)) {\n\t\t\t\tfor (var i = 0; i < renders.length; i++)\n\t\t\t\t\trenders[i].render_item(item);\n\t\t\t}\n\t\t},\n\t\trenderItems: function(renderer){\n\t\t\tvar renderers = renderer.getLayers();\n\t\t\tfor (var i = 0; i < renderers.length; i++) {\n\t\t\t\trenderers[i].clear();\n\t\t\t}\n\n\t\t\tvar data = store.getVisibleItems();\n\n\t\t\tfor (var i = 0; i < renderers.length; i++) {\n\t\t\t\trenderers[i].render_items(data);\n\t\t\t}\n\t\t}\n\t};\n\n\tfunction skipRepaint(gantt){\n\t\tvar state = gantt.$services.getService(\"state\");\n\t\tif(state.getState(\"batchUpdate\").batch_update){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tstore.attachEvent(\"onStoreUpdated\", function(id, item, action){\n\t\tif(skipRepaint(gantt)){\n\t\t\treturn;\n\t\t}\n\n\t\tvar renderer = gantt.$services.getService(\"layers\").getDataRender(name);\n\n\t\tif(renderer){\n\t\t\tif(!id || action == \"move\" || action == \"delete\"){\n\t\t\t\tstore.callEvent(\"onBeforeRefreshAll\", []);\n\t\t\t\titemRepainter.renderItems(renderer);\n\t\t\t\tstore.callEvent(\"onAfterRefreshAll\", []);\n\t\t\t}else{\n\t\t\t\tstore.callEvent(\"onBeforeRefreshItem\", [item.id]);\n\t\t\t\titemRepainter.renderItem(item.id, renderer);\n\t\t\t\tstore.callEvent(\"onAfterRefreshItem\", [item.id]);\n\t\t\t}\n\t\t}\n\n\t});\n\n\tstore.attachEvent(\"onItemOpen\", function(){\n\t\tgantt.render();\n\t});\n\n\tstore.attachEvent(\"onItemClose\", function(){\n\t\tgantt.render();\n\t});\n\n\tfunction refreshId(renders, oldId, newId, item) {\n\t\tfor (var i = 0; i < renders.length; i++) {\n\t\t\trenders[i].change_id(oldId, newId);\n\t\t}\n\t}\n\tstore.attachEvent(\"onIdChange\", function(oldId, newId){\n\t\tif(skipRepaint(gantt)){\n\t\t\treturn;\n\t\t}\n\t\tvar renderer = gantt.$services.getService(\"layers\").getDataRender(name);\n\t\trefreshId(renderer.getLayers(), oldId, newId, store.getItem(newId));\n\t});\n\n};\n\nmodule.exports = {\n\tbindDataStore: storeRenderCreator\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/datastore/datastore_render.js\n// module id = 62\n// module chunks = 0","var liveUpdateHooks = require(\"./live_update_hooks\");\nvar dateHelper = require(\"../../utils/date_helpers\");\nvar helpers = require(\"../../utils/helpers\");\n\nfunction addDataProcessorHooks(gantt) {\n\n\tgantt.dataProcessor = require(\"./dataprocessor\");\n\n\tfunction detachDataProcessor(gantt, dp){\n\t\tdelete dp.$gantt;\n\t\tdelete dp.setGanttMode;\n\t\tdelete dp._getRowData;\n\t\tdp.afterUpdate = oldAfterUpdate;\n\n\t\tdelete gantt._dp;\n\t\tdelete gantt._change_id;\n\t\tdelete gantt._row_style;\n\t\tdelete gantt._delete_task;\n\t\tdelete gantt._sendTaskOrder;\n\n\t\thelpers.forEach(dataProcessorHandlers, function(e){\n\t\t\tgantt.detachEvent(e);\n\t\t});\n\t\tdataProcessorHandlers = [];\n\t}\n\n\tvar oldAfterUpdate;\n\tfunction extendDataProcessor(gantt, dp){\n\t\tdp.setGanttMode = function(mode){\n\t\t\tvar modes = dp.modes || {};\n\t\t\tif(dp._ganttMode){\n\t\t\t\tmodes[dp._ganttMode] = {\n\t\t\t\t\t_in_progress : dp._in_progress,\n\t\t\t\t\t_invalid : dp._invalid,\n\t\t\t\t\tupdatedRows : dp.updatedRows\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tvar newState = modes[mode];\n\t\t\tif(!newState){\n\t\t\t\tnewState = modes[mode] = {\n\t\t\t\t\t_in_progress : {},\n\t\t\t\t\t_invalid : {},\n\t\t\t\t\tupdatedRows : []\n\t\t\t\t};\n\t\t\t}\n\t\t\tdp._in_progress = newState._in_progress;\n\t\t\tdp._invalid = newState._invalid;\n\t\t\tdp.updatedRows = newState.updatedRows;\n\t\t\tdp.modes = modes;\n\t\t\tdp._ganttMode = mode;\n\t\t};\n\n\t\toldAfterUpdate = dp.afterUpdate;\n\t\tdp.afterUpdate = function(){\n\t\t\tvar xml;\n\t\t\tif(arguments.length == 3){\n\t\t\t\txml = arguments[1];\n\t\t\t}else{\n\t\t\t\t// old dataprocessor\n\t\t\t\txml = arguments[4];\n\t\t\t}\n\t\t\tvar mode = dp._ganttMode;\n\t\t\tvar reqUrl = xml.filePath;\n\n\t\t\tif(this._tMode != \"REST\"){\n\t\t\t\tif (reqUrl.indexOf(\"gantt_mode=links\") != -1) {\n\t\t\t\t\tmode = \"links\";\n\t\t\t\t}else{\n\t\t\t\t\tmode = \"tasks\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(reqUrl.indexOf(\"/link\") > reqUrl.indexOf(\"/task\")){\n\t\t\t\t\tmode = \"links\";\n\t\t\t\t}else{\n\t\t\t\t\tmode = \"tasks\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp.setGanttMode(mode);\n\n\t\t\tvar res = oldAfterUpdate.apply(dp, arguments);\n\t\t\tdp.setGanttMode(mode);\n\t\t\treturn res;\n\t\t};\n\n\t\tdp._getRowData=gantt.bind(function(id, pref) {\n\t\t\tvar task;\n\t\t\tif (dp._ganttMode == \"tasks\")\n\t\t\t\ttask = this.isTaskExists(id) ? this.getTask(id) : { id: id };\n\t\t\telse\n\t\t\t\ttask = this.isLinkExists(id) ? this.getLink(id) : { id: id };\n\n\t\t\ttask = gantt.copy(task);\n\n\t\t\tvar data = {};\n\t\t\tfor (var key in task) {\n\t\t\t\tif (key.substr(0, 1) == \"$\") continue;\n\t\t\t\tvar value = task[key];\n\t\t\t\tif (dateHelper.isDate(value))\n\t\t\t\t\tdata[key] = this.templates.xml_format(value);\n\t\t\t\telse if(value === null)\n\t\t\t\t\tdata[key] = \"\";\n\t\t\t\telse\n\t\t\t\t\tdata[key] = value;\n\t\t\t}\n\n\t\t\tvar taskTiming = this._get_task_timing_mode(task);\n\t\t\tif(taskTiming.$no_start){\n\t\t\t\ttask.start_date = \"\";\n\t\t\t\ttask.duration = \"\";\n\t\t\t}\n\t\t\tif(taskTiming.$no_end){\n\t\t\t\ttask.end_date = \"\";\n\t\t\t\ttask.duration = \"\";\n\t\t\t}\n\t\t\tdata[dp.action_param] = this.getUserData(id, dp.action_param);\n\t\t\treturn data;\n\t\t}, gantt);\n\t}\n\n\tfunction extendGantt(gantt, dp){\n\t\tgantt._change_id = gantt.bind(function(oldid, newid) {\n\t\t\tif (dp._ganttMode != \"tasks\")\n\t\t\t\tthis.changeLinkId(oldid, newid);\n\t\t\telse\n\t\t\t\tthis.changeTaskId(oldid, newid);\n\t\t}, this);\n\n\t\tgantt._row_style = function(row_id, classname){\n\t\t\tif (dp._ganttMode != \"tasks\") return;\n\t\t\tif(!gantt.isTaskExists(row_id))\n\t\t\t\treturn;\n\n\t\t\tvar task = gantt.getTask(row_id);\n\t\t\ttask.$dataprocessor_class = classname;\n\t\t\tgantt.refreshTask(row_id);\n\t\t};\n\n\t\t// fake method for dataprocessor\n\t\tgantt._delete_task = function(row_id, node){};\n\n\t\tgantt._sendTaskOrder = function(id, item){\n\t\t\tif(item.$drop_target){\n\t\t\t\tdp.setGanttMode(\"tasks\");\n\t\t\t\tthis.getTask(id).target = item.$drop_target;\n\t\t\t\tdp.setUpdated(id, true,\"order\");\n\t\t\t\tdelete this.getTask(id).$drop_target;\n\t\t\t}\n\t\t};\n\n\t\tthis._dp = dp;\n\t}\n\n\tfunction attachDataProcessorEvents(gantt, dp){\n\t\tfunction clientSideDelete(id){\n\t\t\tvar updated = dp.updatedRows.slice();\n\t\t\tvar clientOnly = false;\n\n\t\t\tfor(var i = 0; i < updated.length && !dp._in_progress[id]; i++){\n\t\t\t\tif(updated[i] == id ){\n\t\t\t\t\tif(gantt.getUserData(id, \"!nativeeditor_status\") == \"inserted\"){\n\t\t\t\t\t\tclientOnly = true;\n\t\t\t\t\t}\n\t\t\t\t\tdp.setUpdated(id,false);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn clientOnly;\n\t\t}\n\n\t\tfunction getTaskLinks(task){\n\t\t\tvar links = [];\n\n\t\t\tif (task.$source) {\n\t\t\t\tlinks = links.concat(task.$source);\n\t\t\t}\n\t\t\tif (task.$target) {\n\t\t\t\tlinks = links.concat(task.$target);\n\t\t\t}\n\n\t\t\treturn links;\n\t\t}\n\n\t\tdataProcessorHandlers.push(this.attachEvent(\"onAfterTaskAdd\", function(id, item) {\n\t\t\tdp.setGanttMode(\"tasks\");\n\t\t\tdp.setUpdated(id,true,\"inserted\");\n\t\t}));\n\t\tdataProcessorHandlers.push(this.attachEvent(\"onAfterTaskUpdate\", function(id, item) {\n\t\t\tdp.setGanttMode(\"tasks\");\n\t\t\tdp.setUpdated(id,true);\n\n\t\t\tgantt._sendTaskOrder(id, item);\n\t\t}));\n\n\t\tvar treeHelper = require(\"../../utils/task_tree_helpers\");\n\t\tvar cascadeDelete = {};\n\n\t\tdataProcessorHandlers.push(this.attachEvent(\"onBeforeTaskDelete\", function(id, item){\n\t\t\tif(!gantt.config.cascade_delete){\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tcascadeDelete[id] = {\n\t\t\t\ttasks: treeHelper.getSubtreeTasks(gantt, id),\n\t\t\t\tlinks: treeHelper.getSubtreeLinks(gantt, id)\n\t\t\t};\n\t\t\treturn true;\n\t\t}));\n\n\t\tdataProcessorHandlers.push(this.attachEvent(\"onAfterTaskDelete\", function(id, item) {\n\t\t\tdp.setGanttMode(\"tasks\");\n\n\t\t\t// not send delete request if item is not inserted into the db - just remove it from the client\n\t\t\tvar needDbDelete = !clientSideDelete(id);\n\t\t\tif(!needDbDelete)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tif(gantt.config.cascade_delete && cascadeDelete[id]){\n\t\t\t\tvar dpMode = dp.updateMode;\n\t\t\t\tdp.setUpdateMode(\"off\");\n\n\t\t\t\tvar cascade = cascadeDelete[id];\n\t\t\t\tfor(var i in cascade.tasks){\n\t\t\t\t\tif(!clientSideDelete(i)){\n\t\t\t\t\t\tdp.setUpdated(i, true, \"deleted\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdp.setGanttMode(\"links\");\n\t\t\t\tfor(var i in cascade.links){\n\t\t\t\t\tif(!clientSideDelete(i)){\n\t\t\t\t\t\tdp.setUpdated(i, true, \"deleted\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcascadeDelete[id] = null;\n\n\t\t\t\tif(dpMode != \"off\"){\n\t\t\t\t\tdp.sendAllData();\n\t\t\t\t}\n\t\t\t\tdp.setGanttMode(\"tasks\");\n\n\t\t\t\tdp.setUpdateMode(dpMode);\n\n\t\t\t}\n\n\t\t\tdp.setUpdated(id,true,\"deleted\");\n\n\t\t\tif(dp.updateMode != 'off' && !dp._tSend){\n\t\t\t\tdp.sendAllData();\n\t\t\t}\n\n\t\t}));\n\t\tdataProcessorHandlers.push(this.attachEvent(\"onAfterLinkUpdate\", function(id, item) {\n\t\t\tdp.setGanttMode(\"links\");\n\t\t\tdp.setUpdated(id, true);\n\t\t}));\n\t\tdataProcessorHandlers.push(this.attachEvent(\"onAfterLinkAdd\", function(id, item) {\n\t\t\tdp.setGanttMode(\"links\");\n\t\t\tdp.setUpdated(id, true,\"inserted\");\n\t\t}));\n\t\tdataProcessorHandlers.push(this.attachEvent(\"onAfterLinkDelete\", function(id, item) {\n\t\t\tdp.setGanttMode(\"links\");\n\n\t\t\tvar needDbDelete = !clientSideDelete(id);\n\t\t\tif(!needDbDelete)\n\t\t\t\treturn;\n\n\t\t\tdp.setUpdated(id, true,\"deleted\");\n\t\t}));\n\t\tdataProcessorHandlers.push(this.attachEvent(\"onRowDragEnd\", function(id, target) {\n\t\t\tgantt._sendTaskOrder(id, gantt.getTask(id));\n\t\t}));\n\n\t\tvar tasks = null,\n\t\t\tlinks = null;\n\t\tdataProcessorHandlers.push(this.attachEvent(\"onTaskIdChange\",function(oldId, newId){\n\t\t\tif(!dp._waitMode) return;\n\n\t\t\tvar children = gantt.getChildren(newId);\n\t\t\tif(children.length) {\n\t\t\t\ttasks = tasks || {};\n\n\t\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\t\tvar ch = this.getTask(children[i]);\n\t\t\t\t\ttasks[ch.id] = ch;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar item = this.getTask(newId),\n\t\t\t\titemLinks = getTaskLinks(item);\n\n\t\t\tif(itemLinks.length) {\n\t\t\t\tlinks = links || {};\n\n\t\t\t\tfor (var i = 0; i < itemLinks.length; i++) {\n\t\t\t\t\tvar link = this.getLink(itemLinks[i]);\n\t\t\t\t\tlinks[link.id] = link;\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tdp.attachEvent(\"onAfterUpdateFinish\", function(){\n\t\t\tif(tasks || links){\n\t\t\t\tgantt.batchUpdate(function(){\n\t\t\t\t\tfor(var id in tasks){\n\t\t\t\t\t\tgantt.updateTask(tasks[id].id);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor(var id in links){\n\t\t\t\t\t\tgantt.updateLink(links[id].id);\n\t\t\t\t\t}\n\t\t\t\t\ttasks = null;\n\t\t\t\t\tlinks = null;\n\t\t\t\t});\n\t\t\t\tif(tasks) {\n\t\t\t\t\tgantt._dp.setGanttMode(\"tasks\");\n\t\t\t\t}else{\n\t\t\t\t\tgantt._dp.setGanttMode(\"links\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tdp.attachEvent(\"onBeforeDataSending\", function() {\n\t\t\tvar url = this._serverProcessor;\n\t\t\tif(this._tMode == \"REST\"){\n\t\t\t\tvar mode = this._ganttMode.substr(0, this._ganttMode.length - 1);// links, tasks -> /link/id, /task/id\n\n\t\t\t\turl = url.substring(0, url.indexOf(\"?\") > -1 ? url.indexOf(\"?\") : url.length);\n\t\t\t\t//editing=true&\n\t\t\t\tthis.serverProcessor = url + (url.slice(-1) == \"/\" ? \"\" : \"/\") + mode;\n\t\t\t}else{\n\t\t\t\tthis.serverProcessor = url + gantt.ajax.urlSeparator(url) + \"gantt_mode=\" + this._ganttMode;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t});\n\t}\n\n\tvar dataProcessorHandlers = [];\n\n\tgantt._dp_init = function(dp) {\n\t\tgantt.assert(!this._dp, \"The dataProcessor is already attached to this gantt instance\");\n\n\t\tdp.setTransactionMode(\"POST\", true);\n\t\tdp.serverProcessor += (dp.serverProcessor.indexOf(\"?\") != -1 ? \"&\" : \"?\") + \"editing=true\";\n\t\tdp._serverProcessor = dp.serverProcessor;\n\t\tdp.$gantt = this;\n\t\tdp.styles = {\n\t\t\tupdated:\"gantt_updated\",\n\t\t\torder:\"gantt_updated\",\n\t\t\tinserted:\"gantt_inserted\",\n\t\t\tdeleted:\"gantt_deleted\",\n\t\t\tinvalid:\"gantt_invalid\",\n\t\t\terror:\"gantt_error\",\n\t\t\tclear:\"\"\n\t\t};\n\n\t\tdp._methods=[\"_row_style\",\"setCellTextStyle\",\"_change_id\",\"_delete_task\"];\n\n\t\textendDataProcessor.call(this, gantt, dp);\n\t\textendGantt.call(this, gantt, dp);\n\t\tattachDataProcessorEvents.call(this, gantt, dp);\n\n\t\tdp.attachEvent(\"onDestroy\", function(){\n\t\t\tdetachDataProcessor(gantt, dp);\n\t\t});\n\t\tliveUpdateHooks(gantt, dp);\n\t};\n\n\tgantt.getUserData = function(id, name) {\n\t\tif (!this.userdata) this.userdata = {};\n\t\tif (this.userdata[id] && this.userdata[id][name]) return this.userdata[id][name];\n\t\treturn \"\";\n\t};\n\tgantt.setUserData = function(id, name, value) {\n\t\tif (!this.userdata) this.userdata = {};\n\t\tif (!this.userdata[id]) this.userdata[id] = {};\n\t\tthis.userdata[id][name] = value;\n\t};\n}\n\nmodule.exports = addDataProcessorHooks;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/dataprocessor/hooks.js\n// module id = 63\n// module chunks = 0","var utils = require (\"../../utils/utils\");\n\nfunction updateCallback(upd, id) {\n\tvar data = upd.data || this.xml._xmlNodeToJSON(upd.firstChild);\n\tif(!this.isTaskExists(id))\n\t\treturn;\n\tvar objData = this.getTask(id);\n\tfor(var key in data) {\n\t\tvar property = data[key];\n\t\tswitch(key) {\n\t\t\tcase \"id\":\n\t\t\t\tcontinue;\n\t\t\tcase \"start_date\":\n\t\t\tcase \"end_date\":\n\t\t\t\tproperty = this.templates.xml_date(property);\n\t\t\t\tbreak;\n\t\t\tcase \"duration\":\n\t\t\t\tobjData.end_date = this.calculateEndDate({start_date: objData.start_date, duration: property, task:objData});\n\t\t\t\tbreak;\n\t\t}\n\t\tobjData[key] = property;\n\t}\n\tthis.updateTask(id);\n\tthis.refreshData();\n}\n\nfunction insertCallback(upd, id, parent, mode) {\n\tvar data = upd.data || this.xml._xmlNodeToJSON(upd.firstChild),\n\t\tmethods = {\n\t\t\tadd: this.addTask,\n\t\t\tisExist: this.isTaskExists\n\t\t};\n\tif(mode == \"links\") {\n\t\tmethods.add = this.addLink;\n\t\tmethods.isExist = this.isLinkExists;\n\t}\n\tif(methods.isExist.call(this, id))\n\t\treturn;\n\tdata.id = id;\n\tmethods.add.call(this, data);\n}\n\nfunction deleteCallback(upd, id, parent, mode) {\n\tvar methods = {\n\t\t\"delete\": this.deleteTask,\n\t\t\"isExist\": this.isTaskExists\n\t};\n\tif(mode == \"links\") {\n\t\tmethods[\"delete\"] = this.deleteLink;\n\t\tmethods.isExist = this.isLinkExists;\n\t}\n\tif(methods.isExist.call(this, id))\n\t\tmethods[\"delete\"].call(this, id);\n}\n\nfunction patchDataProcessor(gantt, dataprocessor){\n\tdataprocessor.attachEvent(\"insertCallback\", utils.bind(insertCallback, gantt));\n\tdataprocessor.attachEvent(\"updateCallback\", utils.bind(deleteCallback, gantt));\n\tdataprocessor.attachEvent(\"deleteCallback\", utils.bind(deleteCallback, gantt));\n}\n\nmodule.exports = patchDataProcessor;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/dataprocessor/live_update_hooks.js\n// module id = 64\n// module chunks = 0","var utils = require(\"../../utils/utils\");\nvar eventable = require(\"../../utils/eventable\");\n\n/**\n\t* \t@desc: constructor, data processor object \n\t*\t@param: serverProcessorURL - url used for update\n\t*\t@type: public\n\t*/\nvar dataProcessor = function(serverProcessorURL){\n this.serverProcessor = serverProcessorURL;\n this.action_param=\"!nativeeditor_status\";\n \n\tthis.object = null;\n\tthis.updatedRows = []; //ids of updated rows\n\t\n\tthis.autoUpdate = true;\n\tthis.updateMode = \"cell\";\n\tthis._tMode=\"GET\"; \n\tthis._headers = null;\n\tthis._payload = null;\n\tthis.post_delim = \"_\";\n\t\n this._waitMode=0;\n this._in_progress={};//?\n this._invalid={};\n this.mandatoryFields=[];\n this.messages=[];\n \n this.styles={\n \tupdated:\"font-weight:bold;\",\n \tinserted:\"font-weight:bold;\",\n \tdeleted:\"text-decoration : line-through;\",\n \tinvalid:\"background-color:FFE0E0;\",\n \tinvalid_cell:\"border-bottom:2px solid red;\",\n \terror:\"color:red;\",\n \tclear:\"font-weight:normal;text-decoration:none;\"\n };\n \n this.enableUTFencoding(true);\n\teventable(this);\n\n return this;\n};\n\ndataProcessor.prototype={\n\tsetTransactionMode:function(mode,total){\n\t\tif (typeof mode == \"object\"){\n\t\t\tthis._tMode = mode.mode || this._tMode;\n\n\t\t\tif(utils.defined(mode.headers)){\n\t\t\t\tthis._headers = mode.headers;\n\t\t\t}\n\n\t\t\tif(utils.defined(mode.payload)){\n\t\t\t\tthis._payload = mode.payload;\n\t\t\t}\n\t\t\t\n\t\t} else {\n \t this._tMode=mode;\n\t\t\tthis._tSend=total;\n\t\t}\n\n\t\tif (this._tMode == \"REST\"){\n\t\t\tthis._tSend = false;\n\t\t\tthis._endnm = true;\n\t\t}\n\n\t\tif (this._tMode == \"JSON\"){\n\t\t\tthis._tSend = false;\n\t\t\tthis._endnm = true;\n\t\t\tthis._headers = this._headers || {};\n\t\t\tthis._headers[\"Content-type\"] = \"application/json\";\n\t\t}\n },\n escape:function(data){\n \tif (this._utf)\n \t\treturn encodeURIComponent(data);\n \telse\n \treturn escape(data);\n\t},\n /**\n\t* \t@desc: allows to set escaping mode\n\t*\t@param: true - utf based escaping, simple - use current page encoding\n\t*\t@type: public\n\t*/\t\n\tenableUTFencoding:function(mode){\n this._utf=!!mode;\n },\n /**\n\t* \t@desc: allows to define, which column may trigger update\n\t*\t@param: val - array or list of true/false values\n\t*\t@type: public\n\t*/\n\tsetDataColumns:function(val){\n\t\tthis._columns=(typeof val == \"string\")?val.split(\",\"):val;\n },\n /**\n\t* \t@desc: get state of updating\n\t*\t@returns: true - all in sync with server, false - some items not updated yet.\n\t*\t@type: public\n\t*/\n\tgetSyncState:function(){\n\t\treturn !this.updatedRows.length;\n\t},\n\t/**\n\t* \t@desc: enable/disable named field for data syncing, will use column ids for grid\n\t*\t@param: mode - true/false\n\t*\t@type: public\n\t*/\n\tenableDataNames:function(mode){\n\t\tthis._endnm= !!mode;\n\t},\n\t/**\n\t* \t@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode\n\t*\t@param: mode - true/false\n\t*\t@type: public\n\t*/\n\tenablePartialDataSend:function(mode){\n\t\tthis._changed= !!mode;\n\t},\n\t/**\n\t* \t@desc: set if rows should be send to server automaticaly\n\t*\t@param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\n\t*\t@type: public\n\t*/\n\tsetUpdateMode:function(mode,dnd){\n\t\tthis.autoUpdate = (mode==\"cell\");\n\t\tthis.updateMode = mode;\n\t\tthis.dnd=dnd;\n\t},\n\tignore:function(code,master){\n\t\tthis._silent_mode=true;\n\t\tcode.call(master||window);\n\t\tthis._silent_mode=false;\n\t},\n\t/**\n\t* \t@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)\n\t*\t@param: rowId - id of row to set update-status for\n\t*\t@param: state - true for \"updated\", false for \"not updated\"\n\t*\t@param: mode - update mode name\n\t*\t@type: public\n\t*/\n\tsetUpdated:function(rowId,state,mode){\n\t\tif (this._silent_mode) return;\n\t\tvar ind=this.findRow(rowId);\n\t\t\n\t\tmode=mode||\"updated\";\n\t\tvar existing = this.obj.getUserData(rowId,this.action_param);\n\t\tif (existing && mode == \"updated\") mode=existing;\n\t\tif (state){\n\t\t\tthis.set_invalid(rowId,false); //clear previous error flag\n\t\t\tthis.updatedRows[ind]=rowId;\n\t\t\tthis.obj.setUserData(rowId,this.action_param,mode);\n\t\t\tif (this._in_progress[rowId]) \n\t\t\t\tthis._in_progress[rowId]=\"wait\";\n\t\t} else{\n\t\t\tif (!this.is_invalid(rowId)){\n\t\t\t\tthis.updatedRows.splice(ind,1);\n\t\t\t\tthis.obj.setUserData(rowId,this.action_param,\"\");\n\t\t\t}\n\t\t}\n\n\t\t//clear changed flag\n\t\tif (!state)\n\t\t\tthis._clearUpdateFlag(rowId);\n \t\t\t\n\t\tthis.markRow(rowId,state,mode);\n\t\tif (state && this.autoUpdate) this.sendData(rowId);\n\t},\n\t_clearUpdateFlag:function(id){},\n\tmarkRow:function(id,state,mode){ \n\t\tvar str=\"\";\n\t\tvar invalid=this.is_invalid(id);\n\t\tif (invalid){\n \tstr=this.styles[invalid];\n \tstate=true;\n \t}\n\t\tif (this.callEvent(\"onRowMark\",[id,state,mode,invalid])){\n\t\t\t//default logic\n\t\t\tstr=this.styles[state?mode:\"clear\"]+str;\n\t\t\t\n \tthis.obj[this._methods[0]](id,str);\n\n\t\t\tif (invalid && invalid.details){\n\t\t\t\tstr+=this.styles[invalid+\"_cell\"];\n\t\t\t\tfor (var i=0; i < invalid.details.length; i++)\n\t\t\t\t\tif (invalid.details[i])\n \t\t\t\tthis.obj[this._methods[1]](id,i,str);\n\t\t\t}\n\t\t}\n\t},\n\tgetState:function(id){\n\t\treturn this.obj.getUserData(id,this.action_param);\n\t},\n\tis_invalid:function(id){\n\t\treturn this._invalid[id];\n\t},\n\tset_invalid:function(id,mode,details){ \n\t\tif (details) mode={value:mode, details:details, toString:function(){ return this.value.toString(); }};\n\t\tthis._invalid[id]=mode;\n\t},\n\t/**\n\t* \t@desc: check mandatory fields and varify values of cells, initiate update (if specified)\n\t*\t@param: rowId - id of row to set update-status for\n\t*\t@type: public\n\t*/\n\tcheckBeforeUpdate:function(rowId){ \n\t\treturn true;\n\t},\n\t/**\n\t* \t@desc: send row(s) values to server\n\t*\t@param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\n\t*\t@type: public\n\t*/\n\tsendData:function(rowId){\n\t\tif (this._waitMode && (this.obj.mytype==\"tree\" || this.obj._h2)) return;\n\t\tif (this.obj.editStop) this.obj.editStop();\n\t\n\t\t\n\t\tif(typeof rowId == \"undefined\" || this._tSend) return this.sendAllData();\n\t\tif (this._in_progress[rowId]) return false;\n\t\t\n\t\tthis.messages=[];\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\",[rowId,this.messages])) return false;\n\t\tthis._beforeSendData(this._getRowData(rowId),rowId);\n },\n _beforeSendData:function(data,rowId){\n \tif (!this.callEvent(\"onBeforeUpdate\",[rowId,this.getState(rowId),data])) return false;\t\n\t\tthis._sendData(data,rowId);\n },\n serialize:function(data, id){\n \tif (typeof data == \"string\")\n \t\treturn data;\n \tif (typeof id != \"undefined\")\n \t\treturn this.serialize_one(data,\"\");\n \telse{\n \t\tvar stack = [];\n \t\tvar keys = [];\n \t\tfor (var key in data)\n \t\t\tif (data.hasOwnProperty(key)){\n \t\t\t\tstack.push(this.serialize_one(data[key],key+this.post_delim));\n \t\t\t\tkeys.push(key);\n\t\t\t\t}\n \t\tstack.push(\"ids=\"+this.escape(keys.join(\",\")));\n \t\tif (this.$gantt.security_key)\n\t\t\t\tstack.push(\"dhx_security=\"+this.$gantt.security_key);\n \t\treturn stack.join(\"&\");\n \t}\n },\n serialize_one:function(data, pref){\n \tif (typeof data == \"string\")\n \t\treturn data;\n \tvar stack = [];\n \tfor (var key in data)\n \t\tif (data.hasOwnProperty(key)){\n \t\t\tif ((key == \"id\" || key == this.action_param) && this._tMode == \"REST\") continue;\n \t\t\tstack.push(this.escape((pref||\"\")+key)+\"=\"+this.escape(data[key]));\n \t\t}\n\t\treturn stack.join(\"&\");\n },\n\t_applyPayload:function(url){\n\t\tvar ajax = this.$gantt.ajax;\n\t\tif (this._payload)\n\t\t\tfor (var key in this._payload)\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\n\t\treturn url;\n\t},\n _sendData:function(a1,rowId){\n \tif (!a1) return; //nothing to send\n\t\tif (!this.callEvent(\"onBeforeDataSending\",rowId?[rowId,this.getState(rowId),a1]:[null, null, a1])) return false;\t\t\t\t\n\t\t\n \tif (rowId)\n\t\t\tthis._in_progress[rowId]=(new Date()).valueOf();\n\n\t\tvar that = this;\n\t\tvar back = function(xml){\n\t\t\tvar ids = [];\n\t\t\tif (rowId)\n\t\t\t\tids.push(rowId);\n\t\t\telse if (a1)\n\t\t\t\tfor (var key in a1)\n\t\t\t\t\tids.push(key);\n\n\t\t\treturn that.afterUpdate(that,xml,ids);\n\t\t};\n\t\tvar ajax = this.$gantt.ajax;\n\n\t\tvar a3 = this.serverProcessor+(this._user?(ajax.urlSeparator(this.serverProcessor)+[\"dhx_user=\"+this._user,\"dhx_version=\"+this.obj.getUserData(0,\"version\")].join(\"&\")):\"\");\n\t\tvar a4 = this._applyPayload(a3);\n\n\t\tif (this._tMode==\"GET\") {\n\t\t\tajax.query({\n\t\t\t\turl: a4 + ajax.urlSeparator(a4) + this.serialize(a1, rowId),\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tcallback: back,\n\t\t\t\theaders: this._headers\n\t\t\t});\n\t\t} else if (this._tMode == \"POST\") {\n\t\t\tajax.query({\n\t\t\t\turl: a4,\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: this._headers,\n\t\t\t\tdata: this.serialize(a1, rowId),\n\t\t\t\tcallback: back\n\t\t\t});\n\t\t} else if (this._tMode == \"JSON\"){\n\t\t\tvar action = a1[this.action_param];\n\t\t\tvar data = {};\n\t\t\tfor (var key in a1) data[key] = a1[key];\n\t\t\tdelete data[this.action_param];\n\t\t\tdelete data.id;\n\t\t\tdelete data.gr_id;\n\n\t\t\tajax.query({\n\t\t\t\turl:a4,\n\t\t\t\tmethod:\"POST\",\n\t\t\t\theaders:this._headers,\n\t\t\t\tcallback:back,\n\t\t\t\tdata:JSON.stringify({\n\t\t\t\t\tid: rowId,\n\t\t\t\t\taction: action,\n\t\t\t\t\tdata: data\n\t\t\t\t})\n\t\t\t});\n\t\t}\n else if (this._tMode == \"REST\"){\n \tvar state = this.getState(rowId);\n \tvar url = a3.replace(/(\\&|\\?)editing\\=true/,\"\");\n \tvar data = \"\";\n \tvar method = \"post\";\n\n \tif (state == \"inserted\"){\n \t\tdata = this.serialize(a1, rowId);\n \t} else if (state == \"deleted\"){\n \t\tmethod = \"DELETE\";\n \t\turl = url + (url.slice(-1) == \"/\" ? \"\" : \"/\") + rowId;\n \t} else {\n \t\tmethod = \"PUT\";\n \t\tdata = this.serialize(a1, rowId);\n \t\turl = url + (url.slice(-1) == \"/\" ? \"\" : \"/\") + rowId;\n \t}\n\n\n \turl = this._applyPayload(url);\n \tajax.query({\n \t\turl:url,\n \t\tmethod:method,\n \t\theaders:this._headers,\n \t\tdata:data,\n \t\tcallback:back\n \t});\n }\n\n\t\tthis._waitMode++;\n },\n\tsendAllData:function(){\n\t\tif (!this.updatedRows.length) return;\t\t\t\n\n\t\tthis.messages=[]; var valid=true;\n\t\tfor (var i=0; i 0 && currentScrollTop + scrollOuterHeight >= scrollInnerHeight + 2) {\n\t\t\tscrollTop = 0;\n\t\t}\n\n\t\tif (scrollLeft && !scrollOuterWidth) {\n\t\t\tscrollLeft = 0;\n\t\t} else if (scrollLeft < 0 && !currentScrollLeft) {\n\t\t\tscrollLeft = 0;\n\t\t} else if (scrollLeft > 0 && currentScrollLeft + scrollOuterWidth >= scrollInnerWidth) {\n\t\t\tscrollLeft = 0;\n\t\t}\n\n\t\tvar step = gantt.config.autoscroll_step;\n\n\t\tif (step && step < 2) // limit step value to 2\n\t\t\tstep = 2;\n\n\t\tscrollLeft = scrollLeft * (step || scrollStep);\n\t\tscrollTop = scrollTop * (step || scrollStep);\n\n\t\tif (scrollLeft || scrollTop) {\n\t\t\tscroll(scrollLeft, scrollTop);\n\t\t} \n\n\t}\n\n\tfunction need_scroll(pos, boxSize, startCoord) {\n\t\tif ((pos - scrollRange < 0) && (pos < startCoord))\n\t\t\treturn -1;\n\t\telse if ((pos > boxSize - scrollRange) && (pos > startCoord))\n\t\t\treturn 1;\n\t\treturn 0;\n\t}\n\n\tfunction scroll(left, top) {\n\t\tvar scrollState = gantt.getScrollState();\n\n\t\tvar scrollLeft = null,\n\t\t\tscrollTop = null;\n\n\t\tif (left) {\n\t\t\tscrollLeft = scrollState.x + left;\n\t\t\tscrollLeft = Math.min(scrollState.width, scrollLeft);\n\t\t\tscrollLeft = Math.max(0, scrollLeft);\n\t\t}\n\n\t\tif (top) {\n\t\t\tscrollTop = scrollState.y + top;\n\t\t\tscrollTop = Math.min(scrollState.height, scrollTop);\n\t\t\tscrollTop = Math.max(0, scrollTop);\n\t\t}\n\n\t\tgantt.scrollTo(scrollLeft, scrollTop);\n\t}\n\n\tgantt.attachEvent(\"onGanttReady\", function() {\n\t\tgantt.eventRemove(document.body, \"mousemove\", autoscrollInterval);\n\t\tgantt.event(document.body, \"mousemove\", autoscrollInterval);\n\t});\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/plugins/autoscroll.js\n// module id = 67\n// module chunks = 0","function createMethod(gantt){\n\tvar methods = {};\n\tvar isActive = false;\n\tfunction disableMethod(methodName, dummyMethod){\n\t\tdummyMethod = typeof dummyMethod == \"function\" ? dummyMethod : function(){};\n\n\t\tif(!methods[methodName]){\n\t\t\tmethods[methodName] = this[methodName];\n\t\t\tthis[methodName] = dummyMethod;\n\t\t}\n\t}\n\tfunction restoreMethod(methodName){\n\t\tif(methods[methodName]){\n\t\t\tthis[methodName] = methods[methodName];\n\t\t\tmethods[methodName] = null;\n\t\t}\n\t}\n\tfunction disableMethods(methodsHash){\n\t\tfor(var i in methodsHash){\n\t\t\tdisableMethod.call(this, i, methodsHash[i]);\n\t\t}\n\t}\n\t function restoreMethods(){\n\t\tfor(var i in methods){\n\t\t\trestoreMethod.call(this, i);\n\t\t}\n\t}\n\n\tfunction batchUpdatePayload(callback){\n\t\ttry{\n\t\t\tcallback();\n\t\t}catch(e){\n\t\t\twindow.console.error(e);\n\t\t}\n\t}\n\n\tvar state = gantt.$services.getService(\"state\");\n\tstate.registerProvider(\"batchUpdate\", function(){\n\t\treturn {\n\t\t\tbatch_update: isActive\n\t\t};\n\t}, true);\n\n\treturn function batchUpdate(callback, noRedraw) {\n\t\tif(isActive){\n\t\t\t// batch mode is already active\n\t\t\tbatchUpdatePayload(callback);\n\t\t\treturn;\n\t\t}\n\n\t\tvar call_dp = (this._dp && this._dp.updateMode != \"off\");\n\t\tvar dp_mode;\n\t\tif (call_dp){\n\t\t\tdp_mode = this._dp.updateMode;\n\t\t\tthis._dp.setUpdateMode(\"off\");\n\t\t}\n\n\t\t// temporary disable some methods while updating multiple tasks\n\t\tvar resetProjects = {};\n\t\tvar methods = {\n\t\t\t\"render\":true,\n\t\t\t\"refreshData\":true,\n\t\t\t\"refreshTask\":true,\n\t\t\t\"refreshLink\":true,\n\t\t\t\"resetProjectDates\":function(task){\n\t\t\t\tresetProjects[task.id] = task;\n\t\t\t}\n\t\t};\n\n\t\tdisableMethods.call(this, methods);\n\n\t\tisActive = true;\n\t\tthis.callEvent(\"onBeforeBatchUpdate\", []);\n\n\t\tbatchUpdatePayload(callback);\n\n\t\tthis.callEvent(\"onAfterBatchUpdate\", []);\n\n\t\trestoreMethods.call(this);\n\n\t\t// do required updates after changes applied\n\t\tfor(var i in resetProjects){\n\t\t\tthis.resetProjectDates(resetProjects[i]);\n\t\t}\n\n\t\tisActive = false;\n\n\t\tif(!noRedraw){\n\t\t\tthis.render();\n\t\t}\n\n\t\tif (call_dp) {\n\t\t\tthis._dp.setUpdateMode(dp_mode);\n\t\t\tthis._dp.setGanttMode(\"tasks\");\n\t\t\tthis._dp.sendData();\n\t\t\tthis._dp.setGanttMode(\"links\");\n\t\t\tthis._dp.sendData();\n\t\t}\n\t};\n\n\n\n}\n\nmodule.exports = function(gantt){\n\tgantt.batchUpdate = createMethod(gantt);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/plugins/batch_update.js\n// module id = 68\n// module chunks = 0","var createWbs = (function(gantt){\n\treturn {\n\t_needRecalc: true,\n\treset: function(){\n\t\tthis._needRecalc = true;\n\t},\n\t_isRecalcNeeded: function(){\n\t\treturn (!this._isGroupSort() && this._needRecalc);\n\t},\n\t_isGroupSort: function() {\n\t\treturn !!(gantt._groups && gantt._groups.is_active());\n\t},\n\t_getWBSCode: function(task) {\n\t\tif(!task) return \"\";\n\n\t\tif(this._isRecalcNeeded()){\n\t\t\tthis._calcWBS();\n\t\t}\n\n\t\tif(task.$virtual) return \"\";\n\t\tif(this._isGroupSort()) return task.$wbs || \"\";\n\n\t\tif(!task.$wbs) {\n\t\t\tthis.reset();\n\t\t\tthis._calcWBS();\n\t\t}\n\t\treturn task.$wbs;\n\t},\n\t_setWBSCode: function(task, value) {\n\t\ttask.$wbs = value;\n\t},\n\tgetWBSCode: function(task) {\n\t\treturn this._getWBSCode(task);\n\t},\n\t_calcWBS: function() {\n\t\tif(!this._isRecalcNeeded()) return;\n\n\t\tvar _isFirst = true;\n\t\tgantt.eachTask(function(ch) {\n\t\t\tif(_isFirst) {\n\t\t\t\t_isFirst = false;\n\t\t\t\tthis._setWBSCode(ch, \"1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar _prevSibling = gantt.getPrevSibling(ch.id);\n\t\t\tif (_prevSibling !== null) {\n\t\t\t\tvar _wbs = gantt.getTask(_prevSibling).$wbs;\n\t\t\t\tif(_wbs) {\n\t\t\t\t\t_wbs = _wbs.split(\".\");\n\t\t\t\t\t_wbs[_wbs.length-1]++;\n\t\t\t\t\tthis._setWBSCode(ch, _wbs.join(\".\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar _parent = gantt.getParent(ch.id);\n\t\t\t\tthis._setWBSCode(ch, gantt.getTask(_parent).$wbs + \".1\");\n\t\t\t}\n\t\t}, gantt.config.root_id, this);\n\n\t\tthis._needRecalc = false;\n\t}\n};\n});\n\nmodule.exports = function(gantt){\n\tvar wbs = createWbs(gantt);\n\tgantt.getWBSCode = function getWBSCode(task) {\n\t\treturn wbs.getWBSCode(task);\n\t};\n\n\tgantt.attachEvent(\"onAfterTaskMove\", function() {\n\t\twbs.reset();\n\t\treturn true;\n\t});\n\n\tgantt.attachEvent(\"onBeforeParse\", function() {\n\t\twbs.reset();\n\t\treturn true;\n\t});\n\n\tgantt.attachEvent(\"onAfterTaskDelete\", function() {\n\t\twbs.reset();\n\t\treturn true;\n\t});\n\n\tgantt.attachEvent(\"onAfterTaskAdd\", function() {\n\t\twbs.reset();\n\t\treturn true;\n\t});\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/plugins/wbs.js\n// module id = 69\n// module chunks = 0","if (window.jQuery){\n\n\t(function( $ ){\n\n\t\tvar methods = [];\n\t\t$.fn.dhx_gantt = function(config){\n\t\t\tconfig = config || {};\n\t\t\tif (typeof(config) === 'string') {\n\t\t\t\tif (methods[config] ) {\n\t\t\t\t\treturn methods[config].apply(this, []);\n\t\t\t\t}else {\n\t\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_gantt');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar views = [];\n\t\t\t\tthis.each(function() {\n\t\t\t\t\tif (this && this.getAttribute){\n\t\t\t\t\t\tif (!this.gantt && !(window.gantt.$root == this)){\n\n\t\t\t\t\t\t\tvar newgantt = (window.gantt.$container && window.Gantt) ? window.Gantt.getGanttInstance():window.gantt;\n\t\t\t\t\t\t\tfor (var key in config)\n\t\t\t\t\t\t\t\tif (key!=\"data\")\n\t\t\t\t\t\t\t\t\tnewgantt.config[key] = config[key];\n\n\t\t\t\t\t\t\tnewgantt.init(this);\n\t\t\t\t\t\t\tif (config.data)\n\t\t\t\t\t\t\t\tnewgantt.parse(config.data);\n\n\t\t\t\t\t\t\tviews.push(newgantt);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tviews.push(typeof this.gantt == \"object\" ? this.gantt : window.gantt);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\tif (views.length === 1) return views[0];\n\t\t\t\treturn views;\n\t\t\t}\n\t\t};\n\n\t})(jQuery);\n\n}\n\n\nmodule.exports = null;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/plugins/jquery_hooks.js\n// module id = 70\n// module chunks = 0","if (window.dhtmlx){\n\n\tif (!dhtmlx.attaches)\n\t\tdhtmlx.attaches = {};\n\n\tdhtmlx.attaches.attachGantt=function(start, end, gantt){\n\t\tvar obj = document.createElement(\"DIV\");\n\n\t\tgantt = gantt || window.gantt;\n\n\t\tobj.id = \"gantt_\"+ gantt.uid();\n\t\tobj.style.width = \"100%\";\n\t\tobj.style.height = \"100%\";\n\t\tobj.cmp = \"grid\";\n\n\t\tdocument.body.appendChild(obj);\n\t\tthis.attachObject(obj.id);\n\t\tthis.dataType = \"gantt\";\n\t\tthis.dataObj = gantt;\n\n\t\tvar that = this.vs[this.av];\n\t\tthat.grid = gantt;\n\n\t\tgantt.init(obj.id, start, end);\n\t\tobj.firstChild.style.border = \"none\";\n\n\t\tthat.gridId = obj.id;\n\t\tthat.gridObj = obj;\n\n\t\tvar method_name=\"_viewRestore\";\n\t\treturn this.vs[this[method_name]()].grid;\n\t};\n\n}\nif (typeof(window.dhtmlXCellObject) != \"undefined\") {\n\n\tdhtmlXCellObject.prototype.attachGantt=function(start, end, gantt){\n\t\tgantt = gantt || window.gantt;\n\n\t\tvar obj = document.createElement(\"DIV\");\n\t\tobj.id = \"gantt_\"+gantt.uid();\n\t\tobj.style.width = \"100%\";\n\t\tobj.style.height = \"100%\";\n\t\tobj.cmp = \"grid\";\n\n\t\tdocument.body.appendChild(obj);\n\t\tthis.attachObject(obj.id);\n\n\t\tthis.dataType = \"gantt\";\n\t\tthis.dataObj = gantt;\n\n\t\tgantt.init(obj.id, start, end);\n\t\tobj.firstChild.style.border = \"none\";\n\t\tvar method_name=\"_viewRestore\";\n\t\tobj = null;\n\t\tthis.callEvent(\"_onContentAttach\",[]);\n\n\t\treturn this.dataObj;\n\t};\n}\n\nmodule.exports = null;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/plugins/dhtmlx_hooks.js\n// module id = 71\n// module chunks = 0","function createResourceMethods(gantt){\n\n\tvar resourceTaskCache = {},\n\t\tresourceLoadCache = {};\n\n\tgantt.$data.tasksStore.attachEvent(\"onStoreUpdated\", function(){\n\t\tresourceTaskCache = {};\n\t\tresourceLoadCache = {};\n\t});\n\n\tfunction getTaskBy(propertyName, propertyValue){\n\t\tif(typeof propertyName == \"function\"){\n\t\t\treturn filterResourceTasks(propertyName);\n\t\t}else{\n\t\t\tif(propertyValue instanceof Array){\n\t\t\t\treturn getResourceTasks(propertyName, propertyValue);\n\t\t\t}else{\n\t\t\t\treturn getResourceTasks(propertyName, [propertyValue]);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction filterResourceTasks(filter){\n\t\tvar res = [];\n\t\tgantt.eachTask(function (task) {\n\t\t\tif (filter(task)) {\n\t\t\t\tres.push(task);\n\t\t\t}\n\t\t});\n\t\treturn res;\n\t}\n\n\tfunction getResourceTasks(property, resourceIds) {\n\t\tvar res;\n\n\t\tvar cacheKey = resourceIds.join(\"_\") + \"_\" + property;\n\n\t\tvar resourceHash = {};\n\t\tfor(var i = 0; i < resourceIds.length; i++){\n\t\t\tresourceHash[resourceIds[i]] = true;\n\t\t}\n\n\t\tif(!resourceTaskCache[cacheKey]){\n\t\t\tres = resourceTaskCache[cacheKey] = [];\n\t\t\tgantt.eachTask(function (task) {\n\t\t\t\tif (resourceHash[task[property]] && task.type != gantt.config.types.project) {\n\t\t\t\t\tres.push(task);\n\t\t\t\t}\n\t\t\t});\n\t\t}else{\n\t\t\tres = resourceTaskCache[cacheKey];\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tfunction getResourceLoad(resourceId, resourceProperty, scale){\n\t\tvar cacheKey = [resourceId, resourceProperty, scale.unit, scale.step].join(\"_\");\n\t\tvar res;\n\t\tif(!resourceTaskCache[cacheKey]){\n\t\t\tres = resourceTaskCache[cacheKey] = calculateResourceLoad(resourceId, resourceProperty, scale);\n\n\t\t}else{\n\t\t\tres = resourceTaskCache[cacheKey];\n\t\t}\n\t\treturn res;\n\t}\n\n\tfunction calculateResourceLoad(resourceProperty, resourceId, scale) {\n\n\t\tvar tasks = getTaskBy(resourceProperty, resourceId);\n\t\tvar step = scale.unit;\n\t\tvar timegrid = {};\n\n\t\tfor (var i = 0; i < tasks.length; i++) {\n\t\t\tvar task = tasks[i];\n\n\t\t\tvar currDate = gantt.date[step + \"_start\"](new Date(task.start_date));\n\n\t\t\twhile (currDate < task.end_date) {\n\n\t\t\t\tvar date = currDate;\n\t\t\t\tcurrDate = gantt.date.add(currDate, 1, step);\n\n\t\t\t\tif (!gantt.isWorkTime({date: date, task: task})) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar timestamp = date.valueOf();\n\t\t\t\tif (!timegrid[timestamp]){\n\t\t\t\t\ttimegrid[timestamp] = {\n\t\t\t\t\t\ttasks: []\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\ttimegrid[timestamp].tasks.push(task);\n\t\t\t}\n\t\t}\n\n\t\tvar timetable = [];\n\t\tvar start, end;\n\t\tfor (var i in timegrid) {\n\t\t\tstart = new Date(i * 1);\n\t\t\tend = gantt.date.add(start, 1, step);\n\t\t\ttimetable.push({\n\t\t\t\tstart_date: start,\n\t\t\t\tend_date: end,\n\t\t\t\ttasks: timegrid[i].tasks\n\t\t\t});\n\t\t}\n\n\t\treturn timetable;\n\t}\n\n\tfunction renderResourceLine(resource, timeline) {\n\t\tvar config = timeline.$getConfig(),\n\t\t\ttemplates = timeline.$getTemplates();\n\t\tvar timetable = getResourceLoad(config.resource_property, resource.id, timeline.getScale());\n\n\t\tvar cells = [];\n\t\tfor (var i = 0; i < timetable.length; i++) {\n\n\t\t\tvar day = timetable[i];\n\n\t\t\tvar css = templates.resource_cell_class(day.start_date, day.end_date, resource, day.tasks);\n\t\t\tvar content = templates.resource_cell_value(day.start_date, day.end_date, resource, day.tasks);\n\n\t\t\tif(css || content){\n\t\t\t\tvar sizes = timeline.getItemPosition(resource, day.start_date, day.end_date);\n\t\t\t\tvar el = document.createElement('div');\n\t\t\t\tel.className = [\"gantt_resource_marker\", css].join(\" \");\n\n\t\t\t\tel.style.cssText = [\n\t\t\t\t\t'left:' + sizes.left + 'px',\n\t\t\t\t\t'width:' + sizes.width + 'px',\n\t\t\t\t\t'height:' + (config.row_height - 1) + 'px',\n\t\t\t\t\t'line-height:' + (config.row_height - 1) + 'px',\n\t\t\t\t\t'top:' + sizes.top + 'px'\n\t\t\t\t].join(\";\");\n\n\t\t\t\tif(content)\n\t\t\t\t\tel.innerHTML = content;\n\n\t\t\t\tcells.push(el);\n\t\t\t}\n\n\t\t}\n\n\t\tvar row = null;\n\t\tif(cells.length){\n\t\t\trow = document.createElement(\"div\");\n\t\t\tfor(var i = 0; i < cells.length; i++){\n\t\t\t\trow.appendChild(cells[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn row;\n\t}\n\treturn {\n\t\trenderLine: renderResourceLine,\n\t\tfilterTasks: getTaskBy\n\t};\n}\n\nmodule.exports = function(gantt){\n\tvar methods = createResourceMethods(gantt);\n\n\tgantt.getTaskBy = methods.filterTasks;\n\tgantt.$ui.layers.resourceRow = methods.renderLine;\n\tgantt.config.resource_property = \"owner_id\";\n\tgantt.config.resource_store = \"resource\";\n\n\tgantt.templates.resource_cell_class = function(start, end, resource, tasks){\n\t\tvar css = \"\";\n\t\tif (tasks.length <= 1) {\n\t\t\tcss = \"gantt_resource_marker_ok\";\n\t\t} else {\n\t\t\tcss = \"gantt_resource_marker_overtime\";\n\t\t}\n\t\treturn css;\n\t};\n\n\tgantt.templates.resource_cell_value = function(start, end, resource, tasks){\n\t\treturn tasks.length * 8;\n\t};\n};\n\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/plugins/resources.js\n// module id = 72\n// module chunks = 0","module.exports = function(gantt) {\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/dynamic_loading.gpl.js\n// module id = 73\n// module chunks = 0","module.exports = function(gantt) {\n\tgantt.getGridColumn = function (name) {\n\t\tvar columns = gantt.config.columns;\n\n\t\tfor (var i = 0; i < columns.length; i++) {\n\t\t\tif (columns[i].name == name)\n\t\t\t\treturn columns[i];\n\t\t}\n\n\t\treturn null;\n\t};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/grid_column_api.gpl.js\n// module id = 74\n// module chunks = 0","module.exports = function(gantt){\n\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\n\n\tfunction stripHTMLLite(htmlText){\n\t\treturn (htmlText + \"\")\n\t\t\t.replace(htmlTags, \" \").\n\t\t\treplace(extraSpaces, \" \");\n\t}\n\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\n\tfunction escapeQuotes(text){\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\n\t}\n\n\tgantt._waiAria = {\n\t\tgetAttributeString: function(attr){\n\t\t\tvar attributes = [\" \"];\n\t\t\tfor(var i in attr){\n\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\n\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\n\t\t\t}\n\t\t\tattributes.push(\" \");\n\t\t\treturn attributes.join(\" \");\n\n\t\t},\n\n\t\tgetTimelineCellAttr:function(dateString){\n\n\t\t\treturn gantt._waiAria.getAttributeString({\"aria-label\": dateString});\n\t\t},\n\n\n\t\t_taskCommonAttr: function(task, div){\n\n\t\t\tif(!(task.start_date && task.end_date))\n\t\t\t\treturn;\n\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(gantt.templates.tooltip_text(task.start_date, task.end_date, task)));\n\n\t\t\tif(gantt.isReadonly(task)){\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\n\n\n\t\t\t}\n\n\t\t\tif(task.$dataprocessor_class){\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\n\t\t\t}\n\n\n\t\t\tdiv.setAttribute(\"aria-selected\",\n\t\t\t\t(gantt.getState().selected_task == task.id || (gantt.isSelectedTask && gantt.isSelectedTask(task.id))) ? \"true\" : \"false\");\n\t\t},\n\n\t\tsetTaskBarAttr: function(task, div){\n\t\t\tthis._taskCommonAttr(task, div);\n\n\t\t\tif(!gantt.isReadonly(task) && gantt.config.drag_move){\n\t\t\t\tif(task.id != gantt.getState().drag_id){\n\t\t\t\t\tdiv.setAttribute(\"aria-grabbed\", false);\n\t\t\t\t}else{\n\t\t\t\t\tdiv.setAttribute(\"aria-grabbed\", true);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\ttaskRowAttr: function(task, div){\n\n\t\t\tthis._taskCommonAttr(task, div);\n\n\t\t\tif(!gantt.isReadonly(task) && gantt.config.order_branch){\n\t\t\t\tdiv.setAttribute(\"aria-grabbed\", false);\n\t\t\t}\n\n\t\t\tdiv.setAttribute(\"role\", \"row\");\n\n\t\t\tdiv.setAttribute(\"aria-level\", task.$level);\n\n\t\t\tif(gantt.hasChild(task.id)){\n\t\t\t\tdiv.setAttribute(\"aria-expanded\", task.$open ? \"true\" : \"false\");\n\t\t\t}\n\t\t},\n\n\t\tlinkAttr: function(link, div){\n\n\t\t\tvar linkTypes = gantt.config.links;\n\n\t\t\tvar toStart = link.type == linkTypes.finish_to_start || link.type == linkTypes.start_to_start;\n\t\t\tvar fromStart = link.type == linkTypes.start_to_start || link.type == linkTypes.start_to_finish;\n\n\t\t\tvar content = gantt.locale.labels.link + \" \" + gantt.templates.drag_link(link.source, fromStart, link.target, toStart);\n\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(content));\n\t\t\tif(gantt.isReadonly(link)){\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\n\t\t\t}\n\t\t},\n\n\t\tgridSeparatorAttr: function(div){\n\t\t\tdiv.setAttribute(\"role\", \"separator\");\n\t\t},\n\n\t\tlightboxHiddenAttr: function(div){\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\n\t\t},\n\n\t\tlightboxVisibleAttr: function(div){\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\n\t\t},\n\n\t\tlightboxAttr: function(div){\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\n\t\t},\n\n\t\tlightboxButtonAttrString:function(buttonName){\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":gantt.locale.labels[buttonName], \"tabindex\":\"0\"});\n\t\t},\n\n\t\tlightboxHeader: function(div, headerText){\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\n\t\t},\n\n\t\tlightboxSelectAttrString: function(time_option){\n\t\t\tvar label = \"\";\n\n\t\t\tswitch (time_option) {\n\t\t\t\tcase \"%Y\":\n\t\t\t\t\tlabel = gantt.locale.labels.years;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"%m\":\n\t\t\t\t\tlabel = gantt.locale.labels.months;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"%d\":\n\t\t\t\t\tlabel = gantt.locale.labels.days;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"%H:%i\":\n\t\t\t\t\tlabel = gantt.locale.labels.hours + gantt.locale.labels.minutes;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn gantt._waiAria.getAttributeString({\"aria-label\": label});\n\t\t},\n\n\t\tlightboxDurationInputAttrString: function(section){\n\t\t\treturn this.getAttributeString({\"aria-label\": gantt.locale.labels.column_duration, \"aria-valuemin\": \"0\"});\n\t\t},\n\n\t\tgridAttrString: function(){\n\t\t\treturn [\" role='treegrid'\", gantt.config.multiselect ? \"aria-multiselectable='true'\" : \"aria-multiselectable='false'\", \" \"].join(\" \");\n\t\t},\n\n\n\t\tgridScaleRowAttrString: function(){\n\t\t\treturn \"role='row'\";\n\t\t},\n\n\t\tgridScaleCellAttrString: function(column, label){\n\t\t\tvar attrs = \"\";\n\t\t\tif(column.name == \"add\"){\n\t\t\t\tattrs = this.getAttributeString({\"role\":\"button\", \"aria-label\": gantt.locale.labels.new_task});\n\t\t\t}else{\n\n\t\t\t\tvar attributes = {\n\t\t\t\t\t\"role\":\"columnheader\",\n\t\t\t\t\t\"aria-label\": label\n\t\t\t\t};\n\n\t\t\t\tif(gantt._sort && gantt._sort.name == column.name){\n\t\t\t\t\tif(gantt._sort.direction == \"asc\"){\n\t\t\t\t\t\tattributes[\"aria-sort\"] = \"ascending\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tattributes[\"aria-sort\"] = \"descending\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tattrs = this.getAttributeString(attributes);\n\t\t\t}\n\t\t\treturn attrs;\n\t\t},\n\n\t\tgridDataAttrString: function(){\n\t\t\treturn \"role='rowgroup'\";\n\t\t},\n\n\t\tgridCellAttrString: function(column, textValue){\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": textValue});\n\t\t},\n\n\t\tgridAddButtonAttrString: function(column){\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\": gantt.locale.labels.new_task});\n\t\t},\n\n\t\tmessageButtonAttrString: function(buttonLabel){\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\n\t\t},\n\n\t\tmessageInfoAttr: function(div){\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\n\t\t},\n\n\t\tmessageModalAttr: function(div, uid){\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\n\t\t\tif(uid){\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\n\t\t\t}\n\n\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\n\t\t},\n\n\t\tquickInfoAttr: function(div){\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\n\t\t},\n\n\t\tquickInfoHeaderAttrString: function(){\n\t\t\treturn \" role='heading' \";\n\t\t},\n\n\t\tquickInfoHeader: function(div, header){\n\t\t\tdiv.setAttribute(\"aria-label\", header);\n\t\t},\n\n\t\tquickInfoButtonAttrString: function(label){\n\t\t\treturn gantt._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\n\t\t},\n\n\t\ttooltipAttr: function(div){\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\n\t\t},\n\n\t\ttooltipVisibleAttr: function(div){\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\n\t\t},\n\n\t\ttooltipHiddenAttr: function(div){\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\n\t\t}\n\t};\n\n\tfunction isDisabled(){\n\t\treturn !gantt.config.wai_aria_attributes;\n\t}\n\n\tfor(var i in gantt._waiAria){\n\t\tgantt._waiAria[i] = (function(payload){\n\t\t\treturn function(){\n\t\t\t\tif(isDisabled()){\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\treturn payload.apply(this, arguments);\n\t\t\t};\n\t\t})(gantt._waiAria[i]);\n\t}\n\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/wai_aria.js\n// module id = 75\n// module chunks = 0","module.exports = function(gantt) {\n\tgantt.isReadonly = function (item) {\n\t\tif (item && item[this.config.editable_property]) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn (item && item[this.config.readonly_property]) || this.config.readonly;\n\t\t}\n\t};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/tasks.js\n// module id = 76\n// module chunks = 0","var utils = require(\"../utils/utils\");\nvar dateHelper = require(\"../utils/date_helpers\");\n\nmodule.exports = function(gantt) {\n\n\tgantt.load = function (url, type, callback) {\n\t\tthis._load_url = url;\n\t\tthis.assert(arguments.length, \"Invalid load arguments\");\n\n\t\tvar tp = 'json', cl = null;\n\t\tif (arguments.length >= 3) {\n\t\t\ttp = type;\n\t\t\tcl = callback;\n\t\t} else {\n\t\t\tif (typeof arguments[1] == \"string\")\n\t\t\t\ttp = arguments[1];\n\t\t\telse if (typeof arguments[1] == \"function\")\n\t\t\t\tcl = arguments[1];\n\t\t}\n\n\t\tthis._load_type = tp;\n\n\t\tthis.callEvent(\"onLoadStart\", [url, tp]);\n\n\t\tthis.ajax.get(url, gantt.bind(function (l) {\n\t\t\tthis.on_load(l, tp);\n\t\t\tthis.callEvent(\"onLoadEnd\", [url, tp]);\n\t\t\tif (typeof cl == \"function\")\n\t\t\t\tcl.call(this);\n\t\t}, this));\n\t};\n\tgantt.parse = function (data, type) {\n\t\tthis.on_load({xmlDoc: {responseText: data}}, type);\n\t};\n\n\tgantt.serialize = function (type) {\n\t\ttype = type || \"json\";\n\t\treturn this[type].serialize();\n\t};\n\n\t/*\n\ttasks and relations\n\t{\n\tdata:[\n\t\t{\n\t\t\t\"id\":\"string\",\n\t\t\t\"text\":\"...\",\n\t\t\t\"start_date\":\"Date or string\",\n\t\t\t\"end_date\":\"Date or string\",\n\t\t\t\"duration\":\"number\",\n\t\t\t\"progress\":\"0..1\",\n\t\t\t\"parent_id\":\"string\",\n\t\t\t\"order\":\"number\"\n\t\t},...],\n\tlinks:[\n\t\t{\n\t\t\tid:\"string\",\n\t\t\tsource:\"string\",\n\t\t\ttarget:\"string\",\n\t\t\ttype:\"string\"\n\t\t},...],\n\tcollections:{\n\t\t\tcollectionName:[\n\t\t\t\t{key:, label:, optional:...},...\n\t\t\t],...\n\t\t}\n\t}\n\n\t* */\n\n\tgantt.on_load = function (resp, type) {\n\t\tthis.callEvent(\"onBeforeParse\", []);\n\t\tif (!type)\n\t\t\ttype = \"json\";\n\t\tthis.assert(this[type], \"Invalid data type:'\" + type + \"'\");\n\n\t\tvar raw = resp.xmlDoc.responseText;\n\n\t\tvar data = this[type].parse(raw, resp);\n\t\tthis._process_loading(data);\n\t};\n\n\tgantt._process_loading = function (data) {\n\t\tif(data.collections)\n\t\t\tthis._load_collections(data.collections);\n\n\t\tthis.$data.tasksStore.parse(data.data);\n\t\tvar links = data.links || (data.collections ? data.collections.links : []);\n\t\tthis.$data.linksStore.parse(links);\n\n\t\t//this._sync_links();\n\t\tthis.callEvent(\"onParse\", []);\n\t\tthis.render();\n\t\tif(this.config.initial_scroll){\n\t\t\tvar firstTask = this.getTaskByIndex(0);\n\t\t\tvar id = firstTask ? firstTask.id : this.config.root_id;\n\t\t\tif(this.isTaskExists(id))\n\t\t\t\tthis.showTask(id);\n\t\t}\n\t};\n\n\n\tgantt._load_collections = function (collections) {\n\t\tvar collections_loaded = false;\n\t\tfor (var key in collections) {\n\t\t\tif (collections.hasOwnProperty(key)) {\n\t\t\t\tcollections_loaded = true;\n\t\t\t\tvar collection = collections[key];\n\t\t\t\tvar arr = this.serverList[key];\n\t\t\t\tif (!arr) continue;\n\t\t\t\tarr.splice(0, arr.length); //clear old options\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\n\t\t\t\t\tvar option = collection[j];\n\t\t\t\t\tvar obj = this.copy(option);\n\t\t\t\t\tobj.key = obj.value;// resulting option object\n\n\t\t\t\t\tfor (var option_key in option) {\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tarr.push(obj);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (collections_loaded)\n\t\t\tthis.callEvent(\"onOptionsLoad\", []);\n\t};\n\n\tgantt.attachEvent(\"onBeforeTaskDisplay\", function (id, task) {\n\t\treturn !task.$ignore;\n\t});\n\n\tgantt.json = {\n\t\tparse: function (data) {\n\t\t\tgantt.assert(data, \"Invalid data\");\n\n\t\t\tif (typeof data == \"string\") {\n\t\t\t\tif (window.JSON)\n\t\t\t\t\tdata = JSON.parse(data);\n\t\t\t\telse {\n\t\t\t\t\tgantt.assert(false, \"JSON is not supported\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (data.dhx_security)\n\t\t\t\tgantt.security_key = data.dhx_security;\n\t\t\treturn data;\n\t\t},\n\t\tserializeTask: function (task) {\n\t\t\treturn this._copyObject(task);\n\t\t},\n\t\tserializeLink: function (link) {\n\t\t\treturn this._copyLink(link);\n\t\t},\n\t\t_copyLink: function (obj) {\n\t\t\tvar copy = {};\n\t\t\tfor (var key in obj)\n\t\t\t\tcopy[key] = obj[key];\n\t\t\treturn copy;\n\t\t},\n\t\t_copyObject: function (obj) {\n\t\t\tvar copy = {};\n\t\t\tfor (var key in obj) {\n\t\t\t\tif (key.charAt(0) == \"$\")\n\t\t\t\t\tcontinue;\n\t\t\t\tcopy[key] = obj[key];\n\n\t\t\t\tif (dateHelper.isDate(copy[key])) {\n\t\t\t\t\tcopy[key] = gantt.templates.xml_format(copy[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn copy;\n\t\t},\n\t\tserialize: function () {\n\t\t\tvar tasks = [];\n\t\t\tvar links = [];\n\n\t\t\tgantt.eachTask(function (obj) {\n\t\t\t\tgantt.resetProjectDates(obj);\n\t\t\t\ttasks.push(this.serializeTask(obj));\n\t\t\t}, gantt.config.root_id, this);\n\n\t\t\tvar rawLinks = gantt.getLinks();\n\t\t\tfor (var i = 0; i < rawLinks.length; i++) {\n\t\t\t\tlinks.push(this.serializeLink(rawLinks[i]));\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdata: tasks,\n\t\t\t\tlinks: links\n\t\t\t};\n\t\t}\n\t};\n\n\t/*\n\t\n\t\t\n\t\t\tMy task 1\n\t\t\t16.08.2013\n\t\t\t22.08.2013\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\t*/\n\n\tgantt.xml = {\n\t\t_xmlNodeToJSON: function (node, attrs_only) {\n\t\t\tvar t = {};\n\t\t\tfor (var i = 0; i < node.attributes.length; i++)\n\t\t\t\tt[node.attributes[i].name] = node.attributes[i].value;\n\n\t\t\tif (!attrs_only) {\n\t\t\t\tfor (var i = 0; i < node.childNodes.length; i++) {\n\t\t\t\t\tvar child = node.childNodes[i];\n\t\t\t\t\tif (child.nodeType == 1)\n\t\t\t\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\n\t\t\t\t}\n\n\t\t\t\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\n\t\t\t}\n\n\t\t\treturn t;\n\t\t},\n\t\t_getCollections: function (loader) {\n\t\t\tvar collection = {};\n\t\t\tvar opts = gantt.ajax.xpath(\"//coll_options\", loader);\n\t\t\tfor (var i = 0; i < opts.length; i++) {\n\t\t\t\tvar bind = opts[i].getAttribute(\"for\");\n\t\t\t\tvar arr = collection[bind] = [];\n\t\t\t\tvar itms = gantt.ajax.xpath(\".//item\", opts[i]);\n\t\t\t\tfor (var j = 0; j < itms.length; j++) {\n\t\t\t\t\tvar itm = itms[j];\n\t\t\t\t\tvar attrs = itm.attributes;\n\t\t\t\t\tvar obj = {key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\n\t\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\n\t\t\t\t\t\tvar attr = attrs[k];\n\t\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\n\t\t\t\t\t}\n\t\t\t\t\tarr.push(obj);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn collection;\n\t\t},\n\t\t_getXML: function (text, loader, toptag) {\n\t\t\ttoptag = toptag || \"data\";\n\t\t\tif (!loader.getXMLTopNode) {\n\t\t\t\tloader = gantt.ajax.parse(loader);\n\t\t\t}\n\n\t\t\tvar xml = gantt.ajax.xmltop(toptag, loader.xmlDoc);\n\t\t\tif (!xml || xml.tagName != toptag) throw \"Invalid XML data\";\n\n\t\t\tvar skey = xml.getAttribute(\"dhx_security\");\n\t\t\tif (skey)\n\t\t\t\tgantt.security_key = skey;\n\n\t\t\treturn xml;\n\t\t},\n\t\tparse: function (text, loader) {\n\t\t\tloader = this._getXML(text, loader);\n\t\t\tvar data = {};\n\n\t\t\tvar evs = data.data = [];\n\t\t\tvar xml = gantt.ajax.xpath(\"//task\", loader);\n\n\t\t\tfor (var i = 0; i < xml.length; i++)\n\t\t\t\tevs[i] = this._xmlNodeToJSON(xml[i]);\n\n\t\t\tdata.collections = this._getCollections(loader);\n\t\t\treturn data;\n\t\t},\n\t\t_copyLink: function (obj) {\n\t\t\treturn \" \";\n\t\t},\n\t\t_copyObject: function (obj) {\n\t\t\treturn \"\";\n\t\t},\n\t\tserialize: function () {\n\t\t\tvar tasks = [];\n\t\t\tvar links = [];\n\n\t\t\tvar json = gantt.json.serialize();\n\t\t\tfor (var i = 0, len = json.data.length; i < len; i++) {\n\t\t\t\ttasks.push(this._copyObject(json.data[i]));\n\t\t\t}\n\t\t\tfor (var i = 0, len = json.links.length; i < len; i++) {\n\t\t\t\tlinks.push(this._copyLink(json.links[i]));\n\t\t\t}\n\t\t\treturn \"\" + tasks.join(\"\") + \"\" + links.join(\"\") + \"\";\n\t\t}\n\t};\n\n\n\tgantt.oldxml = {\n\t\tparse: function (text, loader) {\n\t\t\tloader = gantt.xml._getXML(text, loader, \"projects\");\n\t\t\tvar data = {collections: {links: []}};\n\n\t\t\tvar evs = data.data = [];\n\t\t\tvar xml = gantt.ajax.xpath(\"//task\", loader);\n\n\t\t\tfor (var i = 0; i < xml.length; i++) {\n\t\t\t\tevs[i] = gantt.xml._xmlNodeToJSON(xml[i]);\n\t\t\t\tvar parent = xml[i].parentNode;\n\n\t\t\t\tif (parent.tagName == \"project\")\n\t\t\t\t\tevs[i].parent = \"project-\" + parent.getAttribute(\"id\");\n\t\t\t\telse\n\t\t\t\t\tevs[i].parent = parent.parentNode.getAttribute(\"id\");\n\t\t\t}\n\n\t\t\txml = gantt.ajax.xpath(\"//project\", loader);\n\t\t\tfor (var i = 0; i < xml.length; i++) {\n\t\t\t\tvar ev = gantt.xml._xmlNodeToJSON(xml[i], true);\n\t\t\t\tev.id = \"project-\" + ev.id;\n\t\t\t\tevs.push(ev);\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < evs.length; i++) {\n\t\t\t\tvar ev = evs[i];\n\t\t\t\tev.start_date = ev.startdate || ev.est;\n\t\t\t\tev.end_date = ev.enddate;\n\t\t\t\tev.text = ev.name;\n\t\t\t\tev.duration = ev.duration / 8;\n\t\t\t\tev.open = 1;\n\t\t\t\tif (!ev.duration && !ev.end_date) ev.duration = 1;\n\t\t\t\tif (ev.predecessortasks)\n\t\t\t\t\tdata.collections.links.push({\n\t\t\t\t\t\ttarget: ev.id,\n\t\t\t\t\t\tsource: ev.predecessortasks,\n\t\t\t\t\t\ttype: gantt.config.links.finish_to_start\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn data;\n\t\t},\n\t\tserialize: function () {\n\t\t\tgantt.message(\"Serialization to 'old XML' is not implemented\");\n\t\t}\n\t};\n\n\tgantt.serverList = function (name, array) {\n\t\tif (array) {\n\t\t\tthis.serverList[name] = array.slice(0);\n\t\t} else if (!this.serverList[name]) {\n\t\t\tthis.serverList[name] = [];\n\t\t}\n\t\treturn this.serverList[name];\n\t};\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/load.js\n// module id = 77\n// module chunks = 0","var CalendarManager = require(\"./calendar_manager\"),\n\tTimeCalculator = require(\"./time_calculator\"),\n\tworktimeFacadeFactory = require(\"../facades/worktime_calendars\"),\n\tutils = require(\"../../utils/utils\");\n\nmodule.exports = function (gantt) {\n\tvar manager = new CalendarManager(gantt),\n\ttimeCalculator = new TimeCalculator(manager);\n\tvar facade = worktimeFacadeFactory.create(manager, timeCalculator);\n\tutils.mixin(gantt, facade);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/worktime/work_time.js\n// module id = 78\n// module chunks = 0","var utils = require(\"../../utils/utils\");\nvar createArgumentsHelper = require(\"./calendar_arguments_helper\");\nvar CalendarWorktimeStrategy = require(\"./strategy/calendar_strategy\");\n\nfunction CalendarManager (gantt){\n\tthis.$gantt = gantt;\n\tthis._calendars = {};\n}\n\nCalendarManager.prototype = {\n\t_calendars: {},\n\t_getDayHoursForMultiple: function (calendars, date) {\n\t\tvar units = [],\n\t\t\ttick = true,\n\t\t\tcurrPos = 0,\n\t\t\tis_work_hour = false,\n\t\t\tstart = this.$gantt.date.day_start(new Date(date));\n\t\tfor (var hour = 0; hour < 24; hour++) {\n\t\t\tis_work_hour = calendars.reduce(function (acc, calendar) {\n\t\t\t\treturn acc && calendar._is_work_hour(start);\n\t\t\t}, true);\n\t\t\tif (is_work_hour) {\n\t\t\t\tif (tick) {\n\t\t\t\t\tunits[currPos] = hour;\n\t\t\t\t\tunits[currPos + 1] = (hour + 1);\n\t\t\t\t\tcurrPos += 2;\n\t\t\t\t} else {\n\t\t\t\t\tunits[currPos - 1] += 1;\n\t\t\t\t}\n\t\t\t\ttick = false;\n\t\t\t} else if (!tick) {\n\t\t\t\ttick = true;\n\t\t\t}\n\t\t\tstart = this.$gantt.date.add(start, 1, \"hour\");\n\t\t}\n\t\tif (!units.length)\n\t\t\tunits = false;\n\t\treturn units;\n\t},\n\tmergeCalendars: function () {\n\t\tvar newCalendar = this.createCalendar(),\n\t\t\tday,\n\t\t\tunits = [];\n\t\tvar calendars = Array.prototype.slice.call(arguments, 0);\n\t\tnewCalendar.worktime.hours = [0, 24];\n\t\tnewCalendar.worktime.dates = {};\n\t\tvar start = this.$gantt.date.day_start(new Date(259200000)); // 1970 day=0\n\t\tfor (day = 0; day < 7; day++) {\n\t\t\tunits = this._getDayHoursForMultiple(calendars, start);\n\t\t\tnewCalendar.worktime.dates[day] = units;\n\t\t\tstart = this.$gantt.date.add(start, 1, \"day\");\n\t\t}\n\t\tfor (var i = 0; i < calendars.length; i++) {\n\t\t\tfor (var value in calendars[i].worktime.dates) if (+value > 10000) {\n\t\t\t\tunits = this._getDayHoursForMultiple(calendars, new Date(+value));\n\t\t\t\tnewCalendar.worktime.dates[value] = units;\n\t\t\t}\n\t\t}\n\t\treturn newCalendar;\n\t},\n\n\t_convertWorktimeSettings: function (settings) {\n\t\tvar days = settings.days;\n\t\tif (days) {\n\t\t\tsettings.dates = settings.dates || {};\n\t\t\tfor (var i = 0; i < days.length; i++) {\n\t\t\t\tsettings.dates[i] = days[i];\n\t\t\t\tif (!(days[i] instanceof Array)) {\n\t\t\t\t\tsettings.dates[i] = !!days[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tdelete settings.days;\n\t\t}\n\t\treturn settings;\n\t},\n\n\tcreateCalendar: function (parentCalendar) {\n\t\tvar settings;\n\n\t\tif (!parentCalendar) {\n\t\t\tparentCalendar = {};\n\t\t}\n\n\t\tif (parentCalendar.worktime) {\n\t\t\tsettings = utils.copy(parentCalendar.worktime);\n\t\t} else {\n\t\t\tsettings = utils.copy(parentCalendar);\n\t\t}\n\n\t\tvar defaults = utils.copy(this.defaults.fulltime.worktime);\n\t\tutils.mixin(settings, defaults);\n\n\t\tvar id = utils.uid();\n\t\tvar calendar = {\n\t\t\tid: id + \"\",\n\t\t\tworktime: this._convertWorktimeSettings(settings)\n\t\t};\n\n\t\tvar apiCore = new CalendarWorktimeStrategy(this.$gantt, createArgumentsHelper(this.$gantt));\n\t\tutils.mixin(apiCore, calendar);\n\n\t\t// validate/check if empty calendar\n\t\tif (!apiCore._tryChangeCalendarSettings(function () {\n\t\t\t})) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn apiCore;\n\t\t}\n\t},\n\n\tgetCalendar: function (id) {\n\t\tid = id || \"global\";\n\t\tthis.createDefaultCalendars();\n\t\treturn this._calendars[id];\n\t},\n\n\tgetCalendars: function () {\n\t\tvar res = [];\n\t\tfor (var i in this._calendars) {\n\t\t\tres.push(this.getCalendar(i));\n\t\t}\n\t\treturn res;\n\t},\n\n\tgetTaskCalendar: function (task) {\n\t\tvar config = this.$gantt.$services.config();\n\t\tif (!task) {\n\t\t\treturn this.getCalendar();\n\t\t} else if (task[config.calendar_property]) {\n\t\t\treturn this.getCalendar(task[config.calendar_property]);\n\t\t} else if (config.resource_calendars) {\n\n\t\t\tfor (var field in config.resource_calendars) {\n\t\t\t\tvar resource = config.resource_calendars[field];\n\t\t\t\tif (task[field]) {\n\t\t\t\t\tvar calendarId = resource[task[field]];\n\t\t\t\t\tif (calendarId) {\n\t\t\t\t\t\treturn this.getCalendar(calendarId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.getCalendar();\n\t},\n\n\taddCalendar: function (calendar) { // puts new calendar to Global Storage - gantt.calendarManager._calendars {}\n\t\tif (!(calendar instanceof CalendarWorktimeStrategy)) {\n\t\t\tvar id = calendar.id;\n\t\t\tcalendar = this.createCalendar(calendar);\n\t\t\tcalendar.id = id;\n\t\t}\n\t\tvar config = this.$gantt.$services.config();\n\n\t\tcalendar.id = calendar.id || utils.uid();\n\t\tthis._calendars[calendar.id] = calendar;\n\t\tif (!config.worktimes)\n\t\t\tconfig.worktimes = {};\n\t\tconfig.worktimes[calendar.id] = calendar.worktime;\n\t\treturn calendar.id;\n\t},\n\n\tdeleteCalendar: function (calendar) {\n\t\tvar config = this.$gantt.$services.config();\n\t\tif (!calendar) return false;\n\t\tif (this._calendars[calendar]) {\n\t\t\tdelete this._calendars[calendar];\n\t\t\tif (config.worktimes && config.worktimes[calendar])\n\t\t\t\tdelete config.worktimes[calendar];\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t},\n\n\trestoreConfigCalendars: function (configs) {\n\t\tfor (var i in configs) {\n\t\t\tif (this._calendars[i])\n\t\t\t\tcontinue;\n\n\t\t\tvar settings = configs[i];\n\t\t\tvar calendar = this.createCalendar(settings);\n\t\t\tcalendar.id = i;\n\t\t\tthis.addCalendar(calendar);\n\t\t}\n\t},\n\n\tdefaults: {\n\t\tglobal: {\n\t\t\tid: \"global\",\n\t\t\tworktime: {\n\t\t\t\thours: [8, 17],\n\t\t\t\tdays: [0, 1, 1, 1, 1, 1, 0]\n\t\t\t}\n\t\t},\n\t\tfulltime: {\n\t\t\tid: \"fulltime\",\n\t\t\tworktime: {\n\t\t\t\thours: [0, 24],\n\t\t\t\tdays: [1, 1, 1, 1, 1, 1, 1]\n\t\t\t}\n\t\t}\n\t},\n\n\tcreateDefaultCalendars: function () {\n\t\tvar config = this.$gantt.$services.config();\n\t\tthis.restoreConfigCalendars(this.defaults);\n\t\tthis.restoreConfigCalendars(config.worktimes);\n\t}\n};\n\nmodule.exports = CalendarManager;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/worktime/calendar_manager.js\n// module id = 79\n// module chunks = 0","var Cache = require(\"./calendar_workunit_cache\"),\n\tutils = require(\"../../../utils/utils\");\n\nfunction CalendarWorkTimeStrategy(gantt, argumentsHelper){\n\tthis.argumentsHelper = argumentsHelper;\n\tthis.$gantt = gantt;\n\tthis._workingUnitsCache = new Cache();\n}\n\nCalendarWorkTimeStrategy.prototype = {\n\tunits: [\n\t\t\"year\",\n\t\t\"month\",\n\t\t\"week\",\n\t\t\"day\",\n\t\t\"hour\",\n\t\t\"minute\"\n\t],\n\t// cache previously calculated worktime\n\t_getUnitOrder: function (unit) {\n\t\tfor (var i = 0, len = this.units.length; i < len; i++) {\n\t\t\tif (this.units[i] == unit)\n\t\t\t\treturn i;\n\t\t}\n\t},\n\t_timestamp: function (settings) {\n\n\t\tvar timestamp = null;\n\t\tif ((settings.day || settings.day === 0)) {\n\t\t\ttimestamp = settings.day;\n\t\t} else if (settings.date) {\n\t\t\t// store worktime datestamp in utc so it could be recognized in different timezones (e.g. opened locally and sent to the export service in different timezone)\n\t\t\ttimestamp = Date.UTC(settings.date.getFullYear(), settings.date.getMonth(), settings.date.getDate());\n\t\t}\n\t\treturn timestamp;\n\t},\n\t_checkIfWorkingUnit: function (date, unit, order) {\n\t\tif (order === undefined) {\n\t\t\torder = this._getUnitOrder(unit);\n\t\t}\n\n\t\t// disable worktime check for custom time units\n\t\tif (order === undefined) {\n\t\t\treturn true;\n\t\t}\n\t\tif (order) {\n\t\t\t//check if bigger time unit is a work time (hour < day < month...)\n\t\t\t//i.e. don't check particular hour if the whole day is marked as not working\n\t\t\tif (!this._isWorkTime(date, this.units[order - 1], order - 1))\n\t\t\t\treturn false;\n\t\t}\n\t\tif (!this[\"_is_work_\" + unit])\n\t\t\treturn true;\n\t\treturn this[\"_is_work_\" + unit](date);\n\t},\n\t//checkings for particular time units\n\t//methods for month-year-week can be defined, otherwise always return 'true'\n\t_is_work_day: function (date) {\n\t\tvar val = this._getWorkHours(date);\n\n\t\tif (val instanceof Array) {\n\t\t\treturn val.length > 0;\n\t\t}\n\t\treturn false;\n\t},\n\t_is_work_hour: function (date) {\n\t\tvar hours = this._getWorkHours(date); // [7,12] or []\n\t\tvar hour = date.getHours();\n\t\tfor (var i = 0; i < hours.length; i += 2) {\n\t\t\tif (hours[i + 1] === undefined) {\n\t\t\t\treturn hours[i] == hour;\n\t\t\t} else {\n\t\t\t\tif (hour >= hours[i] && hour < hours[i + 1])\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t},\n\t_internDatesPull: {},\n\t_nextDate: function (start, unit, step) {\n\t\tvar dateHelper = this.$gantt.date;\n\t\treturn dateHelper.add(start, step, unit);\n\n\t\t/*var start_value = +start,\n\t\t\tkey = unit + \"_\" + step;\n\t\tvar interned = this._internDatesPull[key];\n\t\tif(!interned){\n\t\t\tinterned = this._internDatesPull[key] = {};\n\t\t}\n\t\tvar calculated;\n\t\tif(!interned[start_value]){\n\t\t\tinterned[start_value] = calculated = dateHelper.add(start, step, unit);\n\t\t\t//interned[start_value] = dateHelper.add(start, step, unit);\n\t\t}\n\t\treturn calculated || interned[start_value];*/\n\t},\n\t_getWorkUnitsBetweenGeneric: function (from, to, unit, step) {\n\t\tvar dateHelper = this.$gantt.date;\n\t\tvar start = new Date(from),\n\t\t\tend = new Date(to);\n\t\tstep = step || 1;\n\t\tvar units = 0;\n\n\n\t\tvar next = null;\n\t\tvar stepStart,\n\t\t\tstepEnd;\n\n\t\t// calculating decimal durations, i.e. 2016-09-20 00:05:00 - 2016-09-20 01:00:00 ~ 0.95 instead of 1\n\t\t// and also 2016-09-20 00:00:00 - 2016-09-20 00:05:00 ~ 0.05 instead of 1\n\t\t// durations must be rounded later\n\t\tvar checkFirst = false;\n\t\tstepStart = dateHelper[unit + \"_start\"](new Date(start));\n\t\tif (stepStart.valueOf() != start.valueOf()) {\n\t\t\tcheckFirst = true;\n\t\t}\n\t\tvar checkLast = false;\n\t\tstepEnd = dateHelper[unit + \"_start\"](new Date(to));\n\t\tif (stepEnd.valueOf() != to.valueOf()) {\n\t\t\tcheckLast = true;\n\t\t}\n\n\t\tvar isLastStep = false;\n\t\twhile (start.valueOf() < end.valueOf()) {\n\t\t\tnext = this._nextDate(start, unit, step);\n\t\t\tisLastStep = (next.valueOf() > end.valueOf());\n\n\t\t\tif (this._isWorkTime(start, unit)) {\n\t\t\t\tif (checkFirst || (checkLast && isLastStep)) {\n\t\t\t\t\tstepStart = dateHelper[unit + \"_start\"](new Date(start));\n\t\t\t\t\tstepEnd = dateHelper.add(stepStart, step, unit);\n\t\t\t\t}\n\n\t\t\t\tif (checkFirst) {\n\t\t\t\t\tcheckFirst = false;\n\t\t\t\t\tnext = this._nextDate(stepStart, unit, step);\n\t\t\t\t\tunits += ((stepEnd.valueOf() - start.valueOf()) / (stepEnd.valueOf() - stepStart.valueOf()));\n\t\t\t\t} else if (checkLast && isLastStep) {\n\t\t\t\t\tcheckLast = false;\n\t\t\t\t\tunits += ((end.valueOf() - start.valueOf()) / (stepEnd.valueOf() - stepStart.valueOf()));\n\n\t\t\t\t} else {\n\t\t\t\t\tunits++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tstart = next;\n\t\t}\n\t\treturn units;\n\t},\n\t_getHoursPerDay: function (date) {\n\t\tvar hours = this._getWorkHours(date);\n\t\tvar res = 0;\n\t\tfor (var i = 0; i < hours.length; i += 2) {\n\t\t\tres += ((hours[i + 1] - hours[i]) || 0);\n\t\t}\n\t\treturn res;\n\t},\n\t_getWorkHoursForRange: function (from, to) {\n\t\tvar hours = 0;\n\t\tvar start = new Date(from),\n\t\t\tend = new Date(to);\n\n\t\twhile (start.valueOf() < end.valueOf()) {\n\t\t\tif (this._isWorkTime(start, \"day\"))\n\t\t\t\thours += this._getHoursPerDay(start);\n\t\t\tstart = this._nextDate(start, \"day\", 1);\n\t\t}\n\t\treturn hours;\n\t},\n\t_getWorkUnitsBetweenHours: function (from, to, unit, step) {\n\t\tvar start = new Date(from),\n\t\t\tend = new Date(to);\n\t\tstep = step || 1;\n\n\t\tvar firstDayStart = new Date(start);\n\t\tvar firstDayEnd = this.$gantt.date.add(this.$gantt.date.day_start(new Date(start)), 1, \"day\");\n\n\t\tif (end.valueOf() <= firstDayEnd.valueOf()) {\n\t\t\treturn this._getWorkUnitsBetweenGeneric(from, to, unit, step);\n\t\t} else {\n\n\t\t\tvar lastDayStart = this.$gantt.date.day_start(new Date(end));\n\t\t\tvar lastDayEnd = end;\n\n\t\t\tvar startPart = this._getWorkUnitsBetweenGeneric(firstDayStart, firstDayEnd, unit, step);\n\t\t\tvar endPart = this._getWorkUnitsBetweenGeneric(lastDayStart, lastDayEnd, unit, step);\n\n\t\t\tvar hourRange = this._getWorkHoursForRange(firstDayEnd, lastDayStart);\n\t\t\thourRange = ((hourRange / step) + startPart + endPart);\n\n\t\t\treturn hourRange;\n\t\t}\n\t},\n\n\t_getCalendar: function () {\n\t\treturn this.worktime;\n\t},\n\t_setCalendar: function (settings) {\n\t\tthis.worktime = settings;\n\t},\n\n\t_tryChangeCalendarSettings: function (payload) {\n\t\tvar backup = JSON.stringify(this._getCalendar());\n\t\tpayload();\n\t\tif (this._isEmptyCalendar(this._getCalendar())) {\n\t\t\tthis.$gantt.assert(false, \"Invalid calendar settings, no worktime available\");\n\t\t\tthis._setCalendar(JSON.parse(backup));\n\t\t\tthis._workingUnitsCache.clear();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\n\t},\n\n\t_isEmptyCalendar: function (settings) {\n\t\tvar result = false,\n\t\t\tdatesArray = [],\n\t\t\tisFullWeekSet = true;\n\t\tfor (var i in settings.dates) {\n\t\t\tresult |= !!settings.dates[i];\n\t\t\tdatesArray.push(i);\n\t\t}\n\n\t\tvar checkFullArray = [];\n\t\tfor (var i = 0; i < datesArray.length; i++) {\n\t\t\tif (datesArray[i] < 10) {\n\t\t\t\tcheckFullArray.push(datesArray[i]);\n\t\t\t}\n\t\t}\n\t\tcheckFullArray.sort();\n\n\t\tfor (var i = 0; i < 7; i++) {\n\t\t\tif (checkFullArray[i] != i)\n\t\t\t\tisFullWeekSet = false;\n\t\t}\n\t\tif (isFullWeekSet)\n\t\t\treturn !result;\n\t\treturn !(result || !!settings.hours); // can still return false if separated dates are set to true\n\t},\n\n\tgetWorkHours: function () {\n\t\tvar config = this.argumentsHelper.getWorkHoursArguments.apply(this.argumentsHelper, arguments);\n\t\treturn this._getWorkHours(config.date);\n\t},\n\t_getWorkHours: function (date) {\n\t\tvar t = this._timestamp({date: date});\n\t\tvar hours = true;\n\t\tvar calendar = this._getCalendar();\n\t\tif (calendar.dates[t] !== undefined) {\n\t\t\thours = calendar.dates[t];//custom day\n\t\t} else if (calendar.dates[date.getDay()] !== undefined) {\n\t\t\thours = calendar.dates[date.getDay()];//week day\n\t\t}\n\t\tif (hours === true) {\n\t\t\treturn calendar.hours;\n\t\t} else if (hours) {\n\t\t\treturn hours;\n\t\t}\n\t\treturn [];\n\t},\n\n\tsetWorkTime: function (settings) {\n\t\treturn this._tryChangeCalendarSettings(utils.bind(function () {\n\t\t\tvar hours = settings.hours !== undefined ? settings.hours : true;\n\t\t\tvar timestamp = this._timestamp(settings);\n\t\t\tif (timestamp !== null) {\n\t\t\t\tthis._getCalendar().dates[timestamp] = hours;\n\t\t\t} else {\n\t\t\t\tthis._getCalendar().hours = hours;\n\t\t\t}\n\t\t\tthis._workingUnitsCache.clear();\n\t\t}, this));\n\t},\n\n\tunsetWorkTime: function (settings) {\n\t\treturn this._tryChangeCalendarSettings(utils.bind(function () {\n\t\t\tif (!settings) {\n\t\t\t\tthis.reset_calendar();\n\t\t\t} else {\n\n\t\t\t\tvar timestamp = this._timestamp(settings);\n\n\t\t\t\tif (timestamp !== null) {\n\t\t\t\t\tdelete this._getCalendar().dates[timestamp];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Clear work units cache\n\t\t\tthis._workingUnitsCache.clear();\n\t\t}, this));\n\t},\n\n\t_isWorkTime: function (date, unit, order) {\n\t\t//Check if this item has in the cache\n\t\tvar is_work_unit = this._workingUnitsCache.get(unit, date);\n\n\t\tif (is_work_unit == -1) {\n\t\t\t// calculate if not cached\n\t\t\tis_work_unit = this._checkIfWorkingUnit(date, unit, order);\n\t\t\tthis._workingUnitsCache.put(unit, date, is_work_unit);\n\t\t}\n\n\t\treturn is_work_unit;\n\t},\n\n\tisWorkTime: function () {\n\t\tvar config = this.argumentsHelper.isWorkTimeArguments.apply( this.argumentsHelper, arguments);\n\t\treturn this._isWorkTime(config.date, config.unit);\n\t},\n\n\tcalculateDuration: function () {\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply( this.argumentsHelper, arguments);\n\n\t\tif (!config.unit) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar res = 0;\n\t\tif (config.unit == \"hour\") {\n\t\t\tres = this._getWorkUnitsBetweenHours(config.start_date, config.end_date, config.unit, config.step);\n\t\t} else {\n\t\t\tres = this._getWorkUnitsBetweenGeneric(config.start_date, config.end_date, config.unit, config.step);\n\t\t}\n\n\t\t// getDuration.. returns decimal durations\n\t\treturn Math.round(res);\n\t},\n\thasDuration: function () {\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply( this.argumentsHelper, arguments);\n\n\t\tvar from = config.start_date,\n\t\t\tto = config.end_date,\n\t\t\tunit = config.unit,\n\t\t\tstep = config.step;\n\n\t\tif (!unit) {\n\t\t\treturn false;\n\t\t}\n\t\tvar start = new Date(from),\n\t\t\tend = new Date(to);\n\t\tstep = step || 1;\n\n\t\twhile (start.valueOf() < end.valueOf()) {\n\t\t\tif (this._isWorkTime(start, unit))\n\t\t\t\treturn true;\n\t\t\tstart = this._nextDate(start, unit, step);\n\t\t}\n\t\treturn false;\n\t},\n\n\tcalculateEndDate: function () {\n\t\tvar config = this.argumentsHelper.calculateEndDateArguments.apply( this.argumentsHelper, arguments);\n\n\t\tvar from = config.start_date,\n\t\t\tduration = config.duration,\n\t\t\tunit = config.unit,\n\t\t\tstep = config.step;\n\n\t\tvar mult = (config.duration >= 0) ? 1 : -1;\n\t\treturn this._calculateEndDate(from, duration, unit, step * mult);\n\t},\n\t_calculateEndDate: function (from, duration, unit, step) {\n\t\tif (!unit)\n\t\t\treturn false;\n\n\t\tvar start = new Date(from),\n\t\t\tadded = 0;\n\t\tstep = step || 1;\n\t\tduration = Math.abs(duration * 1);\n\n\t\twhile (added < duration) {\n\t\t\tvar next = this._nextDate(start, unit, step);\n\t\t\t//if(this.isWorkTime(step > 0 ? start : next, unit))\n\t\t\tif (this._isWorkTime(step > 0 ? new Date(next.valueOf() - 1) : new Date(next.valueOf() + 1), unit))\n\t\t\t\tadded++;\n\t\t\tstart = next;\n\t\t}\n\t\treturn start;\n\t},\n\n\tgetClosestWorkTime: function () {\n\t\tvar config = this.argumentsHelper.getClosestWorkTimeArguments.apply( this.argumentsHelper, arguments);\n\t\treturn this._getClosestWorkTime(config);\n\t},\n\n\t_getClosestWorkTime: function (settings) {\n\t\tif (this._isWorkTime(settings.date, settings.unit))\n\t\t\treturn settings.date;\n\n\t\tvar unit = settings.unit;\n\n\t\tvar curr = this.$gantt.date[unit + '_start'](settings.date);\n\n\t\tvar future_target = new Date(curr),\n\t\t\tprev_target = new Date(curr),\n\t\t\ttick = true,\n\t\t\tmaximum_loop = 3000,//be extra sure we won't fall into infinite loop, 3k seems big enough\n\t\t\tcount = 0,\n\t\t\tboth_directins = (settings.dir == 'any' || !settings.dir);\n\n\t\tvar inc = 1;\n\t\tif (settings.dir == 'past')\n\t\t\tinc = -1;\n\n\t\t//will seek closest working hour in future or in past, one step in one direction per iteration\n\t\twhile (!this._isWorkTime(curr, unit)) {\n\n\t\t\tif (both_directins) {\n\t\t\t\tcurr = tick ? future_target : prev_target;\n\t\t\t\tinc = inc * (-1);\n\t\t\t}\n\t\t\tvar tzOffset = curr.getTimezoneOffset();\n\t\t\tcurr = this.$gantt.date.add(curr, inc, unit);\n\n\t\t\tcurr = this.$gantt._correct_dst_change(curr, tzOffset, inc, unit);\n\t\t\tif (this.$gantt.date[unit + '_start'])\n\t\t\t\tcurr = this.$gantt.date[unit + '_start'](curr);\n\n\t\t\tif (both_directins) {\n\t\t\t\tif (tick) {\n\t\t\t\t\tfuture_target = curr;\n\t\t\t\t} else {\n\t\t\t\t\tprev_target = curr;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttick = !tick;\n\t\t\tcount++;\n\t\t\tif (count > maximum_loop) {\n\t\t\t\tthis.$gantt.assert(false, \"Invalid working time check\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (curr == prev_target || settings.dir == 'past') {\n\t\t\tcurr = this.$gantt.date.add(curr, 1, unit);\n\t\t}\n\n\t\treturn curr;\n\t}\n};\n\nmodule.exports = CalendarWorkTimeStrategy;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/worktime/strategy/calendar_strategy.js\n// module id = 80\n// module chunks = 0","function WorkUnitsCache() {\n\tthis._cache = {};\n}\n\nWorkUnitsCache.prototype = {\n\t// cache previously calculated worktime\n\tget: function (unit, date) {\n\t\tvar result = -1;// default value (if not existed in the cache)\n\n\t\tvar cache = this._cache;\n\t\tif (cache && cache[unit]) {\n\t\t\tvar units = cache[unit];\n\t\t\tvar time = date.getTime();\n\t\t\tif (units[time] !== undefined)\n\t\t\t\tresult = units[time];\n\t\t}\n\t\treturn result;\n\t},\n\n\tput: function (unit, date, value) {\n\t\tif (!unit || !date) return false;\n\n\t\tvar cache = this._cache;\n\n\t\tvar time = date.getTime();\n\n\t\tvalue = !!value;\n\n\t\tif (!cache) return false;\n\t\tif (!cache[unit]) cache[unit] = {};\n\t\tcache[unit][time] = value;\n\t\treturn true;\n\t},\n\n\tclear: function () {\n\t\tthis._cache = {};\n\t}\n};\n\nmodule.exports = WorkUnitsCache;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/worktime/strategy/calendar_workunit_cache.js\n// module id = 81\n// module chunks = 0","var createArgumentsHelper = require(\"./calendar_arguments_helper\"),\n\tNoWorkTimeCalendar = require(\"./strategy/no_work_time\");\n\nfunction TimeCalculator(calendarManager){\n\n\tthis.$gantt = calendarManager.$gantt;\n\tthis.argumentsHelper = createArgumentsHelper(this.$gantt);\n\tthis.calendarManager = calendarManager;\n\tthis.$disabledCalendar = new NoWorkTimeCalendar(this.$gantt, this.argumentsHelper);\n}\n\nTimeCalculator.prototype = {\n\t_getCalendar: function (config) {\n\t\tvar calendar;\n\t\tif (!this.$gantt.$services.config().work_time) {\n\t\t\tcalendar = this.$disabledCalendar;\n\t\t} else {\n\t\t\tvar manager = this.calendarManager;\n\t\t\tif (config.task) {\n\t\t\t\tcalendar = manager.getTaskCalendar(config.task);\n\t\t\t} else if (config.id) {\n\t\t\t\tcalendar = manager.getTaskCalendar(config);\n\t\t\t} else if (config.calendar) {\n\t\t\t\tcalendar = config.calendar;\n\t\t\t}\n\t\t\tif (!calendar) {\n\t\t\t\tcalendar = manager.getTaskCalendar();\n\t\t\t}\n\t\t}\n\t\treturn calendar;\n\t},\n\n\tgetWorkHours: function (config) {\n\t\tconfig = this.argumentsHelper.getWorkHoursArguments.apply(this.argumentsHelper, arguments);\n\n\t\tvar calendar = this._getCalendar(config);\n\n\t\treturn calendar.getWorkHours(config.date);\n\t},\n\n\tsetWorkTime: function (config, calendar) {\n\t\tconfig = this.argumentsHelper.setWorkTimeArguments.apply(this.argumentsHelper, arguments);\n\n\t\tif (!calendar)\n\t\t\tcalendar = this.calendarManager.getCalendar(); // Global\n\t\treturn calendar.setWorkTime(config);\n\t},\n\n\tunsetWorkTime: function (config, calendar) {\n\t\tconfig = this.argumentsHelper.unsetWorkTimeArguments.apply(this.argumentsHelper, arguments);\n\n\t\tif (!calendar)\n\t\t\tcalendar = this.calendarManager.getCalendar(); // Global\n\t\treturn calendar.unsetWorkTime(config);\n\t},\n\tisWorkTime: function (date, unit, task, calendar) {\n\t\tvar config = this.argumentsHelper.isWorkTimeArguments.apply(this.argumentsHelper, arguments);\n\n\t\tcalendar = this._getCalendar(config);\n\t\treturn calendar.isWorkTime(config);\n\t},\n\tgetClosestWorkTime: function (config) {\n\t\tconfig = this.argumentsHelper.getClosestWorkTimeArguments.apply(this.argumentsHelper, arguments);\n\n\t\tvar calendar = this._getCalendar(config);\n\n\t\treturn calendar.getClosestWorkTime(config);\n\t},\n\n\tcalculateDuration: function () { // start_date_date, end_date, task\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments);\n\n\n\t\tvar calendar = this._getCalendar(config);\n\t\treturn calendar.calculateDuration(config);\n\t},\n\thasDuration: function () {\n\t\tvar config = this.argumentsHelper.hasDurationArguments.apply(this.argumentsHelper, arguments);\n\n\t\tvar calendar = this._getCalendar(config);\n\n\t\treturn calendar.hasDuration(config);\n\t},\n\tcalculateEndDate: function (config) { // start_date, duration, unit, task\n\t\tvar config = this.argumentsHelper.calculateEndDateArguments.apply(this.argumentsHelper, arguments);\n\n\t\tvar calendar = this._getCalendar(config);\n\t\treturn calendar.calculateEndDate(config);\n\t}\n};\n\nmodule.exports = TimeCalculator;\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/worktime/time_calculator.js\n// module id = 82\n// module chunks = 0","function CalendarDisabledTimeStrategy(gantt, argumentsHelper){\n\tthis.argumentsHelper = argumentsHelper;\n\tthis.$gantt = gantt;\n}\n\nCalendarDisabledTimeStrategy.prototype = {\n\tgetWorkHours: function () {\n\t\treturn [0, 24];\n\t},\n\tsetWorkTime: function () {\n\t\treturn true;\n\t},\n\tunsetWorkTime: function () {\n\t\treturn true;\n\t},\n\tisWorkTime: function () {\n\t\treturn true;\n\t},\n\tgetClosestWorkTime: function (config) {\n\t\tvar config = this.argumentsHelper.getClosestWorkTimeArguments.apply(this.argumentsHelper, arguments);\n\t\treturn config.date;\n\t},\n\n\tcalculateDuration: function () {\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments);\n\t\tvar from = config.start_date,\n\t\t\tto = config.end_date,\n\t\t\tunit = config.unit,\n\t\t\tstep = config.step;\n\n\t\treturn this._calculateDuration(from, to, unit, step);\n\t},\n\t_calculateDuration: function (start, end, unit, step) {\n\t\tvar dateHelper = this.$gantt.date;\n\t\tvar fixedUnits = {\n\t\t\t\"week\": 1000 * 60 * 60 * 24 * 7,\n\t\t\t\"day\": 1000 * 60 * 60 * 24,\n\t\t\t\"hour\": 1000 * 60 * 60,\n\t\t\t\"minute\": 1000 * 60\n\t\t};\n\n\t\tvar res = 0;\n\t\tif (fixedUnits[unit]) {\n\t\t\tres = Math.round((end - start) / (step * fixedUnits[unit]));\n\t\t} else {\n\t\t\tvar from = new Date(start),\n\t\t\t\tto = new Date(end);\n\t\t\twhile (from.valueOf() < to.valueOf()) {\n\t\t\t\tres += 1;\n\t\t\t\tfrom = dateHelper.add(from, step, unit);\n\t\t\t}\n\n\t\t\tif (from.valueOf() != end.valueOf()) {\n\t\t\t\tres += (to - from) / (dateHelper.add(from, step, unit) - from);\n\t\t\t}\n\t\t}\n\n\t\treturn Math.round(res);\n\t},\n\n\thasDuration: function () {\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments);\n\t\tvar from = config.start_date,\n\t\t\tto = config.end_date,\n\t\t\tunit = config.unit,\n\t\t\tstep = config.step;\n\n\t\tif (!unit) {\n\t\t\treturn false;\n\t\t}\n\t\tfrom = new Date(from);\n\t\tto = new Date(to);\n\n\t\treturn (from.valueOf() < to.valueOf());\n\t},\n\n\tcalculateEndDate: function () {\n\t\tvar config = this.argumentsHelper.calculateEndDateArguments.apply(this.argumentsHelper, arguments);\n\n\t\tvar start = config.start_date,\n\t\t\tduration = config.duration,\n\t\t\tunit = config.unit,\n\t\t\tstep = config.step;\n\n\t\treturn this.$gantt.date.add(start, step * duration, unit);\n\t}\n};\n\nmodule.exports = CalendarDisabledTimeStrategy;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/worktime/strategy/no_work_time.js\n// module id = 83\n// module chunks = 0","// TODO: rework public api for date methods\nvar utils = require(\"../../utils/utils\");\n\nvar createWorktimeFacade = function(calendarManager, timeCalculator){\n\treturn {\n\t\tgetWorkHours: function (date) {\n\t\t\treturn timeCalculator.getWorkHours(date);\n\t\t},\n\n\t\tsetWorkTime: function (config) {\n\t\t\treturn timeCalculator.setWorkTime(config);\n\t\t},\n\n\t\tunsetWorkTime: function (config) {\n\t\t\ttimeCalculator.unsetWorkTime(config);\n\t\t},\n\n\t\tisWorkTime: function (date, unit, task) {\n\t\t\treturn timeCalculator.isWorkTime(date, unit, task);\n\t\t},\n\n\t\tgetClosestWorkTime: function (config) {\n\t\t\treturn timeCalculator.getClosestWorkTime(config);\n\t\t},\n\n\t\tcalculateDuration: function (start_date, end_date, task) {\n\t\t\treturn timeCalculator.calculateDuration(start_date, end_date, task);\n\t\t},\n\t\t_hasDuration: function (start_date, end_date, task) {\n\t\t\treturn timeCalculator.hasDuration(start_date, end_date, task);\n\t\t},\n\n\t\tcalculateEndDate: function (start, duration, unit, task) {\n\t\t\treturn timeCalculator.calculateEndDate(start, duration, unit, task);\n\t\t},\n\n\t\tcreateCalendar: utils.bind(calendarManager.createCalendar, calendarManager),\n\t\taddCalendar: utils.bind(calendarManager.addCalendar, calendarManager),\n\t\tgetCalendar: utils.bind(calendarManager.getCalendar, calendarManager),\n\t\tgetCalendars: utils.bind(calendarManager.getCalendars, calendarManager),\n\t\tgetTaskCalendar: utils.bind(calendarManager.getTaskCalendar, calendarManager),\n\t\tdeleteCalendar: utils.bind(calendarManager.deleteCalendar, calendarManager)\n\t};\n};\n\n\nmodule.exports = { create: createWorktimeFacade };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/facades/worktime_calendars.js\n// module id = 84\n// module chunks = 0","var dateHelper = require(\"../utils/date_helpers\"),\n\thelpers = require(\"../utils/helpers\");\n\nmodule.exports = function(gantt) {\n\n\tgantt.isUnscheduledTask = function (task) {\n\t\treturn (!!task.unscheduled || !task.start_date);\n\t};\n\n\tgantt._isAllowedUnscheduledTask = function (task) {\n\t\treturn !!(task.unscheduled && gantt.config.show_unscheduled);\n\t};\n\n\tgantt.isTaskVisible = function (id) {\n\t\tif (!this.isTaskExists(id))\n\t\t\treturn false;\n\n\t\tvar task = this.getTask(id),\n\t\t\ttype = this.getTaskType(task.type);\n\n\t\tif (!((+task.start_date <= +this._max_date && +task.end_date >= +this._min_date) || gantt._isAllowedUnscheduledTask(task))){\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !!(gantt.getGlobalTaskIndex(id) >= 0);\n\t};\n\n\tgantt._defaultTaskDate = function (item, parent_id) {\n\t\tvar parent = (parent_id && parent_id != this.config.root_id) ? this.getTask(parent_id) : false,\n\t\t\tstartDate = '';\n\t\tif (parent) {\n\t\t\tstartDate = parent.start_date;\n\t\t} else {\n\t\t\tvar first = this.getTaskByIndex(0);\n\t\t\tstartDate = first ? (first.start_date ? first.start_date : (first.end_date ? this.calculateEndDate({\n\t\t\t\tstart_date: first.end_date,\n\t\t\t\tduration: -this.config.duration_step\n\t\t\t}) : '')) : this.config.start_date || this.getState().min_date;\n\t\t}\n\t\tgantt.assert(startDate, \"Invalid dates\");\n\t\treturn new Date(startDate);\n\t};\n\n\tgantt._set_default_task_timing = function (task) {\n\t\ttask.start_date = task.start_date || gantt._defaultTaskDate(task, this.getParent(task));\n\t\ttask.duration = task.duration || this.config.duration_step;\n\t\ttask.end_date = task.end_date || this.calculateEndDate(task);\n\t};\n\n\tgantt.createTask = function (item, parent, index) {\n\t\titem = item || {};\n\t\tif (!gantt.defined(item.id))\n\t\t\titem.id = gantt.uid();\n\n\t\tif (!item.start_date) {\n\t\t\titem.start_date = gantt._defaultTaskDate(item, parent);\n\t\t}\n\t\tif (item.text === undefined) {\n\t\t\titem.text = gantt.locale.labels.new_task;\n\t\t}\n\t\tif (item.duration === undefined) {\n\t\t\titem.duration = 1;\n\t\t}\n\n\t\tif (parent) {\n\t\t\tthis.setParent(item, parent, true);\n\t\t\tvar parentObj = this.getTask(parent);\n\t\t\tparentObj.$open = true;\n\t\t}\n\n\t\tif (!this.callEvent(\"onTaskCreated\", [item])) {\n\t\t\treturn null;\n\t\t}\n\t\tif (this.config.details_on_create) {\n\t\t\titem.$new = true;\n\t\t\tthis.silent(function(){\n\t\t\t\tgantt.$data.tasksStore.addItem(item, index);\n\t\t\t});\n\t\t\tthis.selectTask(item.id);\n\t\t\tthis.refreshData();\n\t\t\tthis.showLightbox(item.id);\n\t\t} else {\n\t\t\tif (this.addTask(item, parent, index)) {\n\t\t\t\tthis.showTask(item.id);\n\t\t\t\tthis.selectTask(item.id);\n\t\t\t}\n\t\t}\n\t\treturn item.id;\n\t};\n\n\tgantt._update_flags = function (oldid, newid) {\n\t\t// TODO: need a proper way to update all possible flags\n\t\tvar store = gantt.$data.tasksStore;\n\t\tif (oldid === undefined) {\n\t\t\tthis._lightbox_id = null;\n\n\t\t\tstore.silent(function(){\n\t\t\t\tstore.unselect();\n\t\t\t});\n\n\t\t\tif (this._tasks_dnd && this._tasks_dnd.drag) {\n\t\t\t\tthis._tasks_dnd.drag.id = null;\n\t\t\t}\n\t\t} else {\n\t\t\tif (this._lightbox_id == oldid)\n\t\t\t\tthis._lightbox_id = newid;\n\n\t\t\tif (store.getSelectedId() == oldid) {\n\t\t\t\tstore.silent(function(){\n\t\t\t\t\tstore.unselect(oldid);\n\t\t\t\t\tstore.select(newid);\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (this._tasks_dnd && this._tasks_dnd.drag && this._tasks_dnd.drag.id == oldid) {\n\t\t\t\tthis._tasks_dnd.drag.id = newid;\n\t\t\t}\n\t\t}\n\t};\n\n\tgantt._get_task_timing_mode = function (task, force) {\n\t\tvar task_type = this.getTaskType(task.type);\n\n\t\tvar state = {\n\t\t\ttype: task_type,\n\t\t\t$no_start: false,\n\t\t\t$no_end: false\n\t\t};\n\n\t\tif (!force && task_type == task.$rendered_type) {\n\t\t\tstate.$no_start = task.$no_start;\n\t\t\tstate.$no_end = task.$no_end;\n\t\t\treturn state;\n\t\t}\n\n\t\tif (task_type == this.config.types.project) {\n\t\t\t//project duration is always defined by children duration\n\t\t\tstate.$no_end = state.$no_start = true;\n\t\t} else if (task_type != this.config.types.milestone) {\n\t\t\t//tasks can have fixed duration, children duration(as projects), or one date fixed, and other defined by nested items\n\t\t\tstate.$no_end = !(task.end_date || task.duration);\n\t\t\tstate.$no_start = !task.start_date;\n\n\t\t\tif (this._isAllowedUnscheduledTask(task)) {\n\t\t\t\tstate.$no_end = state.$no_start = false;\n\t\t\t}\n\t\t}\n\n\t\treturn state;\n\t};\n\n\tgantt._init_task_timing = function (task) {\n\t\tvar task_mode = gantt._get_task_timing_mode(task, true);\n\n\t\tvar dirty = task.$rendered_type != task_mode.type;\n\n\t\tvar task_type = task_mode.type;\n\n\t\tif (dirty) {\n\t\t\ttask.$no_start = task_mode.$no_start;\n\t\t\ttask.$no_end = task_mode.$no_end;\n\t\t\ttask.$rendered_type = task_mode.type;\n\t\t}\n\n\t\tif (dirty && task_type != this.config.types.milestone) {\n\t\t\tif (task_type == this.config.types.project) {\n\t\t\t\t//project duration is always defined by children duration\n\t\t\t\tthis._set_default_task_timing(task);\n\t\t\t}\n\t\t}\n\n\t\tif (task_type == this.config.types.milestone) {\n\t\t\ttask.end_date = task.start_date;\n\t\t}\n\t\tif (task.start_date && task.end_date) {\n\t\t\ttask.duration = this.calculateDuration(task);\n\t\t}\n\t\ttask.duration = task.duration || 0;\n\t};\n\n\tgantt.isSummaryTask = function (task) {\n\t\tvar mode = gantt._get_task_timing_mode(task);\n\n\t\treturn !!(mode.$no_end || mode.$no_start);\n\t};\n\n// downward calculation of project duration\n\tgantt.resetProjectDates = function (task) {\n\t\tvar taskMode = this._get_task_timing_mode(task);\n\t\tif (taskMode.$no_end || taskMode.$no_start) {\n\t\t\tvar dates = this.getSubtaskDates(task.id);\n\t\t\tthis._assign_project_dates(task, dates.start_date, dates.end_date);\n\t\t}\n\t};\n\n\tgantt.getSubtaskDuration = function (task_id) {\n\t\tvar res = 0,\n\t\t\troot = task_id !== undefined ? task_id : gantt.config.root_id;\n\n\t\tthis.eachTask(function (child) {\n\t\t\tif (this.getTaskType(child.type) == gantt.config.types.project || this.isUnscheduledTask(child))\n\t\t\t\treturn;\n\n\t\t\tres += child.duration;\n\t\t}, root);\n\n\t\treturn res;\n\t};\n\n\tgantt.getSubtaskDates = function (task_id) {\n\t\tvar min = null,\n\t\t\tmax = null,\n\t\t\troot = task_id !== undefined ? task_id : gantt.config.root_id;\n\n\t\tthis.eachTask(function (child) {\n\t\t\tif (this.getTaskType(child.type) == gantt.config.types.project || this.isUnscheduledTask(child))\n\t\t\t\treturn;\n\n\t\t\tif ((child.start_date && !child.$no_start) && (!min || min > child.start_date.valueOf()))\n\t\t\t\tmin = child.start_date.valueOf();\n\t\t\tif ((child.end_date && !child.$no_end) && (!max || max < child.end_date.valueOf()))\n\t\t\t\tmax = child.end_date.valueOf();\n\t\t}, root);\n\n\t\treturn {\n\t\t\tstart_date: min ? new Date(min) : null,\n\t\t\tend_date: max ? new Date(max) : null\n\t\t};\n\t};\n\n\tgantt._assign_project_dates = function (task, from, to) {\n\t\tvar taskTiming = this._get_task_timing_mode(task);\n\t\tif (taskTiming.$no_start) {\n\t\t\tif (from && from != Infinity) {\n\t\t\t\ttask.start_date = new Date(from);\n\t\t\t} else {\n\t\t\t\ttask.start_date = this._defaultTaskDate(task, this.getParent(task));\n\t\t\t}\n\t\t}\n\n\t\tif (taskTiming.$no_end) {\n\t\t\tif (to && to != -Infinity) {\n\t\t\t\ttask.end_date = new Date(to);\n\t\t\t} else {\n\t\t\t\ttask.end_date = this.calculateEndDate({\n\t\t\t\t\tstart_date: task.start_date,\n\t\t\t\t\tduration: this.config.duration_step,\n\t\t\t\t\ttask: task\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (taskTiming.$no_start || taskTiming.$no_end) {\n\t\t\tthis._init_task_timing(task);\n\t\t}\n\t};\n\n// upward calculation of project duration\n\tgantt._update_parents = function (taskId, silent) {\n\t\tif (!taskId) return;\n\n\t\tvar task = this.getTask(taskId);\n\t\tvar pid = this.getParent(task);\n\n\t\tvar taskTiming = this._get_task_timing_mode(task);\n\n\t\tvar has_changed = true;\n\n\t\tif (taskTiming.$no_start || taskTiming.$no_end) {\n\t\t\tvar oldStart = task.start_date.valueOf(),\n\t\t\t\toldEnd = task.end_date.valueOf();\n\n\t\t\tgantt.resetProjectDates(task);\n\n\t\t\t// not refresh parent projects if dates hasn't changed\n\t\t\tif (oldStart == task.start_date.valueOf() && oldEnd == task.end_date.valueOf()) {\n\t\t\t\thas_changed = false;\n\t\t\t}\n\n\t\t\tif (has_changed && !silent) {\n\t\t\t\tthis.refreshTask(task.id, true);\n\t\t\t}\n\t\t}\n\n\n\t\tif (has_changed && pid && this.isTaskExists(pid)) {\n\t\t\tthis._update_parents(pid, silent);\n\t\t}\n\t};\n\n\tgantt.roundDate = function (config) {\n\t\tif (dateHelper.isDate(config)) {\n\t\t\tconfig = {\n\t\t\t\tdate: config,\n\t\t\t\tunit: gantt.getScale().unit,\n\t\t\t\tstep: gantt.getScale().step\n\t\t\t};\n\t\t}\n\t\tvar date = config.date,\n\t\t\tsteps = config.step,\n\t\t\tunit = config.unit;\n\n\t\tvar scale = gantt.getScale();\n\t\tvar upper, lower, colIndex;\n\t\tif (unit == scale.unit && steps == scale.step &&\n\t\t\t+date >= +gantt._min_date && +date <= +gantt._max_date) {\n\t\t\t//find date in time scale config\n\t\t\tcolIndex = Math.floor(gantt.columnIndexByDate(date));\n\n\t\t\tif (!gantt.getScale().trace_x[colIndex]) {\n\t\t\t\tcolIndex -= 1;// end of time scale\n\t\t\t\tif(scale.rtl){\n\t\t\t\t\tcolIndex = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlower = new Date(gantt.getScale().trace_x[colIndex]);\n\t\t\tupper = gantt.date.add(lower, steps, unit);\n\t\t} else {\n\t\t\tcolIndex = Math.floor(gantt.columnIndexByDate(date));\n\n\t\t\tupper = gantt.date[unit + \"_start\"](new Date(this._min_date));\n\t\t\tif (scale.trace_x[colIndex]) {\n\t\t\t\tupper = gantt.date[unit + \"_start\"](scale.trace_x[colIndex]);// end of time scale\n\t\t\t}\n\n\t\t\twhile (+upper < +date) {\n\t\t\t\tupper = gantt.date[unit + \"_start\"](gantt.date.add(upper, steps, unit));\n\n\t\t\t\tvar tzOffset = upper.getTimezoneOffset();\n\n\t\t\t\tupper = gantt._correct_dst_change(upper, tzOffset, upper, unit);\n\t\t\t\tif (gantt.date[unit + '_start'])\n\t\t\t\t\tupper = gantt.date[unit + '_start'](upper);\n\t\t\t}\n\n\t\t\tlower = gantt.date.add(upper, -1 * steps, unit);\n\n\t\t}\n\t\tif (config.dir && config.dir == 'future')\n\t\t\treturn upper;\n\t\tif (config.dir && config.dir == 'past')\n\t\t\treturn lower;\n\n\t\tif (Math.abs(date - lower) < Math.abs(upper - date)) {\n\t\t\treturn lower;\n\t\t} else {\n\t\t\treturn upper;\n\t\t}\n\n\t};\n\n\tgantt.correctTaskWorkTime = function (task) {\n\t\tif (gantt.config.work_time && gantt.config.correct_work_time) {\n\t\t\tif (!this.isWorkTime(task.start_date, undefined, task)) {\n\t\t\t\ttask.start_date = this.getClosestWorkTime({date: task.start_date, dir: 'future', task: task});\n\t\t\t\ttask.end_date = this.calculateEndDate(task);\n\t\t\t} else if (!this.isWorkTime(new Date(+task.end_date - 1), undefined, task)) {\n\t\t\t\ttask.end_date = this.calculateEndDate(task);\n\t\t\t}\n\t\t}\n\t};\n\n\tgantt.attachEvent(\"onBeforeTaskUpdate\", function (id, task) {\n\t\tgantt._init_task_timing(task);\n\t\treturn true;\n\t});\n\tgantt.attachEvent(\"onBeforeTaskAdd\", function (id, task) {\n\t\tgantt._init_task_timing(task);\n\t\treturn true;\n\t});\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/data.js\n// module id = 85\n// module chunks = 0","module.exports = function(gantt) {\n\tvar domHelpers = require(\"../utils/dom_helpers\"),\n\t\thelpers = require(\"../utils/helpers\");\n\n\tgantt._lightbox_methods = {};\n\tgantt._lightbox_template = \"
\";\n\n\n\t//TODO: gantt._lightbox_id is changed from data.js and accessed from autoscheduling, check if it can be removed from gantt object\n\tvar state = gantt.$services.getService(\"state\");\n\tstate.registerProvider(\"lightbox\", function(){\n\t\treturn {\n\t\t\tlightbox: gantt._lightbox_id\n\t\t};\n\t});\n\n\tgantt.showLightbox = function (id) {\n\t\tif (!id || gantt.isReadonly(this.getTask(id))) return;\n\t\tif (!this.callEvent(\"onBeforeLightbox\", [id])) return;\n\n\t\tvar task = this.getTask(id);\n\n\t\tvar box = this.getLightbox(this.getTaskType(task.type));\n\t\tthis._center_lightbox(box);\n\t\tthis.showCover();\n\t\tthis._fill_lightbox(id, box);\n\n\t\tthis._waiAria.lightboxVisibleAttr(box);\n\n\t\tthis.callEvent(\"onLightbox\", [id]);\n\t};\n\n\tfunction _is_chart_visible(gantt) {\n\t\tvar timeline = gantt.$ui.getView(\"timeline\");\n\t\tif(timeline && timeline.isVisible()){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tgantt._get_timepicker_step = function () {\n\t\tif (this.config.round_dnd_dates) {\n\t\t\tvar scale = gantt.getScale(),\n\t\t\t\tstep = (helpers.getSecondsInUnit(scale.unit) * scale.step) / 60;//timepicker step is measured in minutes\n\t\t\tif (step >= 60 * 24 || !_is_chart_visible(this)) {\n\t\t\t\tstep = this.config.time_step;\n\t\t\t}\n\t\t\treturn step;\n\t\t}\n\t\treturn this.config.time_step;\n\t};\n\tgantt.getLabel = function (property, key) {\n\t\tvar sections = this._get_typed_lightbox_config();\n\t\tfor (var i = 0; i < sections.length; i++) {\n\t\t\tif (sections[i].map_to == property) {\n\t\t\t\tvar options = sections[i].options;\n\t\t\t\tfor (var j = 0; j < options.length; j++) {\n\t\t\t\t\tif (options[j].key == key) {\n\t\t\t\t\t\treturn options[j].label;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t};\n\n\tgantt.updateCollection = function (list_name, collection) {\n\t\tcollection = collection.slice(0);\n\t\tvar list = gantt.serverList(list_name);\n\t\tif (!list) return false;\n\t\tlist.splice(0, list.length);\n\t\tlist.push.apply(list, collection || []);\n\t\tgantt.resetLightbox();\n\t};\n\tgantt.getLightboxType = function () {\n\t\treturn this.getTaskType(this._lightbox_type);\n\t};\n\tgantt.getLightbox = function (type) {\n\t\tif (type === undefined)\n\t\t\ttype = this.getLightboxType();\n\n\t\tif (!this._lightbox || this.getLightboxType() != this.getTaskType(type)) {\n\t\t\tthis._lightbox_type = this.getTaskType(type);\n\t\t\tvar d = document.createElement(\"DIV\");\n\t\t\td.className = \"gantt_cal_light\";\n\n\t\t\tvar full_width = this._is_lightbox_timepicker();\n\t\t\tif (gantt.config.wide_form || full_width)\n\t\t\t\td.className += \" gantt_cal_light_wide\";\n\n\t\t\tif (full_width) {\n\t\t\t\tgantt.config.wide_form = true;\n\t\t\t\td.className += \" gantt_cal_light_full\";\n\t\t\t}\n\n\n\t\t\td.style.visibility = \"hidden\";\n\n\t\t\tvar html = this._lightbox_template;\n\n\t\t\tvar ariaAttr;\n\t\t\tvar buttons = this.config.buttons_left;\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\n\t\t\t\t// needed to migrate from 'dhx_something' to 'gantt_something' naming in a lightbox\n\t\t\t\tvar button = this.config._migrate_buttons[buttons[i]] ? this.config._migrate_buttons[buttons[i]] : buttons[i];\n\n\t\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(button);\n\t\t\t\thtml += \"\";\n\n\t\t\t}\n\t\t\tbuttons = this.config.buttons_right;\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\n\t\t\t\tvar button = this.config._migrate_buttons[buttons[i]] ? this.config._migrate_buttons[buttons[i]] : buttons[i];\n\t\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(button);\n\n\t\t\t\thtml += \"\";\n\n\t\t\t}\n\t\t\thtml += \"\";\n\t\t\td.innerHTML = html;\n\n\t\t\tgantt._waiAria.lightboxAttr(d);\n\n\t\t\tif (gantt.config.drag_lightbox) {\n\t\t\t\td.firstChild.onmousedown = gantt._ready_to_dnd;\n\t\t\t\td.firstChild.onselectstart = function () {\n\t\t\t\t\treturn false;\n\t\t\t\t};\n\t\t\t\td.firstChild.style.cursor = \"pointer\";\n\t\t\t\tgantt._init_dnd_events();\n\n\t\t\t}\n\n\t\t\tdocument.body.insertBefore(d, document.body.firstChild);\n\t\t\tthis._lightbox = d;\n\n\t\t\tvar sns = this._get_typed_lightbox_config(type);\n\t\t\thtml = this._render_sections(sns);\n\n\t\t\tvar ds = d.getElementsByTagName(\"div\");\n\t\t\tfor (var i = 0; i < ds.length; i++) {\n\t\t\t\tvar t_ds = ds[i];\n\t\t\t\tif (t_ds.className == \"gantt_cal_larea\") {\n\t\t\t\t\tt_ds.innerHTML = html;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// bind labels to lightbox inputs\n\t\t\tfor (var i = 0; i < sns.length; i++) {\n\t\t\t\tvar section = sns[i];\n\t\t\t\tif (!section.id || !document.getElementById(section.id))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar labelBlock = document.getElementById(section.id);\n\t\t\t\tvar label = labelBlock.querySelector(\"label\");\n\t\t\t\tvar inputBlock = labelBlock.nextSibling;\n\t\t\t\tif (!inputBlock)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar input = inputBlock.querySelector(\"input, select, textarea\");\n\t\t\t\tif (input) {\n\t\t\t\t\tsection.inputId = input.id || \"input_\" + gantt.uid();\n\t\t\t\t\tif (!input.id)\n\t\t\t\t\t\tinput.id = section.inputId;\n\n\t\t\t\t\tlabel.setAttribute(\"for\", section.inputId);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//sizes\n\t\t\tthis.resizeLightbox();\n\n\t\t\tthis._init_lightbox_events(this);\n\t\t\td.style.display = \"none\";\n\t\t\td.style.visibility = \"visible\";\n\t\t}\n\t\treturn this._lightbox;\n\t};\n\n\tgantt._render_sections = function (sns) {\n\t\tvar html = \"\";\n\t\tfor (var i = 0; i < sns.length; i++) {\n\t\t\tvar block = this.form_blocks[sns[i].type];\n\t\t\tif (!block) continue; //ignore incorrect blocks\n\t\t\tsns[i].id = \"area_\" + this.uid();\n\n\t\t\tvar display = sns[i].hidden ? \" style='display:none'\" : \"\";\n\t\t\tvar button = \"\";\n\t\t\tif (sns[i].button) {\n\t\t\t\tbutton = \"\";\n\t\t\t}\n\t\t\tif (this.config.wide_form) {\n\t\t\t\thtml += \"\";\n\t\t\t}\n\t\t\thtml += \"
\" + block.render.call(this, sns[i]);\n\t\t\thtml += \"
\";\n\t\t}\n\t\treturn html;\n\t};\n\n\n\tgantt.resizeLightbox = function () {\n\t\tvar d = this._lightbox;\n\t\tif (!d) return;\n\n\t\tvar con = d.childNodes[1];\n\t\tcon.style.height = \"0px\";\n\t\tcon.style.height = con.scrollHeight + \"px\";\n\t\td.style.height = con.scrollHeight + this.config.lightbox_additional_height + \"px\";\n\t\tcon.style.height = con.scrollHeight + \"px\"; //it is incredible , how ugly IE can be\n\n\n\t};\n\n\tgantt._center_lightbox = function (box) {\n\t\tif (box) {\n\t\t\tbox.style.display = \"block\";\n\n\t\t\tvar scroll_top = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;\n\t\t\tvar scroll_left = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;\n\n\t\t\tvar view_height = window.innerHeight || document.documentElement.clientHeight;\n\n\t\t\tif (scroll_top) // if vertical scroll on window\n\t\t\t\tbox.style.top = Math.round(scroll_top + Math.max((view_height - box.offsetHeight) / 2, 0)) + \"px\";\n\t\t\telse // vertical scroll on body\n\t\t\t\tbox.style.top = Math.round(Math.max(((view_height - box.offsetHeight) / 2), 0) + 9) + \"px\"; // +9 for compatibility with auto tests\n\n\t\t\t// not quite accurate but used for compatibility reasons\n\t\t\tif (document.documentElement.scrollWidth > document.body.offsetWidth) // if horizontal scroll on the window\n\t\t\t\tbox.style.left = Math.round(scroll_left + (document.body.offsetWidth - box.offsetWidth) / 2) + \"px\";\n\t\t\telse // horizontal scroll on the body\n\t\t\t\tbox.style.left = Math.round((document.body.offsetWidth - box.offsetWidth) / 2) + \"px\";\n\t\t}\n\t};\n\tgantt.showCover = function () {\n\t\tif (this._cover) return;\n\n\t\tthis._cover = document.createElement(\"DIV\");\n\t\tthis._cover.className = \"gantt_cal_cover\";\n\t\tvar _document_height = ((document.height !== undefined) ? document.height : document.body.offsetHeight);\n\t\tvar _scroll_height = ((document.documentElement) ? document.documentElement.scrollHeight : 0);\n\t\tthis._cover.style.height = Math.max(_document_height, _scroll_height) + 'px';\n\t\tdocument.body.appendChild(this._cover);\n\t};\n\n\n\tgantt._init_lightbox_events = function () {\n\t\tgantt.lightbox_events = {};\n\n\n\t\tgantt.lightbox_events[\"gantt_save_btn\"] = function (e) {\n\t\t\tgantt._save_lightbox();\n\t\t};\n\n\n\t\tgantt.lightbox_events[\"gantt_delete_btn\"] = function (e) {\n\t\t\tif (!gantt.callEvent(\"onLightboxDelete\", [gantt._lightbox_id]))\n\t\t\t\treturn;\n\n\t\t\tif (gantt.isTaskExists(gantt._lightbox_id)) {\n\t\t\t\tgantt.$click.buttons[\"delete\"](gantt._lightbox_id);\n\t\t\t} else {\n\t\t\t\tgantt.hideLightbox();\n\t\t\t}\n\n\t\t};\n\n\n\t\tgantt.lightbox_events[\"gantt_cancel_btn\"] = function (e) {\n\t\t\tgantt._cancel_lightbox();\n\t\t};\n\n\n\t\tgantt.lightbox_events[\"default\"] = function (e, src) {\n\t\t\tif (src.getAttribute(\"dhx_button\")) {\n\t\t\t\tgantt.callEvent(\"onLightboxButton\", [src.className, src, e]);\n\t\t\t} else {\n\t\t\t\tvar index, block, sec;\n\n\t\t\t\tvar className = domHelpers.getClassName(src);\n\t\t\t\tif (className.indexOf(\"gantt_custom_button\") != -1) {\n\t\t\t\t\tif (className.indexOf(\"gantt_custom_button_\") != -1) {\n\t\t\t\t\t\tindex = src.parentNode.getAttribute(\"index\");\n\t\t\t\t\t\tsec = src;\n\t\t\t\t\t\twhile (sec && domHelpers.getClassName(sec).indexOf(\"gantt_cal_lsection\") == -1) {\n\t\t\t\t\t\t\tsec = sec.parentNode;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tindex = src.getAttribute(\"index\");\n\t\t\t\t\t\tsec = src.parentNode;\n\t\t\t\t\t\tsrc = src.firstChild;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar sections = gantt._get_typed_lightbox_config();\n\n\t\t\t\tif (index) {\n\t\t\t\t\tindex = index * 1;\n\t\t\t\t\tblock = gantt.form_blocks[sections[index * 1].type];\n\t\t\t\t\tblock.button_click(index, src, sec, sec.nextSibling);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.event(gantt.getLightbox(), \"click\", function (e) {\n\t\t\te = e || window.event;\n\t\t\tvar src = e.target ? e.target : e.srcElement;\n\n\t\t\tvar className = domHelpers.getClassName(src);\n\t\t\tif (!className) {\n\t\t\t\tsrc = src.previousSibling;\n\t\t\t\tclassName = domHelpers.getClassName(src);\n\t\t\t}\n\t\t\tif (src && className && className.indexOf(\"gantt_btn_set\") === 0) {\n\t\t\t\tsrc = src.firstChild;\n\t\t\t\tclassName = domHelpers.getClassName(src);\n\t\t\t}\n\t\t\tif (src && className) {\n\t\t\t\tvar func = gantt.defined(gantt.lightbox_events[src.className]) ? gantt.lightbox_events[src.className] : gantt.lightbox_events[\"default\"];\n\t\t\t\treturn func(e, src);\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\n\t\tgantt.getLightbox().onkeydown = function (e) {\n\t\t\tvar event = e || window.event;\n\t\t\tvar target = e.target || e.srcElement;\n\t\t\tvar buttonTarget = !!(domHelpers.getClassName(target).indexOf(\"gantt_btn_set\") > -1);\n\n\t\t\tswitch ((e || event).keyCode) {\n\t\t\t\tcase 32: {//space\n\t\t\t\t\tif ((e || event).shiftKey) return;\n\t\t\t\t\tif (buttonTarget && target.click) {\n\t\t\t\t\t\ttarget.click();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase gantt.keys.edit_save:\n\t\t\t\t\tif ((e || event).shiftKey) return;\n\t\t\t\t\tif (buttonTarget && target.click) {\n\t\t\t\t\t\ttarget.click();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgantt._save_lightbox();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase gantt.keys.edit_cancel:\n\t\t\t\t\tgantt._cancel_lightbox();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t};\n\n\tgantt._cancel_lightbox = function () {\n\t\tvar task = this.getLightboxValues();\n\t\tthis.callEvent(\"onLightboxCancel\", [this._lightbox_id, task.$new]);\n\t\tif (gantt.isTaskExists(task.id) && task.$new) {\n\t\t\tthis.silent(function(){\n\t\t\t\tgantt.$data.tasksStore.removeItem(task.id);\n\t\t\t\tgantt._update_flags(task.id, null);\n\t\t\t});\n\t\t}\n\n\t\tthis.refreshData();\n\t\tthis.hideLightbox();\n\t};\n\n\tgantt._save_lightbox = function () {\n\t\tvar task = this.getLightboxValues();\n\t\tif (!this.callEvent(\"onLightboxSave\", [this._lightbox_id, task, !!task.$new]))\n\t\t\treturn;\n\n\t\tif (task.$new) {\n\t\t\tdelete task.$new;\n\t\t\tthis.addTask(task);\n\t\t}else if(this.isTaskExists(task.id)){\n\t\t\tthis.mixin(this.getTask(task.id), task, true);\n\t\t\tthis.refreshTask(task.id);\n\t\t\tthis.updateTask(task.id);\n\t\t}\n\t\tthis.refreshData();\n\n\t\t// TODO: do we need any blockable events here to prevent closing lightbox?\n\t\tthis.hideLightbox();\n\t};\n\n\tgantt._resolve_default_mapping = function (section) {\n\t\tvar mapping = section.map_to;\n\t\tvar time_controls = {\"time\": true, \"time_optional\": true, \"duration\": true, \"duration_optional\": true};\n\t\tif (time_controls[section.type]) {\n\t\t\tif (section.map_to == 'auto') {\n\t\t\t\tmapping = {start_date: \"start_date\", end_date: \"end_date\", duration: \"duration\"};\n\t\t\t} else if (typeof(section.map_to) === \"string\") {\n\t\t\t\tmapping = {start_date: section.map_to};\n\t\t\t}\n\t\t}\n\n\t\treturn mapping;\n\t};\n\n\tgantt.getLightboxValues = function () {\n\t\tvar task = {};\n\n\t\tif (gantt.isTaskExists(this._lightbox_id)) {\n\t\t\ttask = this.mixin({}, this.getTask(this._lightbox_id));\n\t\t}\n\n\t\tvar sns = this._get_typed_lightbox_config();\n\t\tfor (var i = 0; i < sns.length; i++) {\n\t\t\tvar node = document.getElementById(sns[i].id);\n\t\t\tnode = (node ? node.nextSibling : node);\n\t\t\tvar block = this.form_blocks[sns[i].type];\n\t\t\tif (!block) continue;\n\t\t\tvar res = block.get_value.call(this, node, task, sns[i]);\n\t\t\tvar map_to = gantt._resolve_default_mapping(sns[i]);\n\t\t\tif (typeof map_to == \"string\" && map_to != \"auto\") {\n\t\t\t\ttask[map_to] = res;\n\t\t\t} else if (typeof map_to == \"object\") {\n\t\t\t\tfor (var property in map_to) {\n\t\t\t\t\tif (map_to[property])\n\t\t\t\t\t\ttask[map_to[property]] = res[property];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn task;\n\t};\n\n\n\tgantt.hideLightbox = function () {\n\t\tvar box = this.getLightbox();\n\t\tif (box) box.style.display = \"none\";\n\n\t\tthis._waiAria.lightboxHiddenAttr(box);\n\t\tthis._lightbox_id = null;\n\n\t\tthis.hideCover();\n\t\tthis.callEvent(\"onAfterLightbox\", []);\n\t};\n\tgantt.hideCover = function () {\n\t\tif (this._cover)\n\t\t\tthis._cover.parentNode.removeChild(this._cover);\n\t\tthis._cover = null;\n\t};\n\n\tgantt.resetLightbox = function () {\n\t\tif (gantt._lightbox && !gantt._custom_lightbox)\n\t\t\tgantt._lightbox.parentNode.removeChild(gantt._lightbox);\n\t\tgantt._lightbox = null;\n\t};\n\tgantt._set_lightbox_values = function (data, box) {\n\t\tvar task = data;\n\t\tvar s = box.getElementsByTagName(\"span\");\n\t\tvar lightboxHeader = [];\n\t\tif (gantt.templates.lightbox_header) {\n\t\t\tlightboxHeader.push(\"\");\n\t\t\tlightboxHeader.push(gantt.templates.lightbox_header(task.start_date, task.end_date, task));\n\t\t\ts[1].innerHTML = \"\";\n\t\t\ts[2].innerHTML = gantt.templates.lightbox_header(task.start_date, task.end_date, task);\n\t\t} else {\n\t\t\tlightboxHeader.push(this.templates.task_time(task.start_date, task.end_date, task));\n\t\t\tlightboxHeader.push((this.templates.task_text(task.start_date, task.end_date, task) || \"\").substr(0, 70)); //IE6 fix\n\t\t\ts[1].innerHTML = this.templates.task_time(task.start_date, task.end_date, task);\n\t\t\ts[2].innerHTML = (this.templates.task_text(task.start_date, task.end_date, task) || \"\").substr(0, 70); //IE6 fix\n\t\t}\n\t\ts[1].innerHTML = lightboxHeader[0];\n\t\ts[2].innerHTML = lightboxHeader[1];\n\n\t\tgantt._waiAria.lightboxHeader(box, lightboxHeader.join(\" \"));\n\n\t\tvar sns = this._get_typed_lightbox_config(this.getLightboxType());\n\t\tfor (var i = 0; i < sns.length; i++) {\n\t\t\tvar section = sns[i];\n\n\t\t\tif (!this.form_blocks[section.type]) {\n\t\t\t\tcontinue;//skip incorrect sections, same check is done during rendering\n\t\t\t}\n\n\n\t\t\tvar node = document.getElementById(section.id).nextSibling;\n\t\t\tvar block = this.form_blocks[section.type];\n\t\t\tvar map_to = gantt._resolve_default_mapping(sns[i]);\n\t\t\tvar value = this.defined(task[map_to]) ? task[map_to] : section.default_value;\n\t\t\tblock.set_value.call(gantt, node, value, task, section);\n\n\t\t\tif (section.focus)\n\t\t\t\tblock.focus.call(gantt, node);\n\t\t}\n\t\tif (data.id)\n\t\t\tgantt._lightbox_id = data.id;\n\t};\n\tgantt._fill_lightbox = function (id, box) {\n\t\tvar task = this.getTask(id);\n\t\tthis._set_lightbox_values(task, box);\n\t};\n\n\n\tgantt.getLightboxSection = function (name) {\n\t\tvar config = this._get_typed_lightbox_config();\n\t\tvar i = 0;\n\t\tfor (i; i < config.length; i++)\n\t\t\tif (config[i].name == name)\n\t\t\t\tbreak;\n\t\tvar section = config[i];\n\t\tif (!section)\n\t\t\treturn null;\n\n\t\tif (!this._lightbox)\n\t\t\tthis.getLightbox();\n\t\tvar header = document.getElementById(section.id);\n\t\tvar node = header.nextSibling;\n\n\t\tvar result = {\n\t\t\tsection: section,\n\t\t\theader: header,\n\t\t\tnode: node,\n\t\t\tgetValue: function (ev) {\n\t\t\t\treturn gantt.form_blocks[section.type].get_value.call(gantt, node, (ev || {}), section);\n\t\t\t},\n\t\t\tsetValue: function (value, ev) {\n\t\t\t\treturn gantt.form_blocks[section.type].set_value.call(gantt, node, value, (ev || {}), section);\n\t\t\t}\n\t\t};\n\n\t\tvar handler = this._lightbox_methods[\"get_\" + section.type + \"_control\"];\n\t\treturn handler ? handler(result) : result;\n\t};\n\n\tgantt._lightbox_methods.get_template_control = function (result) {\n\t\tresult.control = result.node;\n\t\treturn result;\n\t};\n\tgantt._lightbox_methods.get_select_control = function (result) {\n\t\tresult.control = result.node.getElementsByTagName('select')[0];\n\t\treturn result;\n\t};\n\tgantt._lightbox_methods.get_textarea_control = function (result) {\n\t\tresult.control = result.node.getElementsByTagName('textarea')[0];\n\t\treturn result;\n\t};\n\tgantt._lightbox_methods.get_time_control = function (result) {\n\t\tresult.control = result.node.getElementsByTagName('select'); // array\n\t\treturn result;\n\t};\n\n\n\tgantt._init_dnd_events = function () {\n\t\tthis.event(document.body, \"mousemove\", gantt._move_while_dnd);\n\t\tthis.event(document.body, \"mouseup\", gantt._finish_dnd);\n\t\tgantt._init_dnd_events = function () {\n\t\t};\n\t};\n\tgantt._move_while_dnd = function (e) {\n\t\tif (gantt._dnd_start_lb) {\n\t\t\tif (!document.gantt_unselectable) {\n\t\t\t\tdocument.body.className += \" gantt_unselectable\";\n\t\t\t\tdocument.gantt_unselectable = true;\n\t\t\t}\n\t\t\tvar lb = gantt.getLightbox();\n\t\t\tvar now = (e && e.target) ? [e.pageX, e.pageY] : [event.clientX, event.clientY];\n\t\t\tlb.style.top = gantt._lb_start[1] + now[1] - gantt._dnd_start_lb[1] + \"px\";\n\t\t\tlb.style.left = gantt._lb_start[0] + now[0] - gantt._dnd_start_lb[0] + \"px\";\n\t\t}\n\t};\n\tgantt._ready_to_dnd = function (e) {\n\t\tvar lb = gantt.getLightbox();\n\t\tgantt._lb_start = [parseInt(lb.style.left, 10), parseInt(lb.style.top, 10)];\n\t\tgantt._dnd_start_lb = (e && e.target) ? [e.pageX, e.pageY] : [event.clientX, event.clientY];\n\t};\n\tgantt._finish_dnd = function () {\n\t\tif (gantt._lb_start) {\n\t\t\tgantt._lb_start = gantt._dnd_start_lb = false;\n\t\t\tdocument.body.className = document.body.className.replace(\" gantt_unselectable\", \"\");\n\t\t\tdocument.gantt_unselectable = false;\n\t\t}\n\t};\n\n\n\tgantt._focus = function (node, select) {\n\t\tif (node && node.focus) {\n\t\t\tif (gantt.config.touch) {\n\t\t\t\t//do not focus editor, to prevent auto-zoom\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tif (select && node.select) node.select();\n\t\t\t\t\tnode.focus();\n\t\t\t\t} catch (e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\n\tgantt.form_blocks = {\n\t\tgetTimePicker: function (sns, hidden) {\n\t\t\tvar time_format = sns.time_format;\n\t\t\tif (!time_format) {\n\t\t\t\t// default order\n\t\t\t\tvar time_format = [\"%d\", \"%m\", \"%Y\"];\n\t\t\t\tif (helpers.getSecondsInUnit(gantt.getScale().unit) < helpers.getSecondsInUnit(\"day\")) {\n\t\t\t\t\ttime_format.push(\"%H:%i\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// map: default order => real one\n\t\t\tsns._time_format_order = {size: 0};\n\n\n\t\t\tvar cfg = this.config;\n\t\t\tvar dt = this.date.date_part(new Date(gantt._min_date.valueOf()));\n\t\t\tvar last = 24 * 60, first = 0;\n\t\t\tif (gantt.config.limit_time_select) {\n\t\t\t\tlast = 60 * cfg.last_hour + 1;\n\t\t\t\tfirst = 60 * cfg.first_hour;\n\t\t\t\tdt.setHours(cfg.first_hour);\n\t\t\t}\n\t\t\tvar html = \"\";\n\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\n\t\t\t\tvar time_option = time_format[p];\n\n\t\t\t\t// adding spaces between selects\n\t\t\t\tif (p > 0) {\n\t\t\t\t\thtml += \" \";\n\t\t\t\t}\n\n\t\t\t\tvar options = '';\n\t\t\t\tswitch (time_option) {\n\t\t\t\t\tcase \"%Y\":\n\t\t\t\t\t\tsns._time_format_order[2] = p;\n\t\t\t\t\t\tsns._time_format_order.size++;\n\t\t\t\t\t\t//year\n\n\t\t\t\t\t\tvar range, offset, start_year, end_year;\n\n\t\t\t\t\t\tif (sns.year_range) {\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\n\t\t\t\t\t\t\t\trange = sns.year_range;\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\n\t\t\t\t\t\t\t\t// if\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trange = range || 10;\n\t\t\t\t\t\toffset = offset || Math.floor(range / 2);\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\n\t\t\t\t\t\tend_year = end_year || start_year + range;\n\n\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\n\t\t\t\t\t\t\toptions += \"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%m\":\n\t\t\t\t\t\tsns._time_format_order[1] = p;\n\t\t\t\t\t\tsns._time_format_order.size++;\n\t\t\t\t\t\t//month\n\t\t\t\t\t\tfor (var i = 0; i < 12; i++)\n\t\t\t\t\t\t\toptions += \"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%d\":\n\t\t\t\t\t\tsns._time_format_order[0] = p;\n\t\t\t\t\t\tsns._time_format_order.size++;\n\t\t\t\t\t\t//days\n\t\t\t\t\t\tfor (var i = 1; i < 32; i++)\n\t\t\t\t\t\t\toptions += \"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"%H:%i\":\n\t\t\t\t\t\t// var last = 24*60, first = 0;\n\t\t\t\t\t\tsns._time_format_order[3] = p;\n\t\t\t\t\t\tsns._time_format_order.size++;\n\t\t\t\t\t\t//hours\n\t\t\t\t\t\tvar i = first;\n\t\t\t\t\t\tvar tdate = dt.getDate();\n\t\t\t\t\t\tsns._time_values = [];\n\n\t\t\t\t\t\twhile (i < last) {\n\t\t\t\t\t\t\tvar time = this.templates.time_picker(dt);\n\t\t\t\t\t\t\toptions += \"\";\n\t\t\t\t\t\t\tsns._time_values.push(i);\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf() + this._get_timepicker_step() * 60 * 1000);\n\t\t\t\t\t\t\tvar diff = (dt.getDate() != tdate) ? 1 : 0; // moved or not to the next day\n\t\t\t\t\t\t\ti = diff * 24 * 60 + dt.getHours() * 60 + dt.getMinutes();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (options) {\n\n\t\t\t\t\tvar ariaAttrs = gantt._waiAria.lightboxSelectAttrString(time_option);\n\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\n\t\t\t\t\tvar display = hidden ? \" style='display:none' \" : \"\";\n\t\t\t\t\thtml += \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn html;\n\t\t},\n\t\t_fill_lightbox_select: function (s, i, d, map, cfg) {\n\t\t\ts[i + map[0]].value = d.getDate();\n\t\t\ts[i + map[1]].value = d.getMonth();\n\t\t\ts[i + map[2]].value = d.getFullYear();\n\t\t\tif (gantt.defined(map[3])) {\n\t\t\t\tvar v = d.getHours() * 60 + d.getMinutes();\n\t\t\t\tv = Math.round(v / gantt._get_timepicker_step()) * gantt._get_timepicker_step();\n\t\t\t\tvar input = s[i + map[3]];\n\t\t\t\tinput.value = v;\n\t\t\t\t//in case option not shown\n\t\t\t\tinput.setAttribute('data-value', v);\n\t\t\t}\n\t\t},\n\t\ttemplate: {\n\t\t\trender: function (sns) {\n\t\t\t\tvar height = (sns.height || \"30\") + \"px\";\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tset_value: function (node, value, ev, config) {\n\t\t\t\tnode.innerHTML = value || \"\";\n\t\t\t},\n\t\t\tget_value: function (node, ev, config) {\n\t\t\t\treturn node.innerHTML || \"\";\n\t\t\t},\n\t\t\tfocus: function (node) {\n\t\t\t}\n\t\t},\n\t\ttextarea: {\n\t\t\trender: function (sns) {\n\t\t\t\tvar height = (sns.height || \"130\") + \"px\";\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\tset_value: function (node, value, ev) {\n\t\t\t\tthis.form_blocks.textarea._get_input(node).value = value || \"\";\n\t\t\t},\n\t\t\tget_value: function (node, ev) {\n\t\t\t\treturn this.form_blocks.textarea._get_input(node).value;\n\t\t\t},\n\t\t\tfocus: function (node) {\n\t\t\t\tvar a = this.form_blocks.textarea._get_input(node);\n\t\t\t\tgantt._focus(a, true);\n\t\t\t},\n\t\t\t_get_input: function (node) {\n\t\t\t\treturn node.querySelector(\"textarea\");\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\trender: function (sns) {\n\t\t\t\tvar height = (sns.height || \"23\") + \"px\";\n\t\t\t\tvar html = \"\";\n\t\t\t\treturn html;\n\t\t\t},\n\t\t\tset_value: function (node, value, ev, sns) {\n\t\t\t\tvar select = node.firstChild;\n\t\t\t\tif (!select._dhx_onchange && sns.onchange) {\n\t\t\t\t\tselect.onchange = sns.onchange;\n\t\t\t\t\tselect._dhx_onchange = true;\n\t\t\t\t}\n\t\t\t\tif (typeof value == \"undefined\")\n\t\t\t\t\tvalue = (select.options[0] || {}).value;\n\t\t\t\tselect.value = value || \"\";\n\t\t\t},\n\t\t\tget_value: function (node, ev) {\n\t\t\t\treturn node.firstChild.value;\n\t\t\t},\n\t\t\tfocus: function (node) {\n\t\t\t\tvar a = node.firstChild;\n\t\t\t\tgantt._focus(a, true);\n\t\t\t}\n\t\t},\n\t\ttime: {\n\t\t\trender: function (sns) {\n\t\t\t\tvar time = this.form_blocks.getTimePicker.call(this, sns);\n\t\t\t\tvar parts = [\"\"];\n\t\t\t\tparts.push(time);\n\n\t\t\t\tif (sns.single_date) {\n\t\t\t\t\ttime = this.form_blocks.getTimePicker.call(this, sns, true);\n\t\t\t\t\tparts.push(\"\");\n\t\t\t\t} else {\n\t\t\t\t\tparts.push(\" – \");\n\t\t\t\t}\n\n\t\t\t\tparts.push(time);\n\t\t\t\tparts.push(\"
\");\n\t\t\t\treturn parts.join('');\n\t\t\t},\n\t\t\tset_value: function (node, value, ev, config) {\n\t\t\t\tvar cfg = config;\n\t\t\t\tvar s = node.getElementsByTagName(\"select\");\n\n\t\t\t\tvar map = config._time_format_order;\n\t\t\t\tvar map_size = config._time_format_size;\n\n\t\t\t\tif (cfg.auto_end_date) {\n\t\t\t\t\tvar _update_lightbox_select = function () {\n\t\t\t\t\t\tstart_date = new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, 0, 0);\n\t\t\t\t\t\tend_date = gantt.calculateEndDate({start_date: start_date, duration: 1, task: ev});\n\t\t\t\t\t\tthis.form_blocks._fill_lightbox_select(s, map.size, end_date, map, cfg);\n\t\t\t\t\t};\n\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\ts[i].onchange = _update_lightbox_select;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar mapping = gantt._resolve_default_mapping(config);\n\n\t\t\t\tif (typeof(mapping) === \"string\") mapping = {start_date: mapping};\n\n\t\t\t\tvar start_date = ev[mapping.start_date] || new Date();\n\t\t\t\tvar end_date = ev[mapping.end_date] || gantt.calculateEndDate({\n\t\t\t\t\tstart_date: start_date,\n\t\t\t\t\tduration: 1,\n\t\t\t\t\ttask: ev\n\t\t\t\t});\n\n\t\t\t\tthis.form_blocks._fill_lightbox_select(s, 0, start_date, map, cfg);\n\t\t\t\tthis.form_blocks._fill_lightbox_select(s, map.size, end_date, map, cfg);\n\t\t\t},\n\n\t\t\tget_value: function (node, ev, config) {\n\t\t\t\tvar s = node.getElementsByTagName(\"select\");\n\t\t\t\tvar map = config._time_format_order;\n\n\t\t\t\tvar hours = 0, minutes = 0;\n\t\t\t\tif (gantt.defined(map[3])) {\n\t\t\t\t\tvar time = parseInt(s[map[3]].value, 10);\n\t\t\t\t\thours = Math.floor(time / 60);\n\t\t\t\t\tminutes = time % 60;\n\t\t\t\t}\n\t\t\t\tvar start_date = new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, hours, minutes);\n\n\t\t\t\thours = minutes = 0;\n\t\t\t\tif (gantt.defined(map[3])) {\n\t\t\t\t\tvar time = parseInt(s[map.size + map[3]].value, 10);\n\t\t\t\t\thours = Math.floor(time / 60);\n\t\t\t\t\tminutes = time % 60;\n\t\t\t\t}\n\t\t\t\tvar end_date = new Date(s[map[2] + map.size].value, s[map[1] + map.size].value, s[map[0] + map.size].value, hours, minutes);\n\n\t\t\t\tif (end_date <= start_date)\n\t\t\t\t\tend_date = gantt.date.add(start_date, gantt._get_timepicker_step(), \"minute\");\n\n\t\t\t\tvar mapped_fields = gantt._resolve_default_mapping(config);\n\n\t\t\t\tvar res = {\n\t\t\t\t\tstart_date: new Date(start_date),\n\t\t\t\t\tend_date: new Date(end_date)\n\t\t\t\t};\n\t\t\t\tif (typeof mapped_fields == \"string\") {\n\t\t\t\t\treturn res.start_date;\n\t\t\t\t} else {\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t},\n\t\t\tfocus: function (node) {\n\t\t\t\tgantt._focus(node.getElementsByTagName(\"select\")[0]);\n\t\t\t}\n\t\t},\n\t\tduration: {\n\t\t\trender: function (sns) {\n\t\t\t\tvar time = this.form_blocks.getTimePicker.call(this, sns);\n\t\t\t\ttime = \"\" + time + \"
\";\n\t\t\t\tvar label = this.locale.labels[this.config.duration_unit + \"s\"];\n\n\t\t\t\tvar singleDate = sns.single_date ? ' style=\"display:none\"' : \"\";\n\t\t\t\tvar readonly = sns.readonly ? \" disabled='disabled'\" : \"\";\n\n\t\t\t\tvar ariaAttr = this._waiAria.lightboxDurationInputAttrString(sns);\n\n\t\t\t\tvar duration = \"\" +\n\t\t\t\t\t\"\" +\n\t\t\t\t\t\"\" +\n\t\t\t\t\t\" \" + label + \" \" +\n\t\t\t\t\t\"
\";\n\t\t\t\tvar html = \"\" + time + \" \" + duration + \"
\";\n\t\t\t\treturn html;\n\t\t\t},\n\t\t\tset_value: function (node, value, ev, config) {\n\t\t\t\tvar cfg = config;\n\t\t\t\tvar s = node.getElementsByTagName(\"select\");\n\t\t\t\tvar inps = node.getElementsByTagName(\"input\");\n\n\t\t\t\tvar duration = inps[1];\n\t\t\t\tvar btns = [inps[0], inps[2]];\n\t\t\t\tvar endspan = node.getElementsByTagName(\"span\")[0];\n\n\t\t\t\tvar map = config._time_format_order;\n\n\t\t\t\tfunction _calc_date() {\n\t\t\t\t\tvar start_date = gantt.form_blocks.duration._get_start_date.call(gantt, node, config);\n\t\t\t\t\tvar duration = gantt.form_blocks.duration._get_duration.call(gantt, node, config);\n\t\t\t\t\tvar end_date = gantt.calculateEndDate({start_date: start_date, duration: duration, task: ev});\n\n\t\t\t\t\tendspan.innerHTML = gantt.templates.task_date(end_date);\n\t\t\t\t}\n\n\t\t\t\tfunction _change_duration(step) {\n\t\t\t\t\tvar value = duration.value;\n\t\t\t\t\tvalue = parseInt(value, 10);\n\t\t\t\t\tif (window.isNaN(value))\n\t\t\t\t\t\tvalue = 0;\n\t\t\t\t\tvalue += step;\n\t\t\t\t\tif (value < 1) value = 1;\n\t\t\t\t\tduration.value = value;\n\t\t\t\t\t_calc_date();\n\t\t\t\t}\n\n\t\t\t\tbtns[0].onclick = gantt.bind(function () {\n\t\t\t\t\t_change_duration(-1 * this.config.duration_step);\n\t\t\t\t}, this);\n\t\t\t\tbtns[1].onclick = gantt.bind(function () {\n\t\t\t\t\t_change_duration(1 * this.config.duration_step);\n\t\t\t\t}, this);\n\t\t\t\ts[0].onchange = _calc_date;\n\t\t\t\ts[1].onchange = _calc_date;\n\t\t\t\ts[2].onchange = _calc_date;\n\t\t\t\tif (s[3]) s[3].onchange = _calc_date;\n\t\t\t\tduration.onkeydown = gantt.bind(function (e) {\n\t\t\t\t\te = e || window.event;\n\t\t\t\t\t// up\n\t\t\t\t\tvar code = (e.charCode || e.keyCode || e.which);\n\n\t\t\t\t\tif (code == 40) {\n\t\t\t\t\t\t_change_duration(-1 * this.config.duration_step);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t// down\n\t\t\t\t\tif (code == 38) {\n\t\t\t\t\t\t_change_duration(1 * this.config.duration_step);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\twindow.setTimeout(function (e) {\n\t\t\t\t\t\t_calc_date();\n\t\t\t\t\t}, 1);\n\t\t\t\t}, this);\n\n\t\t\t\tduration.onchange = gantt.bind(function (e) {\n\t\t\t\t\t_calc_date();\n\t\t\t\t}, this);\n\n\t\t\t\tvar mapping = gantt._resolve_default_mapping(config);\n\t\t\t\tif (typeof(mapping) === \"string\") mapping = {start_date: mapping};\n\n\t\t\t\tvar start_date = ev[mapping.start_date] || new Date();\n\t\t\t\tvar end_date = ev[mapping.end_date] || gantt.calculateEndDate({\n\t\t\t\t\tstart_date: start_date,\n\t\t\t\t\tduration: 1,\n\t\t\t\t\ttask: ev\n\t\t\t\t});\n\t\t\t\tvar duration_val = Math.round(ev[mapping.duration]) || gantt.calculateDuration({\n\t\t\t\t\tstart_date: start_date,\n\t\t\t\t\tend_date: end_date,\n\t\t\t\t\ttask: ev\n\t\t\t\t});\n\n\t\t\t\tgantt.form_blocks._fill_lightbox_select(s, 0, start_date, map, cfg);\n\t\t\t\tduration.value = duration_val;\n\t\t\t\t_calc_date();\n\t\t\t},\n\n\t\t\t_get_start_date: function (node, config) {\n\t\t\t\tvar s = node.getElementsByTagName(\"select\");\n\t\t\t\tvar map = config._time_format_order;\n\t\t\t\tvar hours = 0;\n\t\t\t\tvar minutes = 0;\n\t\t\t\tif (gantt.defined(map[3])) {\n\t\t\t\t\tvar input = s[map[3]];\n\t\t\t\t\tvar time = parseInt(input.value, 10);\n\t\t\t\t\tif (isNaN(time) && input.hasAttribute(\"data-value\")) {\n\t\t\t\t\t\ttime = parseInt(input.getAttribute(\"data-value\"), 10);\n\t\t\t\t\t}\n\n\t\t\t\t\thours = Math.floor(time / 60);\n\t\t\t\t\tminutes = time % 60;\n\t\t\t\t}\n\t\t\t\treturn new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, hours, minutes);\n\t\t\t},\n\t\t\t_get_duration: function (node, config) {\n\t\t\t\tvar duration = node.getElementsByTagName(\"input\")[1];\n\t\t\t\tduration = parseInt(duration.value, 10);\n\t\t\t\tif (!duration || window.isNaN(duration)) duration = 1;\n\t\t\t\tif (duration < 0) duration *= -1;\n\t\t\t\treturn duration;\n\t\t\t},\n\n\t\t\tget_value: function (node, ev, config) {\n\t\t\t\tvar start_date = gantt.form_blocks.duration._get_start_date(node, config);\n\t\t\t\tvar duration = gantt.form_blocks.duration._get_duration(node, config);\n\n\t\t\t\tvar end_date = gantt.calculateEndDate({start_date: start_date, duration: duration, task: ev});\n\t\t\t\tvar mapped_fields = gantt._resolve_default_mapping(config);\n\t\t\t\tvar res = {\n\t\t\t\t\tstart_date: new Date(start_date),\n\t\t\t\t\tend_date: new Date(end_date),\n\t\t\t\t\tduration: duration\n\t\t\t\t};\n\t\t\t\tif (typeof mapped_fields == \"string\") {\n\t\t\t\t\treturn res.start_date;\n\t\t\t\t} else {\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t},\n\t\t\tfocus: function (node) {\n\t\t\t\tgantt._focus(node.getElementsByTagName(\"select\")[0]);\n\t\t\t}\n\t\t},\n\t\tparent: {\n\t\t\t_filter: function (options, config, item_id) {\n\t\t\t\tvar filter = config.filter || function () {\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\toptions = options.slice(0);\n\n\t\t\t\tfor (var i = 0; i < options.length; i++) {\n\t\t\t\t\tvar task = options[i];\n\t\t\t\t\tif (task.id == item_id || gantt.isChildOf(task.id, item_id) || filter(task.id, task) === false) {\n\t\t\t\t\t\toptions.splice(i, 1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn options;\n\t\t\t},\n\n\t\t\t_display: function (config, item_id) {\n\t\t\t\tvar tasks = [],\n\t\t\t\t\toptions = [];\n\t\t\t\tif (item_id) {\n\t\t\t\t\ttasks = gantt.getTaskByTime();\n\t\t\t\t\tif (config.allow_root) {\n\t\t\t\t\t\ttasks.unshift({id: gantt.config.root_id, text: config.root_label || \"\"});\n\t\t\t\t\t}\n\t\t\t\t\ttasks = this._filter(tasks, config, item_id);\n\t\t\t\t\tif (config.sort) {\n\t\t\t\t\t\ttasks.sort(config.sort);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar text = config.template || gantt.templates.task_text;\n\t\t\t\tfor (var i = 0; i < tasks.length; i++) {\n\t\t\t\t\tvar label = text.apply(gantt, [tasks[i].start_date, tasks[i].end_date, tasks[i]]);\n\t\t\t\t\tif (label === undefined) {\n\t\t\t\t\t\tlabel = \"\";\n\t\t\t\t\t}\n\t\t\t\t\toptions.push({\n\t\t\t\t\t\tkey: tasks[i].id,\n\t\t\t\t\t\tlabel: label\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconfig.options = options;\n\t\t\t\tconfig.map_to = config.map_to || \"parent\";\n\t\t\t\treturn gantt.form_blocks.select.render.apply(this, arguments);\n\t\t\t},\n\t\t\trender: function (sns) {\n\t\t\t\treturn gantt.form_blocks.parent._display(sns, false);\n\t\t\t},\n\t\t\tset_value: function (node, value, ev, config) {\n\t\t\t\tvar tmpDom = document.createElement(\"div\");\n\t\t\t\ttmpDom.innerHTML = gantt.form_blocks.parent._display(config, ev.id);\n\t\t\t\tvar newOptions = tmpDom.removeChild(tmpDom.firstChild);\n\t\t\t\tnode.onselect = null;\n\t\t\t\tnode.parentNode.replaceChild(newOptions, node);\n\n\t\t\t\treturn gantt.form_blocks.select.set_value.apply(gantt, [newOptions, value, ev, config]);\n\t\t\t},\n\t\t\tget_value: function () {\n\t\t\t\treturn gantt.form_blocks.select.get_value.apply(gantt, arguments);\n\t\t\t},\n\t\t\tfocus: function () {\n\t\t\t\treturn gantt.form_blocks.select.focus.apply(gantt, arguments);\n\t\t\t}\n\t\t}\n\t};\n\n\tgantt._is_lightbox_timepicker = function () {\n\t\tvar s = this._get_typed_lightbox_config();\n\t\tfor (var i = 0; i < s.length; i++)\n\t\t\tif (s[i].name == \"time\" && s[i].type == \"time\")\n\t\t\t\treturn true;\n\t\treturn false;\n\t};\n\n\tgantt._dhtmlx_confirm = function (message, title, callback, ok) {\n\t\tif (!message)\n\t\t\treturn callback();\n\t\tvar opts = {text: message};\n\t\tif (title)\n\t\t\topts.title = title;\n\t\tif (ok) {\n\t\t\topts.ok = ok;\n\t\t}\n\t\tif (callback) {\n\t\t\topts.callback = function (result) {\n\t\t\t\tif (result)\n\t\t\t\t\tcallback();\n\t\t\t};\n\t\t}\n\t\tgantt.confirm(opts);\n\t};\n\n\tfunction _get_type_name(type_value) {\n\t\tfor (var i in this.config.types) {\n\t\t\tif (this.config.types[i] == type_value) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn \"task\";\n\t}\n\n\tgantt._get_typed_lightbox_config = function (type) {\n\t\tif (type === undefined) {\n\t\t\ttype = this.getLightboxType();\n\t\t}\n\n\t\tvar field = _get_type_name.call(this, type);\n\n\t\tif (gantt.config.lightbox[field + \"_sections\"]) {\n\t\t\treturn gantt.config.lightbox[field + \"_sections\"];\n\t\t} else {\n\t\t\treturn gantt.config.lightbox.sections;\n\t\t}\n\t};\n\n\tgantt._silent_redraw_lightbox = function (type) {\n\t\tvar oldType = this.getLightboxType();\n\n\t\tif (this.getState().lightbox) {\n\t\t\tvar taskId = this.getState().lightbox;\n\t\t\tvar formData = this.getLightboxValues(),\n\t\t\t\ttask = this.copy(this.getTask(taskId));\n\n\t\t\tthis.resetLightbox();\n\n\t\t\tvar updTask = this.mixin(task, formData, true);\n\t\t\tvar box = this.getLightbox(type ? type : undefined);\n\t\t\tthis._center_lightbox(this.getLightbox());\n\t\t\tthis._set_lightbox_values(updTask, box);\n\t\t} else {\n\t\t\tthis.resetLightbox();\n\t\t\tthis.getLightbox(type ? type : undefined);\n\t\t}\n\t\tthis.callEvent(\"onLightboxChange\", [oldType, this.getLightboxType()]);\n\t};\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/lightbox.js\n// module id = 86\n// module chunks = 0","module.exports = function(gantt) {\n\n\tgantt._extend_to_optional = function (lightbox_block) {\n\n\t\tvar duration = lightbox_block;\n\t\tvar optional_time = {\n\t\t\trender: duration.render,\n\t\t\tfocus: duration.focus,\n\t\t\tset_value: function (node, value, task, section) {\n\t\t\t\tvar mapping = gantt._resolve_default_mapping(section);\n\t\t\t\tif (!task[mapping.start_date] || (mapping.start_date == \"start_date\" && this._isAllowedUnscheduledTask(task))) {\n\t\t\t\t\toptional_time.disable(node, section);\n\t\t\t\t\tvar val = {};\n\n\t\t\t\t\tfor (var i in mapping) {\n\t\t\t\t\t\t//take default values from the time control from task start/end dates\n\t\t\t\t\t\tval[mapping[i]] = task[i];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn duration.set_value.call(gantt, node, value, val, section);//set default value\n\t\t\t\t} else {\n\t\t\t\t\toptional_time.enable(node, section);\n\t\t\t\t\treturn duration.set_value.call(gantt, node, value, task, section);\n\t\t\t\t}\n\t\t\t},\n\t\t\tget_value: function (node, task, section) {\n\t\t\t\tif (section.disabled) {\n\t\t\t\t\treturn {start_date: null};\n\t\t\t\t} else {\n\t\t\t\t\treturn duration.get_value.call(gantt, node, task, section);\n\t\t\t\t}\n\t\t\t},\n\t\t\tupdate_block: function (node, section) {\n\t\t\t\tgantt.callEvent(\"onSectionToggle\", [gantt._lightbox_id, section]);\n\t\t\t\tnode.style.display = section.disabled ? \"none\" : \"block\";\n\n\t\t\t\tif (section.button) {\n\t\t\t\t\tvar button = node.previousSibling.querySelector(\".gantt_custom_button_label\"),\n\t\t\t\t\t\tlabels = gantt.locale.labels;\n\n\t\t\t\t\tvar button_text = section.disabled ? labels[section.name + \"_enable_button\"] : labels[section.name + \"_disable_button\"];\n\n\t\t\t\t\tbutton.innerHTML = button_text;\n\t\t\t\t}\n\t\t\t\tgantt.resizeLightbox();\n\t\t\t},\n\t\t\tdisable: function (node, section) {\n\t\t\t\tsection.disabled = true;\n\t\t\t\toptional_time.update_block(node, section);\n\n\t\t\t},\n\t\t\tenable: function (node, section) {\n\t\t\t\tsection.disabled = false;\n\t\t\t\toptional_time.update_block(node, section);\n\t\t\t},\n\t\t\tbutton_click: function (index, el, section, container) {\n\t\t\t\tif (gantt.callEvent(\"onSectionButton\", [gantt._lightbox_id, section]) === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar config = gantt._get_typed_lightbox_config()[index];\n\t\t\t\tif (config.disabled) {\n\t\t\t\t\toptional_time.enable(container, config);\n\t\t\t\t} else {\n\t\t\t\t\toptional_time.disable(container, config);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn optional_time;\n\t};\n\n\tgantt.form_blocks.duration_optional = gantt._extend_to_optional(gantt.form_blocks.duration);\n\tgantt.form_blocks.time_optional = gantt._extend_to_optional(gantt.form_blocks.time);\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/lightbox_optional_time.js\n// module id = 87\n// module chunks = 0","module.exports = function(gantt) {\n\n\tgantt.getTaskType = function (type) {\n\t\treturn \"task\";\n\t};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/data_task_types.gpl.js\n// module id = 88\n// module chunks = 0","/*\n reuse results of functions that can be recalculated during rendering\n greatly increases the rendering speed when critical path enabled\n Sample - 94_dev/critical_path.html\n\n */\nmodule.exports = function(gantt){\n\ngantt._cached_functions = {\n\tcache: {},\n\tmode: false,\n\tcritical_path_mode: false,\n\twrap_methods : function(methods, object){\n\t\tif(object._prefetch_originals){\n\t\t\tfor(var i in object._prefetch_originals){\n\t\t\t\tobject[i] = object._prefetch_originals[i];\n\t\t\t}\n\t\t}\n\t\tobject._prefetch_originals = {};\n\t\tfor(var i = 0; i < methods.length; i++)\n\t\t\tthis.prefetch(methods[i], object);\n\n\t},\n\tprefetch : function(methodname, host){\n\t\tvar original = host[methodname];\n\t\tif(original){\n\t\t\tvar optimizer = this;\n\n\t\t\thost._prefetch_originals[methodname] = original;\n\t\t\thost[methodname] = function get_prefetched_value(){\n\n\t\t\t\tvar argumentsArray = new Array(arguments.length);\n\t\t\t\tfor (var i = 0, l = arguments.length; i < l; i++) {\n\t\t\t\t\targumentsArray[i] = arguments[i];\n\t\t\t\t}\n\n\t\t\t\tif(optimizer.active){\n\t\t\t\t\tvar args = optimizer.get_arguments_hash(Array.prototype.slice.call(argumentsArray));\n\t\t\t\t\tif(!optimizer.cache[methodname]){\n\t\t\t\t\t\toptimizer.cache[methodname] = {};\n\t\t\t\t\t}\n\n\t\t\t\t\tvar cached_values = optimizer.cache[methodname];\n\n\t\t\t\t\tif(optimizer.has_cached_value(cached_values, args)){\n\t\t\t\t\t\treturn optimizer.get_cached_value(cached_values, args);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tvar value = original.apply(this, argumentsArray);\n\t\t\t\t\t\toptimizer.cache_value(cached_values, args, value);\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn original.apply(this, argumentsArray);\n\t\t\t};\n\t\t}\n\t\treturn original;\n\t},\n\tcache_value: function(cache, arguments_hash, value){\n\t\tif(this.is_date(value))\n\t\t\tvalue = new Date(value);\n\t\tcache[arguments_hash] = value;\n\t},\n\thas_cached_value: function(cache, arguments_hash){\n\t\treturn cache.hasOwnProperty(arguments_hash);\n\t},\n\tget_cached_value: function(cache, arguments_hash){\n\t\tvar data = cache[arguments_hash];\n\n\t\t//for cached dates - return copy\n\t\tif(this.is_date(data)){\n\t\t\tdata = new Date(data);\n\t\t}\n\t\treturn data;\n\t},\n\tis_date: function(value){\n\t\treturn (value && value.getUTCDate);\n\t},\n\tget_arguments_hash:function(args){\n\t\tvar values = [];\n\t\tfor(var i = 0; i < args.length; i++){\n\t\t\tvalues.push(this.stringify_argument(args[i]));\n\t\t}\n\t\treturn \"(\" + values.join(\";\") + \")\";\n\t},\n\tstringify_argument: function(value){\n\t\t//expecting task or link, or any other data entries, dates and primitive values\n\t\tvar ret = \"\";\n\t\tif(value.id){\n\t\t\tret = value.id;\n\t\t}else if(this.is_date(value)){\n\t\t\tret = value.valueOf();\n\t\t}else{\n\t\t\tret = value;\n\t\t}\n\t\treturn ret + \"\";\n\t},\n\tactivate: function(){\n\t\tthis.clear();\n\t\tthis.active = true;\n\t},\n\tdeactivate: function(){\n\t\tthis.clear();\n\t\tthis.active = false;\n\t},\n\tclear: function(){\n\t\tthis.cache = {};\n\t},\n\n\tsetup: function(gantt){\n\t\tvar override_gantt = [];\n\n\t\tvar gantt_methods = [\n\t\t\t'_isCriticalTask',\n\t\t\t'isCriticalLink',\n\t\t\t'_isProjectEnd',\n\t\t\t'_getProjectEnd',\n\t\t\t'_getSlack'\n\t\t];\n\n\n\n\t\tif(this.mode == 'auto'){\n\t\t\tif(gantt.config.highlight_critical_path){\n\t\t\t\toverride_gantt = gantt_methods;\n\t\t\t}\n\t\t}else if(this.mode === true){\n\t\t\toverride_gantt = gantt_methods;\n\t\t}\n\n\t\tthis.wrap_methods(override_gantt, gantt);\n\n\t},\n\tupdate_if_changed: function(gantt){\n\t\tvar changed = (this.critical_path_mode != gantt.config.highlight_critical_path ||\n\t\t\t\t\t\tthis.mode !== gantt.config.optimize_render);\n\t\tif(changed){\n\t\t\tthis.critical_path_mode = gantt.config.highlight_critical_path;\n\t\t\tthis.mode = gantt.config.optimize_render;\n\t\t\tthis.setup(gantt);\n\t\t}\n\t}\n};\n\nfunction activate(){\n\tgantt._cached_functions.update_if_changed(gantt);\n\tif(!gantt._cached_functions.active){\n\t\tgantt._cached_functions.activate();\n\t}\n\treturn true;\n}\ngantt.attachEvent(\"onBeforeGanttRender\", activate);\ngantt.attachEvent(\"onBeforeDataRender\", activate);\ngantt.attachEvent(\"onBeforeSmartRender\", function(){\n\tactivate();\n});\ngantt.attachEvent(\"onBeforeParse\", activate);\ngantt.attachEvent(\"onDataRender\", function(){\n\tgantt._cached_functions.deactivate();\n});\nvar deactivTimeout = null;\ngantt.attachEvent(\"onSmartRender\", function(){\n\tif(deactivTimeout)\n\t\tclearTimeout(deactivTimeout);\n\tdeactivTimeout = setTimeout(function(){\n\t\tgantt._cached_functions.deactivate();\n\t}, 1000);\n});\n\ngantt.attachEvent(\"onBeforeGanttReady\", function(){\n\tgantt._cached_functions.update_if_changed(gantt);\n\treturn true;\n});\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/cached_functions.js\n// module id = 89\n// module chunks = 0","function _configure(col, data, force) {\n\tfor (var key in data)\n\t\tif (typeof col[key] == \"undefined\" || force)\n\t\t\tcol[key] = data[key];\n}\n\nfunction _get_skin(force, gantt) {\n\tvar skin = gantt.skin;\n\tif (!skin || force) {\n\t\tvar links = document.getElementsByTagName(\"link\");\n\t\tfor (var i = 0; i < links.length; i++) {\n\t\t\tvar res = links[i].href.match(\"dhtmlxgantt_([a-z\\_]+).css\");\n\t\t\tif (res) {\n\t\t\t\tif (gantt.skins[res[1]] || !skin) {\n\t\t\t\t\tskin = res[1];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tgantt.skin = skin || \"terrace\";\n\tvar skinset = gantt.skins[gantt.skin] || gantt.skins[\"terrace\"];\n\n\t//apply skin related settings\n\t_configure(gantt.config, skinset.config, force);\n\n\tvar config = gantt.getGridColumns();\n\tif (config[1] && !gantt.defined(config[1].width))\n\t\tconfig[1].width = skinset._second_column_width;\n\tif (config[2] && !gantt.defined(config[2].width))\n\t\tconfig[2].width = skinset._third_column_width;\n\t\n\tfor (var i=0; i column.width) ? column.min_width : column.width;\n\t\t\t\tcolumn.width = (column.max_width && column.max_width < column.width) ? column.max_width : column.width;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (skinset.config.task_height)\n\t\tgantt.config.task_height = skinset.config.task_height || \"full\"; \n\n\tif (skinset._lightbox_template)\n\t\tgantt._lightbox_template = skinset._lightbox_template;\n\n\tif (skinset._redefine_lightbox_buttons) {\n\t\tgantt.config.buttons_right = skinset._redefine_lightbox_buttons[\"buttons_right\"];\n\t\tgantt.config.buttons_left = skinset._redefine_lightbox_buttons[\"buttons_left\"];\n\t}\n\n\n\tgantt.resetLightbox();\n}\n\nmodule.exports = function(gantt) {\n\tif(!gantt.resetSkin){\n\t\tgantt.resetSkin = function () {\n\t\t\tthis.skin = \"\";\n\t\t\t_get_skin(true, this);\n\t\t};\n\t\tgantt.skins = {};\n\n\t\tgantt.attachEvent(\"onGanttLayoutReady\", function(){\n\t\t\t_get_skin(false, this);\n\t\t});\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/skin.js\n// module id = 90\n// module chunks = 0","module.exports = function(gantt) {\ngantt.skins.skyblue = {\n\tconfig:{\n\t\tgrid_width:350,\n\t\trow_height: 27,\n\t\tscale_height: 27,\n\t\tlink_line_width:1,\n\t\tlink_arrow_size:8,\n\t\tlightbox_additional_height:75\n\t},\n\t_second_column_width:95,\n\t_third_column_width:80\n};\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/css/skins/skyblue.js\n// module id = 91\n// module chunks = 0","module.exports = function(gantt) {\ngantt.skins.meadow = {\n\tconfig:{\n\t\tgrid_width:350,\n\t\trow_height: 27,\n\t\tscale_height: 30,\n\t\tlink_line_width:2,\n\t\tlink_arrow_size:6,\n\t\tlightbox_additional_height:72\n\t},\n\t_second_column_width:95,\n\t_third_column_width:80\n};\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/css/skins/meadow.js\n// module id = 92\n// module chunks = 0","module.exports = function(gantt) {\ngantt.skins.terrace = {\n\tconfig:{\n\t\tgrid_width:360,\n\t\trow_height: 35,\n\t\tscale_height: 35,\n\t\tlink_line_width:2,\n\t\tlink_arrow_size:6,\n\t\tlightbox_additional_height:75\n\t},\n\t_second_column_width:90,\n\t_third_column_width:70\t\t\n};\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/css/skins/terrace.js\n// module id = 93\n// module chunks = 0","\n\nmodule.exports = function(gantt) {\n\tgantt.skins.broadway = {\n\t\tconfig: {\n\t\t\tgrid_width: 360,\n\t\t\trow_height: 35,\n\t\t\tscale_height: 35,\n\t\t\tlink_line_width: 1,\n\t\t\tlink_arrow_size: 7,\n\t\t\tlightbox_additional_height: 86\n\t\t},\n\t\t_second_column_width: 90,\n\t\t_third_column_width: 80,\n\n\t\t_lightbox_template: \"\",\n\t\t_config_buttons_left: {},\n\t\t_config_buttons_right: {\n\t\t\t\"gantt_delete_btn\": \"icon_delete\",\n\t\t\t\"gantt_save_btn\": \"icon_save\"\n\t\t}\n\t};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/css/skins/broadway.js\n// module id = 94\n// module chunks = 0","module.exports = function(gantt) {\n\tgantt.skins.material = {\n\t\tconfig: {\n\t\t\tgrid_width: 411,\n\t\t\trow_height: 34,\n\t\t\ttask_height_offset: 6,\n\t\t\tscale_height: 36,\n\t\t\tlink_line_width: 2,\n\t\t\tlink_arrow_size: 6,\n\t\t\tlightbox_additional_height: 80\n\t\t},\n\t\t_second_column_width: 110,\n\t\t_third_column_width: 75,\n\t\t_redefine_lightbox_buttons: {\n\t\t\t\"buttons_left\": [\"dhx_delete_btn\"],\n\t\t\t\"buttons_right\": [\"dhx_save_btn\", \"dhx_cancel_btn\"]\n\t\t}\n\t};\n\n\tgantt.attachEvent(\"onAfterTaskDrag\", function (id) {\n\t\tvar t = gantt.getTaskNode(id);\n\t\tif (t) {\n\t\t\tt.className += \" gantt_drag_animation\";\n\t\t\tsetTimeout(function () {\n\t\t\t\tvar indx = t.className.indexOf(\" gantt_drag_animation\");\n\t\t\t\tif (indx > -1) {\n\t\t\t\t\tt.className = t.className.slice(0, indx);\n\t\t\t\t}\n\t\t\t}, 200);\n\t\t}\n\t});\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/css/skins/material.js\n// module id = 95\n// module chunks = 0","module.exports = function(gantt) {\ngantt.skins[\"contrast_black\"] = {\n\tconfig:{\n\t\tgrid_width:360,\n\t\trow_height: 35,\n\t\tscale_height: 35,\n\t\tlink_line_width:2,\n\t\tlink_arrow_size:6,\n\t\tlightbox_additional_height:75\n\t},\n\t_second_column_width:100,\n\t_third_column_width:80\n};\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/css/skins/contrast_black.js\n// module id = 96\n// module chunks = 0","module.exports = function(gantt) {\ngantt.skins[\"contrast_white\"] = {\n\tconfig:{\n\t\tgrid_width:360,\n\t\trow_height: 35,\n\t\tscale_height: 35,\n\t\tlink_line_width:2,\n\t\tlink_arrow_size:6,\n\t\tlightbox_additional_height:75\n\t},\n\t_second_column_width:100,\n\t_third_column_width:80\n};\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/css/skins/contrast_white.js\n// module id = 97\n// module chunks = 0","module.exports = function(gantt) {\n\n\tgantt.config.touch_drag = 500; //nearly immediate dnd\n\tgantt.config.touch = true;\n\tgantt.config.touch_feedback = true;\n\tgantt.config.touch_feedback_duration = 1;\n\tgantt._prevent_touch_scroll = false;\n\n\n\tgantt._touch_feedback = function () {\n\t\tif (gantt.config.touch_feedback) {\n\t\t\tif (navigator.vibrate)\n\t\t\t\tnavigator.vibrate(gantt.config.touch_feedback_duration);\n\t\t}\n\t};\n\n\tgantt.attachEvent(\"onGanttReady\", gantt.bind(function(){\n\t\tif (this.config.touch != \"force\")\n\t\t\tthis.config.touch = this.config.touch &&\n\t\t\t\t((navigator.userAgent.indexOf(\"Mobile\") != -1) ||\n\t\t\t\t\t(navigator.userAgent.indexOf(\"iPad\") != -1) ||\n\t\t\t\t\t(navigator.userAgent.indexOf(\"Android\") != -1) ||\n\t\t\t\t\t(navigator.userAgent.indexOf(\"Touch\") != -1));\n\n\t\tif (this.config.touch) {\n\n\t\t\tvar touchEventsSupported = true;\n\t\t\ttry {\n\t\t\t\tdocument.createEvent(\"TouchEvent\");\n\t\t\t} catch (e) {\n\t\t\t\ttouchEventsSupported = false;\n\t\t\t}\n\n\t\t\tif (touchEventsSupported) {\n\t\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\n\t\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\n\t\t\t\t\tif (ev.touches[0])\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttarget: ev.target,\n\t\t\t\t\t\t\tpageX: ev.touches[0].pageX,\n\t\t\t\t\t\t\tpageY: ev.touches[0].pageY,\n\t\t\t\t\t\t\tclientX: ev.touches[0].clientX,\n\t\t\t\t\t\t\tclientY: ev.touches[0].clientY\n\t\t\t\t\t\t};\n\t\t\t\t\telse\n\t\t\t\t\t\treturn ev;\n\t\t\t\t}, function () {\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t} else if (window.navigator.pointerEnabled) {\n\t\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\n\t\t\t\t\tif (ev.pointerType == \"mouse\") return null;\n\t\t\t\t\treturn ev;\n\t\t\t\t}, function (ev) {\n\t\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\n\t\t\t\t});\n\t\t\t} else if (window.navigator.msPointerEnabled) {\n\t\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\n\t\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\n\t\t\t\t\treturn ev;\n\t\t\t\t}, function (ev) {\n\t\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\n\t\t\t\t});\n\t\t\t}\n\n\t\t}\n\t}, gantt));\n\n\n\tfunction getTaskDND(){\n\t\tvar _tasks_dnd;\n\t\tif(gantt.$ui.getView(\"timeline\")){\n\t\t\t_tasks_dnd = gantt.$ui.getView(\"timeline\")._tasks_dnd;\n\t\t}\n\t\treturn _tasks_dnd;\n\t}\n\n\tvar touchHandlers = [];\n\n//we can't use native scrolling, as we need to sync momentum between different parts\n//so we will block native scroll and use the custom one\n//in future we can add custom momentum\n\tgantt._touch_events = function (names, accessor, ignore) {\n\t\t//webkit on android need to be handled separately\n\t\tvar dblclicktime = 0;\n\t\tvar action_mode = false;\n\t\tvar scroll_mode = false;\n\t\tvar dblclick_timer = 0;\n\t\tvar action_start = null;\n\t\tvar scroll_state;\n\t\tvar long_tap_timer = null;\n\t\tvar current_target = null;\n\n\n\n\t\tfor(var i = 0; i < touchHandlers.length; i++){\n\t\t\tgantt.eventRemove(touchHandlers[i][0], touchHandlers[i][1], touchHandlers[i][2]);\n\t\t}\n\t\ttouchHandlers = [];\n\n\t\t//touch move\n\t\ttouchHandlers.push([gantt.$container, names[0], function (e) {\n\t\t\tvar _tasks_dnd = getTaskDND();\n\n\t\t\t\tif (ignore(e)) return;\n\n\t\t\t\t//ignore common and scrolling moves\n\t\t\t\tif (!action_mode) return;\n\n\t\t\t\tif (long_tap_timer) clearTimeout(long_tap_timer);\n\n\t\t\t\tvar source = accessor(e);\n\t\t\t\tif (_tasks_dnd && (_tasks_dnd.drag.id || _tasks_dnd.drag.start_drag)) {\n\t\t\t\t\t_tasks_dnd.on_mouse_move(source);\n\t\t\t\t\tif (e.preventDefault)\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.cancelBubble = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (!gantt._prevent_touch_scroll) {\n\t\t\t\t\tif (source && action_start) {\n\t\t\t\t\t\tvar dx = action_start.pageX - source.pageX;\n\t\t\t\t\t\tvar dy = action_start.pageY - source.pageY;\n\t\t\t\t\t\tif (!scroll_mode && (Math.abs(dx) > 5 || Math.abs(dy) > 5)) {\n\t\t\t\t\t\t\tgantt._touch_scroll_active = scroll_mode = true;\n\t\t\t\t\t\t\tdblclicktime = 0;\n\t\t\t\t\t\t\tscroll_state = gantt.getScrollState();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (scroll_mode) {\n\t\t\t\t\t\t\tgantt.scrollTo(scroll_state.x + dx, scroll_state.y + dy);\n\t\t\t\t\t\t\tvar new_scroll_state = gantt.getScrollState();\n\n\t\t\t\t\t\t\tif ((scroll_state.x != new_scroll_state.x && dy > 2 * dx) ||\n\t\t\t\t\t\t\t\t(scroll_state.y != new_scroll_state.y && dx > 2 * dy )) {\n\t\t\t\t\t\t\t\treturn block_action(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn block_action(e);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}]);\n\n\n\t\t//block touch context menu in IE10\n\t\ttouchHandlers.push([this.$container, \"contextmenu\", function (e) {\n\t\t\tif (action_mode)\n\t\t\t\treturn block_action(e);\n\t\t}]);\n\n\t\t//touch start\n\t\ttouchHandlers.push([this.$container, names[1], function (e) {\n\t\t\tif (ignore(e)) return;\n\t\t\tif (e.touches && e.touches.length > 1) {\n\t\t\t\taction_mode = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taction_start = accessor(e);\n\t\t\tif (!gantt._locate_css(action_start, \"gantt_hor_scroll\") && !gantt._locate_css(action_start, \"gantt_ver_scroll\")) {\n\t\t\t\taction_mode = true;\n\t\t\t}\n\t\t\tvar _tasks_dnd = getTaskDND();\n\n\t\t\t//long tap\n\t\t\tlong_tap_timer = setTimeout(function () {\n\t\t\t\tvar taskId = gantt.locate(action_start);\n\t\t\t\tif (_tasks_dnd && (taskId && !gantt._locate_css(action_start, \"gantt_link_control\") && !gantt._locate_css(action_start, \"gantt_grid_data\"))) {\n\t\t\t\t\t_tasks_dnd.on_mouse_down(action_start);\n\n\t\t\t\t\tif (_tasks_dnd.drag && _tasks_dnd.drag.start_drag) {\n\t\t\t\t\t\tcloneTaskRendered(taskId);\n\t\t\t\t\t\t_tasks_dnd._start_dnd(action_start);\n\t\t\t\t\t\tgantt._touch_drag = true;\n\n\t\t\t\t\t\tgantt.refreshTask(taskId);\n\n\t\t\t\t\t\tgantt._touch_feedback();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tlong_tap_timer = null;\n\t\t\t}, gantt.config.touch_drag);\n\t\t}]);\n\n\t\t//touch end\n\t\ttouchHandlers.push([this.$container, names[2], function (e) {\n\t\t\tif (ignore(e)) return;\n\t\t\tif (long_tap_timer) clearTimeout(long_tap_timer);\n\t\t\tgantt._touch_drag = false;\n\t\t\taction_mode = false;\n\t\t\tvar source = accessor(e);\n\n\t\t\tvar _tasks_dnd = getTaskDND();\n\n\t\t\tif(_tasks_dnd)\n\t\t\t\t_tasks_dnd.on_mouse_up(source);\n\n\t\t\tif (current_target) {\n\t\t\t\tgantt.refreshTask(gantt.locate(current_target));\n\t\t\t\tif (current_target.parentNode) {\n\t\t\t\t\tcurrent_target.parentNode.removeChild(current_target);\n\t\t\t\t\tgantt._touch_feedback();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgantt._touch_scroll_active = action_mode = scroll_mode = false;\n\t\t\tcurrent_target = null;\n\n\t\t\t//dbl-tap handling\n\t\t\tif (action_start && dblclicktime) {\n\t\t\t\tvar now = new Date();\n\t\t\t\tif ((now - dblclicktime) < 500) {\n\n\t\t\t\t\tvar mouseEvents = gantt.$services.getService(\"mouseEvents\");\n\t\t\t\t\tmouseEvents.onDoubleClick(action_start);\n\t\t\t\t\tblock_action(e);\n\t\t\t\t} else\n\t\t\t\t\tdblclicktime = now;\n\t\t\t} else {\n\t\t\t\tdblclicktime = new Date();\n\t\t\t}\n\t\t}]);\n\n\t\tfor(var i = 0; i < touchHandlers.length; i++){\n\t\t\tgantt.event(touchHandlers[i][0], touchHandlers[i][1], touchHandlers[i][2]);\n\t\t}\n\n\t\t//common helper, prevents event\n\t\tfunction block_action(e) {\n\t\t\tif (e && e.preventDefault)\n\t\t\t\te.preventDefault();\n\t\t\t(e || event).cancelBubble = true;\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction cloneTaskRendered(taskId) {\n\t\t\tvar renders = gantt._getTaskLayers();\n\t\t\tvar task = gantt.getTask(taskId);\n\t\t\tif (task && gantt.isTaskVisible(taskId)) {\n\t\t\t\tfor (var i = 0; i < renders.length; i++) {\n\t\t\t\t\ttask = renders[i].rendered[taskId];\n\t\t\t\t\tif (task && task.getAttribute(\"task_id\") && task.getAttribute(\"task_id\") == taskId) {\n\t\t\t\t\t\tvar copy = task.cloneNode(true);\n\t\t\t\t\t\tcurrent_target = task;\n\t\t\t\t\t\trenders[i].rendered[taskId] = copy;\n\t\t\t\t\t\ttask.style.display = \"none\";\n\t\t\t\t\t\tcopy.className += \" gantt_drag_move \";\n\t\t\t\t\t\ttask.parentNode.appendChild(copy);\n\t\t\t\t\t\t//return copy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/touch.js\n// module id = 98\n// module chunks = 0","module.exports = function(gantt) {\n\tgantt.locale = {\n\t\tdate: {\n\t\t\tmonth_full: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n\t\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n\t\t\tday_full: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n\t\t\tday_short: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\n\t\t},\n\t\tlabels: {\n\t\t\tnew_task: \"New task\",\n\t\t\ticon_save: \"Save\",\n\t\t\ticon_cancel: \"Cancel\",\n\t\t\ticon_details: \"Details\",\n\t\t\ticon_edit: \"Edit\",\n\t\t\ticon_delete: \"Delete\",\n\t\t\tconfirm_closing: \"\",//Your changes will be lost, are you sure?\n\t\t\tconfirm_deleting: \"Task will be deleted permanently, are you sure?\",\n\t\t\tsection_description: \"Description\",\n\t\t\tsection_time: \"Time period\",\n\t\t\tsection_type: \"Type\",\n\n\t\t\t/* grid columns */\n\t\t\tcolumn_wbs: \"WBS\",\n\t\t\tcolumn_text: \"Task name\",\n\t\t\tcolumn_start_date: \"Start time\",\n\t\t\tcolumn_duration: \"Duration\",\n\t\t\tcolumn_add: \"\",\n\n\t\t\t/* link confirmation */\n\t\t\tlink: \"Link\",\n\t\t\tconfirm_link_deleting: \"will be deleted\",\n\t\t\tlink_start: \" (start)\",\n\t\t\tlink_end: \" (end)\",\n\n\t\t\ttype_task: \"Task\",\n\t\t\ttype_project: \"Project\",\n\t\t\ttype_milestone: \"Milestone\",\n\n\t\t\tminutes: \"Minutes\",\n\t\t\thours: \"Hours\",\n\t\t\tdays: \"Days\",\n\t\t\tweeks: \"Week\",\n\t\t\tmonths: \"Months\",\n\t\t\tyears: \"Years\",\n\n\t\t\t/* message popup */\n\t\t\tmessage_ok: \"OK\",\n\t\t\tmessage_cancel: \"Cancel\"\n\n\t\t}\n\t};\n};\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/locale/locale.js\n// module id = 99\n// module chunks = 0","var domHelpers = require(\"../utils/dom_helpers\"),\n\thelpers = require(\"../utils/helpers\");\n\nmodule.exports = function(gantt){\n\tvar calculateScaleRange = require(\"./gantt_data_range\");\n\n\tgantt.assert = require(\"./common/assert\")(gantt);\n\n//initial initialization\n\tgantt.init = function(node, from, to){\n\t\tif(from && to){\n\t\t\tthis.config.start_date = this._min_date = new Date(from);\n\t\t\tthis.config.end_date = this._max_date = new Date(to);\n\t\t}\n\t\tthis.date.init();\n\n\t\tif (!this.config.scroll_size)\n\t\t\tthis.config.scroll_size = domHelpers.getScrollSize() || 1;\n\n\t\tvar resizeDelay;\n\t\tgantt.event(window, \"resize\", function(){\n\t\t\tclearTimeout(resizeDelay);\n\t\t\tresizeDelay = setTimeout(function(){\n\t\t\t\tgantt.render();\n\t\t\t}, 300);\n\t\t});\n\n\t\t//can be called only once\n\t\tthis.init = function(node){\n\t\t\tif (this.$container && this.$container.parentNode){\n\t\t\t\tthis.$container.parentNode.removeChild(this.$container);\n\t\t\t\tthis.$container = null;\n\t\t\t}\n\n\t\t\tif(this.$layout){\n\t\t\t\tthis.$layout.clear();\n\t\t\t}\n\t\t\tthis._reinit(node);\n\t\t};\n\n\t\tthis._reinit(node);\n\t};\n\n\tgantt._reinit = function(node){\n\t\tthis.callEvent(\"onBeforeGanttReady\", []);\n\t\t//this._init_tasks_range();\n\t\tthis.resetLightbox();\n\t\tthis._update_flags();\n\n\n\t\tvar config = this.$services.getService(\"templateLoader\");\n\t\tconfig.initTemplates(this);\n\n\t\tthis._clearTaskLayers();\n\t\tthis._clearLinkLayers();\n\n\t\t//this.clear\n\t\tif(this.$layout){\n\t\t\tthis.$layout.destructor();\n\t\t\tthis.$ui.reset();\n\t\t}\n\n\t\tthis.$root = domHelpers.toNode(node);\n\t\tif(this.$root){\n\t\t\tthis.$root.innerHTML = \"\";\n\t\t}\n\t\tthis.$root.gantt = this;\n\t\tcalculateScaleRange(this);\n\t\tthis.config.layout.id = \"main\";\n\t\tthis.$layout = this.$ui.createView(\"layout\", node, this.config.layout);\n\n\t\tthis.$layout.attachEvent(\"onBeforeResize\", function(){\n\t\t\tvar storeNames = gantt.$services.getService(\"datastores\");\n\t\t\tfor(var i = 0; i < storeNames.length; i++){\n\t\t\t\tgantt.getDatastore(storeNames[i]).filter();\n\t\t\t}\n\t\t});\n\n\t\tthis.$layout.attachEvent(\"onResize\", function(){\n\t\t\tgantt.refreshData();\n\t\t});\n\n\t\tthis.callEvent(\"onGanttLayoutReady\", []);\n\t\tthis.$layout.render();\n\n\t\tgantt.$container = this.$layout.$container.firstChild;\n\t\tthis.callEvent(\"onTemplatesReady\",[]);\n\t\tthis.$mouseEvents.reset(this.$root);\n\t\tthis.callEvent(\"onGanttReady\", []);\n\n\t\tthis.render();\n\t};\n\n\tgantt.$click={\n\t\tbuttons:{\n\t\t\t\"edit\":function(id){\n\t\t\t\tgantt.showLightbox(id);\n\t\t\t},\n\t\t\t\"delete\":function(id){\n\t\t\t\tvar question = gantt.locale.labels.confirm_deleting;\n\t\t\t\tvar title = gantt.locale.labels.confirm_deleting_title;\n\n\t\t\t\tgantt._dhtmlx_confirm(question, title, function(){\n\t\t\t\t\tif(!gantt.isTaskExists(id)){\n\t\t\t\t\t\tgantt.hideLightbox();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar task = gantt.getTask(id);\n\t\t\t\t\tif(task.$new){\n\t\t\t\t\t\tgantt.silent(function(){\n\t\t\t\t\t\t\tgantt.deleteTask(id, true);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tgantt.refreshData();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tgantt.deleteTask(id);\n\t\t\t\t\t}\n\n\t\t\t\t\tgantt.hideLightbox();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n\tgantt.getScrollState = function(){\n\t\tvar state = this._scroll_state();\n\t\treturn { x:state.x_pos, y:state.y_pos, inner_width:state.x, inner_height:state.y, width: state.x_inner, height: state.y_inner };\n\t};\n\n\tgantt.scrollTo = function(left, top){\n\t\tvar vertical = this._getVerticalScrollbar();\n\t\tvar horizontal = this._getHorizontalScrollbar();\n\n\t\tvar oldV = vertical.getScrollState(),\n\t\t\toldH = horizontal.getScrollState();\n\n\t\tif (left*1 == left){\n\t\t\thorizontal.scroll(left);\n\t\t}\n\t\tif(top*1 == top){\n\t\t\tvertical.scroll(top);\n\t\t}\n\n\t\tvar newV = vertical.getScrollState(),\n\t\t\tnewH = horizontal.getScrollState();\n\n\t\tthis.callEvent(\"onGanttScroll\", [oldH.position, oldV.position, newH.position, newV.position]);\n\t};\n\n\tgantt.showDate = function(date){\n\t\tvar date_x = this.posFromDate(date);\n\t\tvar scroll_to = Math.max(date_x - this.config.task_scroll_offset, 0);\n\t\tthis.scrollTo(scroll_to);\n\t};\n\tgantt.showTask = function(id) {\n\t\tvar pos = this.getTaskPosition(this.getTask(id));\n\n\t\tvar left = Math.max(pos.left - this.config.task_scroll_offset, 0);\n\n\t\tvar dataHeight = this._scroll_state().y;\n\t\tvar top;\n\t\tif(!dataHeight){\n\t\t\ttop = pos.top;\n\t\t}else{\n\t\t\ttop = pos.top - (dataHeight - this.config.row_height)/2;\n\t\t}\n\n\t\tthis.scrollTo(left, top);\n\t};\n\n//renders self\n\tgantt.render = function(){\n\t\tthis.callEvent(\"onBeforeGanttRender\", []);\n\n\t\tvar pos = this.getScrollState();\n\t\tvar posX = pos ? pos.x : 0;\n\t\tif(this._getHorizontalScrollbar()){\n\t\t\tvar scrollbar = this._getHorizontalScrollbar();\n\t\t\tposX = scrollbar.$config.codeScrollLeft || posX || 0;\n\t\t}\n\n\n\t\tvar visible_date = null;\n\t\tif(posX){\n\t\t\tvisible_date = gantt.dateFromPos(posX + this.config.task_scroll_offset);\n\t\t}\n\t\tcalculateScaleRange(this);\n\n\t\tthis.$layout.$config.autosize = this.config.autosize;\n\t\tthis.$layout.resize();\n\n\t\tif(this.config.preserve_scroll && pos){\n\n\t\t\tif(posX){\n\t\t\t\tvar new_pos = gantt.getScrollState();\n\t\t\t\tvar new_date = gantt.dateFromPos(new_pos.x);\n\t\t\t\tif(!(+visible_date == +new_date && new_pos.y == pos.y)){\n\t\t\t\t\tif(visible_date){\n\t\t\t\t\t\tthis.showDate(visible_date);\n\t\t\t\t\t}\n\t\t\t\t\tif(pos.y)\n\t\t\t\t\t\tgantt.scrollTo(undefined, pos.y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.callEvent(\"onGanttRender\", []);\n\t};\n\n\t//TODO: add layout.resize method that wouldn't trigger data repaint\n\tgantt.setSizes = gantt.render;\n\n\tgantt._scroll_state = function(){\n\t\tvar result = {\n\t\t\tx: false,\n\t\t\ty: false,\n\t\t\tx_pos: 0,\n\t\t\ty_pos: 0,\n\t\t\tscroll_size: this.config.scroll_size + 1,//1px for inner content\n\t\t\tx_inner: 0,\n\t\t\ty_inner: 0\n\t\t};\n\n\t\tvar scrollVer = gantt._getVerticalScrollbar(),\n\t\t\tscrollHor = gantt._getHorizontalScrollbar();\n\t\tif(scrollHor){\n\t\t\tvar horState = scrollHor.getScrollState();\n\t\t\tif(horState.visible){\n\t\t\t\tresult.x = horState.size;\n\t\t\t\tresult.x_inner = horState.scrollSize;\n\t\t\t}\n\t\t\tresult.x_pos = horState.position || 0;\n\t\t}\n\n\t\tif(scrollVer){\n\t\t\tvar verState = scrollVer.getScrollState();\n\t\t\tif(verState.visible){\n\t\t\t\tresult.y = verState.size;\n\n\t\t\t\tresult.y_inner = verState.scrollSize;\n\t\t\t}\n\t\t\tresult.y_pos = verState.position || 0;\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tgantt.locate = function(e) {\n\t\tvar trg = domHelpers.getTargetNode(e);\n\n\t\t//ignore empty cells\n\t\tvar className = domHelpers.getClassName(trg);\n\t\tif ((className || \"\").indexOf(\"gantt_task_cell\") >= 0) return null;\n\n\t\tvar targetAttribute = arguments[1] || this.config.task_attribute;\n\n\t\tvar node = domHelpers.locateAttribute(trg, targetAttribute);\n\t\tif(node){\n\t\t\treturn node.getAttribute(targetAttribute);\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t};\n\n\tgantt._locate_css = function(e, classname, strict){\n\t\treturn domHelpers.locateClassName(e, classname, strict);\n\t};\n\n\tgantt._locateHTML = function(e, attribute) {\n\t\treturn domHelpers.locateAttribute(e, attribute || this.config.task_attribute);\n\t};\n\n\tgantt.getTaskRowNode = function(id) {\n\t\tvar els = this.$grid_data.childNodes;\n\t\tvar attribute = this.config.task_attribute;\n\t\tfor (var i = 0; i < els.length; i++) {\n\t\t\tif (els[i].getAttribute) {\n\t\t\t\tvar value = els[i].getAttribute(attribute);\n\t\t\t\tif (value == id) return els[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t};\n\n\tgantt.changeLightboxType = function(type){\n\t\tif(this.getLightboxType() == type)\n\t\t\treturn true;\n\t\tgantt._silent_redraw_lightbox(type);\n\t};\n\n\n\tgantt._get_link_type = function (from_start, to_start) {\n\t\tvar type = null;\n\t\tif (from_start && to_start) {\n\t\t\ttype = gantt.config.links.start_to_start;\n\t\t} else if (!from_start && to_start) {\n\t\t\ttype = gantt.config.links.finish_to_start;\n\t\t} else if (!from_start && !to_start) {\n\t\t\ttype = gantt.config.links.finish_to_finish;\n\t\t} else if (from_start && !to_start) {\n\t\t\ttype = gantt.config.links.start_to_finish;\n\t\t}\n\t\treturn type;\n\t};\n\n\tgantt.isLinkAllowed = function (from, to, from_start, to_start) {\n\t\tvar link = null;\n\t\tif (typeof(from) == \"object\") {\n\t\t\tlink = from;\n\t\t} else {\n\t\t\tlink = {source: from, target: to, type: this._get_link_type(from_start, to_start)};\n\t\t}\n\n\t\tif (!link) return false;\n\t\tif (!(link.source && link.target && link.type)) return false;\n\t\tif (link.source == link.target) return false;\n\n\t\tvar res = true;\n\t\t//any custom rules\n\t\tif (this.checkEvent(\"onLinkValidation\"))\n\t\t\tres = this.callEvent(\"onLinkValidation\", [link]);\n\n\t\treturn res;\n\t};\n\n\n\tgantt._correct_dst_change = function(date, prevOffset, step, unit){\n\t\tvar time_unit = helpers.getSecondsInUnit(unit) * step;\n\t\tif(time_unit > 60*60 && time_unit < 60*60*24){\n\t\t\t//correct dst change only if current unit is more than one hour and less than day (days have own checking), e.g. 12h\n\t\t\tvar offsetChanged = date.getTimezoneOffset() - prevOffset;\n\t\t\tif(offsetChanged){\n\t\t\t\tdate = gantt.date.add(date, offsetChanged, \"minute\");\n\t\t\t}\n\t\t}\n\t\treturn date;\n\t};\n\n\tgantt.getGridColumns = function(){\n\t\treturn gantt.config.columns.slice();\n\t};\n\n\tgantt._is_icon_open_click = function(e) {\n\t\tif (!e)\n\t\t\treturn false;\n\t\tvar target = e.target || e.srcElement;\n\t\tif (!(target && target.className))\n\t\t\treturn false;\n\t\tvar className = domHelpers.getClassName(target);\n\t\tif (className.indexOf(\"gantt_tree_icon\") !== -1 && (className.indexOf(\"gantt_close\") !== -1 || className.indexOf(\"gantt_open\") !== -1))\n\t\t\treturn true;\n\t\treturn false;\n\t};\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/gantt_core.js\n// module id = 100\n// module chunks = 0","/*\n \tasserts will be removed in final code, so you can place them anythere\n\twithout caring about performance impacts\n*/\n\nmodule.exports = function(gantt){\n\treturn function assert(check, message){\n\t\t//jshint -W087\n\t\tif (!check){\n\t\t\tif(gantt.config.show_errors && gantt.callEvent(\"onError\",[message]) !== false) {\n\t\t\t\tgantt.message({type: \"error\", text: message, expire: -1});\n\t\t\t\tdebugger;\n\t\t\t}\n\t\t}\n\t};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/common/assert.js\n// module id = 101\n// module chunks = 0","function extend(gantt){\n\n\tgantt.destructor = function(){\n\t\tgantt.callEvent(\"onDestroy\", []);\n\n\t\tthis.clearAll();\n\t\tthis.detachAllEvents();\n\n\t\tif(this.$root){\n\t\t\tdelete this.$root.gantt;\n\t\t}\n\n\t\tthis._eventRemoveAll();\n\t\tif(this.$layout){\n\t\t\tthis.$layout.destructor();\n\t\t}\n\n\t\tthis.resetLightbox();\n\n\t\tif(this._dp && this._dp.destructor){\n\t\t\tthis._dp.destructor();\n\t\t}\n\n\t\tthis.$services.destructor();\n\n\t\tfor(var i in this){\n\t\t\tif(i.indexOf(\"$\") === 0){\n\t\t\t\tdelete this[i];\n\t\t\t}\n\t\t}\n\t};\n}\n\nmodule.exports = extend;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/destructor.js\n// module id = 102\n// module chunks = 0","module.exports = function(gantt){\n\n\tfunction deprecated(badCode, goodCode) {\n\n\t\tvar formatting = gantt.env.isIE ? \"\" : \"%c\";\n\n\n\t\tvar message = [\n\t\t\tformatting, \"\\\"\", badCode, \"\\\"\", formatting,\n\t\t\t\" has been deprecated in dhtmlxGantt v4.0 and will stop working in v6.0. Use \",\n\t\t\tformatting, \"\\\"\", goodCode, \"\\\"\", formatting,\n\t\t\t\" instead. \\nSee more details at http://docs.dhtmlx.com/gantt/migrating.html \"\n\t\t].join(\"\");\n\n\t\tvar log = window.console.warn || window.console.log;\n\n\t\tvar args = [message];\n\t\tif(!gantt.env.isIE){\n\t\t\targs = args.concat([\"font-weight:bold\", \"font-weight:normal\", \"font-weight:bold\", \"font-weight:normal\"]);\n\t\t}\n\n\t\tlog.apply(window.console, args);\n\t}\n\n\tfunction wrapDeprecated(method) {\n\t\treturn function () {\n\t\t\tdeprecated(\"dhtmlx.\" + method, \"gantt.\" + method);\n\t\t\treturn gantt[method].apply(gantt, arguments);\n\t\t};\n\t}\n\n\t/* dhtmlx */\n\n\n\tif (!window.dhtmlx)\n\t\twindow.dhtmlx = {};\n\n\tvar dhtmlxMethods = [\n\t\t\"message\",\n\t\t\"alert\",\n\t\t\"confirm\",\n\t\t\"modalbox\",\n\t\t\"uid\",\n\t\t\"copy\",\n\t\t\"mixin\",\n\t\t\"defined\",\n\t\t\"bind\",\n\t\t\"assert\"\n\t];\n\n\tvar dynMethods = [];\n\n\tfor(var i = 0; i < dhtmlxMethods.length; i++){\n\t\t// wrap dhtmlx methods with 'deprecated' warnings\n\t\t// do not wrap if methods are defined by dhtmlxSuite\n\t\tif(!window.dhtmlx[dhtmlxMethods[i]]){\n\t\t\tdynMethods.push(dhtmlxMethods[i]);\n\t\t\tdhtmlx[dhtmlxMethods[i]] = wrapDeprecated(dhtmlxMethods[i]);\n\t\t}\n\t}\n\n\tgantt.attachEvent(\"onDestroy\", function(){\n\t\tfor(var i = 0; i < dynMethods.length; i++){\n\t\t\tdelete window.dhtmlx[dynMethods[i]];\n\t\t}\n\t\tdynMethods = null;\n\n\t});\n\n\t/* global functions */\n\n\n\tif (!window.dataProcessor) {\n\t\twindow.dataProcessor = function (url) {\n\t\t\tdeprecated(\"new dataProcessor(url)\", \"new gantt.dataProcessor(url)\");\n\t\t\treturn new gantt.dataProcessor(url);\n\t\t};\n\t\tgantt.attachEvent(\"onDestroy\", function(){\n\t\t\twindow.dataProcessor = null;\n\t\t});\n\t}\n\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sources/core/deprecated_warnings.js\n// module id = 103\n// module chunks = 0"],"sourceRoot":""}