UNPKG

react-gantt-timeline-ultra

Version:

[![npm](https://img.shields.io/npm/v/react-gantt-timeline.svg?style=flat-square)](http://npm.im/react-gantt-timeline) [![MIT License](https://img.shields.io/npm/l/react-list.svg?style=flat-square)](http://opensource.org/licenses/MIT) [![Travis](https://

1 lines 72.8 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("moment"),require("react-sizeme")):"function"==typeof define&&define.amd?define("react-gantt-timeline-ultra",["React","moment","ReactDOM"],e):"object"==typeof exports?exports["react-gantt-timeline-ultra"]=e(require("react"),require("moment"),require("react-sizeme")):t["react-gantt-timeline-ultra"]=e(t.React,t.moment,t.ReactDOM)}(window,function(t,e,n){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=13)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){t.exports=n(6)()},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",o=t[3];if(!o)return n;if(e&&"function"==typeof btoa){var r=(a=o,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(c," */")),i=o.sources.map(function(t){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(t," */")});return[n].concat(i).concat([r]).join("\n")}var a,s,c;return[n].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n}).join("")},e.i=function(t,n,o){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(o)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(r[a]=!0)}for(var s=0;s<t.length;s++){var c=[].concat(t[s]);o&&r[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},function(t,e,n){var o,r,i={},a=(o=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=o.apply(this,arguments)),r}),s=function(t){var e={};return function(t){if("function"==typeof t)return t();if(void 0===e[t]){var n=function(t){return document.querySelector(t)}.call(this,t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}}(),c=null,u=0,l=[],p=n(10);function f(t,e){for(var n=0;n<t.length;n++){var o=t[n],r=i[o.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](o.parts[a]);for(;a<o.parts.length;a++)r.parts.push(g(o.parts[a],e))}else{var s=[];for(a=0;a<o.parts.length;a++)s.push(g(o.parts[a],e));i[o.id]={id:o.id,refs:1,parts:s}}}}function d(t,e){for(var n=[],o={},r=0;r<t.length;r++){var i=t[r],a=e.base?i[0]+e.base:i[0],s={css:i[1],media:i[2],sourceMap:i[3]};o[a]?o[a].parts.push(s):n.push(o[a]={id:a,parts:[s]})}return n}function h(t,e){var n=s(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=l[l.length-1];if("top"===t.insertAt)o?o.nextSibling?n.insertBefore(e,o.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),l.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=s(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,r)}}function y(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=l.indexOf(t);e>=0&&l.splice(e,1)}function b(t){var e=document.createElement("style");return void 0===t.attrs.type&&(t.attrs.type="text/css"),m(e,t.attrs),h(t,e),e}function m(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function g(t,e){var n,o,r,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var a=u++;n=c||(c=b(e)),o=k.bind(null,n,a,!1),r=k.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",m(e,t.attrs),h(t,e),e}(e),o=function(t,e,n){var o=n.css,r=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||i)&&(o=p(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([o],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,n,e),r=function(){y(n),n.href&&URL.revokeObjectURL(n.href)}):(n=b(e),o=function(t,e){var n=e.css,o=e.media;o&&t.setAttribute("media",o);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){y(n)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return f(n,e),function(t){for(var o=[],r=0;r<n.length;r++){var a=n[r];(s=i[a.id]).refs--,o.push(s)}t&&f(d(t,e),e);for(r=0;r<o.length;r++){var s;if(0===(s=o[r]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete i[s.id]}}}};var v,w=(v=[],function(t,e){return v[t]=e,v.filter(Boolean).join("\n")});function k(t,e,n,o){var r=n?"":o.css;if(t.styleSheet)t.styleSheet.cssText=w(e,r);else{var i=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}},function(t,e){t.exports=n},function(t,e,n){"use strict";var o=n(7);function r(){}t.exports=function(){function t(t,e,n,r,i,a){if(a!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){var o=n(9);"string"==typeof o&&(o=[[t.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(4)(o,r);o.locals&&(t.exports=o.locals)},function(t,e,n){(e=n(3)(!1)).push([t.i,".header-top {\n height: 20px;\n\n border-bottom: solid 0.5px silver;\n}\n\n.header-middle {\n height: 20px;\n background-color: chocolate;\n color: white;\n font-size: 10px;\n border-bottom: solid 0.5px silver;\n}\n.header-bottom {\n height: 20px;\n font-size: 10px;\n border-bottom: solid 0.5px silver;\n}\n",""]),t.exports=e},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,o=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(t,e,n){var o=n(12);"string"==typeof o&&(o=[[t.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(4)(o,r);o.locals&&(t.exports=o.locals)},function(t,e,n){(e=n(3)(!1)).push([t.i,".timeLine {\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 100%;\n border: solid 1px rgb(207, 207, 205);\n font-size: 12px;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n}\n\n/* Main Area */\n\n.timeLine-main {\n flex: 1 1 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow-y: hidden;\n}\n/* Main Area Header*/\n\n.timeLine-main-header-viewPort {\n flex: 0 0 60px;\n position: relative;\n height: 60px;\n width: 100%;\n background-color: rgb(112, 112, 112);\n overflow: hidden;\n}\n\n.timeLine-main-header-container {\n flex: 0 0 60px;\n position: relative;\n top: 0;\n left: 0;\n height: 100%;\n display: flex;\n flex-direction: column;\n background-color: #333333;\n overflow: hidden;\n user-select: none;\n}\n\n.timeLine-main-header-day-item {\n position: absolute;\n display: flex;\n flex-direction: column;\n justify-content: center;\n background-color: rgb(112, 112, 112);\n font-size: 10px;\n text-align: center;\n border-right: solid 1px;\n border-top: solid 1px;\n border-bottom: solid 1px;\n top: 20px;\n height: 40px;\n color: white;\n text-align: center;\n}\n\n.timeLine-main-header-top-item {\n position: absolute;\n display: flex;\n flex-direction: column;\n justify-content: center;\n border-right: solid 1px gray;\n height: 20px;\n z-index: 91;\n}\n\n.timeLine-main-header-day-week {\n flex: 0 0 12px;\n padding: 4px;\n z-index: 90;\n}\n\n.timeLine-main-header-day-month {\n top: 0px;\n position: sticky;\n flex: 0 0 15px;\n padding: 5px;\n z-index: 90;\n}\n\n.timeLine-main-header-time {\n display: flex;\n flex-direction: row;\n align-items: stretch;\n height: 22px;\n justify-content: stretch;\n}\n\n.timeLine-main-header-time-item {\n border-left: solid 1px silver;\n border-bottom: solid 1px silver;\n border-top: solid 1px silver;\n text-align: center;\n padding-top: 5px;\n}\n/* Main Area Data*/\n\n.timeLine-main-data-viewPort {\n flex: 1 1 auto;\n position: relative;\n overflow: hidden;\n background-color: #fbf9f9;\n}\n.timeLine-main-data-container {\n position: relative;\n top: 0;\n left: 0;\n height: 100%;\n background-color: rgb(255, 255, 255);\n}\n\n.timeLine-main-data-row {\n position: absolute;\n width: 100%;\n height: 50px;\n}\n\n.timeLine-main-data-task {\n position: absolute;\n background-color: darkorchid;\n border-radius: 14px;\n color: white;\n text-align: center;\n}\n\n.timeLine-main-data-task-side {\n position: absolute;\n width: 10px;\n cursor: col-resize;\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n.timeLine-main-data-task-side-linker {\n width: 8px;\n height: 8px;\n border-radius: 4px;\n cursor: default;\n z-index: 100;\n}\n.timeLine-main-data-task-side-linker:hover {\n background-color: black;\n border: solid 0.5px grey;\n}\n/* .timeLine-main-data-task:hover {\n background-color:chocolate;\n border:solid 2px darkorchid;\n cursor: move;\n} */\n\n.timeLine-main-data-verticalLine {\n flex: 1 1 auto;\n height: 100%;\n width: 24px;\n background-color: white;\n border-left-width: 0.5px;\n border-left-color: rgb(207, 207, 205);\n border-left-style: dashed;\n}\n\n/* Side Area */\n\n.timeLine-side-main {\n flex: 0 0 auto;\n /* width: 108px;*/\n min-width: 347px;\n display: flex;\n flex-direction: row;\n}\n\n.timeLine-side {\n flex: 1 0 100px;\n display: flex;\n flex-direction: column;\n border-right: solid 1px rgb(207, 207, 205);\n}\n\n.verticalResizer {\n flex: 0 0 8px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n cursor: col-resize;\n border-right: solid 1px rgb(207, 207, 205);\n height: 100%;\n}\n.squareGrip {\n flex: 0 0 auto;\n\n border-radius: 50%;\n height: 5px;\n width: 5px;\n margin: 3px 0;\n}\n\n.timeLine-side-title {\n flex: 0 0 60px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.timeLine-side-task-viewPort {\n position: relative;\n flex: 1 1 auto;\n height: 100%;\n background-color: #fbf9f9;\n overflow-x: hidden;\n overflow-y: auto;\n}\n\n.timeLine-side-task-container {\n position: relative;\n overflow-x: hidden;\n overflow-y: hidden;\n}\n\n.timeLine-side-task-row {\n position: absolute;\n width: 100%;\n background-color: rgb(112, 112, 112);\n border-bottom-width: 0.5px;\n border-bottom-color: rgb(207, 207, 205);\n border-bottom-style: solid;\n height: 30px;\n color: grey;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n outline: none;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n}\n",""]),t.exports=e},function(t,e,n){"use strict";n.r(e);var o=n(0),r=n.n(o),i=n(2),a=n.n(i);function s(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var c={header:{top:{style:{backgroundColor:"#333333",fontSize:10,color:"white",textAlign:"center"}},middle:{style:{backgroundColor:"chocolate"},selectedStyle:{backgroundColor:"#b13525",fontWeight:"bold"}},bottom:{style:{background:"grey",color:"white",fontSize:9},selectedStyle:{backgroundColor:"#b13525",fontWeight:"bold"}}},taskList:{title:{label:"Projects",style:{backgroundColor:"#333333",borderBottom:"solid 1px silver",color:"white",textAlign:"center"}},task:{style:{backgroundColor:"#fbf9f9"}},verticalSeparator:{style:{backgroundColor:"#333333"},grip:{style:{backgroundColor:"#cfcfcd"}}}},dataViewPort:{rows:{style:{backgroundColor:"#fbf9f9",borderBottom:"solid 0.5px #cfcfcd"}},task:{showLabel:!1,style:{position:"absolute",borderRadius:14,color:"white",textAlign:"center",backgroundColor:"grey"},selectedStyle:{position:"absolute",borderRadius:14,border:"solid 1px #ff00fa",color:"white",textAlign:"center",backgroundColor:"grey"}}},links:{color:"black",selectedColor:"#ff00fa"}},u=new(function(){function t(){var e,n,o,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),o=function(t){r.data={},t?r.populate(t,c,r.data):r.data=c},(n="load")in(e=this)?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,this.data=c}var e,n,o;return e=t,(n=[{key:"populate",value:function(t,e,n){if(this.isObject(e))for(var o in e)t[o]?(n[o]=t[o],this.populate(t[o],e[o],n[o])):n[o]=e[o]}},{key:"isObject",value:function(t){return"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t}},{key:"values",get:function(){return this.data}}])&&s(e.prototype,n),o&&s(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}());function l(t){"@babel/helpers - typeof";return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function f(t,e){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,o=y(t);if(e){var r=y(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return function(t,e){if(e&&("object"===l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}(this,n)}}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var b=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(s,o["Component"]);var e,n,i,a=d(s);function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this,t)).doMouseMove=e.doMouseMove.bind(h(e)),e.doMouseDown=e.doMouseDown.bind(h(e)),e.doMouseUp=e.doMouseUp.bind(h(e)),e.state={dragging:!1},e}return e=s,(n=[{key:"doMouseDown",value:function(t){0===t.button&&(this.draggingPosition=t.clientX,this.setState({dragging:!0}))}},{key:"componentDidUpdate",value:function(t,e){this.state.dragging&&!e.dragging?(document.addEventListener("mousemove",this.doMouseMove),document.addEventListener("mouseup",this.doMouseUp)):!this.state.dragging&&e.dragging&&(document.removeEventListener("mousemove",this.doMouseMove),document.removeEventListener("mouseup",this.doMouseUp))}},{key:"doMouseMove",value:function(t){if(this.state.dragging){t.stopPropagation();var e=this.draggingPosition-t.clientX;this.draggingPosition=t.clientX,this.props.onTaskListSizing(e)}}},{key:"doMouseUp",value:function(t){this.setState({dragging:!1})}},{key:"render",value:function(){return r.a.createElement("div",{className:"verticalResizer",style:u.values.taskList.verticalSeparator.style,onMouseDown:this.doMouseDown},r.a.createElement("div",{className:"squareGrip",style:u.values.taskList.verticalSeparator.grip.style}),r.a.createElement("div",{className:"squareGrip",style:u.values.taskList.verticalSeparator.grip.style}),r.a.createElement("div",{className:"squareGrip",style:u.values.taskList.verticalSeparator.grip.style}),r.a.createElement("div",{className:"squareGrip",style:u.values.taskList.verticalSeparator.grip.style}))}}])&&p(e.prototype,n),i&&p(e,i),Object.defineProperty(e,"prototype",{writable:!1}),s}(),m=n(1),g=n.n(m),v=0,w=30,k=5e3,O="day",x="week",j="month",S="year";function P(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function T(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var E=new(function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),T(this,"dayToPosition",function(t,e,n){return t*n+e}),T(this,"daysInYear",function(t){return e.isLeapYear(t)?366:365})}var e,n,o;return e=t,(n=[{key:"dateToPixel",value:function(t,e,n){var o=this.getToday(),r=new Date(t),i=60*(r.getTimezoneOffset()-o.getTimezoneOffset())*1e3;return(r.getTime()-o.getTime()-i)/36e5*(n/24)+e}},{key:"pixelToDate",value:function(t,e,n){var o=24/n,r=t-e,i=this.getToday(),a=i.getTime()+r*o*36e5,s=new Date(a),c=60*(s.getTimezoneOffset()-i.getTimezoneOffset())*1e3;return s.setTime(s.getTime()+c),s}},{key:"getToday",value:function(){var t=new Date;return t.setHours(0,0,0,0),t}},{key:"monthDiff",value:function(t,e){return Math.abs(e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear()))}},{key:"daysInMonth",value:function(t,e){return new Date(e,t,0).getDate()}},{key:"isLeapYear",value:function(t){return t%400==0||t%100!=0&&t%4==0}}])&&P(e.prototype,n),o&&P(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}());n(8);function L(t){"@babel/helpers - typeof";return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function M(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?C(Object(n),!0).forEach(function(e){D(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function D(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function I(t,e,n){return e&&_(t.prototype,e),n&&_(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function U(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&N(t,e)}function N(t,e){return(N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function z(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,o=W(t);if(e){var r=W(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return function(t,e){if(e&&("object"===L(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return B(t)}(this,n)}}function B(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function W(t){return(W=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var V=function(t){U(n,o["PureComponent"]);var e=z(n);function n(t){return R(this,n),e.call(this,t)}return I(n,[{key:"render",value:function(){return r.a.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",borderLeft:"solid 1px gray",position:"absolute",height:20,left:this.props.left,width:this.props.width}},r.a.createElement("div",null,this.props.label))}}]),n}(),H=function(t){U(n,o["PureComponent"]);var e=z(n);function n(t){var o;return R(this,n),D(B(o=e.call(this,t)),"getStartDate",function(t,e){var n=null;switch(e){case"year":return n=t.year(),g()([n,0,1]);case"month":n=t.year();var o=t.month();return g()([n,o,1]);case"week":return t.subtract(t.day(),"days");default:return t}}),D(B(o),"renderTime",function(t,e,n,o){for(var i=[],a=e/24,s=0,c=0;c<24;c++)i.push(r.a.createElement(V,{key:c,left:s,width:a,label:"shorttime"==n?c:"".concat(c,":00")})),s+=a;return r.a.createElement("div",{key:o,style:{position:"absolute",height:20,left:t,width:e}}," ",i)}),D(B(o),"renderHeaderRows",function(t,e,n){for(var i={top:[],middle:[],bottom:[]},a={},s="",c="",l="",p=null,f=null,d=o.props.currentday,h=o.props.currentday+o.props.numVisibleDays,y=d-w;y<h+w;y++)s!=(p=g()().add(y,"days")).format(o.getFormat(t,"top"))&&(s=p.format(o.getFormat(t,"top")),f=o.getBox(p,t,a.top),a.top=f.left+f.width,i.top.push(r.a.createElement(V,{key:y,left:f.left,width:f.width,label:s}))),c!=p.format(o.getFormat(e))&&(c=p.format(o.getFormat(e)),f=o.getBox(p,e,a.middle),a.middle=f.left+f.width,i.middle.push(r.a.createElement(V,{key:y,left:f.left,width:f.width,label:c}))),l!=p.format(o.getFormat(n))&&(l=p.format(o.getFormat(n)),f=o.getBox(p,n,a.bottom),a.bottom=f.left+f.width,"shorttime"==n||"fulltime"==n?i.bottom.push(o.renderTime(f.left,f.width,n,y)):i.bottom.push(r.a.createElement(V,{key:y,left:f.left,width:f.width,label:l})));return r.a.createElement("div",{className:"timeLine-main-header-container",style:{width:k,maxWidth:k}},r.a.createElement("div",{className:"header-top",style:M({},u.values.header.top.style)},i.top),r.a.createElement("div",{className:"header-middle",style:M({},u.values.header.middle.style)},i.middle),r.a.createElement("div",{className:"header-bottom",style:M({},u.values.header.bottom.style)},i.bottom))}),D(B(o),"renderHeader",function(){switch(o.props.mode){case O:return o.renderHeaderRows("week","dayweek","fulltime");case x:return o.renderHeaderRows("week","dayweek","shorttime");case j:return o.renderHeaderRows("month","dayweek","daymonth");case S:return o.renderHeaderRows("year","month","week")}}),D(B(o),"setBoundaries",function(){o.start=o.props.currentday-w,o.end=o.props.currentday+o.props.numVisibleDays+w}),D(B(o),"needToRender",function(){return o.props.currentday<o.start||o.props.currentday+o.props.numVisibleDays>o.end}),o.setBoundaries(),o}return I(n,[{key:"getFormat",value:function(t,e){switch(t){case"year":return"YYYY";case"month":return"top"==e?"MMMM YYYY":"MMMM";case"week":return"top"==e?"ww MMMM YYYY":"ww";case"dayweek":return"dd";case"daymonth":return"D"}}},{key:"getModeIncrement",value:function(t,e){switch(e){case"year":return E.daysInYear(t.year());case"month":return t.daysInMonth();case"week":return 7;default:return 1}}},{key:"getBox",value:function(t,e,n){var o=this.getModeIncrement(t,e)*this.props.dayWidth;if(!n){var r=this.getStartDate(t,e);r=r.startOf("day");var i=g()().startOf("day"),a=r.diff(i,"days");n=E.dayToPosition(a,this.props.nowposition,this.props.dayWidth)}return{left:n,width:o}}},{key:"render",value:function(){return this.refs.Header&&(this.refs.Header.scrollLeft=this.props.scrollLeft),r.a.createElement("div",{id:"timeline-header",ref:"Header",className:"timeLine-main-header-viewPort"},this.renderHeader())}}]),n}();function A(t){"@babel/helpers - typeof";return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function Y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?F(Object(n),!0).forEach(function(e){J(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function X(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function q(t,e){return(q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function G(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,o=$(t);if(e){var r=$(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return function(t,e){if(e&&("object"===A(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return K(t)}(this,n)}}function K(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $(t){return($=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function J(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Q=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&q(t,e)}(s,o["Component"]);var e,n,i,a=G(s);function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),J(K(e=a.call(this,t)),"onCreateLinkMouseDown",function(t,n){0===t.button&&(t.stopPropagation(),e.props.onStartCreateLink(e.props.item,n))}),J(K(e),"onCreateLinkMouseUp",function(t,n){t.stopPropagation(),e.props.onFinishCreateLink(e.props.item,n)}),J(K(e),"onCreateLinkTouchStart",function(t,n){t.stopPropagation(),e.props.onStartCreateLink(e.props.item,n)}),J(K(e),"onCreateLinkTouchEnd",function(t,n){t.stopPropagation(),e.props.onFinishCreateLink(e.props.item,n)}),J(K(e),"doMouseDown",function(t,n){e.props.onUpdateTask&&0===t.button&&(t.stopPropagation(),e.dragStart(t.clientX,n))}),J(K(e),"doMouseMove",function(t){e.state.dragging&&(t.stopPropagation(),e.dragProcess(t.clientX))}),J(K(e),"doMouseUp",function(){e.dragEnd()}),J(K(e),"doTouchStart",function(t,n){e.props.onUpdateTask&&(t.stopPropagation(),e.dragStart(t.touches[0].clientX,n))}),J(K(e),"doTouchMove",function(t){e.state.dragging&&(t.stopPropagation(),e.dragProcess(t.changedTouches[0].clientX))}),J(K(e),"doTouchEnd",function(t){e.dragEnd()}),e.calculateStyle=e.calculateStyle.bind(K(e)),e.state={dragging:!1,left:e.props.left,width:e.props.width,mode:v},e}return e=s,(n=[{key:"componentDidUpdate",value:function(t,e){this.state.dragging&&!e.dragging?(document.addEventListener("mousemove",this.doMouseMove),document.addEventListener("mouseup",this.doMouseUp),document.addEventListener("touchmove",this.doTouchMove),document.addEventListener("touchend",this.doTouchEnd)):!this.state.dragging&&e.dragging&&(document.removeEventListener("mousemove",this.doMouseMove),document.removeEventListener("mouseup",this.doMouseUp),document.removeEventListener("touchmove",this.doTouchMove),document.removeEventListener("touchend",this.doTouchEnd))}},{key:"dragStart",value:function(t,e){this.props.onChildDrag(!0),this.draggingPosition=t,this.setState({dragging:!0,mode:e,left:this.props.left,width:this.props.width})}},{key:"dragProcess",value:function(t){var e=this.draggingPosition-t,n=this.state.left,o=this.state.width;switch(this.state.mode){case 1:n=this.state.left-e;break;case 2:n=this.state.left-e,o=this.state.width+e;break;case 3:o=this.state.width-e}var r={item:this.props.item,position:{start:n-this.props.nowposition,end:n+o-this.props.nowposition}};this.props.onTaskChanging(r),this.setState({left:n,width:o}),this.draggingPosition=t}},{key:"dragEnd",value:function(){this.props.onChildDrag(!1);var t=E.pixelToDate(this.state.left,this.props.nowposition,this.props.dayWidth),e=E.pixelToDate(this.state.left+this.state.width,this.props.nowposition,this.props.dayWidth);this.props.onUpdateTask(this.props.item,{start:t,end:e}),this.setState({dragging:!1,mode:v})}},{key:"calculateStyle",value:function(){var t=this.props.isSelected?u.values.dataViewPort.task.selectedStyle:u.values.dataViewPort.task.style,e=this.props.color?this.props.color:t.backgroundColor;return this.state.dragging?Y(Y({},t),{},{backgroundColor:e,left:this.state.left,width:this.state.width,height:this.props.height-5,top:2}):Y(Y({},t),{},{backgroundColor:e,left:this.props.left,width:this.props.width,height:this.props.height-5,top:2})}},{key:"render",value:function(){var t=this,e=this.calculateStyle();return r.a.createElement("div",{onMouseDown:function(e){return t.doMouseDown(e,1)},onTouchStart:function(e){return t.doTouchStart(e,1)},onClick:function(e){t.props.onSelectItem(t.props.item)},style:e},r.a.createElement("div",{className:"timeLine-main-data-task-side",style:{top:0,left:-4,height:e.height},onMouseDown:function(e){return t.doMouseDown(e,2)},onTouchStart:function(e){return t.doTouchStart(e,2)}},r.a.createElement("div",{className:"timeLine-main-data-task-side-linker",onMouseUp:function(e){return t.onCreateLinkMouseUp(e,void 0)},onTouchEnd:function(e){return t.onCreateLinkTouchEnd(e,void 0)}})),r.a.createElement("div",{style:{overflow:"hidden"}},u.values.dataViewPort.task.showLabel?this.props.item.name:""),r.a.createElement("div",{className:"timeLine-main-data-task-side",style:{top:0,left:e.width-3,height:e.height},onMouseDown:function(e){return t.doMouseDown(e,3)},onTouchStart:function(e){return t.doTouchStart(e,3)}},r.a.createElement("div",{className:"timeLine-main-data-task-side-linker",onMouseDown:function(e){return t.onCreateLinkMouseDown(e,"LINK_POS_RIGHT")},onTouchStart:function(e){return t.onCreateLinkTouchStart(e,"LINK_POS_RIGHT")}})))}}])&&X(e.prototype,n),i&&X(e,i),Object.defineProperty(e,"prototype",{writable:!1}),s}(),Z=n(5),tt=n.n(Z);function et(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var nt=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data={},this.link={}}var e,n,o;return e=t,(n=[{key:"registerData",value:function(t){var e=this;if(t){this.data={};var n=this.groupData(t,0,t.length);Object.values(n).forEach(function(t,n){t.forEach(function(t){e.data[t.id]={item:t,index:n}})})}}},{key:"registerLinks",value:function(t){if(t){this.link={};for(var e=0,n=0,o=0;o<t.length;o++){e=t[o].start,n=t[o].end;var r={link:t[o],index:o};this.createAddTo(e,this.link,r,o),this.createAddTo(n,this.link,r,o)}}}},{key:"createAddTo",value:function(t,e,n,o){e[t]||(e[t]=[]),-1==e[t].indexOf(n)&&e[t].push(n)}},{key:"getTask",value:function(t){return this.data[t]}},{key:"getLinks",value:function(t){return this.link[t]}},{key:"groupData",value:function(t,e,n){for(var o={},r=e;r<n;r++){var i=t[r];if(!i)break;var a=void 0!==i.groupName?i.groupName:i.id;void 0!==o[a]?o[a].push(i):o[a]=[i]}return o}}])&&et(e.prototype,n),o&&et(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}());function ot(t){"@babel/helpers - typeof";return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function it(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(n),!0).forEach(function(e){at(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function at(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function st(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ct(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function ut(t,e,n){return e&&ct(t.prototype,e),n&&ct(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function lt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pt(t,e)}function pt(t,e){return(pt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ft(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,o=ht(t);if(e){var r=ht(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return function(t,e){if(e&&("object"===ot(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return dt(t)}(this,n)}}function dt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ht(t){return(ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var yt=function(t){lt(n,o["Component"]);var e=ft(n);function n(t){return st(this,n),e.call(this,t)}return ut(n,[{key:"render",value:function(){return r.a.createElement("div",{className:"timeLine-main-data-row",style:it(it({},u.values.dataViewPort.rows.style),{},{top:this.props.top,height:this.props.itemheight})},this.props.children)}}]),n}(),bt=function(t){lt(n,o["Component"]);var e=ft(n);function n(t){var o;return st(this,n),at(dt(o=e.call(this,t)),"onChildDrag",function(t){o.childDragging=t}),at(dt(o),"renderRows",function(){var t=[],e=nt.groupData(o.props.data,o.props.startRow,o.props.endRow+1);return Object.keys(e).forEach(function(n,i){var a=e[n];t.push(r.a.createElement(yt,{key:n,label:n,top:i*o.props.itemheight,left:20,itemheight:o.props.itemheight},a.map(function(t){var e=E.dateToPixel(t.start,o.props.nowposition,o.props.dayWidth),n=E.dateToPixel(t.end,o.props.nowposition,o.props.dayWidth)-e;return r.a.createElement(Q,{key:t.id,item:t,label:t.name,nowposition:o.props.nowposition,dayWidth:o.props.dayWidth,color:t.color,left:e,width:n,height:o.props.itemheight,onChildDrag:o.onChildDrag,isSelected:o.props.selectedItem==t,onSelectItem:o.props.onSelectItem,onStartCreateLink:o.props.onStartCreateLink,onFinishCreateLink:o.props.onFinishCreateLink,onTaskChanging:o.props.onTaskChanging,onUpdateTask:o.props.onUpdateTask}," ")})))}),t}),at(dt(o),"doMouseDown",function(t){0!==t.button||o.childDragging||o.props.onMouseDown(t)}),at(dt(o),"doMouseMove",function(t){o.props.onMouseMove(t,o.refs.dataViewPort)}),at(dt(o),"doTouchStart",function(t){o.childDragging||o.props.onTouchStart(t)}),at(dt(o),"doTouchMove",function(t){o.props.onTouchMove(t,o.refs.dataViewPort)}),o.childDragging=!1,o}return ut(n,[{key:"getContainerHeight",value:function(t){return t>0?t*this.props.itemheight:10}},{key:"componentDidMount",value:function(){this.refs.dataViewPort.scrollLeft=0}},{key:"render",value:function(){this.refs.dataViewPort&&(this.refs.dataViewPort.scrollLeft=this.props.scrollLeft,this.refs.dataViewPort.scrollTop=this.props.scrollTop);var t=this.getContainerHeight(this.props.data.length);return r.a.createElement("div",{ref:"dataViewPort",id:"timeLinedataViewPort",className:"timeLine-main-data-viewPort",onMouseDown:this.doMouseDown,onMouseMove:this.doMouseMove,onMouseUp:this.props.onMouseUp,onMouseLeave:this.props.onMouseLeave,onTouchStart:this.doTouchStart,onTouchMove:this.doTouchMove,onTouchEnd:this.props.onTouchEnd,onTouchCancel:this.props.onTouchCancel},r.a.createElement("div",{className:"timeLine-main-data-container",style:{height:t,width:k,maxWidth:k}},this.renderRows()))}}]),n}(),mt=tt()({monitorWidth:!0,monitorHeight:!0})(bt);function gt(t){"@babel/helpers - typeof";return(gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function wt(t,e){return(wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function kt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,o=xt(t);if(e){var r=xt(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return function(t,e){if(e&&("object"===gt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ot(t)}(this,n)}}function Ot(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xt(t){return(xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var St=20,Pt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wt(t,e)}(s,o["Component"]);var e,n,i,a=kt(s);function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),jt(Ot(e=a.call(this,t)),"calcNormCoordinates",function(){var t;return{cpt1:{x:t=e.props.start.x+(e.props.end.x-e.props.start.x)/2,y:e.props.start.y},cpt2:{x:t,y:e.props.end.y}}}),jt(Ot(e),"calcSCoordinates",function(){var t={x:e.props.start.x+St,y:e.props.start.y},n=(e.props.end.y-e.props.start.y)/2,o={x:t.x,y:t.y+n},r={x:e.props.end.x-St,y:o.y};return{cpt1:t,cpt2:o,cpt3:r,cpt4:{x:r.x,y:r.y+n}}}),jt(Ot(e),"getPath",function(){var t=null;return e.props.start.x>e.props.end.x?(t=e.calcSCoordinates(),"M".concat(e.props.start.x," ").concat(e.props.start.y," ").concat(t.cpt1.x," ").concat(t.cpt1.y," ").concat(t.cpt2.x," ").concat(t.cpt2.y," ").concat(t.cpt3.x," ").concat(t.cpt3.y," ").concat(t.cpt4.x," ").concat(t.cpt4.y," ").concat(e.props.end.x," ").concat(e.props.end.y)):(t=e.calcNormCoordinates(),"M".concat(e.props.start.x," ").concat(e.props.start.y," ").concat(t.cpt1.x," ").concat(t.cpt1.y," ").concat(t.cpt2.x," ").concat(t.cpt2.y," ").concat(e.props.end.x," ").concat(e.props.end.y))}),jt(Ot(e),"onSelect",function(t){e.props.onSelectItem&&e.props.onSelectItem(e.props.item)}),e}return e=s,(n=[{key:"render",value:function(){var t=this.props.isSelected?u.values.links.selectedColor:u.values.links.color;return r.a.createElement("g",{className:"timeline-link"},r.a.createElement("path",{pointerEvents:"stroke",onMouseDown:this.onSelect,stroke:"white",d:this.getPath(),strokeLinejoin:"round",fill:"transparent",strokeWidth:"4",cursor:"pointer"}),r.a.createElement("path",{pointerEvents:"stroke",onMouseDown:this.onSelect,stroke:t,d:this.getPath(),strokeLinejoin:"round",fill:"transparent",strokeWidth:"1",cursor:"pointer",markerEnd:"url(#arrow)"}))}}])&&vt(e.prototype,n),i&&vt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),s}();function Tt(t){"@babel/helpers - typeof";return(Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Et(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Lt(t,e){return(Lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ct(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,o=Dt(t);if(e){var r=Dt(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return function(t,e){if(e&&("object"===Tt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Mt(t)}(this,n)}}function Mt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Dt(t){return(Dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Rt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var _t=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Lt(t,e)}(s,o["Component"]);var e,n,i,a=Ct(s);function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),Rt(Mt(e=a.call(this,t)),"doMouseMove",function(t){e.init||(e.lastX=t.clientX,e.lastY=t.clientY,e.init=!0);var n=e.state.x+(t.clientX-e.lastX),o=e.state.y+(t.clientY-e.lastY);e.lastX=t.clientX,e.lastY=t.clientY,e.setState({x:n,y:o})}),Rt(Mt(e),"doMouseUp",function(t){e.props.onFinishCreateLink()}),e.state={x:e.props.start.x,y:e.props.start.y},e.init=!1,e.lastX=-1,e.lastY=-1,e}return e=s,(n=[{key:"componentDidMount",value:function(){document.addEventListener("mousemove",this.doMouseMove),document.addEventListener("mouseup",this.doMouseUp)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousemove",this.doMouseMove),document.removeEventListener("mouseup",this.doMouseUp)}},{key:"render",value:function(){return r.a.createElement(Pt,{key:-1,start:{x:this.props.start.x,y:this.props.start.y},end:{x:this.state.x,y:this.state.y}})}}])&&Et(e.prototype,n),i&&Et(e,i),Object.defineProperty(e,"prototype",{writable:!1}),s}();function It(t){"@babel/helpers - typeof";return(It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ut(t){return function(t){if(Array.isArray(t))return Nt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Nt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function zt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Bt(t,e){return(Bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Wt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,o=Ht(t);if(e){var r=Ht(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return function(t,e){if(e&&("object"===It(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Vt(t)}(this,n)}}function Vt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ht(t){return(Ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function At(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ft=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bt(t,e)}(s,o["Component"]);var e,n,i,a=Wt(s);function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),At(Vt(e=a.call(this,t)),"getItemPosition",function(t,n){return{x:E.dateToPixel(n,0,e.props.dayWidth),y:t*e.props.itemheight+e.props.itemheight/2}}),At(Vt(e),"renderCreateLink",function(){if(e.props.interactiveMode){var t=nt.getTask(e.props.taskToCreate.task.id),n=e.getItemPosition(t.index,t.item.end);return r.a.createElement(_t,{start:n,onFinishCreateLink:e.props.onFinishCreateLink})}}),At(Vt(e),"renderChangingTaskLinks",function(){if(e.props.changingTask!=e.state.changingTask){e.state.changingTask=e.props.changingTask;var t=nt.getLinks(e.state.changingTask.item.id);if(!t)return;for(var n=null,o=null,i=null,a={},s={},c=0;c<t.length;c++)n=t[c],(o=nt.getTas