/**
* Kendo UI v2016.3.914 (http://www.telerik.com/kendo-ui)
* Copyright 2016 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
!function(e,define){define("util/main.min",["kendo.core.min"],e)}(function(){return function(){function e(e){return typeof e!==M}function t(e,t){var n=i(t);return H.round(e*n)/n}function i(e){return e?H.pow(10,e):1}function n(e,t,i){return H.max(H.min(e,i),t)}function s(e){return e*W}function r(e){return e/W}function a(e){return"number"==typeof e&&!isNaN(e)}function o(t,i){return e(t)?t:i}function d(e){return e*e}function l(e){var t,i=[];for(t in e)i.push(t+e[t]);return i.sort().join("")}function c(e){var t,i=2166136261;for(t=0;e.length>t;++t)i+=(i<<1)+(i<<4)+(i<<7)+(i<<8)+(i<<24),i^=e.charCodeAt(t);return i>>>0}function u(e){return c(l(e))}function h(e){var t,i=e.length,n=P,s=N;for(t=0;i>t;t++)s=H.max(s,e[t]),n=H.min(n,e[t]);return{min:n,max:s}}function p(e){return h(e).min}function f(e){return h(e).max}function m(e){return g(e).min}function v(e){return g(e).max}function g(e){var t,i,n,s=P,r=N;for(t=0,i=e.length;i>t;t++)n=e[t],null!==n&&isFinite(n)&&(s=H.min(s,n),r=H.max(r,n));return{min:s===P?void 0:s,max:r===N?void 0:r}}function b(e){return e?e[e.length-1]:void 0}function _(e,t){return e.push.apply(e,t),e}function y(e){return z.template(e,{useWithBlock:!1,paramName:"d"})}function k(t,i){return e(i)&&null!==i?" "+t+"='"+i+"' ":""}function w(e){var t,i="";for(t=0;e.length>t;t++)i+=k(e[t][0],e[t][1]);return i}function S(t){var i,n,s="";for(i=0;t.length>i;i++)n=t[i][1],e(n)&&(s+=t[i][0]+":"+n+";");return""!==s?s:void 0}function D(e){return"string"!=typeof e&&(e+="px"),e}function T(e){var t,i,n=[];if(e)for(t=z.toHyphens(e).split("-"),i=0;t.length>i;i++)n.push("k-pos-"+t[i]);return n.join(" ")}function C(t){return""===t||null===t||"none"===t||"transparent"===t||!e(t)}function x(e){for(var t={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},i=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],n="";e>0;)i[0]>e?i.shift():(n+=t[i[0]],e-=i[0]);return n}function B(e){var t,i,n,s,r;for(e=e.toLowerCase(),t={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},i=0,n=0,s=0;e.length>s;++s){if(r=t[e.charAt(s)],!r)return null;i+=r,r>n&&(i-=2*n),n=r}return i}function R(e){var t=Object.create(null);return function(){var i,n="";for(i=arguments.length;--i>=0;)n+=":"+arguments[i];return n in t?t[n]:e.apply(this,arguments)}}function F(e){for(var t,i,n=[],s=0,r=e.length;r>s;)t=e.charCodeAt(s++),t>=55296&&56319>=t&&r>s?(i=e.charCodeAt(s++),56320==(64512&i)?n.push(((1023&t)<<10)+(1023&i)+65536):(n.push(t),s--)):n.push(t);return n}function A(e){return e.map(function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)}).join("")}function E(e,t){function i(e,i){for(var n=[],s=0,r=0,a=0;e.length>s&&i.length>r;)t(e[s],i[r])<=0?n[a++]=e[s++]:n[a++]=i[r++];return e.length>s&&n.push.apply(n,e.slice(s)),i.length>r&&n.push.apply(n,i.slice(r)),n}return 2>e.length?e.slice():function n(e){var t,s,r;return 1>=e.length?e:(t=Math.floor(e.length/2),s=e.slice(0,t),r=e.slice(t),s=n(s),r=n(r),i(s,r))}(e)}var H=Math,z=window.kendo,I=z.deepExtend,W=H.PI/180,P=Number.MAX_VALUE,N=-Number.MAX_VALUE,M="undefined",L=Date.now;L||(L=function(){return(new Date).getTime()}),I(z,{util:{MAX_NUM:P,MIN_NUM:N,append:_,arrayLimits:h,arrayMin:p,arrayMax:f,defined:e,deg:r,hashKey:c,hashObject:u,isNumber:a,isTransparent:C,last:b,limitValue:n,now:L,objectKey:l,round:t,rad:s,renderAttr:k,renderAllAttr:w,renderPos:T,renderSize:D,renderStyle:S,renderTemplate:y,sparseArrayLimits:g,sparseArrayMin:m,sparseArrayMax:v,sqr:d,valueOrDefault:o,romanToArabic:B,arabicToRoman:x,memoize:R,ucs2encode:A,ucs2decode:F,mergeSort:E}}),z.drawing.util=z.util,z.dataviz.util=z.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()}),function(e,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],e)}(function(){!function(e){function t(){return{width:0,height:0,baseline:0}}function i(e,t,i){return u.current.measure(e,t,i)}function n(e,t){var i=[];if(e.length>0&&document.fonts){try{i=e.map(function(e){return document.fonts.load(e)})}catch(n){r.logToConsole(n)}Promise.all(i).then(t,t)}else t()}var s=document,r=window.kendo,a=r.Class,o=r.util,d=o.defined,l=a.extend({init:function(e){this._size=e,this._length=0,this._map={}},put:function(e,t){var i=this,n=i._map,s={key:e,value:t};n[e]=s,i._head?(i._tail.newer=s,s.older=i._tail,i._tail=s):i._head=i._tail=s,i._length>=i._size?(n[i._head.key]=null,i._head=i._head.newer,i._head.older=null):i._length++},get:function(e){var t=this,i=t._map[e];return i?(i===t._head&&i!==t._tail&&(t._head=i.newer,t._head.older=null),i!==t._tail&&(i.older&&(i.older.newer=i.newer,i.newer.older=i.older),i.older=t._tail,i.newer=null,t._tail.newer=i,t._tail=i),i.value):void 0}}),c=e("
")[0],u=a.extend({init:function(e){this._cache=new l(1e3),this._initOptions(e)},options:{baselineMarkerSize:1},measure:function(i,n,r){var a,l,u,h,p,f,m,v;if(!i)return t();if(a=o.objectKey(n),l=o.hashKey(i+a),u=this._cache.get(l),u)return u;h=t(),p=r?r:c,f=this._baselineMarker().cloneNode(!1);for(m in n)v=n[m],d(v)&&(p.style[m]=v);return e(p).text(i),p.appendChild(f),s.body.appendChild(p),(i+"").length&&(h.width=p.offsetWidth-this.options.baselineMarkerSize,h.height=p.offsetHeight,h.baseline=f.offsetTop+this.options.baselineMarkerSize),h.width>0&&h.height>0&&this._cache.put(l,h),p.parentNode.removeChild(p),h},_baselineMarker:function(){return e("")[0]}});u.current=new u,r.util.TextMetrics=u,r.util.LRUCache=l,r.util.loadFonts=n,r.util.measureText=i}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()}),function(e,define){define("util/base64.min",["util/main.min"],e)}(function(){return function(){function e(e){var i,n,s,a,o,d,l,c="",u=0;for(e=t(e);e.length>u;)i=e.charCodeAt(u++),n=e.charCodeAt(u++),s=e.charCodeAt(u++),a=i>>2,o=(3&i)<<4|n>>4,d=(15&n)<<2|s>>6,l=63&s,isNaN(n)?d=l=64:isNaN(s)&&(l=64),c=c+r.charAt(a)+r.charAt(o)+r.charAt(d)+r.charAt(l);return c}function t(e){var t,i,n="";for(t=0;e.length>t;t++)i=e.charCodeAt(t),128>i?n+=s(i):2048>i?(n+=s(192|i>>>6),n+=s(128|63&i)):65536>i&&(n+=s(224|i>>>12),n+=s(128|i>>>6&63),n+=s(128|63&i));return n}var i=window.kendo,n=i.deepExtend,s=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n(i.util,{encodeBase64:e,encodeUTF8:t})}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()}),function(e,define){define("mixins/observers.min",["kendo.core.min"],e)}(function(){return function(e){var t=Math,i=window.kendo,n=i.deepExtend,s=e.inArray,r={observers:function(){return this._observers=this._observers||[]},addObserver:function(e){return this._observers?this._observers.push(e):this._observers=[e],this},removeObserver:function(e){var t=this.observers(),i=s(e,t);return-1!=i&&t.splice(i,1),this},trigger:function(e,t){var i,n,s=this._observers;if(s&&!this._suspended)for(n=0;s.length>n;n++)i=s[n],i[e]&&i[e](t);return this},optionsChange:function(e){e=e||{},e.element=this,this.trigger("optionsChange",e)},geometryChange:function(){this.trigger("geometryChange",{element:this})},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=t.max((this._suspended||0)-1,0),this},_observerField:function(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};n(i,{mixins:{ObserversMixin:r}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()}),function(e,define){define("kendo.gantt.min",["kendo.data.min","kendo.popup.min","kendo.window.min","kendo.resizable.min","kendo.gantt.list.min","kendo.gantt.timeline.min","kendo.grid.min","kendo.pdf.min"],e)}(function(){return function(e,t){function i(e){return"["+m.attr("uid")+(e?"='"+e+"']":"]")}function n(e){return delete e.name,delete e.prefix,delete e.remove,delete e.edit,delete e.add,delete e.navigate,e}function s(e){var t,i,n,s,r,a;if(e.filter("[name=end], [name=start]").length){for(t=e.attr("name"),i=m.widgetInstance(e,m.ui),n={},s=e;s!==window&&!r;)s=s.parent(),r=s.data("kendoEditable");return(a=r?r.options.model:null)?(n.start=a.start,n.end=a.end,n[t]=i?i.value():m.parseDate(e.value()),n.end>=n.start):!0}return!0}function r(t,i){var n=t.parents("["+m.attr("role")+'="gantt"]'),s=[],r=a(n);t.attr(W,0),i&&r.each(function(t,i){s[t]=e(i).scrollTop()});try{t[0].setActive()}catch(o){t[0].focus()}i&&r.each(function(t,i){e(i).scrollTop(s[t])})}function a(t){return e(t).parentsUntil("body").filter(function(e,t){var i=m.getComputedStyles(t,["overflow"]);return"visible"!=i.overflow}).add(window)}var o,d,l,c,u,h,p,f,m=window.kendo,v="matchMedia"in window,g=m.support.browser,b=m.support.mobileOS,_=m.Observable,y=m.ui.Widget,k=m.data.DataSource,w=m.data.ObservableObject,S=m.data.ObservableArray,D=m.data.Query,T=e.isArray,C=e.inArray,x=m.isFunction,B=e.proxy,R=e.extend,F=e.isPlainObject,A=e.map,E=m.keys,H=3,z=".kendoGantt",I="p0",W="tabIndex",P="click",N="width",M="string",L={down:{origin:"bottom left",position:"top left"},up:{origin:"top left",position:"bottom left"}},U="aria-activedescendant",q="gantt_active_cell",O="action-option-focused",j=".",G="Are you sure you want to delete this task?",V="Are you sure you want to delete this dependency?",Q=m.template(''),K='',X='#=text#',Y=m.template('&nbps;'),J=m.template(''),Z=m.template(''),$=function(t,i){var n={name:i.field},s=i.model.fields[i.field].validation;s&&F(s)&&s.message&&(n[m.attr("dateCompare-msg")]=s.message),e('").attr(n).appendTo(t),e("').hide().appendTo(t)},ee=function(t,i){e(''+i.messages.assignButton+"").click(i.click).appendTo(t)},te={wrapper:"k-widget k-gantt",rowHeight:"k-gantt-rowheight",listWrapper:"k-gantt-layout k-gantt-treelist",list:"k-gantt-treelist",timelineWrapper:"k-gantt-layout k-gantt-timeline",timeline:"k-gantt-timeline",splitBarWrapper:"k-splitbar k-state-default k-splitbar-horizontal k-splitbar-draggable-horizontal k-gantt-layout",splitBar:"k-splitbar",splitBarHover:"k-splitbar-horizontal-hover",popupWrapper:"k-list-container",popupList:"k-list k-reset",resizeHandle:"k-resize-handle",icon:"k-icon",item:"k-item",line:"k-line",buttonDelete:"k-gantt-delete",buttonCancel:"k-gantt-cancel",buttonSave:"k-gantt-update",buttonToggle:"k-gantt-toggle",primary:"k-primary",hovered:"k-state-hover",selected:"k-state-selected",focused:"k-state-focused",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",popup:{form:"k-popup-edit-form",editForm:"k-gantt-edit-form",formContainer:"k-edit-form-container",resourcesFormContainer:"k-resources-form-container",message:"k-popup-message",buttonsContainer:"k-edit-buttons k-state-default",button:"k-button",editField:"k-edit-field",editLabel:"k-edit-label",resourcesField:"k-gantt-resources"},toolbar:{headerWrapper:"k-floatwrap k-header k-gantt-toolbar",footerWrapper:"k-floatwrap k-header k-gantt-toolbar",toolbar:"k-gantt-toolbar",expanded:"k-state-expanded",views:"k-gantt-views",viewsWrapper:"k-reset k-header k-gantt-views",actions:"k-gantt-actions",button:"k-button k-button-icontext",buttonToggle:"k-button k-button-icon k-gantt-toggle",iconPlus:"k-icon k-i-plus",iconPdf:"k-icon k-i-pdf",iconToggle:"k-icon k-i-gantt-toggle",viewButtonDefault:"k-state-default",viewButton:"k-view",currentView:"k-current-view",link:"k-link",pdfButton:"k-gantt-pdf",appendButton:"k-gantt-create"}},ie=_.extend({init:function(e,t){_.fn.init.call(this),this.element=e,this.options=R(!0,{},this.options,t),this._popup()},options:{direction:"down",navigatable:!1},_current:function(e){var t=f.styles,i=this.list.find(j+t.focused),n=i[e]();n.length&&(i.removeClass(t.focused).removeAttr("id"),n.addClass(t.focused).attr("id",O),this.list.find("ul").removeAttr(U).attr(U,O))},_popup:function(){var t=this,i=f.styles,n="li"+j+i.item,s=j+i.toolbar.appendButton,r=this.options.messages.actions,a=this.options.navigatable;this.list=e(Z({styles:i,actions:[{data:"add",text:r.addChild},{data:"insert-before",text:r.insertBefore},{data:"insert-after",text:r.insertAfter}]})),this.element.append(this.list),this.popup=new m.ui.Popup(this.list,R({anchor:this.element.find(s),open:function(){t._adjustListWidth()},animation:this.options.animation},L[this.options.direction])),this.element.on(P+z,s,function(n){var s=e(this),r=s.attr(m.attr("action"));n.preventDefault(),r?t.trigger("command",{type:r}):(t.popup.open(),a&&t.list.find("li:first").addClass(i.focused).attr("id",O).end().find("ul").attr({TABINDEX:0,"aria-activedescendant":O}).focus())}),this.list.find(n).hover(function(){e(this).addClass(i.hovered)},function(){e(this).removeClass(i.hovered)}).end().on(P+z,n,function(){t.trigger("command",{type:e(this).attr(m.attr("action"))}),t.popup.close()}),a&&(this.popup.bind("close",function(){t.list.find(n).removeClass(i.focused).end().find("ul").attr(W,0),t.element.parents("["+m.attr("role")+'="gantt"]').find(j+i.gridContent+" > table:first").focus()}),this.list.find("ul").on("keydown"+z,function(e){var n=e.keyCode;switch(n){case E.UP:e.preventDefault(),t._current("prev");break;case E.DOWN:e.preventDefault(),t._current("next");break;case E.ENTER:t.list.find(j+i.focused).click();break;case E.ESC:e.preventDefault(),t.popup.close()}}))},_adjustListWidth:function(){var e,t,i=this.list,n=f.styles,s=i[0].style.width,r=this.element.find(j+n.toolbar.appendButton),a=i.outerWidth();!i.data(N)&&s||(e=window.getComputedStyle?window.getComputedStyle(r[0],null):0,t=e?parseFloat(e.width):r.outerWidth(),e&&(g.mozilla||g.msie)&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),s="border-box"!==i.css("box-sizing")?t-(i.outerWidth()-i.width()):t,a>s&&(s=a),i.css({fontFamily:r.css("font-family"),width:s}).data(N,s))},destroy:function(){clearTimeout(this._focusTimeout),this.popup.destroy(),this.element.off(z),this.list.off(z),this.unbind()}}),ne=function(e,t){return function(i){var n,s;if(i=T(i)?{data:i}:i,n=i||{},s=n.data,n.data=s,!(n instanceof e)&&n instanceof k)throw Error("Incorrect DataSource type. Only "+t+" instances are supported");return n instanceof e?n:new e(n)}},se=m.data.Model.define({id:"id",fields:{id:{type:"number"},predecessorId:{type:"number"},successorId:{type:"number"},type:{type:"number"}}}),re=k.extend({init:function(e){k.fn.init.call(this,R(!0,{},{schema:{modelBase:se,model:se}},e))},successors:function(e){return this._dependencies("predecessorId",e)},predecessors:function(e){return this._dependencies("successorId",e)},dependencies:function(e){var t=this.predecessors(e),i=this.successors(e);return t.push.apply(t,i),t},_dependencies:function(e,t){var i=this.view(),n={field:e,operator:"eq",value:t};return i=new D(i).filter(n).toArray()}});re.create=ne(re,"GanttDependencyDataSource"),d=m.data.Model.define({duration:function(){var e=this.end,t=this.start;return e-t},isMilestone:function(){return 0===this.duration()},_offset:function(e){var t,i,n=["start","end"];for(i=0;n.length>i;i++)t=new Date(this.get(n[i]).getTime()+e),this.set(n[i],t)},id:"id",fields:{id:{type:"number"},parentId:{type:"number",defaultValue:null,validation:{required:!0}},orderId:{type:"number",validation:{required:!0}},title:{type:"string",defaultValue:"New task"},start:{type:"date",validation:{required:!0}},end:{type:"date",validation:{required:!0,dateCompare:s,message:"End date should be after or equal to the start date"}},percentComplete:{type:"number",validation:{required:!0,min:0,max:1,step:.01}},summary:{type:"boolean"},expanded:{type:"boolean",defaultValue:!0}}}),l=k.extend({init:function(e){k.fn.init.call(this,R(!0,{},{schema:{modelBase:d,model:d}},e))},remove:function(e){var t=e.get("parentId"),i=this.taskAllChildren(e);return this._removeItems(i),e=k.fn.remove.call(this,e),this._childRemoved(t,e.get("orderId")),e},add:function(e){return e?(e=this._toGanttTask(e),this.insert(this.taskSiblings(e).length,e)):t},insert:function(e,i){return i?(i=this._toGanttTask(i),i.set("orderId",e),i=k.fn.insert.call(this,e,i),this._reorderSiblings(i,this.taskSiblings(i).length-1),this._resolveSummaryFields(this.taskParent(i)),i):t},taskChildren:function(e){var i,n=this.view(),s={field:"parentId",operator:"eq",value:null},r=this._sort&&this._sort.length?this._sort:{field:"orderId",dir:"asc"};if(e){if(i=e.get("id"),i===t||null===i||""===i)return[];s.value=i}return n=new D(n).filter(s).sort(r).toArray()},taskAllChildren:function(e){var t=[],i=this,n=function(e){var s=i.taskChildren(e);t.push.apply(t,s),A(s,n)};return e?n(e):t=this.view(),t},taskSiblings:function(e){if(!e)return null;var t=this.taskParent(e);return this.taskChildren(t)},taskParent:function(e){return e&&null!==e.get("parentId")?this.get(e.parentId):null},taskLevel:function(e){for(var t=0,i=this.taskParent(e);null!==i;)t+=1,i=this.taskParent(i);return t},taskTree:function(e){var t,i,n,s,r=[],a=this.taskChildren(e);for(i=0,n=a.length;n>i;i++)t=a[i],r.push(t),t.get("expanded")&&(s=this.taskTree(t),r.push.apply(r,s));return r},update:function(e,i){var n,s,r=this,a=function(e,t){var i,n,s=r.taskAllChildren(e);for(i=0,n=s.length;n>i;i++)s[i]._offset(t)},o=function(e){var t=e.field,i=e.sender;switch(t){case"start":r._resolveSummaryStart(r.taskParent(i)),a(i,i.get(t).getTime()-n.getTime());break;case"end":r._resolveSummaryEnd(r.taskParent(i));break;case"percentComplete":r._resolveSummaryPercentComplete(r.taskParent(i));break;case"orderId":r._reorderSiblings(i,n)}};i.parentId!==t&&(n=e.get("parentId"),n!==i.parentId&&(e.set("parentId",i.parentId),r._childRemoved(n,e.get("orderId")),e.set("orderId",r.taskSiblings(e).length-1),r._resolveSummaryFields(r.taskParent(e))),delete i.parentId),e.bind("change",o);for(s in i)n=e.get(s),e.set(s,i[s]);e.unbind("change",o)},_resolveSummaryFields:function(e){e&&(this._updateSummary(e),this.taskChildren(e).length&&(this._resolveSummaryStart(e),this._resolveSummaryEnd(e),this._resolveSummaryPercentComplete(e)))},_resolveSummaryStart:function(e){var t=this,i=function(e){var i,n,s,r=t.taskChildren(e),a=r[0].start.getTime();for(n=1,s=r.length;s>n;n++)i=r[n].start.getTime(),a>i&&(a=i);return new Date(a)};this._updateSummaryRecursive(e,"start",i)},_resolveSummaryEnd:function(e){var t=this,i=function(e){var i,n,s,r=t.taskChildren(e),a=r[0].end.getTime();for(n=1,s=r.length;s>n;n++)i=r[n].end.getTime(),i>a&&(a=i);return new Date(a)};this._updateSummaryRecursive(e,"end",i)},_resolveSummaryPercentComplete:function(e){var t=this,i=function(e){var i=t.taskChildren(e),n=new D(i).aggregate([{field:"percentComplete",aggregate:"average"}]);return n.percentComplete.average};this._updateSummaryRecursive(e,"percentComplete",i)},_updateSummaryRecursive:function(e,t,i){var n,s;e&&(n=i(e),e.set(t,n),s=this.taskParent(e),s&&this._updateSummaryRecursive(s,t,i))},_childRemoved:function(e,t){var i,n,s=null===e?null:this.get(e),r=this.taskChildren(s);for(i=t,n=r.length;n>i;i++)r[i].set("orderId",i);this._resolveSummaryFields(s)},_reorderSiblings:function(e,t){var i,n=e.get("orderId"),s=n>t,r=s?t:n,a=s?n:t,o=s?r:r+1,d=this.taskSiblings(e);for(a=Math.min(a,d.length-1),i=r;a>=i;i++)d[i]!==e&&(d[i].set("orderId",o),o+=1)},_updateSummary:function(e){if(null!==e){var t=this.taskChildren(e).length;e.set("summary",t>0)}},_toGanttTask:function(e){if(!(e instanceof d)){var t=e;e=this._createNewModel(),e.accept(t)}return e}}),l.create=ne(l,"GanttDataSource"),R(!0,m.data,{GanttDataSource:l,GanttTask:d,GanttDependencyDataSource:re,GanttDependency:se}),c={desktop:{dateRange:$,resources:ee}},u=m.Observable.extend({init:function(e,t){m.Observable.fn.init.call(this),this.element=e,this.options=R(!0,{},this.options,t),this.createButton=this.options.createButton},fields:function(t,i){var n,s=this,r=this.options,a=r.messages.editor,o=r.resources,d=function(e){e.preventDefault(),o.editor(s.container.find(j+f.styles.popup.resourcesField),i)};return r.editable.template?n=e.map(i.fields,function(e,t){return{field:t}}):(n=[{field:"title",title:a.title},{field:"start",title:a.start,editor:t.dateRange},{field:"end",title:a.end,editor:t.dateRange},{field:"percentComplete",title:a.percentComplete,format:I}],i.get(o.field)&&n.push({field:o.field,title:a.resources,messages:a,editor:t.resources,click:d,styles:f.styles.popup})),n},_buildEditTemplate:function(e,t,i){var n,s,r,a,o=this.options.resources,d=this.options.editable.template,l=R({},m.Template,this.options.templateSettings),c=l.paramName,u=f.styles.popup,h="";if(d)typeof d===M&&(d=window.unescape(d)),h+=m.template(d,l)(e);else for(n=0,s=t.length;s>n;n++)r=t[n],h+='",r.field===o.field&&(h+=''),!e.editable||e.editable(r.field)?(i.push(r),h+="'):(a="#:",r.field?(r=m.expr(r.field,c),a+=r+"==null?'':"+r):a+="''",a+="#",a=m.template(a,l),h+=''+a(e)+"
");return h}}),h=u.extend({destroy:function(){this.close(),this.unbind()},editTask:function(e){this.editable=this._createPopupEditor(e)},close:function(){var e=this,t=function(){e.editable&&(e.editable.destroy(),e.editable=null,e.container=null),e.popup&&(e.popup.destroy(),e.popup=null)};this.editable&&this.container.is(":visible")?(e.trigger("close",{window:e.container}),this.container.data("kendoWindow").bind("deactivate",t).close()):t()},showDialog:function(t){var i,n,s,r,a=t.buttons,o=f.styles.popup,d=m.format('{3}
',o.form,o.formContainer,o.message,t.text,o.buttonsContainer);for(i=0,n=a.length;n>i;i++)d+=this.createButton(a[i]);d+="
",s=this.element,this.popup&&this.popup.destroy(),r=this.popup=e(d).appendTo(s).eq(0).on("click",j+o.button,function(t){t.preventDefault(),r.close();var i=e(t.currentTarget).index();a[i].click()}).kendoWindow({modal:!0,resizable:!1,draggable:!1,title:t.title,visible:!1,deactivate:function(){this.destroy(),s.focus()}}).getKendoWindow(),r.center().open()},_createPopupEditor:function(t){var i,n,s=this,r={},a=this.options.messages,o=f.styles,d=o.popup,l=m.format('',m.attr("uid"),t.uid,d.form,d.editForm,d.formContainer),u=this.fields(c.desktop,t),h=[];return l+=this._buildEditTemplate(t,u,h),l+='
',l+=this.createButton({name:"update",text:a.save,className:f.styles.primary}),l+=this.createButton({name:"cancel",text:a.cancel}),s.options.editable.destroy!==!1&&(l+=this.createButton({name:"delete",text:a.destroy})),l+="
",i=this.container=e(l).appendTo(this.element).eq(0).kendoWindow(R({modal:!0,resizable:!1,draggable:!0,title:a.editor.editorTitle,visible:!1,close:function(e){e.userTriggered&&s.trigger("cancel",{container:i,model:t})&&e.preventDefault()}},r)),n=i.kendoEditable({fields:h,model:t,clearContainer:!1,validateOnBlur:!0,target:s.options.target}).data("kendoEditable"),m.cycleForm(i),this.trigger("edit",{container:i,model:t})?s.trigger("cancel",{container:i,model:t}):(i.data("kendoWindow").center().open(),i.on(P+z,j+o.buttonCancel,function(e){e.preventDefault(),e.stopPropagation(),s.trigger("cancel",{container:i,model:t})}),i.on(P+z,j+o.buttonSave,function(e){var n,r,a,o,d;for(e.preventDefault(),e.stopPropagation(),n=s.fields(c.desktop,t),r={},o=0,d=n.length;d>o;o++)a=n[o].field,r[a]=t.get(a);s.trigger("save",{container:i,model:t,updateInfo:r})}),i.on(P+z,j+o.buttonDelete,function(e){e.preventDefault(),e.stopPropagation(),s.trigger("remove",{container:i,model:t})})),n}}),p=y.extend({init:function(e,t){y.fn.init.call(this,e,t),this.wrapper=this.element,this.model=this.options.model,this.resourcesField=this.options.resourcesField,this.createButton=this.options.createButton,this._initContainer(),this._attachHandlers()},events:["save"],open:function(){this.window.center().open(),this.grid.resize(!0)},close:function(){this.window.bind("deactivate",B(this.destroy,this)).close()},destroy:function(){this._dettachHandlers(),this.grid.destroy(),this.grid=null,this.window.destroy(),this.window=null,y.fn.destroy.call(this),m.destroy(this.wrapper),this.element=this.wrapper=null},_attachHandlers:function(){var t=f.styles,i=this.grid,n=this._cancelProxy=B(this._cancel,this);this.container.on(P+z,j+t.buttonCancel,this._cancelProxy),this._saveProxy=B(this._save,this),this.container.on(P+z,j+t.buttonSave,this._saveProxy),this.window.bind("close",function(e){e.userTriggered&&n(e)}),i.wrapper.on(P+z,"input[type='checkbox']",function(){var t=e(this),n=e(t).closest("tr"),s=i.dataSource.getByUid(n.attr(m.attr("uid"))),r=e(t).is(":checked")?1:"";s.set("value",r)})},_dettachHandlers:function(){this._cancelProxy=null,this._saveProxy=null,this.container.off(z),this.grid.wrapper.off()},_cancel:function(e){e.preventDefault(),this.close()},_save:function(e){e.preventDefault(),this._updateModel(),this.wrapper.is(j+f.styles.popup.resourcesField)||this.trigger("save",{container:this.wrapper,model:this.model}),this.close()},_initContainer:function(){var t=f.styles.popup,i=m.format('"',t.form,t.editForm,t.formContainer,t.resourcesFormContainer);i=e(i),this.container=i.find(j+t.resourcesFormContainer),this.window=i.kendoWindow({modal:!0,resizable:!1,draggable:!0,visible:!1,title:this.options.messages.resourcesEditorTitle}).data("kendoWindow"),this._resourceGrid(),this._createButtons()},_resourceGrid:function(){var t=this,i=this.options.messages,n=e('').appendTo(this.container);this.grid=new m.ui.Grid(n,{columns:[{field:"name",title:i.resourcesHeader,template:"