/* dhtmlxGantt v.7.1.8 Professional */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("dhtmlxgantt",[],e):"object"==typeof exports?exports.dhtmlxgantt=e():t.dhtmlxgantt=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/codebase/",n(n.s=281)}([function(t,e,n){function i(t){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r,a=n(2),o={}.constructor.toString();t.exports={copy:function t(e){var n,r;if(e&&"object"==i(e))switch(!0){case a.isDate(e):r=new Date(e);break;case a.isArray(e):for(r=new Array(e.length),n=0;n=0}function a(t){return!{a:!0,area:!0}[t.nodeName.loLowerCase()]||!!t.getAttribute("href")}function o(t){return!{input:!0,select:!0,textarea:!0,button:!0,object:!0}[t.nodeName.toLowerCase()]||!t.hasAttribute("disabled")}function s(t){if(!t)return"";var e=t.className||"";return e.baseVal&&(e=e.baseVal),e.indexOf||(e=""),u(e)}var l;function c(t){var e;return t.tagName?e=t:(e=(t=t||window.event).target||t.srcElement).shadowRoot&&t.composedPath&&(e=t.composedPath()[0]),e}function u(t){return(String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")}).apply(t)}function d(){return document.head.createShadowRoot||document.head.attachShadow}function h(t){if(!t)return document.body;if(!d())return document.body;for(;t.parentNode&&(t=t.parentNode);)if(t instanceof ShadowRoot)return t.host;return document.body}t.exports={getNodePosition:n,getFocusableNodes:function(t){for(var e=t.querySelectorAll(["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"].join(", ")),n=Array.prototype.slice.call(e,0),s=0;s=0){if(!n)return i;var o=0===a||!u(r.charAt(a-1)),l=a+e.length>=r.length||!u(r.charAt(a+e.length));if(o&&l)return i}}i=i.parentNode}return null},locateAttribute:function(t,e){if(e){for(var n=c(t);n;){if(n.getAttribute&&n.getAttribute(e))return n;n=n.parentNode}return null}},getTargetNode:c,getRelativeEventPosition:function(t,e){var i=document.documentElement,r=n(e);return{x:t.clientX+i.scrollLeft-i.clientLeft-r.x+e.scrollLeft,y:t.clientY+i.scrollTop-i.clientTop-r.y+e.scrollTop}},isChildOf:function(t,e){if(!t||!e)return!1;for(;t&&t!=e;)t=t.parentNode;return t===e},hasClass:function(t,e){return"classList"in t?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)},closest:function(t,e){if(t.closest)return t.closest(e);if(t.matches||t.msMatchesSelector||t.webkitMatchesSelector){var n=t;if(!document.documentElement.contains(n))return null;do{if((n.matches||n.msMatchesSelector||n.webkitMatchesSelector).call(n,e))return n;n=n.parentElement||n.parentNode}while(null!==n&&1===n.nodeType);return null}return console.error("Your browser is not supported"),null},getRootNode:h,hasShadowParent:function(t){return!!h(t)},isShadowDomSupported:d,getActiveElement:function(){var t=document.activeElement;return t.shadowRoot&&(t=t.shadowRoot.activeElement),t===document.body&&document.getSelection&&(t=document.getSelection().focusNode||document.body),t}}},function(t,e){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i={second:1,minute:60,hour:3600,day:86400,week:604800,month:2592e3,quarter:7776e3,year:31536e3};function r(t){return!(!t||"object"!==n(t))&&!!(t.getFullYear&&t.getMonth&&t.getDate)}function a(t,e){var n=[];if(t.filter)return t.filter(e);for(var i=0;ie)){for(;+t[n]==+t[n+1];)n++;return n}if(!isNaN(r)&&r=0||navigator.userAgent.indexOf("Trident")>=0),isIE6:n&&!XMLHttpRequest&&navigator.userAgent.indexOf("MSIE")>=0,isIE7:n&&navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")<0,isIE8:n&&navigator.userAgent.indexOf("MSIE 8.0")>=0&&navigator.userAgent.indexOf("Trident")>=0,isOpera:n&&navigator.userAgent.indexOf("Opera")>=0,isChrome:n&&navigator.userAgent.indexOf("Chrome")>=0,isKHTML:n&&(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0),isFF:n&&navigator.userAgent.indexOf("Firefox")>=0,isIPad:n&&navigator.userAgent.search(/iPad/gi)>=0,isEdge:n&&-1!=navigator.userAgent.indexOf("Edge"),isNode:!n||"undefined"==typeof navigator};t.exports=i},function(t,e){t.exports=function(t){var e=function(){};return e.prototype={show:function(t,e,n,i){},hide:function(){},set_value:function(t,e,n,i){this.get_input(i).value=t},get_value:function(t,e,n){return this.get_input(n).value||""},is_changed:function(t,e,n,i){var r=this.get_value(e,n,i);return r&&t&&r.valueOf&&t.valueOf?r.valueOf()!=t.valueOf():r!=t},is_valid:function(t,e,n,i){return!0},save:function(t,e,n){},get_input:function(t){return t.querySelector("input")},focus:function(t){var e=this.get_input(t);e&&(e.focus&&e.focus(),e.select&&e.select())}},e}},function(t,e,n){var i=n(0),r=n(4),a=n(1),o=function(){"use strict";function t(t,e,n,o){t&&(this.$container=a.toNode(t),this.$parent=t),this.$config=i.mixin(e,{headerHeight:33}),this.$gantt=o,this.$domEvents=o._createDomEventScope(),this.$id=e.id||"c"+i.uid(),this.$name="cell",this.$factory=n,r(this)}return t.prototype.destructor=function(){this.$parent=this.$container=this.$view=null,this.$gantt.$services.getService("mouseEvents").detach("click","gantt_header_arrow",this._headerClickHandler),this.$domEvents.detachAll(),this.callEvent("onDestroy",[]),this.detachAllEvents()},t.prototype.cell=function(t){return null},t.prototype.scrollTo=function(t,e){var n=this.$view;this.$config.html&&(n=this.$view.firstChild),1*t==t&&(n.scrollLeft=t),1*e==e&&(n.scrollTop=e)},t.prototype.clear=function(){this.getNode().innerHTML="",this.getNode().className="gantt_layout_content",this.getNode().style.padding="0"},t.prototype.resize=function(t){if(this.$parent)return this.$parent.resize(t);!1===t&&(this.$preResize=!0);var e=this.$container,n=e.offsetWidth,i=e.offsetHeight,r=this.getSize();e===document.body&&(n=document.body.offsetWidth,i=document.body.offsetHeight),nr.maxWidth&&(n=r.maxWidth),ir.maxHeight&&(i=r.maxHeight),this.setSize(n,i),this.$preResize,this.$preResize=!1},t.prototype.hide=function(){this._hide(!0),this.resize()},t.prototype.show=function(t){this._hide(!1),t&&this.$parent&&this.$parent.show(),this.resize()},t.prototype._hide=function(t){if(!0===t&&this.$view.parentNode)this.$view.parentNode.removeChild(this.$view);else if(!1===t&&!this.$view.parentNode){var e=this.$parent.cellIndex(this.$id);this.$parent.moveView(this,e)}this.$config.hidden=t},t.prototype.$toHTML=function(t,e){void 0===t&&(t=""),e=[e||"",this.$config.css||""].join(" ");var n=this.$config,i="";n.raw?t="string"==typeof n.raw?n.raw:"":(t||(t="
"+(n.html||"")+"
"),n.header&&(i="
"+(n.canCollapse?"
":"")+"
"+n.header+"
"));return"
"+i+t+"
"},t.prototype.$fill=function(t,e){this.$view=t,this.$parent=e,this.init()},t.prototype.getNode=function(){return this.$view.querySelector("gantt_layout_cell")||this.$view},t.prototype.init=function(){var t=this;this._headerClickHandler=function(e){a.locateAttribute(e,"data-cell-id")==t.$id&&t.toggle()},this.$gantt.$services.getService("mouseEvents").delegate("click","gantt_header_arrow",this._headerClickHandler),this.callEvent("onReady",[])},t.prototype.toggle=function(){this.$config.collapsed=!this.$config.collapsed,this.resize()},t.prototype.getSize=function(){var t={height:this.$config.height||0,width:this.$config.width||0,gravity:this.$config.gravity||1,minHeight:this.$config.minHeight||0,minWidth:this.$config.minWidth||0,maxHeight:this.$config.maxHeight||1e11,maxWidth:this.$config.maxWidth||1e11};if(this.$config.collapsed){var e="x"===this.$config.mode;t[e?"width":"height"]=t[e?"maxWidth":"maxHeight"]=this.$config.headerHeight}return t},t.prototype.getContentSize=function(){var t=this.$lastSize.contentX;t!==1*t&&(t=this.$lastSize.width);var e=this.$lastSize.contentY;return e!==1*e&&(e=this.$lastSize.height),{width:t,height:e}},t.prototype._getBorderSizes=function(){var t={top:0,right:0,bottom:0,left:0,horizontal:0,vertical:0};return this._currentBorders&&(this._currentBorders[this._borders.left]&&(t.left=1,t.horizontal++),this._currentBorders[this._borders.right]&&(t.right=1,t.horizontal++),this._currentBorders[this._borders.top]&&(t.top=1,t.vertical++),this._currentBorders[this._borders.bottom]&&(t.bottom=1,t.vertical++)),t},t.prototype.setSize=function(t,e){this.$view.style.width=t+"px",this.$view.style.height=e+"px";var n=this._getBorderSizes(),i=e-n.vertical,r=t-n.horizontal;this.$lastSize={x:t,y:e,contentX:r,contentY:i},this.$config.header?this._sizeHeader():this._sizeContent()},t.prototype._borders={left:"gantt_layout_cell_border_left",right:"gantt_layout_cell_border_right",top:"gantt_layout_cell_border_top",bottom:"gantt_layout_cell_border_bottom"},t.prototype._setBorders=function(t,e){e||(e=this);var n=e.$view;for(var i in this._borders)a.removeClassName(n,this._borders[i]);"string"==typeof t&&(t=[t]);var r={};for(i=0;i"}};function a(t,e,n){return e=e||[],"<"+t+o(n||[])+">"+(e.innerHTML||"")+""}function o(t){var e="";return i.forEach(t,function(t){e+=" "+t.key+"='"+t.value+"'"}),e}t.exports=r},function(t,e,n){var i=n(3),r=n(16);t.exports=function(t){var e=n(5)(t);function a(){return e.apply(this,arguments)||this}return i(a,e),a.prototype.render=function(t){var e="
";return e+=r.getHtmlSelect(t.options,[{key:"style",value:"width:100%;"}]),e+="
"},a.prototype.set_value=function(t,e,n,i){var r=t.firstChild;!r._dhx_onchange&&i.onchange&&(r.onchange=i.onchange,r._dhx_onchange=!0),void 0===e&&(e=(r.options[0]||{}).value),r.value=e||""},a.prototype.get_value=function(t){return t.firstChild.value},a.prototype.focus=function(e){var n=e.firstChild;t._focus(n,!0)},a}},function(t,e,n){var i=n(0);t.exports={createDropTargetObject:function(t){var e={targetParent:null,targetIndex:0,targetId:null,child:!1,nextSibling:!1,prevSibling:!1};return t&&i.mixin(e,t,!0),e},nextSiblingTarget:function(t,e,n){var i=this.createDropTargetObject();return i.targetId=e,i.nextSibling=!0,i.targetParent=n.getParent(i.targetId),i.targetIndex=n.getBranchIndex(i.targetId),(n.getParent(t)!=i.targetParent||i.targetIndexn.getBranchIndex(t)&&(i.targetIndex-=1),i},firstChildTarget:function(t,e,n){var i=this.createDropTargetObject();return i.targetId=e,i.targetParent=i.targetId,i.targetIndex=0,i.child=!0,i},lastChildTarget:function(t,e,n){var i=n.getChildren(e),r=this.createDropTargetObject();return r.targetId=i[i.length-1],r.targetParent=e,r.targetIndex=i.length,r.nextSibling=!0,r}}},function(t,e,n){var i=n(13);t.exports=function(t,e,n,r){var a=e.width[t];if(a<=0)return!1;if(!r.config.smart_rendering||i(r))return!0;var o=e.left[t]-a,s=e.left[t]+a;return o<=n.x_end&&s>=n.x}},function(t,e){t.exports=function(t,e){var n=0,i=t.left.length-1;if(e)for(var r=0;re.x_end){i=r;break}}return{start:n,end:i}}},function(t,e){t.exports=function(t,e,n){return{top:e.getItemTop(t.id),height:e.getItemHeight(t.id),left:0,right:1/0}}},function(t,e){t.exports=function(t){function e(e,a,o){if(!t._isAllowedUnscheduledTask(e)&&t._isTaskInTimelineLimits(e)){var s=a.getItemPosition(e),l=o,c=a.$getTemplates(),u=t.getTaskType(e.type),d=a.getBarHeight(e.id,u==l.types.milestone),h=0;u==l.types.milestone&&(h=(d-s.height)/2);var f=Math.floor((a.getItemHeight(e.id)-d)/2);u==l.types.milestone&&(s.left-=Math.round(d/2),s.width=d);var _=document.createElement("div"),g=Math.round(s.width);a.$config.item_attribute&&(_.setAttribute(a.$config.item_attribute,e.id),_.setAttribute(a.$config.bind+"_id",e.id)),l.show_progress&&u!=l.types.milestone&&function(e,n,i,r,a){var o=1*e.progress||0;i=Math.max(i-2,0);var s=document.createElement("div"),l=Math.round(i*o);l=Math.min(i,l),e.progressColor&&(s.style.backgroundColor=e.progressColor,s.style.opacity=1),s.style.width=l+"px",s.className="gantt_task_progress",s.innerHTML=a.progress_text(e.start_date,e.end_date,e),r.rtl&&(s.style.position="absolute",s.style.right="0px");var c=document.createElement("div");if(c.className="gantt_task_progress_wrapper",c.appendChild(s),n.appendChild(c),t.config.drag_progress&&!t.isReadonly(e)){var u=document.createElement("div"),d=l;r.rtl&&(d=i-l),u.style.left=d+"px",u.className="gantt_task_progress_drag",s.appendChild(u),n.appendChild(u)}}(e,_,g,l,c);var p=function(e,n,i){var r=document.createElement("div");return t.getTaskType(e.type)!=t.config.types.milestone?r.innerHTML=i.task_text(e.start_date,e.end_date,e):t.getTaskType(e.type)==t.config.types.milestone&&n&&(r.style.height=r.style.width=n+"px"),r.className="gantt_task_content",r}(e,g,c);e.textColor&&(p.style.color=e.textColor),_.appendChild(p);var v=function(e,n,i,r){var a=r.$getConfig(),o=[e];n&&o.push(n);var s=t.getState(),l=t.getTask(i);if(t.getTaskType(l.type)==a.types.milestone?o.push("gantt_milestone"):t.getTaskType(l.type)==a.types.project&&o.push("gantt_project"),o.push("gantt_bar_"+t.getTaskType(l.type)),t.isSummaryTask(l)&&o.push("gantt_dependent_task"),t.isSplitTask(l)&&(a.open_split_tasks&&!l.$open||!a.open_split_tasks)&&o.push("gantt_split_parent"),a.select_task&&t.isSelectedTask(i)&&o.push("gantt_selected"),i==s.drag_id&&(o.push("gantt_drag_"+s.drag_mode),s.touch_drag&&o.push("gantt_touch_"+s.drag_mode)),s.link_source_id==i&&o.push("gantt_link_source"),s.link_target_id==i&&o.push("gantt_link_target"),a.highlight_critical_path&&t.isCriticalTask&&t.isCriticalTask(l)&&o.push("gantt_critical_task"),s.link_landing_area&&s.link_target_id&&s.link_source_id&&s.link_target_id!=s.link_source_id&&(s.link_target_id==i||s.link_source_id==i)){var c=s.link_source_id,u=s.link_from_start,d=s.link_to_start,h=t.isLinkAllowed(c,i,u,d),f="";f=h?d?"link_start_allow":"link_finish_allow":d?"link_start_deny":"link_finish_deny",o.push(f)}return o.join(" ")}("gantt_task_line",c.task_class(e.start_date,e.end_date,e),e.id,a);(e.color||e.progressColor||e.textColor)&&(v+=" gantt_task_inline_color"),s.width<20&&(v+=" gantt_thin_task"),_.className=v;var m=["left:"+s.left+"px","top:"+(f+s.top)+"px","height:"+(u==l.types.milestone?s.height:d)+"px","line-height:"+Math.max(d<30?d-2:d,0)+"px","width:"+g+"px"];e.color&&m.push("background-color:"+e.color),e.textColor&&m.push("color:"+e.textColor),_.style.cssText=m.join(";");var y=function(t,e,r,a){var o="gantt_left "+i(!e.rtl,t),s=null;return a&&(s={type:"marginRight",value:a}),n(t,r.leftside_text,o,s)}(e,l,c,h);y&&_.appendChild(y),(y=function(t,e,r,a){var o="gantt_right "+i(!!e.rtl,t),s=null;return a&&(s={type:"marginLeft",value:a}),n(t,r.rightside_text,o,s)}(e,l,c,h))&&_.appendChild(y),t._waiAria.setTaskBarAttr(e,_);var k=t.getState();return t.isReadonly(e)||(l.drag_resize&&!t.isSummaryTask(e)&&u!=l.types.milestone&&r(_,"gantt_task_drag",e,function(t){var e=document.createElement("div");return e.className=t,e},l),l.drag_links&&l.show_links&&r(_,"gantt_link_control",e,function(t){var e=document.createElement("div");e.className=t,e.style.cssText=["height:"+d+"px","line-height:"+d+"px"].join(";");var n=document.createElement("div");n.className="gantt_link_point";var i=!1;return k.link_source_id&&l.touch&&(i=!0),n.style.display=i?"block":"",e.appendChild(n),e},l,h)),_}}function n(t,e,n,i){if(!e)return null;var r=e(t.start_date,t.end_date,t);if(!r)return null;var a=document.createElement("div");return a.className="gantt_side_content "+n,a.innerHTML=r,i&&(a.style[i.type]=Math.abs(i.value)+"px"),a}function i(e,n){var i=function(e){return e?{$source:[t.config.links.start_to_start],$target:[t.config.links.start_to_start,t.config.links.finish_to_start]}:{$source:[t.config.links.finish_to_start,t.config.links.finish_to_finish],$target:[t.config.links.finish_to_finish]}}(e);for(var r in i)for(var a=n[r],o=0;o=+l.min_date&&((s=r([n,a.rtl?"task_right":"task_left","task_start_date"].join(" "))).setAttribute("data-bind-property","start_date"),o&&(s.style.marginLeft=o+"px"),e.appendChild(s)),+i.end_date<=+l.max_date&&((s=r([n,a.rtl?"task_left":"task_right","task_end_date"].join(" "))).setAttribute("data-bind-property","end_date"),o&&(s.style.marginRight=o+"px"),e.appendChild(s))}return function(n,i,r){var a=(r=i.$getConfig()).type_renderers[t.getTaskType(n.type)],o=e;return a?a.call(t,n,function(e){return o.call(t,e,i,r)},i):o.call(t,n,i,r)}}},function(t,e){t.exports=function(t,e,n,i,r){if(!t.start_date||!t.end_date)return null;var a=n.getItemTop(t.id),o=n.getItemHeight(t.id);if(a>e.y_end||a+oe.x_end||u",this.$grid=t.childNodes[0],this.$grid.innerHTML="
",this.$grid_scale=this.$grid.childNodes[0],this.$grid_data=this.$grid.childNodes[1];var u=a[this.$config.bind+"_attribute"];if(!u&&this.$config.bind&&(u="data-"+this.$config.bind+"-id"),this.$config.item_attribute=u||null,!this.$config.layers){var d=this._createLayerConfig();this.$config.layers=d}var h=o(e,this);h.init(),this._renderHeaderResizers=h.doOnRender,this._mouseDelegates=n(26)(e),l(e,this).init(),this._addLayers(this.$gantt),this._initEvents(),s&&(this._columnDND=new c(e,this),this._columnDND.init()),this.callEvent("onReady",[])},_validateColumnWidth:function(t,e){var n=t[e];if(n&&"*"!=n){var i=this.$gantt,r=1*n;isNaN(r)?i.assert(!1,"Wrong "+e+" value of column "+t.name):t[e]=r}},setSize:function(t,e){this.$config.width=this.$state.width=t,this.$config.height=this.$state.height=e;for(var n,i=this.getGridColumns(),r=0,a=(u=this.$getConfig()).grid_elastic_columns,o=0,s=i.length;ou.max_width&&(d=u.max_width-u.width),r-=u.width,u.width+=d,l-=d}for(var h=l>0?1:-1;l>0&&1===h||l<0&&-1===h;){var f=l;for(o=e+1;o-1&&((_=i[e].width+l)==this._getColumnWidth(i[e],n,_)&&(i[e].width=_));return this._getColsTotalWidth()},_getColsTotalWidth:function(){for(var t=this.getGridColumns(),e=0,n=0;no+h&&(d.width=h=f-o),o+=h;var _=t._sort&&d.name==t._sort.name?"
":"",g=["gantt_grid_head_cell","gantt_grid_head_"+d.name,u?"gantt_last_cell":"",i.grid_header_class(d.name,d)].join(" "),p="width:"+(h-(u?1:0))+"px;",v=d.label||s["column_"+d.name]||s[d.name];v=v||"";var m="
"+v+_+"
";a.push(m)}this.$grid_scale.style.height=e.scale_height+"px",this.$grid_scale.style.lineHeight=l+"px",this.$grid_scale.innerHTML=a.join(""),this._renderHeaderResizers&&this._renderHeaderResizers()},_getGridWidth:function(){return this.$config.width},destructor:function(){this._clearLayers(this.$gantt),this._mouseDelegates&&(this._mouseDelegates.destructor(),this._mouseDelegates=null),this._unbindStore(),this.$grid=null,this.$grid_scale=null,this.$grid_data=null,this.$gantt=null,this.$config.rowStore&&(this.$config.rowStore.detachEvent(this._staticBgHandler),this.$config.rowStore=null),this.callEvent("onDestroy",[]),this.detachAllEvents()}},t.exports=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ASAP="asap",t.ALAP="alap",t.SNET="snet",t.SNLT="snlt",t.FNET="fnet",t.FNLT="fnlt",t.MSO="mso",t.MFO="mfo"}(e.ConstraintTypes||(e.ConstraintTypes={}))},function(t,e){t.exports=function(t){return{getVirtualRoot:function(){return t.mixin(t.getSubtaskDates(),{id:t.config.root_id,type:t.config.types.project,$source:[],$target:[],$virtual:!0})},getLinkedTasks:function(e,n){var i=[e],r=!1;t._isLinksCacheEnabled()||(t._startLinksCache(),r=!0);for(var a=[],o={},s={},l=0;l",this.$task=t.childNodes[0],this.$task.innerHTML="
",this.$task_scale=this.$task.childNodes[0],this.$task_data=this.$task.childNodes[1],this.$task_data.innerHTML="
",this.$task_bg=this.$task_data.childNodes[0],this.$task_links=this.$task_data.childNodes[1],this.$task_bars=this.$task_data.childNodes[2],this._tasks={col_width:0,width:[],full_width:0,trace_x:[],rendered:{}};var e=this.$getConfig(),n=e[this.$config.bind+"_attribute"],i=e[this.$config.bindLinks+"_attribute"];!n&&this.$config.bind&&(n="data-"+this.$config.bind+"-id"),!i&&this.$config.bindLinks&&(i="data-"+this.$config.bindLinks+"-id"),this.$config.item_attribute=n||null,this.$config.link_attribute=i||null;var r=this._createLayerConfig();this.$config.layers||(this.$config.layers=r.tasks),this.$config.linkLayers||(this.$config.linkLayers=r.links),this._attachLayers(this.$gantt),this.callEvent("onReady",[]),this.$gantt.ext.dragTimeline&&(this._timelineDragScroll=this.$gantt.ext.dragTimeline.create(),this._timelineDragScroll.attach(this))},setSize:function(t,e){var n=this.$getConfig();if(1*t===t&&(this.$config.width=t),1*e===e){this.$config.height=e;var i=Math.max(this.$config.height-n.scale_height);this.$task_data.style.height=i+"px"}this.refresh(),this.$task_bg.style.backgroundImage="",n.smart_rendering&&this.$config.rowStore?this.$task_bg.style.height=this.getTotalHeight()+"px":this.$task_bg.style.height="";for(var r=this._tasks,a=this.$task_data.childNodes,o=0,s=a.length;o'+this._prepareScaleHtml(t[a],e,n)+"")}return i.join("")},_prepareScaleHtml:function(t,e,n){var i=this.$getConfig(),r=this.$gantt.templates,a=[],s=null,l=null,c=t.format||t.template||t.date;"string"==typeof c&&(c=this.$gantt.date.date_to_str(c));var u=0,d=t.count;!i.smart_scales||isNaN(e)||isNaN(n)||(u=o.findBinary(t.left,e),d=o.findBinary(t.left,n)+1),l=t.css||function(){},!t.css&&i.inherit_scale_class&&(l=r.scale_cell_class);for(var h=u;h"+f+"";a.push(k)}}return a.join("")},dateFromPos:function(t){var e=this._tasks;if(t<0||t>e.full_width||!e.full_width)return null;var n=o.findBinary(this._tasks.left,t),i=this._tasks.left[n],r=e.width[n]||e.col_width,a=0;r&&(a=(t-i)/r,e.rtl&&(a=1-a));var s=0;return a&&(s=this._getColumnDuration(e,e.trace_x[n])),new Date(e.trace_x[n].valueOf()+Math.round(a*s))},posFromDate:function(t){if(!this.isVisible())return 0;if(!t)return 0;var e=String(t.valueOf());if(void 0!==this._posFromDateCache[e])return this._posFromDateCache[e];var n=this.columnIndexByDate(t);this.$gantt.assert(n>=0,"Invalid day index");var i=Math.floor(n),r=n%1,a=this._tasks.left[Math.min(i,this._tasks.width.length-1)];i==this._tasks.width.length&&(a+=this._tasks.width[this._tasks.width.length-1]),r&&(i=r.max_date)return this._tasks.rtl?0:n.length;var a=o.findBinary(n,e),s=this._getClosestVisibleColumn(a,n,i),l=n[s],c=this._tasks.trace_index_transition;if(!l)return c?c[0]:0;var u=(t-n[s])/this._getColumnDuration(this._tasks,n[s]);return c?c[s]+(1-u):s+u},getItemPosition:function(t,e,n){var i,r,a;return this._tasks.rtl?(r=this.posFromDate(e||t.start_date),i=this.posFromDate(n||t.end_date)):(i=this.posFromDate(e||t.start_date),r=this.posFromDate(n||t.end_date)),a=Math.max(r-i,0),{left:i,top:this.getItemTop(t.id),height:this.getBarHeight(t.id),width:a,rowHeight:this.getItemHeight(t.id)}},getBarHeight:function(t,e){var n=this.$getConfig(),i=this.$config.rowStore.getItem(t),r=i.task_height||i.bar_height||n.bar_height||n.task_height,a=this.getItemHeight(t);"full"==r&&(r=a-(n.task_height_offset||5));return r=Math.min(r,a),e&&(r=Math.round(r/Math.sqrt(2))),Math.max(r,0)},getScale:function(){return this._tasks},_getScales:function(){var t=this.$getConfig(),e=this.$scaleHelper,n=[e.primaryScale(t)].concat(e.getSubScales(t));return e.sortScales(n),n},_getColumnDuration:function(t,e){return this.$gantt.date.add(e,t.step,t.unit)-e},_bindStore:function(){if(this.$config.bind){var t=this.$gantt.getDatastore(this.$config.bind);if(this.$config.rowStore=t,t&&!t._timelineCacheAttached){var e=this;t._timelineCacheAttached=t.attachEvent("onBeforeFilter",function(){e._resetTopPositionHeight()})}}},_unbindStore:function(){if(this.$config.bind){var t=this.$gantt.getDatastore(this.$config.bind);t&&t._timelineCacheAttached&&(t.detachEvent(t._timelineCacheAttached),t._timelineCacheAttached=!1)}},refresh:function(){this._bindStore(),this.$config.bindLinks&&(this.$config.linkStore=this.$gantt.getDatastore(this.$config.bindLinks)),this._resetTopPositionHeight(),this._resetHeight(),this._initStaticBackgroundRender(),this._render_tasks_scales()},destructor:function(){var t=this.$gantt;this._clearLayers(t),this._unbindStore(),this.$task=null,this.$task_scale=null,this.$task_data=null,this.$task_bg=null,this.$task_links=null,this.$task_bars=null,this.$gantt=null,this.$config.rowStore&&(this.$config.rowStore.detachEvent(this._staticBgHandler),this.$config.rowStore=null),this.$config.linkStore&&(this.$config.linkStore=null),this._timelineDragScroll&&(this._timelineDragScroll.destructor(),this._timelineDragScroll=null),this.callEvent("onDestroy",[]),this.detachAllEvents()}},t.exports=c},function(t,e,n){var i=n(3),r=n(1),a=function(t){"use strict";function e(e,n,i){var r=t.apply(this,arguments)||this;return e&&(r.$root=!0),r._parseConfig(n),r.$name="layout",r}return i(e,t),e.prototype.destructor=function(){this.$container&&this.$view&&r.removeNode(this.$view);for(var e=0;e0?t[o].$parent.getNextSibling(t[o].$id):t[o].$parent.getPrevSibling(t[o].$id);"resizer"==l.$name&&(l=i>0?l.$parent.getNextSibling(l.$id):l.$parent.getPrevSibling(l.$id));var c=l.getSize();if(a)t[o].$config.gravity=r;else if(l[n]){var u=s.gravity+c.gravity,d=s[n]+c[n],h=u/d;t[o].$config.gravity=h*r,l.$config[n]=d-r,l.$config.gravity=u-h*r}else t[o].$config[n]=r;var f=this.$gantt.$ui.getView("grid");!f||t[o].$content!==f||f.$config.scrollable||a||(this.$gantt.config.grid_width=r)}},e.prototype.resize=function(e){var n=!1;if(this.$root&&!this._resizeInProgress&&(this.callEvent("onBeforeResize",[]),n=!0,this._resizeInProgress=!0),t.prototype.resize.call(this,!0),t.prototype.resize.call(this,!1),n){var i=[];i=(i=(i=i.concat(this.getCellsByType("viewCell"))).concat(this.getCellsByType("viewLayout"))).concat(this.getCellsByType("hostCell"));for(var r=this.getCellsByType("scroller"),a=0;a=0&&this.$cells[e+1]?this.$cells[e+1]:null},e.prototype.getPrevSibling=function(t){var e=this.cellIndex(t);return e>=0&&this.$cells[e-1]?this.$cells[e-1]:null},e.prototype.cell=function(t){for(var e=0;e=n.childNodes.length?n.appendChild(t.$view):n.insertBefore(t.$view,n.childNodes[e])},e.prototype._parseConfig=function(t){this.$cells=[],this._xLayout=!t.rows;for(var e=t.rows||t.cols||t.views,n=0;n=0;i--){var a=this.$cells[i];a.$fill(n[i],this),a.$config.hidden&&a.$view.parentNode.removeChild(a.$view)}},e.prototype.$toHTML=function(){for(var e=this._xLayout?"x":"y",n=[],i=0;i=1e5&&(c.maxWidth=i),c.maxHeight>=1e5&&(c.maxHeight=a),c.minWidth=c.minWidth!=c.minWidth?0:c.minWidth,c.minHeight=c.minHeight!=c.minHeight?0:c.minHeight,this._xLayout?(c.minWidth+=this.$config.margin*this.$cells.length||0,c.minWidth+=2*this.$config.padding||0,c.minHeight+=2*this.$config.padding||0):(c.minHeight+=this.$config.margin*this.$cells.length||0,c.minHeight+=2*this.$config.padding||0),c},e.prototype._calcFreeSpace=function(t,e,n){var i=n?e.minWidth:e.minHeight,r=e.maxWidth,a=t;return a?(a>r&&(a=r),ar&&(a=r,this._free-=a,this._gravity-=e.gravity),aa&&(i=a),i=0;i--)if(!e[i].$config.hidden){n=i;break}for(i=0;i=n,a="";!r&&e[i+1]&&"scrollbar"==e[i+1].$config.view&&(this._xLayout?r=!0:a="gantt_layout_cell_border_transparent"),this._setBorders(r?[]:[t,a],e[i])}},e.prototype._updateCellVisibility=function(){for(var t=this._visibleCells||{},e=!this._visibleCells,n={},i=[],r=0;r=i&&tr.length-1||a<=0||i>r.length-1)){var o=t-this.getSum(r,n,i);this.adjustSize(o,r,n,i),this.adjustSize(-o,r,i+1),e.full_width=this.getSum(r)}},splitSize:function(t,e){for(var n=[],i=0;in(e.unit,e.step)?-1:0});for(var i=0;i=0;u--){var d=u==t.length-1,h=this.initScaleConfig(t[u],r,a);d&&this.processIgnores(h),this.initColSizes(h,e,l,s[u]),this.limitVisibleRange(h),d&&(l=h.full_width),c.unshift(h)}for(u=0;u=+l&&(l=e.add(c,i,n));+c<+l;){o.call(this,new Date(c));var u=c.getTimezoneOffset();c=e.add(c,i,n),c=t._correct_dst_change(c,u,i,n),e[n+"_start"]&&(c=e[n+"_start"](c))}},limitVisibleRange:function(t){var n=t.trace_x,i=t.width.length-1,r=0;if(+n[0]<+t.min_date&&0!=i){var a=Math.floor(t.width[0]*((n[1]-t.min_date)/(n[1]-n[0])));r+=t.width[0]-a,t.width[0]=a,n[0]=new Date(t.min_date)}var o=n.length-1,s=n[o],l=e.add(s,t.step,t.unit);if(+l>+t.max_date&&o>0&&(a=t.width[o]-Math.floor(t.width[o]*((l-t.max_date)/(l-s))),r+=t.width[o]-a,t.width[o]=a),r){for(var c=this.getSum(t.width),u=0,d=0;d=n.$level)return!1;for(;n&&this.exists(i);){if((n=this.getItem(i))&&n.id==e)return!0;i=this.getParent(n)}return!1},getSiblings:function(t){if(!this.exists(t))return i.$create();var e=this.getParent(t);return this.getChildren(e)},getNextSibling:function(t){for(var e=this.getSiblings(t),n=0,i=e.length;n0&&(r="0"),r||null}return null},getPrevSibling:function(t){for(var e=this.getSiblings(t),n=0,i=e.length;n0&&(r="0"),r||null}return null},getParent:function(t){var e=null;return(e=void 0!==t.id?t:this.getItem(t))?e[this.$parentProperty]:this.$getRootId()},clearAll:function(){this._branches={},o.prototype.clearAll.call(this)},calculateItemLevel:function(t){var e=0;return this.eachParent(function(){e++},t),e},_setParentInner:function(t,e,n){n||(t.hasOwnProperty("$rendered_parent")?this._move_branch(t,t.$rendered_parent,e):this._move_branch(t,t[this.$parentProperty],e))},setParent:function(t,e,n){this._setParentInner(t,e,n),t[this.$parentProperty]=e},_eachItemCached:function(t,e){for(var n=0,i=e.length;n=0;s--)i.push(o[s])}},eachItem:function(t,e){var n=this.$getRootId();r.defined(e)||(e=n);var i=l(e,n)||n,a=!1,o=!1,s=null;i===n&&(this._eachItemMainRangeCache?(a=!0,s=this._eachItemMainRangeCache):(o=!0,s=this._eachItemMainRangeCache=[])),a?this._eachItemCached(t,s):this._eachItemIterate(t,i,o?s:null)},eachParent:function(t,e){for(var n={},i=e,r=this.getParent(i);this.exists(r);){if(n[r])throw new Error("Invalid tasks tree. Cyclic reference has been detected on task "+r);n[r]=!0,i=this.getItem(r),t.call(this,i),r=this.getParent(i)}},_add_branch:function(t,e,n){var r=void 0===n?this.getParent(t):n;this.hasChild(r)||(this._branches[r]=i.$create());for(var a=this.getChildren(r),o=!1,s=0,l=a.length;sn[t]?1:-1}:t;if(e){var r=i;i=function(t,e){return r(e,t)}}var o=this.getChildren(n);if(o){for(var s=[],l=o.length-1;l>=0;l--)s[l]=this.getItem(o[l]);s.sort(i);for(l=0;l=0&&this.splice(t,e||1)},$remove:function(t){this.$removeAt(this.$find(t))},$insertAt:function(t,e){if(e||0===e){var n=this.splice(e,this.length-e);this[e]=t,this.push.apply(this,n)}else this.push(t)},$find:function(t){for(var e=0;ei&&(e=Math.min(n.length,e))}this.pull[t.id]=t,this.isSilent()||this._updateOrder(function(){-1===this.$find(t.id)&&this.$insertAt(t.id,e)}),this.filter()},isVisible:function(t){return this.visibleOrder.$find(t)>-1},getVisibleItems:function(){return this.getIndexRange()},addItem:function(t,e){return r.defined(t.id)||(t.id=r.uid()),this.$initItem&&(t=this.$initItem(t)),!(!this.isSilent()&&!1===this.callEvent("onBeforeAdd",[t.id,t]))&&(this._addItemInner(t,e),this.isSilent()||(this.callEvent("onAfterAdd",[t.id,t]),this.callEvent("onStoreUpdated",[t.id,t,"add"])),t.id)},_changeIdInner:function(t,e){this.pull[t]&&(this.pull[e]=this.pull[t]);var n=this._searchVisibleOrder[t];this.pull[e].id=e,this._updateOrder(function(){this[this.$find(t)]=e}),this._searchVisibleOrder[e]=n,delete this._searchVisibleOrder[t],delete this.pull[t]},changeId:function(t,e){this._changeIdInner(t,e),this.callEvent("onIdChange",[t,e])},exists:function(t){return!!this.pull[t]},_moveInner:function(t,e){var n=this.getIdByIndex(t);this._updateOrder(function(){this.$removeAt(t),this.$insertAt(n,Math.min(this.length,e))})},move:function(t,e){var n=this.getIdByIndex(t),i=this.getItem(n);this._moveInner(t,e),this.isSilent()||this.callEvent("onStoreUpdated",[i.id,i,"move"])},clearAll:function(){this.$destroyed||(this.silent(function(){this.unselect()}),this.pull={},this.visibleOrder=i.$create(),this.fullOrder=i.$create(),this.isSilent()||(this.callEvent("onClearAll",[]),this.refresh()))},silent:function(t,e){var n=!1;this.isSilent()&&(n=!0),this._skip_refresh=!0,t.call(e||this),n||(this._skip_refresh=!1)},isSilent:function(){return!!this._skip_refresh},arraysEqual:function(t,e){if(t.length!==e.length)return!1;for(var n=0;n1)for(var n=1;n1&&e.push(t)}),e}}}},function(t,e){t.exports=function(t){t._get_linked_task=function(e,n){var i=null,r=n?e.target:e.source;return t.isTaskExists(r)&&(i=t.getTask(r)),i},t._get_link_target=function(e){return t._get_linked_task(e,!0)},t._get_link_source=function(e){return t._get_linked_task(e,!1)};var e=!1,n={},i={},r={},a={};t._isLinksCacheEnabled=function(){return e},t._startLinksCache=function(){n={},i={},r={},a={},e=!0},t._endLinksCache=function(){n={},i={},r={},a={},e=!1},t._formatLink=function(i){if(e&&n[i.id])return n[i.id];var r=[],a=this._get_link_target(i),o=this._get_link_source(i);if(!o||!a)return r;if(t.isSummaryTask(a)&&t.isChildOf(o.id,a.id)||t.isSummaryTask(o)&&t.isChildOf(a.id,o.id))return r;var s=t.config.schedule_from_end&&t.config.project_end,l=t.config.auto_scheduling_move_projects;!t.config.auto_scheduling_compatibility&&t.config.auto_scheduling_strict&&(l=!1);for(var c=this.isSummaryTask(o)?this.getSubtaskDates(o.id):{start_date:o.start_date,end_date:o.end_date},u=this._getImplicitLinks(i,o,function(e){return l&&s?e.$source.length||t.getState("tasksDnd").drag_id==e.id?0:t.calculateDuration({start_date:e.end_date,end_date:c.end_date,task:o}):0},!0),d=this.isSummaryTask(a)?this.getSubtaskDates(a.id):{start_date:a.start_date,end_date:a.end_date},h=this._getImplicitLinks(i,a,function(e){return!l||s?0:e.$target.length||t.getState("tasksDnd").drag_id==e.id?0:t.calculateDuration({start_date:d.start_date,end_date:e.start_date,task:o})}),f=0,_=u.length;f<_;f++)for(var g=u[f],p=0,v=h.length;p","gm"),n=new RegExp(" +","gm");function i(t){return(t+"").replace(e," ").replace(n," ")}var r=new RegExp("'","gm");function a(t){return(t+"").replace(r,"'")}for(var o in t._waiAria={getAttributeString:function(t){var e=[" "];for(var n in t){var r=a(i(t[n]));e.push(n+"='"+r+"'")}return e.push(" "),e.join(" ")},getTimelineCellAttr:function(e){return t._waiAria.getAttributeString({"aria-label":e})},_taskCommonAttr:function(e,n){e.start_date&&e.end_date&&(n.setAttribute("aria-label",i(t.templates.tooltip_text(e.start_date,e.end_date,e))),e.$dataprocessor_class&&n.setAttribute("aria-busy",!0),n.setAttribute("aria-selected",t.isSelectedTask(e.id)?"true":"false"))},setTaskBarAttr:function(e,n){this._taskCommonAttr(e,n),!t.isReadonly(e)&&t.config.drag_move&&(e.id!=t.getState("tasksDnd").drag_id?n.setAttribute("aria-grabbed",!1):n.setAttribute("aria-grabbed",!0))},taskRowAttr:function(e,n){this._taskCommonAttr(e,n),!t.isReadonly(e)&&t.config.order_branch&&n.setAttribute("aria-grabbed",!1),n.setAttribute("role","row"),n.setAttribute("aria-level",e.$level),t.hasChild(e.id)&&n.setAttribute("aria-expanded",e.$open?"true":"false")},linkAttr:function(e,n){var r=t.config.links,a=e.type==r.finish_to_start||e.type==r.start_to_start,o=e.type==r.start_to_start||e.type==r.start_to_finish,s=t.locale.labels.link+" "+t.templates.drag_link(e.source,o,e.target,a);n.setAttribute("aria-label",i(s)),t.isReadonly(e)&&n.setAttribute("aria-readonly",!0)},gridSeparatorAttr:function(t){t.setAttribute("role","separator")},lightboxHiddenAttr:function(t){t.setAttribute("aria-hidden","true")},lightboxVisibleAttr:function(t){t.setAttribute("aria-hidden","false")},lightboxAttr:function(t){t.setAttribute("role","dialog"),t.setAttribute("aria-hidden","true"),t.firstChild.setAttribute("role","heading")},lightboxButtonAttrString:function(e){return this.getAttributeString({role:"button","aria-label":t.locale.labels[e],tabindex:"0"})},lightboxHeader:function(t,e){t.setAttribute("aria-label",e)},lightboxSelectAttrString:function(e){var n="";switch(e){case"%Y":n=t.locale.labels.years;break;case"%m":n=t.locale.labels.months;break;case"%d":n=t.locale.labels.days;break;case"%H:%i":n=t.locale.labels.hours+t.locale.labels.minutes}return t._waiAria.getAttributeString({"aria-label":n})},lightboxDurationInputAttrString:function(e){return this.getAttributeString({"aria-label":t.locale.labels.column_duration,"aria-valuemin":"0"})},gridAttrString:function(){return[" role='treegrid'",t.config.multiselect?"aria-multiselectable='true'":"aria-multiselectable='false'"," "].join(" ")},gridScaleRowAttrString:function(){return"role='row'"},gridScaleCellAttrString:function(e,n){var i="";if("add"==e.name)i=this.getAttributeString({role:"button","aria-label":t.locale.labels.new_task});else{var r={role:"columnheader","aria-label":n};t._sort&&t._sort.name==e.name&&("asc"==t._sort.direction?r["aria-sort"]="ascending":r["aria-sort"]="descending"),i=this.getAttributeString(r)}return i},gridDataAttrString:function(){return"role='rowgroup'"},gridCellAttrString:function(e,n,i){var r={role:"gridcell","aria-label":n};return e.editor&&!t.isReadonly(i)||(r["aria-readonly"]=!0),this.getAttributeString(r)},gridAddButtonAttrString:function(e){return this.getAttributeString({role:"button","aria-label":t.locale.labels.new_task})},messageButtonAttrString:function(t){return"tabindex='0' role='button' aria-label='"+t+"'"},messageInfoAttr:function(t){t.setAttribute("role","alert")},messageModalAttr:function(t,e){t.setAttribute("role","dialog"),e&&t.setAttribute("aria-labelledby",e)},quickInfoAttr:function(t){t.setAttribute("role","dialog")},quickInfoHeaderAttrString:function(){return" role='heading' "},quickInfoHeader:function(t,e){t.setAttribute("aria-label",e)},quickInfoButtonAttrString:function(e){return t._waiAria.getAttributeString({role:"button","aria-label":e,tabindex:"0"})},tooltipAttr:function(t){t.setAttribute("role","tooltip")},tooltipVisibleAttr:function(t){t.setAttribute("aria-hidden","false")},tooltipHiddenAttr:function(t){t.setAttribute("aria-hidden","true")}},t._waiAria)t._waiAria[o]=function(e){return function(){return t.config.wai_aria_attributes?e.apply(this,arguments):""}}(t._waiAria[o])}},function(t,e){t.exports=function(t){t._extend_to_optional=function(e){var n=e,i={render:n.render,focus:n.focus,set_value:function(e,r,a,o){var s=t._resolve_default_mapping(o);if(!a[s.start_date]||"start_date"==s.start_date&&this._isAllowedUnscheduledTask(a)){i.disable(e,o);var l={};for(var c in s)l[s[c]]=a[c];return n.set_value.call(t,e,r,l,o)}return i.enable(e,o),n.set_value.call(t,e,r,a,o)},get_value:function(e,i,r){return r.disabled?{start_date:null}:n.get_value.call(t,e,i,r)},update_block:function(e,n){if(t.callEvent("onSectionToggle",[t._lightbox_id,n]),e.style.display=n.disabled?"none":"block",n.button){var i=e.previousSibling.querySelector(".gantt_custom_button_label"),r=t.locale.labels,a=n.disabled?r[n.name+"_enable_button"]:r[n.name+"_disable_button"];i.innerHTML=a}t.resizeLightbox()},disable:function(t,e){e.disabled=!0,i.update_block(t,e)},enable:function(t,e){e.disabled=!1,i.update_block(t,e)},button_click:function(e,n,r,a){if(!1!==t.callEvent("onSectionButton",[t._lightbox_id,r])){var o=t._get_typed_lightbox_config()[e];o.disabled?i.enable(a,o):i.disable(a,o)}}};return i},t.form_blocks.duration_optional=t._extend_to_optional(t.form_blocks.duration),t.form_blocks.time_optional=t._extend_to_optional(t.form_blocks.time)}},function(t,e,n){var i=n(3);t.exports=function(t){var e=n(17)(t);function r(){return e.apply(this,arguments)||this}return i(r,e),r.prototype.render=function(n){var i=t.config.types,r=t.locale.labels,a=[],o=n.filter||function(t,e){return!i.placeholder||e!==i.placeholder};for(var s in i)!1==!o(s,i[s])&&a.push({key:i[s],label:r["type_"+s]});n.options=a;var l=n.onchange;return n.onchange=function(){t.changeLightboxType(this.value),this.value===t.config.types.task&&(t._lightbox_new_type="task"),"function"==typeof l&&l.apply(this,arguments)},e.prototype.render.apply(this,arguments)},r}},function(t,e,n){var i=n(3),r=n(16);t.exports=function(t){var e=n(5)(t);function a(){return e.apply(this,arguments)||this}function o(e){return!e||e===t.config.constraint_types.ASAP||e===t.config.constraint_types.ALAP}function s(t,e){for(var n=o(e),i=0;i",a=[];for(var o in t.config.constraint_types)a.push({key:t.config.constraint_types[o],label:t.locale.labels[t.config.constraint_types[o]]});return e.options=e.options||a,i+=""+r.getHtmlSelect(e.options,[{key:"data-type",value:"constraint-type"}])+"",i+="",i+=""},a.prototype.set_value=function(e,n,i,r){var a=e.querySelector("[data-constraint-type-select] select"),o=e.querySelectorAll("[data-constraint-time-select] select"),l=r._time_format_order,c=t._resolve_default_mapping(r);a._eventsInitialized||(a.addEventListener("change",function(t){s(o,t.target.value)}),a._eventsInitialized=!0);var u=i[c.constraint_date]||new Date;t.form_blocks._fill_lightbox_select(o,0,u,l,r);var d=i[c.constraint_type]||t.getConstraintType(i);a.value=d,s(o,d)},a.prototype.get_value=function(e,n,i){var r=e.querySelector("[data-constraint-type-select] select"),a=e.querySelectorAll("[data-constraint-time-select] select"),s=r.value,l=null;return o(s)||(l=t.form_blocks.getTimePickerValue(a,i)),{constraint_type:s,constraint_date:l}},a.prototype.focus=function(e){t._focus(e.querySelector("select"))},a}},function(t,e,n){var i=n(2),r=n(1),a=n(16),o=n(3);t.exports=function(t){var e=n(5)(t),s={resources:{},resourcesValues:{},filter:{},eventsInitialized:{},changed:!1};function l(){return e.apply(this,arguments)||this}function c(t){return void 0===t?".gantt_resource_amount_input":"[data-checked='"+(t?"true":"false")+"'] .gantt_resource_amount_input"}function u(t){return s.resources[t.id]}function d(t){return s.filter[t.id]}return t.attachEvent("onAfterLightbox",function(){for(var t in s.filter)s.filter[t].checkbox.checked=!1,s.filter[t].input.value="",s.filter[t].filterApplied=!1;s.resourcesValues={}}),o(l,e),l.prototype.render=function(e){var n,i=t.locale.labels.resources_filter_placeholder||e.filter_placeholder||"type to filter",r=t.locale.labels.resources_filter_label||"hide empty";return n="",n+="
",n+="
",n+=""},l.prototype.set_value=function(e,n,o,l){var h,f=function(t,e){s.resources[e.id]||(s.resources[e.id]=t.querySelector(".gantt_resources"));return s.resources[e.id]}(e,l),_="";!function(t,e){if(!s.filter[e.id]){var n=t.querySelector(".gantt_resources_filter"),i=n.querySelector(".gantt_resources_filter_input"),r=n.querySelector(".switch_unsetted");s.filter[e.id]={container:n,input:i,checkbox:r,filterApplied:!1}}s.filter[e.id]}(e,l),function(e,n,a,o){if(s.eventsInitialized[a.id])return;var l=function(r){var l,c,u,h,_;f(a,e);var g=d(a);_=g.checkbox,h=g.input,u=_.checked,c=function(t){return t.value.trim()}(h),g.filterApplied=!!c,t.getState().lightbox&&(n=t.getLightboxValues()),l=function(e,n,r,a){var o,l;if(a){var c=n[e.map_to]||[];if(i.isArray(c)||(c=[c]),0===(c=c.slice()).length){for(var u in c=[],(l=t.copy(e)).options=[],s.resourcesValues[e.id]){var d=s.resourcesValues[e.id][u];""!==d.value&&c.push({resource_id:u,value:d.value,id:d.id})}if(0===c.length)return l}else for(var u in s.resourcesValues[e.id]){var d=s.resourcesValues[e.id][u];if(""!==d.value){var h=i.arrayFind(c,function(t){return t.id==u});h||c.push({resource_id:u,value:d.value,id:d.id})}}for(var f={},_=0;_=0))return t}}else{if(""===r)return e;o=function(t){if(t.label.toLowerCase().indexOf(r.toLowerCase())>=0)return t}}return(l=t.copy(e)).options=i.arrayFilter(l.options,o),l}(a,n,c,u);var p=n[a.map_to];o.form_blocks.resources.set_value(e,p,n,l)};function h(e){var n,i,o=e.target;if(s.changed=!0,"checkbox"===e.target.type){n=o.parentNode,(i=n.querySelector(c())).disabled=!o.checked;var l=i.getAttribute("data-item-id"),u=r.locateClassName(e,"gantt_resource_row"),d=u.querySelector(".gantt_resource_amount_input");if(u.setAttribute("data-checked",o.checked),o.checked){"select"===i.nodeName.toLowerCase()&&t.callEvent("onResourcesSelectActivated",[{target:i}]);var h=l,_=a.default_value;a.options.forEach(function(t){t.key==h&&t.default_value&&(_=t.default_value)}),d&&!d.value&&void 0!==_&&(d.value=_,f(a,this)),d.select?d.select():d.focus&&d.focus()}else s.resourcesValues[a.id]&&delete s.resourcesValues[a.id][l]}else"text"!==e.target.type&&"select"!==e.target.nodeName.toLowerCase()||(n=o.parentNode.parentNode,i=e.target,f(a,this))}function f(t,e){var n=c(),i=e.querySelectorAll(n);s.resourcesValues[t.id]=s.resourcesValues[t.id]||{};for(var r=0;r","
","
",t.label,"
","
",function(t,e,n,i){var r,o="";if(!t)return;r=[{key:"data-item-id",value:t.key},{key:"data-assignment-id",value:i||""},{key:"class",value:"gantt_resource_amount_input"}],n&&r.push({key:"disabled",value:"disabled"});t.options?o+=a.getHtmlSelect(t.options,r,e):(r[r.length]={key:"value",value:e||""},o+=a.getHtmlInput(r));return o}(t,h.value,!h.value,h.id),"
","
",t.unit,"
",""].join(""))}),f.innerHTML=_,f.style.zoom="1",f._offsetSizes=f.offsetHeight,f.style.zoom="",t.resizeLightbox(),t._center_lightbox(t.getLightbox()),s.changed=!1},l.prototype.get_value=function(e,n,i){if(!s.changed)return n[i.map_to||t.config.resource_property]||[];for(var r=u(i),a=[],o=c(!0),l=c(!1),h=d(i),f=t.copy(s.resourcesValues[i.id])||{},_=r.querySelectorAll(o),g=r.querySelectorAll(l),p=0;p",i=" "+t.locale.labels[t.config.duration_unit+"s"]+" ",r=e.single_date?" style='display:none'":"",a=e.readonly?" disabled='disabled'":"",o=t._waiAria.lightboxDurationInputAttrString(e),s="gantt_duration_value";e.formatter&&(i="",s+=" gantt_duration_value_formatted");var l="
"+i+"
";return"
"+n+" "+l+"
"},a.prototype.set_value=function(e,n,i,r){var a,c,u,d,h=e.getElementsByTagName("select"),f=e.getElementsByTagName("input"),_=f[1],g=[f[0],f[2]],p=e.getElementsByTagName("span")[0],v=r._time_format_order;function m(){var n=s.call(t,e,r),a=l.call(t,e,r),o=t.calculateEndDate({start_date:n,duration:a,task:i}),c=t.templates.task_end_date||t.templates.task_date;p.innerHTML=c(o)}function y(t){var e=_.value;e=o(r).parse(e),window.isNaN(e)&&(e=0),(e+=t)<1&&(e=1),_.value=o(r).format(e),m()}g[0].onclick=t.bind(function(){y(-1*t.config.duration_step)},this),g[1].onclick=t.bind(function(){y(1*t.config.duration_step)},this),h[0].onchange=m,h[1].onchange=m,h[2].onchange=m,h[3]&&(h[3].onchange=m),_.onkeydown=t.bind(function(e){var n;return(n=(e=e||window.event).charCode||e.keyCode||e.which)==t.constants.KEY_CODES.DOWN?(y(-1*t.config.duration_step),!1):n==t.constants.KEY_CODES.UP?(y(1*t.config.duration_step),!1):void window.setTimeout(m,1)},this),_.onchange=t.bind(m,this),"string"==typeof(a=t._resolve_default_mapping(r))&&(a={start_date:a}),c=i[a.start_date]||new Date,u=i[a.end_date]||t.calculateEndDate({start_date:c,duration:1,task:i}),d=Math.round(i[a.duration])||t.calculateDuration({start_date:c,end_date:u,task:i}),d=o(r).format(d),t.form_blocks._fill_lightbox_select(h,0,c,v,r),_.value=d,m()},a.prototype.get_value=function(e,n,i){var r=s(e,i),a=l(e,i),o=t.calculateEndDate({start_date:r,duration:a,task:n});return"string"==typeof t._resolve_default_mapping(i)?r:{start_date:r,end_date:o,duration:a}},a.prototype.focus=function(e){t._focus(e.getElementsByTagName("select")[0])},a}},function(t,e,n){var i=n(3);t.exports=function(t){var e=n(5)(t);function r(){return e.apply(this,arguments)||this}return i(r,e),r.prototype.render=function(t){var e="
";if(t.options&&t.options.length)for(var n=0;n"+t.options[n].label+"";return e+="
"},r.prototype.set_value=function(t,e,n,i){var r;i.options&&i.options.length&&(r=t.querySelector("input[type=radio][value='"+e+"']")||t.querySelector("input[type=radio][value='"+i.default_value+"']"))&&(!t._dhx_onchange&&i.onchange&&(t.onchange=i.onchange,t._dhx_onchange=!0),r.checked=!0)},r.prototype.get_value=function(t,e){var n=t.querySelector("input[type=radio]:checked");return n?n.value:""},r.prototype.focus=function(e){t._focus(e.querySelector("input[type=radio]"))},r}},function(t,e,n){var i=n(2),r=n(3);t.exports=function(t){var e=n(5)(t);function a(){return e.apply(this,arguments)||this}return r(a,e),a.prototype.render=function(t){var e="
";if(t.options&&t.options.length)for(var n=0;n"+t.options[n].label+"";else t.single_value=!0,e+="";return e+="
"},a.prototype.set_value=function(t,e,n,r){var a=Array.prototype.slice.call(t.querySelectorAll("input[type=checkbox]"));(!t._dhx_onchange&&r.onchange&&(t.onchange=r.onchange,t._dhx_onchange=!0),r.single_value)?a[0].checked=!!e:i.forEach(a,function(t){t.checked=!!e&&e.indexOf(t.value)>=0})},a.prototype.get_value=function(t,e,n){return n.single_value?t.querySelector("input[type=checkbox]").checked:i.arrayMap(Array.prototype.slice.call(t.querySelectorAll("input[type=checkbox]:checked")),function(t){return t.value})},a.prototype.focus=function(e){t._focus(e.querySelector("input[type=checkbox]"))},a}},function(t,e,n){var i=n(3);t.exports=function(t){var e=n(5)(t);function r(){return e.apply(this,arguments)||this}return i(r,e),r.prototype.render=function(e){var n=t.form_blocks.getTimePicker.call(this,e),i="
";return i+=n,e.single_date?(n=t.form_blocks.getTimePicker.call(this,e,!0),i+=""):i+="  –  ",i+=n,i+="
"},r.prototype.set_value=function(e,n,i,r){var a=r,o=e.getElementsByTagName("select"),s=r._time_format_order;if(a.auto_end_date)for(var l=function(){d=new Date(o[s[2]].value,o[s[1]].value,o[s[0]].value,0,0),h=t.calculateEndDate({start_date:d,duration:1,task:i}),t.form_blocks._fill_lightbox_select(o,s.size,h,s,a)},c=0;c<4;c++)o[c].onchange=l;var u=t._resolve_default_mapping(r);"string"==typeof u&&(u={start_date:u});var d=i[u.start_date]||new Date,h=i[u.end_date]||t.calculateEndDate({start_date:d,duration:1,task:i});t.form_blocks._fill_lightbox_select(o,0,d,s,a),t.form_blocks._fill_lightbox_select(o,s.size,h,s,a)},r.prototype.get_value=function(e,n,i){var r,a=e.getElementsByTagName("select"),o=i._time_format_order;return r=t.form_blocks.getTimePickerValue(a,i),"string"==typeof t._resolve_default_mapping(i)?r:{start_date:r,end_date:function(e,n,r){var a=t.form_blocks.getTimePickerValue(e,i,n.size);return a<=r&&(!1!==i.autofix_end||i.single_date)?t.date.add(r,t._get_timepicker_step(),"minute"):a}(a,o,r)}},r.prototype.focus=function(e){t._focus(e.getElementsByTagName("select")[0])},r}},function(t,e,n){var i=n(3);t.exports=function(t){var e=n(5)(t);function r(){return e.apply(this,arguments)||this}return i(r,e),r.prototype.render=function(t){return"
"},r.prototype.set_value=function(e,n){t.form_blocks.textarea._get_input(e).value=n||""},r.prototype.get_value=function(e){return t.form_blocks.textarea._get_input(e).value},r.prototype.focus=function(e){var n=t.form_blocks.textarea._get_input(e);t._focus(n,!0)},r.prototype._get_input=function(t){return t.querySelector("textarea")},r}},function(t,e,n){var i=n(3);t.exports=function(t){var e=n(5)(t);function r(){return e.apply(this,arguments)||this}return i(r,e),r.prototype.render=function(t){return"
"},r.prototype.set_value=function(t,e){t.innerHTML=e||""},r.prototype.get_value=function(t){return t.innerHTML||""},r.prototype.focus=function(){},r}},function(t,e,n){function i(t){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){var e=n(1),r=n(2),a=n(65)(t),o=n(64)(t),s=n(63)(t),l=n(17)(t),c=n(62)(t),u=n(61)(t),d=n(60)(t),h=n(58)(t),f=n(57)(t),_=n(56)(t),g=n(55)(t);function p(e,n){var i,r,a="";for(r=0;r
"+t.locale.labels[i]+"
";return a}function v(e,n,i){var r,a,o,s,l,c,u="";switch(i.timeFormat[n]){case"%Y":for(e._time_format_order[2]=n,e._time_format_order.size++,e.year_range&&(isNaN(e.year_range)?e.year_range.push&&(o=e.year_range[0],s=e.year_range[1]):r=e.year_range),r=r||10,a=a||Math.floor(r/2),o=o||i.date.getFullYear()-a,s=s||o+r,l=o;l"+l+"";break;case"%m":for(e._time_format_order[1]=n,e._time_format_order.size++,l=0;l<12;l++)u+="";break;case"%d":for(e._time_format_order[0]=n,e._time_format_order.size++,l=1;l<32;l++)u+="";break;case"%H:%i":for(e._time_format_order[3]=n,e._time_format_order.size++,l=i.first,c=i.date.getDate(),e._time_values=[];l"+t.templates.time_picker(i.date)+"",e._time_values.push(l),i.date.setTime(i.date.valueOf()+60*t._get_timepicker_step()*1e3),l=24*(i.date.getDate()!=c?1:0)*60+60*i.date.getHours()+i.date.getMinutes()}return u}t._lightbox_methods={},t._lightbox_template="
 
",t.$services.getService("state").registerProvider("lightbox",function(){return{lightbox:t._lightbox_id}}),t.showLightbox=function(t){if(this.callEvent("onBeforeLightbox",[t])){var e=this.getTask(t),n=this.getLightbox(this.getTaskType(e.type));this._center_lightbox(n),this.showCover(),this._fill_lightbox(t,n),this._waiAria.lightboxVisibleAttr(n),this.callEvent("onLightbox",[t])}},t._get_timepicker_step=function(){if(this.config.round_dnd_dates){var e;if(function(t){var e=t.$ui.getView("timeline");return!(!e||!e.isVisible())}(this)){var n=t.getScale();e=r.getSecondsInUnit(n.unit)*n.step/60}return(!e||e>=1440)&&(e=this.config.time_step),e}return this.config.time_step},t.getLabel=function(t,e){for(var n=this._get_typed_lightbox_config(),i=0;i
"+this.locale.labels["button_"+t[n].button]+"
"),this.config.wide_form&&(e+="
"),e+="
"+i.render.call(this,t[n]),e+="
"}}return e},t.resizeLightbox=function(){if(this._lightbox){var t=this._lightbox.querySelector(".gantt_cal_larea");t.style.height="0px",t.style.height=t.scrollHeight+"px",this._lightbox.style.height=t.scrollHeight+this.config.lightbox_additional_height+"px",t.style.height=t.scrollHeight+"px"}},t._center_lightbox=function(t){if(t){t.style.display="block";var e=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop,n=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,i=window.innerHeight||document.documentElement.clientHeight;t.style.top=e?Math.round(e+Math.max((i-t.offsetHeight)/2,0))+"px":Math.round(Math.max((i-t.offsetHeight)/2,0)+9)+"px",document.documentElement.scrollWidth>document.body.offsetWidth?t.style.left=Math.round(n+(document.body.offsetWidth-t.offsetWidth)/2)+"px":t.style.left=Math.round((document.body.offsetWidth-t.offsetWidth)/2)+"px"}},t.showCover=function(){this._cover||(this._cover=document.createElement("DIV"),this._cover.className="gantt_cal_cover",document.body.appendChild(this._cover))},t.event(window,"deviceorientation",function(){t.getState().lightbox&&t._center_lightbox(t.getLightbox())}),t._init_lightbox_events=function(){t.lightbox_events={},t.lightbox_events.gantt_save_btn=function(){t._save_lightbox()},t.lightbox_events.gantt_delete_btn=function(){t._lightbox_new_type=null,t.callEvent("onLightboxDelete",[t._lightbox_id])&&(t.isTaskExists(t._lightbox_id)?t.$click.buttons.delete(t._lightbox_id):t.hideLightbox())},t.lightbox_events.gantt_cancel_btn=function(){t._cancel_lightbox()},t.lightbox_events.default=function(n,i){if(i.getAttribute("data-dhx-button"))t.callEvent("onLightboxButton",[i.className,i,n]);else{var r,a,o=e.getClassName(i);if(-1!=o.indexOf("gantt_custom_button"))if(-1!=o.indexOf("gantt_custom_button_"))for(r=i.parentNode.getAttribute("data-index"),a=i;a&&-1==e.getClassName(a).indexOf("gantt_cal_lsection");)a=a.parentNode;else r=i.getAttribute("data-index"),a=i.parentNode,i=i.firstChild;var s=t._get_typed_lightbox_config();r&&(r*=1,t.form_blocks[s[1*r].type].button_click(r,i,a,a.nextSibling))}},this.event(t.getLightbox(),"click",function(n){n=n||window.event;var i=e.getTargetNode(n),r=e.getClassName(i);return r||(i=i.previousSibling,r=e.getClassName(i)),i&&r&&0===r.indexOf("gantt_btn_set")&&(i=i.firstChild,r=e.getClassName(i)),!(!i||!r)&&(t.defined(t.lightbox_events[i.className])?t.lightbox_events[i.className]:t.lightbox_events.default)(n,i)}),t.getLightbox().onkeydown=function(n){var i=n||window.event,r=n.target||n.srcElement,a=e.getClassName(r).indexOf("gantt_btn_set")>-1;switch((n||i).keyCode){case t.constants.KEY_CODES.SPACE:if((n||i).shiftKey)return;a&&r.click&&r.click();break;case t.keys.edit_save:if((n||i).shiftKey)return;a&&r.click?r.click():t._save_lightbox();break;case t.keys.edit_cancel:t._cancel_lightbox()}}},t._cancel_lightbox=function(){var e=this.getLightboxValues();this.callEvent("onLightboxCancel",[this._lightbox_id,e.$new]),t.isTaskExists(e.id)&&e.$new&&this.silent(function(){t.$data.tasksStore.removeItem(e.id),t._update_flags(e.id,null)}),this.refreshData(),this.hideLightbox()},t._save_lightbox=function(){var t=this.getLightboxValues();this.callEvent("onLightboxSave",[this._lightbox_id,t,!!t.$new])&&(t.$new?(delete t.$new,this.addTask(t,t.parent,this.getTaskIndex(t.id))):this.isTaskExists(t.id)&&(this.mixin(this.getTask(t.id),t,!0),this.refreshTask(t.id),this.updateTask(t.id)),this.refreshData(),this.hideLightbox())},t._resolve_default_mapping=function(t){var e=t.map_to;return!{time:!0,time_optional:!0,duration:!0,duration_optional:!0}[t.type]?"constraint"===t.type&&(t.map_to&&"string"!=typeof t.map_to||(e={constraint_type:"constraint_type",constraint_date:"constraint_date"})):"auto"==t.map_to?e={start_date:"start_date",end_date:"end_date",duration:"duration"}:"string"==typeof t.map_to&&(e={start_date:t.map_to}),e},t.getLightboxValues=function(){var e={};t.isTaskExists(this._lightbox_id)&&(e=this.mixin({},this.getTask(this._lightbox_id)));for(var n=this._get_typed_lightbox_config(),r=0;r0&&(s+=" "),(a=v(e,i,c))&&(o=t._waiAria.lightboxSelectAttrString(c.timeFormat[i]),s+="");return s},getTimePickerValue:function(e,n,i){var r,a=n._time_format_order,o=t.defined(a[3]),s=0,l=0,c=i||0;return o&&(r=parseInt(e[a[3]+c].value,10),s=Math.floor(r/60),l=r%60),new Date(e[a[2]+c].value,e[a[1]+c].value,e[a[0]+c].value,s,l)},_fill_lightbox_select:function(e,n,i,r){if(e[n+r[0]].value=i.getDate(),e[n+r[1]].value=i.getMonth(),e[n+r[2]].value=i.getFullYear(),t.defined(r[3])){var a=60*i.getHours()+i.getMinutes();a=Math.round(a/t._get_timepicker_step())*t._get_timepicker_step();var o=e[n+r[3]];o.value=a,o.setAttribute("data-value",a)}},template:new a,textarea:new o,select:new l,time:new s,duration:new d,parent:new h,radio:new u,checkbox:new c,resources:new f,constraint:new _,typeselect:new g},t._is_lightbox_timepicker=function(){for(var t=this._get_typed_lightbox_config(),e=0;e1),this.config.touch){var t=!0;try{document.createEvent("TouchEvent")}catch(e){t=!1}t?this._touch_events(["touchmove","touchstart","touchend"],function(t){return t.touches&&t.touches.length>1?null:t.touches[0]?{target:t.target,pageX:t.touches[0].pageX,pageY:t.touches[0].pageY,clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}:t},function(){return!1}):window.navigator.pointerEnabled?this._touch_events(["pointermove","pointerdown","pointerup"],function(t){return"mouse"==t.pointerType?null:t},function(t){return!t||"mouse"==t.pointerType}):window.navigator.msPointerEnabled&&this._touch_events(["MSPointerMove","MSPointerDown","MSPointerUp"],function(t){return t.pointerType==t.MSPOINTER_TYPE_MOUSE?null:t},function(t){return!t||t.pointerType==t.MSPOINTER_TYPE_MOUSE})}},t));var i=[];t._touch_events=function(r,a,o){for(var s,l=0,c=!1,u=!1,d=null,h=null,f=null,_=[],g=null,p=0;p5||Math.abs(p)>5)&&(u=!0,l=0,s=g?e(g):t.getScrollState()),u){var m,y=s.x+_,k=s.y+p;if(g?(!function(e,n,i){var r=e.$config.scrollX?t.$ui.getView(e.$config.scrollX):null,a=e.$config.scrollY?t.$ui.getView(e.$config.scrollY):null;r&&r.scrollTo(n,null),a&&a.scrollTo(null,i)}(g,y,k),m=e(g)):(t.scrollTo(y,k),m=t.getScrollState()),s.x!=m.x&&p>2*_||s.y!=m.y&&_>2*p)return v(i)}}return v(i)}return!0}}]),i.push([this.$container,"contextmenu",function(t){if(c)return v(t)}]),i.push([this.$container,r[1],function(e){if(document&&document.body&&document.body.classList.add("gantt_touch_active"),!o(e))if(e.touches&&e.touches.length>1)c=!1;else{d=a(e),g=function(e){for(var n=t.$layout.getCellsByType("viewCell"),i=0;i=r.left&&e.clientX<=r.right&&e.clientY<=r.bottom&&e.clientY>=r.top)return n[i]}}(d),t._locate_css(d,"gantt_hor_scroll")||t._locate_css(d,"gantt_ver_scroll")||(c=!0);var i=n();h=setTimeout(function(){var e=t.locate(d);i&&e&&!t._locate_css(d,"gantt_link_control")&&!t._locate_css(d,"gantt_grid_data")&&(i.on_mouse_down(d),i.drag&&i.drag.start_drag&&(!function(e){var n=t._getTaskLayers(),i=t.getTask(e);if(i&&t.isTaskVisible(e)){f=e;for(var r=0;re._levels.length-1||e.setLevel(t)},this.getCurrentLevel=function(){return e._activeLevelIndex},this.getLevels=function(){return e._levels},this.setLevel=function(t){var n=e._getZoomIndexByName(t);-1===n&&e.$gantt.assert(-1!==n,"Invalid zoom level for gantt.ext.zoom.setLevel. "+t+" is not an expected value."),e._setLevel(n,0)},this._getZoomIndexByName=function(t){var n=-1;if("string"==typeof t){if(!isNaN(Number(t))&&e._levels[Number(t)])n=Number(t);else for(var i=0;i0&&(r=!0),t.preventDefault(),t.stopPropagation(),e._setScaleSettings(r,i)},this._setScaleDates=function(){e._initialStartDate&&e._initialEndDate&&(e.$gantt.config.start_date=e._initialStartDate,e.$gantt.config.end_date=e._initialEndDate)},this.$gantt=t,this._domEvents=this.$gantt._createDomEventScope()}return t.prototype.init=function(t){var e=this;this.$gantt.env.isNode||(this._initialStartDate=t.startDate,this._initialEndDate=t.endDate,this._activeLevelIndex=t.activeLevelIndex?t.activeLevelIndex:0,this._levels=this._mapScales(t.levels||o),this._handler=t.handler||this._defaultHandler,this._minColumnWidth=t.minColumnWidth||60,this._maxColumnWidth=t.maxColumnWidth||240,this._widthStep=t.widthStep||3/8*t.minColumnWidth,this._useKey=t.useKey,this._initialized||(r(this),this.$gantt.attachEvent("onGanttScroll",function(){e._getVisibleDate()})),this._domEvents.detachAll(),"wheel"===t.trigger&&(this.$gantt.$root?this._attachWheelEvent(t):this.$gantt.attachEvent("onGanttReady",function(){e._attachWheelEvent(t)})),this._initialized=!0,this.setLevel(this._activeLevelIndex))},t.prototype._mapScales=function(t){return t.map(function(t){return Array.isArray(t)?{scales:t}:t})},t.prototype._setScaleSettings=function(t,e){t?this._stepUp(e):this._stepDown(e)},t.prototype._stepUp=function(t){if(!(this._activeLevelIndex>=this._levels.length-1)){var e=this._activeLevelIndex;if(this._setScaleDates(),this._widthStep){var n=this.$gantt.config.min_column_width+this._widthStep;n>this._maxColumnWidth&&(n=this._minColumnWidth,e++),this.$gantt.config.min_column_width=n}else e++;this._setLevel(e,t)}},t.prototype._stepDown=function(t){if(!(this._activeLevelIndex<1)){var e=this._activeLevelIndex;if(this._setScaleDates(),this._widthStep){var n=this.$gantt.config.min_column_width-this._widthStep;n0&&p+v>=y+2&&(c=0),s&&!b?s=0:s<0&&!k?s=0:s>0&&k+b>=w&&(s=0);var x=t.config.autoscroll_step;x&&x<2&&(x=2),s*=x||n,c*=x||n,(s||c)&&function(e,n){var i=t.getScrollState(),r=null,a=null;e&&(r=i.x+e,r=Math.min(i.width,r),r=Math.max(0,r));n&&(a=i.y+n,a=Math.min(i.height,a),a=Math.max(0,a));t.scrollTo(r,a)}(s,c)}}function m(t,n,i){return t-e<0&&tn-e&&t>i?1:0}t.attachEvent("onGanttReady",function(){if(!r(t)){var e=i.getRootNode(t.$root)||document.body;t.eventRemove(e,"mousemove",p),t.event(e,"mousemove",p),t.eventRemove(e,"touchmove",p),t.event(e,"touchmove",p),t.eventRemove(e,"pointermove",p),t.event(e,"pointermove",p)}}),t.attachEvent("onDestroy",function(){g(!1)})}},function(t,e,n){t.exports=function(t){t.ext||(t.ext={});for(var e=[n(71),n(70),n(69)],i=0;i-1&&(n.className=n.className.slice(0,t))},200))})}},function(t,e){t.exports=function(t){t.skins.broadway={config:{grid_width:360,row_height:35,scale_height:35,link_line_width:1,link_arrow_size:7,lightbox_additional_height:86},_second_column_width:90,_third_column_width:80,_lightbox_template:"
 
",_config_buttons_left:{},_config_buttons_right:{gantt_delete_btn:"icon_delete",gantt_save_btn:"icon_save"}}}},function(t,e){t.exports=function(t){t.skins.terrace={config:{grid_width:360,row_height:35,scale_height:35,link_line_width:2,link_arrow_size:6,lightbox_additional_height:75},_second_column_width:90,_third_column_width:70}}},function(t,e){t.exports=function(t){t.skins.meadow={config:{grid_width:350,row_height:27,scale_height:30,link_line_width:2,link_arrow_size:6,lightbox_additional_height:72},_second_column_width:95,_third_column_width:80}}},function(t,e){t.exports=function(t){t.skins.skyblue={config:{grid_width:350,row_height:27,scale_height:27,link_line_width:1,link_arrow_size:8,lightbox_additional_height:75},_second_column_width:95,_third_column_width:80}}},function(t,e){function n(t,e){var n=e.skin;if(!n||t)for(var i=document.getElementsByTagName("link"),r=0;rl.width?l.min_width:l.width,l.width=l.max_width&&l.max_widthl[1]&&(t.config.grid_width=l[1]),r&&t.config.show_chart){if(a.$config.width=t.config.grid_width-1,!a.$config.scrollable&&a.$config.scrollY){var c=a.$gantt.$layout.$container.offsetWidth,u=t.$ui.getView(a.$config.scrollY).$config.width,d=c-(a.$config.width+u);d<0&&(a.$config.width+=d,t.config.grid_width+=d)}if(n)a.$parent.$config.width=t.config.grid_width,a.$parent.$config.group&&t.$layout._syncCellSizes(a.$parent.$config.group,{value:a.$parent.$config.width,isGravity:!1});else if(r&&!i.isChildOf(r.$task,e.$view)){if(!a.$config.original_grid_width){var h=t.skins[t.skin];h&&h.config&&h.config.grid_width?a.$config.original_grid_width=h.config.grid_width:a.$config.original_grid_width=0}t.config.grid_width=a.$config.original_grid_width,a.$parent.$config.width=t.config.grid_width}else a.$parent._setContentSize(a.$config.width,null),t.$layout._syncCellSizes(a.$parent.$config.group,{value:t.config.grid_width,isGravity:!1})}else r&&i.isChildOf(r.$task,e.$view)&&(a.$config.original_grid_width=t.config.grid_width),n||(a.$parent.$config.width=0)}n=!1}}),this._initScrollStateEvents(e)},_initScrollStateEvents:function(e){t._getVerticalScrollbar=this.getVerticalScrollbar,t._getHorizontalScrollbar=this.getHorizontalScrollbar;var n=this.getVerticalScrollbar(),i=this.getHorizontalScrollbar();n&&n.attachEvent("onScroll",function(e,n,i){var r=t.getScrollState();t.callEvent("onGanttScroll",[r.x,e,r.x,n])}),i&&i.attachEvent("onScroll",function(e,n,i){var r=t.getScrollState();t.callEvent("onGanttScroll",[e,r.y,n,r.y]);var a=t.$ui.getView("grid");a&&a.$grid_data&&!a.$config.scrollable&&(a.$grid_data.style.left=a.$grid.scrollLeft+"px",a.$grid_data.scrollLeft=a.$grid.scrollLeft)}),e.attachEvent("onResize",function(){n&&!t.$scroll_ver&&(t.$scroll_ver=n.$scroll_ver),i&&!t.$scroll_hor&&(t.$scroll_hor=i.$scroll_hor)})},_findGridResizer:function(t,e){for(var n,i=t.getCellsByType("resizer"),r=!0,a=0;aa.bottom&&(d.y=a.bottom-r.height-s),d.right>a.right&&(d.x=a.right-r.width-o),d}function v(t){var n=u(),i=["gantt_link_tooltip"];n.link_source_id&&n.link_target_id&&(e.isLinkAllowed(n.link_source_id,n.link_target_id,n.link_from_start,n.link_to_start)?i.push("gantt_allowed_link"):i.push("gantt_invalid_link"));var r=e.templates.drag_link_class(n.link_source_id,n.link_from_start,n.link_target_id,n.link_to_start);r&&i.push(r);var a="
"+e.templates.drag_link(n.link_source_id,n.link_from_start,n.link_target_id,n.link_to_start)+"
";t.innerHTML=a}function m(){o=s=r=null,a=!0}function y(n,i,r,a){var o=function(){_._direction&&_._direction.parentNode||(_._direction=document.createElement("div"),t.$task_links.appendChild(_._direction));return _._direction}(),s=u(),l=["gantt_link_direction"];e.templates.link_direction_class&&l.push(e.templates.link_direction_class(s.link_source_id,s.link_from_start,s.link_target_id,s.link_to_start));var c=Math.sqrt(Math.pow(r-n,2)+Math.pow(a-i,2));if(c=Math.max(0,c-3)){o.className=l.join(" ");var d=(a-i)/(r-n),h=Math.atan(d);2==k(n,r,i,a)?h+=Math.PI:3==k(n,r,i,a)&&(h-=Math.PI);var f=Math.sin(h),g=Math.cos(h),p=Math.round(i),v=Math.round(n),m=["-webkit-transform: rotate("+h+"rad)","-moz-transform: rotate("+h+"rad)","-ms-transform: rotate("+h+"rad)","-o-transform: rotate("+h+"rad)","transform: rotate("+h+"rad)","width:"+Math.round(c)+"px"];if(-1!=window.navigator.userAgent.indexOf("MSIE 8.0")){m.push('-ms-filter: "'+function(t,e){return"progid:DXImageTransform.Microsoft.Matrix(M11 = "+e+",M12 = -"+t+",M21 = "+t+",M22 = "+e+",SizingMethod = 'auto expand')"}(f,g)+'"');var y=Math.abs(Math.round(n-r)),b=Math.abs(Math.round(a-i));switch(k(n,r,i,a)){case 1:p-=b;break;case 2:v-=y,p-=b;break;case 3:v-=y}}m.push("top:"+p+"px"),m.push("left:"+v+"px"),o.style.cssText=m.join(";")}}function k(t,e,n,i){return e>=t?i<=n?1:4:i<=n?2:3}_.attachEvent("onBeforeDragStart",e.bind(function(n,r){var a=r.target||r.srcElement;if(m(),e.getState("tasksDnd").drag_id)return!1;if(i.locateClassName(a,"gantt_link_point")){i.locateClassName(a,"task_start_date")&&(s=!0);var l=e.locate(r);o=l;var c=e.getTask(l);if(e.isReadonly(c))return m(),!1;return this._dir_start=g(c,!!s,0,t.$getConfig(),!0),!0}return!1},this)),_.attachEvent("onAfterDragStart",e.bind(function(t,n){e.config.touch&&e.refreshData(),v(_.config.marker)},this)),_.attachEvent("onDragMove",e.bind(function(o,s){var l=_.config,c=p(s,l.marker);!function(t,e){t.style.left=e.x+"px",t.style.top=e.y+"px"}(l.marker,c);var u=!!i.locateClassName(s,"gantt_link_control"),d=r,h=n,f=a,m=e.locate(s),k=!0,b=i.getTargetNode(s);if(i.isChildOf(b,e.$root)||(u=!1,m=null),u&&(k=!i.locateClassName(s,"task_end_date"),u=!!m),r=m,n=u,a=k,u){var w=e.getTask(m),x=t.$getConfig(),S=i.locateClassName(s,"gantt_link_control"),$=0;S&&($=Math.floor(S.offsetWidth/2)),this._dir_end=g(w,!!a,$,x)}else this._dir_end=i.getRelativeEventPosition(s,t.$task_data),e.env.isEdge&&(this._dir_end.y+=window.scrollY);var T=!(h==u&&d==m&&f==k);return T&&(d&&e.refreshTask(d,!1),m&&e.refreshTask(m,!1)),T&&v(l.marker),y(this._dir_start.x,this._dir_start.y,this._dir_end.x,this._dir_end.y),!0},this)),_.attachEvent("onDragEnd",e.bind(function(){var t=u();if(t.link_source_id&&t.link_target_id&&t.link_source_id!=t.link_target_id){var n=e._get_link_type(t.link_from_start,t.link_to_start),i={source:t.link_source_id,target:t.link_target_id,type:n};i.type&&e.isLinkAllowed(i)&&e.callEvent("onLinkCreated",[i])&&e.addLink(i)}m(),e.config.touch?e.refreshData():(t.link_source_id&&e.refreshTask(t.link_source_id,!1),t.link_target_id&&e.refreshTask(t.link_target_id,!1)),_._direction&&(_._direction.parentNode&&_._direction.parentNode.removeChild(_._direction),_._direction=null)},this)),e.attachEvent("onGanttRender",e.bind(function(){_._direction&&y(this._dir_start.x,this._dir_start.y,this._dir_end.x,this._dir_end.y)},this))};t.exports={createLinkDND:function(){return{init:r}}}},function(t,e,n){var i=n(1),r=n(0),a=n(47),o=n(2);t.exports={createTaskDND:function(){var t;return{extend:function(e){e.roundTaskDates=function(e){t.round_task_dates(e)}},init:function(e,n){return t=function(t,e){var n=e.$services;return{drag:null,dragMultiple:{},_events:{before_start:{},before_finish:{},after_finish:{}},_handlers:{},init:function(){this._domEvents=e._createDomEventScope(),this.clear_drag_state();var t=e.config.drag_mode;this.set_actions(),n.getService("state").registerProvider("tasksDnd",r.bind(function(){return{drag_id:this.drag?this.drag.id:void 0,drag_mode:this.drag?this.drag.mode:void 0,drag_from_start:this.drag?this.drag.left:void 0}},this));var i={before_start:"onBeforeTaskDrag",before_finish:"onBeforeTaskChanged",after_finish:"onAfterTaskDrag"};for(var a in this._events)for(var o in t)this._events[a][o]=i[a];this._handlers[t.move]=this._move,this._handlers[t.resize]=this._resize,this._handlers[t.progress]=this._resize_progress},set_actions:function(){var n=t.$task_data;this._domEvents.attach(n,"mousemove",e.bind(function(t){this.on_mouse_move(t)},this)),this._domEvents.attach(n,"mousedown",e.bind(function(t){this.on_mouse_down(t)},this)),this._domEvents.attach(document.body,"mouseup",e.bind(function(t){this.on_mouse_up(t)},this))},clear_drag_state:function(){this.drag={id:null,mode:null,pos:null,start_x:null,start_y:null,obj:null,left:null},this.dragMultiple={}},_resize:function(n,i,r){var a=t.$getConfig(),o=this._drag_task_coords(n,r);r.left?(n.start_date=e.dateFromPos(o.start+i),n.start_date||(n.start_date=new Date(e.getState().min_date))):(n.end_date=e.dateFromPos(o.end+i),n.end_date||(n.end_date=new Date(e.getState().max_date)));var s=this._calculateMinDuration(a.min_duration,a.duration_unit);n.end_date-n.start_datec){var u=c-s.end;(ui||void 0===i)&&(i=d)}}return i},_move:function(t,n,i){var r=this._drag_task_coords(t,i),a=e.dateFromPos(r.start+n),o=e.dateFromPos(r.end+n);a?o?(t.start_date=a,t.end_date=o):(t.end_date=new Date(e.getState().max_date),t.start_date=e.dateFromPos(e.posFromDate(t.end_date)-(r.end-r.start))):(t.start_date=new Date(e.getState().min_date),t.end_date=e.dateFromPos(e.posFromDate(t.start_date)+(r.end-r.start)))},_drag_task_coords:function(t,n){return{start:n.obj_s_x=n.obj_s_x||e.posFromDate(t.start_date),end:n.obj_e_x=n.obj_e_x||e.posFromDate(t.end_date)}},_mouse_position_change:function(t,e){var n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},_is_number:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},on_mouse_move:function(t){if(this.drag.start_drag){var n=i.getRelativeEventPosition(t,e.$task_data),r=this.drag.start_drag.start_x,o=this.drag.start_drag.start_y;(Date.now()-this.drag.timestamp>50||this._is_number(r)&&this._is_number(o)&&this._mouse_position_change({x:r,y:o},n)>20)&&this._start_dnd(t)}if(this.drag.mode){if(!a(this,40))return;this._update_on_move(t)}},_update_item_on_move:function(t,n,i,r,a){var o=e.getTask(n),s=e.mixin({},o),l=e.mixin({},o);this._handlers[i].apply(this,[l,t,r]),e.mixin(o,l,!0),e.callEvent("onTaskDrag",[o.id,i,l,s,a]),e.mixin(o,l,!0),e.refreshTask(n)},_update_on_move:function(n){var a=this.drag,o=t.$getConfig();if(a.mode){var s=i.getRelativeEventPosition(n,t.$task_data);if(a.pos&&a.pos.x==s.x)return;a.pos=s;var l=e.dateFromPos(s.x);if(!l||isNaN(l.getTime()))return;var c=s.x-a.start_x,u=e.getTask(a.id);if(this._handlers[a.mode]){if(a.mode===o.drag_mode.move){var d={};this._isMultiselect()&&e.getSelectedTasks().indexOf(a.id)>=0&&(d=this.dragMultiple);var h=!1;if(e.isSummaryTask(u)&&e.config.drag_project){var f={};f[a.id]=r.copy(a),h=!0,d=r.mixin(f,this.dragMultiple)}var _=this._find_max_shift(d,c);for(var g in void 0!==_&&(c=_),this._update_item_on_move(c,a.id,a.mode,a,n),d){var p=d[g];h&&p.id!=a.id&&(e._bulk_dnd=!0),this._update_item_on_move(c,p.id,p.mode,p,n)}e._bulk_dnd=!1}else this._update_item_on_move(c,a.id,a.mode,a,n);e._update_parents(a.id)}}},on_mouse_down:function(n,r){if(2!=n.button||void 0===n.button){var a=t.$getConfig(),o=e.locate(n),s=null;if(e.isTaskExists(o)&&(s=e.getTask(o)),!e.isReadonly(s)&&!this.drag.mode){this.clear_drag_state(),r=r||n.target||n.srcElement;var l=i.getClassName(r),c=this._get_drag_mode(l,r);if(!l||!c)return r.parentNode?this.on_mouse_down(n,r.parentNode):void 0;if(c)if(c.mode&&c.mode!=a.drag_mode.ignore&&a["drag_"+c.mode]){if(o=e.locate(r),s=e.copy(e.getTask(o)||{}),e.isReadonly(s))return this.clear_drag_state(),!1;if(e.isSummaryTask(s)&&!a.drag_project&&c.mode!=a.drag_mode.progress)return void this.clear_drag_state();c.id=o;var u=i.getRelativeEventPosition(n,e.$task_data);c.start_x=u.x,c.start_y=u.y,c.obj=s,this.drag.start_drag=c,this.drag.timestamp=Date.now()}else this.clear_drag_state();else if(e.checkEvent("onMouseDown")&&e.callEvent("onMouseDown",[l.split(" ")[0]])&&r.parentNode)return this.on_mouse_down(n,r.parentNode)}}},_fix_dnd_scale_time:function(n,i){var r=t.$getConfig(),a=e.getScale().unit,o=e.getScale().step;function s(n){if(e.config.correct_work_time){var i=t.$getConfig();e.isWorkTime(n.start_date,void 0,n)||(n.start_date=e.calculateEndDate({start_date:n.start_date,duration:-1,unit:i.duration_unit,task:n}))}}r.round_dnd_dates||(a="minute",o=r.time_step),i.mode==r.drag_mode.resize?i.left?(n.start_date=e.roundDate({date:n.start_date,unit:a,step:o}),s(n)):(n.end_date=e.roundDate({date:n.end_date,unit:a,step:o}),function(n){if(e.config.correct_work_time){var i=t.$getConfig();e.isWorkTime(new Date(n.end_date-1),void 0,n)||(n.end_date=e.calculateEndDate({start_date:n.end_date,duration:1,unit:i.duration_unit,task:n}))}}(n)):i.mode==r.drag_mode.move&&(n.start_date=e.roundDate({date:n.start_date,unit:a,step:o}),s(n),n.end_date=e.calculateEndDate(n))},_fix_working_times:function(n,i){var r=t.$getConfig();(i=i||{mode:r.drag_mode.move}).mode==r.drag_mode.resize?i.left?n.start_date=e.getClosestWorkTime({date:n.start_date,dir:"future",task:n}):n.end_date=e.getClosestWorkTime({date:n.end_date,dir:"past",task:n}):i.mode==r.drag_mode.move&&e.correctTaskWorkTime(n)},_finalize_mouse_up:function(t,n,i,r){var a=e.getTask(t);if(n.work_time&&n.correct_work_time&&this._fix_working_times(a,i),this._fix_dnd_scale_time(a,i),this._fireEvent("before_finish",i.mode,[t,i.mode,e.copy(i.obj),r])){var o=t;e._init_task_timing(a),this.clear_drag_state(),e.updateTask(a.id),this._fireEvent("after_finish",i.mode,[o,i.mode,r])}else this.clear_drag_state(),t==i.id&&(i.obj._dhx_changed=!1,e.mixin(a,i.obj,!0)),e.refreshTask(a.id)},on_mouse_up:function(n){var i=this.drag;if(i.mode&&i.id){var r=t.$getConfig(),a=e.getTask(i.id),o=this.dragMultiple,s=!1,l=0;i.mode===r.drag_mode.move&&(e.isSummaryTask(a)&&r.drag_project||this._isMultiselect())&&(s=!0,l=Object.keys(o).length);var c=function(){if(s)for(var t in o)this._finalize_mouse_up(o[t].id,r,o[t],n);this._finalize_mouse_up(i.id,r,i,n)};s&&l>10?e.batchUpdate(function(){c.call(this)}.bind(this)):c.call(this)}this.clear_drag_state()},_get_drag_mode:function(e,n){var i=t.$getConfig().drag_mode,r={mode:null,left:null};switch((e||"").split(" ")[0]){case"gantt_task_line":case"gantt_task_content":r.mode=i.move;break;case"gantt_task_drag":r.mode=i.resize;var a=n.getAttribute("data-bind-property");r.left="start_date"==a;break;case"gantt_task_progress_drag":r.mode=i.progress;break;case"gantt_link_control":case"gantt_link_point":r.mode=i.ignore;break;default:r=null}return r},_start_dnd:function(n){var i=this.drag=this.drag.start_drag;delete i.start_drag;var r=t.$getConfig(),a=i.id;if(r["drag_"+i.mode]&&e.callEvent("onBeforeDrag",[a,i.mode,n])&&this._fireEvent("before_start",i.mode,[a,i.mode,n])){delete i.start_drag;var s=e.getTask(a);if(e.isReadonly(s))return void this.clear_drag_state();if(this._isMultiselect()){var l=e.getSelectedTasks();l.indexOf(i.id)>=0&&o.forEach(l,e.bind(function(t){var n=e.getTask(t);e.isSummaryTask(n)&&e.config.drag_project&&i.mode==r.drag_mode.move&&this._addSubtasksToDragMultiple(n.id),this.dragMultiple[t]=e.mixin({id:n.id,obj:e.copy(n)},this.drag)},this))}e.isSummaryTask(s)&&e.config.drag_project&&i.mode==r.drag_mode.move&&this._addSubtasksToDragMultiple(s.id),e.callEvent("onTaskDragStart",[])}else this.clear_drag_state()},_fireEvent:function(t,n,i){e.assert(this._events[t],"Invalid stage:{"+t+"}");var r=this._events[t][n];return e.assert(r,"Unknown after drop mode:{"+n+"}"),e.assert(i,"Invalid event arguments"),!e.checkEvent(r)||e.callEvent(r,i)},round_task_dates:function(e){var n=this.drag,i=t.$getConfig();n||(n={mode:i.drag_mode.move}),this._fix_dnd_scale_time(e,n)},destructor:function(){this._domEvents.detachAll()},_isMultiselect:function(){return e.config.drag_multiple&&!!(e.getSelectedTasks&&e.getSelectedTasks().length>0)},_addSubtasksToDragMultiple:function(t){e.eachTask(function(t){this.dragMultiple[t.id]=e.mixin({id:t.id,obj:e.copy(t)},this.drag)},t,this)}}}(e,n),e._tasks_dnd=t,t.init(n)},destructor:function(){t&&(t.destructor(),t=null)}}}}},function(t,e,n){var i=n(0),r=n(85),a=n(84),o=n(1),s=function(t){var e=t.$services;return{onCreated:function(e){var o=e.$config;o.bind=i.defined(o.bind)?o.bind:"task",o.bindLinks=i.defined(o.bindLinks)?o.bindLinks:"link",e._linksDnD=a.createLinkDND(),e._tasksDnD=r.createTaskDND(),e._tasksDnD.extend(e),this._mouseDelegates=n(26)(t)},onInitialized:function(e){this._attachDomEvents(t),this._attachStateProvider(t,e),e._tasksDnD.init(e,t),e._linksDnD.init(e,t),"timeline"==e.$config.id&&this.extendDom(e)},onDestroyed:function(e){this._clearDomEvents(t),this._clearStateProvider(t),e._tasksDnD&&e._tasksDnD.destructor()},extendDom:function(e){t.$task=e.$task,t.$task_scale=e.$task_scale,t.$task_data=e.$task_data,t.$task_bg=e.$task_bg,t.$task_links=e.$task_links,t.$task_bars=e.$task_bars},_clearDomEvents:function(){this._mouseDelegates.destructor(),this._mouseDelegates=null},_attachDomEvents:function(t){function e(e,n){if(e&&this.callEvent("onLinkDblClick",[e,n])){var i=this.getLink(e);if(this.isReadonly(i))return;var r=this.locale.labels.link+" "+this.templates.link_description(this.getLink(e))+" "+this.locale.labels.confirm_link_deleting;window.setTimeout(function(){t._dhtmlx_confirm(r,"",function(){t.deleteLink(e)})},this.config.touch?300:1)}}this._mouseDelegates.delegate("click","gantt_task_link",t.bind(function(t,e){var n=this.locate(t,this.config.link_attribute);n&&this.callEvent("onLinkClick",[n,t])},t),this.$task),this._mouseDelegates.delegate("click","gantt_scale_cell",t.bind(function(e,n){var i=o.getRelativeEventPosition(e,t.$task_data),r=t.dateFromPos(i.x),a=Math.floor(t.columnIndexByDate(r)),s=t.getScale().trace_x[a];t.callEvent("onScaleClick",[e,s])},t),this.$task),this._mouseDelegates.delegate("doubleclick","gantt_task_link",t.bind(function(n,i,r){i=this.locate(n,t.config.link_attribute),e.call(this,i,n)},t),this.$task),this._mouseDelegates.delegate("doubleclick","gantt_link_point",t.bind(function(t,n,i){n=this.locate(t);var r=this.getTask(n),a=null;return i.parentNode&&o.getClassName(i.parentNode)&&(a=o.getClassName(i.parentNode).indexOf("_left")>-1?r.$target[0]:r.$source[0]),a&&e.call(this,a,t),!1},t),this.$task)},_attachStateProvider:function(t,n){var i=n;e.getService("state").registerProvider("tasksTimeline",function(){return{scale_unit:i._tasks?i._tasks.unit:void 0,scale_step:i._tasks?i._tasks.step:void 0}})},_clearStateProvider:function(){e.getService("state").unregisterProvider("tasksTimeline")}}};t.exports=s},function(t,e,n){var i=n(1);function r(t,e){var n=i.getNodePosition(e.$grid_data);return t.x+=n.x-e.$grid.scrollLeft,t.y+=n.y-e.$grid_data.scrollTop,t}t.exports={removeLineHighlight:function(t){t.markerLine&&t.markerLine.parentNode&&t.markerLine.parentNode.removeChild(t.markerLine),t.markerLine=null},highlightPosition:function(t,e,n){var a=function(t,e){var n=i.getNodePosition(e.$grid_data),r=i.getRelativeEventPosition(t,e.$grid_data),a=n.x,o=r.y-10,s=e.getItemHeight(t.targetId);on.y+l-s&&(o=n.y+l-s),n.x=a,n.y=o,n}(t,n);e.marker.style.left=a.x+9+"px",e.marker.style.top=a.y+"px";var o=e.markerLine;o||((o=document.createElement("div")).className="gantt_drag_marker gantt_grid_dnd_marker",o.innerHTML="
",o.style.pointerEvents="none"),t.child?function(t,e,n){var i=t.targetParent,a=r({x:0,y:n.getItemTop(i)},n),o=n.$grid_data.getBoundingClientRect().bottom;e.innerHTML="
",e.style.width=n.$grid_data.offsetWidth+"px",e.style.top=a.y+"px",e.style.left=a.x+"px",e.style.height=n.getItemHeight(i)+"px",a.y>o&&(e.style.top=o+"px")}(t,o,n):function(t,e,n){var i=function(t,e){var n=e.$config.rowStore,i={x:0,y:0},a=e.$grid_data.querySelector(".gantt_tree_indent"),o=15,s=0;if(a&&(o=a.offsetWidth),t.targetId!==n.$getRootId()){var l=e.getItemTop(t.targetId),c=e.getItemHeight(t.targetId);if(s=n.exists(t.targetId)?n.calculateItemLevel(n.getItem(t.targetId)):0,t.prevSibling)i.y=l;else if(t.nextSibling){var u=0;n.eachItem(function(t){-1!==n.getIndexById(t.id)&&u++},t.targetId),i.y=l+c+u*c}else i.y=l+c,s+=1}return i.x=40+s*o,i.width=Math.max(e.$grid_data.offsetWidth-i.x,0),r(i,e)}(t,n),a=n.$grid_data.getBoundingClientRect().bottom;e.innerHTML="
",e.style.left=i.x+"px",e.style.height="4px";var o=i.y-2;e.style.top=o+"px",e.style.width=i.width+"px",o>a&&(e.style.top=a+"px")}(t,o,n),e.markerLine||(document.body.appendChild(o),e.markerLine=o)}}},function(t,e,n){var i=n(18);t.exports=function(t,e,n,r,a){var o;if(e!==a.$getRootId())o=n<.25?i.prevSiblingTarget(t,e,a):!(n>.6)||a.hasChild(e)&&a.getItem(e).$open?i.firstChildTarget(t,e,a):i.nextSiblingTarget(t,e,a);else{var s=a.$getRootId();o=a.hasChild(s)&&r>=0?i.lastChildTarget(t,s,a):i.firstChildTarget(t,s,a)}return o}},function(t,e,n){var i=n(18);function r(t,e,n,r,a){for(var o=e;r.exists(o);){var s=r.calculateItemLevel(r.getItem(o));if((s===n||s===n-1)&&r.getBranchIndex(o)>-1)break;o=a?r.getPrev(o):r.getNext(o)}return r.exists(o)?r.calculateItemLevel(r.getItem(o))===n?a?i.nextSiblingTarget(t,o,r):i.prevSiblingTarget(t,o,r):i.firstChildTarget(t,o,r):null}function a(t,e,n,i){return r(t,e,n,i,!0)}function o(t,e,n,i){return r(t,e,n,i,!1)}t.exports=function(t,e,n,r,s,l){var c;if(e!==s.$getRootId()){var u=s.getItem(e),d=s.calculateItemLevel(u);if(d===l){var h=s.getPrevSibling(e);n<.5&&!h?c=i.prevSiblingTarget(t,e,s):(n<.5&&(e=h),c=i.nextSiblingTarget(t,e,s))}else if(d>l)s.eachParent(function(t){s.calculateItemLevel(t)===l&&(e=t.id)},u),c=a(t,e,l,s);else{var f=a(t,e,l,s),_=o(t,e,l,s);c=n<.5?f:_}}else{var g=s.$getRootId(),p=s.getChildren(g);c=i.createDropTargetObject(),c=p.length&&r>=0?a(t,function(t){for(var e=t.getNext();t.exists(e);){var n=t.getNext(e);if(!t.exists(n))return e;e=n}return null}(s),l,s):o(t,g,l,s)}return c}},function(t,e,n){var i=n(1),r=n(18),a=n(89),o=n(88),s=n(87),l=n(11);t.exports={init:function(t,e){var n=t.$services.getService("dnd");if(e.$config.bind&&t.getDatastore(e.$config.bind)){var c=new n(e.$grid_data,{updates_per_second:60});t.defined(e.$getConfig().dnd_sensitivity)&&(c.config.sensitivity=e.$getConfig().dnd_sensitivity),c.attachEvent("onBeforeDragStart",t.bind(function(n,r){var a=u(r);if(!a)return!1;if(t.hideQuickInfo&&t._hideQuickInfo(),i.closest(r.target,".gantt_grid_editor_placeholder"))return!1;var o=a.getAttribute(e.$config.item_attribute),s=e.$config.rowStore.getItem(o);return!t.isReadonly(s)&&!d(o)&&(c.config.initial_open_state=s.$open,!!t.callEvent("onRowDragStart",[o,r.target||r.srcElement,r])&&void 0)},t)),c.attachEvent("onAfterDragStart",t.bind(function(t,n){var i=u(n);c.config.marker.innerHTML=i.outerHTML;var a=c.config.marker.firstChild;a&&(c.config.marker.style.opacity=.4,a.style.position="static",a.style.pointerEvents="none"),c.config.id=i.getAttribute(e.$config.item_attribute);var o=e.$config.rowStore,s=o.getItem(c.config.id);c.config.level=o.calculateItemLevel(s),c.config.drop_target=r.createDropTargetObject({targetParent:o.getParent(s.id),targetIndex:o.getBranchIndex(s.id),targetId:s.id,nextSibling:!0}),s.$open=!1,s.$transparent=!0,this.refreshData()},t)),c.attachEvent("onDragMove",t.bind(function(n,i){var a=h(i);return a&&!1!==t.callEvent("onBeforeRowDragMove",[c.config.id,a.targetParent,a.targetIndex])||(a=r.createDropTargetObject(c.config.drop_target)),s.highlightPosition(a,c.config,e),c.config.drop_target=a,this.callEvent("onRowDragMove",[c.config.id,a.targetParent,a.targetIndex]),!0},t)),c.attachEvent("onDragEnd",t.bind(function(){var n=e.$config.rowStore,i=n.getItem(c.config.id);s.removeLineHighlight(c.config),i.$transparent=!1,i.$open=c.config.initial_open_state;var r=c.config.drop_target;!1===this.callEvent("onBeforeRowDragEnd",[c.config.id,r.targetParent,r.targetIndex])?i.$drop_target=null:(n.move(c.config.id,r.targetIndex,r.targetParent),t.render(),this.callEvent("onRowDragEnd",[c.config.id,r.targetParent,r.targetIndex])),n.refresh(i.id)},t))}function u(t){return i.locateAttribute(t,e.$config.item_attribute)}function d(n){return l(n,t,t.getDatastore(e.$config.bind))}function h(n){var r,s=function(n){var r=i.getRelativeEventPosition(n,e.$grid_data).y,a=e.$config.rowStore;r=r||0;var o=e.$state.scrollTop||0,s=t.$grid_data.getBoundingClientRect().height+o,l=o,c=e.getItemIndexByTopPosition(e.$state.scrollTop);if(a.exists(c)||(c=a.countVisible()-1),c<0)return a.$getRootId();var u=a.getIdByIndex(c),h=e.$state.scrollTop/e.getItemHeight(u),f=h-Math.floor(h);f>.1&&f<.9&&(s-=e.getItemHeight(u)*f,l+=e.getItemHeight(u)*(1-f)),r>=s?r=s:r<=l&&(r=l);var _=e.getItemIndexByTopPosition(r);if(_>a.countVisible()-1||_<0)return a.$getRootId();var g=a.getIdByIndex(_);return d(g)?a.getPrevSibling(g):a.getIdByIndex(_)}(n),l=null,u=e.$config.rowStore,h=!e.$getConfig().order_branch_free,f=i.getRelativeEventPosition(n,e.$grid_data).y;return s!==u.$getRootId()&&(l=(f-e.getItemTop(s))/e.getItemHeight(s)),h?(r=a(c.config.id,s,l,f,u,c.config.level))&&r.targetParent&&d(r.targetParent)&&(s=u.getPrevSibling(r.targetParent),r=a(c.config.id,s,l,f,u,c.config.level)):r=o(c.config.id,s,l,f,u),r}}}},function(t,e,n){var i=n(1),r=n(11);t.exports={init:function(t,e){var n=t.$services.getService("dnd");if(e.$config.bind&&t.getDatastore(e.$config.bind)){var a=new n(e.$grid_data,{updates_per_second:60});t.defined(e.$getConfig().dnd_sensitivity)&&(a.config.sensitivity=e.$getConfig().dnd_sensitivity),a.attachEvent("onBeforeDragStart",t.bind(function(n,r){var c=o(r);if(!c)return!1;if(t.hideQuickInfo&&t._hideQuickInfo(),i.closest(r.target,".gantt_grid_editor_placeholder"))return!1;var u=c.getAttribute(e.$config.item_attribute);if(l(u))return!1;var d=s().getItem(u);return!t.isReadonly(d)&&(a.config.initial_open_state=d.$open,!!t.callEvent("onRowDragStart",[u,r.target||r.srcElement,r])&&void 0)},t)),a.attachEvent("onAfterDragStart",t.bind(function(t,n){var i=o(n);a.config.marker.innerHTML=i.outerHTML;var r=a.config.marker.firstChild;r&&(r.style.position="static"),a.config.id=i.getAttribute(e.$config.item_attribute);var l=s(),c=l.getItem(a.config.id);a.config.index=l.getBranchIndex(a.config.id),a.config.parent=c.parent,c.$open=!1,c.$transparent=!0,this.refreshData()},t)),a.lastTaskOfLevel=function(t){for(var e=null,n=s().getItems(),i=0,r=n.length;in.y+l-s&&(o=n.y+l-s),n.x=r,n.y=o,n},t),a._getTargetY=t.bind(function(n){var r=i.getNodePosition(e.$grid_data),a=e.$state.scrollTop||0,o=t.$grid_data.getBoundingClientRect().height+a,s=n.pageY-r.y+a;return s>o?s=o:si.countVisible()-1?null:i.getIdByIndex(r)},t),a.attachEvent("onDragMove",t.bind(function(n,i){var r=t.$grid_data.getBoundingClientRect().height+(e.$state.scrollTop||0),o=a.config,c=a._getGridPos(i),u=e.$getConfig(),d=s();c.y=0;)w=d.getIdByIndex(y-S),x=d.getItem(w),S++;if(h.id==p.id||l(p.id))return;g(p,h)&&h.id!=p.id?d.move(h.id,0,0,p.id):p.$level!=h.$level-1||d.getChildren(p.id).length?x&&g(x,h)&&h.id!=x.id&&d.move(h.id,-1,d.getParent(x.id)):d.move(h.id,0,p.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(91),a=n(90),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(26)(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(21),r=n(6),a=n(20),o=n(19),s=n(32);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 w=g[b];if(w&&(!y||o(b,h,l,t))){var x=c.histogram_cell_capacity(w.start_date,w.end_date,i,w.tasks,w.assignments);v[w.start_date.valueOf()]=x||0;var S=r.getItemPosition(i,w.start_date,w.end_date),$=_(i,S,m,0,c,w,r);$&&(p.push($),n[i.id][b]=$)}}var T=null;if(p.length){T=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)}if(p=t.getGlobalTaskIndex(e.id)%2==0?"":" odd",p+=e.$transparent?" gantt_transparent":"",p+=e.$dataprocessor_class?" "+e.$dataprocessor_class:"",s.grid_row_class){var w=s.grid_row_class.call(t,e.start_date,e.end_date,e);w&&(p+=" "+w)}l.isSelected(e.id)&&(p+=" gantt_selected");var x=document.createElement("div");x.className="gantt_row"+p+" gantt_row_"+t.getTaskType(e.type);var S=n.getItemHeight(e.id);return x.style.height=S+"px",x.style.lineHeight=S+"px",i.smart_rendering&&(x.style.position="absolute",x.style.left="0px",x.style.top=n.getItemTop(e.id)+"px"),n.$config.item_attribute&&(x.setAttribute(n.$config.item_attribute,e.id),x.setAttribute(n.$config.bind+"_id",e.id)),t._waiAria.taskRowAttr(e,x),x.innerHTML=c.join(""),x},update:null,getRectangle:a,getVisibleRange:o,onrender:function(e,n,r){for(var a=r.getGridColumns(),o=0;os+l&&e.y>c+u)return!1;if(e.y_endh){var g=h;h=d,d=g}if(f>_){g=_;_=f,f=g}return d+=-100,h+=100,f+=-100,_+=100,!(e.x>h&&e.x>_)&&!(e.x_endt.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 a=e.$getConfig(),o=this.get_line_type(t,a),s=o.from_start,l=o.to_start,c=r(n,e,a),u=r(i,e,a);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 r(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;gg.end)&&c(t.id,v)}n[t.id]={};for(var m=g.start;m<=g.end;m++){var y=d(h,m,t,s,f,_,a);!y&&l(t,m)?c(t.id,m):y&&!y.parentNode&&i.appendChild(y)}}},getRectangle:i,getVisibleRange:a}}},function(t,e,n){var i=n(22),r=n(23),a=n(6);t.exports=function(t){var e=i(t);return{render:function(n,i){if(n.$rollup&&n.$rollup.length){var r=document.createElement("div"),a=t.getTaskPosition(n);return n.$rollup.forEach(function(o){var s=t.getTask(o),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"),r.appendChild(l)}}),r}return!1},update:null,isInViewPort:r,getVisibleRange:a}}},function(t,e,n){var i=n(23);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(22),r=n(101),a=n(6);t.exports=function(t){var e=i(t);return{render:function(n,i){if(t.isSplitTask(n)&&(t.config.open_split_tasks&&!n.$open||!t.config.open_split_tasks)){var r=document.createElement("div"),a=t.getTaskPosition(n);return t.hasChild(n.id)&&t.eachTask(function(o){var s=t.isSummaryTask(o);if(s&&t.resetProjectDates(o),!o.hide_bar){var l=e(o,i);if(l){var c=i.getBarHeight(n.id,o.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_split_child"),s&&l.classList.add("gantt_split_subproject"),r.appendChild(l)}}},n.id),r}return!1},update:null,isInViewPort:r,getVisibleRange:a}}},function(t,e,n){var i=n(23),r=n(6),a=n(22);t.exports=function(t){return{render:a(t),update:null,isInViewPort:i,getVisibleRange:r}}},function(t,e){t.exports=function(t){return function(e,n,i){"keepDates"==i?function(e,n){"duration"==n?e.end_date=t.calculateEndDate(e):"end_date"!=n&&"start_date"!=n||(e.duration=t.calculateDuration(e))}(e,n):"keepDuration"==i?function(e,n){"end_date"==n?e.start_date=t.calculateEndDate({start_date:e.end_date,duration:-e.duration,task:e}):"start_date"!=n&&"duration"!=n||(e.end_date=t.calculateEndDate(e))}(e,n):function(e,n){"start_date"==n||"duration"==n?e.end_date=t.calculateEndDate(e):"end_date"==n&&(e.duration=t.calculateDuration(e))}(e,n)}}},function(t,e,n){t.exports=function(t){var e=n(8)(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(8)(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(8)(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(8)(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(8)(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(8)(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(112),r=n(111);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(113),r=n(110),a=n(109),o=n(108),s=n(107),l=n(106),c=n(105),u=n(0),d=n(1),h=n(4),f=n(104);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(33),a=n(24),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(24),o=n(27),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(7),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(9));t.exports=s},function(t,e,n){var i=n(3),r=n(1),a=n(0),o=n(9),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(9));t.exports=a},function(t,e,n){var i=n(3),r=n(35),a=n(9),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){var r=t._waiAria.messageButtonAttrString(e),a=n.toLowerCase().replace(/ /g,"_");return"
"+e+"
"}function d(e){k.area||(k.area=document.createElement("div"),k.area.className="gantt_message_area dhtmlx_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 dhtmlx-info gantt-"+e.type+" dhtmlx-"+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'+s.title+""),_+='
'+(s.content?"":s.text)+'
',l&&(_+=u(h(s.ok,t.locale.labels.message_ok,"OK"),"ok",!0)),c&&(_+=u(h(s.cancel,t.locale.labels.message_cancel,"Cancel"),"cancel",!1)),s.buttons)for(var g=0;g",d.innerHTML=_,s.content){var v=s.content;"string"==typeof v&&(v=document.getElementById(v)),"none"==v.style.display&&(v.style.display=""),d.childNodes[s.title?1:0].appendChild(v)}return d.onclick=function(t){var e=t.target||t.srcElement;if(e.className||(e=e.parentNode),a.closest(e,".gantt_popup_button")){var n=e.getAttribute("data-result");o(s,n="true"==n||"false"!=n&&n)}},s.box=d,(l||c)&&(n=s),d}(l,d,f);l.hidden||c(!0),document.body.appendChild(_);var g=Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-_.offsetWidth)/2)),p=Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-_.offsetHeight)/2));return"top"==l.position?_.style.top="-3px":_.style.top=p+"px",_.style.left=g+"px",_.onkeydown=s,y.focus(_),l.hidden&&y.hide(_),t.callEvent("onMessagePopup",[_]),_}function _(t){return f(t,!0,!1)}function g(t){return f(t,!0,!0)}function p(t){return f(t)}function v(t,e,n){return"object"!=i(t)&&("function"==typeof e&&(n=e,e=""),t={text:t,type:e,callback:n}),t}function m(t,e,n,a){return"object"!=i(t)&&(t={text:t,type:e,expire:n,id:a}),t.id=t.id||r.uid(),t.expire=t.expire||k.expire,t}t.event(l,"keydown",s,!0);var y=function(){var t=v.apply(this,arguments);return t.type=t.type||"alert",p(t)};y.hide=function(n){for(;n&&n.getAttribute&&!n.getAttribute(e);)n=n.parentNode;n&&(n.parentNode.removeChild(n),c(!1),t.callEvent("onAfterMessagePopup",[n]))},y.focus=function(t){setTimeout(function(){var e=a.getFocusableNodes(t);e.length&&e[0].focus&&e[0].focus()},1)};var k=function(t,e,n,i){switch((t=m.apply(this,arguments)).type=t.type||"info",t.type.split("-")[0]){case"alert":return _(t);case"confirm":return g(t);case"modalbox":return p(t);default:return d(t)}};k.seed=(new Date).valueOf(),k.uid=r.uid,k.expire=4e3,k.keyboard=!0,k.position="top",k.pull={},k.timers={},k.hideAll=function(){for(var t in k.pull)k.hide(t)},k.hide=function(t){var e=k.pull[t];e&&e.parentNode&&(window.setTimeout(function(){e.parentNode.removeChild(e),e=null},2e3),e.className+=" hidden",k.timers[t]&&window.clearTimeout(k.timers[t]),delete k.pull[t])};var b=[];return t.attachEvent("onMessagePopup",function(t){b.push(t)}),t.attachEvent("onAfterMessagePopup",function(t){for(var e=0;e3600&&o<86400){var s=e.getTimezoneOffset()-n;s&&(e=t.date.add(e,s,"minute"))}return e},t.isSplitTask=function(e){return t.assert(e&&e instanceof Object,"Invalid argument task="+e+" of gantt.isSplitTask. Task object was expected"),this.$data.tasksStore._isSplitItem(e)},t._is_icon_open_click=function(t){if(!t)return!1;var e=t.target||t.srcElement;if(!e||!e.className)return!1;var n=r.getClassName(e);return-1!==n.indexOf("gantt_tree_icon")&&(-1!==n.indexOf("gantt_close")||-1!==n.indexOf("gantt_open"))}}},function(t,e){t.exports=function(t){function e(){return t._cached_functions.update_if_changed(t),t._cached_functions.active||t._cached_functions.activate(),!0}t._cached_functions={cache:{},mode:!1,critical_path_mode:!1,wrap_methods:function(t,e){if(e._prefetch_originals)for(var n in e._prefetch_originals)e[n]=e._prefetch_originals[n];e._prefetch_originals={};for(n=0;ntask="+e+" of gantt.isUnscheduledTask. Task object was expected"),!!e.unscheduled||!e.start_date},t._isAllowedUnscheduledTask=function(e){return!(!e.unscheduled||!t.config.show_unscheduled)},t._isTaskInTimelineLimits=function(t){var e=t.start_date?t.start_date.valueOf():null,n=t.end_date?t.end_date.valueOf():null;return!!(e&&n&&e<=this._max_date.valueOf()&&n>=this._min_date.valueOf())},t.isTaskVisible=function(t){if(!this.isTaskExists(t))return!1;var e=this.getTask(t);return!(!this._isAllowedUnscheduledTask(e)&&!this._isTaskInTimelineLimits(e))&&!!(this.getGlobalTaskIndex(t)>=0)},t._getProjectEnd=function(){if(t.config.project_end)return t.config.project_end;var e=t.getTaskByTime();return(e=e.sort(function(t,e){return+t.end_date>+e.end_date?1:-1})).length?e[e.length-1].end_date:null},t._getProjectStart=function(){if(t.config.project_start)return t.config.project_start;if(t.config.start_date)return t.config.start_date;if(t.getState().min_date)return t.getState().min_date;var e=t.getTaskByTime();return(e=e.sort(function(t,e){return+t.start_date>+e.start_date?1:-1})).length?e[0].start_date:null};var e=function(e,n){var i=!(!n||n==t.config.root_id)&&t.getTask(n),r=null;if(i)r=t.config.schedule_from_end?t.calculateEndDate({start_date:i.end_date,duration:-t.config.duration_step,task:e}):i.start_date;else if(t.config.schedule_from_end)r=t.calculateEndDate({start_date:t._getProjectEnd(),duration:-t.config.duration_step,task:e});else{var a=t.getTaskByIndex(0);r=a?a.start_date?a.start_date:a.end_date?t.calculateEndDate({start_date:a.end_date,duration:-t.config.duration_step,task:e}):null:t.config.start_date||t.getState().min_date}return t.assert(r,"Invalid dates"),new Date(r)};t._set_default_task_timing=function(n){n.start_date=n.start_date||e(n,t.getParent(n)),n.duration=n.duration||t.config.duration_step,n.end_date=n.end_date||t.calculateEndDate(n)},t.createTask=function(n,i,r){(n=n||{},t.defined(n.id)||(n.id=t.uid()),n.start_date||(n.start_date=e(n,i)),void 0===n.text&&(n.text=t.locale.labels.new_task),void 0===n.duration&&(n.duration=1),this.isTaskExists(i))&&(this.setParent(n,i,!0),this.getTask(i).$open=!0);if(!this.callEvent("onTaskCreated",[n]))return null;if(this.config.details_on_create){if(t.isTaskExists(n.id))t.getTask(n.id).$index!=n.$index&&(n.start_date&&"string"==typeof n.start_date&&(n.start_date=this.date.parseDate(n.start_date,"parse_date")),n.end_date&&"string"==typeof n.end_date&&(n.end_date=this.date.parseDate(n.end_date,"parse_date")),this.$data.tasksStore.updateItem(n.id,n));else n.$new=!0,this.silent(function(){t.$data.tasksStore.addItem(n,r)});this.selectTask(n.id),this.refreshData(),this.showLightbox(n.id)}else this.addTask(n,i,r)&&(this.showTask(n.id),this.selectTask(n.id));return n.id},t._update_flags=function(e,n){var i=t.$data.tasksStore;void 0===e?(this._lightbox_id=null,i.silent(function(){i.unselect()}),this._tasks_dnd&&this._tasks_dnd.drag&&(this._tasks_dnd.drag.id=null)):(this._lightbox_id==e&&(this._lightbox_id=n),i.getSelectedId()==e&&i.silent(function(){i.unselect(e),i.select(n)}),this._tasks_dnd&&this._tasks_dnd.drag&&this._tasks_dnd.drag.id==e&&(this._tasks_dnd.drag.id=n))};var n=function(e,n){var i=t.getTaskType(e.type),r={type:i,$no_start:!1,$no_end:!1};return n||i!=e.$rendered_type?(i==t.config.types.project?r.$no_end=r.$no_start=!0:i!=t.config.types.milestone&&(r.$no_end=!(e.end_date||e.duration),r.$no_start=!e.start_date,t._isAllowedUnscheduledTask(e)&&(r.$no_end=r.$no_start=!1)),r):(r.$no_start=e.$no_start,r.$no_end=e.$no_end,r)};function r(e){e.$effective_calendar=t.getTaskCalendar(e).id,e.start_date=t.getClosestWorkTime({dir:"future",date:e.start_date,unit:t.config.duration_unit,task:e}),e.end_date=t.calculateEndDate(e)}function a(e){var n=null,i=null,r=void 0!==e?e:t.config.root_id,a=[];return t.eachTask(function(e){t.getTaskType(e.type)==t.config.types.project||t.isUnscheduledTask(e)||(e.rollup&&a.push(e.id),e.start_date&&!e.$no_start&&(!n||n>e.start_date.valueOf())&&(n=e.start_date.valueOf()),e.end_date&&!e.$no_end&&(!i||itask="+e+" of gantt.isSummaryTask. Task object was expected");var i=n(e);return!(!i.$no_end&&!i.$no_start)},t.resetProjectDates=function(t){var i=n(t);if(i.$no_end||i.$no_start){var r=a(t.id);(function(t,n,i,r){n.$no_start&&(t.start_date=i?new Date(i):e(t,this.getParent(t)));n.$no_end&&(t.end_date=r?new Date(r):this.calculateEndDate({start_date:t.start_date,duration:this.config.duration_step,task:t}));(n.$no_start||n.$no_end)&&this._init_task_timing(t)}).call(this,t,i,r.start_date,r.end_date),t.$rollup=r.rollup}},t.getSubtaskDuration=function(e){var n=0,i=void 0!==e?e:t.config.root_id;return this.eachTask(function(e){this.getTaskType(e.type)==t.config.types.project||this.isUnscheduledTask(e)||(n+=e.duration)},i),n},t.getSubtaskDates=function(t){var e=a(t);return{start_date:e.start_date,end_date:e.end_date}},t._update_parents=function(e,i,r){if(e){var a=this.getTask(e);a.rollup&&(r=!0);var o=this.getParent(a),s=n(a),l=!0;if(r||a.start_date&&a.end_date&&(s.$no_start||s.$no_end)){var c=a.start_date.valueOf(),u=a.end_date.valueOf();t.resetProjectDates(a),r||c!=a.start_date.valueOf()||u!=a.end_date.valueOf()||(l=!1),l&&!i&&this.refreshTask(a.id,!0)}l&&o&&this.isTaskExists(o)&&this._update_parents(o,i,r)}},t.roundDate=function(e){var n=t.getScale();i.isDate(e)&&(e={date:e,unit:n?n.unit:t.config.duration_unit,step:n?n.step:t.config.duration_step});var r,a,o,s=e.date,l=e.step,c=e.unit;if(!n)return s;if(c==n.unit&&l==n.step&&+s>=+n.min_date&&+s<=+n.max_date)o=Math.floor(t.columnIndexByDate(s)),n.trace_x[o]||(o-=1,n.rtl&&(o=0)),a=new Date(n.trace_x[o]),r=t.date.add(a,l,c);else{for(o=Math.floor(t.columnIndexByDate(s)),r=t.date[c+"_start"](new Date(n.min_date)),n.trace_x[o]&&(r=t.date[c+"_start"](n.trace_x[o]));+r<+s;){var u=(r=t.date[c+"_start"](t.date.add(r,l,c))).getTimezoneOffset();r=t._correct_dst_change(r,u,r,c),t.date[c+"_start"]&&(r=t.date[c+"_start"](r))}a=t.date.add(r,-1*l,c)}return e.dir&&"future"==e.dir?r:e.dir&&"past"==e.dir?a:Math.abs(s-a)1e6&&this._resetTimestampCache();var e=null;if(t.day||0===t.day)e=t.day;else if(t.date){var n=String(t.date.valueOf());this._cached_timestamps[n]?e=this._cached_timestamps[n]:(e=Date.UTC(t.date.getFullYear(),t.date.getMonth(),t.date.getDate()),this._cached_timestamps[n]=e,this._cached_timestamps_count++)}return e},_checkIfWorkingUnit:function(t,e){return!this["_is_work_"+e]||this["_is_work_"+e](t)},_is_work_day:function(t){var e=this._getWorkHours(t);return!!Array.isArray(e)&&e.length>0},_is_work_hour:function(t){for(var e=this._getWorkHours(t),n=t.getHours(),i=0;i=e[i].startHour&&n=e[i].start&&no.valueOf(),this._isWorkTime(a,n))(d||h&&f)&&(s=r[n+"_start"](new Date(a)),l=r.add(s,i,n)),d?(d=!1,u=this._nextDate(s,n,i),c+=(l.valueOf()-a.valueOf())/(l.valueOf()-s.valueOf())):h&&f?(h=!1,c+=(o.valueOf()-a.valueOf())/(l.valueOf()-s.valueOf())):c++;else{var _=this._getUnitOrder(n),g=this.units[_-1];g&&!this._isWorkTime(a,g)&&(u=this._getClosestWorkTimeFuture(a,g))}a=u}return c},_getMinutesPerHour:function(t){var e=this._getTimeOfDayStamp(t),n=this._getTimeOfDayStamp(this._nextDate(t,"hour",1));0===n&&(n=86400);for(var i=this._getWorkHours(t),r=0;r=a.start&&n<=a.end)return 60;if(ea.start)return(Math.min(n,a.end)-Math.max(e,a.start))/60}return 0},_getMinutesPerDay:function(t){var e=0;return this._getWorkHours(t).forEach(function(t){e+=t.durationMinutes}),e},getHoursPerDay:function(t){var e=0;return this._getWorkHours(t).forEach(function(t){e+=t.durationHours}),e},_getWorkUnitsForRange:function(t,e,n,i){var r,o=0,s=new Date(t),l=new Date(e);for(r="minute"==n?a.bind(this._getMinutesPerDay,this):a.bind(this.getHoursPerDay,this);s.valueOf()27648e5&&0===s.getDate()){var c=this._largeUnitsCache.getMinutesPerMonth(s);"hour"==n&&(c/=60),o+=c,s=this.$gantt.date.add(s,1,"month")}else{if(l-s>13824e5){var u=this.$gantt.date.week_start(new Date(s));if(s.valueOf()===u.valueOf()){c=this._largeUnitsCache.getMinutesPerWeek(s);"hour"==n&&(c/=60),o+=c,s=this.$gantt.date.add(s,7,"day");continue}}o+=r(s),s=this._nextDate(s,"day",1)}return o/i},_getMinutesBetweenSingleDay:function(t,e){for(var n=this._getIntervalTimestamp(t,e),i=this._getWorkHours(t),r=0,a=0;a=o.start&&n.start<=o.end){var s=Math.max(o.start,n.start),l=Math.min(o.end,n.end);r+=(l-s)/60,n.start=l}}return Math.floor(r)},_getMinutesBetween:function(t,e,n,i){var r=new Date(t),a=new Date(e);i=i||1;var o=new Date(r),s=this.$gantt.date.add(this.$gantt.date.day_start(new Date(r)),1,"day");if(a.valueOf()<=s.valueOf())return this._getMinutesBetweenSingleDay(t,e);var l=this.$gantt.date.day_start(new Date(a)),c=a,u=this._getMinutesBetweenSingleDay(o,s),d=this._getMinutesBetweenSingleDay(l,c);return u+this._getWorkUnitsForRange(s,l,n,i)+d},_getHoursBetween:function(t,e,n,i){var r=new Date(t),a=new Date(e);i=i||1;var o=new Date(r),s=this.$gantt.date.add(this.$gantt.date.day_start(new Date(r)),1,"day");if(a.valueOf()<=s.valueOf())return Math.round(this._getMinutesBetweenSingleDay(t,e)/60);var l=this.$gantt.date.day_start(new Date(a)),c=a,u=this._getMinutesBetweenSingleDay(o,s,n,i)/60,d=this._getMinutesBetweenSingleDay(l,c,n,i)/60,h=u+this._getWorkUnitsForRange(s,l,n,i)+d;return Math.round(h)},getConfig:function(){return this._worktime},_setConfig:function(t){this._worktime=t,this._parseSettings(),this._clearCaches()},_parseSettings:function(){var t=this.getConfig();for(var e in t.parsed={dates:{},hours:null,haveCustomWeeks:!1,customWeeks:{},customWeeksRangeStart:null,customWeeksRangeEnd:null,customWeeksBoundaries:[]},t.parsed.hours=this._parseHours(t.hours),t.dates)t.parsed.dates[e]=this._parseHours(t.dates[e]);if(t.customWeeks){var n=null,i=null;for(var e in t.customWeeks){var r=t.customWeeks[e];if(r.from&&r.to){var a=r.from,o=r.to;(!n||n>a.valueOf())&&(n=a.valueOf()),(!i||ii)for(var r=0;ri){n=n.customWeeks[n.customWeeksBoundaries[r].name];break}var a=!0;return void 0!==n.dates[i]?a=n.dates[i]:void 0!==n.dates[t.getDay()]&&(a=n.dates[t.getDay()]),!0===a?n.hours:a||[]},_getIntervalTimestamp:function(t,e){var n={start:0,end:0};n.start=60*t.getHours()*60+60*t.getMinutes()+t.getSeconds();var i=e.getHours();return!i&&!e.getMinutes()&&!e.getSeconds()&&t.valueOf()e.valueOf()){var o=e;e=t,t=o,a=-1}return r="hour"==n&&1==i?this._getHoursBetween(t,e,n,i):"minute"==n&&1==i?this._getMinutesBetween(t,e,n,i):this._getWorkUnitsBetweenGeneric(t,e,n,i),a*Math.round(r)},hasDuration:function(){var t=this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper,arguments),e=t.start_date,n=t.end_date,i=t.unit,r=t.step;if(!i)return!1;var a=new Date(e),o=new Date(n);for(r=r||1;a.valueOf()=0?1:-1;n=Math.abs(1*n);var o=this;return this._dateDurationCache.getEndDate(e,n,i,r*a,function(){return o._calculateEndDate(e,n,i,r*a)})},_calculateEndDate:function(t,e,n,i){return!!n&&(1==i&&"minute"==n?this._calculateMinuteEndDate(t,e,i):-1==i&&"minute"==n?this._subtractMinuteDate(t,e,i):1==i&&"hour"==n?this._calculateHourEndDate(t,e,i):this._addInterval(t,e,n,i,null).end)},_addInterval:function(t,e,n,i,r){for(var a=0,o=t,s=new Date(o.valueOf()-1),l=o.getTimezoneOffset()-s.getTimezoneOffset();a0&&(c.setTime(c.getTime()+6e4*l),l=!1);var u=c.getTimezoneOffset()-o.getTimezoneOffset();u<0&&i>0&&"day"!=n&&c.setTime(c.getTime()+6e4*u);var d=new Date(c.valueOf()+1);i>0&&(d=new Date(c.valueOf()-1)),this._isWorkTime(d,n)&&a++,o=c}return{end:o,start:t,added:a}},_addHoursUntilDayEnd:function(t,e){for(var n=this.$gantt.date.add(this.$gantt.date.day_start(new Date(t)),1,"day"),i=0,r=e,a=this._getIntervalTimestamp(t,n),o=this._getWorkHours(t),s=0;s=l.start&&a.start<=l.end){var c=Math.max(l.start,a.start),u=Math.min(l.end,a.end),d=(u-c)/3600;d>r&&(d=r,u=c+60*r*60);var h=Math.round((u-c)/3600);i+=h,r-=h,a.start=u}}var f=n;return i===e&&(f=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,a.start)),{added:i,end:f}},_calculateHourEndDate:function(t,e,n){var i=new Date(t),r=0;n=n||1,e=Math.abs(1*e);var a=this._addHoursUntilDayEnd(i,e);if(r=a.added,i=a.end,c=e-r){for(var o=i;r0?this.getHoursPerDay(new Date(s.valueOf()-1)):this.getHoursPerDay(new Date(s.valueOf()+1)))>=e)break;r+=l,o=s}i=o}if(r=l.start&&a.start<=l.end){var c=Math.max(l.start,a.start),u=Math.min(l.end,a.end),d=(u-c)/60;d>r&&(d=r,u=c+60*r);var h=Math.round((u-c)/60);r-=h,i+=h,a.start=u}}var f=n;return i===e&&(f=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,a.start)),{added:i,end:f}},_subtractMinutesUntilHourStart:function(t,e){for(var n=this.$gantt.date.hour_start(new Date(t)),i=0,r=e,a=60*n.getHours()*60+60*n.getMinutes()+n.getSeconds(),o=60*t.getHours()*60+60*t.getMinutes()+t.getSeconds(),s=this._getWorkHours(t),l=s.length-1;l>=0&&ic.start&&a<=c.end){var u=Math.min(o,c.end),d=Math.max(a,c.start),h=(u-d)/60;h>r&&(h=r,d=u-60*r);var f=Math.abs(Math.round((u-d)/60));r-=f,i+=f,o=d}}var _=n;return i===e&&(_=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,o)),{added:i,end:_}},_subtractMinuteDate:function(t,e,n){var i=new Date(t),r=0;n=n||-1,e=Math.abs(1*e),e=Math.round(e);var a=this._subtractMinutesUntilHourStart(i,e);r+=a.added,i=a.end;for(var o=0,s=[],l=0;rl)r+=l,i=this.$gantt.date.add(i,-1,"day");else{for(var _=!1,g=null,p=s.length-1;p>=0;p--)if(s[p].start=f-1){_=!0,g=s[p];break}if(_)if(f===g.end&&h>=g.durationMinutes)r+=g.durationMinutes,i=this.$gantt.date.add(i,-g.durationMinutes,"minute");else if(h<=f/60-g.startMinute)r+=h,i=this.$gantt.date.add(i,-h,"minute");else{var v=this._getMinutesPerHour(i);v<=h?(r+=v,i=this._nextDate(i,"hour",n)):(r+=(a=this._subtractMinutesUntilHourStart(i,h)).added,i=a.end)}else if(0===i.getHours()&&0===i.getMinutes()&&0===i.getSeconds()){if((m=this._getClosestWorkTimePast(i,"hour")).valueOf()===i.valueOf()){var m=this.$gantt.date.add(i,-1,"day"),y=this._getWorkHours(m);if(y.length){var k=y[y.length-1];m.setSeconds(k.durationSeconds)}}i=m}else i=this._getClosestWorkTimePast(new Date(i-1),"hour")}else i=this.$gantt.date.add(i,-1,"day")}if(r=d&&u>=l){if(r+=l,u==l){i=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,s[s.length-1].end);break}i=this.$gantt.date.add(i,1,"day"),i=this.$gantt.date.day_start(i)}else{for(var h=!1,f=null,_=0;_d){h=!0,f=s[_];break}if(h)if(d===f.start&&u>=f.durationMinutes)r+=f.durationMinutes,i=this.$gantt.date.add(i,f.durationMinutes,"minute");else if(u<=f.endMinute-d/60)r+=u,i=this.$gantt.date.add(i,u,"minute");else{var g=this._getMinutesPerHour(i);g<=u?(r+=g,i=this._nextDate(i,"hour",n)):(r+=(a=this._addMinutesUntilHourEnd(i,u)).added,i=a.end)}else i=this._getClosestWorkTimeFuture(i,"hour")}else i=this.$gantt.date.add(this.$gantt.date.day_start(i),1,"day")}if(r0){for(var s=0;s=o){r=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,n[s].start);break}}else for(s=n.length-1;s>=0;s--){if(n[s].end<=o){r=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,n[s].end);break}if(n[s].end>o&&n[s].start<=o){r=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,o);break}}return r},_getClosestWorkMinute:function(t,e,n){var i=new Date(t),r=this._getWorkHours(i),a=this._findClosestTimeInDay(i,n,r);return a||(i=this.calculateEndDate(i,n,"day"),n>0?i=this.$gantt.date.day_start(i):(i=this.$gantt.date.day_start(i),i=this.$gantt.date.add(i,1,"day"),i=new Date(i.valueOf()-1)),r=this._getWorkHours(i),a=this._findClosestTimeInDay(i,n,r)),n<0&&(a=this.$gantt.date.add(a,-1,e)),a},_getClosestWorkTimeGeneric:function(t,e,n){if("hour"===e||"minute"===e)return this._getClosestWorkMinute(t,e,n);for(var i=this._getUnitOrder(e),r=this.units[i-1],a=t,o=0;!this._isWorkTime(a,e)&&(!r||this._isWorkTime(a,r)||(a=n>0?this._getClosestWorkTimeFuture(a,r):this._getClosestWorkTimePast(a,r),!this._isWorkTime(a,e)));){if(++o>3e3)return this.$gantt.assert(!1,"Invalid working time check"),!1;var s=a.getTimezoneOffset();a=this.$gantt.date.add(a,n,e),a=this.$gantt._correct_dst_change(a,s,n,e),this.$gantt.date[e+"_start"]&&(a=this.$gantt.date[e+"_start"](a))}return a},hasWorkTime:function(){var t=this.getConfig(),e=t.dates,n=[];for(var i in t.dates)Number(i)>6&&n.push(Number(i));var r=this._checkWorkHours(t.hours),a=!1;return[0,1,2,3,4,5,6].forEach(function(t){if(!a){var n=e[t];!0===n?a=r:Array.isArray(n)&&(a=this._checkWorkHours(n))}}.bind(this)),a},_checkWorkHours:function(t){if(0===t.length)return!1;for(var e=!1,n=0;ne.length?t:e,r=t===i?e:t;i=i.slice(),r=r.slice();n=[];for(var a=0;ao.start&&(n.push({start:Math.max(o.start,l.start),end:Math.min(o.end,l.end)}),o.end>l.end&&(r.splice(s,1),s--,a--))}return n},_mergeAdjacentIntervals:function(t){var e=t.slice();e.sort(function(t,e){return t.start-e.start});for(var n=e[0],i=1;in.end&&(n.end=r.end),e.splice(i,1),i--):n=r}return e},_mergeHoursConfig:function(t,e){return this._mergeAdjacentIntervals(this._intersectHourRanges(t,e))},merge:function(t,e){var n=i.copy(t.getConfig().parsed),r=i.copy(e.getConfig().parsed),a={hours:this._toHoursArray(this._mergeHoursConfig(n.hours,r.hours)),dates:{},customWeeks:{}};for(var o in n.dates){var s=n.dates[o],l=r.dates[o];if(s&&l)if(Array.isArray(s)||Array.isArray(l)){var c=Array.isArray(s)?s:n.hours,u=Array.isArray(l)?l:r.hours;a.dates[o]=this._toHoursArray(this._mergeHoursConfig(c,u))}else a.dates[o]=!0;else a.dates[o]=!1}if(n.customWeeks)for(var o in n.customWeeks)a.customWeeks[o]=n.customWeeks[o];if(r.customWeeks)for(var o in r.customWeeks)a.customWeeks[o]=r.customWeeks[o];return a}},t.exports=r},function(t,e,n){var i=n(0),r=n(37),a=n(185),o=n(184),s=n(179),l=n(178)();function c(t){this.$gantt=t,this._calendars={},this._legacyConfig=void 0,this.$gantt.attachEvent("onGanttReady",function(){this.$gantt.config.resource_calendars&&(this._isLegacyConfig=s.isLegacyResourceCalendarFormat(this.$gantt.config.resource_calendars))}.bind(this)),this.$gantt.attachEvent("onBeforeGanttReady",function(){this.createDefaultCalendars()}.bind(this)),this.$gantt.attachEvent("onBeforeGanttRender",function(){this.createDefaultCalendars()}.bind(this))}c.prototype={_calendars:{},_convertWorkTimeSettings:function(t){var e=t.days;if(e&&!t.dates){t.dates=t.dates||{};for(var n=0;n=3?(r=n,a=i):"string"==typeof arguments[1]?r=arguments[1]:"function"==typeof arguments[1]&&(a=arguments[1]),this._load_type=r,this.callEvent("onLoadStart",[e,r]),this.ajax.get(e,t.bind(function(t){this.on_load(t,r),this.callEvent("onLoadEnd",[e,r]),"function"==typeof a&&a.call(this)},this))},t.parse=function(t,e){this.on_load({xmlDoc:{responseText:t}},e)},t.serialize=function(t){return this[t=t||"json"].serialize()},t.on_load=function(e,n){if(e.xmlDoc&&404===e.xmlDoc.status)this.assert(!1,"Failed to load the data from "+e.xmlDoc.responseURL+", server returns 404");else if(!t.$destroyed){this.callEvent("onBeforeParse",[]),n||(n="json"),this.assert(this[n],"Invalid data type:'"+n+"'");var i=e.xmlDoc.responseText,r=this[n].parse(i,e);this._process_loading(r)}},t._process_loading=function(t){t.collections&&this._load_collections(t.collections),this.$data.tasksStore.parse(t.data||t.tasks);var e=t.links||(t.collections?t.collections.links:[]);this.$data.linksStore.parse(e),this.callEvent("onParse",[]),this.render()},t._load_collections=function(t){var e=!1;for(var n in t)if(t.hasOwnProperty(n)){e=!0;var i=t[n],r=this.serverList[n];if(!r)continue;r.splice(0,r.length);for(var a=0;a"},_copyObject:function(t){return""},serialize:function(){for(var e=[],n=[],i=t.json.serialize(),r=0,a=i.data.length;r"+e.join("")+""+n.join("")+""}},t.oldxml={parse:function(e,n){n=t.xml._getXML(e,n,"projects");for(var i={collections:{links:[]}},r=i.data=[],a=t.ajax.xpath("//task",n),o=0;o=r-20&&(t.autoscrollRight(),t.autoscrollStart()),o<=a+20&&(t.autoscrollLeft(),t.autoscrollStart()),oa+20&&t.autoscrollStop(),!0}),this._dnd.attachEvent("onDragEnd",function(){t.autoscrollStop()}))},t.prototype.autoscrollStart=function(){var t=this;if(0!==this._scrollOrder){var e=10*this._scrollOrder,n=this._scrollView.getScrollState();this._scrollView.scrollTo(n.position+e),setTimeout(function(){t.autoscrollStart()},50)}},t.prototype.autoscrollRight=function(){this._scrollOrder=1},t.prototype.autoscrollLeft=function(){this._scrollOrder=-1},t.prototype.autoscrollStop=function(){this._scrollOrder=0},t.prototype.getCorrection=function(){return this.isScrollable()?this._scrollView.getScrollState().position:0},t.prototype.isScrollable=function(){return!!this.$grid.$config.scrollable},t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(191),a=function(){function t(t,e){var n=this;this._targetMarker=null,this.calculateCurrentPosition=function(t){var e=n.$grid.$grid.getBoundingClientRect(),i=e.right,r=e.left,a=t;return a>i&&(a=i),a=e},d=function(t){return--t});for(var h=this._dragX-this.$grid.$grid.getBoundingClientRect().left+this._scrollableGrid.getCorrection(),f=l;u(f,c)&&(void 0===t||void 0===e);f=d(f))o[f].hide||(s.startX=s.endX,s.endX+=o[f].width,h>=s.startX&&(h<=s.endX||!u(d(f),c))&&(t=f,n=s.startX,i=s.endX,r=(h-s.startX)/(s.endX-s.startX)),a===o[f].name&&(e=f));return{targetIndex:t,draggedIndex:e,xBefore:n,xAfter:i,columnRelativePos:r}},t.prototype.setMarkerPosition=function(t,e){void 0===e&&(e=10);var n=this._dnd.config.marker,i=this._dnd._obj.getBoundingClientRect();n.style.top=i.y+e+"px",n.style.left=t+"px"},t.prototype.drawTargetMarker=function(t){var e,n=t.targetIndex,r=t.draggedIndex,a=t.xBefore,o=t.xAfter,s=t.columnRelativePos;this._targetMarker||(this._targetMarker=document.createElement("div"),i.addClassName(this._targetMarker,"gantt_grid_target_marker"),this._targetMarker.style.display="none",this._targetMarker.style.height=this._gridConfig.scale_height+"px"),this._targetMarker.parentNode||this.$grid.$grid_scale.appendChild(this._targetMarker),e=n>r?o:n.5?o:a,this._targetMarker.style.left=e+"px",this._targetMarker.style.display="block"},t.prototype.cleanTargetMarker=function(){this._targetMarker&&this._targetMarker.parentNode&&this.$grid.$grid_scale.removeChild(this._targetMarker),this._targetMarker=null},t}();e.ColumnsGridDnd=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(192);e.default=i.ColumnsGridDnd},function(t,e,n){var i=n(1);t.exports=function(t,e){var n={row_before_start:t.bind(function(t,n,r){var a=e.$getConfig(),o=e.$config.rowStore;if(!i.locateAttribute(r,a.task_grid_row_resizer_attribute))return!1;var s=this.locate(r,a.task_grid_row_resizer_attribute),l=o.getItem(s);return!1!==e.callEvent("onBeforeRowResize",[l])&&void 0},t),row_after_start:t.bind(function(t,n,i){var r=e.$getConfig(),a=this.locate(i,r.task_grid_row_resizer_attribute);t.config.marker.innerHTML="",t.config.marker.className+=" gantt_row_grid_resize_area",t.config.marker.style.width=e.$grid.offsetWidth+"px",t.config.drag_id=a},t),row_drag_move:t.bind(function(t,n,r){var a=e.$config.rowStore,o=e.$getConfig(),s=t.config,l=parseInt(s.drag_id,10),c=e.getItemHeight(l),u=e.getItemTop(l),d=i.getNodePosition(e.$grid_data),h=parseInt(s.marker.style.top,10),f=u+d.y,_=0,g=o.min_task_grid_row_height;return(_=h-f)_&&(h=_)}else if(!e.$config.scrollable){var y=h,k=t.$container.offsetWidth,b=0;if(e.$grid_data.offsetWidth<=k-25)for(v=c+1;v=0;v--)b+=l[v].width;b=k-b}b>k&&(b-=k);var w=e.$parent.$parent;if(w&&"y"==w.$config.mode){var x=w.$lastSize.x;k=Math.min(k,x-(w.$cells.length-1))}y+b>k&&(h=k-b)}return s.left=h-1,p=Math.abs(h-g),u.max_width&&p>u.max_width&&(p=u.max_width),o.rtl&&(g=d.width-g+2-p),s.marker.style.top=d.y+"px",s.marker.style.left=d.x-1+g+"px",s.marker.style.width=p+"px",e.callEvent("onColumnResize",[c,l[c],p-1]),!0},t),column_drag_end:t.bind(function(n,i,r){for(var a=e.$getConfig(),o=e.getGridColumns(),s=0,l=parseInt(n.config.drag_index,10),c=o[l],u=0;u
",u.setAttribute(i.grid_resizer_column_attribute,s),u.setAttribute("column_index",s),t._waiAria.gridSeparatorAttr(u),e.$grid_scale.appendChild(u),u.style.left=Math.max(0,l)+"px"}}}}}},function(t,e,n){var i=n(27);t.exports=function(t){n(190)(t),i.prototype.getGridColumns=function(){for(var t=this.$getConfig().columns,e=[],n=0;n=0?"&":"?",a=t.getScrollState().y||0,o={taskId:e,url:n+r+"parent_id="+encodeURIComponent(e)};if(!1===t.callEvent("onBeforeBranchLoading",[o]))return;t.load(o.url,this._load_type,function(){a&&t.scrollTo(null,a),t.callEvent("onAfterBranchLoading",[o])}),i[e]=!0}})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){var e=this;this.format=function(t){return e._getWBSCode(t.source)},this.canParse=function(t){return e._linkReg.test(t)},this.parse=function(t){if(!e.canParse(t))return null;var n=e._linkReg.exec(t)[0].trim();return{id:void 0,source:e._findSource(n)||null,target:null,type:e._gantt.config.links.finish_to_start,lag:0}},this._getWBSCode=function(t){var n=e._gantt.getTask(t);return e._gantt.getWBSCode(n)},this._findSource=function(t){var n=new RegExp("^[0-9.]+","i");if(n.exec(t)){var i=n.exec(t)[0],r=e._gantt.getTaskByWBSCode(i);if(r)return r.id}return null},this._linkReg=/^[0-9\.]+/,this._gantt=t}return t.create=function(e,n){return void 0===e&&(e=null),new t(n)},t}();e.default=i},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var i=t.call(this,n)||this;return i.format=function(t){var e=i._getFormattedLinkType(i._getLinkTypeName(t.type)),n=i._getWBSCode(t.source),r=i._getLagString(t.lag);return t.type!==i._gantt.config.links.finish_to_start||t.lag?""+n+e+r:n},i.parse=function(t){if(!i.canParse(t))return null;var e=i._linkReg.exec(t)[0].trim(),n=t.replace(e,"").trim(),r=i._findTypeFormat(e),a=i._getLinkTypeNumber(r);return{id:void 0,source:i._findSource(e)||null,target:null,type:a,lag:i._parseLag(n)}},i._getLinkTypeName=function(t){var e="";for(e in i._config.labels)if(i._gantt.config.links[e].toLowerCase()===t.toLowerCase())break;return e},i._getLinkTypeNumber=function(t){var e="";for(e in i._gantt.config.links)if(e.toLowerCase()===t.toLowerCase())break;return i._gantt.config.links[e]},i._getFormattedLinkType=function(t){return i._config.labels[t]||""},i._getLagString=function(t){if(!t)return"";var e=i._config.durationFormatter.format(t);return t<0?e:"+"+e},i._findTypeFormat=function(t){var e=t.replace(/[^a-zA-Z]/gi,""),n="finish_to_start";for(var r in i._config.labels)i._config.labels[r].toLowerCase()===e.toLowerCase()&&(n=r);return n},i._parseLag=function(t){return t?i._config.durationFormatter.parse(t):0},i._config=i._defaultSettings(e),i._linkReg=/^[0-9\.]+[a-zA-Z]*/,i}return i(e,t),e.prototype._defaultSettings=function(t){void 0===t&&(t=null);var e={durationFormatter:this._gantt.ext.formatters.durationFormatter(),labels:{finish_to_finish:"FF",finish_to_start:"FS",start_to_start:"SS",start_to_finish:"SF"}};if(t&&t.durationFormatter&&(e.durationFormatter=t.durationFormatter),t&&t.labels)for(var n in t.labels)e.labels[n]=t.labels[n];return e},e.create=function(t,n){return void 0===t&&(t=null),new e(t,n)},e}(n(199).default);e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t=null);var e=this;this.canParse=function(t){var n="",i=e._config.labels;for(var r in i){var a=i[r];n+=a.full+"|"+a.plural+"|"+a.short+"|"}return new RegExp("^([+-]? *[0-9.]{1,}\\s*("+n+")\\s*)*$").test((t||"").trim())},this.format=function(t){var n=e._config.store,i=e._config.format,r=e._config.short,a=e.transferUnits[n].toMinutes(t),o=i;if(o&&"auto"===o&&(o=e._selectFormatForValue(a)),o||(o="day"),"auto"===i&&!t)return"";for(var s="",l=(o=Array.isArray(o)?o:[o]).length-1,c=0;c-1?t.indexOf("?"):t.length),this.serverProcessor=t+("/"===t.slice(-1)?"":"/")+n}else{var i=this._ganttMode+"s";this.serverProcessor=t+e.ajax.urlSeparator(t)+"gantt_mode="+i}return!0}),t.attachEvent("insertCallback",function(t,n,i,r){var a=t.data||e.xml._xmlNodeToJSON(t.firstChild),o={add:e.addTask,isExist:e.isTaskExists};"links"===r&&(o.add=e.addLink,o.isExist=e.isLinkExists),o.isExist.call(e,n)||(a.id=n,o.add.call(e,a))}),t.attachEvent("updateCallback",function(t,n){var i=t.data||e.xml._xmlNodeToJSON(t.firstChild);if(e.isTaskExists(n)){var r=e.getTask(n);for(var a in i){var o=i[a];switch(a){case"id":continue;case"start_date":case"end_date":o=e.defined(e.templates.xml_date)?e.templates.xml_date(o):e.templates.parse_date(o);break;case"duration":r.end_date=e.calculateEndDate({start_date:r.start_date,duration:o,task:r})}r[a]=o}e.updateTask(n),e.refreshData()}}),t.attachEvent("deleteCallback",function(t,n,i,r){var a={delete:e.deleteTask,isExist:e.isTaskExists};"links"===r&&(a.delete=e.deleteLink,a.isExist=e.isLinkExists),a.isExist.call(e,n)&&a.delete.call(e,n)})},t.prototype.detach=function(){var t=this;i.forEach(this._dataProcessorHandlers,function(e){t.$gantt.detachEvent(e)}),this._dataProcessorHandlers=[]},t}();e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(4),r=n(2),a=n(0),o=n(212),s=n(211),l=n(210);e.createDataProcessor=function(t){var e,n;t instanceof Function?e=t:t.hasOwnProperty("router")?e=t.router:t.hasOwnProperty("link")&&t.hasOwnProperty("task")&&(e=t),n=e?"CUSTOM":t.mode||"REST-JSON";var i=new c(t.url);return i.init(this),i.setTransactionMode({mode:n,router:e},t.batchUpdate),i};var c=function(){function t(t){this.serverProcessor=t,this.action_param="!nativeeditor_status",this.updatedRows=[],this.autoUpdate=!0,this.updateMode="cell",this._headers=null,this._payload=null,this._postDelim="_",this._routerParametersFormat="parameters",this._waitMode=0,this._in_progress={},this._storage=l.default.create(),this._invalid={},this.messages=[],this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"},this.enableUTFencoding(!0),i(this)}return t.prototype.setTransactionMode=function(t,e){"object"==typeof t?(this._tMode=t.mode||this._tMode,a.defined(t.headers)&&(this._headers=t.headers),a.defined(t.payload)&&(this._payload=t.payload),this._tSend=!!e):(this._tMode=t,this._tSend=e),"REST"===this._tMode&&(this._tSend=!1),"JSON"===this._tMode||"REST-JSON"===this._tMode?(this._tSend=!1,this._serializeAsJson=!0,this._headers=this._headers||{},this._headers["Content-Type"]="application/json"):this._headers&&!this._headers["Content-Type"]&&(this._headers["Content-Type"]="application/x-www-form-urlencoded"),"CUSTOM"===this._tMode&&(this._tSend=!1,this._router=t.router)},t.prototype.escape=function(t){return this._utf?encodeURIComponent(t):escape(t)},t.prototype.enableUTFencoding=function(t){this._utf=!!t},t.prototype.getSyncState=function(){return!this.updatedRows.length},t.prototype.setUpdateMode=function(t,e){this.autoUpdate="cell"===t,this.updateMode=t,this.dnd=e},t.prototype.ignore=function(t,e){this._silent_mode=!0,t.call(e||window),this._silent_mode=!1},t.prototype.setUpdated=function(t,e,n){if(!this._silent_mode){var i=this.findRow(t);n=n||"updated";var r=this.$gantt.getUserData(t,this.action_param);r&&"updated"===n&&(n=r),e?(this.set_invalid(t,!1),this.updatedRows[i]=t,this.$gantt.setUserData(t,this.action_param,n),this._in_progress[t]&&(this._in_progress[t]="wait")):this.is_invalid(t)||(this.updatedRows.splice(i,1),this.$gantt.setUserData(t,this.action_param,"")),this.markRow(t,e,n),e&&this.autoUpdate&&this.sendData(t)}},t.prototype.markRow=function(t,e,n){var i="",r=this.is_invalid(t);if(r&&(i=this.styles[r],e=!0),this.callEvent("onRowMark",[t,e,n,r])&&(i=this.styles[e?n:"clear"]+" "+i,this.$gantt[this._methods[0]](t,i),r&&r.details)){i+=this.styles[r+"_cell"];for(var a=0;aa.indexOf("/task")?"link":"task",this.setGanttMode(r);var o,s=this.$gantt.ajax;try{o=JSON.parse(e.xmlDoc.responseText)}catch(t){e.xmlDoc.responseText.length||(o={})}if(o){var l=o.action||this.getState(n)||"updated",c=o.sid||n[0],u=o.tid||n[0];return t.afterUpdateCallback(c,u,l,o,r),t.finalizeUpdate(),void this.setGanttMode(r)}var d=s.xmltop("data",e.xmlDoc);if(!d)return this.cleanUpdate(n);var h=s.xpath("//data/action",d);if(!h.length)return this.cleanUpdate(n);for(var f=0;fr||+n.end_date<+i)return!1}return!0}),s.attachEvent("onIdChange",function(e,n){t._update_flags(e,n);var i=t.getTask(n);s.isSilent()||(i.$split_subtask||i.rollup)&&t.eachParent(function(e){t.refreshTask(e.id)},n)}),s.attachEvent("onAfterUpdate",function(e){if(t._update_parents(e),t.getState("batchUpdate").batch_update)return!0;var n=s.getItem(e);n.$source||(n.$source=[]);for(var i=0;i=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(221),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(14))},function(t,e,n){(function(n,i,r){var a,o,s;function l(t){"@babel/helpers - typeof";return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)} /* @preserve * The MIT License (MIT) * * Copyright (c) 2013-2018 Petka Antonov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */!function(n){"object"==l(e)&&void 0!==t?t.exports=n():(o=[],void 0===(s="function"==typeof(a=n)?a.apply(e,o):a)||(t.exports=s))}(function(){var t,e,a;return function t(e,n,i){function r(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof _dereq_&&_dereq_;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};e[o][0].call(u.exports,function(t){var n=e[o][1][t];return r(n||t)},u,u.exports,t,e,n,i)}return n[o].exports}for(var a="function"==typeof _dereq_&&_dereq_,o=0;o0;)f(t)}function f(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var n=t.shift(),i=t.shift();e.call(n,i)}}l.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},l.prototype.hasCustomScheduler=function(){return this._customScheduler},l.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},l.prototype.disableTrampolineIfNecessary=function(){s.hasDevTools&&(this._trampolineEnabled=!1)},l.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},l.prototype.fatalError=function(t,e){e?(n.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),n.exit(2)):this.throwLater(t)},l.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.hasDevTools?(l.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?c.call(this,t,e,n):this._schedule(function(){setTimeout(function(){t.call(e,n)},100)})},l.prototype.invoke=function(t,e,n){this._trampolineEnabled?u.call(this,t,e,n):this._schedule(function(){t.call(e,n)})},l.prototype.settlePromises=function(t){this._trampolineEnabled?d.call(this,t):this._schedule(function(){t._settlePromises()})}):(l.prototype.invokeLater=c,l.prototype.invoke=u,l.prototype.settlePromises=d),l.prototype._drainQueues=function(){h(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,h(this._lateQueue)},l.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},l.prototype._reset=function(){this._isTickUsed=!1},e.exports=l,e.exports.firstLineError=r},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,i){var r=!1,a=function(t,e){this._reject(e)},o=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(a,a,null,this,t)},s=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},l=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(a){r||(r=!0,t.prototype._propagateFrom=i.propagateFromFunction(),t.prototype._boundValue=i.boundValueFunction());var c=n(a),u=new t(e);u._propagateFrom(this,1);var d=this._target();if(u._setBoundTo(c),c instanceof t){var h={promiseRejectionQueued:!1,promise:u,target:d,bindingPromise:c};d._then(e,o,void 0,u,h),c._then(s,l,void 0,u,h),u._setOnCancel(c)}else u._resolveCallback(d);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";var i;"undefined"!=typeof Promise&&(i=Promise);var r=t("./promise")();r.noConflict=function(){try{Promise===r&&(Promise=i)}catch(t){}return r},e.exports=r},{"./promise":22}],5:[function(t,e,n){"use strict";var i=Object.create;if(i){var r=i(null),a=i(null);r[" size"]=a[" size"]=0}e.exports=function(e){var n=t("./util"),i=n.canEvaluate;n.isIdentifier;function r(t){return function(t,i){var r;if(null!=t&&(r=t[i]),"function"!=typeof r){var a="Object "+n.classString(t)+" has no method '"+n.toString(i)+"'";throw new e.TypeError(a)}return r}(t,this.pop()).apply(t,this)}function a(t){return t[this]}function o(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e;if("number"==typeof t)e=o;else if(i){var n=(void 0)(t);e=null!==n?n:a}else e=a;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,i,r){var a=t("./util"),o=a.tryCatch,s=a.errorObj,l=e._async;e.prototype.break=e.prototype.cancel=function(){if(!r.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),l.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(a.isArray(t))for(var n=0;n=0)return n[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},i.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,n.push(this._trace))},i.prototype._popContext=function(){if(void 0!==this._trace){var t=n.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},i.CapturedTrace=null,i.create=function(){if(e)return new i},i.deactivateLongStackTraces=function(){},i.activateLongStackTraces=function(){var n=t.prototype._pushContext,a=t.prototype._popContext,o=t._peekContext,s=t.prototype._peekContext,l=t.prototype._promiseCreated;i.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=a,t._peekContext=o,t.prototype._peekContext=s,t.prototype._promiseCreated=l,e=!1},e=!0,t.prototype._pushContext=i.prototype._pushContext,t.prototype._popContext=i.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},i}},{}],9:[function(t,e,i){"use strict";e.exports=function(e,i){var r,a,o,s=e._getDomain,c=e._async,u=t("./errors").Warning,d=t("./util"),h=t("./es5"),f=d.canAttachTrace,_=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,g=/\((?:timers\.js):\d+:\d+\)/,p=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,v=null,m=null,y=!1,k=!(0==d.env("BLUEBIRD_DEBUG")),b=!(0==d.env("BLUEBIRD_WARNINGS")||!k&&!d.env("BLUEBIRD_WARNINGS")),w=!(0==d.env("BLUEBIRD_LONG_STACK_TRACES")||!k&&!d.env("BLUEBIRD_LONG_STACK_TRACES")),x=0!=d.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!d.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},e.prototype._notifyUnhandledRejectionIsHandled=function(){G("rejectionHandled",r,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),G("unhandledRejection",a,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return z(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=s();a="function"==typeof t?null===e?t:d.domainBind(e,t):void 0},e.onUnhandledRejectionHandled=function(t){var e=s();r="function"==typeof t?null===e?t:d.domainBind(e,t):void 0};var S=function(){};e.longStackTraces=function(){if(c.haveItemsQueued()&&!tt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!tt.longStackTraces&&Y()){var t=e.prototype._captureStackTrace,n=e.prototype._attachExtraTrace,r=e.prototype._dereferenceTrace;tt.longStackTraces=!0,S=function(){if(c.haveItemsQueued()&&!tt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=n,e.prototype._dereferenceTrace=r,i.deactivateLongStackTraces(),c.enableTrampoline(),tt.longStackTraces=!1},e.prototype._captureStackTrace=j,e.prototype._attachExtraTrace=F,e.prototype._dereferenceTrace=B,i.activateLongStackTraces(),c.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return tt.longStackTraces&&Y()};var $=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return d.global.dispatchEvent(t),function(t,e){var n={detail:e,cancelable:!0};h.defineProperty(n,"promise",{value:e.promise}),h.defineProperty(n,"reason",{value:e.reason});var i=new CustomEvent(t.toLowerCase(),n);return!d.global.dispatchEvent(i)}}if("function"==typeof Event){t=new Event("CustomEvent");return d.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,h.defineProperty(n,"promise",{value:e.promise}),h.defineProperty(n,"reason",{value:e.reason}),!d.global.dispatchEvent(n)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),d.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!d.global.dispatchEvent(n)}}catch(t){}return function(){return!1}}(),T=d.isNode?function(){return n.emit.apply(n,arguments)}:d.global?function(t){var e="on"+t.toLowerCase(),n=d.global[e];return!!n&&(n.apply(d.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function C(t,e){return{promise:e}}var E={promiseCreated:C,promiseFulfilled:C,promiseRejected:C,promiseResolved:C,promiseCancelled:C,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:C},D=function(t){var e=!1;try{e=T.apply(null,arguments)}catch(t){c.throwLater(t),e=!0}var n=!1;try{n=$(t,E[t].apply(null,arguments))}catch(t){c.throwLater(t),n=!0}return n||e};function A(){return!1}function M(t,e,n){var i=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+d.toString(t));i._attachCancellationCallback(t)})}catch(t){return t}}function I(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?d.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function N(){return this._onCancelField}function P(t){this._onCancelField=t}function L(){this._cancellationParent=void 0,this._onCancelField=void 0}function O(t,e){if(0!=(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}e.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&S()),"warnings"in t){var n=t.warnings;tt.warnings=!!n,x=tt.warnings,d.isObject(n)&&"wForgottenReturn"in n&&(x=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!tt.cancellation){if(c.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=L,e.prototype._propagateFrom=O,e.prototype._onCancel=N,e.prototype._setOnCancel=P,e.prototype._attachCancellationCallback=I,e.prototype._execute=M,R=O,tt.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!tt.monitoring?(tt.monitoring=!0,e.prototype._fireEvent=D):!t.monitoring&&tt.monitoring&&(tt.monitoring=!1,e.prototype._fireEvent=A)),e},e.prototype._fireEvent=A,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(t){return t}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._dereferenceTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var R=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function H(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function j(){this._trace=new Q(this._peekContext())}function F(t,e){if(f(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=W(t);d.notEnumerableProp(t,"stack",i.message+"\n"+i.stack.join("\n")),d.notEnumerableProp(t,"__stackCleaned__",!0)}}}function B(){this._trace=void 0}function z(t,n,i){if(tt.warnings){var r,a=new u(t);if(n)i._attachExtraTrace(a);else if(tt.longStackTraces&&(r=e._peekContext()))r.attachExtraTrace(a);else{var o=W(a);a.stack=o.message+"\n"+o.stack.join("\n")}D("warning",a)||U(a,"",!0)}}function V(t){for(var e=[],n=0;n0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:V(e)}}function U(t,e,n){if("undefined"!=typeof console){var i;if(d.isObject(t)){var r=t.stack;i=e+m(r,t)}else i=e+String(t);"function"==typeof o?o(i,n):"function"!=typeof console.log&&"object"!==l(console.log)||console.log(i)}}function G(t,e,n,i){var r=!1;try{"function"==typeof e&&(r=!0,"rejectionHandled"===t?e(i):e(n,i))}catch(t){c.throwLater(t)}"unhandledRejection"===t?D(t,n,i)||r||U(n,"Unhandled rejection "):D(t,i)}function q(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():d.toString(t);if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){if(t.length<41)return t;return t.substr(0,38)+"..."}(e)+">, no stack trace)"}function Y(){return"function"==typeof Z}var K=function(){return!1},X=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function J(t){var e=t.match(X);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function Q(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);Z(this,Q),e>32&&this.uncycle()}d.inherits(Q,Error),i.CapturedTrace=Q,Q.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],n={},i=0,r=this;void 0!==r;++i)e.push(r),r=r._parent;for(i=(t=this._length=i)-1;i>=0;--i){var a=e[i].stack;void 0===n[a]&&(n[a]=i)}for(i=0;i0&&(e[o-1]._parent=void 0,e[o-1]._length=1),e[i]._parent=void 0,e[i]._length=1;var s=i>0?e[i-1]:this;o=0;--c)e[c]._length=l,l++;return}}}},Q.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=W(t),n=e.message,i=[e.stack],r=this;void 0!==r;)i.push(V(r.stack.split("\n"))),r=r._parent;!function(t){for(var e=t[0],n=1;n=0;--s)if(i[s]===a){o=s;break}for(s=o;s>=0;--s){var l=i[s];if(e[r]!==l)break;e.pop(),r--}e=i}}(i),function(t){for(var e=0;e=0)return v=/@/,m=e,y=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){i="stack"in t}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(m=function(t,e){return"string"==typeof t?t:"object"!==l(e)&&"function"!=typeof e||void 0===e.name||void 0===e.message?q(e):e.toString()},null):(v=t,m=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(o=function(t){console.warn(t)},d.isNode&&n.stderr.isTTY?o=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:d.isNode||"string"!=typeof(new Error).stack||(o=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var tt={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1};return w&&e.longStackTraces(),{longStackTraces:function(){return tt.longStackTraces},warnings:function(){return tt.warnings},cancellation:function(){return tt.cancellation},monitoring:function(){return tt.monitoring},propagateFromFunction:function(){return R},boundValueFunction:function(){return H},checkForgottenReturns:function(t,e,n,i,r){if(void 0===t&&null!==e&&x){if(void 0!==r&&r._returnedNonUndefined())return;if(0==(65535&i._bitField))return;n&&(n+=" ");var a="",o="";if(e._trace){for(var s=e._trace.stack.split("\n"),l=V(s),c=l.length-1;c>=0;--c){var u=l[c];if(!g.test(u)){var d=u.match(p);d&&(a="at "+d[1]+":"+d[2]+":"+d[3]+" ");break}}if(l.length>0){var h=l[0];for(c=0;c0&&(o="\n"+s[c-1]);break}}}var f="a promise was created in a "+n+"handler "+a+"but was not returned from it, see http://goo.gl/rRqMUw"+o;i._warn(f,!0,e)}},setBounds:function(t,e){if(Y()){for(var n,i,r=t.stack.split("\n"),a=e.stack.split("\n"),o=-1,s=-1,l=0;l=s||(K=function(t){if(_.test(t))return!0;var e=J(t);return!!(e&&e.fileName===n&&o<=e.line&&e.line<=s)})}},warn:z,deprecated:function(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),z(n)},CapturedTrace:Q,fireDomEvent:$,fireGlobalEvent:T}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1];return this.caught(t,function(){throw e})},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var i=arguments[1];i instanceof t&&i.suppressUnhandledRejections();return this.caught(n,function(){return i})}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){var n=t.reduce,i=t.all;function r(){return i(this)}t.prototype.each=function(t){return n(this,t,e,0)._then(r,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return n(this,t,e,e)},t.each=function(t,i){return n(t,i,e,0)._then(r,void 0,void 0,t,void 0)},t.mapSeries=function(t,i){return n(t,i,e,e)}}},{}],12:[function(t,e,n){"use strict";var i,r,a=t("./es5"),o=a.freeze,s=t("./util"),l=s.inherits,c=s.notEnumerableProp;function u(t,e){function n(i){if(!(this instanceof n))return new n(i);c(this,"message","string"==typeof i?i:e),c(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return l(n,Error),n}var d=u("Warning","warning"),h=u("CancellationError","cancellation error"),f=u("TimeoutError","timeout error"),_=u("AggregateError","aggregate error");try{i=TypeError,r=RangeError}catch(t){i=u("TypeError","type error"),r=u("RangeError","range error")}for(var g="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),p=0;p1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function d(){return f.call(this,this.promise._target()._settledValue())}function h(t){if(!u(this,t))return o.e=t,o}function f(t){var r=this.promise,s=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?s.call(r._boundValue()):s.call(r._boundValue(),t);if(l===i)return l;if(void 0!==l){r._setReturnedNonUndefined();var f=n(l,r);if(f instanceof e){if(null!=this.cancelPromise){if(f._isCancelled()){var _=new a("late cancellation observer");return r._attachExtraTrace(_),o.e=_,o}f.isPending()&&f._attachCancellationCallback(new c(this))}return f._then(d,h,void 0,this,void 0)}}}return r.isRejected()?(u(this),o.e=t,o):(u(this),t)}return l.prototype.isFinallyHandler=function(){return 0===this.type},c.prototype._resultCancelled=function(){u(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,i){return"function"!=typeof t?this.then():this._then(n,i,void 0,new l(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,f,f)},e.prototype.tap=function(t){return this._passThrough(t,1,f)},e.prototype.tapCatch=function(t){var n=arguments.length;if(1===n)return this._passThrough(t,1,void 0,f);var i,a=new Array(n-1),o=0;for(i=0;i0&&"function"==typeof arguments[e]&&(t=arguments[e]);var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,i,r,a,o){var s=e._getDomain,c=t("./util"),u=c.tryCatch,d=c.errorObj,h=e._async;function f(t,e,n,i){this.constructor$(t),this._promise._captureStackTrace();var r=s();this._callback=null===r?e:c.domainBind(r,e),this._preservedValues=i===a?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}function _(t,n,r,a){if("function"!=typeof n)return i("expecting a function but got "+c.classString(n));var o=0;if(void 0!==r){if("object"!==l(r)||null===r)return e.reject(new TypeError("options argument must be an object but it is "+c.classString(r)));if("number"!=typeof r.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+c.classString(r.concurrency)));o=r.concurrency}return new f(t,n,o="number"==typeof o&&isFinite(o)&&o>=1?o:0,a).promise()}c.inherits(f,n),f.prototype._asyncInit=function(){this._init$(void 0,-2)},f.prototype._init=function(){},f.prototype._promiseFulfilled=function(t,n){var i=this._values,a=this.length(),s=this._preservedValues,l=this._limit;if(n<0){if(i[n=-1*n-1]=t,l>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(l>=1&&this._inFlight>=l)return i[n]=t,this._queue.push(n),!1;null!==s&&(s[n]=t);var c=this._promise,h=this._callback,f=c._boundValue();c._pushContext();var _=u(h).call(f,t,n,a),g=c._popContext();if(o.checkForgottenReturns(_,g,null!==s?"Promise.filter":"Promise.map",c),_===d)return this._reject(_.e),!0;var p=r(_,this._promise);if(p instanceof e){var v=(p=p._target())._bitField;if(0==(50397184&v))return l>=1&&this._inFlight++,i[n]=p,p._proxy(this,-1*(n+1)),!1;if(0==(33554432&v))return 0!=(16777216&v)?(this._reject(p._reason()),!0):(this._cancel(),!0);_=p._value()}i[n]=_}return++this._totalResolved>=a&&(null!==s?this._filter(i,s):this._resolve(i),!0)},f.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight1){a.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],u=arguments[2];i=o.isArray(c)?s(t).apply(u,c):s(t).call(u,c)}else i=s(t)();var d=l._popContext();return a.checkForgottenReturns(i,d,"Promise.try",l),l._resolveFromSyncValue(i),l},e.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";var i=t("./util"),r=i.maybeWrapAsError,a=t("./errors").OperationalError,o=t("./es5");var s=/^(?:name|message|stack|cause)$/;function l(t){var e;if(function(t){return t instanceof Error&&o.getPrototypeOf(t)===Error.prototype}(t)){(e=new a(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var n=o.keys(t),r=0;r1){var n,i=new Array(e-1),r=0;for(n=0;n0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+c.classString(t);arguments.length>1&&(n+=", "+c.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},D.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},D.prototype.spread=function(t){return"function"!=typeof t?a("expecting a function but got "+c.classString(t)):this.all()._then(t,void 0,void 0,v,void 0)},D.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},D.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new k(this).promise()},D.prototype.error=function(t){return this.caught(c.originatesFromRejection,t)},D.getNewLibraryCopy=e.exports,D.is=function(t){return t instanceof D},D.fromNode=D.fromCallback=function(t){var e=new D(p);e._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,i=E(t)(T(e,n));return i===C&&e._rejectCallback(i.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},D.all=function(t){return new k(t).promise()},D.cast=function(t){var e=y(t);return e instanceof D||((e=new D(p))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},D.resolve=D.fulfilled=D.cast,D.reject=D.rejected=function(t){var e=new D(p);return e._captureStackTrace(),e._rejectCallback(t,!0),e},D.setScheduler=function(t){if("function"!=typeof t)throw new _("expecting a function but got "+c.classString(t));return h.setScheduler(t)},D.prototype._then=function(t,e,n,i,r){var a=void 0!==r,o=a?r:new D(p),l=this._target(),u=l._bitField;a||(o._propagateFrom(this,3),o._captureStackTrace(),void 0===i&&0!=(2097152&this._bitField)&&(i=0!=(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,o));var d=s();if(0!=(50397184&u)){var f,_,v=l._settlePromiseCtx;0!=(33554432&u)?(_=l._rejectionHandler0,f=t):0!=(16777216&u)?(_=l._fulfillmentHandler0,f=e,l._unsetRejectionIsUnhandled()):(v=l._settlePromiseLateCancellationObserver,_=new g("late cancellation observer"),l._attachExtraTrace(_),f=e),h.invoke(v,l,{handler:null===d?f:"function"==typeof f&&c.domainBind(d,f),promise:o,receiver:i,value:_})}else l._addCallbacks(t,e,o,i,d);return o},D.prototype._length=function(){return 65535&this._bitField},D.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},D.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},D.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},D.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},D.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},D.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},D.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},D.prototype._isFinal=function(){return(4194304&this._bitField)>0},D.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},D.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},D.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},D.prototype._setAsyncGuaranteed=function(){h.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},D.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==l)return void 0===e&&this._isBound()?this._boundValue():e},D.prototype._promiseAt=function(t){return this[4*t-4+2]},D.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},D.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},D.prototype._boundValue=function(){},D.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,n=t._rejectionHandler0,i=t._promise0,r=t._receiverAt(0);void 0===r&&(r=l),this._addCallbacks(e,n,i,r,null)},D.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),i=t._rejectionHandlerAt(e),r=t._promiseAt(e),a=t._receiverAt(e);void 0===a&&(a=l),this._addCallbacks(n,i,r,a,null)},D.prototype._addCallbacks=function(t,e,n,i,r){var a=this._length();if(a>=65531&&(a=0,this._setLength(0)),0===a)this._promise0=n,this._receiver0=i,"function"==typeof t&&(this._fulfillmentHandler0=null===r?t:c.domainBind(r,t)),"function"==typeof e&&(this._rejectionHandler0=null===r?e:c.domainBind(r,e));else{var o=4*a-4;this[o+2]=n,this[o+3]=i,"function"==typeof t&&(this[o+0]=null===r?t:c.domainBind(r,t)),"function"==typeof e&&(this[o+1]=null===r?e:c.domainBind(r,e))}return this._setLength(a+1),a},D.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},D.prototype._resolveCallback=function(t,e){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(i(),!1);var n=y(t,this);if(!(n instanceof D))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r!==this){var a=r._bitField;if(0==(50397184&a)){var o=this._length();o>0&&r._migrateCallback0(this);for(var s=1;s>>16)){if(t===this){var n=i();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!=(134217728&e)?this._settlePromises():h.settlePromises(this),this._dereferenceTrace())}},D.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return h.fatalError(t,c.isNode);(65535&e)>0?h.settlePromises(this):this._ensurePossibleRejectionHandled()}},D.prototype._fulfillPromises=function(t,e){for(var n=1;n0){if(0!=(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var i=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,i,t),this._fulfillPromises(e,i)}this._setLength(0)}this._clearCancellationData()},D.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},D.defer=D.pending=function(){return x.deprecated("Promise.defer","new Promise"),{promise:new D(p),resolve:A,reject:M}},c.notEnumerableProp(D,"_makeSelfResolutionError",i),t("./method")(D,p,y,a,x),t("./bind")(D,p,y,x),t("./cancel")(D,k,a,x),t("./direct_resolve")(D),t("./synchronous_inspection")(D),t("./join")(D,k,y,p,h,s),D.Promise=D,D.version="3.5.4",t("./map.js")(D,k,a,y,p,x),t("./call_get.js")(D),t("./using.js")(D,a,y,w,p,x),t("./timers.js")(D,p,x),t("./generators.js")(D,a,p,y,o,x),t("./nodeify.js")(D),t("./promisify.js")(D,p),t("./props.js")(D,k,y,a),t("./race.js")(D,p,y,a),t("./reduce.js")(D,k,a,y,p,x),t("./settle.js")(D,k,x),t("./some.js")(D,k,a),t("./filter.js")(D,p),t("./each.js")(D,p),t("./any.js")(D),c.toFastProperties(D),c.toFastProperties(D.prototype),I({a:1}),I({b:2}),I({c:3}),I(1),I(function(){}),I(void 0),I(!1),I(new D(p)),x.setBounds(d.firstLineError,c.lastLineError),D}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,i,r,a){var o=t("./util");o.isArray;function s(t){var i=this._promise=new e(n);t instanceof e&&i._propagateFrom(t,3),i._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return o.inherits(s,a),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(n,a){var s=i(this._values,this._promise);if(s instanceof e){var l=(s=s._target())._bitField;if(this._values=s,0==(50397184&l))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,a);if(0==(33554432&l))return 0!=(16777216&l)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=o.asArray(s)))0!==s.length?this._iterate(s):-5===a?this._resolveEmptyArray():this._resolve(function(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}(a));else{var c=r("expecting an array or an iterable object but got "+o.classString(s)).reason();this._promise._rejectCallback(c,!1)}},s.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var r=this._promise,a=!1,o=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;n=this._length){var n;if(this._isMap)n=function(t){for(var e=new a,n=t.length/2|0,i=0;i>1},e.prototype.props=function(){return d(this)},e.props=function(t){return d(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacity=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseFulfilled=function(t,e){var n=new r;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},a.prototype._promiseRejected=function(t,e){var n=new r;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return i.deprecated(".settle()",".reflect()"),new a(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,i){var r=t("./util"),a=t("./errors").RangeError,o=t("./errors").AggregateError,s=r.isArray,l={};function c(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(t,e){if((0|e)!==e||e<0)return i("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new c(t),r=n.promise();return n.setHowMany(e),n.init(),r}r.inherits(c,n),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=s(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(t){this._howMany=t},c.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new o,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},c.prototype._fulfilled=function(){return this._totalResolved},c.prototype._rejected=function(){return this._values.length-this.length()},c.prototype._addRejected=function(t){this._values.push(t)},c.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},c.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},c.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},c.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return u(t,e)},e.prototype.some=function(t){return u(this,t)},e._SomePromiseArray=c}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},a=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},o=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},t.prototype.isPending=function(){return o.call(this._target())},t.prototype.isRejected=function(){return a.call(this._target())},t.prototype.isFulfilled=function(){return r.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),i.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){var i=t("./util"),r=i.errorObj,a=i.isObject;var o={}.hasOwnProperty;return function(t,s){if(a(t)){if(t instanceof e)return t;var l=function(t){try{return function(t){return t.then}(t)}catch(t){return r.e=t,r}}(t);if(l===r){s&&s._pushContext();var c=e.reject(l.e);return s&&s._popContext(),c}if("function"==typeof l)return function(t){try{return o.call(t,"_promise0")}catch(t){return!1}}(t)?(c=new e(n),t._then(c._fulfill,c._reject,void 0,c,null),c):function(t,a,o){var s=new e(n),l=s;o&&o._pushContext(),s._captureStackTrace(),o&&o._popContext();var c=!0,u=i.tryCatch(a).call(t,function(t){s&&(s._resolveCallback(t),s=null)},function(t){s&&(s._rejectCallback(t,c,!0),s=null)});return c=!1,s&&u===r&&(s._rejectCallback(u.e,!0,!0),s=null),l}(t,l,s)}return t}}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,i){var r=t("./util"),a=e.TimeoutError;function o(t){this.handle=t}o.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(t){return l(+this).thenReturn(t)},l=e.delay=function(t,r){var a,l;return void 0!==r?(a=e.resolve(r)._then(s,null,null,t,void 0),i.cancellation()&&r instanceof e&&a._setOnCancel(r)):(a=new e(n),l=setTimeout(function(){a._fulfill()},+t),i.cancellation()&&a._setOnCancel(new o(l)),a._captureStackTrace()),a._setAsyncGuaranteed(),a};e.prototype.delay=function(t){return l(t,this)};function c(t){return clearTimeout(this.handle),t}function u(t){throw clearTimeout(this.handle),t}e.prototype.timeout=function(t,e){var n,s;t=+t;var l=new o(setTimeout(function(){n.isPending()&&function(t,e,n){var i;i="string"!=typeof e?e instanceof Error?e:new a("operation timed out"):new a(e),r.markAsOriginatingFromRejection(i),t._attachExtraTrace(i),t._reject(i),null!=n&&n.cancel()}(n,e,s)},t));return i.cancellation()?(s=this.then(),(n=s._then(c,u,void 0,l,void 0))._setOnCancel(l)):n=this._then(c,u,void 0,l,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,i,r,a,o){var s=t("./util"),l=t("./errors").TypeError,c=t("./util").inherits,u=s.errorObj,d=s.tryCatch,h={};function f(t){setTimeout(function(){throw t},0)}function _(t,n){var r=0,o=t.length,s=new e(a);return function a(){if(r>=o)return s._fulfill();var l=function(t){var e=i(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(t[r++]);if(l instanceof e&&l._isDisposable()){try{l=i(l._getDisposer().tryDispose(n),t.promise)}catch(t){return f(t)}if(l instanceof e)return l._then(a,f,null,null,null)}a()}(),s}function g(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function v(t){return g.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function m(t){this.length=t,this.promise=null,this[t-1]=null}g.prototype.data=function(){return this._data},g.prototype.promise=function(){return this._promise},g.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():h},g.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var i=e!==h?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,i},g.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},c(p,g),p.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},m.prototype._resultCancelled=function(){for(var t=this.length,n=0;n0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,r());throw new l}}},{"./errors":12,"./util":36}],36:[function(t,e,r){"use strict";var a=t("./es5"),o="undefined"==typeof navigator,s={e:{}},c,u="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i?i:void 0!==this?this:null;function d(){try{var t=c;return c=null,t.apply(this,arguments)}catch(t){return s.e=t,s}}function h(t){return c=t,d}var f=function(t,e){var n={}.hasOwnProperty;function i(){for(var i in this.constructor=t,this.constructor$=e,e.prototype)n.call(e.prototype,i)&&"$"!==i.charAt(i.length-1)&&(this[i+"$"]=e.prototype[i])}return i.prototype=e.prototype,t.prototype=new i,t.prototype};function _(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function g(t){return"function"==typeof t||"object"===l(t)&&null!==t}function p(t){return _(t)?new Error(E(t)):t}function v(t,e){var n,i=t.length,r=new Array(i+1);for(n=0;n1,i=e.length>0&&!(1===e.length&&"constructor"===e[0]),r=w.test(t+"")&&a.names(t).length>0;if(n||i||r)return!0}return!1}catch(t){return!1}}function S(t){function e(){}e.prototype=t;var n=new e;function i(){return l(n.foo)}return i(),i(),t}var $=/^[a-z$_][a-z$_0-9]*$/i;function T(t){return $.test(t)}function C(t,e,n){for(var i=new Array(t),r=0;r10||t[0]>0}(),V.isNode&&V.toFastProperties(n);try{throw new Error}catch(t){V.lastLineError=t}e.exports=V},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,n(46),n(14),n(222).setImmediate)},function(t,e,n){t.exports=n(223)},function(t,e,n){var i=n(0);t.exports=function(){var t={};return{getState:function(e){if(t[e])return t[e].method();var n={};for(var r in t)t[r].internal||i.mixin(n,t[r].method(),!0);return n},registerProvider:function(e,n,i){t[e]={method:n,internal:i}},unregisterProvider:function(e){delete t[e]}}}},function(t,e){t.exports=function(t){var e={};function n(n,i,r){r=r||n;var a=t.config,o=t.templates;t.config[n]&&e[r]!=a[n]&&(i&&o[r]||(o[r]=t.date.date_to_str(a[n]),e[r]=a[n]))}return{initTemplates:function(){var e=t.locale.labels;e.gantt_save_btn=e.icon_save,e.gantt_cancel_btn=e.icon_cancel,e.gantt_delete_btn=e.icon_delete;var i=t.date,r=i.date_to_str,a=t.config,o=r(a.xml_date||a.date_format,a.server_utc),s=i.str_to_date(a.xml_date||a.date_format,a.server_utc);n("date_scale",!0,void 0,t.config,t.templates),n("date_grid",!0,"grid_date_format",t.config,t.templates),n("task_date",!0,void 0,t.config,t.templates),t.mixin(t.templates,{xml_format:void 0,format_date:o,xml_date:void 0,parse_date:s,progress_text:function(t,e,n){return""},grid_header_class:function(t,e){return""},task_text:function(t,e,n){return n.text},task_class:function(t,e,n){return""},task_end_date:function(e){return t.templates.task_date(e)},grid_row_class:function(t,e,n){return""},task_row_class:function(t,e,n){return""},timeline_cell_class:function(t,e){return""},scale_cell_class:function(t){return""},scale_row_class:function(t){return""},grid_indent:function(t){return"
"},grid_folder:function(t){return"
"},grid_file:function(t){return"
"},grid_open:function(t){return"
"},grid_blank:function(t){return"
"},date_grid:function(e,n,i){return n&&t.isUnscheduledTask(n)&&t.config.show_unscheduled?t.templates.task_unscheduled_time(n):t.templates.grid_date_format(e,i)},task_time:function(e,n,i){return t.isUnscheduledTask(i)&&t.config.show_unscheduled?t.templates.task_unscheduled_time(i):t.templates.task_date(e)+" - "+t.templates.task_end_date(n)},task_unscheduled_time:function(t){return""},time_picker:r(a.time_picker),link_class:function(t){return""},link_description:function(e){var n=t.getTask(e.source),i=t.getTask(e.target);return""+n.text+""+i.text+""},drag_link:function(e,n,i,r){e=t.getTask(e);var a=t.locale.labels,o=""+e.text+" "+(n?a.link_start:a.link_end)+"
";return i&&(o+=" "+(i=t.getTask(i)).text+" "+(r?a.link_start:a.link_end)+"
"),o},drag_link_class:function(e,n,i,r){var a="";return e&&i&&(a=" "+(t.isLinkAllowed(e,i,n,r)?"gantt_link_allow":"gantt_link_deny")),"gantt_link_tooltip"+a},tooltip_date_format:i.date_to_str("%Y-%m-%d"),tooltip_text:function(e,n,i){return"Task: "+i.text+"
Start date: "+t.templates.tooltip_date_format(e)+"
End date: "+t.templates.tooltip_date_format(n)}})},initTemplate:n}}},function(t,e,n){var i=n(4),r=n(0),a=n(47),o=n(12),s=n(1);t.exports=function(t){function e(t){return{target:t.target||t.srcElement,pageX:t.pageX,pageY:t.pageY,clientX:t.clientX,clientY:t.clientY,metaKey:t.metaKey,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey}}function n(n,a){this._obj=n,this._settings=a||{},i(this);var o=this.getInputMethods();this._drag_start_timer=null,t.attachEvent("onGanttScroll",r.bind(function(t,e){this.clearDragTimer()},this));for(var l={passive:!1},c=0;cthis.config.sensitivity},initDnDMarker:function(){var t=this.config.marker=document.createElement("div");t.className="gantt_drag_marker",t.innerHTML="",document.body.appendChild(t)},backupEventTarget:function(n,i){if(t.config.touch){var r=i(n),a=r.target||r.srcElement,o=a.cloneNode(!0);this.config.original_target=e(r),this.config.original_target.target=o,this.config.backup_element=a,a.parentNode.appendChild(o),a.style.display="none",(this.config.mousemoveContainer||document.body).appendChild(a)}},getInputMethods:function(){var e=[];if(e.push({move:"mousemove",down:"mousedown",up:"mouseup",accessor:function(t){return t}}),t.config.touch){var n=!0;try{document.createEvent("TouchEvent")}catch(t){n=!1}n?e.push({move:"touchmove",down:"touchstart",up:"touchend",accessor:function(t){return t.touches&&t.touches.length>1?null:t.touches[0]?{target:document.elementFromPoint(t.touches[0].clientX,t.touches[0].clientY),pageX:t.touches[0].pageX,pageY:t.touches[0].pageY,clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}:t}}):o.navigator.pointerEnabled?e.push({move:"pointermove",down:"pointerdown",up:"pointerup",accessor:function(t){return"mouse"==t.pointerType?null:t}}):o.navigator.msPointerEnabled&&e.push({move:"MSPointerMove",down:"MSPointerDown",up:"MSPointerUp",accessor:function(t){return t.pointerType==t.MSPOINTER_TYPE_MOUSE?null:t}})}return e},clearDragTimer:function(){this._drag_start_timer&&(clearTimeout(this._drag_start_timer),this._drag_start_timer=null)},dragStart:function(e,n,i){this.config&&this.config.started||(this.config={obj:e,marker:null,started:!1,pos:this.getPosition(n),sensitivity:4},this._settings&&r.mixin(this.config,this._settings,!0),this.traceDragEvents(e,i),t._prevent_touch_scroll=!0,document.body.className+=" gantt_noselect",t.config.touch&&this.dragMove(e,n,i.accessor))},dragMove:function(e,n,i){var r=i(n);if(!r)return!1;if(!this.config.marker&&!this.config.started){var a=this.getPosition(r);if(t.config.touch||this.checkPositionChange(a)){if(this.config.started=!0,this.config.ignore=!1,!1===this.callEvent("onBeforeDragStart",[e,this.config.original_target]))return this.config.ignore=!0,!1;this.backupEventTarget(n,i),this.initDnDMarker(),t._touch_feedback(),this.callEvent("onAfterDragStart",[e,this.config.original_target])}else this.config.ignore=!0}if(!this.config.ignore){if(n.targetTouches&&!r.target)return;return r.pos=this.getPosition(r),this.config.marker.style.left=r.pos.x+"px",this.config.marker.style.top=r.pos.y+"px",this.callEvent("onDragMove",[e,r]),!0}return!1},dragEnd:function(e){var n=this.config.backup_element;n&&n.parentNode&&n.parentNode.removeChild(n),t._prevent_touch_scroll=!1,this.config.marker&&(this.config.marker.parentNode.removeChild(this.config.marker),this.config.marker=null,this.callEvent("onDragEnd",[])),this.config.started=!1,document.body.className=document.body.className.replace(" gantt_noselect","")},getPosition:function(t){var e=0,n=0;return t.pageX||t.pageY?(e=t.pageX,n=t.pageY):(t.clientX||t.clientY)&&(e=t.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,n=t.clientY+document.body.scrollTop+document.documentElement.scrollTop),{x:e,y:n}}},n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={date_to_str:function(t,e,n){return function(i){return t.replace(/%[a-zA-Z]/g,function(t){switch(t){case"%d":return e?n.date.to_fixed(i.getUTCDate()):n.date.to_fixed(i.getDate());case"%m":return e?n.date.to_fixed(i.getUTCMonth()+1):n.date.to_fixed(i.getMonth()+1);case"%j":return e?i.getUTCDate():i.getDate();case"%n":return e?i.getUTCMonth()+1:i.getMonth()+1;case"%y":return e?n.date.to_fixed(i.getUTCFullYear()%100):n.date.to_fixed(i.getFullYear()%100);case"%Y":return e?i.getUTCFullYear():i.getFullYear();case"%D":return e?n.locale.date.day_short[i.getUTCDay()]:n.locale.date.day_short[i.getDay()];case"%l":return e?n.locale.date.day_full[i.getUTCDay()]:n.locale.date.day_full[i.getDay()];case"%M":return e?n.locale.date.month_short[i.getUTCMonth()]:n.locale.date.month_short[i.getMonth()];case"%F":return e?n.locale.date.month_full[i.getUTCMonth()]:n.locale.date.month_full[i.getMonth()];case"%h":return e?n.date.to_fixed((i.getUTCHours()+11)%12+1):n.date.to_fixed((i.getHours()+11)%12+1);case"%g":return e?(i.getUTCHours()+11)%12+1:(i.getHours()+11)%12+1;case"%G":return e?i.getUTCHours():i.getHours();case"%H":return e?n.date.to_fixed(i.getUTCHours()):n.date.to_fixed(i.getHours());case"%i":return e?n.date.to_fixed(i.getUTCMinutes()):n.date.to_fixed(i.getMinutes());case"%a":return e?i.getUTCHours()>11?"pm":"am":i.getHours()>11?"pm":"am";case"%A":return e?i.getUTCHours()>11?"PM":"AM":i.getHours()>11?"PM":"AM";case"%s":return e?n.date.to_fixed(i.getUTCSeconds()):n.date.to_fixed(i.getSeconds());case"%W":return e?n.date.to_fixed(n.date.getUTCISOWeek(i)):n.date.to_fixed(n.date.getISOWeek(i));default:return t}})}},str_to_date:function(t,e,n){return function(i){for(var r=[0,0,1,0,0,0],a=i.match(/[a-zA-Z]+|[0-9]+/g),o=t.match(/%[a-zA-Z]/g),s=0;s50?1900:2e3);break;case"%g":case"%G":case"%h":case"%H":r[3]=a[s]||0;break;case"%i":r[4]=a[s]||0;break;case"%Y":r[0]=a[s]||0;break;case"%a":case"%A":r[3]=r[3]%12+("am"===(a[s]||"").toLowerCase()?0:12);break;case"%s":r[5]=a[s]||0;break;case"%M":r[1]=n.locale.date.month_short_hash[a[s]]||0;break;case"%F":r[1]=n.locale.date.month_full_hash[a[s]]||0}return e?new Date(Date.UTC(r[0],r[1],r[2],r[3],r[4],r[5])):new Date(r[0],r[1],r[2],r[3],r[4],r[5])}}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={date_to_str:function(t,e,n){t=t.replace(/%[a-zA-Z]/g,function(t){switch(t){case"%d":return'"+to_fixed(date.get'+(e?"UTC":"")+'Date())+"';case"%m":return'"+to_fixed((date.get'+(e?"UTC":"")+'Month()+1))+"';case"%j":return'"+date.get'+(e?"UTC":"")+'Date()+"';case"%n":return'"+(date.get'+(e?"UTC":"")+'Month()+1)+"';case"%y":return'"+to_fixed(date.get'+(e?"UTC":"")+'FullYear()%100)+"';case"%Y":return'"+date.get'+(e?"UTC":"")+'FullYear()+"';case"%D":return'"+locale.date.day_short[date.get'+(e?"UTC":"")+'Day()]+"';case"%l":return'"+locale.date.day_full[date.get'+(e?"UTC":"")+'Day()]+"';case"%M":return'"+locale.date.month_short[date.get'+(e?"UTC":"")+'Month()]+"';case"%F":return'"+locale.date.month_full[date.get'+(e?"UTC":"")+'Month()]+"';case"%h":return'"+to_fixed((date.get'+(e?"UTC":"")+'Hours()+11)%12+1)+"';case"%g":return'"+((date.get'+(e?"UTC":"")+'Hours()+11)%12+1)+"';case"%G":return'"+date.get'+(e?"UTC":"")+'Hours()+"';case"%H":return'"+to_fixed(date.get'+(e?"UTC":"")+'Hours())+"';case"%i":return'"+to_fixed(date.get'+(e?"UTC":"")+'Minutes())+"';case"%a":return'"+(date.get'+(e?"UTC":"")+'Hours()>11?"pm":"am")+"';case"%A":return'"+(date.get'+(e?"UTC":"")+'Hours()>11?"PM":"AM")+"';case"%s":return'"+to_fixed(date.get'+(e?"UTC":"")+'Seconds())+"';case"%W":return'"+to_fixed(getISOWeek(date))+"';case"%w":return'"+to_fixed(getWeek(date))+"';default:return t}});var i=new Function("date","to_fixed","locale","getISOWeek","getWeek",'return "'+t+'";');return function(t){return i(t,n.date.to_fixed,n.locale,n.date.getISOWeek,n.date.getWeek)}},str_to_date:function(t,e,n){for(var i="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);",r=t.match(/%[a-zA-Z]/g),a=0;a50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":i+="set[3]=temp["+a+"]||0;";break;case"%i":i+="set[4]=temp["+a+"]||0;";break;case"%Y":i+="set[0]=temp["+a+"]||0;";break;case"%a":case"%A":i+="set[3]=set[3]%12+((temp["+a+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":i+="set[5]=temp["+a+"]||0;";break;case"%M":i+="set[1]=locale.date.month_short_hash[temp["+a+"]]||0;";break;case"%F":i+="set[1]=locale.date.month_full_hash[temp["+a+"]]||0;"}var o="set[0],set[1],set[2],set[3],set[4],set[5]";e&&(o=" Date.UTC("+o+")");var s=new Function("date","locale","var set=[0,0,1,0,0,0]; "+i+" return new Date("+o+");");return function(t){return s(t,n.locale)}}};e.default=i},function(t,e,n){var i=n(229).default,r=n(228).default;t.exports=function(t){var e=null;function n(){var n=!1;return"auto"===t.config.csp?(null===e&&function(){try{new Function("canUseCsp = false;")}catch(t){e=!0}}(),n=e):n=t.config.csp,n}return{init:function(){for(var e=t.locale,n=e.date.month_short,i=e.date.month_short_hash={},r=0;r=9?9:n>=6?6:n>=3?3:0,t.setMonth(e),t},year_start:function(t){return t.setMonth(0),this.month_start(t)},day_start:function(t){return this.date_part(t)},hour_start:function(t){return t.getMinutes()&&t.setMinutes(0),this.minute_start(t),t},minute_start:function(t){return t.getSeconds()&&t.setSeconds(0),t.getMilliseconds()&&t.setMilliseconds(0),t},_add_days:function(t,e,n){t.setDate(t.getDate()+e);var i=e>=0,r=!n.getHours()&&t.getHours(),a=t.getDate()<=n.getDate()||t.getMonth()=0?"&":"?")+"dhxr"+(new Date).getTime()+"=1"),h.open(e,n,s),c)for(var _ in c)h.setRequestHeader(_,c[_]);else"POST"==e.toUpperCase()||"PUT"==e||"DELETE"==e?h.setRequestHeader("Content-Type","application/x-www-form-urlencoded"):"GET"==e&&(o=null);if(h.setRequestHeader("X-Requested-With","XMLHttpRequest"),h.send(o),!s)return{xmlDoc:h,filePath:n}})},urlSeparator:function(t){return-1!=t.indexOf("?")?"&":"?"}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t.exports=function(){return{layout:{css:"gantt_container",rows:[{cols:[{view:"grid",scrollX:"scrollHor",scrollY:"scrollVer"},{resizer:!0,width:1},{view:"timeline",scrollX:"scrollHor",scrollY:"scrollVer"},{view:"scrollbar",id:"scrollVer"}]},{view:"scrollbar",id:"scrollHor",height:20}]},links:{finish_to_start:"0",start_to_start:"1",finish_to_finish:"2",start_to_finish:"3"},types:{task:"task",project:"project",milestone:"milestone"},auto_types:!1,duration_unit:"day",work_time:!1,correct_work_time:!1,skip_off_time:!1,cascade_delete:!0,autosize:!1,autosize_min_width:0,autoscroll:!0,autoscroll_speed:30,deepcopy_on_parse:!1,show_links:!0,show_task_cells:!0,static_background:!1,static_background_cells:!0,branch_loading:!1,branch_loading_property:"$has_child",show_loading:!1,show_chart:!0,show_grid:!0,min_duration:36e5,date_format:"%d-%m-%Y %H:%i",xml_date:void 0,start_on_monday:!0,server_utc:!1,show_progress:!0,fit_tasks:!1,select_task:!0,scroll_on_click:!0,smart_rendering:!0,preserve_scroll:!0,readonly:!1,container_resize_timeout:20,date_grid:"%Y-%m-%d",drag_links:!0,drag_progress:!0,drag_resize:!0,drag_project:!1,drag_move:!0,drag_mode:{resize:"resize",progress:"progress",move:"move",ignore:"ignore"},round_dnd_dates:!0,link_wrapper_width:20,root_id:0,autofit:!1,columns:[{name:"text",tree:!0,width:"*",resize:!0},{name:"start_date",align:"center",resize:!0},{name:"duration",align:"center"},{name:"add",width:44}],scale_offset_minimal:!0,inherit_scale_class:!1,scales:[{unit:"day",step:1,date:"%d %M"}],time_step:60,duration_step:1,task_date:"%d %F %Y",time_picker:"%H:%i",task_attribute:"data-task-id",link_attribute:"data-link-id",layer_attribute:"data-layer",buttons_left:["gantt_save_btn","gantt_cancel_btn"],_migrate_buttons:{dhx_save_btn:"gantt_save_btn",dhx_cancel_btn:"gantt_cancel_btn",dhx_delete_btn:"gantt_delete_btn"},buttons_right:["gantt_delete_btn"],lightbox:{sections:[{name:"description",height:70,map_to:"text",type:"textarea",focus:!0},{name:"time",type:"duration",map_to:"auto"}],project_sections:[{name:"description",height:70,map_to:"text",type:"textarea",focus:!0},{name:"type",type:"typeselect",map_to:"type"},{name:"time",type:"duration",readonly:!0,map_to:"auto"}],milestone_sections:[{name:"description",height:70,map_to:"text",type:"textarea",focus:!0},{name:"type",type:"typeselect",map_to:"type"},{name:"time",type:"duration",single_date:!0,map_to:"auto"}]},drag_lightbox:!0,sort:!1,details_on_create:!0,details_on_dblclick:!0,initial_scroll:!0,task_scroll_offset:100,order_branch:!1,order_branch_free:!1,task_height:void 0,bar_height:"full",min_column_width:70,min_grid_column_width:70,grid_resizer_column_attribute:"data-column-index",keep_grid_width:!1,grid_resize:!1,grid_elastic_columns:!1,show_tasks_outside_timescale:!1,show_unscheduled:!0,resize_rows:!1,task_grid_row_resizer_attribute:"data-row-index",min_task_grid_row_height:30,readonly_property:"readonly",editable_property:"editable",calendar_property:"calendar_id",resource_calendars:{},dynamic_resource_calendars:!1,inherit_calendar:!1,type_renderers:{},open_tree_initially:!1,optimize_render:!0,prevent_default_scroll:!1,show_errors:!0,wai_aria_attributes:!0,smart_scales:!0,rtl:!1,placeholder_task:!1,horizontal_scroll_key:"shiftKey",drag_timeline:{useKey:void 0,ignore:".gantt_task_line, .gantt_task_link"},drag_multiple:!0,csp:"auto"}}},function(t,e){t.exports=function(){var t={};return{services:{},setService:function(e,n){t[e]=n},getService:function(e){return t[e]?t[e]():null},dropService:function(e){t[e]&&delete t[e]},destructor:function(){for(var e in t)if(t[e]){var n=t[e];n&&n.destructor&&n.destructor()}t=null}}}},function(t,e){t.exports={KEY_CODES:{UP:38,DOWN:40,LEFT:37,RIGHT:39,SPACE:32,ENTER:13,DELETE:46,ESC:27,TAB:9}}},function(t,e,n){function i(t){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){var e=new function(){this.constants=n(235),this.version="7.1.8",this.license="site",this.templates={},this.ext={},this.keys={edit_save:this.constants.KEY_CODES.ENTER,edit_cancel:this.constants.KEY_CODES.ESC}},r=new(0,n(48).default)(t),a={};e.plugins=function(t){for(var n in t)if(t[n]&&!a[n]){var i=r.getExtension(n);i&&(i(e),a[n]=!0)}},e.$services=n(234)(),e.config=n(233)(),e.ajax=n(232)(e),e.date=n(230)(e);var o=n(227)(e);e.$services.setService("dnd",function(){return o});var s=n(226)(e);e.$services.setService("templateLoader",function(){return s}),n(4)(e);var l=new(n(225));l.registerProvider("global",function(){var t={min_date:e._min_date,max_date:e._max_date,selected_task:null};return e.$data&&e.$data.tasksStore&&(t.selected_task=e.$data.tasksStore.getSelectedId()),t}),e.getState=l.getState,e.$services.setService("state",function(){return l});var c=n(0);c.mixin(e,c),e.Promise=n(224),e.env=n(7),n(220)(e);var u=n(214);e.dataProcessor=u.DEPRECATED_api,e.createDataProcessor=u.createDataProcessor,n(209)(e),n(198)(e),n(197)(e),n(189)(e),n(188)(e),n(187)(e),n(174)(e),n(173).default(e),n(172)(e),n(171)(e),n(170)(e),n(167)(e),n(166).default(e);var d=n(165).default();return e.i18n={addLocale:d.addLocale,setLocale:function(t){if("string"==typeof t){var n=d.getLocale(t);n||(n=d.getLocale("en")),e.locale=n}else if(t)if(e.locale)for(var r in t)t[r]&&"object"===i(t[r])?(e.locale[r]||(e.locale[r]={}),e.mixin(e.locale[r],t[r],!0)):e.locale[r]=t[r];else e.locale=t},getLocale:d.getLocale},e.i18n.setLocale("en"),e}},function(t,e,n){n(31);var i=n(236);t.exports=function(t){var e=i(t);return e.env.isNode||n(131)(e),e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(48),r=n(12),a=function(){return function(t,e){var n=this;this.plugin=function(t){n._ganttPlugin.push(t),void 0!==r.gantt&&r.gantt.getTask&&t(r.gantt)},this.getGanttInstance=function(t){for(var e=n._factoryMethod(n._bundledExtensions),i=0;ithis.maxSteps;)t.shift();return e}}},t.prototype._pop=function(t){return t.pop()},t.prototype._reorderCommands=function(t){var e={any:0,link:1,task:2},n={move:1,any:0};t.commands.sort(function(t,i){if("task"===t.entity&&"task"===i.entity)return t.type!==i.type?(n[i.type]||0)-(n[t.type]||0):"move"===t.type&&t.oldValue&&i.oldValue&&i.oldValue.parent===t.oldValue.parent?t.oldValue.$index-i.oldValue.$index:0;var r=e[t.entity]||e.any;return(e[i.entity]||e.any)-r})},t.prototype._applyAction=function(t){var e=null,n=this.command.entity,i=this.command.type,r=this._gantt,a={};a[n.task]={add:"addTask",get:"getTask",update:"updateTask",remove:"deleteTask",move:"moveTask",isExists:"isTaskExists"},a[n.link]={add:"addLink",get:"getLink",update:"updateLink",remove:"deleteLink",isExists:"isLinkExists"},r.batchUpdate(function(){for(var n=0;nn.bottom&&(a.bottom=n.bottom,a.top=a.bottom-a.height),a.leftn.right&&(a.right=n.right,a.left=a.right-a.width),c.x>=a.left&&c.x<=a.right&&(a.left=c.x-a.width-o,a.right=a.left+a.width),c.y>=a.top&&c.y<=a.bottom&&(a.top=c.y-a.height-s,a.bottom=a.top+a.height),a},t.prototype._getViewPortSize=function(){var t,e=this._gantt,n=this._getViewPort(),r=n,a=window.scrollY+document.body.scrollTop,o=window.scrollX+document.body.scrollLeft;return n===e.$task_data?(r=e.$task,a=0,o=0,t=i.getNodePosition(e.$task)):t=i.getNodePosition(r),{left:t.x+o,top:t.y+a,width:t.width,height:t.height,bottom:t.y+t.height+a,right:t.x+t.width+o}},t}();e.Tooltip=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(49),r=n(1),a=n(2),o=n(242),s=function(){function t(t){this._listeners={},this.tooltip=new o.Tooltip(t),this._gantt=t,this._domEvents=i(),this._initDelayedFunctions()}return t.prototype.destructor=function(){this.tooltip.hide(),this._domEvents.detachAll()},t.prototype.hideTooltip=function(){this.delayHide()},t.prototype.attach=function(t){var e=this,n=document.body,i=this._gantt;t.global||(n=i.$root);var a=null,o=function(n){var i=r.getTargetNode(n),o=r.closest(i,t.selector);if(!r.isChildOf(i,e.tooltip.getNode())){var s=function(){a=o,t.onmouseenter(n,o)};a?o&&o===a?t.onmousemove(n,o):(t.onmouseleave(n,a),a=null,o&&o!==a&&s()):o&&s()}};this.detach(t.selector),this._domEvents.attach(n,"mousemove",o),this._listeners[t.selector]={node:n,handler:o}},t.prototype.detach=function(t){var e=this._listeners[t];e&&this._domEvents.detach(e.node,"mousemove",e.handler)},t.prototype.tooltipFor=function(t){var e=this,n=function(t){var e=t;return document.createEventObject&&!document.createEvent&&(e=document.createEventObject(t)),e};this._initDelayedFunctions(),this.attach({selector:t.selector,global:t.global,onmouseenter:function(i,r){var a=t.html(i,r);a&&e.delayShow(n(i),a)},onmousemove:function(i,r){var a=t.html(i,r);a?e.delayShow(n(i),a):(e.delayShow.$cancelTimeout(),e.delayHide())},onmouseleave:function(){e.delayShow.$cancelTimeout(),e.delayHide()}})},t.prototype._initDelayedFunctions=function(){var t=this,e=this._gantt;this.delayShow&&this.delayShow.$cancelTimeout(),this.delayHide&&this.delayHide.$cancelTimeout(),this.tooltip.hide(),this.delayShow=a.delay(function(n,i){!1===e.callEvent("onBeforeTooltip",[n])?t.tooltip.hide():(t.tooltip.setContent(i),t.tooltip.show(n))},e.config.tooltip_timeout||1),this.delayHide=a.delay(function(){t.delayShow.$cancelTimeout(),t.tooltip.hide()},e.config.tooltip_hide_timeout||1)},t}();e.TooltipManager=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(243);e.default=function(t){t.config.tooltip_timeout=30,t.config.tooltip_offset_y=20,t.config.tooltip_offset_x=10,t.config.tooltip_hide_timeout=30;var e=new i.TooltipManager(t);t.ext.tooltips=e,t.attachEvent("onGanttReady",function(){e.tooltipFor({selector:"["+t.config.task_attribute+"]:not(.gantt_task_row)",html:function(e){if(!t.config.touch||t.config.touch_tooltip){var n=t.locate(e);if(t.isTaskExists(n)){var i=t.getTask(n);return t.templates.tooltip_text(i.start_date,i.end_date,i)}return null}},global:!1})}),t.attachEvent("onDestroy",function(){e.destructor()}),t.attachEvent("onLightbox",function(){e.hideTooltip()}),t.attachEvent("onBeforeTooltip",function(){if(t.getState().link_source_id)return!1}),t.attachEvent("onGanttScroll",function(){e.hideTooltip()})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){var e=this;this.show=function(t,n){void 0===n?e._showForTask(t):e._showAtCoordinates(t,n)},this.hide=function(t){var n=e._gantt,i=e._quickInfoBox;e._quickInfoBoxId=0;var r=e._quickInfoTask;if(e._quickInfoTask=null,i&&i.parentNode){if(n.config.quick_info_detached)return n.callEvent("onAfterQuickInfo",[r]),i.parentNode.removeChild(i);i.className+=" gantt_qi_hidden","auto"===i.style.right?i.style.left="-350px":i.style.right="-350px",t&&(i.style.left=i.style.right="",i.parentNode.removeChild(i)),n.callEvent("onAfterQuickInfo",[r])}},this.getNode=function(){return e._quickInfoBox?e._quickInfoBox:null},this.setContainer=function(t){t&&(e._container="string"==typeof t?document.getElementById(t):t)},this.setContent=function(t){var n=e._gantt,i={taskId:null,header:{title:"",date:""},content:"",buttons:n.config.quickinfo_buttons};t||(t=i),t.taskId||(t.taskId=i.taskId),t.header||(t.header=i.header),t.header.title||(t.header.title=i.header.title),t.header.date||(t.header.date=i.header.date),t.content||(t.content=i.content),t.buttons||(t.buttons=i.buttons);var r=e.getNode();r||(r=e._createQuickInfoElement()),t.taskId&&(e._quickInfoBoxId=t.taskId);var a=r.querySelector(".gantt_cal_qi_title"),o=a.querySelector(".gantt_cal_qi_tcontent"),s=a.querySelector(".gantt_cal_qi_tdate"),l=r.querySelector(".gantt_cal_qi_content"),c=r.querySelector(".gantt_cal_qi_controls");n._waiAria.quickInfoHeader(r,[t.header.title,t.header.date].join(" ")),o.innerHTML=t.header.title,s.innerHTML=t.header.date,t.header.title||t.header.date?a.style.display="":a.style.display="none",l.innerHTML=t.content;var u=t.buttons;u.length?c.style.display="":c.style.display="none";for(var d="",h=0;h
"+n.locale.labels[u[h]]+"
"}c.innerHTML=d,n.eventRemove(r,"click",e._qiButtonClickHandler),n.eventRemove(r,"keypress",e._qiKeyPressHandler),n.event(r,"click",e._qiButtonClickHandler),n.event(r,"keypress",e._qiKeyPressHandler)},this._qiButtonClickHandler=function(t){t=t||event,e._qi_button_click(t.target||t.srcElement)},this._qiKeyPressHandler=function(t){var n=(t=t||event).which||event.keyCode;13!==n&&32!==n||setTimeout(function(){e._qi_button_click(t.target||t.srcElement)},1)},this._gantt=t}return t.prototype._showAtCoordinates=function(t,e){this.hide(!0),this._quickInfoBoxId=0,this._quickInfoTask=null,this._quickInfoBox||(this._createQuickInfoElement(),this.setContent()),this._appendAtCoordinates(t,e),this._gantt.callEvent("onQuickInfo",[null])},t.prototype._showForTask=function(t){var e=this._gantt;if((t!==this._quickInfoBoxId||!e.utils.dom.isChildOf(this._quickInfoBox,document.body))&&e.config.show_quick_info){this.hide(!0);var n=this._getContainer(),i=this._get_event_counter_part(t,6,n.xViewport,n.yViewport);i&&(this._quickInfoBox=this._init_quick_info(t),this._quickInfoTask=t,this._quickInfoBox.className=this._prepare_quick_info_classname(t),this._fill_quick_data(t),this._show_quick_info(i,6),e.callEvent("onQuickInfo",[t]))}},t.prototype._get_event_counter_part=function(t,e,n,i){var r=this._gantt,a=r.getTaskNode(t);if(!a&&!(a=r.getTaskRowNode(t)))return null;var o=0,s=e+a.offsetTop+a.offsetHeight,l=a;if(r.utils.dom.isChildOf(l,n))for(;l&&l!==n;)o+=l.offsetLeft,l=l.offsetParent;var c=r.getScrollState();return l?{left:o,top:s,dx:o+a.offsetWidth/2-c.x>n.offsetWidth/2?1:0,dy:s+a.offsetHeight/2-c.y>i.offsetHeight/2?1:0,width:a.offsetWidth,height:a.offsetHeight}:null},t.prototype._createQuickInfoElement=function(){var t=this,e=this._gantt,n=document.createElement("div");n.className+="gantt_cal_quick_info",e._waiAria.quickInfoAttr(n);var i='
';if(i+='
',i+="
",n.innerHTML=i,e.config.quick_info_detached){var r=this._getContainer();e.event(r.parent,"scroll",function(){t.hide()})}return this._quickInfoBox=n,n},t.prototype._init_quick_info=function(t){var e=this._gantt,n=e.getTask(t);return"boolean"==typeof this._quickInfoReadonly&&e.isReadonly(n)!==this._quickInfoReadonly&&(this.hide(!0),this._quickInfoBox=null),this._quickInfoReadonly=e.isReadonly(n),this._quickInfoBox||(this._quickInfoBox=this._createQuickInfoElement()),this._quickInfoBox},t.prototype._prepare_quick_info_classname=function(t){var e=this._gantt,n=e.getTask(t),i="gantt_cal_quick_info",r=e.templates.quick_info_class(n.start_date,n.end_date,n);return r&&(i+=" "+r),i},t.prototype._fill_quick_data=function(t){var e=this._gantt,n=e.getTask(t);this._quickInfoBoxId=t;var i=[];if(this._quickInfoReadonly)for(var r=e.config.quickinfo_buttons,a={icon_delete:!0,icon_edit:!0},o=0;oc.offsetHeight/2&&(h=t.top-(o+t.height+2*e))t.getGlobalTaskIndex(n)?1:-1}),e},forSelected:function(t){for(var e=this.getSelected(),n=0;nl?t.getNext(c):t.getPrev(c);for(c=n;t.getGlobalTaskIndex(c)!==i;)this.select(c,e)&&!a&&(a=!0,r=c),c=i>s?t.getNext(c):t.getPrev(c)}}else o=n}.bind(this);return s&&(e.ctrlKey||e.metaKey)?(this.isSelected(n)||this.setFirstSelected(n),n&&this.toggle(n,e)):s&&e.shiftKey?(t.isTaskExists(this.getFirstSelected())&&null!==this.getFirstSelected()||this.setFirstSelected(n),i.length?c():l()):l(),this.isSelected(n)?this.setLastSelected(n):r?n==o&&this.setLastSelected(e.shiftKey?r:this.getDefaultSelected()):this.setLastSelected(null),this.getSelected().length||this.setLastSelected(null),this.getLastSelected()&&this.isSelected(this.getFirstSelected())||this.setFirstSelected(this.getLastSelected()),!0}},function(){var e=t.selectTask;t.selectTask=function(n){if(!(n=i(n,this.config.root_id)))return!1;var r=t._multiselect,a=n;return r.isActive()?(r.select(n,null)&&r.setLastSelected(n),r.setFirstSelected(r.getLastSelected())):a=e.call(this,n),a};var n=t.unselectTask;t.unselectTask=function(e){var i=t._multiselect,r=i.isActive();(e=e||i.getLastSelected())&&r&&(i.unselect(e,null),e==i.getLastSelected()&&i.setLastSelected(null),t.refreshTask(e),i.setFirstSelected(i.getLastSelected()));var a=e;return r||(a=n.call(this,e)),a},t.toggleTaskSelection=function(e){var n=t._multiselect;e&&n.isActive()&&(n.toggle(e),n.setFirstSelected(n.getLastSelected()))},t.getSelectedTasks=function(){var e=t._multiselect;return e.isActive(),e.getSelected()},t.eachSelectedTask=function(t){return this._multiselect.forSelected(t)},t.isSelectedTask=function(t){return this._multiselect.isSelected(t)},t.getLastSelectedTask=function(){return this._multiselect.getLastSelected()},t.attachEvent("onGanttReady",function(){var e=t.$data.tasksStore.isSelected;t.$data.tasksStore.isSelected=function(n){return t._multiselect.isActive()?t._multiselect.isSelected(n):e.call(this,n)}})}(),t.attachEvent("onTaskIdChange",function(e,n){var i=t._multiselect;if(!i.isActive())return!0;t.isSelectedTask(e)&&(i.unselect(e,null),i.select(n,null))}),t.attachEvent("onAfterTaskDelete",function(e,n){var i=t._multiselect;if(!i.isActive())return!0;i._selected[e]&&(i.unselect(e,null),i._selected[e]=!1,i.setLastSelected(i.getDefaultSelected())),i.forSelected(function(e){t.isTaskExists(e)||i.unselect(e,null)})}),t.attachEvent("onBeforeTaskMultiSelect",function(e,n,i){var r=t._multiselect;return!(n&&r.isActive()&&r._one_level)||r.isSameLevel(e)}),t.attachEvent("onTaskClick",function(e,n){return t._multiselect.doSelection(n)&&t.callEvent("onMultiSelect",[n]),!0})}},function(t,e){t.exports=function(t){function e(e){if(!t.config.show_markers)return!1;if(!e.start_date)return!1;var n=t.getState();if(!(+e.start_date>+n.max_date||(!e.end_date||+e.end_date<+n.min_date)&&+e.start_date<+n.min_date)){var i=document.createElement("div");i.setAttribute("data-marker-id",e.id);var r="gantt_marker";t.templates.marker_class&&(r+=" "+t.templates.marker_class(e)),e.css&&(r+=" "+e.css),e.title&&(i.title=e.title),i.className=r;var a=t.posFromDate(e.start_date);if(i.style.left=a+"px",i.style.height=Math.max(t.getRowTop(t.getVisibleTaskCount()),0)+"px",e.end_date){var o=t.posFromDate(e.end_date);i.style.width=Math.max(o-a,0)+"px"}return e.text&&(i.innerHTML="
"+e.text+"
"),i}}function n(){if(t.$task_data){var e=document.createElement("div");e.className="gantt_marker_area",t.$task_data.appendChild(e),t.$marker_area=e}}t._markers||(t._markers=t.createDatastore({name:"marker",initItem:function(e){return e.id=e.id||t.uid(),e}})),t.config.show_markers=!0,t.attachEvent("onBeforeGanttRender",function(){t.$marker_area||n()}),t.attachEvent("onDataRender",function(){t.$marker_area||(n(),t.renderMarkers())}),t.attachEvent("onGanttLayoutReady",function(){t.attachEvent("onBeforeGanttRender",function(){n(),t.$services.getService("layers").createDataRender({name:"marker",defaultContainer:function(){return t.$marker_area}}).addLayer(e)},{once:!0})}),t.getMarker=function(t){return this._markers?this._markers.getItem(t):null},t.addMarker=function(t){return this._markers.addItem(t)},t.deleteMarker=function(t){return!!this._markers.exists(t)&&(this._markers.removeItem(t),!0)},t.updateMarker=function(t){this._markers.refresh(t)},t._getMarkers=function(){return this._markers.getItems()},t.renderMarkers=function(){this._markers.refresh()}}},function(t,e){t.exports=function(t){t.$keyboardNavigation.dispatcher={isActive:!1,activeNode:null,globalNode:new t.$keyboardNavigation.GanttNode,enable:function(){this.isActive=!0,this.setActiveNode(this.getActiveNode())},disable:function(){this.isActive=!1},isEnabled:function(){return!!this.isActive},getDefaultNode:function(){var e;return(e=t.config.keyboard_navigation_cells?new t.$keyboardNavigation.TaskCell:new t.$keyboardNavigation.TaskRow).isValid()||(e=e.fallback()),e},setDefaultNode:function(){this.setActiveNode(this.getDefaultNode())},getActiveNode:function(){var t=this.activeNode;return t&&!t.isValid()&&(t=t.fallback()),t},fromDomElement:function(e){for(var n=[t.$keyboardNavigation.TaskRow,t.$keyboardNavigation.TaskCell,t.$keyboardNavigation.HeaderCell],i=0;i=0&&!i[r];)r--;i[r]&&(n=new t.$keyboardNavigation.TaskCell(e.taskId,r))}return n},fromDomElement:function(n){if(!t.config.keyboard_navigation_cells)return null;var i=t.locate(n);if(t.isTaskExists(i)){var r=0,a=e.locateAttribute(n,"data-column-index");return a&&(r=1*a.getAttribute("data-column-index")),new t.$keyboardNavigation.TaskCell(i,r)}return null},getNode:function(){if(t.isTaskExists(this.taskId)&&t.isTaskVisible(this.taskId)){if(t.config.show_grid){var e=t.$grid.querySelector(".gantt_row["+t.config.task_attribute+"='"+this.taskId+"']");return e?e.querySelector("[data-column-index='"+this.columnIndex+"']"):null}return t.getTaskNode(this.taskId)}},keys:{up:function(){var e=null,n=t.getPrev(this.taskId);e=t.isTaskExists(n)?new t.$keyboardNavigation.TaskCell(n,this.columnIndex):new t.$keyboardNavigation.HeaderCell(this.columnIndex),this.moveTo(e)},down:function(){var e=t.getNext(this.taskId);t.isTaskExists(e)&&this.moveTo(new t.$keyboardNavigation.TaskCell(e,this.columnIndex))},left:function(){this.columnIndex>0&&this.moveTo(new t.$keyboardNavigation.TaskCell(this.taskId,this.columnIndex-1))},right:function(){var e=t.getGridColumns();this.columnIndex-1},fallback:function(){if(!t.getVisibleTaskCount()){var e=new t.$keyboardNavigation.HeaderCell;return e.isValid()?e:null}var n=-1;if(t.getTaskByIndex(this.index-1))n=this.index-1;else if(t.getTaskByIndex(this.index+1))n=this.index+1;else for(var i=this.index;i>=0;){if(t.getTaskByIndex(i)){n=i;break}i--}if(n>-1)return new t.$keyboardNavigation.TaskRow(t.getTaskByIndex(n).id)},fromDomElement:function(e){if(t.config.keyboard_navigation_cells)return null;var n=t.locate(e);return t.isTaskExists(n)?new t.$keyboardNavigation.TaskRow(n):null},getNode:function(){if(t.isTaskExists(this.taskId)&&t.isTaskVisible(this.taskId))return t.config.show_grid?t.$grid.querySelector(".gantt_row["+t.config.task_attribute+"='"+this.taskId+"']"):t.getTaskNode(this.taskId)},focus:function(e){if(!e){var n,i,r=t.getTaskPosition(t.getTask(this.taskId)),a=t.getTaskHeight(this.taskId),o=t.getScrollState();n=t.$task?t.$task.offsetWidth:o.inner_width,i=t.$grid_data||t.$task_data?(t.$grid_data||t.$task_data).offsetHeight:o.inner_height,r.topo.y+i?t.scrollTo(null,r.top-5*a):t.config.scroll_on_click&&t.config.show_chart&&(r.left>o.x+n?t.scrollTo(r.left-t.config.task_scroll_offset):r.left+r.width=0&&!e[n];)n--;return e[n]?new t.$keyboardNavigation.HeaderCell(n):null},fromDomElement:function(n){var i=e.locateClassName(n,"gantt_grid_head_cell");if(i){for(var r=0;i&&i.previousSibling;)i=i.previousSibling,r+=1;return new t.$keyboardNavigation.HeaderCell(r)}return null},getNode:function(){return t.$grid_scale.childNodes[this.index]},keys:{left:function(){this.index>0&&this.moveTo(new t.$keyboardNavigation.HeaderCell(this.index-1))},right:function(){var e=t.getGridColumns();this.index=r.length-1){var c=r[0];if(c)return c.focus(),i.preventDefault(),!0}return!1}}()}},function(t,e){t.exports=function(t){t.$keyboardNavigation.EventHandler={_handlers:null,findHandler:function(e){this._handlers||(this._handlers={});var n=t.$keyboardNavigation.shortcuts.getHash(e);return this._handlers[n]},doAction:function(e,n){var i=this.findHandler(e);if(i){if(!1===t.$keyboardNavigation.facade.callEvent("onBeforeAction",[e,n]))return;i.call(this,n),n.preventDefault?n.preventDefault():n.returnValue=!1}},bind:function(e,n){this._handlers||(this._handlers={});for(var i=t.$keyboardNavigation.shortcuts,r=i.parse(e),a=0;a=96&&e.keyCode<=105&&(e.keyCode-=48);var n=String.fromCharCode(e.keyCode);return n&&(e.keyCode=n.toLowerCase().charCodeAt(0)),e},getHashFromEvent:function(t){return this.getHash(this.getCommandFromEvent(t))},getHash:function(t){var e=[];for(var n in t.modifiers)t.modifiers[n]&&e.push(n);return e.push(t.keyCode),e.join(this.junctionChar)},getExpressions:function(t){return t.split(this.junctionChar)},getWords:function(t){return t.split(this.combinationChar)},trim:function(t){return t.replace(/\s/g,"")},junctionChar:",",combinationChar:"+",commandKeys:{shift:16,alt:18,ctrl:17,meta:!0},specialKeys:{backspace:8,tab:9,enter:13,esc:27,space:32,up:38,down:40,left:37,right:39,home:36,end:35,pageup:33,pagedown:34,delete:46,insert:45,plus:107,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123}}}},function(t,e,n){t.exports=function(t){var e=n(4);!function(t){t.config.keyboard_navigation=!0,t.config.keyboard_navigation_cells=!1,t.$keyboardNavigation={},t._compose=function(){for(var t=Array.prototype.slice.call(arguments,0),e={},n=0;n-1)i[l].resource_id=s,a.push(i[l]);else{var c=t.copy(i[0]);c.resource_id=s,a.push(c)}}return a}function a(t,e,n){return t}function o(t){return t.map(s).sort().join(",")}function s(t){return t&&"object"==i(t)?String(t.resource_id):String(t)}function l(){var n=this;this.$data.tasksStore._listenerToDrop&&this.$data.tasksStore.detachEvent(this.$data.tasksStore._listenerToDrop);var i=e.delay(function(){if(!n._groups.dynamicGroups)return!0;if(n._groups.regroup){var e=t.getScrollState();n._groups.regroup(),e&&t.scrollTo(e.x,e.y)}return!0});this.$data.tasksStore.attachEvent("onAfterUpdate",function(){return i.$pending||i(),!0})}t._groups={relation_property:null,relation_id_property:"$group_id",group_id:null,group_text:null,loading:!1,loaded:0,dynamicGroups:!1,set_relation_value:void 0,_searchCache:null,init:function(t){var e=this;t.attachEvent("onClear",function(){e.clear()}),e.clear();var n=t.$data.tasksStore.getParent;this._searchCache=null,t.attachEvent("onBeforeTaskMove",function(t,n,i){var r=n===this.config.root_id||this.isTaskExists(n)&&!this.getTask(n).$virtual,a=this._groups.dynamicGroups&&!(this._groups.set_relation_value instanceof Function);return!e.is_active()||!r&&!a}),t.$data.tasksStore._listenerToDrop=t.$data.tasksStore.attachEvent("onStoreUpdated",t.bind(l,t)),t.$data.tasksStore.getParent=function(i){return e.is_active()?e.get_parent(t,i):n.apply(this,arguments)};var i=t.$data.tasksStore.setParent;t.$data.tasksStore.setParent=function(n,r){if(!e.is_active())return i.apply(this,arguments);if(e.set_relation_value instanceof Function&&t.isTaskExists(r)){var a=(o=t.getTask(r))[e.relation_id_property];void 0===n[e.group_id]&&(n[e.group_id]=a),a&&(a="string"==typeof a?a.split(","):[a]),n[e.relation_property]=e.set_relation_value(a,n.id,n[e.relation_property])||a}else if(t.isTaskExists(r)){var o=t.getTask(r);e.dynamicGroups||(n[e.relation_property]=o[e.relation_id_property]),this._setParentInner.apply(this,arguments)}else e.dynamicGroups&&(void 0===n[e.group_id]||!n.$virtual&&n[e.relation_property][0]===[][0])&&(n[e.relation_property]=0)},t.attachEvent("onBeforeTaskDisplay",function(n,i){return!(e.is_active()&&i.type==t.config.types.project&&!i.$virtual)}),t.attachEvent("onBeforeParse",function(){e.loading=!0,e._clearCache()}),t.attachEvent("onTaskLoading",function(){return e.is_active()&&(e.loaded--,e.loaded<=0&&(e.loading=!1,e._clearCache(),t.eachTask(t.bind(function(e){this.get_parent(t,e)},e)))),!0}),t.attachEvent("onParse",function(){e.loading=!1,e.loaded=0})},_clearCache:function(){this._searchCache=null},_buildCache:function(){this._searchCache={};for(var e=t.$data.tasksStore.getItems(),n=0;n0)f=o(p),_=p.map(function(t,e){var n;return n=t&&"object"==i(t)?t.resource_id:t,(t=s[n]).label||t.text}).sort().join(c);else{if(u)continue;f=0,_=n.default_group_label}else if(p)_=s[f=p].label||s[f].text;else{if(u)continue;f=0,_=n.default_group_label}void 0!==f&&void 0===r[f]&&(r[f]={key:f,label:_},f===d&&(r[f].default=!0),r[f][n.group_text]=_,r[f][n.group_id]=f)}return(a=e.hashToArray(r)).forEach(function(t){t.key==d&&(t.default=!0)}),a}(n,t):t.groups:null;return a}(n,r,t);return c&&l&&c.forEach(function(t){void 0!==a[t[d]]&&(t.open=a[t[d]])}),s._groups.group_tasks(s,c,u,d,h),!0},this._groups.regroup()},t.$services.getService("state").registerProvider("groupBy",function(){return{group_mode:t._groups.is_active()?t._groups.relation_property:null}})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){function e(){var t=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;return!(!t||t!==document.body)}t.$services.getService("state").registerProvider("fullscreen",function(){return{fullscreen:e()}});var n={overflow:null,padding:null,paddingTop:null,paddingRight:null,paddingBottom:null,paddingLeft:null},i={width:null,height:null,top:null,left:null,position:null,zIndex:null,modified:!1},r=null;function a(t,e){e.width=t.width,e.height=t.height,e.top=t.top,e.left=t.left,e.position=t.position,e.zIndex=t.zIndex}var o=!1;function s(){var s;t.$container&&(e()?o&&(s="onExpand",function(){var e=t.ext.fullscreen.getFullscreenElement(),o=document.body;a(e.style,i),n={overflow:o.style.overflow,padding:o.style.padding?o.style.padding:null,paddingTop:o.style.paddingTop?o.style.paddingTop:null,paddingRight:o.style.paddingRight?o.style.paddingRight:null,paddingBottom:o.style.paddingBottom?o.style.paddingBottom:null,paddingLeft:o.style.paddingLeft?o.style.paddingLeft:null},o.style.padding&&(o.style.padding="0"),o.style.paddingTop&&(o.style.paddingTop="0"),o.style.paddingRight&&(o.style.paddingRight="0"),o.style.paddingBottom&&(o.style.paddingBottom="0"),o.style.paddingLeft&&(o.style.paddingLeft="0"),o.style.overflow="hidden",e.style.width="100vw",e.style.height="100vh",e.style.top="0px",e.style.left="0px",e.style.position="absolute",e.style.zIndex=1,i.modified=!0,r=function(t){for(var e=t.parentNode,n=[];e&&e.style;)n.push({element:e,originalPositioning:e.style.position}),e.style.position="static",e=e.parentNode;return n}(e)}()):o&&(o=!1,s="onCollapse",function(){var e=t.ext.fullscreen.getFullscreenElement(),o=document.body;i.modified&&(n.padding&&(o.style.padding=n.padding),n.paddingTop&&(o.style.paddingTop=n.paddingTop),n.paddingRight&&(o.style.paddingRight=n.paddingRight),n.paddingBottom&&(o.style.paddingBottom=n.paddingBottom),n.paddingLeft&&(o.style.paddingLeft=n.paddingLeft),o.style.overflow=n.overflow,n={overflow:null,padding:null,paddingTop:null,paddingRight:null,paddingBottom:null,paddingLeft:null},a(i,e.style),i.modified=!1),function(t){t.forEach(function(t){t.element.style.position=t.originalPositioning})}(r),r=null}()),setTimeout(function(){t.render()}),setTimeout(function(){t.callEvent(s,[t.ext.fullscreen.getFullscreenElement()])}))}function l(){return!(t.$container&&t.ext.fullscreen.getFullscreenElement()&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||((console.warning||console.log)("The `fullscreen` feature not being allowed, or full-screen mode not being supported"),0)))}t.ext.fullscreen={expand:function(){if(!l()&&!e()&&t.callEvent("onBeforeExpand",[this.getFullscreenElement()])){o=!0;var n=document.body,i=n.webkitRequestFullscreen?[Element.ALLOW_KEYBOARD_INPUT]:[],r=n.msRequestFullscreen||n.mozRequestFullScreen||n.webkitRequestFullscreen||n.requestFullscreen;r&&r.apply(n,i)}},collapse:function(){if(!l()&&e()&&t.callEvent("onBeforeCollapse",[this.getFullscreenElement()])){var n=document.msExitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.exitFullscreen;n&&n.apply(document)}},toggle:function(){l()||(e()?this.collapse():this.expand())},getFullscreenElement:function(){return t.$root}},t.expand=function(){t.ext.fullscreen.expand()},t.collapse=function(){t.ext.fullscreen.collapse()},t.attachEvent("onGanttReady",function(){t.event(document,"webkitfullscreenchange",s),t.event(document,"mozfullscreenchange",s),t.event(document,"MSFullscreenChange",s),t.event(document,"fullscreenChange",s),t.event(document,"fullscreenchange",s)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){var e=this;this._mouseDown=!1,this._calculateDirectionVector=function(){if(e._trace.length>=10){for(var t=e._trace.slice(e._trace.length-10),n=[],i=1;i75&&(i=0)),{x:e._scrollState.x+i,y:e._scrollState.y+r}},this._setScrollPosition=function(t,n){var i=e._gantt;requestAnimationFrame(function(){i.$ui.getView(t.$config.scrollX).scroll(n.x),i.$ui.getView(t.$config.scrollY).scroll(n.y)})},this._stopDrag=function(t){var n=e._gantt;if(e._trace=[],n.$root.classList.remove("gantt_noselect"),void 0!==e._originalReadonly&&(n.config.readonly=e._originalReadonly),void 0!==e._originAutoscroll&&(n.config.autoscroll=e._originAutoscroll),n.config.drag_timeline){var i=n.config.drag_timeline.useKey;if(i&&!0!==t[i])return}e._mouseDown=!1},this._startDrag=function(t){var n=e._gantt;e._originAutoscroll=n.config.autoscroll,n.config.autoscroll=!1,n.$root.classList.add("gantt_noselect"),e._originalReadonly=n.config.readonly,n.config.readonly=!0,e._trace=[],e._mouseDown=!0;var i=e._getScrollPosition(e._timeline),r=i.x,a=i.y;e._scrollState={x:r,y:a},e._startPoint={x:t.clientX,y:t.clientY},e._trace.push(e._startPoint)},this._gantt=t,this._domEvents=t._createDomEventScope(),this._trace=[]}return t.create=function(e){return new t(e)},t.prototype.destructor=function(){this._domEvents.detachAll()},t.prototype.attach=function(t){var e=this;this._timeline=t;var n=this._gantt;this._domEvents.attach(t.$task,"mousedown",function(t){if(n.config.drag_timeline){var i=n.config.drag_timeline,r=i.useKey,a=i.ignore;if(!1!==i.enabled){var o=".gantt_task_line, .gantt_task_link";void 0!==a&&(o=a instanceof Array?a.join(", "):a),o&&n.utils.dom.closest(t.target,o)||r&&!0!==t[r]||e._startDrag(t)}}}),this._domEvents.attach(document,"keydown",function(t){if(n.config.drag_timeline){var i=n.config.drag_timeline.useKey;i&&!0===t[i]&&e._applyDndReadyStyles()}}),this._domEvents.attach(document,"keyup",function(t){if(n.config.drag_timeline){var i=n.config.drag_timeline.useKey;i&&!1===t[i]&&(e._clearDndReadyStyles(),e._stopDrag(t))}}),this._domEvents.attach(document,"mouseup",function(t){e._stopDrag(t)}),this._domEvents.attach(n.$root,"mouseup",function(t){e._stopDrag(t)}),this._domEvents.attach(document,"mouseleave",function(t){e._stopDrag(t)}),this._domEvents.attach(n.$root,"mouseleave",function(t){e._stopDrag(t)}),this._domEvents.attach(n.$root,"mousemove",function(i){if(n.config.drag_timeline){var r=n.config.drag_timeline.useKey;if((!r||!0===i[r])&&!0===e._mouseDown){e._trace.push({x:i.clientX,y:i.clientY});var a=e._countNewScrollPosition({x:i.clientX,y:i.clientY});e._setScrollPosition(t,a),e._scrollState=a,e._startPoint={x:i.clientX,y:i.clientY}}}})},t}();e.EventsManager=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(263);e.default=function(t){t.ext||(t.ext={}),t.ext.dragTimeline={create:function(){return i.EventsManager.create(t)}},t.config.drag_timeline={enabled:!0}}},function(t,e,n){t.exports=function(t){var e=n(29)(t),i=n(51)(t);return t._isProjectEnd=function(t){return!this._hasDuration({start_date:t.end_date,end_date:this._getProjectEnd(),task:t})},{_needRecalc:!0,_cache:null,reset:function(){this._needRecalc=!0,this._cache=null},_isRecalcNeeded:function(){return this._needRecalc},_getLinks:function(){var t=e.getLinkedTasks();return i.groupAdjacentEdges(t)},_calculateBranch:function(e,n,i,r){if(n[e.id]=!0,void 0===i[e.id])for(var a=[e];a.length;)if(i[(e=a.pop()).id]||t._isProjectEnd(e))for(i[e.id]=!0;a.length;){i[(e=a.pop()).id]=!0}else{i[e.id]=!1;for(var o=r[e.id]||[],s=0;st.additional&&(c[t.task.id]=t);-1!=l.indexOf(t.task.id);){var e=l.indexOf(t.task.id);l.splice(e,1)}l.push(t.task.id)}else l.push(t.task.id),c[t.task.id]=t}),o[t.task.id]=e.taskSlack):o[t.task.id]=e)};for(s.sort(function(t,e){return+e.end_date-+t.end_date});s.length;){var d={task:s.shift(),additional:0,chain:!1};t.isSummaryTask(d.task)||u(d)}for(;l.length;){var h=l.shift();u(d=c[h])}return t._slacksChanged=!1,this._slackNeedCalculate=!1,this._totalSlack},_predecessorChainSlackCount:function(e,n,i){var r=this;if(this._successorsByTaskId[e.id]?i=i||!1:(this._totalSlack[e.id]=t.calculateDuration(e.end_date,t.getSubtaskDates().end_date),this._totalSlack[e.id],i=!0),i){var a=this._linkedTasksById[e.id];if(a&&a.linked.length>-1){var o=[];return a.linked.forEach(function(n){var a=t.getTask(n.source),s=t.getSlack(a,e)+r._totalSlack[e.id];(void 0===r._totalSlack[a.id]||r._totalSlack[a.id]>s)&&(r._totalSlack[a.id]=s),i&&o.push({task:a,additional:r._totalSlack[a.id],chain:!0})}),{taskSlack:this._totalSlack[e.id],predecessorStack:o}}return this._totalSlack,this._totalSlack[e.id]}},_calculateTaskSlack:function(t){return t.$source&&t.$source.length?this._calculateRelationSlack(t):this._calculateHierarchySlack(t)},_calculateRelationSlack:function(t){for(var e,n=0,i=t.$source,r=0;r(e=this._calculateLinkSlack(i[r]))||0===r)&&(n=e);return n},_calculateLinkSlack:function(e){var n=t.getLink(e),i=0;return t.isTaskExists(n.source)&&t.isTaskExists(n.target)&&(i=t.getSlack(t.getTask(n.source),t.getTask(n.target))),i},_calculateHierarchySlack:function(e){var n,i,r=null,a=t.getSubtaskDates().end_date;if(t.isTaskExists(e.parent)){i=t.getSubtaskDates(e.id).end_date||e.end_date;var o=t.getTask(e.parent);o.type==t.config.types.project&&o.$source&&o.$source.length&&(r=this._calculateRelationSlack(o))}else i=e.end_date;return n=Math.max(t.calculateDuration(i,a),0),null!==r&&rs||0===a)&&(n=s)}else n=this._getSlack(t,e,{});return n},t._getSlack=function(t,e,n){var i=this.config.types,r=null;r=this.getTaskType(t.type)==i.milestone?t.start_date:t.end_date;var a=e.start_date,o=0;o=+r>+a?-this.calculateDuration({start_date:a,end_date:r,task:t}):this.calculateDuration({start_date:r,end_date:a,task:t});var s=n.lag;return s&&1*s==s&&(o-=s),o}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(4),r=n(2),a=function(){function t(t,e,n){var a=this;this._el=document.createElement("div"),this.defaultRender=function(t,e){a._el||(a._el=document.createElement("div"));var n=a._el,i=Math.min(t.relative.top,e.relative.top),r=Math.max(t.relative.top,e.relative.top),o=Math.min(t.relative.left,e.relative.left),s=Math.max(t.relative.left,e.relative.left);if(a._singleRow){var l=a._getTaskPositionByTop(a._startPoint.relative.top);n.style.height=l.height+"px",n.style.top=l.top+"px"}else n.style.height=Math.abs(r-i)+"px",n.style.top=i+"px";return n.style.width=Math.abs(s-o)+"px",n.style.left=o+"px",n},this._gantt=e,this._view=n,this._viewPort=t.viewPort,this._el.classList.add(t.className),"function"==typeof t.callback&&(this._callback=t.callback),this.render=function(){var e;(e=t.render?t.render(a._startPoint,a._endPoint):a.defaultRender(a._startPoint,a._endPoint))!==a._el&&(a._el&&a._el.parentNode&&a._el.parentNode.removeChild(a._el),a._el=e),""!==t.className&&a._el.classList.add(t.className),a.draw()},r.isEventable(this._viewPort)||i(this._viewPort),this._singleRow=t.singleRow,this._useRequestAnimationFrame=t.useRequestAnimationFrame}return t.prototype.draw=function(){var t=this;if(this._useRequestAnimationFrame)return requestAnimationFrame(function(){t._viewPort.appendChild(t.getElement())});this._viewPort.appendChild(this.getElement())},t.prototype.clear=function(){var t=this;if(this._useRequestAnimationFrame)return requestAnimationFrame(function(){t._el.parentNode&&t._viewPort.removeChild(t._el)});this._el.parentNode&&this._viewPort.removeChild(this._el)},t.prototype.getElement=function(){return this._el},t.prototype.getViewPort=function(){return this._viewPort},t.prototype.setStart=function(t){var e=this._gantt;this._startPoint=t,this._startDate=e.dateFromPos(this._startPoint.relative.left),this._viewPort.callEvent("onBeforeDrag",[this._startPoint])},t.prototype.setEnd=function(t){var e=this._gantt;if(this._endPoint=t,this._singleRow){var n=this._getTaskPositionByTop(this._startPoint.relative.top);this._endPoint.relative.top=n.top}this._endDate=e.dateFromPos(this._endPoint.relative.left),this._startPoint.relative.left>this._endPoint.relative.left&&(this._positionPoint={relative:{left:this._endPoint.relative.left,top:this._positionPoint.relative.top},absolute:{left:this._endPoint.absolute.left,top:this._positionPoint.absolute.top}}),this._startPoint.relative.top>this._endPoint.relative.top&&(this._positionPoint={relative:{left:this._positionPoint.relative.left,top:this._endPoint.relative.top},absolute:{left:this._positionPoint.absolute.left,top:this._endPoint.absolute.top}}),this._viewPort.callEvent("onDrag",[this._startPoint,this._endPoint])},t.prototype.setPosition=function(t){this._positionPoint=t},t.prototype.dragEnd=function(t){var e,n=this._gantt;t.relative.left<0&&(t.relative.left=0),this._viewPort.callEvent("onBeforeDragEnd",[this._startPoint,t]),this.setEnd(t),this._endDate=this._endDate||n.getState().max_date,this._startDate.valueOf()>this._endDate.valueOf()&&(e=[this._endDate,this._startDate],this._startDate=e[0],this._endDate=e[1]),this.clear();var i=n.getTaskByTime(this._startDate,this._endDate),r=this._getTasksByTop(this._startPoint.relative.top,this._endPoint.relative.top);this._viewPort.callEvent("onDragEnd",[this._startPoint,this._endPoint]),this._callback&&this._callback(this._startPoint,this._endPoint,this._startDate,this._endDate,i,r)},t.prototype.getInBounds=function(){return this._singleRow},t.prototype._getTasksByTop=function(t,e){var n=this._gantt,i=t,r=e;t>e&&(i=e,r=t);for(var a=this._getTaskPositionByTop(i).index,o=this._getTaskPositionByTop(r).index,s=[],l=a;l<=o;l++){n.getTaskByIndex(l)&&s.push(n.getTaskByIndex(l))}return s},t.prototype._getTaskPositionByTop=function(t){var e=this._gantt,n=this._view,i=n.getItemIndexByTopPosition(t),r=e.getTaskByIndex(i);if(r){var a=n.getItemHeight(r.id);return{top:n.getItemTop(r.id)||0,height:a||0,index:i}}var o=n.getTotalHeight();return{top:t>o?o:0,height:e.config.row_height,index:t>o?e.getTaskCount():0}},t}();e.SelectedRegion=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=function(){function t(t){this._mouseDown=!1,this._gantt=t,this._domEvents=t._createDomEventScope()}return t.prototype.attach=function(t,e){var n=this,r=this._gantt,a=t.getViewPort();this._originPosition=window.getComputedStyle(a).display,this._restoreOriginPosition=function(){a.style.position=n._originPosition},"static"===this._originPosition&&(a.style.position="relative");var o=r.$services.getService("state");o.registerProvider("clickDrag",function(){return{autoscroll:!1}});var s=null;this._domEvents.attach(a,"mousedown",function(i){s=null,r.utils.dom.closest(i.target,".gantt_task_line, .gantt_task_link")||(o.registerProvider("clickDrag",function(){return{autoscroll:n._mouseDown}}),e&&!0!==i[e]||(s=n._getCoordinates(i,t)))});var l=i.getRootNode(r.$root)||document.body;this._domEvents.attach(l,"mouseup",function(i){if(s=null,(!e||!0===i[e])&&!0===n._mouseDown){n._mouseDown=!1;var r=n._getCoordinates(i,t);t.dragEnd(r)}}),this._domEvents.attach(a,"mousemove",function(i){if(!e||!0===i[e]){var a=null;if(!n._mouseDown&&s)return a=n._getCoordinates(i,t),void(Math.abs(s.relative.left-a.relative.left)>5&&s&&(n._mouseDown=!0,t.setStart(r.copy(s)),t.setPosition(r.copy(s)),t.setEnd(r.copy(s)),s=null));!0===n._mouseDown&&(a=n._getCoordinates(i,t),t.setEnd(a),t.render())}})},t.prototype.detach=function(){var t=this._gantt;this._domEvents.detachAll(),this._restoreOriginPosition&&this._restoreOriginPosition(),t.$services.getService("state").unregisterProvider("clickDrag")},t.prototype.destructor=function(){this.detach()},t.prototype._getCoordinates=function(t,e){var n=e.getViewPort(),i=n.getBoundingClientRect(),r=t.clientX,a=t.clientY;return{absolute:{left:r,top:a},relative:{left:r-i.left+n.scrollLeft,top:a-i.top+n.scrollTop}}},t}();e.EventsManager=r},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;nn.valueOf()?t._hasDuration({start_date:n,end_date:e,task:r}):t._hasDuration({start_date:e,end_date:n,task:i}))}function d(e,n){return!!u(e.start_date,n.start_date,e,n)||t.getConstraintType(e)!==t.getConstraintType(n)||!!u(e.constraint_date,n.constraint_date,e,n)||!(!u(e.start_date,n.start_date,e,n)&&(!u(e.end_date,n.end_date,e,n)&&e.duration===n.duration||e.type===t.config.types.milestone))||void 0}function h(n){return t.config.auto_scheduling_compatibility?e.getLinkedTasks(n,!0):i.getConnectedGroupRelations(n)}function f(e){t.config.schedule_from_end?(e.constraint_type=t.config.constraint_types.FNLT,e.constraint_date=new Date(e.end_date)):(e.constraint_type=t.config.constraint_types.SNET,e.constraint_date=new Date(e.start_date))}function _(e){t.config.auto_scheduling_compatibility&&(e.constraint_type!==t.config.constraint_types.SNET&&e.constraint_type!==t.config.constraint_types.FNLT||(e.constraint_type=null,e.constraint_date=null))}t.attachEvent("onAfterBatchUpdate",function(){o&&t.autoSchedule(),o=!1}),t.attachEvent("onAfterLinkUpdate",s),t.attachEvent("onAfterLinkAdd",s),t.attachEvent("onAfterLinkDelete",function(e,n){if(t.config.auto_scheduling&&!t._autoscheduling_in_progress&&t.isTaskExists(n.target)){var i=t.getTask(n.target),r=t._getPredecessors(i);r.length&&(t.getState().batch_update?o=!0:t.autoSchedule(r[0].source,!1))}}),t.attachEvent("onParse",function(){t.config.auto_scheduling&&t.config.auto_scheduling_initial&&t.autoSchedule()}),t.attachEvent("onBeforeLinkAdd",l),t.attachEvent("onBeforeLinkAdd",c),t.attachEvent("onBeforeLinkUpdate",l),t.attachEvent("onBeforeLinkUpdate",c),t.attachEvent("onBeforeTaskDrag",function(e,n,i){return t.config.auto_scheduling&&t.config.auto_scheduling_move_projects&&(r=h(e),a=e),!0});var g,p=function(e,n){if(t.config.auto_scheduling&&!t._autoscheduling_in_progress){var i=t.getTask(e);d(n,i)&&(f(i),t.config.auto_scheduling_move_projects&&a==e?(t.calculateDuration(n)!==t.calculateDuration(i)&&function(e,n){for(var i=!1,a=0;a0;)if(!n[i=r.shift()]){n[i]=!0,a.push(i);for(var l=0;le.latestStart&&(e.start_date=e.latestStart,e.end_date=e.latestEnd),e.latestSchedulingStart&&n>e.latestSchedulingStart&&(e.start_date=e.latestSchedulingStart,e.end_date=e.latestSchedulingEnd),e.earliestSchedulingStart&&ne.latestSchedulingStart||e.start_datee.latestStart||e.start_datee.latestSchedulingEnd||e.end_datee.latestEnd||e.end_date