_.width&&(u.marker.style.width=_.width-10-2+"px",u.marker.style.overflow="hidden");var g=f.getItem(a.config.id),p=a._getTargetY(r),v=a._getTaskByY(p,f.getIndexById(g.id));function m(t,e){return!f.isChildOf(y.id,e.id)&&(t.$level==e.$level||h.order_branch_free)}if(f.exists(v)||(v=a.lastTaskOfLevel(h.order_branch_free?g.$level:0))==a.config.id&&(v=null),f.exists(v)){var y=f.getItem(v),k=e.getItemTop(y.id),b=e.getItemHeight(y.id);if(k+b/2=0;)T=f.getIdByIndex(x-C),$=f.getItem(T),C++;if(g.id==y.id||l(y.id))return;m(y,g)&&g.id!=y.id?f.move(g.id,0,0,y.id):y.$level!=g.$level-1||f.getChildren(y.id).length?$&&m($,g)&&g.id!=$.id&&f.move(g.id,-1,f.getParent($.id)):f.move(g.id,0,y.id)}return!0},t)),a.attachEvent("onDragEnd",t.bind(function(){var e=s(),n=e.getItem(a.config.id);n.$transparent=!1,n.$open=a.config.initial_open_state,!1===this.callEvent("onBeforeRowDragEnd",[a.config.id,a.config.parent,a.config.index])?(e.move(a.config.id,a.config.index,a.config.parent),n.$drop_target=null):this.callEvent("onRowDragEnd",[a.config.id,n.$drop_target]),t.render(),this.refreshData()},t))}function o(t){return i.locateAttribute(t,e.$config.item_attribute)}function s(){return t.getDatastore(e.$config.bind)}function l(e){return r(e,t,s())}}}},function(t,e,n){var i=n(0),r=n(115),a=n(114),o=function(t){return{onCreated:function(e){e.$config=i.mixin(e.$config,{bind:"task"}),"grid"==e.$config.id&&(this.extendGantt(e),t.ext.inlineEditors=t.ext._inlineEditors.createEditors(e),t.ext.inlineEditors.init()),this._mouseDelegates=n(33)(t)},onInitialized:function(e){var n=e.$getConfig();n.order_branch&&("marker"==n.order_branch?a.init(e.$gantt,e):r.init(e.$gantt,e)),this.initEvents(e,t),"grid"==e.$config.id&&this.extendDom(e)},onDestroyed:function(e){"grid"==e.$config.id&&t.ext.inlineEditors.destructor(),this.clearEvents(e,t)},initEvents:function(t,e){this._mouseDelegates.delegate("click","gantt_row",e.bind(function(n,i,r){var a=t.$getConfig();if(null!==i){var o=this.getTask(i);a.scroll_on_click&&!e._is_icon_open_click(n)&&this.showDate(o.start_date),e.callEvent("onTaskRowClick",[i,r])}},e),t.$grid),this._mouseDelegates.delegate("click","gantt_grid_head_cell",e.bind(function(n,i,r){var a=r.getAttribute("data-column-id");if(e.callEvent("onGridHeaderClick",[a,n])){var o=t.$getConfig();if("add"!=a){if(o.sort&&a){for(var s,l=a,c=0;c",a.setAttribute(r.task_grid_row_resizer_attribute,e.id),t._waiAria.gridSeparatorAttr(a),a},update:null,getRectangle:i,getVisibleRange:r}}},function(t,e,n){var i=n(29),r=n(6),a=n(28),o=n(27),s=n(39);function l(t,e,n,i){var r=100*(1-(1*t||0)),a=i.posFromDate(e),o=i.posFromDate(n),s=document.createElement("div");return s.className="gantt_histogram_hor_bar",s.style.top=r+"%",s.style.left=a+"px",s.style.width=o-a+1+"px",s}function c(t,e,n){if(t===e)return null;var i=1-Math.max(t,e),r=Math.abs(t-e),a=document.createElement("div");return a.className="gantt_histogram_vert_bar",a.style.top=100*i+"%",a.style.height=100*r+"%",a.style.left=n+"px",a}t.exports=function(t){var e=s(t),n={},u={},d={};function h(t,e){var i=n[t];i&&i[e]&&i[e].parentNode&&i[e].parentNode.removeChild(i[e])}function f(e,n,i,r,o,s,u){var h=d[e.id];h&&h.parentNode&&h.parentNode.removeChild(h);var f=function(e,n,i,r){for(var o=n.getScale(),s=document.createElement("div"),u=a(o,r),d=u.start;d<=u.end;d++){var h=o.trace_x[d],f=o.trace_x[d+1]||t.date.add(h,o.step,o.unit),_=o.trace_x[d].valueOf(),g=Math.min(e[_]/i,1)||0;if(g<0)return null;var p=Math.min(e[f.valueOf()]/i,1)||0,v=l(g,h,f,n);v&&s.appendChild(v);var m=c(g,p,n.posFromDate(f));m&&s.appendChild(m)}return s}(i,o,s,u);return f&&n&&(f.setAttribute("data-resource-id",e.id),f.setAttribute(o.$config.item_attribute,e.id),f.style.position="absolute",f.style.top=n.top+1+"px",f.style.height=o.getItemHeight(e.id)-1+"px",f.style.left=0),f}function _(t,e,n,i,r,a,o){var s=r.histogram_cell_class(a.start_date,a.end_date,t,a.tasks,a.assignments),l=r.histogram_cell_label(a.start_date,a.end_date,t,a.tasks,a.assignments),c=r.histogram_cell_allocated(a.start_date,a.end_date,t,a.tasks,a.assignments),u=o.getItemHeight(t.id)-1;if(s||l){var d=document.createElement("div");return d.className=["gantt_histogram_cell",s].join(" "),d.setAttribute(o.$config.item_attribute,t.id),d.style.cssText=["left:"+e.left+"px","width:"+e.width+"px","height:"+u+"px","line-height:"+u+"px","top:"+(e.top+1)+"px"].join(";"),l&&(l=""+l+"
"),c&&(l=""+l),l&&(d.innerHTML=l),d}return null}return{render:function(i,r,s,l){var c=r.$getTemplates(),h=r.getScale(),g=e(i,s.resource_property,h,r),p=[],v={},m=i.capacity||r.$config.capacity||24;n[i.id]={},u[i.id]=null,d[i.id]=null;for(var y=!!l,k=a(h,l),b=k.start;b<=k.end;b++){var x=g[b];if(x&&(!y||o(b,h,l,t))){var w=c.histogram_cell_capacity(x.start_date,x.end_date,i,x.tasks,x.assignments);v[x.start_date.valueOf()]=w||0;var S=r.getItemPosition(i,x.start_date,x.end_date),T=_(i,S,m,0,c,x,r);T&&(p.push(T),n[i.id][b]=T)}}var $=null;if(p.length){$=document.createElement("div");for(var C=0;C",f=""):(h=g.template?g.template(e):e[g.name],r.isDate(h)&&(h=s.date_grid(h,e,g.name)),null!==h&&void 0!==h||(h=""),f=h,h=""+h+"
");var p="gantt_cell"+(_?" gantt_last_cell":""),v=[];if(g.tree){p+=" gantt_cell_tree";for(var m=0;m"+v.join("")+"",c.push(d)}switch(p="",l.$config.name){case"task":p=t.getGlobalTaskIndex(e.id)%2==0?"":" odd";break;case"resource":p=l.visibleOrder.indexOf(e.id)%2==0?"":" odd"}if(p+=e.$transparent?" gantt_transparent":"",p+=e.$dataprocessor_class?" "+e.$dataprocessor_class:"",s.grid_row_class){var x=s.grid_row_class.call(t,e.start_date,e.end_date,e);x&&(p+=" "+x)}l.isSelected(e.id)&&(p+=" gantt_selected");var w=document.createElement("div");w.className="gantt_row"+p+" gantt_row_"+t.getTaskType(e.type);var S=n.getItemHeight(e.id);return w.style.height=S+"px",w.style.lineHeight=S+"px",i.smart_rendering&&(w.style.position="absolute",w.style.left="0px",w.style.top=n.getItemTop(e.id)+"px"),n.$config.item_attribute&&(w.setAttribute(n.$config.item_attribute,e.id),w.setAttribute(n.$config.bind+"_id",e.id)),t._waiAria.taskRowAttr(e,w),w.innerHTML=c.join(""),w},update:null,getRectangle:a,getVisibleRange:o,onrender:function(e,n,r){for(var a=r.getGridColumns(),o=0;ot.x?this.dirs.right:e.y>t.y?this.dirs.down:this.dirs.up}},n={path:[],clear:function(){this.path=[]},current:function(){return this.path[this.path.length-1]},point:function(e){return e?(this.path.push(t.copy(e)),e):this.current()},point_to:function(n,i,r){r=r?{x:r.x,y:r.y}:t.copy(this.point());var a=e.dirs;switch(n){case a.left:r.x-=i;break;case a.right:r.x+=i;break;case a.up:r.y-=i;break;case a.down:r.y+=i}return this.point(r)},get_points:function(n,i,r,a){var o=this.get_endpoint(n,i,r,a),s=t.config,l=o.e_y-o.y,c=o.e_x-o.x,u=e.dirs,d=i.getItemHeight(n.source);this.clear(),this.point({x:o.x,y:o.y});var h=2*s.link_arrow_size,f=this.get_line_type(n,i.$getConfig()),_=o.e_x>o.x;if(f.from_start&&f.to_start)this.point_to(u.left,h),_?(this.point_to(u.down,l),this.point_to(u.right,c)):(this.point_to(u.right,c),this.point_to(u.down,l)),this.point_to(u.right,h);else if(!f.from_start&&f.to_start)if(_=o.e_x>o.x+2*h,this.point_to(u.right,h),_)c-=h,this.point_to(u.down,l),this.point_to(u.right,c);else{c-=2*h;var g=l>0?1:-1;this.point_to(u.down,g*(d/2)),this.point_to(u.right,c),this.point_to(u.down,g*(Math.abs(l)-d/2)),this.point_to(u.right,h)}else f.from_start||f.to_start?f.from_start&&!f.to_start&&(_=o.e_x>o.x-2*h,this.point_to(u.left,h),_?(c+=2*h,g=l>0?1:-1,this.point_to(u.down,g*(d/2)),this.point_to(u.right,c),this.point_to(u.down,g*(Math.abs(l)-d/2)),this.point_to(u.left,h)):(c+=h,this.point_to(u.down,l),this.point_to(u.right,c))):(this.point_to(u.right,h),_?(this.point_to(u.right,c),this.point_to(u.down,l)):(this.point_to(u.down,l),this.point_to(u.right,c)),this.point_to(u.left,h));return this.path},get_line_type:function(e,n){var i=n.links,r=!1,a=!1;return e.type==i.start_to_start?r=a=!0:e.type==i.finish_to_finish?r=a=!1:e.type==i.finish_to_start?(r=!1,a=!0):e.type==i.start_to_finish?(r=!0,a=!1):t.assert(!1,"Invalid link type"),n.rtl&&(r=!r,a=!a),{from_start:r,to_start:a}},get_endpoint:function(t,e,n,i){var r=e.$getConfig(),o=this.get_line_type(t,r),s=o.from_start,l=o.to_start,c=a(n,e,r),u=a(i,e,r);return{x:s?c.left:c.left+c.width,e_x:l?u.left:u.left+u.width,y:c.top+c.rowHeight/2-1,e_y:u.top+u.rowHeight/2-1}}};function a(e,n,i){var r=n.getItemPosition(e);if(t.getTaskType(e.type)==i.types.milestone){var a=n.getBarHeight(e.id,!0),o=Math.sqrt(2*a*a);r.left-=o/2,r.width=o}return r}return{render:function(i,r,a){var o=t.getTask(i.source);if(!o.hide_bar){var s=t.getTask(i.target);if(!s.hide_bar){var l=n.get_endpoint(i,r,o,s),c=l.e_y-l.y;if(!(l.e_x-l.x||c))return null;var u=n.get_points(i,r,o,s),d=e.get_lines(u,r),h=document.createElement("div"),f="gantt_task_link";i.color&&(f+=" gantt_link_inline_color");var _=t.templates.link_class?t.templates.link_class(i):"";_&&(f+=" "+_),a.highlight_critical_path&&t.isCriticalLink&&t.isCriticalLink(i)&&(f+=" gantt_critical_link"),h.className=f,r.$config.link_attribute&&(h.setAttribute(r.$config.link_attribute,i.id),h.setAttribute("link_id",i.id));for(var g=0;gv.end)&&u(t.id,y)}n[t.id]={};for(var k=v.start;k<=v.end;k++){var b=f(l,k,t,s,_,g,p,a);!b&&c(t,k)?u(t.id,k):b&&!b.parentNode&&i.appendChild(b)}}},getRectangle:i,getVisibleRange:a,prepareData:l}}},function(t,e,n){var i=n(30),r=n(19),a=n(6);t.exports=function(t){var e=i(t);return{render:function(n,i){if(!1!==n.rollup&&n.$rollup&&n.$rollup.length){var r=document.createElement("div"),a=t.getTaskPosition(n);return n.$rollup.forEach(function(o){var s=t.copy(t.getTask(o));if(s.$rendered_at=n.id,!1!==t.callEvent("onBeforeRollupTaskDisplay",[s.id,s,n.id])){var l=e(s,i);if(l){var c=i.getBarHeight(n.id,s.type==t.config.types.milestone),u=Math.floor((i.getItemHeight(n.id)-c)/2);l.style.top=a.top+u+"px",l.classList.add("gantt_rollup_child"),l.setAttribute("data-rollup-parent-id",n.id),r.appendChild(l)}}}),r}return!1},update:null,isInViewPort:r,getVisibleRange:a}}},function(t,e,n){var i=n(19);t.exports=function(t,e,n,r,a){if(!a.isSplitTask(t))return!1;var o=a.getSubtaskDates(t.id);return i({id:t.id,start_date:o.start_date,end_date:o.end_date,parent:t.parent},e,n,a)}},function(t,e,n){var i=n(30),r=n(6),a=n(125),o=n(19);t.exports=function(t){var e=i(t),n={};function s(t,e,n,i,r){var a=!t.hide_bar;return i.smart_rendering&&a&&(a=o(t,e,n,i,r)),a}function l(n,i,r,a){if(!i.hide_bar){var o=t.isSummaryTask(i);o&&t.resetProjectDates(i);var s=t.copy(t.getTask(i.id));if(s.$rendered_at=n.id,!1!==t.callEvent("onBeforeSplitTaskDisplay",[s.id,s,n.id])){var l=e(s,r);if(l){var c=r.getBarHeight(n.id,i.type==t.config.types.milestone),u=Math.floor((r.getItemHeight(n.id)-c)/2);return l.style.top=a.top+u+"px",l.classList.add("gantt_split_child"),o&&l.classList.add("gantt_split_subproject"),l}}}}function c(t,e){return t+"_"+e}function u(e,n){return t.isSplitTask(e)&&(n.open_split_tasks&&!e.$open||!n.open_split_tasks)&&t.hasChild(e.id)}return{render:function(e,i,r,a){if(u(e,r)){var o=document.createElement("div"),d=t.getTaskPosition(e);return t.hasChild(e.id)&&t.eachTask(function(u){if(s(u,a,i,r,t)){var h=l(e,u,i,d);h?(n[c(u.id,e.id)]=h,o.appendChild(h)):n[c(u.id,e.id)]=!1}},e.id),o}return!1},update:function(e,i,r,a,o){if(u(e,a)){var d=document.createElement("div"),h=t.getTaskPosition(e);t.eachTask(function(u){var f=c(u.id,e.id),_=s(u,o,r,a,t);if(_!==!!n[f])if(_){var g=l(e,u,r,h);n[f]=g||!1}else n[f]=!1;n[f]&&d.appendChild(n[f]),i.innerHTML=d.innerHTML},e.id)}},isInViewPort:a,getVisibleRange:r}}},function(t,e,n){var i=n(19),r=n(6),a=n(30);t.exports=function(t){return{render:a(t),update:null,isInViewPort:i,getVisibleRange:r}}},function(t,e){t.exports=function(t){return function(n,i,r){"keepDates"==r?function(e,n){"duration"==n?e.end_date=t.calculateEndDate(e):"end_date"!=n&&"start_date"!=n||(e.duration=t.calculateDuration(e))}(n,i):"keepDuration"==r?function(n,i){"end_date"==i?n.start_date=e(n):"start_date"!=i&&"duration"!=i||(n.end_date=t.calculateEndDate(n))}(n,i):function(n,i){t.config.schedule_from_end?"end_date"==i||"duration"==i?n.start_date=e(n):"start_date"==i&&(n.duration=t.calculateDuration(n)):"start_date"==i||"duration"==i?n.end_date=t.calculateEndDate(n):"end_date"==i&&(n.duration=t.calculateDuration(n))}(n,i)};function e(e){return t.calculateEndDate({start_date:e.end_date,duration:-e.duration,task:e})}}},function(t,e,n){t.exports=function(t){var e=n(11)(t),i=n(0);function r(){return e.apply(this,arguments)||this}function a(e){return e.formatter||t.ext.formatters.durationFormatter()}return n(3)(r,e),i.mixin(r.prototype,{show:function(t,e,n,i){var r="";i.innerHTML=r},set_value:function(t,e,n,i){this.get_input(i).value=a(n.editor).format(t)},get_value:function(t,e,n){return a(e.editor).parse(this.get_input(n).value||"")}},!0),r}},function(t,e,n){t.exports=function(t){var e=n(11)(t),i=n(0);function r(){return e.apply(this,arguments)||this}function a(e){return e.formatter||t.ext.formatters.linkFormatter()}function o(t,e){for(var n=(t||"").split(e.delimiter||","),i=0;i";i.innerHTML=r},hide:function(){},set_value:function(e,n,i,r){this.get_input(r).value=s(e,i.editor,t)},get_value:function(t,e,n){return o(this.get_input(n).value||"",e.editor)},save:function(e,n,i){var r=c(t.getTask(e),this.get_value(e,n,i),n.editor);(r.add.length||r.remove.length)&&t.batchUpdate(function(){r.add.forEach(function(e){t.addLink(e)}),r.remove.forEach(function(e){t.deleteLink(e)}),t.autoSchedule&&t.autoSchedule()})},is_changed:function(e,n,i,r){var a=this.get_value(n,i,r),l=o(s(e,i.editor,t),i.editor);return a.join()!==l.join()}},!0),r}},function(t,e,n){t.exports=function(t){var e=n(11)(t),i=n(0),r="%Y-%m-%d",a=null,o=null;function s(){return e.apply(this,arguments)||this}return n(3)(s,e),i.mixin(s.prototype,{show:function(e,n,i,s){a||(a=t.date.date_to_str(r)),o||(o=t.date.str_to_date(r));var l=null,c=null;l="function"==typeof i.min?i.min(e,n):i.min,c="function"==typeof i.max?i.max(e,n):i.max;var u="";s.innerHTML=u},set_value:function(t,e,n,i){t&&t.getFullYear?this.get_input(i).value=a(t):this.get_input(i).value=t},is_valid:function(t,e,n,i){return!(!t||isNaN(t.getTime()))},get_value:function(t,e,n){var i;try{i=o(this.get_input(n).value||"")}catch(t){i=null}return i}},!0),s}},function(t,e,n){t.exports=function(t){var e=n(11)(t),i=n(0);function r(){return e.apply(this,arguments)||this}return n(3)(r,e),i.mixin(r.prototype,{show:function(t,e,n,i){for(var r="",i.innerHTML=r},get_input:function(t){return t.querySelector("select")}},!0),r}},function(t,e,n){t.exports=function(t){var e=n(11)(t),i=n(0);function r(){return e.apply(this,arguments)||this}return n(3)(r,e),i.mixin(r.prototype,{show:function(t,e,n,i){var r="";i.innerHTML=r},get_value:function(t,e,n){return this.get_input(n).value||""},is_valid:function(t,e,n,i){return!isNaN(parseInt(t,10))}},!0),r}},function(t,e,n){t.exports=function(t){var e=n(11)(t),i=n(0);function r(){return e.apply(this,arguments)||this}return n(3)(r,e),i.mixin(r.prototype,{show:function(t,e,n,i){var r="";i.innerHTML=r}},!0),r}},function(t,e){t.exports={init:function(t,e){var n=t,i=e.$gantt,r=null,a=i.ext.keyboardNavigation;a.attachEvent("onBeforeFocus",function(e){var i=t.locateCell(e);if(clearTimeout(r),i){var a=i.columnName,o=i.id,s=n.getState();if(n.isVisible()&&s.id==o&&s.columnName===a)return!1}return!0}),a.attachEvent("onFocus",function(e){var i=t.locateCell(e),a=t.getState();return clearTimeout(r),!i||i.id==a.id&&i.columnName==a.columnName||n.isVisible()&&n.save(),!0}),t.attachEvent("onHide",function(){clearTimeout(r)}),a.attachEvent("onBlur",function(){return r=setTimeout(function(){n.save()}),!0}),i.attachEvent("onTaskDblClick",function(e,n){var i=t.getState(),r=t.locateCell(n.target);return!r||!t.isVisible()||r.columnName!=i.columnName}),i.attachEvent("onTaskClick",function(e,n){if(i._is_icon_open_click(n))return!0;var r=t.getState(),a=t.locateCell(n.target);return!a||!t.getEditorConfig(a.columnName)||(t.isVisible()&&r.id==a.id&&r.columnName==a.columnName||t.startEdit(a.id,a.columnName),!1)}),i.attachEvent("onEmptyClick",function(){return n.save(),!0}),a.attachEvent("onKeyDown",function(e,r){var o=t.locateCell(r.target),s=!!o&&t.getEditorConfig(o.columnName),l=t.getState(),c=i.constants.KEY_CODES,u=r.keyCode,d=!1;switch(u){case c.ENTER:t.isVisible()?(t.save(),r.preventDefault(),d=!0):s&&!(r.ctrlKey||r.metaKey||r.shiftKey)&&(n.startEdit(o.id,o.columnName),r.preventDefault(),d=!0);break;case c.ESC:t.isVisible()&&(t.hide(),r.preventDefault(),d=!0);break;case c.UP:case c.DOWN:break;case c.LEFT:case c.RIGHT:(s&&t.isVisible()||"date"===l.editorType)&&(d=!0);break;case c.SPACE:t.isVisible()&&(d=!0),s&&!t.isVisible()&&(n.startEdit(o.id,o.columnName),r.preventDefault(),d=!0);break;case c.DELETE:s&&!t.isVisible()?(n.startEdit(o.id,o.columnName),d=!0):s&&t.isVisible()&&(d=!0);break;case c.TAB:if(t.isVisible()){r.shiftKey?t.editPrevCell(!0):t.editNextCell(!0);var h=t.getState();h.id&&a.focus({type:"taskCell",id:h.id,column:h.columnName}),r.preventDefault(),d=!0}break;default:if(t.isVisible())d=!0;else if(u>=48&&u<=57||u>95&&u<112||u>=64&&u<=91||u>185&&u<193||u>218&&u<223){var f=e.modifiers,_=f.alt||f.ctrl||f.meta||f.shift;f.alt||_&&a.getCommandHandler(e,"taskCell")||s&&!t.isVisible()&&(n.startEdit(o.id,o.columnName),d=!0)}}return!d})},onShow:function(t,e,n){},onHide:function(t,e,n){n.$gantt.focus()},destroy:function(){}}},function(t,e){t.exports={init:function(t,e){var n=e.$gantt;n.attachEvent("onTaskClick",function(e,i){if(n._is_icon_open_click(i))return!0;var r=t.getState(),a=t.locateCell(i.target);return!a||!t.getEditorConfig(a.columnName)||(t.isVisible()&&r.id==a.id&&r.columnName==a.columnName||t.startEdit(a.id,a.columnName),!1)}),n.attachEvent("onEmptyClick",function(){return t.isVisible()&&t.isChanged()?t.save():t.hide(),!0}),n.attachEvent("onTaskDblClick",function(e,n){var i=t.getState(),r=t.locateCell(n.target);return!r||!t.isVisible()||r.columnName!=i.columnName})},onShow:function(t,e,n){var i=n.$gantt;i.ext&&i.ext.keyboardNavigation&&i.ext.keyboardNavigation.attachEvent("onKeyDown",function(e,n){var r=i.constants.KEY_CODES,a=!1;switch(n.keyCode){case r.SPACE:t.isVisible()&&(a=!0)}return!a});e.onkeydown=function(e){e=e||window.event;var n=i.constants.KEY_CODES;if(!(e.defaultPrevented||e.shiftKey&&e.keyCode!=n.TAB)){var r=!0;switch(e.keyCode){case i.keys.edit_save:t.save();break;case i.keys.edit_cancel:t.hide();break;case n.UP:case n.DOWN:t.isVisible()&&(t.hide(),r=!1);break;case n.TAB:e.shiftKey?t.editPrevCell(!0):t.editNextCell(!0);break;default:r=!1}r&&e.preventDefault()}}},onHide:function(){},destroy:function(){}}},function(t,e,n){var i=n(136),r=n(135);t.exports=function(t){var e=null;return{setMapping:function(t){e=t},getMapping:function(){return e||(t.config.keyboard_navigation_cells&&t.ext.keyboardNavigation?r:i)}}}},function(t,e,n){var i=n(137),r=n(134),a=n(133),o=n(132),s=n(131),l=n(130),c=n(129),u=n(0),d=n(1),h=n(5),f=n(128);function _(t){t.config.editor_types={text:new(r(t)),number:new(a(t)),select:new(o(t)),date:new(s(t)),predecessor:new(l(t)),duration:new(c(t))}}t.exports=function(t){var e=i(t),n={};h(n);var r={init:_,createEditors:function(i){function r(t,e){var n=i.$getConfig(),r=function(t,e){for(var n=i.$getConfig(),r=i.getItemTop(t),a=i.getItemHeight(t),o=i.getGridColumns(),s=0,l=0,c=0,u=0;u0?t.getNext:t.getPrev,i=(n=t.bind(n,t))(this._itemId);t.isTaskExists(i)&&t.isReadonly(t.getTask(i));)i=n(i);return i},editNextRow:function(e){var n=this.getState().id;if(t.isTaskExists(n)){var i=null;i=e?this.moveRow(1):t.getNext(n),t.isTaskExists(i)&&this.startEdit(i,this._columnName)}},editPrevRow:function(e){var n=this.getState().id;if(t.isTaskExists(n)){var i=null;i=e?this.moveRow(-1):t.getPrev(n),t.isTaskExists(i)&&this.startEdit(i,this._columnName)}},destructor:function(){o.forEach(function(t){l.detachEvent(t)}),s.forEach(function(e){t.detachEvent(e)}),o=[],s=[],l=null,this.hide(),this.detachAllEvents()}};return u.mixin(c,e),u.mixin(c,n),c}};return u.mixin(r,e),u.mixin(r,n),r}},function(t,e,n){var i=n(0),r=n(40),a=n(31),o=n(3),s=function(t){function e(e,n,i,r){var a=t.apply(this,arguments)||this;return a.$config.bindLinks=null,a}return o(e,t),i.mixin(e.prototype,{_createLayerConfig:function(){var t=this,e=function(){return t.isVisible()};return{tasks:[{renderer:this.$gantt.$ui.layers.resourceHistogram(),container:this.$task_bars,filter:[e]},{renderer:this.$gantt.$ui.layers.taskBg(),container:this.$task_bg,filter:[e]}],links:[]}}},!0),i.mixin(e.prototype,a(t),!0),e}(r);t.exports=s},function(t,e,n){var i=n(1),r=n(0),a=n(31),o=n(34),s=n(3),l=function(t){function e(e,n,i,r){return t.apply(this,arguments)||this}return s(e,t),r.mixin(e.prototype,{init:function(){void 0===this.$config.bind&&(this.$config.bind=this.$getConfig().resource_store),t.prototype.init.apply(this,arguments)},_initEvents:function(){var e=this.$gantt;t.prototype._initEvents.apply(this,arguments),this._mouseDelegates.delegate("click","gantt_row",e.bind(function(t,e,n){var r=this.$config.rowStore;if(!r)return!0;var a=i.locateAttribute(t,this.$config.item_attribute);return a&&r.select(a.getAttribute(this.$config.item_attribute)),!1},this),this.$grid)}},!0),r.mixin(e.prototype,a(e),!0),e}(o);t.exports=l},function(t,e,n){var i=n(0),r=n(8),a=function(t,e){var n={},i="gantt-static-bg-styles-"+t.uid();function r(t){var e=/^rgba?\(([\d]{1,3}), *([\d]{1,3}), *([\d]{1,3}) *(,( *[\d.]+ *))?\)$/i.exec(t);return e?{r:1*e[1],g:1*e[2],b:1*e[3],a:255*e[5]||255}:null}function a(t){return n[t]||null}function o(t,e,n){return(t+""+e+n.bottomBorderColor+n.rightBorderColor).replace(/[^\w\d]/g,"")}function s(t,e){n[t]=e}function l(t,e,n){var i=Math.floor(500/t)||1,a=Math.floor(500/e)||1,o=document.createElement("canvas");o.height=e*a,o.width=t*i;var s=o.getContext("2d");return function(t,e,n,i,a,o){var s=a.createImageData(e*i,t*n);s.imageSmoothingEnabled=!1;for(var c=1*o.rightBorderWidth,u=r(o.rightBorderColor),d=0,h=0,f=0,_=1;_<=i;_++)for(d=_*e-1,f=0;fd){for(var g=r,p=0,v=Math.floor(d/n.row_height)*n.row_height,m=l;g>0;){var y=Math.min(g,v);g-=v,(a=document.createElement("div")).style.height=y+"px",a.style.position="absolute",a.style.top=p+"px",a.style.left=u+"px",a.style.pointerEvents="none",a.style.whiteSpace="no-wrap",a.className=t[o||_],f==c.length-1&&(m=_+m-1),a.style.width=m+"px",s.push(a),p+=y}l=0,u+=m}_&&(l+=_,o=_)}return s}(function(t,e,n,r){var u={},d=function(t){for(var e=t.width,n={},i=0;i"},n.prototype._getRootParent=function(){for(var t=this.$parent;t&&t.$parent;)t=t.$parent;if(t)return t},n.prototype._eachView=function(){var t=[];return function t(e,n){if(n.push(e),e.$cells)for(var i=0;id[s]&&d[o]>e&&u>d[s]-l+2&&(e=u+(i?0:2),n=d[s]);else{var h=Math.max(d[o]-u,0);(u+=h)>Math.max(d[s]-h,0)&&u>e&&(e=u,n=d[s])}}return{outerScroll:n,innerScroll:e}},n.prototype.scroll=function(t){this._isHorizontal()?this.scrollHorizontally(t):this.scrollVertically(t)},n.prototype.getScrollState=function(){return{visible:this.isVisible(),direction:this.$config.scroll,size:this.$config.outerSize,scrollSize:this.$config.scrollSize||0,position:this.$config.scrollPosition||0}},n.prototype.setSize=function(e,n){t.prototype.setSize.apply(this,arguments);var i=this._getScrollSize(),r=(this._isVertical()?n:e)-this._getScrollOffset()+(this._isHorizontal()?1:0);i.innerScroll&&r>i.outerScroll&&(i.innerScroll+=r-i.outerScroll),this.$config.scrollSize=i.innerScroll,this.$config.width=e,this.$config.height=n,this._setScrollSize(i.innerScroll)},n.prototype.isVisible=function(){return!(!this.$parent||!this.$parent.$view.parentNode)},n.prototype.shouldShow=function(){var t=this._getScrollSize();return!(!t.innerScroll&&this.$parent&&this.$parent.$view.parentNode)&&!(!t.innerScroll||this.$parent&&this.$parent.$view.parentNode)},n.prototype.shouldHide=function(){return!(this._getScrollSize().innerScroll||!this.$parent||!this.$parent.$view.parentNode)},n.prototype.toggleVisibility=function(){this.shouldHide()?this.hide():this.shouldShow()&&this.show()},n.prototype._getScaleOffset=function(t){var e=0;return!t||"timeline"!=t.$config.view&&"grid"!=t.$config.view||(e=t.$content.$getConfig().scale_height),e},n.prototype._getScrollOffset=function(){var t=0;if(this._isVertical()){var e=this.$parent.$parent;t=Math.max(this._getScaleOffset(e.getPrevSibling(this.$parent.$id)),this._getScaleOffset(e.getNextSibling(this.$parent.$id)))}else for(var n=this._getLinkedViews(),i=0;i=0&&(!t[f]||t.deltaX||t.wheelDeltaX||(d=2*h,h=0)),d&&Math.abs(d)>Math.abs(h)){if(this._isVertical())return;if(i.x)return!0;if(!this.$scroll_hor||!this.$scroll_hor.offsetWidth)return!0;var _=d/-40,g=this._oldLeft,p=g+30*_;if(this.scrollHorizontally(p),this.$scroll_hor.scrollLeft=p,g==this.$scroll_hor.scrollLeft)return!0;this._oldLeft=this.$scroll_hor.scrollLeft}else{if(this._isHorizontal())return;if(i.y)return!0;if(!this.$scroll_ver||!this.$scroll_ver.offsetHeight)return!0;_=h/-40;void 0===h&&(_=t.detail);var v=this._oldTop,m=this.$scroll_ver.scrollTop+30*_;if(this.scrollVertically(m),this.$scroll_ver.scrollTop=m,v==this.$scroll_ver.scrollTop)return!0;this._oldTop=this.$scroll_ver.scrollTop}return t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1}},n}(n(12));t.exports=s},function(t,e,n){var i=n(3),r=n(1),a=n(0),o=n(12),s=function(t){"use strict";function e(e,n,i){var r,a,o=t.apply(this,arguments)||this;function s(t){var e=t.pageX,n=t.pageY;return t.touches&&(e=t.touches[0].pageX,n=t.touches[0].pageY),{x:e,y:n}}return o._moveHandler=function(t){o._moveResizer(o._resizer,s(t).x,s(t).y)},o._upHandler=function(t){var e=o._getNewSizes();!1!==o.callEvent("onResizeEnd",[r,a,e?e.back:0,e?e.front:0])&&o._setSizes(),o._setBackground(!1),o._clearResizer(),o._clearListeneres(),t.touches&&(o.$gantt._prevent_touch_scroll=!1)},o._clearListeneres=function(){this.$domEvents.detach(document,"mouseup",o._upHandler),this.$domEvents.detach(document,"mousemove",o._moveHandler),this.$domEvents.detach(document,"mousemove",o._startOnMove),this.$domEvents.detach(document,"mouseup",o._cancelDND),this.$domEvents.detach(document,"touchend",o._upHandler),this.$domEvents.detach(document,"touchmove",o._startOnMove),this.$domEvents.detach(document,"touchstart",o._downHandler)},o._callStartDNDEvent=function(){if(this._xMode?(r=this._behind.$config.width||this._behind.$view.offsetWidth,a=this._front.$config.width||this._front.$view.offsetWidth):(r=this._behind.$config.height||this._behind.$view.offsetHeight,a=this._front.$config.height||this._front.$view.offsetHeight),!1===o.callEvent("onResizeStart",[r,a]))return!1},o._startDND=function(t){if(!1!==this._callStartDNDEvent()){var e=!1;this._eachGroupItem(function(t){t._getSiblings(),!1===t._callStartDNDEvent()&&(e=!0)}),e||(o._moveHandler(t),o.$domEvents.attach(document,"mousemove",o._moveHandler),o.$domEvents.attach(document,"mouseup",o._upHandler))}},o._cancelDND=function(){o._setBackground(!1),o._clearResizer(),o._clearListeneres()},o._startOnMove=function(t){t.touches&&(o.$gantt._prevent_touch_scroll=!0),o._isPosChanged(t)&&(o._clearListeneres(),o._startDND(t))},o._downHandler=function(t){o._getSiblings(),o._behind.$config.collapsed||o._front.$config.collapsed||(o._setBackground(!0),o._resizer=o._setResizer(),o._positions={x:s(t).x,y:s(t).y,timestamp:Date.now()},o.$domEvents.attach(document,"mousemove",o._startOnMove),o.$domEvents.attach(document,"mouseup",o._cancelDND))},o.$name="resizer",o}return i(e,t),e.prototype.init=function(){t.prototype.init.call(this),this._xMode="x"===this.$config.mode,this._xMode&&!this.$config.width?this.$config.width=this.$config.minWidth=1:this._xMode||this.$config.height||(this.$config.height=this.$config.minHeight=1),this.$config.margin=-1,this.$domEvents.attach(this.$view,"mousedown",this._downHandler),this.$domEvents.attach(this.$view,"touchstart",this._downHandler),this.$domEvents.attach(this.$view,"touchmove",this._startOnMove),this.$domEvents.attach(this.$view,"touchend",this._upHandler)},e.prototype.$toHTML=function(){var t=this.$config.mode,e=this.$config.css||"";return""},e.prototype._clearResizer=function(){this._resizer&&(this._resizer.parentNode&&this._resizer.parentNode.removeChild(this._resizer),this._resizer=null)},e.prototype._isPosChanged=function(t){return!!this._positions&&(Math.abs(this._positions.x-t.pageX)>3||Math.abs(this._positions.y-t.pageY)>3||Date.now()-this._positions.timestamp>300)},e.prototype._getSiblings=function(){var t=this.$parent.getCells();this.$config.prev&&(this._behind=this.$factory.getView(this.$config.prev),this._behind instanceof o||(this._behind=this._behind.$parent)),this.$config.next&&(this._front=this.$factory.getView(this.$config.next),this._front instanceof o||(this._front=this._behind.$parent));for(var e=0;ethis._front.$config.maxWidth)return;Math.abs(n)>=i&&(n=-Math.abs(i-2)),i-Math.abs(n)<=r&&(n=-Math.abs(i-r))}else l=a-Math.abs(n),s=i+n,i+n>this._behind.$config.maxWidth&&(n=this._behind.$config.maxWidth-i),Math.abs(n)>=a&&(n=a-2),a-Math.abs(n)<=o&&(n=Math.abs(a-o));return-1===c?(l=a-n,s=i-Math.abs(n)):(l=a-Math.abs(n),s=i+n),{size:n,newFrontSide:l,newBehindSide:s}},e.prototype._getGroupName=function(){return this._getSiblings(),this._front.$config.group||this._behind.$config.group},e.prototype._eachGroupItem=function(t,e){for(var n=this.$factory.getView("main"),i=this._getGroupName(),r=n.getCellsByType("resizer"),a=0;ai.newBehindSide&&(i=r[o])}return i},e.prototype._moveResizer=function(t,e,n){if(0!==e){var i=this._getGroupResizePosition(e,n);i&&1!==Math.abs(i.size)&&(this._xMode?(t.style.left=i.size+"px",this._positions.nextX=i.size||0):(t.style.top=i.size+"px",this._positions.nextY=i.size||0),this.callEvent("onResize",[i.newBehindSide,i.newFrontSide]))}},e.prototype._setGravity=function(t){var e=this._xMode?"offsetWidth":"offsetHeight",n=this._xMode?this._positions.nextX:this._positions.nextY,i=this._front.$view[e],r=this._behind.$view[e],a=(i-n)/i*this._front.getSize().gravity,o=(r+n)/r*this._behind.getSize().gravity;"front"!==t&&(this._front.$config.gravity=a),"behind"!==t&&(this._behind.$config.gravity=o)},e.prototype._getNewSizes=function(){var t,e,n;return this._xMode?(t=this._behind.$config.width,e=this._front.$config.width,n=this._positions.nextX):(t=this._behind.$config.height,e=this._front.$config.height,n=this._positions.nextY),e||t?{front:e?e-n||1:0,back:t?t+n||1:0}:null},e.prototype._assignNewSizes=function(t){this._getSiblings();var e=this._xMode?"width":"height";t?(t.front?this._front.$config[e]=t.front:this._setGravity("behind"),t.back?this._behind.$config[e]=t.back:this._setGravity("front")):this._setGravity()},e.prototype._setSizes=function(){this._resizer&&this.$view.removeChild(this._resizer);var t=this._getNewSizes();if(this._positions.nextX||this._positions.nextY){this._assignNewSizes(t);var e,n=this._xMode?"width":"height";t&&t.front||this._front.$config.group&&(e={value:this._front.$config.gravity,isGravity:!0},this.$gantt.$layout._syncCellSizes(this._front.$config.group,e)),t&&t.back||this._behind.$config.group&&(e={value:this._behind.$config.gravity,isGravity:!0},this.$gantt.$layout._syncCellSizes(this._behind.$config.group,e)),t&&(t.front?this._front.$config.group&&(e={value:this._front.$config[n],isGravity:!1},this.$gantt.$layout._syncCellSizes(this._front.$config.group,e)):t.back&&this._behind.$config.group&&(e={value:this._behind.$config[n],isGravity:!1},this.$gantt.$layout._syncCellSizes(this._behind.$config.group,e))),this._getGroupName()?this.$factory.getView("main").resize():this.$parent.resize()}},e}(o);t.exports=s},function(t,e,n){var i=n(3),r=n(0),a=function(t){"use strict";function e(e,n,i){var a=t.apply(this,arguments)||this;if(n.view){n.id&&(this.$id=r.uid());var o=r.copy(n);if(delete o.config,delete o.templates,this.$content=this.$factory.createView(n.view,this,o,this),!this.$content)return!1}return a.$name="viewCell",a}return i(e,t),e.prototype.destructor=function(){this.clear(),t.prototype.destructor.call(this)},e.prototype.clear=function(){if(this.$initialized=!1,this.$content){var e=this.$content.unload||this.$content.destructor;e&&e.call(this.$content)}t.prototype.clear.call(this)},e.prototype.scrollTo=function(e,n){this.$content&&this.$content.scrollTo?this.$content.scrollTo(e,n):t.prototype.scrollTo.call(this,e,n)},e.prototype._setContentSize=function(t,e){var n=this._getBorderSizes();if("number"==typeof t){var i=t+n.horizontal;this.$config.width=i}if("number"==typeof e){var r=e+n.vertical;this.$config.height=r}},e.prototype.setSize=function(e,n){if(t.prototype.setSize.call(this,e,n),!this.$preResize&&this.$content&&!this.$initialized){this.$initialized=!0;var i=this.$view.childNodes[0],r=this.$view.childNodes[1];r||(r=i),this.$content.init(r)}},e.prototype.setContentSize=function(){!this.$preResize&&this.$content&&this.$initialized&&this.$content.setSize(this.$lastSize.contentX,this.$lastSize.contentY)},e.prototype.getContentSize=function(){var e=t.prototype.getContentSize.call(this);if(this.$content&&this.$initialized){var n=this.$content.getSize();e.width=void 0===n.contentX?n.width:n.contentX,e.height=void 0===n.contentY?n.height:n.contentY}var i=this._getBorderSizes();return e.width+=i.horizontal,e.height+=i.vertical,e},e}(n(12));t.exports=a},function(t,e,n){var i=n(3),r=n(42),a=n(12),o=function(t){"use strict";function e(e,n,i){for(var r=t.apply(this,arguments)||this,a=0;at.x_end||e.left+e.widtht.y_end||e.top+e.height-1&&r.click?r.click():(o(n,!0),i=!0)}27==e&&(o(n,!1),i=!0)}return i?(t.preventDefault&&t.preventDefault(),!(t.cancelBubble=!0)):void 0}}var l=a.getRootNode(t.$root)||document;function c(t){c.cover||(c.cover=document.createElement("div"),c.cover.onkeydown=s,c.cover.className="dhx_modal_cover",document.body.appendChild(c.cover)),c.cover.style.display=t?"inline-block":"none"}function u(e,n,i){return""}function d(e){k.area||(k.area=document.createElement("div"),k.area.className="gantt_message_area",k.area.style[k.position]="5px",document.body.appendChild(k.area)),k.hide(e.id);var n=document.createElement("div");return n.innerHTML=""+e.text+"
",n.className="gantt-info gantt-"+e.type,n.onclick=function(){k.hide(e.id),e=null},t._waiAria.messageInfoAttr(n),"bottom"==k.position&&k.area.firstChild?k.area.insertBefore(n,k.area.firstChild):k.area.appendChild(n),e.expire>0&&(k.timers[e.id]=window.setTimeout(function(){k&&k.hide(e.id)},e.expire)),k.pull[e.id]=n,n=null,e.id}function h(){for(var t=[].slice.apply(arguments,[0]),e=0;e