pandorafms/pandora_console/include/visual-console-client/vc.main.min.js

2 lines
82 KiB
JavaScript

!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=9)}([function(t,e,n){"use strict";n.d(e,"m",function(){return r}),n.d(e,"l",function(){return s}),n.d(e,"r",function(){return o}),n.d(e,"j",function(){return a}),n.d(e,"k",function(){return c}),n.d(e,"n",function(){return u}),n.d(e,"q",function(){return h}),n.d(e,"i",function(){return p}),n.d(e,"h",function(){return _}),n.d(e,"g",function(){return f}),n.d(e,"o",function(){return d}),n.d(e,"d",function(){return m}),n.d(e,"e",function(){return y}),n.d(e,"f",function(){return b}),n.d(e,"p",function(){return v}),n.d(e,"c",function(){return x}),n.d(e,"a",function(){return w}),n.d(e,"b",function(){return O});var i=function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function r(t,e){return"number"==typeof t?t:"string"==typeof t&&t.length>0&&!isNaN(parseInt(t))?parseInt(t):e}function s(t,e){return"number"==typeof t?t:"string"==typeof t&&t.length>0&&!isNaN(parseFloat(t))?parseFloat(t):e}function o(t){return null==t||0===t.length}function a(t,e){return"string"==typeof t&&t.length>0?t:e}function c(t){return"boolean"==typeof t?t:"number"==typeof t?t>0:"string"==typeof t&&("1"===t||"true"===t)}function l(t,e,n){void 0===n&&(n=" "),"number"==typeof t&&(t=""+t),"number"==typeof n&&(n=""+n);var i=e-t.length;if(0===i)return t;if(i<0)return t.substr(Math.abs(i));if(i===n.length)return""+n+t;if(i<n.length)return""+n.substring(0,i)+t;for(var r=Math.floor(i/n.length),s=i-n.length*r,o="",a=0;a<r;a++)o+=n;return 0===s?""+o+t:""+o+n.substring(0,s)+t}function u(t){return{x:r(t.x,0),y:r(t.y,0)}}function h(t){if(null==t.width||isNaN(parseInt(t.width))||null==t.height||isNaN(parseInt(t.height)))throw new TypeError("invalid size.");return{width:parseInt(t.width),height:parseInt(t.height)}}function p(t){return i({moduleId:r(t.moduleId,null),moduleName:a(t.moduleName,null),moduleDescription:a(t.moduleDescription,null)},function(t){var e={agentId:r(t.agent,null),agentName:a(t.agentName,null),agentAlias:a(t.agentAlias,null),agentDescription:a(t.agentDescription,null),agentAddress:a(t.agentAddress,null)};return null!=t.metaconsoleId?i({metaconsoleId:t.metaconsoleId},e):e}(t))}function _(t){var e=t.metaconsoleId,n=t.linkedLayoutId,s=t.linkedLayoutAgentId,o={linkedLayoutStatusType:"default"};switch(t.linkedLayoutStatusType){case"weight":var a=r(t.linkedLayoutStatusTypeWeight,null);if(null==a)throw new TypeError("invalid status calculation properties.");t.linkedLayoutStatusTypeWeight&&(o={linkedLayoutStatusType:"weight",linkedLayoutStatusTypeWeight:a});break;case"service":var c=r(t.linkedLayoutStatusTypeWarningThreshold,null),l=r(t.linkedLayoutStatusTypeCriticalThreshold,null);if(null==c||null==l)throw new TypeError("invalid status calculation properties.");o={linkedLayoutStatusType:"service",linkedLayoutStatusTypeWarningThreshold:c,linkedLayoutStatusTypeCriticalThreshold:l}}var u=i({linkedLayoutId:r(n,null),linkedLayoutAgentId:r(s,null)},o);return null!=e?i({metaconsoleId:e},u):u}function f(t){var e,n,i=(e=t.receivedAt,n=null,e instanceof Date?e:"number"==typeof e?new Date(1e3*e):"string"!=typeof e||Number.isNaN(new Date(e).getTime())?n:new Date(e));if(null===i)throw new TypeError("invalid meta structure");var r=null;return t.error instanceof Error?r=t.error:"string"==typeof t.error&&(r=new Error(t.error)),{receivedAt:i,error:r,editMode:c(t.editMode),isFromCache:c(t.isFromCache),isFetching:!1,isUpdating:!1}}function d(t,e){var n=t+": "+e+";";return["-webkit-"+n,"-moz-"+n,"-ms-"+n,"-o-"+n,""+n]}function m(t){return decodeURIComponent(escape(window.atob(t)))}function y(t,e){if(void 0===e&&(e=null),e&&Intl&&Intl.DateTimeFormat){return Intl.DateTimeFormat(e,{day:"2-digit",month:"2-digit",year:"numeric"}).format(t)}return l(t.getDate(),2,0)+"/"+l(t.getMonth()+1,2,0)+"/"+l(t.getFullYear(),4,0)}function b(t){return l(t.getHours(),2,0)+":"+l(t.getMinutes(),2,0)+":"+l(t.getSeconds(),2,0)}function v(t,e){return t.reduce(function(t,e){var n=e.macro,i=e.value;return t.replace(n,i)},e)}function g(t,e){var n=0;return function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var s=Date.now();if(!(s-n<t))return n=s,e.apply(void 0,i)}}function x(t,e){var n=null;return function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];null!==n&&window.clearTimeout(n),n=window.setTimeout(function(){e.apply(void 0,i),n=null},t)}}function E(t){for(var e=0,n=0;t&&!Number.isNaN(t.offsetLeft)&&!Number.isNaN(t.offsetTop);)e+=t.offsetLeft-t.scrollLeft,n+=t.offsetTop-t.scrollTop,t=t.offsetParent;return{top:n,left:e}}function w(t,e){var n=t.parentElement,i=t.draggable,r=0,s=0,o=0,a=0,c=0,l=0,u=n.getBoundingClientRect(),h=E(n),p=h.top,_=p+u.height,f=h.left,d=f+u.width,m=t.getBoundingClientRect(),y=window.getComputedStyle(t).borderWidth||"0",b=2*Number.parseInt(y),v=x(32,function(t,n){return e(t,n)}),w=g(16,function(t,n){return e(t,n)}),O=function(t){var e=0,n=0,i=t.pageX,h=t.pageY,y=i-o,g=h-a,x=u.width-m.width+b,E=u.height-m.height+b,O=i<f||0===r&&y>0&&i<f+c,T=i>d||y+r+m.width-b>u.width||r===x&&y<0&&i>f+x+c,A=h<p||0===s&&g>0&&h<p+l,k=h>_||g+s+m.height-b>u.height||s===E&&g<0&&h>p+E+l;(e=O?0:T?x:y+r)<0&&(e=0),(n=A?0:k?E:g+s)<0&&(n=0),o=i,a=h,e===r&&n===s||(w(e,n),v(e,n),r=e,s=n)},T=function(){r=0,s=0,o=0,a=0,document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",T),t.draggable=i,document.body.style.userSelect="auto"},A=function(e){e.stopPropagation(),t.draggable=!1,r=t.offsetLeft,s=t.offsetTop,o=e.pageX,a=e.pageY,c=e.offsetX,l=e.offsetY,u=n.getBoundingClientRect(),h=E(n),p=h.top,_=p+u.height,f=h.left,d=f+u.width,m=t.getBoundingClientRect(),y=window.getComputedStyle(t).borderWidth||"0",b=2*Number.parseInt(y),document.addEventListener("mousemove",O),document.addEventListener("mouseup",T),document.body.style.userSelect="none"};return t.addEventListener("mousedown",A),function(){t.removeEventListener("mousedown",A),T()}}function O(t,e){var n=document.createElement("div");n.className="resize-draggable",t.appendChild(n);var i=t.parentElement,r=t.draggable,s=0,o=0,a=0,c=0,l=0,u=i.getBoundingClientRect(),h=E(i),p=h.top,_=p+u.height,f=h.left,d=f+u.width,m=E(t),y=m.top,b=m.left,v=window.getComputedStyle(t).borderWidth||"0",w=Number.parseInt(v),O=x(32,function(t,n){return e(t,n)}),T=g(16,function(t,n){return e(t,n)}),A=function(t){var e=s+(t.pageX-a),n=o+(t.pageY-c);e===s&&n===o||e<s&&t.pageX>b+(s-l)||(e<15?e=15:e+b-w/2>=d&&(e=d-b),n<15?n=15:n+y-w/2>=_&&(n=_-y),T(e,n),O(e,n),s=e,o=n,a=t.pageX,c=t.pageY)},k=function(){s=0,o=0,a=0,c=0,l=0,0,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",k),t.draggable=r,document.body.style.userSelect="auto"};return n.addEventListener("mousedown",function(e){e.stopPropagation(),t.draggable=!1;var n=t.getBoundingClientRect(),r=n.width,v=n.height;s=r,o=v,a=e.pageX,c=e.pageY,l=e.offsetX,e.offsetY,u=i.getBoundingClientRect(),h=E(i),p=h.top,_=p+u.height,f=h.left,d=f+u.width,m=E(t),y=m.top,b=m.left,document.addEventListener("mousemove",A),document.addEventListener("mouseup",k),document.body.style.userSelect="none"}),function(){n.remove(),k()}}},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var i=n(0),r=n(2),s=function(){return(s=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},o=function(t){switch(t){case"up":case"right":case"down":case"left":return t;default:return"down"}};function a(t){if(null==t.id||isNaN(parseInt(t.id)))throw new TypeError("invalid id.");if(null==t.type||isNaN(parseInt(t.type)))throw new TypeError("invalid type.");return s({id:parseInt(t.id),type:parseInt(t.type),label:Object(i.j)(t.label,null),labelPosition:o(t.labelPosition),isLinkEnabled:Object(i.k)(t.isLinkEnabled),link:Object(i.j)(t.link,null),isOnTop:Object(i.k)(t.isOnTop),parentId:Object(i.m)(t.parentId,null),aclGroupId:Object(i.m)(t.aclGroupId,null)},Object(i.q)(t),Object(i.n)(t))}var c=function(){function t(t,e){var n=this;this.clickEventManager=new r.a,this.movedEventManager=new r.a,this.resizedEventManager=new r.a,this.removeEventManager=new r.a,this.disposables=[],this.debouncedMovementSave=Object(i.c)(500,function(t,e){var i={x:n.props.x,y:n.props.y},r={x:t,y:e};n.positionChanged(i,r)&&(n.move(t,e),n.movedEventManager.emit({item:n,prevPosition:i,newPosition:r}))}),this.removeMovement=null,this.debouncedResizementSave=Object(i.c)(500,function(t,e){var i={width:n.props.width,height:n.props.height},r={width:t,height:e};n.sizeChanged(i,r)&&(n.resize(t,e),n.resizedEventManager.emit({item:n,prevSize:i,newSize:r}))}),this.removeResizement=null,this.itemProps=t,this._metadata=e,this.elementRef=this.createContainerDomElement(),this.labelElementRef=this.createLabelDomElement(),this.childElementRef=this.createDomElement(),this.elementRef.append(this.childElementRef,this.labelElementRef),this.resizeElement(t.width,t.height),this.changeLabelPosition(t.labelPosition)}return t.prototype.initMovementListener=function(t){var e=this;this.removeMovement=Object(i.a)(t,function(t,n){e.moveElement(t,n),e.debouncedMovementSave(t,n)})},t.prototype.stopMovementListener=function(){this.removeMovement&&(this.removeMovement(),this.removeMovement=null)},t.prototype.initResizementListener=function(t){var e=this;this.removeResizement=Object(i.b)(t,function(t,n){if(e.props.label&&e.props.label.length>0){var i=e.labelElementRef.getBoundingClientRect(),r=i.width,s=i.height;switch(e.props.labelPosition){case"up":case"down":n-=s;break;case"left":case"right":t-=r}}e.resizeElement(t,n),e.debouncedResizementSave(t,n)})},t.prototype.stopResizementListener=function(){this.removeResizement&&(this.removeResizement(),this.removeResizement=null)},t.prototype.createContainerDomElement=function(){var t,e=this;return this.props.isLinkEnabled?(t=document.createElement("a"),this.props.link&&(t.href=this.props.link)):t=document.createElement("div"),t.className="visual-console-item",t.style.zIndex=this.props.isOnTop?"2":"1",t.style.left=this.props.x+"px",t.style.top=this.props.y+"px",t.addEventListener("click",function(t){e.meta.editMode?(t.preventDefault(),t.stopPropagation()):e.clickEventManager.emit({data:e.props,nativeEvent:t})}),this.meta.editMode&&(t.classList.add("is-editing"),this.initMovementListener(t),this.initResizementListener(t)),this.meta.isFetching&&t.classList.add("is-fetching"),this.meta.isUpdating&&t.classList.add("is-updating"),t},t.prototype.createLabelDomElement=function(){var t=document.createElement("div");t.className="visual-console-item-label";var e=this.getLabelWithMacrosReplaced();if(e.length>0){var n=document.createElement("table"),i=document.createElement("tr"),r=document.createElement("tr"),s=document.createElement("tr"),o=document.createElement("td");switch(o.innerHTML=e,i.append(o),n.append(r,i,s),n.style.textAlign="center",this.props.labelPosition){case"up":case"down":this.props.width>0&&(n.style.width=this.props.width+"px",n.style.height=null);break;case"left":case"right":this.props.height>0&&(n.style.width=null,n.style.height=this.props.height+"px")}t.append(n)}return t},t.prototype.getLabelWithMacrosReplaced=function(){var t=this.props;return Object(i.p)([{macro:"_date_",value:Object(i.e)(new Date)},{macro:"_time_",value:Object(i.f)(new Date)},{macro:"_agent_",value:null!=t.agentAlias?t.agentAlias:""},{macro:"_agentdescription_",value:null!=t.agentDescription?t.agentDescription:""},{macro:"_address_",value:null!=t.agentAddress?t.agentAddress:""},{macro:"_module_",value:null!=t.moduleName?t.moduleName:""},{macro:"_moduledescription_",value:null!=t.moduleDescription?t.moduleDescription:""}],this.props.label||"")},t.prototype.updateDomElement=function(t){t.innerHTML=this.createDomElement().innerHTML},Object.defineProperty(t.prototype,"props",{get:function(){return s({},this.itemProps)},set:function(t){var e=this.props;this.itemProps=t,this.shouldBeUpdated(e,t)&&this.render(e,this._metadata)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"meta",{get:function(){return s({},this._metadata)},set:function(t){this.setMeta(t)},enumerable:!0,configurable:!0}),t.prototype.setMeta=function(t){var e=this._metadata;this._metadata=t,this.render(this.itemProps,e)},t.prototype.shouldBeUpdated=function(t,e){return t!==e},t.prototype.render=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.updateDomElement(this.childElementRef),t&&!this.positionChanged(t,this.props)||this.moveElement(this.props.x,this.props.y),t&&!this.sizeChanged(t,this.props)||this.resizeElement(this.props.width,this.props.height);var n=this.labelElementRef.innerHTML,i=this.createLabelDomElement().innerHTML;if(n!==i&&(this.labelElementRef.innerHTML=i),t&&t.labelPosition===this.props.labelPosition||this.changeLabelPosition(this.props.labelPosition),t&&(t.isLinkEnabled!==this.props.isLinkEnabled||this.props.isLinkEnabled&&t.link!==this.props.link)){var r=this.createContainerDomElement();r.innerHTML=this.elementRef.innerHTML;for(var s=this.elementRef.attributes,o=0;o<s.length;o++)"id"!==s[o].nodeName&&r.setAttributeNode(s[o]);null!==this.elementRef.parentNode&&this.elementRef.parentNode.replaceChild(r,this.elementRef),this.elementRef=r}e&&e.editMode===this.meta.editMode||(this.meta.editMode?(this.elementRef.classList.add("is-editing"),this.initMovementListener(this.elementRef),this.initResizementListener(this.elementRef)):(this.elementRef.classList.remove("is-editing"),this.stopMovementListener(),this.stopResizementListener())),e&&e.isFetching===this.meta.isFetching||(this.meta.isFetching?this.elementRef.classList.add("is-fetching"):this.elementRef.classList.remove("is-fetching")),e&&e.isUpdating===this.meta.isUpdating||(this.meta.isUpdating?this.elementRef.classList.add("is-updating"):this.elementRef.classList.remove("is-updating"))},t.prototype.remove=function(){this.removeEventManager.emit({data:this.props}),this.disposables.forEach(function(t){try{t.dispose()}catch(t){}}),this.elementRef.remove()},t.prototype.positionChanged=function(t,e){return t.x!==e.x||t.y!==e.y},t.prototype.changeLabelPosition=function(t){switch(t){case"up":this.elementRef.style.flexDirection="column-reverse";break;case"left":this.elementRef.style.flexDirection="row-reverse";break;case"right":this.elementRef.style.flexDirection="row";break;case"down":default:this.elementRef.style.flexDirection="column"}var e=this.labelElementRef.getElementsByTagName("table"),n=e.length>0?e.item(0):null;if(n)switch(this.props.labelPosition){case"up":case"down":this.props.width>0&&(n.style.width=this.props.width+"px",n.style.height=null);break;case"left":case"right":this.props.height>0&&(n.style.width=null,n.style.height=this.props.height+"px")}},t.prototype.moveElement=function(t,e){this.elementRef.style.left=t+"px",this.elementRef.style.top=e+"px"},t.prototype.move=function(t,e){this.moveElement(t,e),this.itemProps=s({},this.props,{x:t,y:e})},t.prototype.sizeChanged=function(t,e){return t.width!==e.width||t.height!==e.height},t.prototype.resizeElement=function(t,e){if(this.childElementRef.style.width=t>0?t+"px":null,this.childElementRef.style.height=e>0?e+"px":null,this.props.label&&this.props.label.length>0){var n=this.labelElementRef.getElementsByTagName("table"),i=n.length>0?n.item(0):null;if(i)switch(this.props.labelPosition){case"up":case"down":i.style.width=t>0?t+"px":null;break;case"left":case"right":i.style.height=e>0?e+"px":null}}},t.prototype.resize=function(t,e){this.resizeElement(t,e),this.itemProps=s({},this.props,{width:t,height:e})},t.prototype.onClick=function(t){var e=this.clickEventManager.on(t);return this.disposables.push(e),e},t.prototype.onMoved=function(t){var e=this.movedEventManager.on(t);return this.disposables.push(e),e},t.prototype.onResized=function(t){var e=this.resizedEventManager.on(t);return this.disposables.push(e),e},t.prototype.onRemove=function(t){var e=this.removeEventManager.on(t);return this.disposables.push(e),e},t}();e.a=c},function(t,e,n){"use strict";var i=function(){return function(){var t=this;this.listeners=[],this.listenersOncer=[],this.on=function(e){return t.listeners.push(e),{dispose:function(){return t.off(e)}}},this.once=function(e){t.listenersOncer.push(e)},this.off=function(e){var n=t.listeners.indexOf(e);n>-1&&t.listeners.splice(n,1)},this.emit=function(e){t.listeners.forEach(function(t){return t(e)}),t.listenersOncer.forEach(function(t){return t(e)}),t.listenersOncer=[]},this.pipe=function(e){return t.on(function(t){return e.emit(t)})}}}();e.a=i},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"b",function(){return eventsHistoryPropsDecoder});var _lib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_Item__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),__extends=(extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),extendStatics,__assign=function(){return(__assign=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function eventsHistoryPropsDecoder(t){if(Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.html)&&Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.encodedHtml))throw new TypeError("missing html content.");return __assign({},Object(_Item__WEBPACK_IMPORTED_MODULE_1__.b)(t),{type:14,maxTime:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.m)(t.maxTime,null),html:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.html)?Object(_lib__WEBPACK_IMPORTED_MODULE_0__.d)(t.encodedHtml):t.html},Object(_lib__WEBPACK_IMPORTED_MODULE_0__.i)(t))}var EventsHistory=function(_super){function EventsHistory(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(EventsHistory,_super),EventsHistory.prototype.createDomElement=function(){var element=document.createElement("div");element.className="events-history",element.innerHTML=this.props.html;for(var scripts=element.getElementsByTagName("script"),_loop_1=function(i){0===scripts[i].src.length&&setTimeout(function(){try{eval(scripts[i].innerHTML.trim())}catch(t){}},0)},i=0;i<scripts.length;i++)_loop_1(i);return element},EventsHistory.prototype.updateDomElement=function(element){element.innerHTML=this.props.html;var aux=document.createElement("div");aux.innerHTML=this.props.html;for(var scripts=aux.getElementsByTagName("script"),i=0;i<scripts.length;i++)0===scripts[i].src.length&&eval(scripts[i].innerHTML.trim())},EventsHistory}(_Item__WEBPACK_IMPORTED_MODULE_1__.a);__webpack_exports__.a=EventsHistory},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"b",function(){return donutGraphPropsDecoder});var _lib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_Item__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),__extends=(extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),extendStatics,__assign=function(){return(__assign=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function donutGraphPropsDecoder(t){if(Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.html)&&Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.encodedHtml))throw new TypeError("missing html content.");return __assign({},Object(_Item__WEBPACK_IMPORTED_MODULE_1__.b)(t),{type:17,html:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.html)?Object(_lib__WEBPACK_IMPORTED_MODULE_0__.d)(t.encodedHtml):t.html},Object(_lib__WEBPACK_IMPORTED_MODULE_0__.i)(t),Object(_lib__WEBPACK_IMPORTED_MODULE_0__.h)(t))}var DonutGraph=function(_super){function DonutGraph(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(DonutGraph,_super),DonutGraph.prototype.createDomElement=function(){var element=document.createElement("div");element.className="donut-graph",element.innerHTML=this.props.html;for(var scripts=element.getElementsByTagName("script"),_loop_1=function(i){setTimeout(function(){0===scripts[i].src.length&&eval(scripts[i].innerHTML.trim())},0)},i=0;i<scripts.length;i++)_loop_1(i);return element},DonutGraph.prototype.updateDomElement=function(element){element.innerHTML=this.props.html;var aux=document.createElement("div");aux.innerHTML=this.props.html;for(var scripts=aux.getElementsByTagName("script"),i=0;i<scripts.length;i++)0===scripts[i].src.length&&eval(scripts[i].innerHTML.trim())},DonutGraph}(_Item__WEBPACK_IMPORTED_MODULE_1__.a);__webpack_exports__.a=DonutGraph},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",function(){return barsGraphPropsDecoder});var _lib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_Item__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),__extends=(extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),extendStatics,__assign=function(){return(__assign=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function barsGraphPropsDecoder(t){if(Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.html)&&Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.encodedHtml))throw new TypeError("missing html content.");return __assign({},Object(_Item__WEBPACK_IMPORTED_MODULE_1__.b)(t),{type:18,html:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.html)?Object(_lib__WEBPACK_IMPORTED_MODULE_0__.d)(t.encodedHtml):t.html},Object(_lib__WEBPACK_IMPORTED_MODULE_0__.i)(t))}var BarsGraph=function(_super){function BarsGraph(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(BarsGraph,_super),BarsGraph.prototype.createDomElement=function(){var element=document.createElement("div");element.className="bars-graph",element.innerHTML=this.props.html;for(var scripts=element.getElementsByTagName("script"),_loop_1=function(i){setTimeout(function(){0===scripts[i].src.length&&eval(scripts[i].innerHTML.trim())},0)},i=0;i<scripts.length;i++)_loop_1(i);return element},BarsGraph.prototype.updateDomElement=function(element){element.innerHTML=this.props.html;var aux=document.createElement("div");aux.innerHTML=this.props.html;for(var scripts=aux.getElementsByTagName("script"),i=0;i<scripts.length;i++)0===scripts[i].src.length&&eval(scripts[i].innerHTML.trim())},BarsGraph}(_Item__WEBPACK_IMPORTED_MODULE_1__.a);__webpack_exports__.b=BarsGraph},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"b",function(){return moduleGraphPropsDecoder});var _lib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_Item__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),__extends=(extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),extendStatics,__assign=function(){return(__assign=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function moduleGraphPropsDecoder(t){if(Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.html)&&Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.encodedHtml))throw new TypeError("missing html content.");return __assign({},Object(_Item__WEBPACK_IMPORTED_MODULE_1__.b)(t),{type:1,html:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.r)(t.html)?Object(_lib__WEBPACK_IMPORTED_MODULE_0__.d)(t.encodedHtml):t.html},Object(_lib__WEBPACK_IMPORTED_MODULE_0__.i)(t),Object(_lib__WEBPACK_IMPORTED_MODULE_0__.h)(t))}var ModuleGraph=function(_super){function ModuleGraph(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ModuleGraph,_super),ModuleGraph.prototype.resizeElement=function(t){_super.prototype.resizeElement.call(this,t,0)},ModuleGraph.prototype.initResizementListener=function(){},ModuleGraph.prototype.createDomElement=function(){var element=document.createElement("div");element.className="module-graph",element.innerHTML=this.props.html;for(var legendP=element.getElementsByTagName("p"),i=0;i<legendP.length;i++)legendP[i].style.margin="0px";for(var overviewGraphs=element.getElementsByClassName("overview_graph"),i=0;i<overviewGraphs.length;i++)overviewGraphs[i].remove();for(var scripts=element.getElementsByTagName("script"),_loop_1=function(i){0===scripts[i].src.length&&setTimeout(function(){try{eval(scripts[i].innerHTML.trim())}catch(t){}},0)},i=0;i<scripts.length;i++)_loop_1(i);return element},ModuleGraph.prototype.updateDomElement=function(element){element.innerHTML=this.props.html;for(var legendP=element.getElementsByTagName("p"),i=0;i<legendP.length;i++)legendP[i].style.margin="0px";for(var overviewGraphs=element.getElementsByClassName("overview_graph"),i=0;i<overviewGraphs.length;i++)overviewGraphs[i].remove();for(var scripts=element.getElementsByTagName("script"),i=0;i<scripts.length;i++)0===scripts[i].src.length&&eval(scripts[i].innerHTML.trim())},ModuleGraph}(_Item__WEBPACK_IMPORTED_MODULE_1__.a);__webpack_exports__.a=ModuleGraph},function(t,e,n){},function(t,e,n){},function(t,e,n){"use strict";n.r(e);n(7);var i,r=n(0),s=n(1),o=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},c=function(t){switch(t){case"default":case"enabled":case"disabled":return t;default:return"default"}};function l(t){if("string"!=typeof t.imageSrc||0===t.imageSrc.length)throw new TypeError("invalid image src.");return a({},Object(s.b)(t),{type:0,imageSrc:t.imageSrc,showLastValueTooltip:c(t.showLastValueTooltip),statusImageSrc:Object(r.j)(t.statusImageSrc,null),lastValue:Object(r.j)(t.lastValue,null)},Object(r.i)(t),Object(r.h)(t))}var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.createDomElement=function(){var t=this.props.statusImageSrc||this.props.imageSrc,e=document.createElement("div");return e.className="static-graph",e.style.background="url("+t+") no-repeat",e.style.backgroundSize="contain",e.style.backgroundPosition="center",null!==this.props.lastValue&&"disabled"!==this.props.showLastValueTooltip&&(e.className="static-graph image forced_title",e.setAttribute("data-use_title_for_force_title","1"),e.setAttribute("data-title",this.props.lastValue)),e},e}(s.a),h=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),p=function(){return(p=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function _(t){if("string"!=typeof t.imageSrc||0===t.imageSrc.length)throw new TypeError("invalid image src.");return p({},Object(s.b)(t),{type:5,imageSrc:t.imageSrc},Object(r.h)(t))}var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="icon",t.style.background="url("+this.props.imageSrc+") no-repeat",t.style.backgroundSize="contain",t.style.backgroundPosition="center",t},e}(s.a),d=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),m=function(){return(m=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function y(t){if("string"!=typeof t.color||0===t.color.length)throw new TypeError("invalid color.");return m({},Object(s.b)(t),{type:20,color:t.color},Object(r.i)(t),Object(r.h)(t))}var b="http://www.w3.org/2000/svg",v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="color-cloud",t.append(this.createSvgElement()),t},e.prototype.resizeElement=function(e){t.prototype.resizeElement.call(this,e,e)},e.prototype.createSvgElement=function(){var t="grad_"+this.props.id,e=document.createElementNS(b,"svg");e.setAttribute("viewBox","0 0 100 100");var n=document.createElementNS(b,"defs"),i=document.createElementNS(b,"radialGradient");i.setAttribute("id",t),i.setAttribute("cx","50%"),i.setAttribute("cy","50%"),i.setAttribute("r","50%"),i.setAttribute("fx","50%"),i.setAttribute("fy","50%");var r=document.createElementNS(b,"stop");r.setAttribute("offset","0%"),r.setAttribute("style","stop-color:"+this.props.color+";stop-opacity:0.9");var s=document.createElementNS(b,"stop");s.setAttribute("offset","100%"),s.setAttribute("style","stop-color:"+this.props.color+";stop-opacity:0");var o=document.createElementNS(b,"circle");return o.setAttribute("fill","url(#"+t+")"),o.setAttribute("cx","50%"),o.setAttribute("cy","50%"),o.setAttribute("r","50%"),i.append(r,s),n.append(i),e.append(n,o),e},e}(s.a),g=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),x=function(){return(x=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function E(t){if(("string"!=typeof t.imageSrc||0===t.imageSrc.length)&&null===t.encodedHtml)throw new TypeError("invalid image src.");if(null===Object(r.m)(t.groupId,null))throw new TypeError("invalid group Id.");var e=Object(r.k)(t.showStatistics),n=e?function(t){return Object(r.r)(t.html)?Object(r.r)(t.encodedHtml)?null:Object(r.d)(t.encodedHtml):t.html}(t):null;return x({},Object(s.b)(t),{type:11,groupId:parseInt(t.groupId),imageSrc:Object(r.j)(t.imageSrc,null),statusImageSrc:Object(r.j)(t.statusImageSrc,null),showStatistics:e,html:n},Object(r.h)(t))}var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="group",this.props.showStatistics||null===this.props.statusImageSrc?this.props.showStatistics&&null!=this.props.html&&(t.innerHTML=this.props.html):(t.style.background="url("+this.props.statusImageSrc+") no-repeat",t.style.backgroundSize="contain",t.style.backgroundPosition="center"),t},e}(s.a),O=(n(8),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),T=function(){return(T=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},A=function(t){switch(t){case"analogic":case"digital":return t;default:return"analogic"}},k=function(t){switch(t){case"datetime":case"time":return t;default:return"datetime"}};function M(t){if("string"!=typeof t.clockTimezone||0===t.clockTimezone.length)throw new TypeError("invalid timezone.");return T({},Object(s.b)(t),{type:19,clockType:A(t.clockType),clockFormat:k(t.clockFormat),clockTimezone:t.clockTimezone,clockTimezoneOffset:Object(r.m)(t.clockTimezoneOffset,0),showClockTimezone:Object(r.k)(t.showClockTimezone),color:Object(r.j)(t.color,null)},Object(r.h)(t))}var j=function(t){function e(n,i){var r=t.call(this,n,i)||this;return r.intervalRef=null,r.startTick(function(){r.childElementRef.innerHTML=r.createClock().innerHTML},"analogic"===r.props.clockType?2e4:e.TICK_INTERVAL),r}return O(e,t),e.prototype.stopTick=function(){null!==this.intervalRef&&(window.clearInterval(this.intervalRef),this.intervalRef=null)},e.prototype.startTick=function(t,n){void 0===n&&(n=e.TICK_INTERVAL),this.stopTick(),this.intervalRef=window.setInterval(t,n)},e.prototype.createDomElement=function(){return this.createClock()},e.prototype.remove=function(){this.stopTick(),t.prototype.remove.call(this)},e.prototype.resizeElement=function(e,n){var i=this.getElementSize(e,n),r=i.width,s=i.height;t.prototype.resizeElement.call(this,r,s),"digital"===this.props.clockType&&(this.childElementRef.innerHTML=this.createClock().innerHTML)},e.prototype.createClock=function(){switch(this.props.clockType){case"analogic":return this.createAnalogicClock();case"digital":return this.createDigitalClock();default:throw new Error("invalid clock type.")}},e.prototype.createAnalogicClock=function(){var t="http://www.w3.org/2000/svg",e="#FFFFF0",n="#242124",i="#242124",s="#242124",o="#525252",a="#DC143C",c=this.getElementSize(),l=c.width,u=c.height,h=10*l/100,p=document.createElement("div");p.className="analogic-clock",p.style.width=l+"px",p.style.height=u+"px";var _=document.createElementNS(t,"svg");_.setAttribute("viewBox","0 0 100 100");var f=document.createElementNS(t,"g");f.setAttribute("class","clockface");var d=document.createElementNS(t,"circle");d.setAttribute("cx","50"),d.setAttribute("cy","50"),d.setAttribute("r","48"),d.setAttribute("fill",e),d.setAttribute("stroke",n),d.setAttribute("stroke-width","2"),d.setAttribute("stroke-linecap","round"),f.append(d);var m=this.getHumanTimezone();if(m.length>0){var y=document.createElementNS(t,"text");y.setAttribute("text-anchor","middle"),y.setAttribute("font-size","8"),y.setAttribute("transform","translate(30 50) rotate(90)"),y.setAttribute("fill",i),y.textContent=m,f.append(y)}var b=document.createElementNS(t,"g");b.setAttribute("class","marks");var v=document.createElementNS(t,"g");v.setAttribute("class","mark"),v.setAttribute("transform","translate(50 50)");var g=document.createElementNS(t,"line");g.setAttribute("x1","36"),g.setAttribute("y1","0"),g.setAttribute("x2","46"),g.setAttribute("y2","0"),g.setAttribute("stroke",i),g.setAttribute("stroke-width","5");var x=document.createElementNS(t,"line");x.setAttribute("x1","36"),x.setAttribute("y1","0"),x.setAttribute("x2","46"),x.setAttribute("y2","0"),x.setAttribute("stroke",e),x.setAttribute("stroke-width","1"),v.append(g,x),b.append(v);for(var E=1;E<60;E++){var w=document.createElementNS(t,"line");w.setAttribute("y1","0"),w.setAttribute("y2","0"),w.setAttribute("stroke",i),w.setAttribute("transform","translate(50 50) rotate("+6*E+")"),E%5==0?(w.setAttribute("x1","38"),w.setAttribute("x2","46"),w.setAttribute("stroke-width",E%15==0?"2":"1")):(w.setAttribute("x1","42"),w.setAttribute("x2","46"),w.setAttribute("stroke-width","0.5")),b.append(w)}var O=document.createElementNS(t,"g");O.setAttribute("class","hour-hand"),O.setAttribute("transform","translate(50 50)");var T=document.createElementNS(t,"line");T.setAttribute("class","hour-hand-a"),T.setAttribute("x1","0"),T.setAttribute("y1","0"),T.setAttribute("x2","30"),T.setAttribute("y2","0"),T.setAttribute("stroke",o),T.setAttribute("stroke-width","4"),T.setAttribute("stroke-linecap","round");var A=document.createElementNS(t,"line");A.setAttribute("class","hour-hand-b"),A.setAttribute("x1","0"),A.setAttribute("y1","0"),A.setAttribute("x2","29.9"),A.setAttribute("y2","0"),A.setAttribute("stroke",s),A.setAttribute("stroke-width","3.1"),A.setAttribute("stroke-linecap","round"),O.append(T,A);var k=document.createElementNS(t,"g");k.setAttribute("class","minute-hand"),k.setAttribute("transform","translate(50 50)");var M=document.createElementNS(t,"line");M.setAttribute("class","minute-hand-a"),M.setAttribute("x1","0"),M.setAttribute("y1","0"),M.setAttribute("x2","40"),M.setAttribute("y2","0"),M.setAttribute("stroke",o),M.setAttribute("stroke-width","2"),M.setAttribute("stroke-linecap","round");var j=document.createElementNS(t,"line");j.setAttribute("class","minute-hand-b"),j.setAttribute("x1","0"),j.setAttribute("y1","0"),j.setAttribute("x2","39.9"),j.setAttribute("y2","0"),j.setAttribute("stroke",s),j.setAttribute("stroke-width","1.5"),j.setAttribute("stroke-linecap","round");var P=document.createElementNS(t,"circle");P.setAttribute("r","3"),P.setAttribute("fill",s),k.append(M,j,P);var S=document.createElementNS(t,"g");S.setAttribute("class","second-hand"),S.setAttribute("transform","translate(50 50)");var L=document.createElementNS(t,"line");L.setAttribute("x1","0"),L.setAttribute("y1","0"),L.setAttribute("x2","46"),L.setAttribute("y2","0"),L.setAttribute("stroke",a),L.setAttribute("stroke-width","1"),L.setAttribute("stroke-linecap","round");var R=document.createElementNS(t,"circle");R.setAttribute("r","2"),R.setAttribute("fill",a),S.append(L,R);var N=document.createElementNS(t,"circle");N.setAttribute("cx","50"),N.setAttribute("cy","50"),N.setAttribute("r","0.3"),N.setAttribute("fill",s);var I=this.getOriginDate(),D=I.getSeconds(),C=I.getMinutes(),z=6*D,B=6*C+D/60*6,W=30*I.getHours()+C/60*30;if(O.setAttribute("transform","translate(50 50) rotate("+W+")"),k.setAttribute("transform","translate(50 50) rotate("+B+")"),S.setAttribute("transform","translate(50 50) rotate("+z+")"),_.append(f,b,O,k,S,N),_.setAttribute("transform","rotate(-90)"),p.innerHTML="\n <style>\n @keyframes rotate-hour {\n from {\n "+Object(r.o)("transform","translate(50px, 50px) rotate("+W+"deg)").join("\n")+"\n }\n to {\n "+Object(r.o)("transform","translate(50px, 50px) rotate("+(W+360)+"deg)").join("\n")+"\n }\n }\n @keyframes rotate-minute {\n from {\n "+Object(r.o)("transform","translate(50px, 50px) rotate("+B+"deg)").join("\n")+"\n }\n to {\n "+Object(r.o)("transform","translate(50px, 50px) rotate("+(B+360)+"deg)").join("\n")+"\n }\n }\n @keyframes rotate-second {\n from {\n "+Object(r.o)("transform","translate(50px, 50px) rotate("+z+"deg)").join("\n")+"\n }\n to {\n "+Object(r.o)("transform","translate(50px, 50px) rotate("+(z+360)+"deg)").join("\n")+"\n }\n }\n </style>\n ",p.append(_),"datetime"===this.props.clockFormat){var H=document.createElement("span");H.className="date",H.textContent=Object(r.e)(I,"default"),H.style.fontSize=h+"px",this.props.color&&(H.style.color=this.props.color),p.append(H)}return p},e.prototype.createDigitalClock=function(){var t=document.createElement("div");t.className="digital-clock";var e=this.getElementSize().width,n=6/this.props.clockTimezone.length,i=20*e/100,s=10*e/100,o=Math.min(20*n*e/100,e/100*10),a=this.getOriginDate();if("datetime"===this.props.clockFormat){var c=document.createElement("span");c.className="date",c.textContent=Object(r.e)(a,"default"),c.style.fontSize=s+"px",this.props.color&&(c.style.color=this.props.color),t.append(c)}var l=document.createElement("span");l.className="time",l.textContent=Object(r.f)(a),l.style.fontSize=i+"px",this.props.color&&(l.style.color=this.props.color),t.append(l);var u=this.getHumanTimezone();if(u.length>0){var h=document.createElement("span");h.className="timezone",h.textContent=u,h.style.fontSize=o+"px",this.props.color&&(h.style.color=this.props.color),t.append(h)}return t},e.prototype.getOriginDate=function(t){void 0===t&&(t=null);var e=t||new Date,n=1e3*this.props.clockTimezoneOffset,i=60*e.getTimezoneOffset()*1e3,r=e.getTime()+n+i;return new Date(r)},e.prototype.getHumanTimezone=function(t){void 0===t&&(t=this.props.clockTimezone);var e=t.split("/")[1];return(void 0===e?"":e).replace("_"," ")},e.prototype.getElementSize=function(t,e){switch(void 0===t&&(t=this.props.width),void 0===e&&(e=this.props.height),this.props.clockType){case"analogic":var n=100;return t>0&&e>0?n=Math.min(t,e):t>0?n=t:e>0&&(n=e),{width:n,height:n};case"digital":return t>0&&e>0?e=t/2<e?t/2:e:t>0?e=t/2:e>0?t=2*e:(t=100,e=50),{width:t,height:e};default:throw new Error("invalid clock type.")}},e.TICK_INTERVAL=1e3,e}(s.a),P=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),S=function(){return(S=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function L(t){return S({},Object(s.b)(t),{type:12,label:null,isLinkEnabled:!1,parentId:null,aclGroupId:null,borderWidth:Object(r.m)(t.borderWidth,0),borderColor:Object(r.j)(t.borderColor,null),fillColor:Object(r.j)(t.fillColor,null)})}var R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");if(t.className="box",t.style.boxSizing="border-box",this.props.fillColor&&(t.style.backgroundColor=this.props.fillColor),this.props.borderWidth>0){t.style.borderStyle="solid";var e=Math.min(this.props.width,this.props.height)/2,n=Math.min(this.props.borderWidth,e);t.style.borderWidth=n+"px",this.props.borderColor&&(t.style.borderColor=this.props.borderColor)}return t},e}(s.a),N=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),I=function(){return(I=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function D(t){var e=I({},Object(s.b)(I({},t,{width:1,height:1})),{type:13,label:null,isLinkEnabled:!1,parentId:null,aclGroupId:null,x:0,y:0,width:0,height:0,startPosition:{x:Object(r.m)(t.startX,0),y:Object(r.m)(t.startY,0)},endPosition:{x:Object(r.m)(t.endX,0),y:Object(r.m)(t.endY,0)},lineWidth:Object(r.m)(t.lineWidth||t.borderWidth,1),color:Object(r.j)(t.borderColor||t.color,null)});return I({},e,C.extractBoxSizeAndPosition(e))}var C=function(t){function e(n,i){return t.call(this,I({},n,e.extractBoxSizeAndPosition(n)),I({},i,{editMode:!1}))||this}return N(e,t),e.prototype.setMeta=function(e){t.prototype.setMeta.call(this,I({},e,{editMode:!1}))},e.prototype.createDomElement=function(){var t=document.createElement("div");t.className="line";var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");n.setAttribute("width",(this.props.width+this.props.lineWidth).toString()),n.setAttribute("height",(this.props.height+this.props.lineWidth).toString());var i=document.createElementNS(e,"line");return i.setAttribute("x1",""+(this.props.startPosition.x-this.props.x+this.props.lineWidth/2)),i.setAttribute("y1",""+(this.props.startPosition.y-this.props.y+this.props.lineWidth/2)),i.setAttribute("x2",""+(this.props.endPosition.x-this.props.x+this.props.lineWidth/2)),i.setAttribute("y2",""+(this.props.endPosition.y-this.props.y+this.props.lineWidth/2)),i.setAttribute("stroke",this.props.color||"black"),i.setAttribute("stroke-width",this.props.lineWidth.toString()),n.append(i),t.append(n),t},e.extractBoxSizeAndPosition=function(t){return{width:Math.abs(t.startPosition.x-t.endPosition.x),height:Math.abs(t.startPosition.y-t.endPosition.y),x:Math.min(t.startPosition.x,t.endPosition.x),y:Math.min(t.startPosition.y,t.endPosition.y)}},e}(s.a),z=C,B=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),W=function(){return(W=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function H(t){return W({},Object(s.b)(t),{type:4},Object(r.h)(t))}var U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return B(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="label",t.innerHTML=this.getLabelWithMacrosReplaced(),t},e.prototype.createLabelDomElement=function(){var t=document.createElement("div");return t.className="visual-console-item-label",t},e}(s.a),K=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),G=function(){return(G=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},q=function(t){switch(t){case"string":case"image":return t;default:return"string"}},F=function(t){switch(t){case"none":case"avg":case"max":case"min":return t;default:return"none"}};function V(t){if("string"!=typeof t.value||0===t.value.length)throw new TypeError("invalid value");var e=F(t.processValue);return G({},Object(s.b)(t),{type:2,valueType:q(t.valueType),value:t.value},"none"===e?{processValue:e}:{processValue:e,period:Object(r.m)(t.period,0)},Object(r.i)(t),Object(r.h)(t))}var X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return K(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");if(t.className="simple-value","image"===this.props.valueType){var e=document.createElement("img");e.src=this.props.value,t.append(e)}else{var n=this.props.value,i=this.getLabelWithMacrosReplaced();i.length>0&&(n=Object(r.p)([{macro:/\(?_VALUE_\)?/i,value:n}],i)),t.innerHTML=n}return t},e.prototype.createLabelDomElement=function(){var t=document.createElement("div");return t.className="visual-console-item-label",t},e}(s.a),Y=n(3),Z=Math.PI,Q=2*Z,J=Q-1e-6;function $(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function tt(){return new $}$.prototype=tt.prototype={constructor:$,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,s){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var s=this._x1,o=this._y1,a=n-t,c=i-e,l=s-t,u=o-e,h=l*l+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>1e-6)if(Math.abs(u*a-c*l)>1e-6&&r){var p=n-s,_=i-o,f=a*a+c*c,d=p*p+_*_,m=Math.sqrt(f),y=Math.sqrt(h),b=r*Math.tan((Z-Math.acos((f+h-d)/(2*m*y)))/2),v=b/y,g=b/m;Math.abs(v-1)>1e-6&&(this._+="L"+(t+v*l)+","+(e+v*u)),this._+="A"+r+","+r+",0,0,"+ +(u*p>l*_)+","+(this._x1=t+g*a)+","+(this._y1=e+g*c)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,s){t=+t,e=+e;var o=(n=+n)*Math.cos(i),a=n*Math.sin(i),c=t+o,l=e+a,u=1^s,h=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+c+","+l:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+c+","+l),n&&(h<0&&(h=h%Q+Q),h>J?this._+="A"+n+","+n+",0,1,"+u+","+(t-o)+","+(e-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=c)+","+(this._y1=l):h>1e-6&&(this._+="A"+n+","+n+",0,"+ +(h>=Z)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var et=tt,nt=function(t){return function(){return t}},it=Math.abs,rt=Math.atan2,st=Math.cos,ot=Math.max,at=Math.min,ct=Math.sin,lt=Math.sqrt,ut=1e-12,ht=Math.PI,pt=ht/2,_t=2*ht;function ft(t){return t>=1?pt:t<=-1?-pt:Math.asin(t)}function dt(t){return t.innerRadius}function mt(t){return t.outerRadius}function yt(t){return t.startAngle}function bt(t){return t.endAngle}function vt(t){return t&&t.padAngle}function gt(t,e,n,i,r,s,o){var a=t-n,c=e-i,l=(o?s:-s)/lt(a*a+c*c),u=l*c,h=-l*a,p=t+u,_=e+h,f=n+u,d=i+h,m=(p+f)/2,y=(_+d)/2,b=f-p,v=d-_,g=b*b+v*v,x=r-s,E=p*d-f*_,w=(v<0?-1:1)*lt(ot(0,x*x*g-E*E)),O=(E*v-b*w)/g,T=(-E*b-v*w)/g,A=(E*v+b*w)/g,k=(-E*b+v*w)/g,M=O-m,j=T-y,P=A-m,S=k-y;return M*M+j*j>P*P+S*S&&(O=A,T=k),{cx:O,cy:T,x01:-u,y01:-h,x11:O*(r/x-1),y11:T*(r/x-1)}}var xt=function(){var t=dt,e=mt,n=nt(0),i=null,r=yt,s=bt,o=vt,a=null;function c(){var c,l,u,h=+t.apply(this,arguments),p=+e.apply(this,arguments),_=r.apply(this,arguments)-pt,f=s.apply(this,arguments)-pt,d=it(f-_),m=f>_;if(a||(a=c=et()),p<h&&(l=p,p=h,h=l),p>ut)if(d>_t-ut)a.moveTo(p*st(_),p*ct(_)),a.arc(0,0,p,_,f,!m),h>ut&&(a.moveTo(h*st(f),h*ct(f)),a.arc(0,0,h,f,_,m));else{var y,b,v=_,g=f,x=_,E=f,w=d,O=d,T=o.apply(this,arguments)/2,A=T>ut&&(i?+i.apply(this,arguments):lt(h*h+p*p)),k=at(it(p-h)/2,+n.apply(this,arguments)),M=k,j=k;if(A>ut){var P=ft(A/h*ct(T)),S=ft(A/p*ct(T));(w-=2*P)>ut?(x+=P*=m?1:-1,E-=P):(w=0,x=E=(_+f)/2),(O-=2*S)>ut?(v+=S*=m?1:-1,g-=S):(O=0,v=g=(_+f)/2)}var L=p*st(v),R=p*ct(v),N=h*st(E),I=h*ct(E);if(k>ut){var D,C=p*st(g),z=p*ct(g),B=h*st(x),W=h*ct(x);if(d<ht&&(D=function(t,e,n,i,r,s,o,a){var c=n-t,l=i-e,u=o-r,h=a-s,p=h*c-u*l;if(!(p*p<ut))return[t+(p=(u*(e-s)-h*(t-r))/p)*c,e+p*l]}(L,R,B,W,C,z,N,I))){var H=L-D[0],U=R-D[1],K=C-D[0],G=z-D[1],q=1/ct(((u=(H*K+U*G)/(lt(H*H+U*U)*lt(K*K+G*G)))>1?0:u<-1?ht:Math.acos(u))/2),F=lt(D[0]*D[0]+D[1]*D[1]);M=at(k,(h-F)/(q-1)),j=at(k,(p-F)/(q+1))}}O>ut?j>ut?(y=gt(B,W,L,R,p,j,m),b=gt(C,z,N,I,p,j,m),a.moveTo(y.cx+y.x01,y.cy+y.y01),j<k?a.arc(y.cx,y.cy,j,rt(y.y01,y.x01),rt(b.y01,b.x01),!m):(a.arc(y.cx,y.cy,j,rt(y.y01,y.x01),rt(y.y11,y.x11),!m),a.arc(0,0,p,rt(y.cy+y.y11,y.cx+y.x11),rt(b.cy+b.y11,b.cx+b.x11),!m),a.arc(b.cx,b.cy,j,rt(b.y11,b.x11),rt(b.y01,b.x01),!m))):(a.moveTo(L,R),a.arc(0,0,p,v,g,!m)):a.moveTo(L,R),h>ut&&w>ut?M>ut?(y=gt(N,I,C,z,h,-M,m),b=gt(L,R,B,W,h,-M,m),a.lineTo(y.cx+y.x01,y.cy+y.y01),M<k?a.arc(y.cx,y.cy,M,rt(y.y01,y.x01),rt(b.y01,b.x01),!m):(a.arc(y.cx,y.cy,M,rt(y.y01,y.x01),rt(y.y11,y.x11),!m),a.arc(0,0,h,rt(y.cy+y.y11,y.cx+y.x11),rt(b.cy+b.y11,b.cx+b.x11),m),a.arc(b.cx,b.cy,M,rt(b.y11,b.x11),rt(b.y01,b.x01),!m))):a.arc(0,0,h,E,x,m):a.lineTo(N,I)}else a.moveTo(0,0);if(a.closePath(),c)return a=null,c+""||null}return c.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-ht/2;return[st(i)*n,ct(i)*n]},c.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:nt(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:nt(+t),c):e},c.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:nt(+t),c):n},c.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:nt(+t),c):i},c.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:nt(+t),c):r},c.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:nt(+t),c):s},c.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:nt(+t),c):o},c.context=function(t){return arguments.length?(a=null==t?null:t,c):a},c};function Et(t){this._context=t}Et.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var wt=function(t){return new Et(t)};Tt(wt);function Ot(t){this._curve=t}function Tt(t){function e(e){return new Ot(t(e))}return e._curve=t,e}Ot.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};Array.prototype.slice;Math.sqrt(1/3);var At=Math.sin(ht/10)/Math.sin(7*ht/10),kt=(Math.sin(_t/10),Math.cos(_t/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12),function(){});function Mt(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function jt(t){this._context=t}jt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Mt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Mt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pt(t){this._context=t}Pt.prototype={areaStart:kt,areaEnd:kt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Mt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function St(t){this._context=t}St.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Mt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Lt(t,e){this._basis=new jt(t),this._beta=e}Lt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],s=e[0],o=t[n]-r,a=e[n]-s,c=-1;++c<=n;)i=c/n,this._basis.point(this._beta*t[c]+(1-this._beta)*(r+i*o),this._beta*e[c]+(1-this._beta)*(s+i*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};(function t(e){function n(t){return 1===e?new jt(t):new Lt(t,e)}return n.beta=function(e){return t(+e)},n})(.85);function Rt(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Nt(t,e){this._context=t,this._k=(1-e)/6}Nt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Rt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Rt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new Nt(t,e)}return n.tension=function(e){return t(+e)},n})(0);function It(t,e){this._context=t,this._k=(1-e)/6}It.prototype={areaStart:kt,areaEnd:kt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Rt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new It(t,e)}return n.tension=function(e){return t(+e)},n})(0);function Dt(t,e){this._context=t,this._k=(1-e)/6}Dt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Rt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new Dt(t,e)}return n.tension=function(e){return t(+e)},n})(0);function Ct(t,e,n){var i=t._x1,r=t._y1,s=t._x2,o=t._y2;if(t._l01_a>ut){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>ut){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*l+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,s,o,t._x2,t._y2)}function zt(t,e){this._context=t,this._alpha=e}zt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Ct(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new zt(t,e):new Nt(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function Bt(t,e){this._context=t,this._alpha=e}Bt.prototype={areaStart:kt,areaEnd:kt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ct(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new Bt(t,e):new It(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function Wt(t,e){this._context=t,this._alpha=e}Wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ct(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new Wt(t,e):new Dt(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function Ht(t){this._context=t}Ht.prototype={areaStart:kt,areaEnd:kt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Ut(t){return t<0?-1:1}function Kt(t,e,n){var i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||r<0&&-0),o=(n-t._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(Ut(s)+Ut(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function Gt(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function qt(t,e,n){var i=t._x0,r=t._y0,s=t._x1,o=t._y1,a=(s-i)/3;t._context.bezierCurveTo(i+a,r+a*e,s-a,o-a*n,s,o)}function Ft(t){this._context=t}function Vt(t){this._context=new Xt(t)}function Xt(t){this._context=t}function Yt(t){this._context=t}function Zt(t){var e,n,i=t.length-1,r=new Array(i),s=new Array(i),o=new Array(i);for(r[0]=0,s[0]=2,o[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,s[e]=4,o[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,s[i-1]=7,o[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/s[e-1],s[e]-=n,o[e]-=n*o[e-1];for(r[i-1]=o[i-1]/s[i-1],e=i-2;e>=0;--e)r[e]=(o[e]-r[e+1])/s[e];for(s[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)s[e]=2*t[e+1]-r[e+1];return[r,s]}Ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:qt(this,this._t0,Gt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,qt(this,Gt(this,n=Kt(this,t,e)),n);break;default:qt(this,this._t0,n=Kt(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Vt.prototype=Object.create(Ft.prototype)).point=function(t,e){Ft.prototype.point.call(this,e,t)},Xt.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,s){this._context.bezierCurveTo(e,t,i,n,s,r)}},Yt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=Zt(t),r=Zt(e),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],t[o],e[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function Qt(t,e){this._context=t,this._t=e}Qt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Jt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),$t=function(){return($t=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function te(t){switch(t){case"progress-bar":case"bubble":case"circular-progress-bar":case"circular-progress-bar-alt":return t;default:case 3:return"progress-bar";case 9:return"bubble";case 15:return"circular-progress-bar";case 16:return"circular-progress-bar-alt"}}function ee(t){switch(t){case"percent":case"value":return t;default:return"percent"}}function ne(t){return $t({},Object(s.b)(t),{type:3,percentileType:te(t.percentileType||t.type),valueType:ee(t.valueType),minValue:Object(r.m)(t.minValue,null),maxValue:Object(r.m)(t.maxValue,null),color:Object(r.j)(t.color,null),labelColor:Object(r.j)(t.labelColor,null),value:Object(r.l)(t.value,null),unit:Object(r.j)(t.unit,null)},Object(r.i)(t),Object(r.h)(t))}var ie="http://www.w3.org/2000/svg",re=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Jt(e,t),e.prototype.createDomElement=function(){var t,e={background:"#000000",progress:this.props.color||"#F0F0F0",text:this.props.labelColor||"#444444"},n=this.getProgress(),i=document.createElement("div"),r=document.createElementNS(ie,"svg");switch(null!=this.props.value&&(t=Intl?Intl.NumberFormat("en-EN").format(this.props.value):this.props.value),this.props.percentileType){case"progress-bar":var s=document.createElementNS(ie,"rect");s.setAttribute("fill",e.background),s.setAttribute("fill-opacity","0.5"),s.setAttribute("width","100"),s.setAttribute("height","20"),s.setAttribute("rx","5"),s.setAttribute("ry","5");var o=document.createElementNS(ie,"rect");o.setAttribute("fill",e.progress),o.setAttribute("fill-opacity","1"),o.setAttribute("width",""+n),o.setAttribute("height","20"),o.setAttribute("rx","5"),o.setAttribute("ry","5"),(h=document.createElementNS(ie,"text")).setAttribute("text-anchor","middle"),h.setAttribute("alignment-baseline","middle"),h.setAttribute("font-size","12"),h.setAttribute("font-family","arial"),h.setAttribute("font-weight","bold"),h.setAttribute("transform","translate(50 11)"),h.setAttribute("fill",e.text),"value"===this.props.valueType?(h.style.fontSize="6pt",h.textContent=this.props.unit?t+" "+this.props.unit:""+t):h.textContent=n+"%",r.setAttribute("viewBox","0 0 100 20"),r.append(s,o,h);break;case"bubble":case"circular-progress-bar":case"circular-progress-bar-alt":if(r.setAttribute("viewBox","0 0 100 100"),"bubble"===this.props.percentileType){(a=document.createElementNS(ie,"circle")).setAttribute("transform","translate(50 50)"),a.setAttribute("fill",e.background),a.setAttribute("fill-opacity","0.5"),a.setAttribute("r","50"),(c=document.createElementNS(ie,"circle")).setAttribute("transform","translate(50 50)"),c.setAttribute("fill",e.progress),c.setAttribute("fill-opacity","1"),c.setAttribute("r",""+n/2),r.append(a,c)}else{var a,c,l={innerRadius:"circular-progress-bar"===this.props.percentileType?30:0,outerRadius:50,startAngle:0,endAngle:2*Math.PI},u=xt();(a=document.createElementNS(ie,"path")).setAttribute("transform","translate(50 50)"),a.setAttribute("fill",e.background),a.setAttribute("fill-opacity","0.5"),a.setAttribute("d",""+u(l)),(c=document.createElementNS(ie,"path")).setAttribute("transform","translate(50 50)"),c.setAttribute("fill",e.progress),c.setAttribute("fill-opacity","1"),c.setAttribute("d",""+u($t({},l,{endAngle:l.endAngle*(n/100)}))),r.append(a,c)}var h;if((h=document.createElementNS(ie,"text")).setAttribute("text-anchor","middle"),h.setAttribute("alignment-baseline","middle"),h.setAttribute("font-size","16"),h.setAttribute("font-family","arial"),h.setAttribute("font-weight","bold"),h.setAttribute("fill",e.text),"value"===this.props.valueType&&null!=this.props.value)if(this.props.unit&&this.props.unit.length>0){var p=document.createElementNS(ie,"tspan");p.setAttribute("x","0"),p.setAttribute("dy","1em"),p.textContent=""+t,p.style.fontSize="8pt";var _=document.createElementNS(ie,"tspan");_.setAttribute("x","0"),_.setAttribute("dy","1em"),_.textContent=""+this.props.unit,_.style.fontSize="8pt",h.append(p,_),h.setAttribute("transform","translate(50 33)")}else h.textContent=""+t,h.style.fontSize="8pt",h.setAttribute("transform","translate(50 50)");else h.textContent=n+"%",h.setAttribute("transform","translate(50 50)");r.append(h)}return i.append(r),i},e.prototype.getProgress=function(){var t=this.props.minValue||0,e=this.props.maxValue||100,n=null==this.props.value?0:this.props.value;return n<=t?0:n>=e?100:Math.trunc((n-t)/(e-t)*100)},e}(s.a),se=n(2),oe=n(4),ae=n(5),ce=n(6),le=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ue=function(){return(ue=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function he(t){if(null!==t.imageSrc){if("string"!=typeof t.statusImageSrc||0===t.imageSrc.statusImageSrc)throw new TypeError("invalid status image src.")}else if(Object(r.r)(t.encodedTitle))throw new TypeError("missing encode tittle content.");if(null===Object(r.m)(t.serviceId,null))throw new TypeError("invalid service id.");return ue({},Object(s.b)(t),{type:10,serviceId:t.serviceId,imageSrc:Object(r.j)(t.imageSrc,null),statusImageSrc:Object(r.j)(t.statusImageSrc,null),encodedTitle:Object(r.j)(t.encodedTitle,null)})}var pe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return le(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="service",null!==this.props.statusImageSrc?(t.style.background="url("+this.props.statusImageSrc+") no-repeat",t.style.backgroundSize="contain",t.style.backgroundPosition="center"):null!==this.props.encodedTitle&&(t.innerHTML=Object(r.d)(this.props.encodedTitle)),t},e}(s.a),_e=function(){return(_e=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function fe(t){var e=Object(r.m)(t.type,null);if(null==e)throw new TypeError("missing item type.");var n=Object(r.g)(t);switch(e){case 0:return new u(l(t),n);case 1:return new ce.a(Object(ce.b)(t),n);case 2:case 6:case 7:case 8:return new X(V(t),n);case 3:case 9:case 15:case 16:return new re(ne(t),n);case 4:return new U(H(t),n);case 5:return new f(_(t),n);case 10:return new pe(he(t),n);case 11:return new w(E(t),n);case 12:return new R(L(t),n);case 13:return new z(D(t),n);case 14:return new Y.a(Object(Y.b)(t),n);case 17:return new oe.a(Object(oe.b)(t),n);case 18:return new ae.b(Object(ae.a)(t),n);case 19:return new j(M(t),n);case 20:return new v(y(t),n);default:throw new TypeError("item not found")}}var de=function(){function t(t,e,n){var i=this;this.elementsById={},this.elementIds=[],this.relations={},this.clickEventManager=new se.a,this.movedEventManager=new se.a,this.resizedEventManager=new se.a,this.disposables=[],this.handleElementClick=function(t){i.clickEventManager.emit(t)},this.handleElementMovement=function(t){i.movedEventManager.emit(t)},this.handleElementResizement=function(t){i.resizedEventManager.emit(t)},this.handleElementRemove=function(t){i.elementIds=i.elementIds.filter(function(e){return e!==t.data.id}),delete i.elementsById[t.data.id],i.clearRelations(t.data.id)},this.containerRef=t,this._props=function(t){var e=t.id,n=t.name,i=t.groupId,s=t.backgroundURL,o=t.backgroundColor,a=t.isFavorite,c=t.relationLineWidth;if(null==e||isNaN(parseInt(e)))throw new TypeError("invalid Id.");if("string"!=typeof n||0===n.length)throw new TypeError("invalid name.");if(null==i||isNaN(parseInt(i)))throw new TypeError("invalid group Id.");return _e({id:parseInt(e),name:n,groupId:parseInt(i),backgroundURL:Object(r.j)(s,null),backgroundColor:Object(r.j)(o,null),isFavorite:Object(r.k)(a),relationLineWidth:Object(r.m)(c,0)},Object(r.q)(t))}(e),this.render(),(n=n.sort(function(t,e){return null==t.isOnTop||null==e.isOnTop||null==t.id||null==e.id?0:t.isOnTop&&!e.isOnTop?1:!t.isOnTop&&e.isOnTop?-1:t.id>e.id?1:-1})).forEach(function(t){try{var e=fe(t);i.elementsById[e.props.id]=e,i.elementIds.push(e.props.id),e.onClick(i.handleElementClick),e.onMoved(i.handleElementMovement),e.onResized(i.handleElementResizement),e.onRemove(i.handleElementRemove),i.containerRef.append(e.elementRef)}catch(t){console.log("Error creating a new element:",t.message)}}),this.buildRelations()}return Object.defineProperty(t.prototype,"elements",{get:function(){var t=this;return this.elementIds.map(function(e){return t.elementsById[e]}).filter(function(t){return null!=t})},enumerable:!0,configurable:!0}),t.prototype.updateElements=function(t){var e=this,n=t.map(function(t){return t.id||null}).filter(function(t){return null!=t});this.elementIds.filter(function(t){return n.indexOf(t)<0}).forEach(function(t){null!=e.elementsById[t]&&(e.elementsById[t].remove(),delete e.elementsById[t])}),this.elementIds=n,t.forEach(function(t){if(t.id)if(null==e.elementsById[t.id])try{var n=fe(t);e.elementsById[n.props.id]=n,n.onClick(e.handleElementClick),n.onRemove(e.handleElementRemove),e.containerRef.append(n.elementRef)}catch(t){console.log("Error creating a new element:",t.message)}else try{e.elementsById[t.id].props=function(t){var e=Object(r.m)(t.type,null);if(null==e)throw new TypeError("missing item type.");switch(e){case 0:return l(t);case 1:return Object(ce.b)(t);case 2:case 6:case 7:case 8:return V(t);case 3:case 9:case 15:case 16:return ne(t);case 4:return H(t);case 5:return _(t);case 10:return he(t);case 11:return E(t);case 12:return L(t);case 13:return D(t);case 14:return Object(Y.b)(t);case 17:return Object(oe.b)(t);case 18:return Object(ae.a)(t);case 19:return M(t);case 20:return y(t);default:throw new TypeError("decoder not found")}}(t)}catch(t){console.log("Error updating an element:",t.message)}}),this.buildRelations()},Object.defineProperty(t.prototype,"props",{get:function(){return _e({},this._props)},set:function(t){var e=this.props;this._props=t,this.render(e)},enumerable:!0,configurable:!0}),t.prototype.render=function(t){void 0===t&&(t=null),t?(t.backgroundURL!==this.props.backgroundURL&&(this.containerRef.style.backgroundImage=null!==this.props.backgroundURL?"url("+this.props.backgroundURL+")":null),t.backgroundColor!==this.props.backgroundColor&&(this.containerRef.style.backgroundColor=this.props.backgroundColor),this.sizeChanged(t,this.props)&&this.resizeElement(this.props.width,this.props.height)):(this.containerRef.style.backgroundImage=null!==this.props.backgroundURL?"url("+this.props.backgroundURL+")":null,this.containerRef.style.backgroundColor=this.props.backgroundColor,this.resizeElement(this.props.width,this.props.height))},t.prototype.sizeChanged=function(t,e){return t.width!==e.width||t.height!==e.height},t.prototype.resizeElement=function(t,e){this.containerRef.style.width=t+"px",this.containerRef.style.height=e+"px"},t.prototype.resize=function(t,e){this.props=_e({},this.props,{width:t,height:e})},t.prototype.remove=function(){this.disposables.forEach(function(t){return t.dispose()}),this.elements.forEach(function(t){return t.remove()}),this.elementsById={},this.elementIds=[],this.clearRelations(),this.containerRef.innerHTML=""},t.prototype.buildRelations=function(){var t=this;this.clearRelations(),this.elements.forEach(function(e){if(null!==e.props.parentId){var n=t.elementsById[e.props.parentId],i=t.elementsById[e.props.id];n&&i&&t.addRelationLine(n,i)}})},t.prototype.clearRelations=function(t){if(null!=t)for(var e in this.relations){var n=e.split("|"),i=Number.parseInt(n[0]),r=Number.parseInt(n[1]);t!==i&&t!==r||(this.relations[e].remove(),delete this.relations[e])}else for(var e in this.relations)this.relations[e].remove(),delete this.relations[e]},t.prototype.getRelationLine=function(t,e){var n=t+"|"+e;return this.relations[n]||null},t.prototype.addRelationLine=function(t,e){var n=t.props.id+"|"+e.props.id;null!=this.relations[n]&&this.relations[n].remove();var i=t.props.x+t.elementRef.clientWidth/2,s=t.props.y+(t.elementRef.clientHeight-t.labelElementRef.clientHeight)/2,o=e.props.x+e.elementRef.clientWidth/2,a=e.props.y+(e.elementRef.clientHeight-e.labelElementRef.clientHeight)/2,c=new z(D({id:0,type:13,startX:i,startY:s,endX:o,endY:a,width:0,height:0,lineWidth:this.props.relationLineWidth,color:"#CCCCCC"}),Object(r.g)({receivedAt:new Date}));return this.relations[n]=c,c.elementRef.style.zIndex="0",this.containerRef.append(c.elementRef),c},t.prototype.onItemClick=function(t){var e=this.clickEventManager.on(t);return this.disposables.push(e),e},t.prototype.onItemMoved=function(t){var e=this.movedEventManager.on(t);return this.disposables.push(e),e},t.prototype.onItemResized=function(t){var e=this.resizedEventManager.on(t);return this.disposables.push(e),e},t.prototype.enableEditMode=function(){this.elements.forEach(function(t){t.meta=_e({},t.meta,{editMode:!0})}),this.containerRef.classList.add("is-editing")},t.prototype.disableEditMode=function(){this.elements.forEach(function(t){t.meta=_e({},t.meta,{editMode:!1})}),this.containerRef.classList.remove("is-editing")},t}(),me=function(){function t(t){this.cancellable={cancel:function(){}},this._status="waiting",this.statusChangeEventManager=new se.a,this.disposables=[],this.taskInitiator=t}return Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(t){this._status=t,this.statusChangeEventManager.emit(t)},enumerable:!0,configurable:!0}),t.prototype.init=function(){var t=this;this.cancellable=this.taskInitiator(function(){t.status="finished"}),this.status="started"},t.prototype.cancel=function(){this.cancellable.cancel(),this.status="cancelled"},t.prototype.onStatusChange=function(t){var e=this.statusChangeEventManager.on(t);return this.disposables.push(e),e},t}();var ye=function(){function t(){this.tasks={}}return t.prototype.add=function(t,e,n){void 0===n&&(n=0),this.tasks[t]&&"started"===this.tasks[t].status&&this.tasks[t].cancel();var i=n>0?function(t,e){return new me(function(){var n=null;return t.onStatusChange(function(i){"finished"===i&&(n=window.setTimeout(function(){t.init()},e))}),t.init(),{cancel:function(){n&&clearTimeout(n),t.cancel()}}})}(new me(e),n):new me(e);return this.tasks[t]=i,this.tasks[t]},t.prototype.init=function(t){!this.tasks[t]||"waiting"!==this.tasks[t].status&&"cancelled"!==this.tasks[t].status&&"finished"!==this.tasks[t].status||this.tasks[t].init()},t.prototype.cancel=function(t){this.tasks[t]&&"started"===this.tasks[t].status&&this.tasks[t].cancel()},t}();window.VisualConsole=de,window.AsyncTaskManager=ye}]);
//# sourceMappingURL=vc.main.min.js.map