text: !function(){"use strict";angular.module("gantt",["gantt.templates","angularMoment"]).directive("gantt",["Gantt","ganttOptions","GanttCalendar","moment","ganttMouseOffset","ganttDebounce","ganttEnableNgAnimate",function(t,e,n,i,a,r,s){return{restrict:"EA",transclude:!0,templateUrl:function(t,e){return void 0===e.templateUrl?"template/gantt.tmpl.html":e.templateUrl},scope:{sortMode:"=?",filterTask:"=?",filterTaskComparator:"=?",filterRow:"=?",filterRowComparator:"=?",viewScale:"=?",columnWidth:"=?",allowLabelsResizing:"=?",fromDate:"=?",toDate:"=?",currentDateValue:"=?",currentDate:"=?",autoExpand:"=?",taskOutOfRange:"=?",maxHeight:"=?",labelsWidth:"=?",showLabelsColumn:"=?",showTooltips:"=?",headers:"=?",headersFormats:"=?",timeFrames:"=?",dateFrames:"=?",timeFramesWorkingMode:"=?",timeFramesNonWorkingMode:"=?",timespans:"=?",columnMagnet:"=?",data:"=?",api:"=?",options:"=?"},controller:["$scope","$element",function(n,i){for(var a in n.options)n[a]=n.options[a];e.initialize(n),s(!1,i),n.gantt=new t(n,i),this.gantt=n.gantt}],link:function(t,e){t.gantt.api.core.raise.ready(t.gantt.api),t.gantt.api.directives.raise.new("gantt",t,e),t.$on("$destroy",function(){t.gantt.api.directives.raise.destroy("gantt",t,e)})}}}])}(),function(){"use strict";angular.module("gantt").factory("GanttApi",["$q","$rootScope","ganttUtils",function(t,e,n){function i(t,e,n,i){return t.$on(e,function(){var t=Array.prototype.slice.call(arguments);t.splice(0,1),n.apply(i.api,t)})}var a=function(t){this.gantt=t,this.listeners=[],this.apiId=n.newId()};return a.prototype.suppressEvents=function(t,e){var n=this,a=angular.isArray(t)?t:[t],r=[];a.forEach(function(t){r=n.listeners.filter(function(e){return t===e.handler})}),r.forEach(function(t){t.dereg()}),e(),r.forEach(function(t){t.dereg=i(t.scope,t.eventId,t.handler,n.gantt)})},a.prototype.registerEvent=function(t,n){var a=this;a[t]||(a[t]={});var r=a[t];r.on||(r.on={},r.raise={});var s="event:gantt:"+this.apiId+":"+t+":"+n;r.raise[n]=function(){e.$broadcast.apply(e,[s].concat(Array.prototype.slice.call(arguments)))},r.on[n]=function(t,e){var n=i(t,s,e,a.gantt),r={handler:e,dereg:n,eventId:s,scope:t};a.listeners.push(r),t.$on("$destroy",function(){r.dereg=null,r.handler=null,r.eventId=null,r.scope=null})}},a.prototype.registerEventsFromObject=function(t){var e=this,n=[];angular.forEach(t,function(t,e){var i={name:e,events:[]};angular.forEach(t,function(t,e){i.events.push(e)}),n.push(i)}),n.forEach(function(t){t.events.forEach(function(n){e.registerEvent(t.name,n)})})},a.prototype.registerMethod=function(t,e,i,a){this[t]||(this[t]={});var r=this[t];r[e]=n.createBoundedWrapper(a||this.gantt,i)},a.prototype.registerMethodsFromObject=function(t,e){var n=this,i=[];angular.forEach(t,function(t,e){var n={name:e,methods:[]};angular.forEach(t,function(t,e){n.methods.push({name:e,fn:t})}),i.push(n)}),i.forEach(function(t){t.methods.forEach(function(i){n.registerMethod(t.name,i.name,i.fn,e)})})},a}])}(),function(){"use strict";angular.module("gantt").factory("ganttOptions",["moment",function(t){return{initialize:function(e){return e.api=e.api||angular.noop(),e.data=e.data||[],e.timespans=e.timespans||[],e.sortMode=e.sortMode||void 0,e.filterTask=e.filterTask||void 0,e.filterTaskComparator=e.filterTaskComparator||void 0,e.filterRow=e.filterRow||void 0,e.filterRowComparator=e.filterRowComparator||void 0,e.viewScale=e.viewScale||"day",e.columnMagnet=e.columnMagnet||"15 minutes",e.columnWidth=e.columnWidth||void 0,e.fromDate=e.fromDate||void 0,e.toDate=e.toDate||void 0,e.allowLabelsResizing=void 0!==e.allowLabelsResizing?!!e.allowLabelsResizing:!0,e.currentDate=e.currentDate||"line",e.currentDateValue=e.currentDateValue||t(),e.autoExpand=e.autoExpand||"none",e.taskOutOfRange=e.taskOutOfRange||"truncate",e.maxHeight=e.maxHeight||0,e.labelsWidth=e.labelsWidth||void 0,e.showLabelsColumn=void 0!==e.showLabelsColumn?!!e.showLabelsColumn:!0,e.showTooltips=void 0!==e.showTooltips?!!e.showTooltips:!0,e.headers=e.headers||void 0,e.headersFormats=e.headersFormats||void 0,e.timeFrames=e.timeFrames||[],e.dateFrames=e.dateFrames||[],e.timeFramesWorkingMode=e.timeFramesWorkingMode||"hidden",e.timeFramesNonWorkingMode=e.timeFramesNonWorkingMode||"visible",e}}}])}(),function(){"use strict";angular.module("gantt").factory("GanttCalendar",["$filter","moment",function(t,e){var n=function(t){void 0===t&&(t={}),this.start=t.start,this.end=t.end,this.working=t.working,this.default=t.default,this.color=t.color,this.classes=t.classes};n.prototype.updateView=function(){if(this.$element){void 0!==this.left?this.$element.css("left",this.left+"px"):this.$element.css("left",""),void 0!==this.width?this.$element.css("width",this.width+"px"):this.$element.css("width",""),void 0!==this.color?this.$element.css("background-color",this.color):this.$element.css("background-color","");var t=["gantt-timeframe"+(this.working?"":"-non")+"-working"];this.classes&&(t=t.concat(this.classes));for(var e=0,n=t.length;n>e;e++)this.$element.toggleClass(t[e],!0)}},n.prototype.getDuration=function(){return this.end.diff(this.start,"milliseconds")},n.prototype.clone=function(){return new n(this)};var i=function(t){this.func=t};i.prototype.getTimeFrames=function(t){var e=this.func(t);return e instanceof Array||(e=[e]),e},i.prototype.clone=function(){return new i(this.func)};var a=function(t){this.evaluator=t.evaluator,t.date?(this.start=e(t.date).startOf("day"),this.end=e(t.date).endOf("day")):(this.start=t.start,this.end=t.end),this.targets=t.targets instanceof Array?t.targets:[t.targets],this.default=t.default};a.prototype.dateMatch=function(t){return this.evaluator?this.evaluator(t):this.start&&this.end?t>=this.start&&t<=this.end:!1},a.prototype.clone=function(){return new a(this)};var r=function(){this.timeFrames={},this.timeFrameMappings={},this.dateFrames={}};r.prototype.clear=function(){this.timeFrames={},this.timeFrameMappings={},this.dateFrames={}},r.prototype.registerTimeFrames=function(t){angular.forEach(t,function(t,e){this.timeFrames[e]=new n(t)},this)},r.prototype.removeTimeFrames=function(t){angular.forEach(t,function(t){delete this.timeFrames[t]},this)},r.prototype.clearTimeFrames=function(){this.timeFrames={}},r.prototype.registerTimeFrameMappings=function(t){angular.forEach(t,function(t,e){this.timeFrameMappings[e]=new i(t)},this)},r.prototype.removeTimeFrameMappings=function(t){angular.forEach(t,function(t){delete this.timeFrameMappings[t]},this)},r.prototype.clearTimeFrameMappings=function(){this.timeFrameMappings={}},r.prototype.registerDateFrames=function(t){angular.forEach(t,function(t,e){this.dateFrames[e]=new a(t)},this)},r.prototype.removeDateFrames=function(t){angular.forEach(t,function(t){delete this.dateFrames[t]},this)},r.prototype.clearDateFrames=function(){this.dateFrames={}};var s=function(t,e){var n=[];return angular.forEach(t,function(t){t.dateMatch(e)&&n.push(t)}),0===n.length&&angular.forEach(t,function(t){t.default&&n.push(t)}),n};return r.prototype.getTimeFrames=function(t){var n=[],i=s(this.dateFrames,t);angular.forEach(i,function(t){void 0!==t&&angular.forEach(t.targets,function(t){var e=this.timeFrameMappings[t];if(void 0!==e)n.push(e.getTimeFrames());else{var i=this.timeFrames[t];void 0!==i&&n.push(i)}},this)},this);var a=t.year(),r=t.month(),o=t.date(),l=[];return 0===n.length&&angular.forEach(this.timeFrames,function(t){t.default&&n.push(t)}),angular.forEach(n,function(t){t=t.clone(),void 0!==t.start&&(t.start.year(a),t.start.month(r),t.start.date(o)),void 0!==t.end&&(t.end.year(a),t.end.month(r),t.end.date(o),e(t.end).startOf("day")===t.end&&t.end.add(1,"day")),l.push(t)}),l},r.prototype.solve=function(i,a,r){var s,o,l,d,c=0===i.length;angular.forEach(i,function(t){(void 0===l||l>t.start)&&(l=t.start),(void 0===d||d<t.end)&&(d=t.end),void 0===s&&t.color&&(s=t.color),void 0!==t.classes&&(void 0===o&&(o=[]),o=o.concat(t.classes))}),void 0===a&&(a=l),void 0===r&&(r=d);var u=[new n({start:a,end:r,working:c,color:s,classes:o})],h=t("orderBy")(i,function(t){return-t.getDuration()});return angular.forEach(h,function(t){var n=u.slice(),i=0,a=!1,r=!1;angular.forEach(u,function(s){if(!r){if(t.end>s.start&&t.start<s.end){t=t.clone();var o=s.clone();s.end=e(t.start),o.start=e(t.end),n.splice(i+1,0,t.clone(),o),r=!0}else!a&&t.start<s.end?(t=t.clone(),s.end=e(t.start),n.splice(i+1,0,t),a=!0):a&&t.end>s.start&&(s.start=e(t.end),a=!1,r=!0);i++}}),u=n}),u=t("filter")(u,function(t){return(void 0===t.start||t.start<r)&&(void 0===t.end||t.end>a)})},r}])}(),function(){"use strict";angular.module("gantt").factory("GanttCurrentDateManager",[function(){var t=function(t){var e=this;this.gantt=t,this.date=void 0,this.position=void 0,this.currentDateColumn=void 0,this.gantt.$scope.$watchGroup(["currentDate","currentDateValue"],function(){e.setCurrentDate(e.gantt.$scope.currentDateValue)})};return t.prototype.setCurrentDate=function(t){if(this.date=t,void 0!==this.currentDateColumn&&(void 0!==this.currentDateColumn.$element&&this.currentDateColumn.$element.removeClass("gantt-foreground-col-current-date"),delete this.currentDateColumn),void 0!==this.date){var e=this.gantt.columnsManager.getColumnByDate(this.date);void 0!==e&&(this.currentDateColumn=e,"column"===this.gantt.$scope.currentDate&&void 0!==this.currentDateColumn.$element&&this.currentDateColumn.$element.addClass("gantt-foreground-col-current-date"))}this.position=this.gantt.getPositionByDate(this.date)},t}])}(),function(){"use strict";angular.module("gantt").factory("GanttColumn",["moment",function(t){var e=function(t,e,n,i,a,r,s,o,l){this.date=t,this.endDate=e,this.left=n,this.width=i,this.calendar=a,this.duration=this.endDate.diff(this.date,"milliseconds"),this.timeFramesWorkingMode=r,this.timeFramesNonWorkingMode=s,this.timeFrames=[],this.visibleTimeFrames=[],this.daysTimeFrames={},this.cropped=!1,this.columnMagnetValue=o,this.columnMagnetUnit=l,this.originalSize={left:this.left,width:this.width},this.updateTimeFrames(),this.updateView()},n=function(t){return t.year()+"-"+t.month()+"-"+t.date()};e.prototype.updateView=function(){if(this.$element){this.$element.css("left",this.left+"px"),this.$element.css("width",this.width+"px");for(var t=0,e=this.timeFrames.length;e>t;t++)this.timeFrames[t].updateView()}},e.prototype.updateTimeFrames=function(){var e=this;if(void 0!==e.calendar&&("hidden"!==e.timeFramesNonWorkingMode||"hidden"!==e.timeFramesWorkingMode)){for(var i=function(n,i,a){return function(r){var s=r.start;void 0===s&&(s=i);var o=r.end;void 0===o&&(o=a),s<e.date&&(s=e.date),o>e.endDate&&(o=e.endDate),r=r.clone(),r.start=t(s),r.end=t(o),n.push(r)}},a=e.date,r=t(a).startOf("day"),s=r.add(1,"day");a<e.endDate;){var o=e.calendar.getTimeFrames(a),l=t.min(s,e.endDate);o=e.calendar.solve(o,a,l);var d=[];angular.forEach(o,i(d,a,l)),e.timeFrames=e.timeFrames.concat(d);var c=n(a);e.daysTimeFrames[c]=d,a=l,r=t(a).startOf("day"),s=r.add(1,"day")}if(angular.forEach(e.timeFrames,function(t){var n=t.start.diff(e.date,"milliseconds"),i=n/e.duration*e.width,a=t.end.diff(t.start,"milliseconds"),r=a/e.duration*e.width,s=!1;t.working&&"visible"!==e.timeFramesWorkingMode?s=!0:t.working||"visible"===e.timeFramesNonWorkingMode||(s=!0),s||e.visibleTimeFrames.push(t),t.hidden=s,t.left=i,t.width=r,t.originalSize={left:t.left,width:t.width},t.updateView()}),"cropped"===e.timeFramesNonWorkingMode||"cropped"===e.timeFramesWorkingMode){var u=0;if(angular.forEach(e.timeFrames,function(t){(!t.working&&"cropped"!==e.timeFramesNonWorkingMode||t.working&&"cropped"!==e.timeFramesWorkingMode)&&(u+=t.width)}),u!==e.width){var h=e.width/u,g=0,m=0,p=!0;angular.forEach(e.timeFrames,function(t){!t.working&&"cropped"!==e.timeFramesNonWorkingMode||t.working&&"cropped"!==e.timeFramesWorkingMode?(t.left=(t.left-g)*h,t.width=t.width*h,t.originalSize.left=(t.originalSize.left-m)*h,t.originalSize.width=t.originalSize.width*h,t.cropped=!1,p=!1):(g+=t.width,m+=t.originalSize.width,t.left=void 0,t.width=0,t.originalSize={left:void 0,width:0},t.cropped=!0),t.updateView()}),e.cropped=p}else e.cropped=!1}}},e.prototype.clone=function(){return new e(t(this.date),t(this.endDate),this.left,this.width,this.calendar)},e.prototype.containsDate=function(t){return t>this.date&&t<=this.endDate},e.prototype.equals=function(t){return this.date===t.date},e.prototype.getMagnetDate=function(e){if(this.columnMagnetValue>0&&void 0!==this.columnMagnetUnit){e=t(e);var n=e.get(this.columnMagnetUnit),i=Math.round(n/this.columnMagnetValue)*this.columnMagnetValue;return e.startOf(this.columnMagnetUnit),e.set(this.columnMagnetUnit,i),e}return e};var i=function(e,n){for(var i=0;i<e.length;i++){var a=e[i];if(!a.cropped&&n>=a.left&&n<=a.left+a.width){var r=a.getDuration()/a.width*(n-a.left),s=t(a.start).add(r,"milliseconds");return s}}};return e.prototype.getDateByPosition=function(e,n){var a,r;return 0>e&&(e=0),e>this.width&&(e=this.width),("cropped"===this.timeFramesNonWorkingMode||"cropped"===this.timeFramesWorkingMode)&&(r=i(this.timeFrames,e)),void 0===r&&(a=this.duration/this.width*e,r=t(this.date).add(a,"milliseconds")),n?this.getMagnetDate(r):r},e.prototype.getDayTimeFrame=function(t){var e=this.daysTimeFrames[n(t)];return void 0===e?[]:e},e.prototype.getPositionByDate=function(t){var e,n;if("cropped"===this.timeFramesNonWorkingMode||"cropped"===this.timeFramesWorkingMode)for(var i=t,a=this.getDayTimeFrame(i),r=0;r<a.length;r++){var s=a[r];if(i>=s.start&&i<=s.end){if(!s.cropped)return e=i.diff(s.start,"milliseconds"),n=e/s.getDuration()*s.width,this.left+s.left+n;i=a.length>r+1?a[r+1].start:s.end}}return e=t.diff(this.date,"milliseconds"),n=e/this.duration*this.width,0>n&&(n=0),n>this.width&&(n=this.width),this.left+n},e}])}(),function(){"use strict";angular.module("gantt").factory("GanttColumnGenerator",["GanttColumn","moment",function(t,e){var n=function(n){var i=this,a=n.gantt.$scope.columnWidth;void 0===a&&(a=20);var r,s,o=n.gantt.$scope.viewScale,l=n.gantt.calendar,d=n.gantt.$scope.timeFramesWorkingMode,c=n.gantt.$scope.timeFramesNonWorkingMode;if(n.gantt.$scope.columnMagnet){var u=n.gantt.$scope.columnMagnet.trim().split(" ");u.length>1&&(r=parseInt(u[0]),s=u[u.length-1])}i.generate=function(n,i,u,g,m){if(!i&&!u)throw"to or maximumWidth must be defined";var p=!1;n=e(n).startOf(o),i&&(p=h(i),i=e(i).startOf(o));for(var f=e(n).startOf(o),v=[],w=0;;){if(u&&Math.abs(w)>u+a)break;var y=e(f),b=e(y).add(1,o),k=new t(y,b,g?w+g:w,a,l,d,c,r,s);if(!k.cropped&&(v.push(k),m?w-=a:w+=a,i))if(m){if(p&&i>f||!p&&i>=f)break}else if(p&&f>i||!p&&f>=i)break;f.add(m?-1:1,o)}return m&&(h(n)&&v.shift(),v.reverse()),v};var h=function(t){return e(t).add(1,o).startOf(o)===t}};return n}])}(),function(){"use strict";angular.module("gantt").factory("GanttColumnHeader",["moment","GanttColumn",function(t,e){var n=function(n,i,a,r,s){var o=t(n),l=t(o).add(1,i),d=new e(o,l,a,r);return d.unit=i,d.label=s,d};return n}])}(),function(){"use strict";angular.module("gantt").factory("GanttColumnsManager",["GanttColumnGenerator","GanttHeaderGenerator","$filter","$timeout","ganttLayout","ganttBinarySearch",function(t,e,n,i,a,r){var s=function(t){var e=this;this.gantt=t,this.from=void 0,this.to=void 0,this.columns=[],this.visibleColumns=[],this.previousColumns=[],this.nextColumns=[],this.headers=[],this.visibleHeaders=[],this.scrollAnchor=void 0,this.gantt.$scope.$watchGroup(["viewScale","columnWidth","timeFramesWorkingMode","timeFramesNonWorkingMode","columnMagnet","fromDate","toDate","autoExpand","taskOutOfRange"],function(t,n){t!==n&&e.generateColumns()}),this.gantt.$scope.$watchCollection("headers",function(t,n){t!==n&&e.generateColumns()}),this.gantt.$scope.$watchCollection("headersFormats",function(t,n){t!==n&&e.generateColumns()}),this.gantt.$scope.$watchGroup(["ganttElementWidth","labelsWidth","showLabelsColumn","maxHeight"],function(t,n){t!==n&&e.updateColumnsMeta()}),this.gantt.$scope.$watchGroup(["scrollLeft","scrollWidth"],function(t,n){t!==n&&e.updateVisibleColumns()}),this.gantt.api.data.on.load(this.gantt.$scope,function(){(void 0===e.from||void 0===e.to||e.from>e.gantt.rowsManager.getDefaultFrom()||e.to<e.gantt.rowsManager.getDefaultTo())&&e.generateColumns(),e.gantt.rowsManager.sortRows()}),this.gantt.api.data.on.remove(this.gantt.$scope,function(){e.gantt.rowsManager.sortRows()}),this.gantt.api.registerMethod("columns","clear",this.clearColumns,this),this.gantt.api.registerMethod("columns","generate",this.generateColumns,this),this.gantt.api.registerMethod("columns","refresh",this.updateColumnsMeta,this),this.gantt.api.registerEvent("columns","generate")};s.prototype.setScrollAnchor=function(){if(this.gantt.scroll.$element&&this.columns.length>0){var t=this.gantt.scroll.$element[0],e=t.scrollLeft+t.offsetWidth/2;this.scrollAnchor=this.gantt.getDateByPosition(e)}},s.prototype.scrollToScrollAnchor=function(){var t=this;this.columns.length>0&&void 0!==this.scrollAnchor&&this.gantt.$scope.$$postDigest(function(){t.gantt.api.scroll.toDate(t.scrollAnchor)})},s.prototype.clearColumns=function(){this.setScrollAnchor(),this.from=void 0,this.to=void 0,this.columns=[],this.visibleColumns=[],this.previousColumns=[],this.nextColumns=[],this.headers=[],this.visibleHeaders=[],this.gantt.api.columns.raise.clear()},s.prototype.generateColumns=function(n,i){if(n||(n=this.gantt.$scope.fromDate),i||(i=this.gantt.$scope.toDate),!n&&(n=this.gantt.rowsManager.getDefaultFrom(),!n))return!1;if(!i&&(i=this.gantt.rowsManager.getDefaultTo(),!i))return!1;"expand"===this.gantt.$scope.taskOutOfRange&&(n=this.gantt.rowsManager.getExpandedFrom(n),i=this.gantt.rowsManager.getExpandedTo(i)),this.setScrollAnchor(),this.from=n,this.to=i;var a=new t(this),r=new e(this);this.columns=a.generate(n,i),this.headers=r.generate(this.columns),this.previousColumns=[],this.nextColumns=[],this.updateColumnsMeta(),this.scrollToScrollAnchor(),this.gantt.api.columns.raise.generate(this.columns,this.headers)},s.prototype.updateColumnsMeta=function(){var t=this.getLastColumn();if(this.gantt.originalWidth=void 0!==t?t.originalSize.left+t.originalSize.width:0,void 0===this.gantt.$scope.columnWidth){var e=this.gantt.$scope.ganttElementWidth-(this.gantt.$scope.showLabelsColumn?this.gantt.$scope.labelsWidth:0);this.gantt.$scope.maxHeight>0&&(e-=a.getScrollBarWidth()),a.setColumnsWidth(e,this.gantt.originalWidth,this.previousColumns),a.setColumnsWidth(e,this.gantt.originalWidth,this.columns),a.setColumnsWidth(e,this.gantt.originalWidth,this.nextColumns),angular.forEach(this.headers,function(t){a.setColumnsWidth(e,this.gantt.originalWidth,t)},this)}this.gantt.width=void 0!==t?t.left+t.width:0,this.gantt.rowsManager.updateTasksPosAndSize(),this.gantt.timespansManager.updateTimespansPosAndSize(),this.updateVisibleColumns(),this.gantt.rowsManager.updateVisibleObjects(),this.gantt.currentDateManager.setCurrentDate(this.gantt.$scope.currentDateValue)},s.prototype.getLastColumn=function(t){var e=this.columns;return t&&(e=this.nextColumns),e&&e.length>0?e[e.length-1]:void 0},s.prototype.getFirstColumn=function(t){var e=this.columns;return t&&(e=this.previousColumns),e&&e.length>0?e[0]:void 0},s.prototype.getColumnByDate=function(t){this.expandExtendedColumnsForDate(t);var e=this.previousColumns.concat(this.columns,this.nextColumns),n=r.get(e,t,function(t){return t.date});return void 0!==n[0]?n[0]:n[1]},s.prototype.getColumnByPosition=function(t){this.expandExtendedColumnsForPosition(t);var e=this.previousColumns.concat(this.columns,this.nextColumns);return r.get(e,t,function(t){return t.left})[0]},s.prototype.expandExtendedColumnsForPosition=function(e){if(0>e){var n=this.getFirstColumn(),i=n.date,a=this.getFirstColumn(!0);return(!a||a.left>e)&&(this.previousColumns=new t(this).generate(i,void 0,-e,0,!0)),!0}if(e>this.gantt.width){var r=this.getLastColumn(),s=r.getDateByPosition(r.width),o=this.getLastColumn(!0);return(!o||o.left+o.width<e)&&(this.nextColumns=new t(this).generate(s,void 0,e-this.gantt.width,this.gantt.width,!1)),!0}return!1},s.prototype.expandExtendedColumnsForDate=function(e){var n,i=this.getFirstColumn();i&&(n=i.date);var a,r=this.getLastColumn();if(r&&(a=r.getDateByPosition(r.width)),n&&n>e){var s=this.getFirstColumn(!0);return(!s||s.date>e)&&(this.previousColumns=new t(this).generate(n,e,void 0,0,!0)),!0}if(a&&e>a){var o=this.getLastColumn(!0);return(!o||o>a)&&(this.nextColumns=new t(this).generate(a,e,void 0,this.gantt.width,!1)),!0}return!1},s.prototype.getActiveHeadersCount=function(){return this.headers.length},s.prototype.updateVisibleColumns=function(){this.visibleColumns=n("ganttColumnLimit")(this.columns,this.gantt.$scope.scrollLeft,this.gantt.$scope.scrollWidth),this.visibleHeaders=[],angular.forEach(this.headers,function(t){this.visibleHeaders.push(n("ganttColumnLimit")(t,this.gantt.$scope.scrollLeft,this.gantt.$scope.scrollWidth))},this),angular.forEach(this.visibleColumns,function(t){t.updateView()}),angular.forEach(this.visibleHeaders,function(t){angular.forEach(t,function(t){t.updateView()})})};var o={year:"YYYY",quarter:"[Q]Q YYYY",month:"MMMM YYYY",week:"w",day:"D",hour:"H",minute:"HH:mm"},l={day:"LL",hour:"H",minute:"HH:mm"},d={year:"YYYY",quarter:"[Q]Q",month:"MMMM"};return s.prototype.getHeaderFormat=function(t){var e;return void 0!==this.gantt.$scope.headersFormats&&(e=this.gantt.$scope.headersFormats[t]),void 0===e&&(["millisecond","second","minute","hour"].indexOf(this.gantt.$scope.viewScale)>-1?e=l[t]:["month","quarter","year"].indexOf(this.gantt.$scope.viewScale)>-1&&(e=d[t]),void 0===e&&(e=o[t])),e},s}])}(),function(){"use strict";angular.module("gantt").factory("GanttHeaderGenerator",["GanttColumnHeader",function(t){var e=function(e,n,i){for(var a,r,s=[],o=0,l=n.length;l>o;o++){var d=n[o],c=d.date.get(i);if(0===o||r!==c){r=c;var u=d.date.format(e.getHeaderFormat(i));a=new t(d.date,i,d.originalSize.left,d.originalSize.width,u),a.left=d.left,a.width=d.width,s.push(a)}else a.originalSize.width+=d.originalSize.width,a.width+=d.width}return s};return function(t){this.generate=function(n){var i=[];void 0===t.gantt.$scope.headers?(i=[],["year","quarter","month"].indexOf(t.gantt.$scope.viewScale)>-1&&i.push("year"),["quarter"].indexOf(t.gantt.$scope.viewScale)>-1&&i.push("quarter"),["day","week","month"].indexOf(t.gantt.$scope.viewScale)>-1&&i.push("month"),["day","week"].indexOf(t.gantt.$scope.viewScale)>-1&&i.push("week"),["hour","day"].indexOf(t.gantt.$scope.viewScale)>-1&&i.push("day"),["hour","minute","second"].indexOf(t.gantt.$scope.viewScale)>-1&&i.push("hour"),["minute","second"].indexOf(t.gantt.$scope.viewScale)>-1&&i.push("minute"),["second"].indexOf(t.gantt.$scope.viewScale)>-1&&i.push("second"),0===i.length&&i.push(t.gantt.$scope.viewScale)):i=t.gantt.$scope.headers;var a=[];return angular.forEach(i,function(i){a.push(e(t,n,i))}),a}}}])}(),function(){"use strict";angular.module("gantt").factory("Gantt",["GanttApi","GanttCalendar","GanttScroll","GanttBody","GanttRowHeader","GanttHeader","GanttLabels","GanttObjectModel","GanttRowsManager","GanttColumnsManager","GanttTimespansManager","GanttCurrentDateManager","ganttArrays","moment",function(t,e,n,i,a,r,s,o,l,d,c,u,h,g){var m=function(g,m){var p=this;this.$scope=g,this.$element=m,this.api=new t(this),this.api.registerEvent("core","ready"),this.api.registerEvent("directives","preLink"),this.api.registerEvent("directives","postLink"),this.api.registerEvent("directives","new"),this.api.registerEvent("directives","destroy"),this.api.registerEvent("data","load"),this.api.registerEvent("data","remove"),this.api.registerEvent("data","clear"),this.api.registerMethod("core","getDateByPosition",this.getDateByPosition,this),this.api.registerMethod("core","getPositionByDate",this.getPositionByDate,this),this.api.registerMethod("data","load",this.loadData,this),this.api.registerMethod("data","remove",this.removeData,this),this.api.registerMethod("data","clear",this.clearData,this),this.api.registerMethod("data","get",this.getData,this),this.calendar=new e(this),this.calendar.registerTimeFrames(this.$scope.timeFrames),this.calendar.registerDateFrames(this.$scope.dateFrames),this.api.registerMethod("timeframes","registerTimeFrames",this.calendar.registerTimeFrames,this.calendar),this.api.registerMethod("timeframes","clearTimeframes",this.calendar.clearTimeFrames,this.calendar),this.api.registerMethod("timeframes","registerDateFrames",this.calendar.registerDateFrames,this.calendar),this.api.registerMethod("timeframes","clearDateFrames",this.calendar.clearDateFrames,this.calendar),this.api.registerMethod("timeframes","registerTimeFrameMappings",this.calendar.registerTimeFrameMappings,this.calendar),this.api.registerMethod("timeframes","clearTimeFrameMappings",this.calendar.clearTimeFrameMappings,this.calendar),g.$watchGroup(["timeFrames","dateFrames"],function(t,e){if(t!==e){var n=t[0],i=t[1],a=e[0],r=e[1];angular.equals(n,a)||(p.calendar.clearTimeFrames(),p.calendar.registerTimeFrames(n)),angular.equals(i,r)||(p.calendar.clearDateFrames(),p.calendar.registerDateFrames(i)),p.columnsManager.generateColumns()}}),this.scroll=new n(this),this.body=new i(this),this.rowHeader=new a(this),this.header=new r(this),this.labels=new s(this),this.objectModel=new o(this.api),this.rowsManager=new l(this),this.columnsManager=new d(this),this.timespansManager=new c(this),this.currentDateManager=new u(this),this.originalWidth=0,this.width=0,angular.isFunction(this.$scope.api)&&this.$scope.api(this.api),this.$scope.$watchCollection("data",function(t,e){for(var n=h.getRemovedIds(t,e),i=0,a=n.length;a>i;i++){var r=n[i];p.rowsManager.removeRow(r)}void 0!==t&&p.loadData(t)})};return m.prototype.getDateByPosition=function(t,e){var n=this.columnsManager.getColumnByPosition(t);return void 0!==n?n.getDateByPosition(t-n.left,e):void 0},m.prototype.getPositionByDate=function(t){if(void 0===t)return void 0;g.isMoment(g)||(t=g(t));var e=this.columnsManager.getColumnByDate(t);return void 0!==e?e.getPositionByDate(t):void 0},m.prototype.loadData=function(t){angular.isArray(t)||(t=void 0!==t?[t]:[]),(void 0===this.$scope.data||this.$scope.data!==t)&&(this.$scope.data=[]);for(var e=0,n=t.length;n>e;e++){var i=t[e];this.rowsManager.addRow(i)}this.api.data.raise.load(this.$scope,t)},m.prototype.getData=function(){return this.$scope.data},m.prototype.removeData=function(t){angular.isArray(t)||(t=void 0!==t?[t]:[]),this.rowsManager.removeData(t),this.api.data.raise.remove(this.$scope,t)},m.prototype.clearData=function(){this.rowsManager.removeAll(),this.api.data.raise.clear(this.$scope)},m}])}(),function(){"use strict";angular.module("gantt").factory("GanttObjectModel",["ganttUtils","moment",function(t,e){var n=function(t){this.api=t,this.api.registerEvent("tasks","clean"),this.api.registerEvent("rows","clean"),this.api.registerEvent("timespans","clean")};return n.prototype.cleanTask=function(n){void 0===n.id&&(n.id=t.randomUuid()),void 0===n.from||e.isMoment(n.from)||(n.from=e(n.from)),void 0===n.to||e.isMoment(n.to)||(n.to=e(n.to)),this.api.tasks.raise.clean(n)},n.prototype.cleanRow=function(n){void 0===n.id&&(n.id=t.randomUuid()),void 0===n.from||e.isMoment(n.from)||(n.from=e(n.from)),void 0===n.to||e.isMoment(n.to)||(n.to=e(n.to)),this.api.rows.raise.clean(n)},n.prototype.cleanTimespan=function(n){void 0===n.id&&(n.id=t.randomUuid()),void 0===n.from||e.isMoment(n.from)||(n.from=e(n.from)),void 0===n.to||e.isMoment(n.to)||(n.to=e(n.to)),this.api.timespans.raise.clean(n)},n}])}(),function(){"use strict";angular.module("gantt").factory("GanttRow",["GanttTask","moment","$filter",function(t,e,n){var i=function(t,e){this.rowsManager=t,this.model=e,this.from=void 0,this.to=void 0,this.tasksMap={},this.tasks=[],this.filteredTasks=[],this.visibleTasks=[]};return i.prototype.addTaskImpl=function(t,e){this.tasksMap[t.model.id]=t,this.tasks.push(t),this.filteredTasks.push(t),this.visibleTasks.push(t),e||(void 0===this.model.tasks&&(this.model.tasks=[]),-1===this.model.tasks.indexOf(t.model)&&this.model.tasks.push(t.model))},i.prototype.addTask=function(e,n){var i,a=!1;if(this.rowsManager.gantt.objectModel.cleanTask(e),e.id in this.tasksMap){if(i=this.tasksMap[e.id],i.model===e)return i;i.model=e,a=!0}else i=new t(this,e),this.addTaskImpl(i,n);return this.sortTasks(),this.setFromToByTask(i),n||(a?this.rowsManager.gantt.api.tasks.raise.change(i):this.rowsManager.gantt.api.tasks.raise.add(i)),i},i.prototype.moveTaskToRow=function(t,e){var n=t.row;n.removeTask(t.model.id,e),t.row=this,this.addTaskImpl(t,e),this.sortTasks(),this.setFromToByTask(t),t.updatePosAndSize(),e||this.rowsManager.gantt.api.tasks.raise.rowChange(t,n)},i.prototype.updateVisibleTasks=function(){if(this.rowsManager.gantt.$scope.filterTask){var t=this.rowsManager.gantt.$scope.filterTask;"object"==typeof t&&(t={model:t});var e=this.rowsManager.gantt.$scope.filterTaskComparator;"function"==typeof e&&(e=function(t,e){return this.rowsManager.gantt.$scope.filterRowComparator(t.model,e.model)}),this.filteredTasks=n("filter")(this.tasks,t,e)}else this.filteredTasks=this.tasks.slice(0);this.visibleTasks=n("ganttTaskLimit")(this.filteredTasks,this.rowsManager.gantt)},i.prototype.updateTasksPosAndSize=function(){for(var t=0,e=this.tasks.length;e>t;t++)this.tasks[t].updatePosAndSize()},i.prototype.removeTask=function(t,e){if(t in this.tasksMap){var n,i,a=this.tasksMap[t];for(i=this.tasks.length-1;i>=0;i--)if(n=this.tasks[i],n.model.id===t){this.tasks.splice(i,1),(this.from-n.model.from===0||this.to-n.model.to===0)&&this.setFromTo();break}for(i=this.filteredTasks.length-1;i>=0;i--)if(n=this.filteredTasks[i],n.model.id===t){this.filteredTasks.splice(i,1);break}for(i=this.visibleTasks.length-1;i>=0;i--)if(n=this.visibleTasks[i],n.model.id===t){this.visibleTasks.splice(i,1);break}if(!e){if(delete this.tasksMap[t],void 0!==this.model.tasks){var r=this.model.tasks.indexOf(a.model);r>-1&&this.model.tasks.splice(r,1)}this.rowsManager.gantt.api.tasks.raise.remove(a)}return a}},i.prototype.removeAllTasks=function(){this.from=void 0,this.to=void 0,this.tasksMap={},this.tasks=[],this.filteredTasks=[],this.visibleTasks=[]},i.prototype.setFromTo=function(){this.from=void 0,this.to=void 0;for(var t=0,e=this.tasks.length;e>t;t++)this.setFromToByTask(this.tasks[t])},i.prototype.setFromToByTask=function(t){void 0===this.from?this.from=e(t.model.from):t.model.from<this.from&&(this.from=e(t.model.from)),void 0===this.to?this.to=e(t.model.to):t.model.to>this.to&&(this.to=e(t.model.to))},i.prototype.sortTasks=function(){this.tasks.sort(function(t,e){return t.left-e.left})},i.prototype.clone=function(){for(var t=new i(this.rowsManager,angular.copy(this)),e=0,n=this.tasks.length;n>e;e++)t.addTask(this.tasks[e].model);return t},i}])}(),function(){"use strict";angular.module("gantt").factory("GanttRowHeader",[function(){var t=function(t){this.gantt=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttRowsManager",["GanttRow","ganttArrays","$filter","moment",function(t,e,n,i){var a=function(t){var e=this;this.gantt=t,this.rowsMap={},this.rows=[],this.sortedRows=[],this.filteredRows=[],this.visibleRows=[],this.rowsTaskWatchers=[],this.gantt.$scope.$watchGroup(["scrollLeft","scrollWidth"],function(t,n){t!==n&&e.updateVisibleTasks()}),this.gantt.$scope.$watchGroup(["filterTask","filterTaskComparator"],function(t,n){t!==n&&e.updateVisibleTasks()}),this.gantt.$scope.$watchGroup(["filterRow","filterRowComparator"],function(t,n){t!==n&&e.updateVisibleRows()}),this.gantt.$scope.$watch("sortMode",function(t,n){t!==n&&e.sortRows()}),this.gantt.api.registerMethod("rows","sort",a.prototype.sortRows,this),this.gantt.api.registerMethod("rows","applySort",a.prototype.applySort,this),this.gantt.api.registerMethod("rows","refresh",a.prototype.updateVisibleObjects,this),this.gantt.api.registerEvent("tasks","add"),this.gantt.api.registerEvent("tasks","change"),this.gantt.api.registerEvent("tasks","rowChange"),this.gantt.api.registerEvent("tasks","remove"),this.gantt.api.registerEvent("tasks","filter"),this.gantt.api.registerEvent("rows","add"),this.gantt.api.registerEvent("rows","change"),this.gantt.api.registerEvent("rows","remove"),this.gantt.api.registerEvent("rows","move"),this.gantt.api.registerEvent("rows","filter"),this.updateVisibleObjects()
  };return a.prototype.addRow=function(n){var i,a,r,s=!1;if(this.gantt.objectModel.cleanRow(n),n.id in this.rowsMap){if(i=this.rowsMap[n.id],i.model===n)return;var o=e.getRemovedIds(n.tasks,i.model.tasks);for(a=0,r=o.length;r>a;a++){var l=o[a];i.removeTask(l)}i.model=n,s=!0}else i=new t(this,n),this.rowsMap[n.id]=i,this.rows.push(i),this.sortedRows.push(i),this.filteredRows.push(i),this.visibleRows.push(i),-1===this.gantt.$scope.data.indexOf(n)&&this.gantt.$scope.data.push(n);if(void 0!==n.tasks&&n.tasks.length>0)for(a=0,r=n.tasks.length;r>a;a++){var d=n.tasks[a];i.addTask(d)}if(s?this.gantt.api.rows.raise.change(i):this.gantt.api.rows.raise.add(i),!s){var c=this.gantt.$scope.$watchCollection(function(){return n.tasks},function(t,n){if(t!==n){var a,r,s=e.getRemovedIds(t,n);for(a=0,r=s.length;r>a;a++){var o=s[a];i.removeTask(o)}if(void 0!==t)for(a=0,r=t.length;r>a;a++){var l=t[a];i.addTask(l)}}});this.rowsTaskWatchers.push(c)}return s},a.prototype.removeRow=function(t){if(t in this.rowsMap){delete this.rowsMap[t];var n,i,a=e.indexOfId(this.rows,t,["model","id"]);if(a>-1){n=this.rows.splice(a,1)[0];var r=this.rowsTaskWatchers.splice(a,1)[0];r()}return e.removeId(this.sortedRows,t,["model","id"]),e.removeId(this.filteredRows,t,["model","id"]),e.removeId(this.visibleRows,t,["model","id"]),e.remove(this.gantt.$scope.data,n.model),this.gantt.api.rows.raise.remove(n),i}return void 0},a.prototype.removeData=function(t){for(var e=0,n=t.length;n>e;e++){var i,a=t[e];if(void 0!==a.tasks&&a.tasks.length>0){if(a.id in this.rowsMap){i=this.rowsMap[a.id];for(var r=0,s=a.tasks.length;s>r;r++)i.removeTask(a.tasks[r].id);this.gantt.api.rows.raise.change(i)}}else i=this.removeRow(a.id)}this.updateVisibleObjects()},a.prototype.removeAll=function(){this.rowsMap={},this.rows=[],this.sortedRows=[],this.filteredRows=[],this.visibleRows=[];for(var t=this.gantt.$scope.data;t>0;)t.pop();for(var e=0,n=this.rowsTaskWatchers.length;n>e;e++){var i=this.rowsTaskWatchers[e];i()}this.rowsTaskWatchers=[]},a.prototype.sortRows=function(){var t=this.gantt.$scope.sortMode;if(void 0!==t){var e=!1;"-"===t.charAt(0)&&(e=!0,t=t.substr(1));var i=n("orderBy");this.sortedRows=i(this.rows,t,e)}else this.sortedRows=this.rows.slice();this.updateVisibleRows()},a.prototype.applySort=function(){for(var t=this.gantt.$scope.data;t>0;)t.pop();for(var e=[],n=0,i=this.sortedRows.length;i>n;n++)t.push(this.sortedRows[n].model),e.push(this.sortedRows[n]);this.rows=e},a.prototype.moveRow=function(t,n){void 0!==this.gantt.$scope.sortMode&&(this.applySort(),this.gantt.$scope.sortMode=void 0);var i=this.rows.indexOf(n),a=this.rows.indexOf(t);i>-1&&a>-1&&i!==a&&(e.moveToIndex(this.rows,a,i),e.moveToIndex(this.rowsTaskWatchers,a,i),e.moveToIndex(this.gantt.$scope.data,a,i),this.gantt.api.rows.raise.change(t),this.gantt.api.rows.raise.move(t,a,i),this.updateVisibleObjects(),this.sortRows())},a.prototype.updateVisibleObjects=function(){this.updateVisibleRows(),this.updateVisibleTasks()},a.prototype.updateVisibleRows=function(){var t=this.filteredRows;if(this.gantt.$scope.filterRow){var e=this.gantt.$scope.filterRow;"object"==typeof e&&(e={model:e});var i=this.gantt.$scope.filterRowComparator;"function"==typeof i&&(i=function(t,e){return this.gantt.$scope.filterRowComparator(t.model,e.model)}),this.filteredRows=n("filter")(this.sortedRows,e,i)}else this.filteredRows=this.sortedRows.slice(0);var a=!angular.equals(t,this.filteredRows);this.visibleRows=this.filteredRows,a&&this.gantt.api.rows.raise.filter(this.sortedRows,this.filteredRows)},a.prototype.updateVisibleTasks=function(){var t=[],e=[],n=[];angular.forEach(this.filteredRows,function(i){t=t.concat(i.filteredTasks),i.updateVisibleTasks(),e=e.concat(i.filteredTasks),n=n.concat(i.tasks)});var i=!angular.equals(t,e);i&&this.gantt.api.tasks.raise.filter(n,e)},a.prototype.updateTasksPosAndSize=function(){for(var t=0,e=this.rows.length;e>t;t++)this.rows[t].updateTasksPosAndSize()},a.prototype.getExpandedFrom=function(t){t=t?i(t):t;var e=t;return angular.forEach(this.rows,function(t){(void 0===e||e>t.from)&&(e=t.from)}),e&&(!t||t>e)?e:t},a.prototype.getExpandedTo=function(t){t=t?i(t):t;var e=t;return angular.forEach(this.rows,function(t){(void 0===e||e<t.to)&&(e=t.to)}),e&&(!this.gantt.$scope.toDate||e>this.gantt.$scope.toDate)?e:t},a.prototype.getDefaultFrom=function(){var t;return angular.forEach(this.rows,function(e){(void 0===t||e.from<t)&&(t=e.from)}),t},a.prototype.getDefaultTo=function(){var t;return angular.forEach(this.rows,function(e){(void 0===t||e.to>t)&&(t=e.to)}),t},a}])}(),function(){"use strict";angular.module("gantt").factory("GanttTask",[function(){var t=function(t,e){this.rowsManager=t.rowsManager,this.row=t,this.model=e,this.truncatedLeft=!1,this.truncatedRight=!1};return t.prototype.isMilestone=function(){return!this.model.to||this.model.from-this.model.to===0},t.prototype.updatePosAndSize=function(){this.modelLeft=this.rowsManager.gantt.getPositionByDate(this.model.from),this.modelWidth=this.rowsManager.gantt.getPositionByDate(this.model.to)-this.modelLeft,this.left=Math.min(Math.max(this.modelLeft,0),this.rowsManager.gantt.width),this.modelLeft<0?(this.truncatedLeft=!0,this.modelWidth+this.modelLeft>this.rowsManager.gantt.width?(this.truncatedRight=!0,this.width=this.rowsManager.gantt.width):(this.truncatedRight=!1,this.width=this.modelWidth+this.modelLeft)):this.modelWidth+this.modelLeft>this.rowsManager.gantt.width?(this.truncatedRight=!0,this.truncatedLeft=!1,this.width=this.rowsManager.gantt.width-this.modelLeft):(this.truncatedLeft=!1,this.truncatedRight=!1,this.width=this.modelWidth),this.width<0&&(this.left=this.left+this.width,this.width=-this.width),this.updateView()},t.prototype.updateView=function(){this.$element&&(this.$element.css("left",this.left+"px"),this.$element.css("width",this.width+"px"))},t.prototype.setFrom=function(t){this.model.from=this.rowsManager.gantt.getDateByPosition(t,!0),this.row.setFromToByTask(this),this.updatePosAndSize()},t.prototype.setTo=function(t){this.model.to=this.rowsManager.gantt.getDateByPosition(t,!0),this.row.setFromToByTask(this),this.updatePosAndSize()},t.prototype.moveTo=function(t){this.model.from=this.rowsManager.gantt.getDateByPosition(t,!0);var e=this.rowsManager.gantt.getPositionByDate(this.model.from);this.model.to=this.rowsManager.gantt.getDateByPosition(e+this.modelWidth,!0),this.row.setFromToByTask(this),this.updatePosAndSize()},t.prototype.clone=function(){return new t(this.row,angular.copy(this.model))},t}])}(),function(){"use strict";angular.module("gantt").factory("GanttBody",["GanttBodyColumns","GanttBodyRows","GanttBodyBackground","GanttBodyForeground",function(t,e,n,i){var a=function(a){this.gantt=a,this.background=new n(this),this.foreground=new i(this),this.columns=new t(this),this.rows=new e(this)};return a}])}(),function(){"use strict";angular.module("gantt").factory("GanttBodyBackground",[function(){var t=function(t){this.body=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttBodyColumns",[function(){var t=function(t){this.body=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttBodyForeground",[function(){var t=function(t){this.body=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttBodyRows",[function(){var t=function(t){this.body=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttHeader",["GanttHeaderColumns",function(t){var e=function(e){this.gantt=e,this.columns=new t(this),this.getHeight=function(){return this.$element[0].offsetHeight}};return e}])}(),function(){"use strict";angular.module("gantt").factory("GanttHeaderColumns",[function(){var t=function(t){this.$element=t};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttLabels",[function(){var t=function(t){this.gantt=t,this.gantt.api.registerEvent("labels","resize")};return t}])}(),function(){"use strict";angular.module("gantt").factory("GanttScroll",[function(){var t=function(e){this.gantt=e,this.gantt.api.registerEvent("scroll","scroll"),this.gantt.api.registerMethod("scroll","to",t.prototype.scrollTo,this),this.gantt.api.registerMethod("scroll","toDate",t.prototype.scrollToDate,this),this.gantt.api.registerMethod("scroll","left",t.prototype.scrollToLeft,this),this.gantt.api.registerMethod("scroll","right",t.prototype.scrollToRight,this)};return t.prototype.scrollTo=function(t){this.$element[0].scrollLeft=t,this.$element.triggerHandler("scroll")},t.prototype.scrollToLeft=function(t){this.$element[0].scrollLeft-=t,this.$element.triggerHandler("scroll")},t.prototype.scrollToRight=function(t){this.$element[0].scrollLeft+=t,this.$element.triggerHandler("scroll")},t.prototype.scrollToDate=function(t){var e=this.gantt.getPositionByDate(t);void 0!==e&&(this.$element[0].scrollLeft=e-this.$element[0].offsetWidth/2)},t}])}(),function(){"use strict";angular.module("gantt").factory("GanttTimespan",[function(){var t=function(t,e){this.gantt=t,this.model=e};return t.prototype.updatePosAndSize=function(){this.left=this.gantt.getPositionByDate(this.model.from),this.width=this.gantt.getPositionByDate(this.model.to)-this.left,this.updateView()},t.prototype.updateView=function(){this.$element&&(this.$element.css("left",this.left+"px"),this.$element.css("width",this.width+"px"))},t.prototype.setFrom=function(t){this.from=this.gantt.getDateByPosition(t),this.updatePosAndSize()},t.prototype.setTo=function(t){this.to=this.gantt.getDateByPosition(t),this.updatePosAndSize()},t.prototype.moveTo=function(t){this.from=this.gantt.getDateByPosition(t),this.to=this.gantt.getDateByPosition(t+this.width),this.updatePosAndSize()},t.prototype.clone=function(){return new t(this.gantt,angular.copy(this.model))},t}])}(),function(){"use strict";angular.module("gantt").factory("GanttTimespansManager",["GanttTimespan",function(t){var e=function(t){var e=this;this.gantt=t,this.timespansMap={},this.timespans=[],this.gantt.$scope.$watchCollection("timespans",function(t){e.clearTimespans(),e.loadTimespans(t)}),this.gantt.api.registerMethod("timespans","load",this.loadTimespans,this),this.gantt.api.registerMethod("timespans","remove",this.removeTimespans,this),this.gantt.api.registerMethod("timespans","clear",this.clearTimespans,this),this.gantt.api.registerEvent("timespans","add"),this.gantt.api.registerEvent("timespans","remove"),this.gantt.api.registerEvent("timespans","change")};return e.prototype.loadTimespans=function(t){angular.isArray(t)||(t=void 0!==t?[t]:[]),this.gantt.$scope.timespans=t;for(var e=0,n=t.length;n>e;e++){var i=t[e];this.gantt.objectModel.cleanTimespan(i),this.loadTimespan(i)}},e.prototype.loadTimespan=function(e){var n,i=!1;return e.id in this.timespansMap?(n=this.timespansMap[e.id],n.model=e,i=!0,this.gantt.api.timespans.raise.change(n)):(n=new t(this.gantt,e),this.timespansMap[e.id]=n,this.timespans.push(n),this.gantt.api.timespans.raise.add(n)),n.updatePosAndSize(),i},e.prototype.removeTimespans=function(t){angular.isArray(t)||(t=[t]);for(var e=0,n=t.length;n>e;e++){var i=t[e];this.removeTimespan(i.id)}this.updateVisibleObjects()},e.prototype.removeTimespan=function(t){if(t in this.timespansMap){delete this.timespansMap[t];for(var e,n,i=this.timespans.length-1;i>=0;i--)n=this.timespans[i],n.model.id===t&&(e=n,this.timespans.splice(i,1));return this.gantt.api.timespans.raise.remove(e),e}return void 0},e.prototype.clearTimespans=function(){this.timespansMap={},this.timespans=[]},e.prototype.updateTimespansPosAndSize=function(){for(var t=0,e=this.timespans.length;e>t;t++)this.timespans[t].updatePosAndSize()},e}])}(),function(){"use strict";angular.module("gantt").service("ganttArrays",[function(){return{moveToIndex:function(t,e,n){if(n>=t.length)for(var i=n-t.length;i--+1;)t.push(void 0);return t.splice(n,0,t.splice(e,1)[0]),t},getRemovedIds:function(t,e,n){void 0===n&&(n="id");var i,a,r=[];if(void 0!==e)for(i=0,a=e.length;a>i;i++)r.push(e[i][n]);if(void 0!==t)for(i=0,a=t.length;a>i;i++){var s=t[i];if(void 0!==s[n]){var o=r.indexOf(s[n]);o>-1&&r.splice(o,1)}}return r},indexOfId:function(t,e,n){var i;if(void 0===n)n="id";else if(n instanceof Array){for(i=t.length-1;i>=0;i--){for(var a=t[i],r=0,s=n.length;s>r;r++)a=a[n[r]];if(a===e)return i}return-1}for(i=t.length-1;i>=0;i--)if(t[i][n]===e)return i;return-1},removeId:function(t,e,n){var i=this.indexOfId(t,e,n);return i>-1?t.splice(i,1)[0]:void 0},remove:function(t,e){var n=t.indexOf(e);return n>-1?(t.splice(n,1),!0):!1}}}])}(),function(){"use strict";angular.module("gantt").service("ganttBinarySearch",[function(){return{getIndicesOnly:function(t,e,n){for(var i=-1,a=t.length;a-i>1;){var r=Math.floor((i+a)/2);n(t[r])<=e?i=r:a=r}return void 0!==t[i]&&n(t[i])===e&&(a=i),[i,a]},get:function(t,e,n){var i=this.getIndicesOnly(t,e,n);return[t[i[0]],t[i[1]]]}}}])}(),function(){"use strict";angular.module("gantt").service("ganttUtils",["$document",function(t){return{createBoundedWrapper:function(t,e){return function(){return e.apply(t,arguments)}},firstProperty:function(t,e,n){for(var i=0,a=t.length;a>i;i++){var r=t[i];if(void 0!==r&&e in r&&void 0!==r[e])return r[e]}return n},elementFromPoint:function(e,n){var i=t[0].elementFromPoint(e,n);return angular.element(i)},scopeFromPoint:function(t,e){var n=this.elementFromPoint(t,e);return void 0!==n?n.scope():void 0},random4:function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},randomUuid:function(){return this.random4()+this.random4()+"-"+this.random4()+"-"+this.random4()+"-"+this.random4()+"-"+this.random4()+this.random4()+this.random4()},newId:function(){var t=(new Date).getTime();return function(){return t+=1}}()}}])}(),function(){"use strict";angular.module("gantt").directive("ganttLabelsResize",["$document","ganttDebounce","ganttMouseOffset",function(t,e,n){return{restrict:"A",require:"^gantt",scope:{enabled:"=ganttLabelsResize",width:"=ganttLabelsResizeWidth",minWidth:"=ganttLabelsResizeMinWidth"},link:function(e,i,a,r){var s,o=r.gantt.api,l=5,d="ew-resize";i.bind("mousedown",function(t){e.enabled&&u(t)&&(h(t),t.preventDefault())}),i.bind("mousemove",function(t){e.enabled&&(u(t)?i.css("cursor",d):i.css("cursor",""))});var c=function(t){0===e.width&&(e.width=i[0].offsetWidth),e.width+=t-s,e.width<e.minWidth&&(e.width=e.minWidth),s=t},u=function(t){var e=n.getOffset(t).x;return e>i[0].offsetWidth-l},h=function(n){s=n.screenX,angular.element(t[0].body).css({"-moz-user-select":"-moz-none","-webkit-user-select":"none","-ms-user-select":"none","user-select":"none",cursor:d});var i=function(t){e.$evalAsync(function(){c(t.screenX)})};angular.element(t[0].body).bind("mousemove",i),angular.element(t[0].body).one("mouseup",function(){angular.element(t[0].body).unbind("mousemove",i),g()})},g=function(){i.css("cursor",""),angular.element(t[0].body).css({"-moz-user-select":"","-webkit-user-select":"","-ms-user-select":"","user-select":"",cursor:""}),o.labels.raise.resize(e.width)}}}}])}(),function(){"use strict";angular.module("gantt").filter("ganttColumnLimit",["ganttBinarySearch",function(t){return function(e,n,i){var a=function(t){return t.left},r=t.getIndicesOnly(e,n,a)[0],s=t.getIndicesOnly(e,n+i,a)[1];return e.slice(r,s)}}])}(),function(){"use strict";angular.module("gantt").directive("ganttLimitUpdater",["$timeout","ganttDebounce",function(t,e){return{restrict:"A",controller:["$scope","$element",function(t,n){var i=n[0],a=function(){t.scrollLeft=i.scrollLeft,t.scrollWidth=i.offsetWidth};n.bind("scroll",e(function(){a()},5)),t.$watch("gantt.width",e(function(){a()},20))}]}}])}(),function(){"use strict";angular.module("gantt").filter("ganttTaskLimit",[function(){return function(t,e){var n=[],i=e.columnsManager.getFirstColumn(),a=e.columnsManager.getLastColumn();if(void 0!==i&&void 0!==a)for(var r=0,s=t.length;s>r;r++){var o=t[r];if(o.active)n.push(o);else if(o.model.to>e.columnsManager.getFirstColumn().date&&o.model.from<e.columnsManager.getLastColumn().endDate){var l=e.$scope.scrollLeft,d=e.$scope.scrollWidth;(void 0===l&&void 0===d||o.left>=l&&o.left<=l+d||o.left+o.width>=l&&o.left+o.width<=l+d||o.left<l&&o.left+o.width>l+d)&&n.push(o)}}return n}}])}(),function(){"use strict";angular.module("gantt").directive("ganttHorizontalScrollReceiver",function(){return{restrict:"A",require:"^ganttScrollManager",controller:["$scope","$element",function(t,e){t.scrollManager.registerHorizontalReceiver(e)}]}})}(),function(){"use strict";angular.module("gantt").directive("ganttScrollManager",function(){return{restrict:"A",controller:["$scope",function(t){t.scrollManager={horizontal:[],vertical:[],registerVerticalReceiver:function(e){e.css("position","relative"),t.scrollManager.vertical.push(e[0])},registerHorizontalReceiver:function(e){e.css("position","relative"),t.scrollManager.horizontal.push(e[0])}}}]}})}(),function(){"use strict";angular.module("gantt").directive("ganttScrollSender",[function(){return{restrict:"A",require:"^ganttScrollManager",controller:["$scope","$element",function(t,e){var n,i,a,r=e[0],s=function(){var e,n;for(e=0,n=t.scrollManager.vertical.length;n>e;e++){var a=t.scrollManager.vertical[e];a.style.top!==-r.scrollTop&&(a.style.top=-r.scrollTop+"px")}for(e=0,n=t.scrollManager.horizontal.length;n>e;e++){var s=t.scrollManager.horizontal[e];s.style.left!==-r.scrollLeft&&(s.style.left=-r.scrollLeft+"px",s.style.width=i+r.scrollLeft+"px")}};e.bind("scroll",s),t.$watchGroup(["labelsWidth","bodyRowsWidth","bodyRowsHeight"],function(t){n=t[0],i=t[1],a=t[2],s()})}]}}])}(),function(){"use strict";angular.module("gantt").directive("ganttScrollable",["GanttDirectiveBuilder","ganttDebounce","ganttLayout","moment",function(t,e,n,i){var a=new t("ganttScrollable");return a.controller=function(t,a){t.gantt.scroll.$element=a;var r,s,o=n.getScrollBarWidth(),l=500,d=function(e,n,a){if(!("both"!==t.autoExpand&&t.autoExpand!==!0&&t.autoExpand!==a||Date.now()-s<l)){var r,o,d=1,c=31;"left"===a?(r="hour"===t.viewScale?i(n).add(-d,"day"):i(n).add(-c,"day"),o=n):(r=n,o="hour"===t.viewScale?i(n).add(d,"day"):i(n).add(c,"day")),t.fromDate=r,t.toDate=o,s=Date.now()}};a.bind("scroll",e(function(){var e,n,i=a[0];i.scrollLeft<r&&0===i.scrollLeft?(e="left",n=t.gantt.columnsManager.from):i.scrollLeft>r&&i.offsetWidth+i.scrollLeft>=i.scrollWidth-1&&(e="right",n=t.gantt.columnsManager.to),r=i.scrollLeft,void 0!==n?(d(i,n,e),t.gantt.api.scroll.raise.scroll(i.scrollLeft,n,e)):t.gantt.api.scroll.raise.scroll(i.scrollLeft)},5)),t.getScrollableCss=function(){var e={};return t.ganttElementWidth-(t.showLabelsColumn?t.labelsWidth:0)>t.gantt.width+o&&(e.width=t.gantt.width+o+"px"),t.maxHeight>0?(e["max-height"]=t.maxHeight-t.gantt.header.getHeight()+"px",e["overflow-y"]="auto"):e["overflow-y"]="hidden",e}},a.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttVerticalScrollReceiver",function(){return{restrict:"A",require:"^ganttScrollManager",controller:["$scope","$element",function(t,e){t.scrollManager.registerVerticalReceiver(e)}]}})}(),function(){"use strict";angular.module("gantt").directive("ganttElementHeightListener",[function(){return{restrict:"A",controller:["$scope","$element","$attrs",function(t,e,n){var i=n.ganttElementHeightListener;""===i&&(i="ganttElementHeight");for(var a=t;0===i.indexOf("$parent.");)i=i.substring("$parent.".length),a=a.$parent;a.$watch(function(){e[0].offsetHeight>0&&(a[i]=e[0].offsetHeight)})}]}}])}(),function(){"use strict";angular.module("gantt").directive("ganttElementWidthListener",[function(){return{restrict:"A",controller:["$scope","$element","$attrs",function(t,e,n){var i=n.ganttElementWidthListener;""===i&&(i="ganttElementWidth");for(var a=t;0===i.indexOf("$parent.");)i=i.substring("$parent.".length),a=a.$parent;a.$watch(function(){e[0].offsetWidth>0&&(a[i]=e[0].offsetWidth)})}]}}])}(),function(){"use strict";angular.module("gantt").directive("ganttBody",["GanttDirectiveBuilder",function(t){var e=new t("ganttBody");return e.controller=function(t,e){t.gantt.body.$element=e},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttBodyBackground",["GanttDirectiveBuilder",function(t){var e=new t("ganttBodyBackground");return e.controller=function(t,e){t.gantt.body.background.$element=e},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttBodyColumns",["GanttDirectiveBuilder",function(t){var e=new t("ganttBodyColumns");return e.controller=function(t,e){t.gantt.body.columns.$element=e},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttBodyForeground",["GanttDirectiveBuilder",function(t){var e=new t("ganttBodyForeground");return e.controller=function(t,e){t.gantt.body.foreground.$element=e},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttBodyRows",["GanttDirectiveBuilder",function(t){var e=new t("ganttBodyRows");return e.controller=function(t,e){t.gantt.body.rows.$element=e},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttColumn",["GanttDirectiveBuilder",function(t){var e=new t("ganttColumn");return e.controller=function(t,e){t.column.$element=e,t.column.updateView()},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttColumnHeader",["GanttDirectiveBuilder",function(t){var e=new t("ganttColumnHeader");return e.controller=function(t,e){t.column.$element=e,t.column.updateView()},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttHeader",["GanttDirectiveBuilder",function(t){var e=new t("ganttHeader");return e.controller=function(t,e){t.gantt.header.$element=e,t.getHeaderCss=function(){var e={};return t.ganttElementWidth-(t.showLabelsColumn?t.labelsWidth:0)>t.gantt.width&&(e.width=t.gantt.width+"px"),e}},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttHeaderColumns",["GanttDirectiveBuilder",function(t){var e=new t("ganttHeaderColumns");return e.controller=function(t,e){t.gantt.header.columns.$element=e},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttLabels",["GanttDirectiveBuilder",function(t){var e=new t("ganttLabels");return e.controller=function(t,e){t.gantt.labels.$element=e},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttLabelsBody",["GanttDirectiveBuilder",function(t){var e=new t("ganttLabelsBody");return e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttLabelsHeader",["GanttDirectiveBuilder",function(t){var e=new t("ganttLabelsHeader");return e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttRow",["GanttDirectiveBuilder",function(t){var e=new t("ganttRow");return e.controller=function(t,e){t.row.$element=e},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttRowBackground",["GanttDirectiveBuilder",function(t){var e=new t("ganttRowBackground");return e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttRowHeader",["GanttDirectiveBuilder",function(t){var e=new t("ganttRowHeader");return e.controller=function(t,e){t.gantt.rowHeader.$element=e},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttRowLabel",["GanttDirectiveBuilder",function(t){var e=new t("ganttRowLabel");return e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttTask",["GanttDirectiveBuilder",function(t){var e=new t("ganttTask");return e.controller=function(t,e){t.task.$element=e,t.$watchGroup(["task.model.from","task.model.to"],function(){t.task.updatePosAndSize()})},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttTaskContent",["GanttDirectiveBuilder",function(t){var e=new t("ganttTaskContent");return e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttTimeFrame",["GanttDirectiveBuilder",function(t){var e=new t("ganttTimeFrame");return e.controller=function(t,e){t.timeFrame.$element=e,t.timeFrame.updateView()},e.build()}])}(),function(){"use strict";angular.module("gantt").directive("ganttTimespan",["GanttDirectiveBuilder",function(t){var e=new t("ganttTimespan");return e.controller=function(t,e){t.timespan.$element=e,t.timespan.updateView()},e.build()}])}(),function(){"use strict";angular.module("gantt").factory("ganttDebounce",["$timeout",function(t){function e(e,n,i){var a=0;return function(){var r=this,s=arguments;a++;var o=function(t){return function(){return t===a?e.apply(r,s):void 0}}(a);return t(o,n,void 0===i?!0:i)}}return e}])}(),function(){"use strict";angular.module("gantt").service("GanttDirectiveBuilder",[function(){var t=function(t,e,n,i){var a=this;this.directiveName=t,this.templateUrl=void 0===e?"template/"+t+".tmpl.html":e,this.require=void 0===n?"^gantt":n,this.restrict=void 0===i?"E":i,this.transclude=!0,this.replace=!0,this.build=function(){var t=a.directiveName,e=a.templateUrl,n=a.controller;return{restrict:a.restrict,require:a.require,transclude:a.transclude,replace:a.replace,templateUrl:function(t,n){return void 0===n.templateUrl?e:n.templateUrl},compile:function(){return{pre:function(e,n,i,a){e.gantt.api.directives.raise.preLink(t,e,n,i,a)},post:function(e,n,i,a){e.gantt.api.directives.raise.postLink(t,e,n,i,a)}}},controller:["$scope","$element","$attrs",function(e,i,a){var r=this;void 0!==n&&n(e,i,a,r),e.gantt.api.directives.raise.new(t,e,i,a,r),e.$on("$destroy",function(){e.gantt.api.directives.raise.destroy(t,e,i,a,r)})}]}}};return t}])}(),function(){"use strict";angular.module("gantt").service("ganttEnableNgAnimate",["$injector",function(t){var e;try{e=t.get("$animate")}catch(n){}return void 0!==e?function(t,n){e.enabled(!1,n)}:function(){}}])}(),function(){"use strict";angular.module("gantt").service("ganttLayout",["$document",function(t){return{getScrollBarWidth:function(){var e=t[0].createElement("p");e.style.width="100%",e.style.height="200px";var n=t[0].createElement("div");n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.visibility="hidden",n.style.width="200px",n.style.height="150px",n.style.overflow="hidden",n.appendChild(e),t[0].body.appendChild(n);var i=e.offsetWidth;n.style.overflow="scroll";var a=e.offsetWidth;return i===a&&(a=n.clientWidth),t[0].body.removeChild(n),i-a},setColumnsWidth:function(t,e,n){if(t&&e&&n){var i=Math.abs(t/e);angular.forEach(n,function(t){t.left=i*t.originalSize.left,t.width=i*t.originalSize.width,angular.forEach(t.timeFrames,function(t){t.left=i*t.originalSize.left,t.width=i*t.originalSize.width})})}}}}])}(),function(){"use strict";angular.module("gantt").service("ganttMouseButton",[function(){return{getButton:function(t){return t=t||window.event,t.which?t.which:void 0===t.button?1:t.button<2?1:4===t.button?2:3}}}])}(),function(){"use strict";angular.module("gantt").service("ganttMouseOffset",[function(){return{getTouch:function(t){return void 0!==t.touches?t.touches[0]:t},getOffset:function(t){return t.offsetX&&t.offsetY?{x:t.offsetX,y:t.offsetY}:t.layerX&&t.layerY?{x:t.layerX,y:t.layerY}:this.getOffsetForElement(t.target,t)},getOffsetForElement:function(t,e){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}}}])}(),function(){"use strict";angular.module("gantt").factory("ganttSmartEvent",[function(){function t(t,e,n,i){return t.$on("$destroy",function(){e.unbind(n,i)}),{bindOnce:function(){e.one(n,i)},bind:function(){e.bind(n,i)},unbind:function(){e.unbind(n,i)}}}return t}])}(),angular.module("gantt.templates",[]).run(["$templateCache",function(t){t.put("template/gantt.tmpl.html",'<div class="gantt unselectable" ng-cloak gantt-scroll-manager gantt-element-width-listener>\n    <gantt-labels>\n        <gantt-labels-header>\n            <gantt-row-header></gantt-row-header>\n        </gantt-labels-header>\n        <gantt-labels-body>\n            <div ng-repeat="row in gantt.rowsManager.visibleRows track by row.model.id">\n                <gantt-row-label></gantt-row-label>\n            </div>\n        </gantt-labels-body>\n    </gantt-labels>\n    <gantt-header>\n        <gantt-header-columns>\n            <div ng-repeat="header in gantt.columnsManager.visibleHeaders">\n                <div class="gantt-header-row" ng-class="$last && \'gantt-header-row-last\' || \'\'">\n                    <div ng-repeat="column in header">\n                        <gantt-column-header ></gantt-column-header>\n                    </div>\n                </div>\n            </div>\n        </gantt-header-columns>\n    </gantt-header>\n    <gantt-scrollable>\n        <gantt-body>\n            <gantt-body-background>\n                <div ng-repeat="row in gantt.rowsManager.visibleRows track by row.model.id">\n                    <gantt-row-background></gantt-row-background>\n                </div>\n            </gantt-body-background>\n            <gantt-body-foreground>\n                <div class="gantt-current-date-line" ng-if="currentDate === \'line\' && gantt.currentDateManager.position >= 0 && gantt.currentDateManager.position <= gantt.width" ng-style="{\'left\': gantt.currentDateManager.position + \'px\' }"></div>\n            </gantt-body-foreground>\n            <gantt-body-columns>\n                <div ng-repeat="column in gantt.columnsManager.visibleColumns">\n                    <gantt-column>\n                        <div ng-repeat="timeFrame in column.visibleTimeFrames">\n                            <gantt-time-frame></gantt-time-frame>\n                        </div>\n                    </gantt-column>\n                </div>\n            </gantt-body-columns>\n            <gantt-body-rows gantt-element-height-listener="$parent.$parent.bodyRowsHeight" gantt-element-width-listener="$parent.$parent.bodyRowsWidth">\n                <div ng-repeat="timespan in gantt.timespansManager.timespans">\n                    <gantt-timespan></gantt-timespan>\n                </div>\n                <div ng-repeat="row in gantt.rowsManager.visibleRows track by row.model.id">\n                    <gantt-row>\n                        <div ng-repeat="task in row.visibleTasks track by task.model.id">\n                            <gantt-task ></gantt-task>\n                        </div>\n                    </gantt-row>\n                </div>\n            </gantt-body-rows>\n        </gantt-body>\n    </gantt-scrollable>\n\n    <!-- Plugins -->\n    <ng-transclude></ng-transclude>\n\n    <!--\n    ******* Inline templates *******\n    You can specify your own templates by either changing the default ones below or by\n    adding an attribute template-url="<url to your template>" on the specific element.\n    -->\n\n    <!-- Body template -->\n    <script type="text/ng-template" id="template/ganttBody.tmpl.html">\n        <div ng-transclude class="gantt-body"\n             ng-style="{\'width\': gantt.width +\'px\'}"></div>\n    </script>\n\n    <!-- Header template -->\n    <script type="text/ng-template" id="template/ganttHeader.tmpl.html">\n        <div ng-transclude class="gantt-header"\n             ng-show="gantt.columnsManager.columns.length > 0 && gantt.columnsManager.headers.length > 0"\n             ng-style="getHeaderCss()"></div>\n    </script>\n\n    <!-- Row label template -->\n    <script type="text/ng-template" id="template/ganttRowLabel.tmpl.html">\n        <div class="gantt-labels-row gantt-row-height"\n             ng-class-odd="\'gantt-background-row\'"\n             ng-class-even="\'gantt-background-row-alt\'"\n             ng-class="row.model.classes" ng-style="{\'background-color\': row.model.color, \'height\': row.model.height}">\n                <span class="gantt-labels-text">{{ row.model.name }}</span>\n        </div>\n    </script>\n\n    <!-- Row header template -->\n    <script type="text/ng-template" id="template/ganttRowHeader.tmpl.html">\n        <div class="gantt-labels-header-row gantt-labels-header-row-last"\n             ng-show="gantt.columnsManager.columns.length > 0 && gantt.columnsManager.headers.length > 0"\n             ng-style="{\'margin-top\': ((gantt.columnsManager.headers.length-1)*2)+\'em\'}">\n            <span>Name</span>\n        </div>\n    </script>\n\n    <!-- Labels header template-->\n    <script type="text/ng-template" id="template/ganttLabelsHeader.tmpl.html">\n        <div ng-transclude= class="gantt-labels-header">\n        </div>\n    </script>\n\n    <script type="text/ng-template" id="template/ganttLabelsBody.tmpl.html">\n    <div class="gantt-labels-body"\n         ng-style="(maxHeight > 0 && {\'max-height\': (maxHeight - gantt.header.getHeight())+\'px\'} || {})"\n         ng-show="gantt.columnsManager.columns.length > 0">\n        <div ng-transclude gantt-vertical-scroll-receiver>\n        </div>\n    </div>\n    </script>\n\n    <!-- Labels template -->\n    <script type="text/ng-template" id="template/ganttLabels.tmpl.html">\n        <div ng-transclude ng-if="showLabelsColumn" class="gantt-labels"\n             ng-style="($parent.labelsWidth > 0 && {\'width\': $parent.labelsWidth+\'px\'} || {})"\n             gantt-labels-resize="$parent.allowLabelsResizing"\n             gantt-labels-resize-width="$parent.labelsWidth"\n             gantt-labels-resize-min-width="50"\n             gantt-element-width-listener="$parent.labelsWidth"></div>\n    </script>\n\n    <!-- Header columns template -->\n    <script type="text/ng-template" id="template/ganttHeaderColumns.tmpl.html">\n        <div ng-transclude class="gantt-header-columns"\n              gantt-horizontal-scroll-receiver></div>\n    </script>\n\n    <script type="text/ng-template" id="template/ganttColumnHeader.tmpl.html">\n        <div class="gantt-column-header">\n            {{ ::column.label }}\n        </div>\n    </script>\n\n    <!-- Body background template -->\n    <script type="text/ng-template" id="template/ganttBodyBackground.tmpl.html">\n        <div ng-transclude class="gantt-body-background"></div>\n    </script>\n\n    <!-- Row background template -->\n    <script type="text/ng-template" id="template/ganttRowBackground.tmpl.html">\n        <div class="gantt-row-height"\n             ng-class-odd="\'gantt-background-row\'"\n             ng-class-even="\'gantt-background-row-alt\'"\n             ng-class="row.model.classes"\n             ng-style="{\'background-color\': row.model.color, \'height\': row.model.height}">\n        </div>\n    </script>\n\n    <!-- Body foreground template -->\n    <script type="text/ng-template" id="template/ganttBodyForeground.tmpl.html">\n        <div ng-transclude class="gantt-body-foreground"></div>\n    </script>\n\n    <!-- Body columns template -->\n    <script type="text/ng-template" id="template/ganttBodyColumns.tmpl.html">\n        <div ng-transclude class="gantt-body-columns"></div>\n    </script>\n\n    <script type="text/ng-template" id="template/ganttColumn.tmpl.html">\n        <div ng-transclude class="gantt-column gantt-foreground-col"></div>\n    </script>\n\n    <script type="text/ng-template" id="template/ganttTimeFrame.tmpl.html">\n        <div class="gantt-timeframe"></div>\n    </script>\n\n    <!-- Scrollable template -->\n    <script type="text/ng-template" id="template/ganttScrollable.tmpl.html">\n        <div ng-transclude class="gantt-scrollable" gantt-scroll-sender gantt-limit-updater\n             ng-style="getScrollableCss()"></div>\n    </script>\n\n    <!-- Rows template -->\n    <script type="text/ng-template" id="template/ganttBodyRows.tmpl.html">\n        <div ng-transclude class="gantt-body-rows"></div>\n    </script>\n\n    <!-- Timespan template -->\n    <script type="text/ng-template" id="template/ganttTimespan.tmpl.html">\n        <div class="gantt-timespan"\n             ng-style="{\'z-index\': (timespan.priority || 0)}"\n             ng-class="timespan.classes">\n        </div>\n    </script>\n\n    <!-- Task template -->\n    <script type="text/ng-template" id="template/ganttTask.tmpl.html">\n        <div ng-class="(task.isMilestone() === true && [\'gantt-task-milestone\'] || [\'gantt-task\']).concat(task.model.classes)"\n             ng-style="{\'z-index\': (task.active === true && 1  || task.model.priority || \'\'), \'background-color\': task.model.color}">\n            <div ng-if="task.truncatedLeft" class="gantt-task-truncated-left"><span>&lt;</span></div>\n            <gantt-task-content></gantt-task-content>\n            <div ng-if="task.truncatedRight" class="gantt-task-truncated-right"><span>&gt;</span></div>\n        </div>\n    </script>\n\n    <!-- Task content template -->\n    <script type="text/ng-template" id="template/ganttTaskContent.tmpl.html">\n        <div class="gantt-task-content-container">\n            <div class="gantt-task-content"><span>{{ (task.isMilestone() === true && \'&nbsp;\' || task.model.name) }}</span></div>\n        </div>\n    </script>\n\n    <!-- Row template -->\n    <script type="text/ng-template" id="template/ganttRow.tmpl.html">\n        <div ng-transclude class="gantt-row gantt-row-height" ng-style="{\'height\': row.model.height}"></div>\n    </script>\n\n</div>\n')
  }]);