diff --git a/dist/bundle.js b/dist/bundle.js index f9f80913cafe377fba580e6db5fb0de32bd9b82d..f4f0b8a2c8f618f980f9083f06990d7f21bb0c0e 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1,2 +1,2 @@ /*! For license information please see bundle.js.LICENSE.txt */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["dashboard-sdk"]=e():t["dashboard-sdk"]=e()}(self,(()=>(()=>{"use strict";var t={744:(t,e,n)=>{n.d(e,{Z:()=>d});var i=n(81),r=n.n(i),o=n(645),s=n.n(o),a=n(667),l=n.n(a),u=new URL(n(810),n.b),c=s()(r()),h=l()(u);c.push([t.id,":root .grid-stack-item>.ui-resizable-handle{filter:none}.grid-stack{position:relative}.grid-stack.grid-stack-rtl{direction:ltr}.grid-stack.grid-stack-rtl>.grid-stack-item{direction:rtl}.grid-stack .grid-stack-placeholder>.placeholder-content{background-color:rgba(0,0,0,0.1);margin:0;position:absolute;width:auto;z-index:0 !important;text-align:center}.grid-stack>.grid-stack-item{min-width:8.3333333333%;position:absolute;padding:0}.grid-stack>.grid-stack-item>.grid-stack-item-content{margin:0;position:absolute;width:auto;overflow-x:hidden;overflow-y:auto}.grid-stack>.grid-stack-item>.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.grid-stack>.grid-stack-item.ui-resizable-autohide>.ui-resizable-handle,.grid-stack>.grid-stack-item.ui-resizable-disabled>.ui-resizable-handle{display:none}.grid-stack>.grid-stack-item>.ui-resizable-se,.grid-stack>.grid-stack-item>.ui-resizable-sw{background-image:url("+h+');background-repeat:no-repeat;background-position:center;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.grid-stack>.grid-stack-item>.ui-resizable-se{-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.grid-stack>.grid-stack-item>.ui-resizable-nw{cursor:nw-resize;width:20px;height:20px;top:0}.grid-stack>.grid-stack-item>.ui-resizable-n{cursor:n-resize;height:10px;top:0;left:25px;right:25px}.grid-stack>.grid-stack-item>.ui-resizable-ne{cursor:ne-resize;width:20px;height:20px;top:0}.grid-stack>.grid-stack-item>.ui-resizable-e{cursor:e-resize;width:10px;top:15px;bottom:15px}.grid-stack>.grid-stack-item>.ui-resizable-se{cursor:se-resize;width:20px;height:20px}.grid-stack>.grid-stack-item>.ui-resizable-s{cursor:s-resize;height:10px;left:25px;bottom:0;right:25px}.grid-stack>.grid-stack-item>.ui-resizable-sw{cursor:sw-resize;width:20px;height:20px}.grid-stack>.grid-stack-item>.ui-resizable-w{cursor:w-resize;width:10px;top:15px;bottom:15px}.grid-stack>.grid-stack-item.ui-draggable-dragging>.ui-resizable-handle{display:none !important}.grid-stack>.grid-stack-item[gs-w="0"]{width:0%}.grid-stack>.grid-stack-item[gs-x="0"]{left:0}.grid-stack>.grid-stack-item[gs-min-w="0"]{min-width:0}.grid-stack>.grid-stack-item[gs-max-w="0"]{max-width:0%}.grid-stack>.grid-stack-item[gs-w="1"]{width:8.3333333333%}.grid-stack>.grid-stack-item[gs-x="1"]{left:8.3333333333%}.grid-stack>.grid-stack-item[gs-min-w="1"]{min-width:8.3333333333%}.grid-stack>.grid-stack-item[gs-max-w="1"]{max-width:8.3333333333%}.grid-stack>.grid-stack-item[gs-w="2"]{width:16.6666666667%}.grid-stack>.grid-stack-item[gs-x="2"]{left:16.6666666667%}.grid-stack>.grid-stack-item[gs-min-w="2"]{min-width:16.6666666667%}.grid-stack>.grid-stack-item[gs-max-w="2"]{max-width:16.6666666667%}.grid-stack>.grid-stack-item[gs-w="3"]{width:25%}.grid-stack>.grid-stack-item[gs-x="3"]{left:25%}.grid-stack>.grid-stack-item[gs-min-w="3"]{min-width:25%}.grid-stack>.grid-stack-item[gs-max-w="3"]{max-width:25%}.grid-stack>.grid-stack-item[gs-w="4"]{width:33.3333333333%}.grid-stack>.grid-stack-item[gs-x="4"]{left:33.3333333333%}.grid-stack>.grid-stack-item[gs-min-w="4"]{min-width:33.3333333333%}.grid-stack>.grid-stack-item[gs-max-w="4"]{max-width:33.3333333333%}.grid-stack>.grid-stack-item[gs-w="5"]{width:41.6666666667%}.grid-stack>.grid-stack-item[gs-x="5"]{left:41.6666666667%}.grid-stack>.grid-stack-item[gs-min-w="5"]{min-width:41.6666666667%}.grid-stack>.grid-stack-item[gs-max-w="5"]{max-width:41.6666666667%}.grid-stack>.grid-stack-item[gs-w="6"]{width:50%}.grid-stack>.grid-stack-item[gs-x="6"]{left:50%}.grid-stack>.grid-stack-item[gs-min-w="6"]{min-width:50%}.grid-stack>.grid-stack-item[gs-max-w="6"]{max-width:50%}.grid-stack>.grid-stack-item[gs-w="7"]{width:58.3333333333%}.grid-stack>.grid-stack-item[gs-x="7"]{left:58.3333333333%}.grid-stack>.grid-stack-item[gs-min-w="7"]{min-width:58.3333333333%}.grid-stack>.grid-stack-item[gs-max-w="7"]{max-width:58.3333333333%}.grid-stack>.grid-stack-item[gs-w="8"]{width:66.6666666667%}.grid-stack>.grid-stack-item[gs-x="8"]{left:66.6666666667%}.grid-stack>.grid-stack-item[gs-min-w="8"]{min-width:66.6666666667%}.grid-stack>.grid-stack-item[gs-max-w="8"]{max-width:66.6666666667%}.grid-stack>.grid-stack-item[gs-w="9"]{width:75%}.grid-stack>.grid-stack-item[gs-x="9"]{left:75%}.grid-stack>.grid-stack-item[gs-min-w="9"]{min-width:75%}.grid-stack>.grid-stack-item[gs-max-w="9"]{max-width:75%}.grid-stack>.grid-stack-item[gs-w="10"]{width:83.3333333333%}.grid-stack>.grid-stack-item[gs-x="10"]{left:83.3333333333%}.grid-stack>.grid-stack-item[gs-min-w="10"]{min-width:83.3333333333%}.grid-stack>.grid-stack-item[gs-max-w="10"]{max-width:83.3333333333%}.grid-stack>.grid-stack-item[gs-w="11"]{width:91.6666666667%}.grid-stack>.grid-stack-item[gs-x="11"]{left:91.6666666667%}.grid-stack>.grid-stack-item[gs-min-w="11"]{min-width:91.6666666667%}.grid-stack>.grid-stack-item[gs-max-w="11"]{max-width:91.6666666667%}.grid-stack>.grid-stack-item[gs-w="12"]{width:100%}.grid-stack>.grid-stack-item[gs-x="12"]{left:100%}.grid-stack>.grid-stack-item[gs-min-w="12"]{min-width:100%}.grid-stack>.grid-stack-item[gs-max-w="12"]{max-width:100%}.grid-stack.grid-stack-1>.grid-stack-item{min-width:100%}.grid-stack.grid-stack-1>.grid-stack-item[gs-w="1"]{width:100%}.grid-stack.grid-stack-1>.grid-stack-item[gs-x="1"]{left:100%}.grid-stack.grid-stack-1>.grid-stack-item[gs-min-w="1"]{min-width:100%}.grid-stack.grid-stack-1>.grid-stack-item[gs-max-w="1"]{max-width:100%}.grid-stack.grid-stack-animate,.grid-stack.grid-stack-animate .grid-stack-item{-webkit-transition:left .3s,top .3s,height .3s,width .3s;-moz-transition:left .3s,top .3s,height .3s,width .3s;-ms-transition:left .3s,top .3s,height .3s,width .3s;-o-transition:left .3s,top .3s,height .3s,width .3s;transition:left .3s,top .3s,height .3s,width .3s}.grid-stack.grid-stack-animate .grid-stack-item.grid-stack-placeholder,.grid-stack.grid-stack-animate .grid-stack-item.ui-draggable-dragging,.grid-stack.grid-stack-animate .grid-stack-item.ui-resizable-resizing{-webkit-transition:left 0s,top 0s,height 0s,width 0s;-moz-transition:left 0s,top 0s,height 0s,width 0s;-ms-transition:left 0s,top 0s,height 0s,width 0s;-o-transition:left 0s,top 0s,height 0s,width 0s;transition:left 0s,top 0s,height 0s,width 0s}.ui-draggable-dragging,.ui-resizable-resizing{z-index:100}.ui-draggable-dragging>.grid-stack-item-content,.ui-resizable-resizing>.grid-stack-item-content{box-shadow:1px 4px 6px rgba(0,0,0,0.2);opacity:.8}.ui-draggable-dragging{will-change:left,top;cursor:move}.ui-resizable-resizing{will-change:width,height}\n',""]);const d=c},466:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(81),r=n.n(i),o=n(645),s=n.n(o)()(r());s.push([t.id,'.chart-title{font-size:20px;font-weight:bold}.chart-error-message{font-size:15px;font-style:italic}.chart-path{fill:none;stroke-width:1.5}.chart-area{stroke-width:1.5}.listening-rect{stroke:grey;fill:white}.question-mark{cursor:pointer;opacity:0.2;transform:scale(0.05);-ms-transform:scale(0.05);-webkit-transform:scale(0.05)}.question-mark:hover{opacity:0.5}.grid-stack-item-content{overflow:hidden !important;box-shadow:0 1px 3px rgba(0,0,0,0.12),0 1px 2px rgba(0,0,0,0.24);transition:all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);background:#fff}.grid-stack-item-removing{opacity:0.5}.subgrid{margin-right:20px}.grid-stack>.grid-stack-item.grid-stack-sub-grid>.grid-stack-item-content{background:rgba(0,0,0,0.05)}.grid-stack.grid-stack-nested{background:none;position:absolute;inset:0}body{height:100%;margin:0;padding:0}.wrapper{display:flex;font-family:"Roboto"}.grid{width:100%;height:100%}.grid .grid-stack{min-height:500px}.sidebar-hidden{visibility:hidden;display:none}.sidebar{visibility:visible;display:flex;flex-direction:column;gap:10px;padding:10px}.dropzone-remove{border:3px dashed red;opacity:0.5;height:100px;display:flex;justify-content:center;align-items:center}.dropzone-remove:hover{opacity:1}.available-widgets{border:3px dashed grey;padding:10px;display:flex;flex-direction:column;gap:10px}\n',""]);const a=s},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,r,o){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(i)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var u=0;u<t.length;u++){var c=[].concat(t[u]);i&&s[c[0]]||(void 0!==o&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),e.push(c))}},e}},667:t=>{t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},81:t=>{t.exports=function(t){return t[1]}},249:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDBaseImplement=void 0,e.DDBaseImplement=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(t,e){this._eventRegister[t]=e}off(t){delete this._eventRegister[t]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(t,e){if(!this.disabled&&this._eventRegister&&this._eventRegister[t])return this._eventRegister[t](e)}}},529:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDDraggable=void 0;const i=n(427),r=n(284),o=n(249),s=n(168);class a extends o.DDBaseImplement{constructor(t,e={}){super(),this.el=t,this.option=e;let n=e.handle.substring(1);this.dragEl=t.classList.contains(n)?t:t.querySelector(e.handle)||t,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this.enable()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){!1!==this.disabled&&(super.enable(),this.dragEl.addEventListener("mousedown",this._mouseDown),s.isTouch&&(this.dragEl.addEventListener("touchstart",s.touchstart),this.dragEl.addEventListener("pointerdown",s.pointerdown)),this.el.classList.remove("ui-draggable-disabled"),this.el.classList.add("ui-draggable"))}disable(t=!1){!0!==this.disabled&&(super.disable(),this.dragEl.removeEventListener("mousedown",this._mouseDown),s.isTouch&&(this.dragEl.removeEventListener("touchstart",s.touchstart),this.dragEl.removeEventListener("pointerdown",s.pointerdown)),this.el.classList.remove("ui-draggable"),t||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.dragging&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(t){return Object.keys(t).forEach((e=>this.option[e]=t[e])),this}_mouseDown(t){if(i.DDManager.mouseHandled)return;if(0!==t.button)return!0;const e=t.target.nodeName.toLowerCase();return["input","textarea","button","select","option"].find((t=>t===e))||t.target.closest('[contenteditable="true"]')||(this.mouseDownEvent=t,delete this.dragging,delete i.DDManager.dragElement,delete i.DDManager.dropElement,document.addEventListener("mousemove",this._mouseMove,!0),document.addEventListener("mouseup",this._mouseUp,!0),s.isTouch&&(this.dragEl.addEventListener("touchmove",s.touchmove),this.dragEl.addEventListener("touchend",s.touchend)),t.preventDefault(),document.activeElement&&document.activeElement.blur(),i.DDManager.mouseHandled=!0),!0}_callDrag(t){if(!this.dragging)return;const e=r.Utils.initEvent(t,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(e,this.ui()),this.triggerEvent("drag",e)}_mouseMove(t){var e;let n=this.mouseDownEvent;if(this.dragging)if(this._dragFollow(t),i.DDManager.pauseDrag){const e=Number.isInteger(i.DDManager.pauseDrag)?i.DDManager.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout((()=>this._callDrag(t)),e)}else this._callDrag(t);else if(Math.abs(t.x-n.x)+Math.abs(t.y-n.y)>3){this.dragging=!0,i.DDManager.dragElement=this;let n=null===(e=this.el.gridstackNode)||void 0===e?void 0:e.grid;n?i.DDManager.dropElement=n.el.ddElement.ddDroppable:delete i.DDManager.dropElement,this.helper=this._createHelper(t),this._setupHelperContainmentStyle(),this.dragOffset=this._getDragOffset(t,this.el,this.helperContainment);const o=r.Utils.initEvent(t,{target:this.el,type:"dragstart"});this._setupHelperStyle(t),this.option.start&&this.option.start(o,this.ui()),this.triggerEvent("dragstart",o)}return t.preventDefault(),!0}_mouseUp(t){var e;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),s.isTouch&&(this.dragEl.removeEventListener("touchmove",s.touchmove,!0),this.dragEl.removeEventListener("touchend",s.touchend,!0)),this.dragging){delete this.dragging,(null===(e=i.DDManager.dropElement)||void 0===e?void 0:e.el)===this.el.parentElement&&delete i.DDManager.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper===this.el?this._removeHelperStyle():this.helper.remove();const n=r.Utils.initEvent(t,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(n),this.triggerEvent("dragstop",n),i.DDManager.dropElement&&i.DDManager.dropElement.drop(t)}delete this.helper,delete this.mouseDownEvent,delete i.DDManager.dragElement,delete i.DDManager.dropElement,delete i.DDManager.mouseHandled,t.preventDefault()}_createHelper(t){let e=this.el;return"function"==typeof this.option.helper?e=this.option.helper(t):"clone"===this.option.helper&&(e=r.Utils.cloneNode(this.el)),document.body.contains(e)||r.Utils.appendTo(e,"parent"===this.option.appendTo?this.el.parentNode:this.option.appendTo),e===this.el&&(this.dragElementOriginStyle=a.originStyleProp.map((t=>this.el.style[t]))),e}_setupHelperStyle(t){this.helper.classList.add("ui-draggable-dragging");const e=this.helper.style;return e.pointerEvents="none",e["min-width"]=0,e.width=this.dragOffset.width+"px",e.height=this.dragOffset.height+"px",e.willChange="left, top",e.position="fixed",this._dragFollow(t),e.transition="none",setTimeout((()=>{this.helper&&(e.transition=null)}),0),this}_removeHelperStyle(){var t;this.helper.classList.remove("ui-draggable-dragging");let e=null===(t=this.helper)||void 0===t?void 0:t.gridstackNode;if(this.dragElementOriginStyle&&(!e||!e._isAboutToRemove)){let t=this.helper,e=this.dragElementOriginStyle.transition||null;t.style.transition=this.dragElementOriginStyle.transition="none",a.originStyleProp.forEach((e=>t.style[e]=this.dragElementOriginStyle[e]||null)),setTimeout((()=>t.style.transition=e),50)}return delete this.dragElementOriginStyle,this}_dragFollow(t){const e=this.helper.style,n=this.dragOffset;e.left=t.clientX+n.offsetLeft-0+"px",e.top=t.clientY+n.offsetTop-0+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,"fixed"!==this.helper.style.position&&(this.parentOriginStylePosition=this.helperContainment.style.position,window.getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(t,e,n){let i=0,o=0;if(n){const t=document.createElement("div");r.Utils.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),n.appendChild(t);const e=t.getBoundingClientRect();n.removeChild(t),i=e.left,o=e.top}const s=e.getBoundingClientRect();return{left:s.left,top:s.top,offsetLeft:-t.clientX+s.left-i,offsetTop:-t.clientY+s.top-o,width:s.width,height:s.height}}ui(){const t=this.el.parentElement.getBoundingClientRect(),e=this.helper.getBoundingClientRect();return{position:{top:e.top-t.top,left:e.left-t.left}}}}e.DDDraggable=a,a.originStyleProp=["transition","pointerEvents","position","left","top"]},514:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDDroppable=void 0;const i=n(427),r=n(249),o=n(284),s=n(168);class a extends r.DDBaseImplement{constructor(t,e={}){super(),this.el=t,this.option=e,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){!1!==this.disabled&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),s.isTouch&&(this.el.addEventListener("pointerenter",s.pointerenter),this.el.addEventListener("pointerleave",s.pointerleave)))}disable(t=!1){!0!==this.disabled&&(super.disable(),this.el.classList.remove("ui-droppable"),t||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),s.isTouch&&(this.el.removeEventListener("pointerenter",s.pointerenter),this.el.removeEventListener("pointerleave",s.pointerleave)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(t){return Object.keys(t).forEach((e=>this.option[e]=t[e])),this._setupAccept(),this}_mouseEnter(t){if(!i.DDManager.dragElement)return;if(!this._canDrop(i.DDManager.dragElement.el))return;t.preventDefault(),t.stopPropagation(),i.DDManager.dropElement&&i.DDManager.dropElement!==this&&i.DDManager.dropElement._mouseLeave(t),i.DDManager.dropElement=this;const e=o.Utils.initEvent(t,{target:this.el,type:"dropover"});this.option.over&&this.option.over(e,this._ui(i.DDManager.dragElement)),this.triggerEvent("dropover",e),this.el.classList.add("ui-droppable-over")}_mouseLeave(t){var e;if(!i.DDManager.dragElement||i.DDManager.dropElement!==this)return;t.preventDefault(),t.stopPropagation();const n=o.Utils.initEvent(t,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(n,this._ui(i.DDManager.dragElement)),this.triggerEvent("dropout",n),i.DDManager.dropElement===this){let n;delete i.DDManager.dropElement;let r=this.el.parentElement;for(;!n&&r;)n=null===(e=r.ddElement)||void 0===e?void 0:e.ddDroppable,r=r.parentElement;n&&n._mouseEnter(t)}}drop(t){t.preventDefault();const e=o.Utils.initEvent(t,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(e,this._ui(i.DDManager.dragElement)),this.triggerEvent("drop",e)}_canDrop(t){return t&&(!this.accept||this.accept(t))}_setupAccept(){return this.option.accept?("string"==typeof this.option.accept?this.accept=t=>t.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(t){return Object.assign({draggable:t.el},t.ui())}}e.DDDroppable=a},474:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDElement=void 0;const i=n(945),r=n(529),o=n(514);class s{constructor(t){this.el=t}static init(t){return t.ddElement||(t.ddElement=new s(t)),t.ddElement}on(t,e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(t)>-1?this.ddDraggable.on(t,e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(t)>-1?this.ddDroppable.on(t,e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(t)>-1&&this.ddResizable.on(t,e),this}off(t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(t)>-1?this.ddDraggable.off(t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(t)>-1?this.ddDroppable.off(t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(t)>-1&&this.ddResizable.off(t),this}setupDraggable(t){return this.ddDraggable?this.ddDraggable.updateOption(t):this.ddDraggable=new r.DDDraggable(this.el,t),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(t){return this.ddResizable?this.ddResizable.updateOption(t):this.ddResizable=new i.DDResizable(this.el,t),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(t){return this.ddDroppable?this.ddDroppable.updateOption(t):this.ddDroppable=new o.DDDroppable(this.el,t),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}e.DDElement=s},470:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDGridStack=void 0;const i=n(523),r=n(929),o=n(284),s=n(427),a=n(474);class l{static get(){return u}resizable(t,e,n,i){return this._getDDElements(t).forEach((t=>{if("disable"===e||"enable"===e)t.ddResizable&&t.ddResizable[e]();else if("destroy"===e)t.ddResizable&&t.cleanResizable();else if("option"===e)t.setupResizable({[n]:i});else{const n=t.el.gridstackNode.grid;let i=t.el.getAttribute("gs-resize-handles")?t.el.getAttribute("gs-resize-handles"):n.opts.resizable.handles,r=!n.opts.alwaysShowResizeHandle;t.setupResizable(Object.assign(Object.assign(Object.assign({},n.opts.resizable),{handles:i,autoHide:r}),{start:e.start,stop:e.stop,resize:e.resize}))}})),this}draggable(t,e,n,i){return this._getDDElements(t).forEach((t=>{if("disable"===e||"enable"===e)t.ddDraggable&&t.ddDraggable[e]();else if("destroy"===e)t.ddDraggable&&t.cleanDraggable();else if("option"===e)t.setupDraggable({[n]:i});else{const n=t.el.gridstackNode.grid;t.setupDraggable(Object.assign(Object.assign({},n.opts.draggable),{start:e.start,stop:e.stop,drag:e.drag}))}})),this}dragIn(t,e){return this._getDDElements(t).forEach((t=>t.setupDraggable(e))),this}droppable(t,e,n,i){return"function"!=typeof e.accept||e._accept||(e._accept=e.accept,e.accept=t=>e._accept(t)),this._getDDElements(t).forEach((t=>{"disable"===e||"enable"===e?t.ddDroppable&&t.ddDroppable[e]():"destroy"===e?t.ddDroppable&&t.cleanDroppable():"option"===e?t.setupDroppable({[n]:i}):t.setupDroppable(e)})),this}isDroppable(t){return!(!(t&&t.ddElement&&t.ddElement.ddDroppable)||t.ddElement.ddDroppable.disabled)}isDraggable(t){return!(!(t&&t.ddElement&&t.ddElement.ddDraggable)||t.ddElement.ddDraggable.disabled)}isResizable(t){return!(!(t&&t.ddElement&&t.ddElement.ddResizable)||t.ddElement.ddResizable.disabled)}on(t,e,n){return this._getDDElements(t).forEach((t=>t.on(e,(t=>{n(t,s.DDManager.dragElement?s.DDManager.dragElement.el:t.target,s.DDManager.dragElement?s.DDManager.dragElement.helper:null)})))),this}off(t,e){return this._getDDElements(t).forEach((t=>t.off(e))),this}_getDDElements(t,e=!0){let n=o.Utils.getElements(t);if(!n.length)return[];let i=n.map((t=>t.ddElement||(e?a.DDElement.init(t):null)));return e||i.filter((t=>t)),i}}e.DDGridStack=l;const u=new l;function c(t,e){let n=t?t.gridstackNode:void 0;n&&n.grid&&(e?n._isAboutToRemove=!0:delete n._isAboutToRemove,e?t.classList.add("grid-stack-item-removing"):t.classList.remove("grid-stack-item-removing"))}r.GridStack.prototype._setupAcceptWidget=function(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return u.droppable(this.el,"destroy"),this;let t,e,n=(n,i,r)=>{let s=i.gridstackNode;if(!s)return;r=r||i;let a=this.el.getBoundingClientRect(),{top:l,left:c}=r.getBoundingClientRect();c-=a.left,l-=a.top;let h={position:{top:l,left:c}};if(s._temporaryRemoved){if(s.x=Math.max(0,Math.round(c/e)),s.y=Math.max(0,Math.round(l/t)),delete s.autoPosition,this.engine.nodeBoundFix(s),!this.engine.willItFit(s)){if(s.autoPosition=!0,!this.engine.willItFit(s))return void u.off(i,"drag");s._willFitPos&&(o.Utils.copyPos(s,s._willFitPos),delete s._willFitPos)}this._onStartMoving(r,n,h,s,e,t)}else this._dragOrResize(r,n,h,s,e,t)};return u.droppable(this.el,{accept:t=>{let e=t.gridstackNode;if((null==e?void 0:e.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let n=!0;if("function"==typeof this.opts.acceptWidgets)n=this.opts.acceptWidgets(t);else{let e=!0===this.opts.acceptWidgets?".grid-stack-item":this.opts.acceptWidgets;n=t.matches(e)}if(n&&e&&this.opts.maxRow){let t={w:e.w,h:e.h,minW:e.minW,minH:e.minH};n=this.engine.willItFit(t)}return n}}).on(this.el,"dropover",((i,r,o)=>{let s=r.gridstackNode;if((null==s?void 0:s.grid)===this&&!s._temporaryRemoved)return!1;(null==s?void 0:s.grid)&&s.grid!==this&&!s._temporaryRemoved&&s.grid._leave(r,o),e=this.cellWidth(),t=this.getCellHeight(!0),s||(s=this._readAttr(r)),s.grid||(s._isExternal=!0,r.gridstackNode=s),o=o||r;let a=s.w||Math.round(o.offsetWidth/e)||1,l=s.h||Math.round(o.offsetHeight/t)||1;return s.grid&&s.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=s),r.gridstackNode=s=Object.assign(Object.assign({},s),{w:a,h:l,grid:this}),this.engine.cleanupNode(s).nodeBoundFix(s),s._initDD=s._isExternal=s._temporaryRemoved=!0):(s.w=a,s.h=l,s._temporaryRemoved=!0),c(s.el,!1),u.on(r,"drag",n),n(i,r,o),!1})).on(this.el,"dropout",((t,e,n)=>{let i=e.gridstackNode;return!!i&&(i.grid&&i.grid!==this||(this._leave(e,n),this._isTemp&&this.removeAsSubGrid(i)),!1)})).on(this.el,"drop",((t,e,n)=>{var i,r;let s=e.gridstackNode;if((null==s?void 0:s.grid)===this&&!s._isExternal)return!1;let a=!!this.placeholder.parentElement;this.placeholder.remove();let l=e._gridstackNodeOrig;if(delete e._gridstackNodeOrig,a&&(null==l?void 0:l.grid)&&l.grid!==this){let t=l.grid;t.engine.removedNodes.push(l),t._triggerRemoveEvent(),t.parentGridItem&&!t.engine.nodes.length&&t.opts.subGridDynamic&&t.removeAsSubGrid()}if(!s)return!1;if(a&&(this.engine.cleanupNode(s),s.grid=this),u.off(e,"drag"),n!==e?(n.remove(),e.gridstackNode=l,a&&(e=e.cloneNode(!0))):(e.remove(),this._removeDD(e)),!a)return!1;e.gridstackNode=s,s.el=e;let c=null===(r=null===(i=s.subGrid)||void 0===i?void 0:i.el)||void 0===r?void 0:r.gridstack;return o.Utils.copyPos(s,this._readAttr(this.placeholder)),o.Utils.removePositioningStyles(e),this._writeAttr(e,s),this.el.appendChild(e),c&&(c.parentGridItem=s,c.opts.styleInHead||c._updateStyles(!0)),this._updateContainerHeight(),this.engine.addedNodes.push(s),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(Object.assign(Object.assign({},t),{type:"dropped"}),l&&l.grid?l:void 0,s),window.setTimeout((()=>{s.el&&s.el.parentElement?this._prepareDragDropByNode(s):this.engine.removeNode(s),delete s.grid._isTemp})),!1})),this},r.GridStack.prototype._setupRemoveDrop=function(){if(!this.opts.staticGrid&&"string"==typeof this.opts.removable){let t=document.querySelector(this.opts.removable);if(!t)return this;u.isDroppable(t)||u.droppable(t,this.opts.removableOptions).on(t,"dropover",((t,e)=>c(e,!0))).on(t,"dropout",((t,e)=>c(e,!1)))}return this},r.GridStack.setupDragIn=function(t,e){void 0!==(null==e?void 0:e.pause)&&(s.DDManager.pauseDrag=e.pause),"string"==typeof t&&(e=Object.assign(Object.assign({},i.dragInDefaultOptions),e||{}),o.Utils.getElements(t).forEach((t=>{u.isDraggable(t)||u.dragIn(t,e)})))},r.GridStack.prototype._prepareDragDropByNode=function(t){let e=t.el;const n=t.noMove||this.opts.disableDrag,i=t.noResize||this.opts.disableResize;if(this.opts.staticGrid||n&&i)return t._initDD&&(this._removeDD(e),delete t._initDD),e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!t._initDD){let n,i,r=(r,o)=>{this._gsEventHandler[r.type]&&this._gsEventHandler[r.type](r,r.target),n=this.cellWidth(),i=this.getCellHeight(!0),this._onStartMoving(e,r,o,t,n,i)},s=(r,o)=>{this._dragOrResize(e,r,o,t,n,i)},a=n=>{this.placeholder.remove(),delete t._moving,delete t._event,delete t._lastTried;let i=n.target;if(i.gridstackNode&&i.gridstackNode.grid===this){if(t.el=i,t._isAboutToRemove){let r=e.gridstackNode.grid;r._gsEventHandler[n.type]&&r._gsEventHandler[n.type](n,i),this._removeDD(e),r.engine.removedNodes.push(t),r._triggerRemoveEvent(),delete e.gridstackNode,delete t.el,e.remove()}else o.Utils.removePositioningStyles(i),t._temporaryRemoved?(o.Utils.copyPos(t,t._orig),this._writePosAttr(i,t),this.engine.addNode(t)):this._writePosAttr(i,t),this._gsEventHandler[n.type]&&this._gsEventHandler[n.type](n,i);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()}};u.draggable(e,{start:r,stop:a,drag:s}).resizable(e,{start:r,stop:a,resize:s}),t._initDD=!0}return u.draggable(e,n?"disable":"enable").resizable(e,i?"disable":"enable"),this},r.GridStack.prototype._onStartMoving=function(t,e,n,i,r,o){this.engine.cleanNodes().beginUpdate(i),this._writePosAttr(this.placeholder,i),this.el.appendChild(this.placeholder),i.el=this.placeholder,i._lastUiPosition=n.position,i._prevYPix=n.position.top,i._moving="dragstart"===e.type,delete i._lastTried,"dropover"===e.type&&i._temporaryRemoved&&(this.engine.addNode(i),i._moving=!0),this.engine.cacheRects(r,o,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),"resizestart"===e.type&&(u.resizable(t,"option","minWidth",r*(i.minW||1)).resizable(t,"option","minHeight",o*(i.minH||1)),i.maxW&&u.resizable(t,"option","maxWidth",r*i.maxW),i.maxH&&u.resizable(t,"option","maxHeight",o*i.maxH))},r.GridStack.prototype._leave=function(t,e){let n=t.gridstackNode;n&&(u.off(t,"drag"),n._temporaryRemoved||(n._temporaryRemoved=!0,this.engine.removeNode(n),n.el=n._isExternal&&e?e:t,!0===this.opts.removable&&c(t,!0),t._gridstackNodeOrig?(t.gridstackNode=t._gridstackNodeOrig,delete t._gridstackNodeOrig):n._isExternal&&(delete n.el,delete t.gridstackNode,this.engine.restoreInitial())))},r.GridStack.prototype._dragOrResize=function(t,e,n,i,r,s){let a,l=Object.assign({},i._orig),u=this.opts.marginLeft,c=this.opts.marginRight,h=this.opts.marginTop,d=this.opts.marginBottom,f=Math.round(.1*s),g=Math.round(.1*r);if(u=Math.min(u,g),c=Math.min(c,g),h=Math.min(h,f),d=Math.min(d,f),"drag"===e.type){if(i._temporaryRemoved)return;let e=n.position.top-i._prevYPix;i._prevYPix=n.position.top,o.Utils.updateScrollPosition(t,n.position,e);let a=n.position.left+(n.position.left>i._lastUiPosition.left?-c:u),f=n.position.top+(n.position.top>i._lastUiPosition.top?-d:h);l.x=Math.round(a/r),l.y=Math.round(f/s);let g=this._extraDragRow;if(this.engine.collide(i,l)){let t=this.getRow(),e=Math.max(0,l.y+i.h-t);this.opts.maxRow&&t+e>this.opts.maxRow&&(e=Math.max(0,this.opts.maxRow-t)),this._extraDragRow=e}else this._extraDragRow=0;if(this._extraDragRow!==g&&this._updateContainerHeight(),i.x===l.x&&i.y===l.y)return}else if("resize"===e.type){if(l.x<0)return;if(o.Utils.updateScrollResize(e,t,s),l.w=Math.round((n.size.width-u)/r),l.h=Math.round((n.size.height-h)/s),i.w===l.w&&i.h===l.h)return;if(i._lastTried&&i._lastTried.w===l.w&&i._lastTried.h===l.h)return;let c=n.position.left+u,d=n.position.top+h;l.x=Math.round(c/r),l.y=Math.round(d/s),a=!0}i._event=e,i._lastTried=l;let p={x:n.position.left+u,y:n.position.top+h,w:(n.size?n.size.width:i.w*r)-u-c,h:(n.size?n.size.height:i.h*s)-h-d};if(this.engine.moveNodeCheck(i,Object.assign(Object.assign({},l),{cellWidth:r,cellHeight:s,rect:p,resizing:a}))){i._lastUiPosition=n.position,this.engine.cacheRects(r,s,h,c,d,u),delete i._skipDown,a&&i.subGrid&&i.subGrid.onParentResize(),this._extraDragRow=0,this._updateContainerHeight();let t=e.target;this._writePosAttr(t,i),this._gsEventHandler[e.type]&&this._gsEventHandler[e.type](e,t)}},r.GridStack.prototype.movable=function(t,e){return this.opts.staticGrid||r.GridStack.getElements(t).forEach((t=>{let n=t.gridstackNode;n&&(e?delete n.noMove:n.noMove=!0,this._prepareDragDropByNode(n))})),this},r.GridStack.prototype.resizable=function(t,e){return this.opts.staticGrid||r.GridStack.getElements(t).forEach((t=>{let n=t.gridstackNode;n&&(e?delete n.noResize:n.noResize=!0,this._prepareDragDropByNode(n))})),this},r.GridStack.prototype.disable=function(){if(!this.opts.staticGrid)return this.enableMove(!1),this.enableResize(!1),this._triggerEvent("disable"),this},r.GridStack.prototype.enable=function(){if(!this.opts.staticGrid)return this.enableMove(!0),this.enableResize(!0),this._triggerEvent("enable"),this},r.GridStack.prototype.enableMove=function(t){return this.opts.staticGrid||(this.opts.disableDrag=!t,this.engine.nodes.forEach((e=>this.movable(e.el,t)))),this},r.GridStack.prototype.enableResize=function(t){return this.opts.staticGrid||(this.opts.disableResize=!t,this.engine.nodes.forEach((e=>this.resizable(e.el,t)))),this},r.GridStack.prototype._removeDD=function(t){return u.draggable(t,"destroy").resizable(t,"destroy"),t.gridstackNode&&delete t.gridstackNode._initDD,delete t.ddElement,this}},427:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDManager=void 0,e.DDManager=class{}},952:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDResizableHandle=void 0;const i=n(168);class r{constructor(t,e,n){this.moving=!1,this.host=t,this.dir=e,this.option=n,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._init()}_init(){const t=document.createElement("div");return t.classList.add("ui-resizable-handle"),t.classList.add(`${r.prefix}${this.dir}`),t.style.zIndex="100",t.style.userSelect="none",this.el=t,this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),i.isTouch&&(this.el.addEventListener("touchstart",i.touchstart),this.el.addEventListener("pointerdown",i.pointerdown)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),i.isTouch&&(this.el.removeEventListener("touchstart",i.touchstart),this.el.removeEventListener("pointerdown",i.pointerdown)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(t){this.mouseDownEvent=t,document.addEventListener("mousemove",this._mouseMove,!0),document.addEventListener("mouseup",this._mouseUp,!0),i.isTouch&&(this.el.addEventListener("touchmove",i.touchmove),this.el.addEventListener("touchend",i.touchend)),t.stopPropagation(),t.preventDefault()}_mouseMove(t){let e=this.mouseDownEvent;this.moving?this._triggerEvent("move",t):Math.abs(t.x-e.x)+Math.abs(t.y-e.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",t)),t.stopPropagation(),t.preventDefault()}_mouseUp(t){this.moving&&this._triggerEvent("stop",t),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),i.isTouch&&(this.el.removeEventListener("touchmove",i.touchmove),this.el.removeEventListener("touchend",i.touchend)),delete this.moving,delete this.mouseDownEvent,t.stopPropagation(),t.preventDefault()}_triggerEvent(t,e){return this.option[t]&&this.option[t](e),this}}e.DDResizableHandle=r,r.prefix="ui-resizable-"},945:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDResizable=void 0;const i=n(952),r=n(249),o=n(284),s=n(427);class a extends r.DDBaseImplement{constructor(t,e={}){super(),this._ui=()=>{const t=this.el.parentElement.getBoundingClientRect(),e={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},n=this.temporalRect||e;return{position:{left:n.left-t.left,top:n.top-t.top},size:{width:n.width,height:n.height}}},this.el=t,this.option=e,this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){super.enable(),this.el.classList.add("ui-resizable"),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this.el.classList.remove("ui-resizable"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),this.el.classList.remove("ui-resizable"),delete this.el,super.destroy()}updateOption(t){let e=t.handles&&t.handles!==this.option.handles,n=t.autoHide&&t.autoHide!==this.option.autoHide;return Object.keys(t).forEach((e=>this.option[e]=t[e])),e&&(this._removeHandlers(),this._setupHandlers()),n&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(t){return t?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),s.DDManager.overResizeElement===this&&delete s.DDManager.overResizeElement),this}_mouseOver(t){s.DDManager.overResizeElement||s.DDManager.dragElement||(s.DDManager.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(t){s.DDManager.overResizeElement===this&&(delete s.DDManager.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){let t=this.option.handles||"e,s,se";return"all"===t&&(t="n,e,s,w,se,sw,ne,nw"),this.handlers=t.split(",").map((t=>t.trim())).map((t=>new i.DDResizableHandle(this.el,t,{start:t=>{this._resizeStart(t)},stop:t=>{this._resizeStop(t)},move:e=>{this._resizing(e,t)}}))),this}_resizeStart(t){this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=o.Utils.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=t,this._setupHelper(),this._applyChange();const e=o.Utils.initEvent(t,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(e,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",e),this}_resizing(t,e){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(t,e),this._applyChange();const n=o.Utils.initEvent(t,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(n,this._ui()),this.triggerEvent("resize",n),this}_resizeStop(t){const e=o.Utils.initEvent(t,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(e),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",e),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){return this.elOriginStyleVal=a._originStyleProp.map((t=>this.el.style[t])),this.parentOriginStylePosition=this.el.parentElement.style.position,window.getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return a._originStyleProp.forEach(((t,e)=>{this.el.style[t]=this.elOriginStyleVal[e]||null})),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(t,e){const n=this.startEvent,i={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=t.clientX-n.clientX,o=t.clientY-n.clientY;e.indexOf("e")>-1?i.width+=r:e.indexOf("w")>-1&&(i.width-=r,i.left+=r),e.indexOf("s")>-1?i.height+=o:e.indexOf("n")>-1&&(i.height-=o,i.top+=o);const s=this._constrainSize(i.width,i.height);return Math.round(i.width)!==Math.round(s.width)&&(e.indexOf("w")>-1&&(i.left+=i.width-s.width),i.width=s.width),Math.round(i.height)!==Math.round(s.height)&&(e.indexOf("n")>-1&&(i.top+=i.height-s.height),i.height=s.height),i}_constrainSize(t,e){const n=this.option.maxWidth||Number.MAX_SAFE_INTEGER,i=this.option.minWidth||t,r=this.option.maxHeight||Number.MAX_SAFE_INTEGER,o=this.option.minHeight||e;return{width:Math.min(n,Math.max(i,t)),height:Math.min(r,Math.max(o,e))}}_applyChange(){let t={left:0,top:0,width:0,height:0};if("absolute"===this.el.style.position){const e=this.el.parentElement,{left:n,top:i}=e.getBoundingClientRect();t={left:n,top:i,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach((e=>{const n=this.temporalRect[e];this.el.style[e]=n-t[e]+"px"})),this):this}_removeHandlers(){return this.handlers.forEach((t=>t.destroy())),delete this.handlers,this}}e.DDResizable=a,a._originStyleProp=["width","height","position","left","top","opacity","zIndex"]},168:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.pointerleave=e.pointerenter=e.pointerdown=e.touchend=e.touchmove=e.touchstart=e.isTouch=void 0;const i=n(427);e.isTouch="undefined"!=typeof window&&"undefined"!=typeof document&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class r{}function o(t,e){if(t.touches.length>1)return;t.cancelable&&t.preventDefault();const n=t.changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent(e,!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(i)}function s(t,e){t.cancelable&&t.preventDefault();const n=document.createEvent("MouseEvents");n.initMouseEvent(e,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(n)}e.touchstart=function(t){r.touchHandled||(r.touchHandled=!0,o(t,"mousedown"))},e.touchmove=function(t){r.touchHandled&&o(t,"mousemove")},e.touchend=function(t){if(!r.touchHandled)return;r.pointerLeaveTimeout&&(window.clearTimeout(r.pointerLeaveTimeout),delete r.pointerLeaveTimeout);const e=!!i.DDManager.dragElement;o(t,"mouseup"),e||o(t,"click"),r.touchHandled=!1},e.pointerdown=function(t){t.target.releasePointerCapture(t.pointerId)},e.pointerenter=function(t){i.DDManager.dragElement&&s(t,"mouseenter")},e.pointerleave=function(t){i.DDManager.dragElement&&(r.pointerLeaveTimeout=window.setTimeout((()=>{delete r.pointerLeaveTimeout,s(t,"mouseleave")}),10))}},935:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GridStackEngine=void 0;const i=n(284);class r{constructor(t={}){this.addedNodes=[],this.removedNodes=[],this.column=t.column||12,this.maxRow=t.maxRow,this._float=t.float,this.nodes=t.nodes||[],this.onChange=t.onChange}batchUpdate(t=!0){return!!this.batchMode===t||(this.batchMode=t,t?(this._prevFloat=this._float,this._float=!0,this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,this._packNodes()._notify())),this}_useEntireRowArea(t,e){return!this.float&&!this._hasLocked&&(!t._moving||t._skipDown||e.y<=t.y)}_fixCollisions(t,e=t,n,r={}){if(this.sortNodes(-1),!(n=n||this.collide(t,e)))return!1;if(t._moving&&!r.nested&&!this.float&&this.swap(t,n))return!0;let o=e;this._useEntireRowArea(t,e)&&(o={x:0,w:this.column,y:e.y,h:e.h},n=this.collide(t,o,r.skip));let s=!1,a={nested:!0,pack:!1};for(;n=n||this.collide(t,o,r.skip);){let o;if(n.locked||t._moving&&!t._skipDown&&e.y>t.y&&!this.float&&(!this.collide(n,Object.assign(Object.assign({},n),{y:t.y}),t)||!this.collide(n,Object.assign(Object.assign({},n),{y:e.y-n.h}),t))?(t._skipDown=t._skipDown||e.y>t.y,o=this.moveNode(t,Object.assign(Object.assign(Object.assign({},e),{y:n.y+n.h}),a)),n.locked&&o?i.Utils.copyPos(e,t):!n.locked&&o&&r.pack&&(this._packNodes(),e.y=n.y+n.h,i.Utils.copyPos(t,e)),s=s||o):o=this.moveNode(n,Object.assign(Object.assign(Object.assign({},n),{y:e.y+e.h,skip:t}),a)),!o)return s;n=void 0}return s}collide(t,e=t,n){return this.nodes.find((r=>r!==t&&r!==n&&i.Utils.isIntercepted(r,e)))}collideAll(t,e=t,n){return this.nodes.filter((r=>r!==t&&r!==n&&i.Utils.isIntercepted(r,e)))}directionCollideCoverage(t,e,n){if(!e.rect||!t._rect)return;let i,r=t._rect,o=Object.assign({},e.rect);return o.y>r.y?(o.h+=o.y-r.y,o.y=r.y):o.h+=r.y-o.y,o.x>r.x?(o.w+=o.x-r.x,o.x=r.x):o.w+=r.x-o.x,n.forEach((t=>{if(t.locked||!t._rect)return;let e=t._rect,n=Number.MAX_VALUE,s=Number.MAX_VALUE,a=.5;r.y<e.y?n=(o.y+o.h-e.y)/e.h:r.y+r.h>e.y+e.h&&(n=(e.y+e.h-o.y)/e.h),r.x<e.x?s=(o.x+o.w-e.x)/e.w:r.x+r.w>e.x+e.w&&(s=(e.x+e.w-o.x)/e.w);let l=Math.min(s,n);l>a&&(a=l,i=t)})),e.collide=i,i}cacheRects(t,e,n,i,r,o){return this.nodes.forEach((s=>s._rect={y:s.y*e+n,x:s.x*t+o,w:s.w*t-o-i,h:s.h*e-n-r})),this}swap(t,e){if(!e||e.locked||!t||t.locked)return!1;function n(){let n=e.x,i=e.y;return e.x=t.x,e.y=t.y,t.h!=e.h?(t.x=n,t.y=e.y+e.h):t.w!=e.w?(t.x=e.x+e.w,t.y=i):(t.x=n,t.y=i),t._dirty=e._dirty=!0,!0}let r;if(t.w===e.w&&t.h===e.h&&(t.x===e.x||t.y===e.y)&&(r=i.Utils.isTouching(t,e)))return n();if(!1!==r){if(t.w===e.w&&t.x===e.x&&(r||(r=i.Utils.isTouching(t,e)))){if(e.y<t.y){let n=t;t=e,e=n}return n()}if(!1!==r){if(t.h===e.h&&t.y===e.y&&(r||(r=i.Utils.isTouching(t,e)))){if(e.x<t.x){let n=t;t=e,e=n}return n()}return!1}}}isAreaEmpty(t,e,n,i){let r={x:t||0,y:e||0,w:n||1,h:i||1};return!this.collide(r)}compact(){if(0===this.nodes.length)return this;this.batchUpdate().sortNodes();let t=this.nodes;return this.nodes=[],t.forEach((t=>{t.locked||(t.autoPosition=!0),this.addNode(t,!1),t._dirty=!0})),this.batchUpdate(!1)}set float(t){this._float!==t&&(this._float=t||!1,t||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(t){return this.nodes=i.Utils.sort(this.nodes,t,this.column),this}_packNodes(){return this.batchMode||(this.sortNodes(),this.float?this.nodes.forEach((t=>{if(t._updating||void 0===t._orig||t.y===t._orig.y)return;let e=t.y;for(;e>t._orig.y;)--e,this.collide(t,{x:t.x,y:e,w:t.w,h:t.h})||(t._dirty=!0,t.y=e)})):this.nodes.forEach(((t,e)=>{if(!t.locked)for(;t.y>0;){let n=0===e?0:t.y-1;if(0!==e&&this.collide(t,{x:t.x,y:n,w:t.w,h:t.h}))break;t._dirty=t.y!==n,t.y=n}}))),this}prepareNode(t,e){(t=t||{})._id=t._id||r._idSeq++,void 0!==t.x&&void 0!==t.y&&null!==t.x&&null!==t.y||(t.autoPosition=!0);let n={x:0,y:0,w:1,h:1};return i.Utils.defaults(t,n),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,"string"==typeof t.x&&(t.x=Number(t.x)),"string"==typeof t.y&&(t.y=Number(t.y)),"string"==typeof t.w&&(t.w=Number(t.w)),"string"==typeof t.h&&(t.h=Number(t.h)),isNaN(t.x)&&(t.x=n.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=n.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=n.w),isNaN(t.h)&&(t.h=n.h),this.nodeBoundFix(t,e)}nodeBoundFix(t,e){let n=t._orig||i.Utils.copyPos({},t);if(t.maxW&&(t.w=Math.min(t.w,t.maxW)),t.maxH&&(t.h=Math.min(t.h,t.maxH)),t.minW&&t.minW<=this.column&&(t.w=Math.max(t.w,t.minW)),t.minH&&(t.h=Math.max(t.h,t.minH)),(1===this.column||t.x+t.w>this.column)&&this.column<12&&!this._inColumnResize&&!t.autoPosition&&t._id&&-1===this.findCacheLayout(t,12)){let e=Object.assign({},t);e.x=Math.min(11,e.x),e.w=Math.min(12,e.w),this.cacheOneLayout(e,12)}return t.w>this.column?t.w=this.column:t.w<1&&(t.w=1),this.maxRow&&t.h>this.maxRow?t.h=this.maxRow:t.h<1&&(t.h=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.w>this.column&&(e?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(e?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),i.Utils.samePos(t,n)||(t._dirty=!0),t}getDirtyNodes(t){return t?this.nodes.filter((t=>t._dirty&&!i.Utils.samePos(t,t._orig))):this.nodes.filter((t=>t._dirty))}_notify(t){if(this.batchMode||!this.onChange)return this;let e=(t||[]).concat(this.getDirtyNodes());return this.onChange(e),this}cleanNodes(){return this.batchMode||this.nodes.forEach((t=>{delete t._dirty,delete t._lastTried})),this}saveInitial(){return this.nodes.forEach((t=>{t._orig=i.Utils.copyPos({},t),delete t._dirty})),this._hasLocked=this.nodes.some((t=>t.locked)),this}restoreInitial(){return this.nodes.forEach((t=>{i.Utils.samePos(t,t._orig)||(i.Utils.copyPos(t,t._orig),t._dirty=!0)})),this._notify(),this}findEmptyPosition(t){this.sortNodes();let e=!1;for(let n=0;!e;++n){let r=n%this.column,o=Math.floor(n/this.column);if(r+t.w>this.column)continue;let s={x:r,y:o,w:t.w,h:t.h};this.nodes.find((t=>i.Utils.isIntercepted(s,t)))||(t.x=r,t.y=o,e=!0)}return e}addNode(t,e=!1){return this.nodes.find((e=>e._id===t._id))||(delete(t=this._inColumnResize?this.nodeBoundFix(t):this.prepareNode(t))._temporaryRemoved,delete t._removeDOM,t.autoPosition&&this.findEmptyPosition(t)&&delete t.autoPosition,this.nodes.push(t),e&&this.addedNodes.push(t),this._fixCollisions(t),this.batchMode||this._packNodes()._notify(),t)}removeNode(t,e=!0,n=!1){return this.nodes.find((e=>e===t))?(n&&this.removedNodes.push(t),e&&(t._removeDOM=!0),this.nodes=this.nodes.filter((e=>e!==t)),this._packNodes()._notify([t])):this}removeAll(t=!0){return delete this._layouts,0===this.nodes.length?this:(t&&this.nodes.forEach((t=>t._removeDOM=!0)),this.removedNodes=this.nodes,this.nodes=[],this._notify(this.removedNodes))}moveNodeCheck(t,e){if(!this.changedPosConstrain(t,e))return!1;if(e.pack=!0,!this.maxRow)return this.moveNode(t,e);let n,o=new r({column:this.column,float:this.float,nodes:this.nodes.map((e=>e===t?(n=Object.assign({},e),n):Object.assign({},e)))});if(!n)return!1;let s=o.moveNode(n,e)&&o.getRow()<=this.maxRow;if(!s&&!e.resizing&&e.collide){let n=e.collide.el.gridstackNode;if(this.swap(t,n))return this._notify(),!0}return!!s&&(o.nodes.filter((t=>t._dirty)).forEach((t=>{let e=this.nodes.find((e=>e._id===t._id));e&&(i.Utils.copyPos(e,t),e._dirty=!0)})),this._notify(),!0)}willItFit(t){if(delete t._willFitPos,!this.maxRow)return!0;let e=new r({column:this.column,float:this.float,nodes:this.nodes.map((t=>Object.assign({},t)))}),n=Object.assign({},t);return this.cleanupNode(n),delete n.el,delete n._id,delete n.content,delete n.grid,e.addNode(n),e.getRow()<=this.maxRow&&(t._willFitPos=i.Utils.copyPos({},n),!0)}changedPosConstrain(t,e){return e.w=e.w||t.w,e.h=e.h||t.h,t.x!==e.x||t.y!==e.y||(t.maxW&&(e.w=Math.min(e.w,t.maxW)),t.maxH&&(e.h=Math.min(e.h,t.maxH)),t.minW&&(e.w=Math.max(e.w,t.minW)),t.minH&&(e.h=Math.max(e.h,t.minH)),t.w!==e.w||t.h!==e.h)}moveNode(t,e){var n,r;if(!t||!e)return!1;let o;void 0===e.pack&&(o=e.pack=!0),"number"!=typeof e.x&&(e.x=t.x),"number"!=typeof e.y&&(e.y=t.y),"number"!=typeof e.w&&(e.w=t.w),"number"!=typeof e.h&&(e.h=t.h);let s=t.w!==e.w||t.h!==e.h,a=i.Utils.copyPos({},t,!0);if(i.Utils.copyPos(a,e),a=this.nodeBoundFix(a,s),i.Utils.copyPos(e,a),i.Utils.samePos(t,e))return!1;let l=i.Utils.copyPos({},t),u=this.collideAll(t,a,e.skip),c=!0;if(u.length){let s=t._moving&&!e.nested,l=s?this.directionCollideCoverage(t,e,u):u[0];if(s&&l&&(null===(r=null===(n=t.grid)||void 0===n?void 0:n.opts)||void 0===r?void 0:r.subGridDynamic)&&!t.grid._isTemp){let n=i.Utils.areaIntercept(e.rect,l._rect),r=i.Utils.area(e.rect),o=i.Utils.area(l._rect);n/(r<o?r:o)>.8&&(l.grid.makeSubGrid(l.el,void 0,t),l=void 0)}l?c=!this._fixCollisions(t,a,l,e):(c=!1,o&&delete e.pack)}return c&&(t._dirty=!0,i.Utils.copyPos(t,a)),e.pack&&this._packNodes()._notify(),!i.Utils.samePos(t,l)}getRow(){return this.nodes.reduce(((t,e)=>Math.max(t,e.y+e.h)),0)}beginUpdate(t){return t._updating||(t._updating=!0,delete t._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let t=this.nodes.find((t=>t._updating));return t&&(delete t._updating,delete t._skipDown),this}save(t=!0){var e;let n=null===(e=this._layouts)||void 0===e?void 0:e.length,r=n&&this.column!==n-1?this._layouts[n-1]:null,o=[];return this.sortNodes(),this.nodes.forEach((e=>{let n=null==r?void 0:r.find((t=>t._id===e._id)),s=Object.assign({},e);n&&(s.x=n.x,s.y=n.y,s.w=n.w),i.Utils.removeInternalForSave(s,!t),o.push(s)})),o}layoutsNodesChange(t){return!this._layouts||this._inColumnResize||this._layouts.forEach(((e,n)=>{if(!e||n===this.column)return this;if(n<this.column)this._layouts[n]=void 0;else{let i=n/this.column;t.forEach((t=>{if(!t._orig)return;let n=e.find((e=>e._id===t._id));n&&(t.y!==t._orig.y&&(n.y+=t.y-t._orig.y),t.x!==t._orig.x&&(n.x=Math.round(t.x*i)),t.w!==t._orig.w&&(n.w=Math.round(t.w*i)))}))}})),this}updateNodeWidths(t,e,n,r="moveScale"){var o;if(!this.nodes.length||!e||t===e)return this;this.cacheLayout(this.nodes,t),this.batchUpdate();let s=[],a=!1;if(1===e&&(null==n?void 0:n.length)){a=!0;let t=0;n.forEach((e=>{e.x=0,e.w=1,e.y=Math.max(e.y,t),t=e.y+e.h})),s=n,n=[]}else n=i.Utils.sort(this.nodes,-1,t);let l=[];if(e>t){l=this._layouts[e]||[];let i=this._layouts.length-1;!l.length&&t!==i&&(null===(o=this._layouts[i])||void 0===o?void 0:o.length)&&(t=i,this._layouts[i].forEach((t=>{let e=n.find((e=>e._id===t._id));e&&(e.x=t.x,e.y=t.y,e.w=t.w)})))}if(l.forEach((t=>{let e=n.findIndex((e=>e._id===t._id));-1!==e&&(n[e].x=t.x,n[e].y=t.y,n[e].w=t.w,s.push(n[e]),n.splice(e,1))})),n.length)if("function"==typeof r)r(e,t,s,n);else if(!a){let i=e/t,o="move"===r||"moveScale"===r,a="scale"===r||"moveScale"===r;n.forEach((n=>{n.x=1===e?0:o?Math.round(n.x*i):Math.min(n.x,e-1),n.w=1===e||1===t?1:a?Math.round(n.w*i)||1:Math.min(n.w,e),s.push(n)})),n=[]}return a||(s=i.Utils.sort(s,-1,e)),this._inColumnResize=!0,this.nodes=[],s.forEach((t=>{this.addNode(t,!1),delete t._orig})),this.batchUpdate(!1),delete this._inColumnResize,this}cacheLayout(t,e,n=!1){let i=[];return t.forEach(((t,e)=>{t._id=t._id||r._idSeq++,i[e]={x:t.x,y:t.y,w:t.w,_id:t._id}})),this._layouts=n?[]:this._layouts||[],this._layouts[e]=i,this}cacheOneLayout(t,e){t._id=t._id||r._idSeq++;let n={x:t.x,y:t.y,w:t.w,_id:t._id};this._layouts=this._layouts||[],this._layouts[e]=this._layouts[e]||[];let i=this.findCacheLayout(t,e);return-1===i?this._layouts[e].push(n):this._layouts[e][i]=n,this}findCacheLayout(t,e){var n,i,r;return null!==(r=null===(i=null===(n=this._layouts)||void 0===n?void 0:n[e])||void 0===i?void 0:i.findIndex((e=>e._id===t._id)))&&void 0!==r?r:-1}cleanupNode(t){for(let e in t)"_"===e[0]&&"_id"!==e&&delete t[e];return this}}e.GridStackEngine=r,r._idSeq=1},929:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.GridStack=void 0;const o=n(935),s=n(284),a=n(523);r(n(523),e),r(n(284),e),r(n(935),e);class l{constructor(t,e={}){var n,i;this._gsEventHandler={},this._extraDragRow=0,this.el=t,(e=e||{}).row&&(e.minRow=e.maxRow=e.row,delete e.row);let r=s.Utils.toNumber(t.getAttribute("gs-row"));"auto"===e.column&&delete e.column;let h=e;void 0!==h.minWidth&&(e.oneColumnSize=e.oneColumnSize||h.minWidth,delete h.minWidth),void 0!==e.alwaysShowResizeHandle&&(e._alwaysShowResizeHandle=e.alwaysShowResizeHandle);let d=Object.assign(Object.assign({},s.Utils.cloneDeep(a.gridDefaults)),{column:s.Utils.toNumber(t.getAttribute("gs-column"))||a.gridDefaults.column,minRow:r||s.Utils.toNumber(t.getAttribute("gs-min-row"))||a.gridDefaults.minRow,maxRow:r||s.Utils.toNumber(t.getAttribute("gs-max-row"))||a.gridDefaults.maxRow,staticGrid:s.Utils.toBool(t.getAttribute("gs-static"))||a.gridDefaults.staticGrid,draggable:{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||a.gridDefaults.draggable.handle},removableOptions:{accept:e.itemClass?"."+e.itemClass:a.gridDefaults.removableOptions.accept}});t.getAttribute("gs-animate")&&(d.animate=s.Utils.toBool(t.getAttribute("gs-animate"))),this.opts=s.Utils.defaults(e,d),e=null,this._initMargin(),1!==this.opts.column&&!this.opts.disableOneColumnMode&&this._widthOrContainer()<=this.opts.oneColumnSize&&(this._prevColumn=this.getColumn(),this.opts.column=1),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===t.style.direction),this.opts.rtl&&this.el.classList.add("grid-stack-rtl");let f=null===(n=s.Utils.closestUpByClass(this.el,a.gridDefaults.itemClass))||void 0===n?void 0:n.gridstackNode;f&&(f.subGrid=this,this.parentGridItem=f,this.el.classList.add("grid-stack-nested"),f.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight="auto"===this.opts.cellHeight,this._isAutoCellHeight||"initial"===this.opts.cellHeight?this.cellHeight(void 0,!1):("number"==typeof this.opts.cellHeight&&this.opts.cellHeightUnit&&this.opts.cellHeightUnit!==a.gridDefaults.cellHeightUnit&&(this.opts.cellHeight=this.opts.cellHeight+this.opts.cellHeightUnit,delete this.opts.cellHeightUnit),this.cellHeight(this.opts.cellHeight,!1)),"mobile"===this.opts.alwaysShowResizeHandle&&(this.opts.alwaysShowResizeHandle=u.isTouch),this._styleSheetClass="grid-stack-instance-"+o.GridStackEngine._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();let g=this.opts.engineClass||l.engineClass||o.GridStackEngine;if(this.engine=new g({column:this.getColumn(),float:this.opts.float,maxRow:this.opts.maxRow,onChange:t=>{let e=0;this.engine.nodes.forEach((t=>{e=Math.max(e,t.y+t.h)})),t.forEach((t=>{let e=t.el;e&&(t._removeDOM?(e&&e.remove(),delete t._removeDOM):this._writePosAttr(e,t))})),this._updateStyles(!1,e)}}),this.opts.auto){this.batchUpdate();let t=[],e=this.getColumn();1===e&&this._prevColumn&&(e=this._prevColumn),this.getGridItems().forEach((n=>{let i=parseInt(n.getAttribute("gs-x")),r=parseInt(n.getAttribute("gs-y"));t.push({el:n,i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(r)?1e3:r)*e})})),t.sort(((t,e)=>e.i-t.i)).forEach((t=>this._prepareElement(t.el))),this.batchUpdate(!1)}this.setAnimation(this.opts.animate),this._updateStyles(),12!=this.opts.column&&this.el.classList.add("grid-stack-"+this.opts.column),this.opts.dragIn&&l.setupDragIn(this.opts.dragIn,this.opts.dragInOptions),delete this.opts.dragIn,delete this.opts.dragInOptions,this.opts.subGridDynamic&&!c.DDManager.pauseDrag&&(c.DDManager.pauseDrag=!0),void 0!==(null===(i=this.opts.draggable)||void 0===i?void 0:i.pause)&&(c.DDManager.pauseDrag=this.opts.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateWindowResizeEvent()}static init(t={},e=".grid-stack"){let n=l.getGridElement(e);return n?(n.gridstack||(n.gridstack=new l(n,s.Utils.cloneDeep(t))),n.gridstack):("string"==typeof e?console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'):console.error("GridStack.init() no grid element was passed."),null)}static initAll(t={},e=".grid-stack"){let n=[];return l.getGridElements(e).forEach((e=>{e.gridstack||(e.gridstack=new l(e,s.Utils.cloneDeep(t)),delete t.dragIn,delete t.dragInOptions),n.push(e.gridstack)})),0===n.length&&console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'),n}static addGrid(t,e={}){if(!t)return null;let n=t;if(!t.classList.contains("grid-stack")){let i=document.implementation.createHTMLDocument("");i.body.innerHTML=`<div class="grid-stack ${e.class||""}"></div>`,n=i.body.children[0],t.appendChild(n)}let i=l.init(e,n);if(i.opts.children){let t=i.opts.children;delete i.opts.children,i.load(t)}return i}static registerEngine(t){l.engineClass=t}get placeholder(){if(!this._placeholder){let t=document.createElement("div");t.className="placeholder-content",this.opts.placeholderText&&(t.innerHTML=this.opts.placeholderText),this._placeholder=document.createElement("div"),this._placeholder.classList.add(this.opts.placeholderClass,a.gridDefaults.itemClass,this.opts.itemClass),this.placeholder.appendChild(t)}return this._placeholder}addWidget(t,e){let n;if("string"==typeof t){let e=document.implementation.createHTMLDocument("");e.body.innerHTML=t,n=e.body.children[0]}else if(0===arguments.length||1===arguments.length&&(void 0!==(i=t).x||void 0!==i.y||void 0!==i.w||void 0!==i.h||void 0!==i.content)){let i=t&&t.content||"";e=t;let r=document.implementation.createHTMLDocument("");r.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${i}</div></div>`,n=r.body.children[0]}else n=t;var i;let r=this._readAttr(n);e=s.Utils.cloneDeep(e)||{},s.Utils.defaults(e,r);let o=this.engine.prepareNode(e);return this._writeAttr(n,e),this._insertNotAppend?this.el.prepend(n):this.el.appendChild(n),this._prepareElement(n,!0,e),this._updateContainerHeight(),o.subGrid&&this.makeSubGrid(o.el,void 0,void 0,!1),this._prevColumn&&1===this.opts.column&&(this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,n}makeSubGrid(t,e,n,i=!0){var r;let o,a=t.gridstackNode;if(a||(a=this.makeWidget(t).gridstackNode),null===(r=a.subGrid)||void 0===r?void 0:r.el)return a.subGrid;(e=s.Utils.cloneDeep(e||a.subGrid||Object.assign(Object.assign({},this.opts.subGrid),{children:void 0}))).subGrid=s.Utils.cloneDeep(e),a.subGrid=e,"auto"===e.column&&(o=!0,e.column=Math.max(a.w||1,(null==n?void 0:n.w)||1),e.disableOneColumnMode=!0);let u,c,h=a.el.querySelector(".grid-stack-item-content");if(i){this._removeDD(a.el);let t=document.implementation.createHTMLDocument("");t.body.innerHTML='<div class="grid-stack-item"></div>',u=t.body.children[0],u.appendChild(h),c=Object.assign(Object.assign({},a),{x:0,y:0}),s.Utils.removeInternalForSave(c),delete c.subGrid,a.content&&(c.content=a.content,delete a.content),t.body.innerHTML='<div class="grid-stack-item-content"></div>',h=t.body.children[0],a.el.appendChild(h),this._prepareDragDropByNode(a)}if(n){let t=o?e.column:a.w,i=a.h+n.h,r=a.el.style;r.transition="none",this.update(a.el,{w:t,h:i}),setTimeout((()=>r.transition=null))}let d=a.subGrid=l.addGrid(h,e);return(null==n?void 0:n._moving)&&(d._isTemp=!0),o&&(d._autoColumn=!0),i&&d.addWidget(u,c),n&&(n._moving?window.setTimeout((()=>s.Utils.simulateMouseEvent(n._event,"mouseenter",d.el)),0):d.addWidget(a.el,a)),d}removeAsSubGrid(t){var e;let n=null===(e=this.parentGridItem)||void 0===e?void 0:e.grid;n&&(n.batchUpdate(),n.removeWidget(this.parentGridItem.el,!0,!0),this.engine.nodes.forEach((t=>{t.x+=this.parentGridItem.x,t.y+=this.parentGridItem.y,n.addWidget(t.el,t)})),n.batchUpdate(!1),delete this.parentGridItem,t&&window.setTimeout((()=>s.Utils.simulateMouseEvent(t._event,"mouseenter",n.el)),0))}save(t=!0,e=!1){let n=this.engine.save(t);if(n.forEach((e=>{if(t&&e.el&&!e.subGrid){let t=e.el.querySelector(".grid-stack-item-content");e.content=t?t.innerHTML:void 0,e.content||delete e.content}else t||delete e.content,e.subGrid&&(e.subGrid=e.subGrid.save(t,!0));delete e.el})),e){let t=s.Utils.cloneDeep(this.opts);t.marginBottom===t.marginTop&&t.marginRight===t.marginLeft&&t.marginTop===t.marginRight&&(t.margin=t.marginTop,delete t.marginTop,delete t.marginRight,delete t.marginBottom,delete t.marginLeft),t.rtl===("rtl"===this.el.style.direction)&&(t.rtl="auto"),this._isAutoCellHeight&&(t.cellHeight="auto"),this._autoColumn&&(t.column="auto",delete t.disableOneColumnMode);const e=t._alwaysShowResizeHandle;return delete t._alwaysShowResizeHandle,void 0!==e?t.alwaysShowResizeHandle=e:delete t.alwaysShowResizeHandle,s.Utils.removeInternalAndSame(t,a.gridDefaults),t.children=n,t}return n}load(t,e=!0){let n=l.Utils.sort([...t],-1,this._prevColumn||this.getColumn());this._insertNotAppend=!0,this._prevColumn&&this._prevColumn!==this.opts.column&&n.some((t=>t.x+t.w>this.opts.column))&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(n,this._prevColumn,!0));let i=[];return this.batchUpdate(),e&&[...this.engine.nodes].forEach((t=>{n.find((e=>t.id===e.id))||("function"==typeof e?e(this,t,!1):(i.push(t),this.removeWidget(t.el,!0,!1)))})),n.forEach((t=>{let n=t.id||0===t.id?this.engine.nodes.find((e=>e.id===t.id)):void 0;if(n){if(this.update(n.el,t),t.subGrid&&t.subGrid.children){let e=n.el.querySelector(".grid-stack");e&&e.gridstack&&(e.gridstack.load(t.subGrid.children),this._insertNotAppend=!0)}}else e&&(t="function"==typeof e?e(this,t,!0).gridstackNode:this.addWidget(t).gridstackNode)})),this.engine.removedNodes=i,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this._insertNotAppend,this}batchUpdate(t=!0){return this.engine.batchUpdate(t),t||(this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(t=!1){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight&&(!t||!this.opts.cellHeightUnit||"px"===this.opts.cellHeightUnit))return this.opts.cellHeight;let e=this.el.querySelector("."+this.opts.itemClass);if(e){let t=s.Utils.toNumber(e.getAttribute("gs-h"));return Math.round(e.offsetHeight/t)}let n=parseInt(this.el.getAttribute("gs-current-row"));return n?Math.round(this.el.getBoundingClientRect().height/n):this.opts.cellHeight}cellHeight(t,e=!0){if(e&&void 0!==t&&this._isAutoCellHeight!==("auto"===t)&&(this._isAutoCellHeight="auto"===t,this._updateWindowResizeEvent()),"initial"!==t&&"auto"!==t||(t=void 0),void 0===t){let e=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;t=this.cellWidth()+e}let n=s.Utils.parseHeight(t);return this.opts.cellHeightUnit===n.unit&&this.opts.cellHeight===n.h||(this.opts.cellHeightUnit=n.unit,this.opts.cellHeight=n.h,e&&this._updateStyles(!0)),this}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(){return this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}compact(){return this.engine.compact(),this._triggerChangeEvent(),this}column(t,e="moveScale"){if(t<1||this.opts.column===t)return this;let n,i=this.getColumn();return 1===t?this._prevColumn=i:delete this._prevColumn,this.el.classList.remove("grid-stack-"+i),this.el.classList.add("grid-stack-"+t),this.opts.column=this.engine.column=t,1===t&&this.opts.oneColumnModeDomSort&&(n=[],this.getGridItems().forEach((t=>{t.gridstackNode&&n.push(t.gridstackNode)})),n.length||(n=void 0)),this.engine.updateNodeWidths(i,t,n,e),this._isAutoCellHeight&&this.cellHeight(),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter((t=>t.matches("."+this.opts.itemClass)&&!t.matches("."+this.opts.placeholderClass)))}destroy(t=!0){if(this.el)return this._updateWindowResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.classList.remove(this._styleSheetClass)),this._removeStylesheet(),this.el.removeAttribute("gs-current-row"),delete this.parentGridItem,delete this.opts,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(t){return this.opts.float!==t&&(this.opts.float=this.engine.float=t,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(t,e=!1){let n,i=this.el.getBoundingClientRect();n=e?{top:i.top+document.documentElement.scrollTop,left:i.left}:{top:this.el.offsetTop,left:this.el.offsetLeft};let r=t.left-n.left,o=t.top-n.top,s=i.width/this.getColumn(),a=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/s),y:Math.floor(o/a)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(t,e,n,i){return this.engine.isAreaEmpty(t,e,n,i)}makeWidget(t){let e=l.getElement(t);return this._prepareElement(e,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),e}on(t,e){if(-1!==t.indexOf(" "))return t.split(" ").forEach((t=>this.on(t,e))),this;if("change"===t||"added"===t||"removed"===t||"enable"===t||"disable"===t){let n="enable"===t||"disable"===t;this._gsEventHandler[t]=n?t=>e(t):t=>e(t,t.detail),this.el.addEventListener(t,this._gsEventHandler[t])}else"drag"===t||"dragstart"===t||"dragstop"===t||"resizestart"===t||"resize"===t||"resizestop"===t||"dropped"===t?this._gsEventHandler[t]=e:console.log("GridStack.on("+t+') event not supported, but you can still use $(".grid-stack").on(...) while jquery-ui is still used internally.');return this}off(t){return-1!==t.indexOf(" ")?(t.split(" ").forEach((t=>this.off(t))),this):("change"!==t&&"added"!==t&&"removed"!==t&&"enable"!==t&&"disable"!==t||this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}removeWidget(t,e=!0,n=!0){return l.getElements(t).forEach((t=>{if(t.parentElement&&t.parentElement!==this.el)return;let i=t.gridstackNode;i||(i=this.engine.nodes.find((e=>t===e.el))),i&&(delete t.gridstackNode,this._removeDD(t),this.engine.removeNode(i,e,n),e&&t.parentElement&&t.remove())})),n&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this}removeAll(t=!0){return this.engine.nodes.forEach((t=>{delete t.el.gridstackNode,this._removeDD(t.el)})),this.engine.removeAll(t),this._triggerRemoveEvent(),this}setAnimation(t){return t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}setStatic(t,e=!0){return this.opts.staticGrid===t||(this.opts.staticGrid=t,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach((t=>this._prepareDragDropByNode(t))),e&&this._setStaticClass()),this}update(t,e){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update(el, {x, w, content, ...})`. It will be removed soon");let n=arguments,i=1;return e={x:n[i++],y:n[i++],w:n[i++],h:n[i++]},this.update(t,e)}return l.getElements(t).forEach((t=>{if(!t||!t.gridstackNode)return;let n=t.gridstackNode,i=s.Utils.cloneDeep(e);delete i.autoPosition;let r,o=["x","y","w","h"];if(o.some((t=>void 0!==i[t]&&i[t]!==n[t]))&&(r={},o.forEach((t=>{r[t]=void 0!==i[t]?i[t]:n[t],delete i[t]}))),!r&&(i.minW||i.minH||i.maxW||i.maxH)&&(r={}),i.content){let e=t.querySelector(".grid-stack-item-content");e&&e.innerHTML!==i.content&&(e.innerHTML=i.content),delete i.content}let a=!1,l=!1;for(const t in i)"_"!==t[0]&&n[t]!==i[t]&&(n[t]=i[t],a=!0,l=l||!this.opts.staticGrid&&("noResize"===t||"noMove"===t||"locked"===t));r&&(this.engine.cleanNodes().beginUpdate(n).moveNode(n,r),this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()),a&&this._writeAttr(t,n),l&&this._prepareDragDropByNode(n)})),this}margin(t){if(!("string"==typeof t&&t.split(" ").length>1)){let e=s.Utils.parseHeight(t);if(this.opts.marginUnit===e.unit&&this.opts.margin===e.h)return}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(t){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let t=arguments,e=0,n={x:t[e++],y:t[e++],w:t[e++],h:t[e++],autoPosition:t[e++]};return this.willItFit(n)}return this.engine.willItFit(t)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let t=this.engine.getDirtyNodes(!0);return t&&t.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine.saveInitial(),this}_triggerAddEvent(){return this.engine.batchMode||this.engine.addedNodes&&this.engine.addedNodes.length>0&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach((t=>{delete t._dirty})),this._triggerEvent("added",this.engine.addedNodes),this.engine.addedNodes=[]),this}_triggerRemoveEvent(){return this.engine.batchMode||this.engine.removedNodes&&this.engine.removedNodes.length>0&&(this._triggerEvent("removed",this.engine.removedNodes),this.engine.removedNodes=[]),this}_triggerEvent(t,e){let n=e?new CustomEvent(t,{bubbles:!1,detail:e}):new Event(t);return this.el.dispatchEvent(n),this}_removeStylesheet(){return this._styles&&(s.Utils.removeStylesheet(this._styleSheetClass),delete this._styles),this}_updateStyles(t=!1,e){if(t&&this._removeStylesheet(),e||(e=this.getRow()),this._updateContainerHeight(),0===this.opts.cellHeight)return this;let n=this.opts.cellHeight,i=this.opts.cellHeightUnit,r=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let t=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=s.Utils.createStylesheet(this._styleSheetClass,t),!this._styles)return this;this._styles._max=0,s.Utils.addCSSRule(this._styles,r,`min-height: ${n}${i}`);let e=this.opts.marginTop+this.opts.marginUnit,o=this.opts.marginBottom+this.opts.marginUnit,a=this.opts.marginRight+this.opts.marginUnit,l=this.opts.marginLeft+this.opts.marginUnit,u=`${r} > .grid-stack-item-content`,c=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;s.Utils.addCSSRule(this._styles,u,`top: ${e}; right: ${a}; bottom: ${o}; left: ${l};`),s.Utils.addCSSRule(this._styles,c,`top: ${e}; right: ${a}; bottom: ${o}; left: ${l};`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-ne`,`right: ${a}`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-e`,`right: ${a}`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-se`,`right: ${a}; bottom: ${o}`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-nw`,`left: ${l}`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-w`,`left: ${l}`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-sw`,`left: ${l}; bottom: ${o}`)}if((e=e||this._styles._max)>this._styles._max){let t=t=>n*t+i;for(let n=this._styles._max+1;n<=e;n++){let e=t(n);s.Utils.addCSSRule(this._styles,`${r}[gs-y="${n-1}"]`,`top: ${t(n-1)}`),s.Utils.addCSSRule(this._styles,`${r}[gs-h="${n}"]`,`height: ${e}`),s.Utils.addCSSRule(this._styles,`${r}[gs-min-h="${n}"]`,`min-height: ${e}`),s.Utils.addCSSRule(this._styles,`${r}[gs-max-h="${n}"]`,`max-height: ${e}`)}this._styles._max=e}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.getRow()+this._extraDragRow;if(this.el.setAttribute("gs-current-row",String(t)),0===t)return this.el.style.removeProperty("min-height"),this;let e=this.opts.cellHeight,n=this.opts.cellHeightUnit;return e?(this.el.style.minHeight=t*e+n,this):this}_prepareElement(t,e=!1,n){n||(t.classList.add(this.opts.itemClass),n=this._readAttr(t)),t.gridstackNode=n,n.el=t,n.grid=this;let i=Object.assign({},n);return n=this.engine.addNode(n,e),s.Utils.same(n,i)||this._writeAttr(t,n),this._prepareDragDropByNode(n),this}_writePosAttr(t,e){return void 0!==e.x&&null!==e.x&&t.setAttribute("gs-x",String(e.x)),void 0!==e.y&&null!==e.y&&t.setAttribute("gs-y",String(e.y)),e.w&&t.setAttribute("gs-w",String(e.w)),e.h&&t.setAttribute("gs-h",String(e.h)),this}_writeAttr(t,e){if(!e)return this;this._writePosAttr(t,e);let n={autoPosition:"gs-auto-position",minW:"gs-min-w",minH:"gs-min-h",maxW:"gs-max-w",maxH:"gs-max-h",noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",resizeHandles:"gs-resize-handles"};for(const i in n)e[i]?t.setAttribute(n[i],String(e[i])):t.removeAttribute(n[i]);return this}_readAttr(t){let e={};e.x=s.Utils.toNumber(t.getAttribute("gs-x")),e.y=s.Utils.toNumber(t.getAttribute("gs-y")),e.w=s.Utils.toNumber(t.getAttribute("gs-w")),e.h=s.Utils.toNumber(t.getAttribute("gs-h")),e.maxW=s.Utils.toNumber(t.getAttribute("gs-max-w")),e.minW=s.Utils.toNumber(t.getAttribute("gs-min-w")),e.maxH=s.Utils.toNumber(t.getAttribute("gs-max-h")),e.minH=s.Utils.toNumber(t.getAttribute("gs-min-h")),e.autoPosition=s.Utils.toBool(t.getAttribute("gs-auto-position")),e.noResize=s.Utils.toBool(t.getAttribute("gs-no-resize")),e.noMove=s.Utils.toBool(t.getAttribute("gs-no-move")),e.locked=s.Utils.toBool(t.getAttribute("gs-locked")),e.resizeHandles=t.getAttribute("gs-resize-handles"),e.id=t.getAttribute("gs-id");for(const t in e){if(!e.hasOwnProperty(t))return;e[t]||0===e[t]||delete e[t]}return e}_setStaticClass(){let t=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...t),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...t),this.el.removeAttribute("gs-static")),this}onParentResize(){if(!this.el||!this.el.clientWidth)return;let t=!1;if(this._autoColumn&&this.parentGridItem)this.opts.column!==this.parentGridItem.w&&(t=!0,this.column(this.parentGridItem.w,"none"));else{let e=!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.oneColumnSize;1===this.opts.column!==e&&(t=!0,this.opts.animate&&this.setAnimation(!1),this.column(e?1:this._prevColumn),this.opts.animate&&this.setAnimation(!0))}return this._isAutoCellHeight&&(!t&&this.opts.cellHeightThrottle?(this._cellHeightThrottle||(this._cellHeightThrottle=s.Utils.throttle((()=>this.cellHeight()),this.opts.cellHeightThrottle)),this._cellHeightThrottle()):this.cellHeight()),this.engine.nodes.forEach((t=>{t.subGrid&&t.subGrid.onParentResize()})),this}_updateWindowResizeEvent(t=!1){const e=(this._isAutoCellHeight||!this.opts.disableOneColumnMode)&&!this.parentGridItem;return t||!e||this._windowResizeBind?!t&&e||!this._windowResizeBind||(window.removeEventListener("resize",this._windowResizeBind),delete this._windowResizeBind):(this._windowResizeBind=this.onParentResize.bind(this),window.addEventListener("resize",this._windowResizeBind)),this}static getElement(t=".grid-stack-item"){return s.Utils.getElement(t)}static getElements(t=".grid-stack-item"){return s.Utils.getElements(t)}static getGridElement(t){return l.getElement(t)}static getGridElements(t){return s.Utils.getElements(t)}_initMargin(){let t,e=0,n=[];return"string"==typeof this.opts.margin&&(n=this.opts.margin.split(" ")),2===n.length?(this.opts.marginTop=this.opts.marginBottom=n[0],this.opts.marginLeft=this.opts.marginRight=n[1]):4===n.length?(this.opts.marginTop=n[0],this.opts.marginRight=n[1],this.opts.marginBottom=n[2],this.opts.marginLeft=n[3]):(t=s.Utils.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,e=this.opts.margin=t.h),void 0===this.opts.marginTop?this.opts.marginTop=e:(t=s.Utils.parseHeight(this.opts.marginTop),this.opts.marginTop=t.h,delete this.opts.margin),void 0===this.opts.marginBottom?this.opts.marginBottom=e:(t=s.Utils.parseHeight(this.opts.marginBottom),this.opts.marginBottom=t.h,delete this.opts.margin),void 0===this.opts.marginRight?this.opts.marginRight=e:(t=s.Utils.parseHeight(this.opts.marginRight),this.opts.marginRight=t.h,delete this.opts.margin),void 0===this.opts.marginLeft?this.opts.marginLeft=e:(t=s.Utils.parseHeight(this.opts.marginLeft),this.opts.marginLeft=t.h,delete this.opts.margin),this.opts.marginUnit=t.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}static setupDragIn(t,e){}movable(t,e){return this}resizable(t,e){return this}disable(){return this}enable(){return this}enableMove(t){return this}enableResize(t){return this}_removeDD(t){return this}_setupAcceptWidget(){return this}_setupRemoveDrop(){return this}_prepareDragDropByNode(t){return this}_onStartMoving(t,e,n,i,r,o){}_dragOrResize(t,e,n,i,r,o){}_leave(t,e){}commit(){return s.obsolete(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}e.GridStack=l,l.Utils=s.Utils,l.Engine=o.GridStackEngine,l.GDRev="7.1.1";const u=n(168),c=n(427);r(n(470),e)},523:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dragInDefaultOptions=e.gridDefaults=void 0,e.gridDefaults={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body"},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,oneColumnSize:768,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:".grid-stack-item"},resizable:{handles:"se"},rtl:"auto"},e.dragInDefaultOptions={handle:".grid-stack-item-content",appendTo:"body"}},284:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Utils=e.obsoleteAttr=e.obsoleteOptsDel=e.obsoleteOpts=e.obsolete=void 0,e.obsolete=function(t,e,n,i,r){let o=(...o)=>(console.warn("gridstack.js: Function `"+n+"` is deprecated in "+r+" and has been replaced with `"+i+"`. It will be **removed** in a future release"),e.apply(t,o));return o.prototype=e.prototype,o},e.obsoleteOpts=function(t,e,n,i){void 0!==t[e]&&(t[n]=t[e],console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+" and has been replaced with `"+n+"`. It will be **removed** in a future release"))},e.obsoleteOptsDel=function(t,e,n,i){void 0!==t[e]&&console.warn("gridstack.js: Option `"+e+"` is deprecated in "+n+i)},e.obsoleteAttr=function(t,e,n,i){let r=t.getAttribute(e);null!==r&&(t.setAttribute(n,r),console.warn("gridstack.js: attribute `"+e+"`="+r+" is deprecated on this object in "+i+" and has been replaced with `"+n+"`. It will be **removed** in a future release"))};class n{static getElements(t){if("string"==typeof t){let e=document.querySelectorAll(t);return e.length||"."===t[0]||"#"===t[0]||(e=document.querySelectorAll("."+t),e.length||(e=document.querySelectorAll("#"+t))),Array.from(e)}return[t]}static getElement(t){if("string"==typeof t){if(!t.length)return null;if("#"===t[0])return document.getElementById(t.substring(1));if("."===t[0]||"["===t[0])return document.querySelector(t);if(!isNaN(+t[0]))return document.getElementById(t);let e=document.querySelector(t);return e||(e=document.getElementById(t)),e||(e=document.querySelector("."+t)),e}return t}static isIntercepted(t,e){return!(t.y>=e.y+e.h||t.y+t.h<=e.y||t.x+t.w<=e.x||t.x>=e.x+e.w)}static isTouching(t,e){return n.isIntercepted(t,{x:e.x-.5,y:e.y-.5,w:e.w+1,h:e.h+1})}static areaIntercept(t,e){let n=t.x>e.x?t.x:e.x,i=t.x+t.w<e.x+e.w?t.x+t.w:e.x+e.w;if(i<=n)return 0;let r=t.y>e.y?t.y:e.y,o=t.y+t.h<e.y+e.h?t.y+t.h:e.y+e.h;return o<=r?0:(i-n)*(o-r)}static area(t){return t.w*t.h}static sort(t,e,n){return n=n||t.reduce(((t,e)=>Math.max(e.x+e.w,t)),0)||12,-1===e?t.sort(((t,e)=>e.x+e.y*n-(t.x+t.y*n))):t.sort(((t,e)=>t.x+t.y*n-(e.x+e.y*n)))}static createStylesheet(t,e){let n=document.createElement("style");return n.setAttribute("type","text/css"),n.setAttribute("gs-style-id",t),n.styleSheet?n.styleSheet.cssText="":n.appendChild(document.createTextNode("")),e?e.insertBefore(n,e.firstChild):(e=document.getElementsByTagName("head")[0]).appendChild(n),n.sheet}static removeStylesheet(t){let e=document.querySelector("STYLE[gs-style-id="+t+"]");e&&e.parentNode&&e.remove()}static addCSSRule(t,e,n){"function"==typeof t.addRule?t.addRule(e,n):"function"==typeof t.insertRule&&t.insertRule(`${e}{${n}}`)}static toBool(t){return"boolean"==typeof t?t:"string"==typeof t?!(""===(t=t.toLowerCase())||"no"===t||"false"===t||"0"===t):Boolean(t)}static toNumber(t){return null===t||0===t.length?void 0:Number(t)}static parseHeight(t){let e,n="px";if("string"==typeof t){let i=t.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!i)throw new Error("Invalid height");n=i[2]||"px",e=parseFloat(i[1])}else e=t;return{h:e,unit:n}}static defaults(t,...e){return e.forEach((e=>{for(const n in e){if(!e.hasOwnProperty(n))return;null===t[n]||void 0===t[n]?t[n]=e[n]:"object"==typeof e[n]&&"object"==typeof t[n]&&this.defaults(t[n],e[n])}})),t}static same(t,e){if("object"!=typeof t)return t==e;if(typeof t!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}static copyPos(t,e,n=!1){return t.x=e.x,t.y=e.y,t.w=e.w,t.h=e.h,n&&(e.minW&&(t.minW=e.minW),e.minH&&(t.minH=e.minH),e.maxW&&(t.maxW=e.maxW),e.maxH&&(t.maxH=e.maxH)),t}static samePos(t,e){return t&&e&&t.x===e.x&&t.y===e.y&&t.w===e.w&&t.h===e.h}static removeInternalAndSame(t,e){if("object"==typeof t&&"object"==typeof e)for(let n in t){let i=t[n];if("_"===n[0]||i===e[n])delete t[n];else if(i&&"object"==typeof i&&void 0!==e[n]){for(let t in i)i[t]!==e[n][t]&&"_"!==t[0]||delete i[t];Object.keys(i).length||delete t[n]}}}static removeInternalForSave(t,e=!0){for(let e in t)"_"!==e[0]&&null!==t[e]&&void 0!==t[e]||delete t[e];delete t.grid,e&&delete t.el,t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,t.locked||delete t.locked,1!==t.w&&t.w!==t.minW||delete t.w,1!==t.h&&t.h!==t.minH||delete t.h}static closestUpByClass(t,e){for(;t;){if(t.classList.contains(e))return t;t=t.parentElement}return null}static throttle(t,e){let n=!1;return(...i)=>{n||(n=!0,setTimeout((()=>{t(...i),n=!1}),e))}}static removePositioningStyles(t){let e=t.style;e.position&&e.removeProperty("position"),e.left&&e.removeProperty("left"),e.top&&e.removeProperty("top"),e.width&&e.removeProperty("width"),e.height&&e.removeProperty("height")}static getScrollElement(t){if(!t)return document.scrollingElement||document.documentElement;const e=getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowY)?t:this.getScrollElement(t.parentElement)}static updateScrollPosition(t,e,n){let i=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight;if(i.top<0||i.bottom>r){let o=i.bottom-r,s=i.top,a=this.getScrollElement(t);if(null!==a){let l=a.scrollTop;i.top<0&&n<0?t.offsetHeight>r?a.scrollTop+=n:a.scrollTop+=Math.abs(s)>Math.abs(n)?n:s:n>0&&(t.offsetHeight>r?a.scrollTop+=n:a.scrollTop+=o>n?n:o),e.top+=a.scrollTop-l}}}static updateScrollResize(t,e,n){const i=this.getScrollElement(e),r=i.clientHeight,o=i===this.getScrollElement()?0:i.getBoundingClientRect().top,s=t.clientY-o,a=s>r-n;s<n?i.scrollBy({behavior:"smooth",top:s-n}):a&&i.scrollBy({behavior:"smooth",top:n-(r-s)})}static clone(t){return null==t||"object"!=typeof t?t:t instanceof Array?[...t]:Object.assign({},t)}static cloneDeep(t){const e=["parentGrid","el","grid","subGrid","engine"],i=n.clone(t);for(const r in i)i.hasOwnProperty(r)&&"object"==typeof i[r]&&"__"!==r.substring(0,2)&&!e.find((t=>t===r))&&(i[r]=n.cloneDeep(t[r]));return i}static cloneNode(t){const e=t.cloneNode(!0);return e.removeAttribute("id"),e}static appendTo(t,e){let n;n="string"==typeof e?document.querySelector(e):e,n&&n.appendChild(t)}static addElStyles(t,e){if(e instanceof Object)for(const n in e)e.hasOwnProperty(n)&&(Array.isArray(e[n])?e[n].forEach((e=>{t.style[n]=e})):t.style[n]=e[n])}static initEvent(t,e){const n={type:e.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:e.target?e.target:t.target};return t.dataTransfer&&(n.dataTransfer=t.dataTransfer),["altKey","ctrlKey","metaKey","shiftKey"].forEach((e=>n[e]=t[e])),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach((e=>n[e]=t[e])),Object.assign(Object.assign({},n),i)}static simulateMouseEvent(t,e,n){const i=document.createEvent("MouseEvents");i.initMouseEvent(e,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,0,t.target),(n||t.target).dispatchEvent(i)}}e.Utils=n},379:t=>{var e=[];function n(t){for(var n=-1,i=0;i<e.length;i++)if(e[i].identifier===t){n=i;break}return n}function i(t,i){for(var o={},s=[],a=0;a<t.length;a++){var l=t[a],u=i.base?l[0]+i.base:l[0],c=o[u]||0,h="".concat(u," ").concat(c);o[u]=c+1;var d=n(h),f={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var g=r(f,i);i.byIndex=a,e.splice(a,0,{identifier:h,updater:g,references:1})}s.push(h)}return s}function r(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,r){var o=i(t=t||[],r=r||{});return function(t){t=t||[];for(var s=0;s<o.length;s++){var a=n(o[s]);e[a].references--}for(var l=i(t,r),u=0;u<o.length;u++){var c=n(o[u]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}o=l}}},569:t=>{var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},216:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},795:t=>{t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},810:t=>{t.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMS42MjYgNTExLjYyNyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTExLjYyNiA1MTEuNjI3OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggZD0iTTMyOC45MDYsNDAxLjk5NGgtMzYuNTUzVjEwOS42MzZoMzYuNTUzYzQuOTQ4LDAsOS4yMzYtMS44MDksMTIuODQ3LTUuNDI2YzMuNjEzLTMuNjE1LDUuNDIxLTcuODk4LDUuNDIxLTEyLjg0NSAgIGMwLTQuOTQ5LTEuODAxLTkuMjMxLTUuNDI4LTEyLjg1MWwtNzMuMDg3LTczLjA5QzI2NS4wNDQsMS44MDksMjYwLjc2LDAsMjU1LjgxMywwYy00Ljk0OCwwLTkuMjI5LDEuODA5LTEyLjg0Nyw1LjQyNCAgIGwtNzMuMDg4LDczLjA5Yy0zLjYxOCwzLjYxOS01LjQyNCw3LjkwMi01LjQyNCwxMi44NTFjMCw0Ljk0NiwxLjgwNyw5LjIyOSw1LjQyNCwxMi44NDVjMy42MTksMy42MTcsNy45MDEsNS40MjYsMTIuODUsNS40MjYgICBoMzYuNTQ1djI5Mi4zNThoLTM2LjU0MmMtNC45NTIsMC05LjIzNSwxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MjEtNS40MjQsNy45MDUtNS40MjQsMTIuODU0ICAgYzAsNC45NDUsMS44MDcsOS4yMjcsNS40MjQsMTIuODQ3bDczLjA4OSw3My4wODhjMy42MTcsMy42MTcsNy44OTgsNS40MjQsMTIuODQ3LDUuNDI0YzQuOTUsMCw5LjIzNC0xLjgwNywxMi44NDktNS40MjQgICBsNzMuMDg3LTczLjA4OGMzLjYxMy0zLjYyLDUuNDIxLTcuOTAxLDUuNDIxLTEyLjg0N2MwLTQuOTQ4LTEuODA4LTkuMjMyLTUuNDIxLTEyLjg1NCAgIEMzMzguMTQyLDQwMy44MDIsMzMzLjg1Nyw0MDEuOTk0LDMyOC45MDYsNDAxLjk5NHoiIGZpbGw9IiM2NjY2NjYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K"}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={id:i,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.b=document.baseURI||self.location.href,n.nc=void 0;var i={};return(()=>{n.r(i),n.d(i,{AreaChartWidget:()=>il,BarChartWidget:()=>Ga,BaseChartWidget:()=>Ea,LineChartWidget:()=>Ra,PieChartWidget:()=>Za,StackedBarChartWidget:()=>pl,getResult:()=>k,initGrid:()=>T});var t=n(379),e=n.n(t),r=n(795),o=n.n(r),s=n(569),a=n.n(s),l=n(565),u=n.n(l),c=n(216),h=n.n(c),d=n(589),f=n.n(d),g=n(466),p={};p.styleTagTransform=f(),p.setAttributes=u(),p.insert=a().bind(null,"head"),p.domAPI=o(),p.insertStyleElement=h(),e()(g.Z,p),g.Z&&g.Z.locals&&g.Z.locals;var m=n(744),y={};y.styleTagTransform=f(),y.setAttributes=u(),y.insert=a().bind(null,"head"),y.domAPI=o(),y.insertStyleElement=h(),e()(m.Z,y),m.Z&&m.Z.locals&&m.Z.locals;var v=n(929);function b(t){return b="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},b(t)}function w(){w=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,s=Object.create(o.prototype),a=new S(r||[]);return i(s,"_invoke",{value:M(t,n,a)}),s}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function d(){}function f(){}function g(){}var p={};l(p,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(C([])));y&&y!==e&&n.call(y,o)&&(p=y);var v=g.prototype=d.prototype=Object.create(p);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,s,a){var l=c(t[i],t,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==b(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,a)}))}a(l.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function M(t,e,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return{value:void 0,done:!0}}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=k(s,n);if(a){if(a===h)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=c(t,e,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function k(t,e){var n=e.method,i=t.iterator[n];if(void 0===i)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var r=c(i,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,r=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:A}}function A(){return{value:void 0,done:!0}}return f.prototype=g,i(v,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:f,configurable:!0}),f.displayName=l(g,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,a,"GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},_(x.prototype),l(x.prototype,s,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var s=new x(u(e,n,i,r),o);return t.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(v),l(v,a,"Generator"),l(v,o,(function(){return this})),l(v,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},t.values=C,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(n,i){return s.type="throw",s.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),D(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;D(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function x(t,e,n,i,r,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function M(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function s(t){x(o,i,r,s,a,"next",t)}function a(t){x(o,i,r,s,a,"throw",t)}s(void 0)}))}}function k(t,e){return E.apply(this,arguments)}function E(){return(E=M(w().mark((function t(e,n){var i,r;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(n,{headers:{Authorization:"Basic ".concat(e)}});case 2:return i=t.sent,t.next=5,i.json();case 5:if(r=t.sent,200===i.status){t.next=8;break}throw Error(r.message);case 8:return t.abrupt("return",r);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function D(t,e){var n,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return _(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.subGrid)D(r.subGrid.engine.nodes,e);else{var o=e[r.widgetId];if(o)S(r,o);else if(r.el.getAttribute("widgetId")){var s=r.el.getAttribute("widgetId");S(r,e[s])}else console.error("Couldn't find widget by id ".concat(r.widgetId))}}}catch(t){i.e(t)}finally{i.f()}}function S(t,e){var n=t.el.querySelector(".grid-stack-item-content"),i=n.offsetWidth,r=n.offsetHeight;n.innerHTML=e.plot(i,r)}function C(t,e){var n=t.plot(400,400),i=document.createElement("div");return i.innerHTML='<div class="newWidget grid-stack-item" widgetId="'.concat(e,'"><div class="grid-stack-item-content">').concat(n,"</div></div>"),i}function A(t){var e=t.srcElement.closest(".newWidget").cloneNode(!0);return e.style.removeProperty("newWidget"),e}function T(t,e){var n=t,i=v.GridStack.init({cellHeight:70,acceptWidgets:!0,removable:".dropzone-remove",minRow:2,subGrid:{disableOneColumnMode:!0,minRow:2,cellHeight:70,margin:5,acceptWidgets:!0,locked:!0,noResize:!0,noMove:!0,removable:".dropzone-remove"},subGridDynamic:!0});function r(){i.enableResize(!0),i.enableMove(!0),i.engine.nodes.map((function(t){t.subGrid&&(t.subGrid.enableResize(!0),t.subGrid.enableMove(!0))}))}function o(){i.enableResize(!1),i.enableMove(!1),i.engine.nodes.map((function(t){t.subGrid&&(t.subGrid.enableResize(!1),t.subGrid.enableMove(!1))}))}return i.load(e),i.setAnimation(!1),function(t){window.addEventListener("resize",(function(e){D(t.engine.nodes,n)}),!0)}(i),D(i.engine.nodes,n),o(),i.engine.nodes.map((function(t){t.subGrid&&t.subGrid.on("resizestop",(function(t,e){D(i.engine.nodes,n)}))})),i.on("removed change",(function(t,e){D(i.engine.nodes,n)})),i.on("added",(function(t,e){D(i.engine.nodes,n)})),{grid:i,toggleSidebar:function(){var t=document.getElementById("sidebar");"sidebar"===t.className?(o(),t.className="sidebar-hidden",function(t){for(;t.firstChild;)t.removeChild(t.firstChild)}(document.getElementById("available-widgets")),D(i.engine.nodes,n)):(t.className="sidebar",function(t){for(var e=document.getElementById("available-widgets"),n=0,i=Object.keys(t);n<i.length;n++){var r=i[n],o=C(t[r],r);e.appendChild(o,r)}}(n),v.GridStack.setupDragIn(".newWidget",{revert:"invalid",scroll:!1,appendTo:"body",helper:A}),r(),D(i.engine.nodes,n))},save:function(){return i.save().map((function(t){return t.subGrid?{x:t.x,y:t.y,w:t.w,h:t.h,subGrid:{x:t.subGrid.x,y:t.subGrid.y,w:t.subGrid.w,h:t.subGrid.h,children:t.subGrid.children.map((function(t){return{x:t.x,y:t.y,w:t.w,h:t.h,widgetId:t.widgetId}}))}}:{x:t.x,y:t.y,w:t.w,h:t.h,widgetId:t.widgetId}}))},load:function(t){i.removeAll(),i.load(t),D(i.engine.nodes,n),o()},enableWidgetMoveAndResize:r,disableWidgetMoveAndResize:o,refreshWidgets:function(t){n=t,D(i.engine.nodes,n)}}}function N(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(void 0===n?o>=o&&(n=i=o):(n>o&&(n=o),i<o&&(i=o)))}return[n,i]}function O(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function L(t){return t}var R=1e-6;function z(t){return"translate("+t+",0)"}function j(t){return"translate(0,"+t+")"}function U(t){return e=>+t(e)}function P(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function H(){return!this.__axis}function I(t,e){var n=[],i=null,r=null,o=6,s=6,a=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,u=1===t||4===t?-1:1,c=4===t||2===t?"x":"y",h=1===t||3===t?z:j;function d(d){var f=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,g=null==r?e.tickFormat?e.tickFormat.apply(e,n):L:r,p=Math.max(o,0)+a,m=e.range(),y=+m[0]+l,v=+m[m.length-1]+l,b=(e.bandwidth?P:U)(e.copy(),l),w=d.selection?d.selection():d,_=w.selectAll(".domain").data([null]),x=w.selectAll(".tick").data(f,e).order(),M=x.exit(),k=x.enter().append("g").attr("class","tick"),E=x.select("line"),D=x.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(k),E=E.merge(k.append("line").attr("stroke","currentColor").attr(c+"2",u*o)),D=D.merge(k.append("text").attr("fill","currentColor").attr(c,u*p).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),d!==w&&(_=_.transition(d),x=x.transition(d),E=E.transition(d),D=D.transition(d),M=M.transition(d).attr("opacity",R).attr("transform",(function(t){return isFinite(t=b(t))?h(t+l):this.getAttribute("transform")})),k.attr("opacity",R).attr("transform",(function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:b(t))+l)}))),M.remove(),_.attr("d",4===t||2===t?s?"M"+u*s+","+y+"H"+l+"V"+v+"H"+u*s:"M"+l+","+y+"V"+v:s?"M"+y+","+u*s+"V"+l+"H"+v+"V"+u*s:"M"+y+","+l+"H"+v),x.attr("opacity",1).attr("transform",(function(t){return h(b(t)+l)})),E.attr(c+"2",u*o),D.attr(c,u*p).text(g),w.filter(H).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),w.each((function(){this.__axis=b}))}return d.scale=function(t){return arguments.length?(e=t,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),d):n.slice()},d.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),d):i&&i.slice()},d.tickFormat=function(t){return arguments.length?(r=t,d):r},d.tickSize=function(t){return arguments.length?(o=s=+t,d):o},d.tickSizeInner=function(t){return arguments.length?(o=+t,d):o},d.tickSizeOuter=function(t){return arguments.length?(s=+t,d):s},d.tickPadding=function(t){return arguments.length?(a=+t,d):a},d.offset=function(t){return arguments.length?(l=+t,d):l},d}function G(t){return I(3,t)}function B(t){return I(4,t)}function Y(){}function W(t){return null==t?Y:function(){return this.querySelector(t)}}function $(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function F(){return[]}function q(t){return null==t?F:function(){return this.querySelectorAll(t)}}function X(t){return function(){return this.matches(t)}}function Z(t){return function(e){return e.matches(t)}}var V=Array.prototype.find;function Q(){return this.firstElementChild}var K=Array.prototype.filter;function J(){return Array.from(this.children)}function tt(t){return new Array(t.length)}function et(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function nt(t){return function(){return t}}function it(t,e,n,i,r,o){for(var s,a=0,l=e.length,u=o.length;a<u;++a)(s=e[a])?(s.__data__=o[a],i[a]=s):n[a]=new et(t,o[a]);for(;a<l;++a)(s=e[a])&&(r[a]=s)}function rt(t,e,n,i,r,o,s){var a,l,u,c=new Map,h=e.length,d=o.length,f=new Array(h);for(a=0;a<h;++a)(l=e[a])&&(f[a]=u=s.call(l,l.__data__,a,e)+"",c.has(u)?r[a]=l:c.set(u,l));for(a=0;a<d;++a)u=s.call(t,o[a],a,o)+"",(l=c.get(u))?(i[a]=l,l.__data__=o[a],c.delete(u)):n[a]=new et(t,o[a]);for(a=0;a<h;++a)(l=e[a])&&c.get(f[a])===l&&(r[a]=l)}function ot(t){return t.__data__}function st(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function at(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}et.prototype={constructor:et,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var lt="http://www.w3.org/1999/xhtml";const ut={svg:"http://www.w3.org/2000/svg",xhtml:lt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ct(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),ut.hasOwnProperty(e)?{space:ut[e],local:t}:t}function ht(t){return function(){this.removeAttribute(t)}}function dt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ft(t,e){return function(){this.setAttribute(t,e)}}function gt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function pt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function mt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function yt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function vt(t){return function(){this.style.removeProperty(t)}}function bt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function wt(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function _t(t,e){return t.style.getPropertyValue(e)||yt(t).getComputedStyle(t,null).getPropertyValue(e)}function xt(t){return function(){delete this[t]}}function Mt(t,e){return function(){this[t]=e}}function kt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Et(t){return t.trim().split(/^|\s+/)}function Dt(t){return t.classList||new St(t)}function St(t){this._node=t,this._names=Et(t.getAttribute("class")||"")}function Ct(t,e){for(var n=Dt(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function At(t,e){for(var n=Dt(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function Tt(t){return function(){Ct(this,t)}}function Nt(t){return function(){At(this,t)}}function Ot(t,e){return function(){(e.apply(this,arguments)?Ct:At)(this,t)}}function Lt(){this.textContent=""}function Rt(t){return function(){this.textContent=t}}function zt(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function jt(){this.innerHTML=""}function Ut(t){return function(){this.innerHTML=t}}function Pt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Ht(){this.nextSibling&&this.parentNode.appendChild(this)}function It(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Gt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===lt&&e.documentElement.namespaceURI===lt?e.createElement(t):e.createElementNS(n,t)}}function Bt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Yt(t){var e=ct(t);return(e.local?Bt:Gt)(e)}function Wt(){return null}function $t(){var t=this.parentNode;t&&t.removeChild(this)}function Ft(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function qt(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Xt(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function Zt(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,o=e.length;i<o;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function Vt(t,e,n){return function(){var i,r=this.__on,o=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),void(i.value=e);this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Qt(t,e,n){var i=yt(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function Kt(t,e){return function(){return Qt(this,t,e)}}function Jt(t,e){return function(){return Qt(this,t,e.apply(this,arguments))}}St.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var te=[null];function ee(t,e){this._groups=t,this._parents=e}function ne(){return new ee([[document.documentElement]],te)}ee.prototype=ne.prototype={constructor:ee,select:function(t){"function"!=typeof t&&(t=W(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s,a=e[r],l=a.length,u=i[r]=new Array(l),c=0;c<l;++c)(o=a[c])&&(s=t.call(o,o.__data__,c,a))&&("__data__"in o&&(s.__data__=o.__data__),u[c]=s);return new ee(i,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return $(t.apply(this,arguments))}}(t):q(t);for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var s,a=e[o],l=a.length,u=0;u<l;++u)(s=a[u])&&(i.push(t.call(s,s.__data__,u,a)),r.push(s));return new ee(i,r)},selectChild:function(t){return this.select(null==t?Q:function(t){return function(){return V.call(this.children,t)}}("function"==typeof t?t:Z(t)))},selectChildren:function(t){return this.selectAll(null==t?J:function(t){return function(){return K.call(this.children,t)}}("function"==typeof t?t:Z(t)))},filter:function(t){"function"!=typeof t&&(t=X(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],u=0;u<a;++u)(o=s[u])&&t.call(o,o.__data__,u,s)&&l.push(o);return new ee(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,ot);var n=e?rt:it,i=this._parents,r=this._groups;"function"!=typeof t&&(t=nt(t));for(var o=r.length,s=new Array(o),a=new Array(o),l=new Array(o),u=0;u<o;++u){var c=i[u],h=r[u],d=h.length,f=st(t.call(c,c&&c.__data__,u,i)),g=f.length,p=a[u]=new Array(g),m=s[u]=new Array(g),y=l[u]=new Array(d);n(c,h,p,m,y,f,e);for(var v,b,w=0,_=0;w<g;++w)if(v=p[w]){for(w>=_&&(_=w+1);!(b=m[_])&&++_<g;);v._next=b||null}}return(s=new ee(s,i))._enter=a,s._exit=l,s},enter:function(){return new ee(this._enter||this._groups.map(tt),this._parents)},exit:function(){return new ee(this._exit||this._groups.map(tt),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,o=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?o.remove():n(o),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,o=i.length,s=Math.min(r,o),a=new Array(r),l=0;l<s;++l)for(var u,c=n[l],h=i[l],d=c.length,f=a[l]=new Array(d),g=0;g<d;++g)(u=c[g]||h[g])&&(f[g]=u);for(;l<r;++l)a[l]=n[l];return new ee(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],o=r.length-1,s=r[o];--o>=0;)(i=r[o])&&(s&&4^i.compareDocumentPosition(s)&&s.parentNode.insertBefore(i,s),s=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=at);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var s,a=n[o],l=a.length,u=r[o]=new Array(l),c=0;c<l;++c)(s=a[c])&&(u[c]=s);u.sort(e)}return new ee(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var s=i[r];if(s)return s}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,o=e[n],s=0,a=o.length;s<a;++s)(r=o[s])&&t.call(r,r.__data__,s,o);return this},attr:function(t,e){var n=ct(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?dt:ht:"function"==typeof e?n.local?mt:pt:n.local?gt:ft)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?vt:"function"==typeof e?wt:bt)(t,e,null==n?"":n)):_t(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?xt:"function"==typeof e?kt:Mt)(t,e)):this.node()[t]},classed:function(t,e){var n=Et(t+"");if(arguments.length<2){for(var i=Dt(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?Ot:e?Tt:Nt)(n,e))},text:function(t){return arguments.length?this.each(null==t?Lt:("function"==typeof t?zt:Rt)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?jt:("function"==typeof t?Pt:Ut)(t)):this.node().innerHTML},raise:function(){return this.each(Ht)},lower:function(){return this.each(It)},append:function(t){var e="function"==typeof t?t:Yt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:Yt(t),i=null==e?Wt:"function"==typeof e?e:W(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each($t)},clone:function(t){return this.select(t?qt:Ft)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,o=Xt(t+""),s=o.length;if(!(arguments.length<2)){for(a=e?Vt:Zt,i=0;i<s;++i)this.each(a(o[i],e,n));return this}var a=this.node().__on;if(a)for(var l,u=0,c=a.length;u<c;++u)for(i=0,l=a[u];i<s;++i)if((r=o[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?Jt:Kt)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],o=0,s=r.length;o<s;++o)(i=r[o])&&(yield i)}};const ie=ne;var re={value:()=>{}};function oe(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new se(i)}function se(t){this._=t}function ae(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function le(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function ue(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=re,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}se.prototype=oe.prototype={constructor:se,on:function(t,e){var n,i=this._,r=ae(t+"",i),o=-1,s=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=r[o]).type)i[n]=ue(i[n],t.name,e);else if(null==e)for(n in i)i[n]=ue(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=r[o]).type)&&(n=le(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new se(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};const ce=oe;var he,de,fe=0,ge=0,pe=0,me=0,ye=0,ve=0,be="object"==typeof performance&&performance.now?performance:Date,we="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function _e(){return ye||(we(xe),ye=be.now()+ve)}function xe(){ye=0}function Me(){this._call=this._time=this._next=null}function ke(t,e,n){var i=new Me;return i.restart(t,e,n),i}function Ee(){ye=(me=be.now())+ve,fe=ge=0;try{!function(){_e(),++fe;for(var t,e=he;e;)(t=ye-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fe}()}finally{fe=0,function(){for(var t,e,n=he,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:he=e);de=t,Se(i)}(),ye=0}}function De(){var t=be.now(),e=t-me;e>1e3&&(ve-=e,me=t)}function Se(t){fe||(ge&&(ge=clearTimeout(ge)),t-ye>24?(t<1/0&&(ge=setTimeout(Ee,t-be.now()-ve)),pe&&(pe=clearInterval(pe))):(pe||(me=be.now(),pe=setInterval(De,1e3)),fe=1,we(Ee)))}function Ce(t,e,n){var i=new Me;return e=null==e?0:+e,i.restart((n=>{i.stop(),t(n+e)}),e,n),i}Me.prototype=ke.prototype={constructor:Me,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?_e():+n)+(null==e?0:+e),this._next||de===this||(de?de._next=this:he=this,de=this),this._call=t,this._time=n,Se()},stop:function(){this._call&&(this._call=null,this._time=1/0,Se())}};var Ae=ce("start","end","cancel","interrupt"),Te=[];function Ne(t,e,n,i,r,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function o(l){var u,c,h,d;if(1!==n.state)return a();for(u in r)if((d=r[u]).name===n.name){if(3===d.state)return Ce(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[u]):+u<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[u])}if(Ce((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(l))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(h=n.tween.length),u=0,c=-1;u<h;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=d);i.length=c+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(a),n.state=5,1),o=-1,s=i.length;++o<s;)i[o].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),a())}function a(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=ke((function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}),0,n.time)}(t,n,{name:e,index:i,group:r,on:Ae,tween:Te,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function Oe(t,e){var n=Re(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function Le(t,e){var n=Re(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Re(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function ze(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var je,Ue=180/Math.PI,Pe={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function He(t,e,n,i,r,o){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(e,t)*Ue,skewX:Math.atan(l)*Ue,scaleX:s,scaleY:a}}function Ie(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(o,s){var a=[],l=[];return o=t(o),s=t(s),function(t,i,r,o,s,a){if(t!==r||i!==o){var l=s.push("translate(",null,e,null,n);a.push({i:l-4,x:ze(t,r)},{i:l-2,x:ze(i,o)})}else(r||o)&&s.push("translate("+r+e+o+n)}(o.translateX,o.translateY,s.translateX,s.translateY,a,l),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:ze(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,s.rotate,a,l),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:ze(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,s.skewX,a,l),function(t,e,n,i,o,s){if(t!==n||e!==i){var a=o.push(r(o)+"scale(",null,",",null,")");s.push({i:a-4,x:ze(t,n)},{i:a-2,x:ze(e,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,l),o=s=null,function(t){for(var e,n=-1,i=l.length;++n<i;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var Ge=Ie((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Pe:He(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Be=Ie((function(t){return null==t?Pe:(je||(je=document.createElementNS("http://www.w3.org/2000/svg","g")),je.setAttribute("transform",t),(t=je.transform.baseVal.consolidate())?He((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Pe)}),", ",")",")");function Ye(t,e){var n,i;return function(){var r=Le(this,t),o=r.tween;if(o!==n)for(var s=0,a=(i=n=o).length;s<a;++s)if(i[s].name===e){(i=i.slice()).splice(s,1);break}r.tween=i}}function We(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var o=Le(this,t),s=o.tween;if(s!==i){r=(i=s).slice();for(var a={name:e,value:n},l=0,u=r.length;l<u;++l)if(r[l].name===e){r[l]=a;break}l===u&&r.push(a)}o.tween=r}}function $e(t,e,n){var i=t._id;return t.each((function(){var t=Le(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Re(t,i).value[e]}}function Fe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function qe(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Xe(){}var Ze=.7,Ve=1/Ze,Qe="\\s*([+-]?\\d+)\\s*",Ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tn=/^#([0-9a-f]{3,8})$/,en=new RegExp(`^rgb\\(${Qe},${Qe},${Qe}\\)$`),nn=new RegExp(`^rgb\\(${Je},${Je},${Je}\\)$`),rn=new RegExp(`^rgba\\(${Qe},${Qe},${Qe},${Ke}\\)$`),on=new RegExp(`^rgba\\(${Je},${Je},${Je},${Ke}\\)$`),sn=new RegExp(`^hsl\\(${Ke},${Je},${Je}\\)$`),an=new RegExp(`^hsla\\(${Ke},${Je},${Je},${Ke}\\)$`),ln={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function un(){return this.rgb().formatHex()}function cn(){return this.rgb().formatRgb()}function hn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=tn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?dn(e):3===n?new mn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?fn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?fn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=en.exec(t))?new mn(e[1],e[2],e[3],1):(e=nn.exec(t))?new mn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=rn.exec(t))?fn(e[1],e[2],e[3],e[4]):(e=on.exec(t))?fn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=sn.exec(t))?xn(e[1],e[2]/100,e[3]/100,1):(e=an.exec(t))?xn(e[1],e[2]/100,e[3]/100,e[4]):ln.hasOwnProperty(t)?dn(ln[t]):"transparent"===t?new mn(NaN,NaN,NaN,0):null}function dn(t){return new mn(t>>16&255,t>>8&255,255&t,1)}function fn(t,e,n,i){return i<=0&&(t=e=n=NaN),new mn(t,e,n,i)}function gn(t){return t instanceof Xe||(t=hn(t)),t?new mn((t=t.rgb()).r,t.g,t.b,t.opacity):new mn}function pn(t,e,n,i){return 1===arguments.length?gn(t):new mn(t,e,n,null==i?1:i)}function mn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function yn(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}`}function vn(){const t=bn(this.opacity);return`${1===t?"rgb(":"rgba("}${wn(this.r)}, ${wn(this.g)}, ${wn(this.b)}${1===t?")":`, ${t})`}`}function bn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function wn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _n(t){return((t=wn(t))<16?"0":"")+t.toString(16)}function xn(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new kn(t,e,n,i)}function Mn(t){if(t instanceof kn)return new kn(t.h,t.s,t.l,t.opacity);if(t instanceof Xe||(t=hn(t)),!t)return new kn;if(t instanceof kn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=e===o?(n-i)/a+6*(n<i):n===o?(i-e)/a+2:(e-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new kn(s,a,l,t.opacity)}function kn(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function En(t){return(t=(t||0)%360)<0?t+360:t}function Dn(t){return Math.max(0,Math.min(1,t||0))}function Sn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Cn(t,e,n,i,r){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*n+(1+3*t+3*o-3*s)*i+s*r)/6}Fe(Xe,hn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:un,formatHex:un,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Mn(this).formatHsl()},formatRgb:cn,toString:cn}),Fe(mn,pn,qe(Xe,{brighter(t){return t=null==t?Ve:Math.pow(Ve,t),new mn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ze:Math.pow(Ze,t),new mn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new mn(wn(this.r),wn(this.g),wn(this.b),bn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yn,formatHex:yn,formatHex8:function(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}${_n(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:vn,toString:vn})),Fe(kn,(function(t,e,n,i){return 1===arguments.length?Mn(t):new kn(t,e,n,null==i?1:i)}),qe(Xe,{brighter(t){return t=null==t?Ve:Math.pow(Ve,t),new kn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ze:Math.pow(Ze,t),new kn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new mn(Sn(t>=240?t-240:t+120,r,i),Sn(t,r,i),Sn(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new kn(En(this.h),Dn(this.s),Dn(this.l),bn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=bn(this.opacity);return`${1===t?"hsl(":"hsla("}${En(this.h)}, ${100*Dn(this.s)}%, ${100*Dn(this.l)}%${1===t?")":`, ${t})`}`}}));const An=t=>()=>t;function Tn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):An(isNaN(t)?e:t)}const Nn=function t(e){var n=function(t){return 1==(t=+t)?Tn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):An(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=pn(t)).r,(e=pn(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),s=Tn(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function On(t){return function(e){var n,i,r=e.length,o=new Array(r),s=new Array(r),a=new Array(r);for(n=0;n<r;++n)i=pn(e[n]),o[n]=i.r||0,s[n]=i.g||0,a[n]=i.b||0;return o=t(o),s=t(s),a=t(a),i.opacity=1,function(t){return i.r=o(t),i.g=s(t),i.b=a(t),i+""}}}On((function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],o=t[i+1],s=i>0?t[i-1]:2*r-o,a=i<e-1?t[i+2]:2*o-r;return Cn((n-i/e)*e,s,r,o,a)}})),On((function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],o=t[i%e],s=t[(i+1)%e],a=t[(i+2)%e];return Cn((n-i/e)*e,r,o,s,a)}}));var Ln=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rn=new RegExp(Ln.source,"g");function zn(t,e){var n,i,r,o=Ln.lastIndex=Rn.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=Ln.exec(t))&&(i=Rn.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:ze(n,i)})),o=Rn.lastIndex;return o<e.length&&(r=e.slice(o),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)a[(n=l[i]).i]=n.x(t);return a.join("")})}function jn(t,e){var n;return("number"==typeof e?ze:e instanceof hn?Nn:(n=hn(e))?(e=n,Nn):zn)(t,e)}function Un(t){return function(){this.removeAttribute(t)}}function Pn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Hn(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttribute(t);return s===o?null:s===i?r:r=e(i=s,n)}}function In(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===i?r:r=e(i=s,n)}}function Gn(t,e,n){var i,r,o;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttribute(t))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l));this.removeAttribute(t)}}function Bn(t,e,n){var i,r,o;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l));this.removeAttributeNS(t.space,t.local)}}function Yn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Wn(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function $n(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&Wn(t,r)),n}return r._value=e,r}function Fn(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&Yn(t,r)),n}return r._value=e,r}function qn(t,e){return function(){Oe(this,t).delay=+e.apply(this,arguments)}}function Xn(t,e){return e=+e,function(){Oe(this,t).delay=e}}function Zn(t,e){return function(){Le(this,t).duration=+e.apply(this,arguments)}}function Vn(t,e){return e=+e,function(){Le(this,t).duration=e}}function Qn(t,e){if("function"!=typeof e)throw new Error;return function(){Le(this,t).ease=e}}function Kn(t,e,n){var i,r,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Oe:Le;return function(){var s=o(this,t),a=s.on;a!==i&&(r=(i=a).copy()).on(e,n),s.on=r}}var Jn=ie.prototype.constructor;function ti(t){return function(){this.style.removeProperty(t)}}function ei(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function ni(t,e,n){var i,r;function o(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&ei(t,o,n)),i}return o._value=e,o}function ii(t){return function(e){this.textContent=t.call(this,e)}}function ri(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&ii(i)),e}return i._value=t,i}var oi=0;function si(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function ai(){return++oi}var li=ie.prototype;si.prototype=function(t){return ie().transition(t)}.prototype={constructor:si,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=W(t));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s<r;++s)for(var a,l,u=i[s],c=u.length,h=o[s]=new Array(c),d=0;d<c;++d)(a=u[d])&&(l=t.call(a,a.__data__,d,u))&&("__data__"in a&&(l.__data__=a.__data__),h[d]=l,Ne(h[d],e,n,d,h,Re(a,n)));return new si(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=q(t));for(var i=this._groups,r=i.length,o=[],s=[],a=0;a<r;++a)for(var l,u=i[a],c=u.length,h=0;h<c;++h)if(l=u[h]){for(var d,f=t.call(l,l.__data__,h,u),g=Re(l,n),p=0,m=f.length;p<m;++p)(d=f[p])&&Ne(d,e,n,p,f,g);o.push(f),s.push(l)}return new si(o,s,e,n)},selectChild:li.selectChild,selectChildren:li.selectChildren,filter:function(t){"function"!=typeof t&&(t=X(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],u=0;u<a;++u)(o=s[u])&&t.call(o,o.__data__,u,s)&&l.push(o);return new si(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),s=new Array(i),a=0;a<o;++a)for(var l,u=e[a],c=n[a],h=u.length,d=s[a]=new Array(h),f=0;f<h;++f)(l=u[f]||c[f])&&(d[f]=l);for(;a<i;++a)s[a]=e[a];return new si(s,this._parents,this._name,this._id)},selection:function(){return new Jn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=ai(),i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,u=0;u<l;++u)if(s=a[u]){var c=Re(s,e);Ne(s,t,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new si(i,this._parents,t,n)},call:li.call,nodes:li.nodes,node:li.node,size:li.size,empty:li.empty,each:li.each,on:function(t,e){var n=this._id;return arguments.length<2?Re(this.node(),n).on.on(t):this.each(Kn(n,t,e))},attr:function(t,e){var n=ct(t),i="transform"===n?Be:jn;return this.attrTween(t,"function"==typeof e?(n.local?Bn:Gn)(n,i,$e(this,"attr."+t,e)):null==e?(n.local?Pn:Un)(n):(n.local?In:Hn)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=ct(t);return this.tween(n,(i.local?$n:Fn)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?Ge:jn;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var o=_t(this,t),s=(this.style.removeProperty(t),_t(this,t));return o===s?null:o===n&&s===i?r:r=e(n=o,i=s)}}(t,i)).on("end.style."+t,ti(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,o;return function(){var s=_t(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=_t(this,t)),s===l?null:s===i&&l===r?o:(r=l,o=e(i=s,a))}}(t,i,$e(this,"style."+t,e))).each(function(t,e){var n,i,r,o,s="style."+e,a="end."+s;return function(){var l=Le(this,t),u=l.on,c=null==l.value[s]?o||(o=ti(e)):void 0;u===n&&r===c||(i=(n=u).copy()).on(a,r=c),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,o=n+"";return function(){var s=_t(this,t);return s===o?null:s===i?r:r=e(i=s,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,ni(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}($e(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,ri(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=Re(this.node(),n).tween,o=0,s=r.length;o<s;++o)if((i=r[o]).name===t)return i.value;return null}return this.each((null==e?Ye:We)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?qn:Xn)(e,t)):Re(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Zn:Vn)(e,t)):Re(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(Qn(e,t)):Re(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;Le(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise((function(o,s){var a={value:s},l={value:function(){0==--r&&o()}};n.each((function(){var n=Le(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e})),0===r&&o()}))},[Symbol.iterator]:li[Symbol.iterator]};var ui={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function ci(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}ie.prototype.interrupt=function(t){return this.each((function(){!function(t,e){var n,i,r,o=t.__transition,s=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[r]):s=!1;s&&delete t.__transition}}(this,t)}))},ie.prototype.transition=function(t){var e,n;t instanceof si?(e=t._id,t=t._name):(e=ai(),(n=ui).time=_e(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,u=0;u<l;++u)(s=a[u])&&Ne(s,t,e,u,a,n||ci(s,e));return new si(i,this._parents,t,e)};const{abs:hi,max:di,min:fi}=Math;function gi(t){return{type:t}}function pi(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o}function mi(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}["w","e"].map(gi),["n","s"].map(gi),["n","w","e","s","nw","ne","sw","se"].map(gi);class yi extends Map{constructor(t,e=xi){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(bi(this,t))}has(t){return super.has(bi(this,t))}set(t,e){return super.set(wi(this,t),e)}delete(t){return super.delete(_i(this,t))}}class vi extends Set{constructor(t,e=xi){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(bi(this,t))}add(t){return super.add(wi(this,t))}delete(t){return super.delete(_i(this,t))}}function bi({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function wi({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function _i({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function xi(t){return null!==t&&"object"==typeof t?t.valueOf():t}const Mi=Symbol("implicit");function ki(){var t=new yi,e=[],n=[],i=Mi;function r(r){let o=t.get(r);if(void 0===o){if(i!==Mi)return i;t.set(r,o=e.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new yi;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return ki(e,n).unknown(i)},mi.apply(r,arguments),r}function Ei(){var t,e,n=ki().unknown(void 0),i=n.domain,r=n.range,o=0,s=1,a=!1,l=0,u=0,c=.5;function h(){var n=i().length,h=s<o,d=h?s:o,f=h?o:s;t=(f-d)/Math.max(1,n-l+2*u),a&&(t=Math.floor(t)),d+=(f-d-t*(n-l))*c,e=t*(1-l),a&&(d=Math.round(d),e=Math.round(e));var g=pi(n).map((function(e){return d+t*e}));return r(h?g.reverse():g)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([o,s]=t,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(t){return[o,s]=t,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,h()):a},n.padding=function(t){return arguments.length?(l=Math.min(1,u=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(u=+t,h()):u},n.align=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),h()):c},n.copy=function(){return Ei(i(),[o,s]).round(a).paddingInner(l).paddingOuter(u).align(c)},mi.apply(h(),arguments)}var Di=Math.sqrt(50),Si=Math.sqrt(10),Ci=Math.sqrt(2);function Ai(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/Math.pow(10,r);return r>=0?(o>=Di?10:o>=Si?5:o>=Ci?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=Di?10:o>=Si?5:o>=Ci?2:1)}function Ti(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=Di?r*=10:o>=Si?r*=5:o>=Ci&&(r*=2),e<t?-r:r}function Ni(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Oi(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Li(t){let e,n,i;function r(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<0?r=e+1:o=e}while(r<o)}return r}return 2!==t.length?(e=Ni,n=(e,n)=>Ni(t(e),n),i=(e,n)=>t(e)-n):(e=t===Ni||t===Oi?t:Ri,n=t,i=t),{left:r,center:function(t,e,n=0,o=t.length){const s=r(t,e,n,o-1);return s>n&&i(t[s-1],e)>-i(t[s],e)?s-1:s},right:function(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<=0?r=e+1:o=e}while(r<o)}return r}}}function Ri(){return 0}const zi=Li(Ni),ji=zi.right,Ui=(zi.left,Li((function(t){return null===t?NaN:+t})).center,ji);function Pi(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),s=new Array(i);for(n=0;n<r;++n)o[n]=Bi(t[n],e[n]);for(;n<i;++n)s[n]=e[n];return function(t){for(n=0;n<r;++n)s[n]=o[n](t);return s}}function Hi(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Ii(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=Bi(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}function Gi(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(o){for(n=0;n<i;++n)r[n]=t[n]*(1-o)+e[n]*o;return r}}function Bi(t,e){var n,i,r=typeof e;return null==e||"boolean"===r?An(e):("number"===r?ze:"string"===r?(n=hn(e))?(e=n,Nn):zn:e instanceof hn?Nn:e instanceof Date?Hi:(i=e,!ArrayBuffer.isView(i)||i instanceof DataView?Array.isArray(e)?Pi:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Ii:ze:Gi))(t,e)}function Yi(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Wi(t){return+t}var $i=[0,1];function Fi(t){return t}function qi(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Xi(t,e,n){var i=t[0],r=t[1],o=e[0],s=e[1];return r<i?(i=qi(r,i),o=n(s,o)):(i=qi(i,r),o=n(o,s)),function(t){return o(i(t))}}function Zi(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)r[s]=qi(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(e){var n=Ui(t,e,1,i)-1;return o[n](r[n](e))}}function Vi(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Qi(){return function(){var t,e,n,i,r,o,s=$i,a=$i,l=Bi,u=Fi;function c(){var t,e,n,l=Math.min(s.length,a.length);return u!==Fi&&(t=s[0],e=s[l-1],t>e&&(n=t,t=e,e=n),u=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?Zi:Xi,r=o=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(s.map(t),a,l)))(t(u(e)))}return h.invert=function(n){return u(e((o||(o=i(a,s.map(t),ze)))(n)))},h.domain=function(t){return arguments.length?(s=Array.from(t,Wi),c()):s.slice()},h.range=function(t){return arguments.length?(a=Array.from(t),c()):a.slice()},h.rangeRound=function(t){return a=Array.from(t),l=Yi,c()},h.clamp=function(t){return arguments.length?(u=!!t||Fi,c()):u!==Fi},h.interpolate=function(t){return arguments.length?(l=t,c()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,c()}}()(Fi,Fi)}var Ki,Ji=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tr(t){if(!(e=Ji.exec(t)))throw new Error("invalid format: "+t);var e;return new er({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function er(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function nr(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function ir(t){return(t=nr(Math.abs(t)))?t[1]:NaN}function rr(t,e){var n=nr(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}tr.prototype=er.prototype,er.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const or={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>rr(100*t,e),r:rr,s:function(t,e){var n=nr(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(Ki=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+nr(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function sr(t){return t}var ar,lr,ur,cr=Array.prototype.map,hr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function dr(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var i,r,o,s,a=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((i=e<t)&&(r=t,t=e,e=r),0===(s=Ai(t,e,n))||!isFinite(s))return[];if(s>0){let n=Math.round(t/s),i=Math.round(e/s);for(n*s<t&&++n,i*s>e&&--i,o=new Array(r=i-n+1);++a<r;)o[a]=(n+a)*s}else{s=-s;let n=Math.round(t*s),i=Math.round(e*s);for(n/s<t&&++n,i/s>e&&--i,o=new Array(r=i-n+1);++a<r;)o[a]=(n+a)/s}return i&&o.reverse(),o}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return function(t,e,n,i){var r,o=Ti(t,e,n);switch((i=tr(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ir(e)/3)))-ir(Math.abs(t)))}(o,s))||(i.precision=r),ur(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ir(e)-ir(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-ir(Math.abs(t)))}(o))||(i.precision=r-2*("%"===i.type))}return lr(i)}(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,o=e(),s=0,a=o.length-1,l=o[s],u=o[a],c=10;for(u<l&&(r=l,l=u,u=r,r=s,s=a,a=r);c-- >0;){if((r=Ai(l,u,n))===i)return o[s]=l,o[a]=u,e(o);if(r>0)l=Math.floor(l/r)*r,u=Math.ceil(u/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,u=Math.floor(u*r)/r}i=r}return t},t}function fr(){var t=Qi();return t.copy=function(){return Vi(t,fr())},mi.apply(t,arguments),dr(t)}ar=function(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?sr:(e=cr.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,o=[],s=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[s=(s+1)%e.length];return o.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",s=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?sr:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(cr.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",u=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=tr(t)).fill,n=t.align,h=t.sign,d=t.symbol,f=t.zero,g=t.width,p=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(p=!0,v="g"):or[v]||(void 0===m&&(m=12),y=!0,v="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",w="$"===d?o:/[%p]/.test(v)?l:"",_=or[v],x=/[defgprs%]/.test(v);function M(t){var r,o,l,d=b,M=w;if("c"===v)M=_(t)+M,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:_(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),k&&0==+t&&"+"!==h&&(k=!1),d=(k?"("===h?h:u:"-"===h||"("===h?"":h)+d,M=("s"===v?hr[8+Ki/3]:"")+M+(k&&"("===h?")":""),x)for(r=-1,o=t.length;++r<o;)if(48>(l=t.charCodeAt(r))||l>57){M=(46===l?s+t.slice(r+1):t.slice(r))+M,t=t.slice(0,r);break}}p&&!f&&(t=i(t,1/0));var E=d.length+t.length+M.length,D=E<g?new Array(g-E+1).join(e):"";switch(p&&f&&(t=i(D+t,D.length?g-M.length:1/0),D=""),n){case"<":t=d+t+M+D;break;case"=":t=d+D+t+M;break;case"^":t=D.slice(0,E=D.length>>1)+d+t+M+D.slice(E);break;default:t=D+d+t+M}return a(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),M.toString=function(){return t+""},M}return{format:h,formatPrefix:function(t,e){var n=h(((t=tr(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(ir(e)/3))),r=Math.pow(10,-i),o=hr[8+i/3];return function(t){return n(r*t)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),lr=ar.format,ur=ar.formatPrefix;const gr=1e3,pr=6e4,mr=36e5,yr=864e5,vr=6048e5,br=31536e6,wr=new Date,_r=new Date;function xr(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,o)=>{const s=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return s;let a;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<i);return s},r.filter=n=>xr((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})),n&&(r.count=(e,i)=>(wr.setTime(+e),_r.setTime(+i),t(wr),t(_r),Math.floor(n(wr,_r))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t==0:e=>r.count(0,e)%t==0):r:null)),r}const Mr=xr((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));Mr.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?xr((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):Mr:null),Mr.range;const kr=xr((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*gr)}),((t,e)=>(e-t)/gr),(t=>t.getUTCSeconds())),Er=(kr.range,xr((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gr)}),((t,e)=>{t.setTime(+t+e*pr)}),((t,e)=>(e-t)/pr),(t=>t.getMinutes()))),Dr=(Er.range,xr((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*pr)}),((t,e)=>(e-t)/pr),(t=>t.getUTCMinutes()))),Sr=(Dr.range,xr((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gr-t.getMinutes()*pr)}),((t,e)=>{t.setTime(+t+e*mr)}),((t,e)=>(e-t)/mr),(t=>t.getHours()))),Cr=(Sr.range,xr((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*mr)}),((t,e)=>(e-t)/mr),(t=>t.getUTCHours()))),Ar=(Cr.range,xr((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*pr)/yr),(t=>t.getDate()-1))),Tr=(Ar.range,xr((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/yr),(t=>t.getUTCDate()-1))),Nr=(Tr.range,xr((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/yr),(t=>Math.floor(t/yr))));function Or(t){return xr((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*pr)/vr))}Nr.range;const Lr=Or(0),Rr=Or(1),zr=Or(2),jr=Or(3),Ur=Or(4),Pr=Or(5),Hr=Or(6);function Ir(t){return xr((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/vr))}Lr.range,Rr.range,zr.range,jr.range,Ur.range,Pr.range,Hr.range;const Gr=Ir(0),Br=Ir(1),Yr=Ir(2),Wr=Ir(3),$r=Ir(4),Fr=Ir(5),qr=Ir(6),Xr=(Gr.range,Br.range,Yr.range,Wr.range,$r.range,Fr.range,qr.range,xr((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()))),Zr=(Xr.range,xr((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()))),Vr=(Zr.range,xr((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear())));Vr.every=t=>isFinite(t=Math.floor(t))&&t>0?xr((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null,Vr.range;const Qr=xr((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));function Kr(t,e,n,i,r,o){const s=[[kr,1,gr],[kr,5,5e3],[kr,15,15e3],[kr,30,3e4],[o,1,pr],[o,5,3e5],[o,15,9e5],[o,30,18e5],[r,1,mr],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,yr],[i,2,1728e5],[n,1,vr],[e,1,2592e6],[e,3,7776e6],[t,1,br]];function a(e,n,i){const r=Math.abs(n-e)/i,o=Li((([,,t])=>t)).right(s,r);if(o===s.length)return t.every(Ti(e/br,n/br,i));if(0===o)return Mr.every(Math.max(Ti(e,n,i),1));const[a,l]=s[r/s[o-1][2]<s[o][2]/r?o-1:o];return a.every(l)}return[function(t,e,n){const i=e<t;i&&([t,e]=[e,t]);const r=n&&"function"==typeof n.range?n:a(t,e,n),o=r?r.range(t,+e+1):[];return i?o.reverse():o},a]}Qr.every=t=>isFinite(t=Math.floor(t))&&t>0?xr((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null,Qr.range;const[Jr,to]=Kr(Qr,Zr,Gr,Nr,Cr,Dr),[eo,no]=Kr(Vr,Xr,Lr,Ar,Sr,Er);function io(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ro(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function oo(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var so,ao,lo={"-":"",_:" ",0:"0"},uo=/^\s*\d+/,co=/^%/,ho=/[\\^$*+?|[\]().{}]/g;function fo(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function go(t){return t.replace(ho,"\\$&")}function po(t){return new RegExp("^(?:"+t.map(go).join("|")+")","i")}function mo(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function yo(t,e,n){var i=uo.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function vo(t,e,n){var i=uo.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function bo(t,e,n){var i=uo.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function wo(t,e,n){var i=uo.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function _o(t,e,n){var i=uo.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function xo(t,e,n){var i=uo.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Mo(t,e,n){var i=uo.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function ko(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Eo(t,e,n){var i=uo.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function Do(t,e,n){var i=uo.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function So(t,e,n){var i=uo.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Co(t,e,n){var i=uo.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function Ao(t,e,n){var i=uo.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function To(t,e,n){var i=uo.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function No(t,e,n){var i=uo.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Oo(t,e,n){var i=uo.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Lo(t,e,n){var i=uo.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Ro(t,e,n){var i=co.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function zo(t,e,n){var i=uo.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function jo(t,e,n){var i=uo.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Uo(t,e){return fo(t.getDate(),e,2)}function Po(t,e){return fo(t.getHours(),e,2)}function Ho(t,e){return fo(t.getHours()%12||12,e,2)}function Io(t,e){return fo(1+Ar.count(Vr(t),t),e,3)}function Go(t,e){return fo(t.getMilliseconds(),e,3)}function Bo(t,e){return Go(t,e)+"000"}function Yo(t,e){return fo(t.getMonth()+1,e,2)}function Wo(t,e){return fo(t.getMinutes(),e,2)}function $o(t,e){return fo(t.getSeconds(),e,2)}function Fo(t){var e=t.getDay();return 0===e?7:e}function qo(t,e){return fo(Lr.count(Vr(t)-1,t),e,2)}function Xo(t){var e=t.getDay();return e>=4||0===e?Ur(t):Ur.ceil(t)}function Zo(t,e){return t=Xo(t),fo(Ur.count(Vr(t),t)+(4===Vr(t).getDay()),e,2)}function Vo(t){return t.getDay()}function Qo(t,e){return fo(Rr.count(Vr(t)-1,t),e,2)}function Ko(t,e){return fo(t.getFullYear()%100,e,2)}function Jo(t,e){return fo((t=Xo(t)).getFullYear()%100,e,2)}function ts(t,e){return fo(t.getFullYear()%1e4,e,4)}function es(t,e){var n=t.getDay();return fo((t=n>=4||0===n?Ur(t):Ur.ceil(t)).getFullYear()%1e4,e,4)}function ns(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+fo(e/60|0,"0",2)+fo(e%60,"0",2)}function is(t,e){return fo(t.getUTCDate(),e,2)}function rs(t,e){return fo(t.getUTCHours(),e,2)}function os(t,e){return fo(t.getUTCHours()%12||12,e,2)}function ss(t,e){return fo(1+Tr.count(Qr(t),t),e,3)}function as(t,e){return fo(t.getUTCMilliseconds(),e,3)}function ls(t,e){return as(t,e)+"000"}function us(t,e){return fo(t.getUTCMonth()+1,e,2)}function cs(t,e){return fo(t.getUTCMinutes(),e,2)}function hs(t,e){return fo(t.getUTCSeconds(),e,2)}function ds(t){var e=t.getUTCDay();return 0===e?7:e}function fs(t,e){return fo(Gr.count(Qr(t)-1,t),e,2)}function gs(t){var e=t.getUTCDay();return e>=4||0===e?$r(t):$r.ceil(t)}function ps(t,e){return t=gs(t),fo($r.count(Qr(t),t)+(4===Qr(t).getUTCDay()),e,2)}function ms(t){return t.getUTCDay()}function ys(t,e){return fo(Br.count(Qr(t)-1,t),e,2)}function vs(t,e){return fo(t.getUTCFullYear()%100,e,2)}function bs(t,e){return fo((t=gs(t)).getUTCFullYear()%100,e,2)}function ws(t,e){return fo(t.getUTCFullYear()%1e4,e,4)}function _s(t,e){var n=t.getUTCDay();return fo((t=n>=4||0===n?$r(t):$r.ceil(t)).getUTCFullYear()%1e4,e,4)}function xs(){return"+0000"}function Ms(){return"%"}function ks(t){return+t}function Es(t){return Math.floor(+t/1e3)}function Ds(t){return new Date(t)}function Ss(t){return t instanceof Date?+t:+new Date(+t)}function Cs(t,e,n,i,r,o,s,a,l,u){var c=Qi(),h=c.invert,d=c.domain,f=u(".%L"),g=u(":%S"),p=u("%I:%M"),m=u("%I %p"),y=u("%a %d"),v=u("%b %d"),b=u("%B"),w=u("%Y");function _(t){return(l(t)<t?f:a(t)<t?g:s(t)<t?p:o(t)<t?m:i(t)<t?r(t)<t?y:v:n(t)<t?b:w)(t)}return c.invert=function(t){return new Date(h(t))},c.domain=function(t){return arguments.length?d(Array.from(t,Ss)):d().map(Ds)},c.ticks=function(e){var n=d();return t(n[0],n[n.length-1],null==e?10:e)},c.tickFormat=function(t,e){return null==e?_:u(e)},c.nice=function(t){var n=d();return t&&"function"==typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?d(function(t,e){var n,i=0,r=(t=t.slice()).length-1,o=t[i],s=t[r];return s<o&&(n=i,i=r,r=n,n=o,o=s,s=n),t[i]=e.floor(o),t[r]=e.ceil(s),t}(n,t)):c},c.copy=function(){return Vi(c,Cs(t,e,n,i,r,o,s,a,l,u))},c}function As(){return mi.apply(Cs(eo,no,Vr,Xr,Lr,Ar,Sr,Er,kr,ao).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Ts(t){return"string"==typeof t?new ee([[document.querySelector(t)]],[document.documentElement]):new ee([[t]],te)}so=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,u=po(r),c=mo(r),h=po(o),d=mo(o),f=po(s),g=mo(s),p=po(a),m=mo(a),y=po(l),v=mo(l),b={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:Uo,e:Uo,f:Bo,g:Jo,G:es,H:Po,I:Ho,j:Io,L:Go,m:Yo,M:Wo,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ks,s:Es,S:$o,u:Fo,U:qo,V:Zo,w:Vo,W:Qo,x:null,X:null,y:Ko,Y:ts,Z:ns,"%":Ms},w={a:function(t){return s[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:is,e:is,f:ls,g:bs,G:_s,H:rs,I:os,j:ss,L:as,m:us,M:cs,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ks,s:Es,S:hs,u:ds,U:fs,V:ps,w:ms,W:ys,x:null,X:null,y:vs,Y:ws,Z:xs,"%":Ms},_={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=g.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=y.exec(e.slice(n));return i?(t.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=p.exec(e.slice(n));return i?(t.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return k(t,e,n,i)},d:So,e:So,f:Lo,g:Mo,G:xo,H:Ao,I:Ao,j:Co,L:Oo,m:Do,M:To,p:function(t,e,n){var i=u.exec(e.slice(n));return i?(t.p=c.get(i[0].toLowerCase()),n+i[0].length):-1},q:Eo,Q:zo,s:jo,S:No,u:vo,U:bo,V:wo,w:yo,W:_o,x:function(t,e,i){return k(t,n,e,i)},X:function(t,e,n){return k(t,i,e,n)},y:Mo,Y:xo,Z:ko,"%":Ro};function x(t,e){return function(n){var i,r,o,s=[],a=-1,l=0,u=t.length;for(n instanceof Date||(n=new Date(+n));++a<u;)37===t.charCodeAt(a)&&(s.push(t.slice(l,a)),null!=(r=lo[i=t.charAt(++a)])?i=t.charAt(++a):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),s.push(i),l=a+1);return s.push(t.slice(l,a)),s.join("")}}function M(t,e){return function(n){var i,r,o=oo(1900,void 0,1);if(k(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=ro(oo(o.y,0,1))).getUTCDay(),i=r>4||0===r?Br.ceil(i):Br(i),i=Tr.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=io(oo(o.y,0,1))).getDay(),i=r>4||0===r?Rr.ceil(i):Rr(i),i=Ar.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?ro(oo(o.y,0,1)).getUTCDay():io(oo(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,ro(o)):io(o)}}function k(t,e,n,i){for(var r,o,s=0,a=e.length,l=n.length;s<a;){if(i>=l)return-1;if(37===(r=e.charCodeAt(s++))){if(r=e.charAt(s++),!(o=_[r in lo?e.charAt(s++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=x(n,b),b.X=x(i,b),b.c=x(e,b),w.x=x(n,w),w.X=x(i,w),w.c=x(e,w),{format:function(t){var e=x(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=M(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=x(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=M(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),ao=so.format,so.parse,so.utcFormat,so.utcParse;const Ns=Math.PI,Os=2*Ns,Ls=1e-6,Rs=Os-Ls;function zs(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function js(){return new zs}zs.prototype=js.prototype={constructor:zs,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,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,s=this._y1,a=n-t,l=i-e,u=o-t,c=s-e,h=u*u+c*c;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>Ls)if(Math.abs(c*a-l*u)>Ls&&r){var d=n-o,f=i-s,g=a*a+l*l,p=d*d+f*f,m=Math.sqrt(g),y=Math.sqrt(h),v=r*Math.tan((Ns-Math.acos((g+h-p)/(2*m*y)))/2),b=v/y,w=v/m;Math.abs(b-1)>Ls&&(this._+="L"+(t+b*u)+","+(e+b*c)),this._+="A"+r+","+r+",0,0,"+ +(c*d>u*f)+","+(this._x1=t+w*a)+","+(this._y1=e+w*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,i,r,o){t=+t,e=+e,o=!!o;var s=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+s,u=e+a,c=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>Ls||Math.abs(this._y1-u)>Ls)&&(this._+="L"+l+","+u),n&&(h<0&&(h=h%Os+Os),h>Rs?this._+="A"+n+","+n+",0,1,"+c+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):h>Ls&&(this._+="A"+n+","+n+",0,"+ +(h>=Ns)+","+c+","+(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._}};const Us=js;function Ps(t){return function(){return t}}const Hs=Math.abs,Is=Math.atan2,Gs=Math.cos,Bs=Math.max,Ys=Math.min,Ws=Math.sin,$s=Math.sqrt,Fs=1e-12,qs=Math.PI,Xs=qs/2,Zs=2*qs;function Vs(t){return t>1?0:t<-1?qs:Math.acos(t)}function Qs(t){return t>=1?Xs:t<=-1?-Xs:Math.asin(t)}function Ks(t){return t.innerRadius}function Js(t){return t.outerRadius}function ta(t){return t.startAngle}function ea(t){return t.endAngle}function na(t){return t&&t.padAngle}function ia(t,e,n,i,r,o,s,a){var l=n-t,u=i-e,c=s-r,h=a-o,d=h*l-c*u;if(!(d*d<Fs))return[t+(d=(c*(e-o)-h*(t-r))/d)*l,e+d*u]}function ra(t,e,n,i,r,o,s){var a=t-n,l=e-i,u=(s?o:-o)/$s(a*a+l*l),c=u*l,h=-u*a,d=t+c,f=e+h,g=n+c,p=i+h,m=(d+g)/2,y=(f+p)/2,v=g-d,b=p-f,w=v*v+b*b,_=r-o,x=d*p-g*f,M=(b<0?-1:1)*$s(Bs(0,_*_*w-x*x)),k=(x*b-v*M)/w,E=(-x*v-b*M)/w,D=(x*b+v*M)/w,S=(-x*v+b*M)/w,C=k-m,A=E-y,T=D-m,N=S-y;return C*C+A*A>T*T+N*N&&(k=D,E=S),{cx:k,cy:E,x01:-c,y01:-h,x11:k*(r/_-1),y11:E*(r/_-1)}}function oa(){var t=Ks,e=Js,n=Ps(0),i=null,r=ta,o=ea,s=na,a=null;function l(){var l,u,c=+t.apply(this,arguments),h=+e.apply(this,arguments),d=r.apply(this,arguments)-Xs,f=o.apply(this,arguments)-Xs,g=Hs(f-d),p=f>d;if(a||(a=l=Us()),h<c&&(u=h,h=c,c=u),h>Fs)if(g>Zs-Fs)a.moveTo(h*Gs(d),h*Ws(d)),a.arc(0,0,h,d,f,!p),c>Fs&&(a.moveTo(c*Gs(f),c*Ws(f)),a.arc(0,0,c,f,d,p));else{var m,y,v=d,b=f,w=d,_=f,x=g,M=g,k=s.apply(this,arguments)/2,E=k>Fs&&(i?+i.apply(this,arguments):$s(c*c+h*h)),D=Ys(Hs(h-c)/2,+n.apply(this,arguments)),S=D,C=D;if(E>Fs){var A=Qs(E/c*Ws(k)),T=Qs(E/h*Ws(k));(x-=2*A)>Fs?(w+=A*=p?1:-1,_-=A):(x=0,w=_=(d+f)/2),(M-=2*T)>Fs?(v+=T*=p?1:-1,b-=T):(M=0,v=b=(d+f)/2)}var N=h*Gs(v),O=h*Ws(v),L=c*Gs(_),R=c*Ws(_);if(D>Fs){var z,j=h*Gs(b),U=h*Ws(b),P=c*Gs(w),H=c*Ws(w);if(g<qs&&(z=ia(N,O,P,H,j,U,L,R))){var I=N-z[0],G=O-z[1],B=j-z[0],Y=U-z[1],W=1/Ws(Vs((I*B+G*Y)/($s(I*I+G*G)*$s(B*B+Y*Y)))/2),$=$s(z[0]*z[0]+z[1]*z[1]);S=Ys(D,(c-$)/(W-1)),C=Ys(D,(h-$)/(W+1))}}M>Fs?C>Fs?(m=ra(P,H,N,O,h,C,p),y=ra(j,U,L,R,h,C,p),a.moveTo(m.cx+m.x01,m.cy+m.y01),C<D?a.arc(m.cx,m.cy,C,Is(m.y01,m.x01),Is(y.y01,y.x01),!p):(a.arc(m.cx,m.cy,C,Is(m.y01,m.x01),Is(m.y11,m.x11),!p),a.arc(0,0,h,Is(m.cy+m.y11,m.cx+m.x11),Is(y.cy+y.y11,y.cx+y.x11),!p),a.arc(y.cx,y.cy,C,Is(y.y11,y.x11),Is(y.y01,y.x01),!p))):(a.moveTo(N,O),a.arc(0,0,h,v,b,!p)):a.moveTo(N,O),c>Fs&&x>Fs?S>Fs?(m=ra(L,R,j,U,c,-S,p),y=ra(N,O,P,H,c,-S,p),a.lineTo(m.cx+m.x01,m.cy+m.y01),S<D?a.arc(m.cx,m.cy,S,Is(m.y01,m.x01),Is(y.y01,y.x01),!p):(a.arc(m.cx,m.cy,S,Is(m.y01,m.x01),Is(m.y11,m.x11),!p),a.arc(0,0,c,Is(m.cy+m.y11,m.cx+m.x11),Is(y.cy+y.y11,y.cx+y.x11),p),a.arc(y.cx,y.cy,S,Is(y.y11,y.x11),Is(y.y01,y.x01),!p))):a.arc(0,0,c,_,w,p):a.lineTo(L,R)}else a.moveTo(0,0);if(a.closePath(),l)return a=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-qs/2;return[Gs(i)*n,Ws(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ps(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ps(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ps(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Ps(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ps(+t),l):r},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ps(+t),l):o},l.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Ps(+t),l):s},l.context=function(t){return arguments.length?(a=null==t?null:t,l):a},l}function sa(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function aa(t){this._context=t}function la(t){return new aa(t)}function ua(t){return t[0]}function ca(t){return t[1]}function ha(t,e){var n=Ps(!0),i=null,r=la,o=null;function s(s){var a,l,u,c=(s=sa(s)).length,h=!1;for(null==i&&(o=r(u=Us())),a=0;a<=c;++a)!(a<c&&n(l=s[a],a,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(l,a,s),+e(l,a,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?ua:Ps(t),e="function"==typeof e?e:void 0===e?ca:Ps(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Ps(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Ps(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ps(!!t),s):n},s.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),s):r},s.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),s):i},s}function da(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function fa(t){return t}function ga(t,e){if((r=t.length)>1)for(var n,i,r,o=1,s=t[e[0]],a=s.length;o<r;++o)for(i=s,s=t[e[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function pa(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function ma(t,e){return t[e]}function ya(t){const e=[];return e.key=t,e}function va(t,e,n){this.k=t,this.x=e,this.y=n}function ba(t){return ba="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},ba(t)}function wa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _a(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ma(i.key),i)}}function xa(t,e,n){return(e=Ma(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ma(t){var e=function(t,e){if("object"!==ba(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==ba(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===ba(e)?e:String(e)}Array.prototype.slice,aa.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)}}},va.prototype={constructor:va,scale:function(t){return 1===t?this:new va(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new va(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new va(1,0,0),va.prototype;var ka=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5","salmon","lightsalmon","lightsteelblue","steelblue","yellow","orange","#cccccc","#dddddd","#eee","#aaa","#123456","black"],Ea=function(){function t(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};wa(this,t),xa(this,"marginRight",150),xa(this,"marginBottom",150),xa(this,"colorRange",ka),this.title=e,this.description=n,this.data=i,this.options=r,this.dataIsValid=Array.isArray(i)?i.length>0:!!i,this.wrapper=document.createElement("div"),this.svg=Ts(this.wrapper).append("svg")}var e,n;return e=t,n=[{key:"clearAndScaleSvg",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.g&&this.g.remove(),this.svg.selectAll("*").remove();var r=n||100,o=i||50;this.g=this.svg.append("g").attr("transform","translate(".concat(r,",").concat(o,")")),this.svg.attr("height",e).attr("width",t);var s=this.svg.attr("width")-this.marginRight,a=this.svg.attr("height")-this.marginBottom;return[s,a]}},{key:"drawTitle",value:function(){var t=this;if(this.title&&this.svg.append("g").attr("transform","translate(10, 0)").append("text").attr("text-anchor","start").attr("x",0).attr("y",25).attr("class","chart-title").text(this.title),this.description){var e=Date.now();this.svg.append("g").attr("transform","translate(".concat(this.svg.attr("width")-40,", 5)")).append("path").attr("class","question-mark").attr("id","id-".concat(e)).attr("d","M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z"),setTimeout((function(){var n=document.getElementById("id-".concat(e));n&&n.addEventListener("click",(function(e){t.options.onShowDesc(t.description)}))}))}}},{key:"appendXAxis",value:function(t,e){var n=this.options.ticks?G(t).ticks(this.options.ticks).tickFormat(ao("%d.%m.%Y %H:%M")):G(t).tickFormat(ao("%d.%m.%Y %H:%M"));this.g.append("g").attr("transform","translate(0,"+e+")").call(n)}},{key:"appendXAxisLabel",value:function(t,e){this.options.xAxisLabel&&this.g.append("g").append("text").attr("x",t).attr("y",e+50).attr("text-anchor","end").attr("font-size","18px").attr("fill","black").text(this.options.xAxisLabel)}},{key:"appendYAxisLabel",value:function(){this.options.yAxisLabel&&this.g.append("g").append("text").attr("transform","rotate(-90)").attr("y",6).attr("dy","-4em").attr("text-anchor","end").attr("font-size","18px").attr("fill","black").text(this.options.yAxisLabel)}},{key:"showErrorMessage",value:function(t,e){this.g.append("g").append("text").attr("x",t/2-140).attr("y",e/2-20).attr("class","chart-error-message").text("No data available.")}},{key:"showLegend",value:function(t,e,n){this.svg.append("g").selectAll("g").data(t).enter().append("circle").attr("cx",n-120).attr("cy",(function(t,e){return 25+25*e})).attr("r",7).style("fill",(function(t){return e(t)})),this.svg.selectAll("label").data(t).enter().append("text").attr("x",n-100).attr("y",(function(t,e){return 25+25*e})).style("fill",(function(t){return e(t)})).text((function(t){return t})).attr("text-anchor","left").style("alignment-baseline","middle")}}],n&&_a(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Da(t){return Da="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},Da(t)}function Sa(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ca(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ca(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ca(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Aa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ta(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,r=function(t,e){if("object"!==Da(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==Da(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===Da(r)?r:String(r)),i)}var r}function Na(t,e){return Na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Na(t,e)}function Oa(t,e){if(e&&("object"===Da(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function La(t){return La=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},La(t)}var Ra=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&&Na(t,e)}(s,t);var e,n,i,r,o=(i=s,r=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}}(),function(){var t,e=La(i);if(r){var n=La(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Oa(this,t)});function s(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Aa(this,s),r.transform&&(i=(null!==(t=i)&&void 0!==t?t:[]).map(r.transform)),o.call(this,e,n,i,r)}return e=s,n=[{key:"plot",value:function(t,e){var n=Sa(this.clearAndScaleSvg(t,e),2),i=n[0],r=n[1];if(this.drawTitle(),!this.dataIsValid)return this.showErrorMessage(t,e),this.wrapper.innerHTML;var o=Sa(N(this.data,(function(t){return t.column1})),2),s=o[0],a=o[1],l=As().domain([s,a]).range([0,i]);this.appendXAxis(l,r),this.appendXAxisLabel(i,r),this.appendYAxisLabel();var u=O(this.data,(function(t){return+t.column2})),c=fr().domain([0,u]).range([r,0]);this.g.append("g").call(B(c));var h=ki().range(this.colorRange);return this.g.append("path").datum(this.data).attr("stroke",(function(t){return h(t.column2)})).attr("class","chart-path").attr("d",ha().x((function(t){return l(t.column1)})).y((function(t){return c(t.column2)}))),this.options.showLegend&&this.showLegend(this.data.map((function(t){return t.column1})),h,t),this.wrapper.innerHTML}}],n&&Ta(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Ea);function za(t){return za="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},za(t)}function ja(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Ua(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,r=function(t,e){if("object"!==za(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==za(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===za(r)?r:String(r)),i)}var r}function Pa(t,e){return Pa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pa(t,e)}function Ha(t,e){if(e&&("object"===za(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ia(t){return Ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ia(t)}var Ga=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&&Pa(t,e)}(s,t);var e,n,i,r,o=(i=s,r=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}}(),function(){var t,e=Ia(i);if(r){var n=Ia(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ha(this,t)});function s(t,e,n,i){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),i.transform&&(n=(null!==(r=n)&&void 0!==r?r:[]).map(i.transform)),o.call(this,t,e,n,i)}return e=s,n=[{key:"plot",value:function(t,e){var n,i,r=(n=this.clearAndScaleSvg(t,e),i=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(n,i)||function(t,e){if(t){if("string"==typeof t)return ja(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ja(t,e):void 0}}(n,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],s=r[1];if(this.drawTitle(),!this.dataIsValid)return this.showErrorMessage(t,e),this.wrapper.innerHTML;var a=Ei().range([0,o]).padding(.4),l=fr().range([s,0]),u=O(this.data,(function(t){return t.column2}));a.domain(this.data.map((function(t){return t.column1}))),l.domain([0,u]),this.appendXAxis(a,s),this.appendXAxisLabel(o,s),this.appendYAxisLabel(),this.g.append("g").attr("transform","translate(0, 0)").call(B(l));var c=ki().range(this.colorRange);return this.g.selectAll(".bar").data(this.data).enter().append("rect").attr("fill",(function(t){return c(t.column2)})).attr("x",(function(t){return a(t.column1)})).attr("y",(function(t){return l(t.column2)})).attr("width",a.bandwidth()).attr("height",(function(t){return s-l(t.column2)})),this.options.showLegend&&this.showLegend(this.data.map((function(t){return t.column1})),c,t),this.wrapper.innerHTML}}],n&&Ua(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Ea);function Ba(t){return Ba="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},Ba(t)}function Ya(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Wa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $a(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,r=function(t,e){if("object"!==Ba(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==Ba(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===Ba(r)?r:String(r)),i)}var r}function Fa(t,e){return Fa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fa(t,e)}function qa(t,e){if(e&&("object"===Ba(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Xa(t){return Xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xa(t)}var Za=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&&Fa(t,e)}(s,t);var e,n,i,r,o=(i=s,r=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}}(),function(){var t,e=Xa(i);if(r){var n=Xa(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return qa(this,t)});function s(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Wa(this,s),r.transform&&(i=(null!==(t=i)&&void 0!==t?t:[]).map(r.transform)),o.call(this,e,n,i,r)}return e=s,n=[{key:"plot",value:function(t,e){var n=t/2,i=e/2;if(!this.dataIsValid)return this.clearAndScaleSvg(t,e),this.drawTitle(),this.showErrorMessage(t,e),this.wrapper.innerHTML;var r,o,s=(r=this.clearAndScaleSvg(t,e,n,i),o=2,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(r,o)||function(t,e){if(t){if("string"==typeof t)return Ya(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ya(t,e):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=s[0],l=s[1];this.drawTitle();var u=Math.min(a,l)/1.5,c=function(){var t=fa,e=da,n=null,i=Ps(0),r=Ps(Zs),o=Ps(0);function s(s){var a,l,u,c,h,d=(s=sa(s)).length,f=0,g=new Array(d),p=new Array(d),m=+i.apply(this,arguments),y=Math.min(Zs,Math.max(-Zs,r.apply(this,arguments)-m)),v=Math.min(Math.abs(y)/d,o.apply(this,arguments)),b=v*(y<0?-1:1);for(a=0;a<d;++a)(h=p[g[a]=a]=+t(s[a],a,s))>0&&(f+=h);for(null!=e?g.sort((function(t,n){return e(p[t],p[n])})):null!=n&&g.sort((function(t,e){return n(s[t],s[e])})),a=0,u=f?(y-d*b)/f:0;a<d;++a,m=c)l=g[a],c=m+((h=p[l])>0?h*u:0)+b,p[l]={data:s[l],index:a,value:h,startAngle:m,endAngle:c,padAngle:v};return p}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:Ps(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ps(+t),s):i},s.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ps(+t),s):r},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ps(+t),s):o},s}().value((function(t){return t.column2})),h=oa().outerRadius(u-10).innerRadius(0),d=(oa().outerRadius(u).innerRadius(u-80),this.g.selectAll(".arc").data(c(this.data)).enter().append("g").attr("class","arc")),f=ki().domain(this.data).range(this.colorRange);return d.append("path").attr("d",h).attr("fill",(function(t){return f(t.data.column1)})),d.append("text").attr("transform",(function(t){return"translate("+(u+50)*Math.sin((t.endAngle-t.startAngle)/2+t.startAngle)+", "+-1*(u-10)*Math.cos((t.endAngle-t.startAngle)/2+t.startAngle)+")"})).attr("dy",".5em").text((function(t){return"".concat(t.data.column2," %")})),this.options.showLegend&&this.showLegend(this.data.map((function(t){return t.column1})),f,t),this.wrapper.innerHTML}}],n&&$a(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Ea);function Va(t){return Va="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},Va(t)}function Qa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Ka(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ja(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,r=function(t,e){if("object"!==Va(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==Va(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===Va(r)?r:String(r)),i)}var r}function tl(t,e){return tl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tl(t,e)}function el(t,e){if(e&&("object"===Va(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function nl(t){return nl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nl(t)}var il=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&&tl(t,e)}(s,t);var e,n,i,r,o=(i=s,r=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}}(),function(){var t,e=nl(i);if(r){var n=nl(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return el(this,t)});function s(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Ka(this,s),r.transform&&(i=(null!==(t=i)&&void 0!==t?t:[]).map(r.transform)),o.call(this,e,n,i,r)}return e=s,n=[{key:"plot",value:function(t,e){var n,i,r=(n=this.clearAndScaleSvg(t,e),i=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(n,i)||function(t,e){if(t){if("string"==typeof t)return Qa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qa(t,e):void 0}}(n,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],s=r[1];if(this.drawTitle(),!this.dataIsValid)return this.showErrorMessage(t,e),this.wrapper.innerHTML;var a=As().domain(N(this.data,(function(t){return t.column1}))).range([0,o]);this.appendXAxis(a,s),this.appendXAxisLabel(o,s),this.appendYAxisLabel();var l=fr().domain([0,O(this.data,(function(t){return+t.column2}))]).range([s,0]);this.g.append("g").call(B(l));var u=ki().range(this.colorRange);return this.g.append("path").datum(this.data).attr("fill",(function(t){return u(t.column2)})).attr("class","chart-area").attr("d",function(t,e,n){var i=null,r=Ps(!0),o=null,s=la,a=null;function l(l){var u,c,h,d,f,g=(l=sa(l)).length,p=!1,m=new Array(g),y=new Array(g);for(null==o&&(a=s(f=Us())),u=0;u<=g;++u){if(!(u<g&&r(d=l[u],u,l))===p)if(p=!p)c=u,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=u-1;h>=c;--h)a.point(m[h],y[h]);a.lineEnd(),a.areaEnd()}p&&(m[u]=+t(d,u,l),y[u]=+e(d,u,l),a.point(i?+i(d,u,l):m[u],n?+n(d,u,l):y[u]))}if(f)return a=null,f+""||null}function u(){return ha().defined(r).curve(s).context(o)}return t="function"==typeof t?t:void 0===t?ua:Ps(+t),e="function"==typeof e?e:Ps(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?ca:Ps(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Ps(+e),i=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Ps(+e),l):t},l.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Ps(+t),l):i},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Ps(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Ps(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Ps(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(i).y(e)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:Ps(!!t),l):r},l.curve=function(t){return arguments.length?(s=t,null!=o&&(a=s(o)),l):s},l.context=function(t){return arguments.length?(null==t?o=a=null:a=s(o=t),l):o},l}().x((function(t){return a(t.column1)})).y0(l(0)).y1((function(t){return l(t.column2)}))),this.options.showLegend&&this.showLegend(this.data.map((function(t){return t.column1})),u,t),this.wrapper.innerHTML}}],n&&Ja(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Ea);function rl(t){return rl="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},rl(t)}function ol(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function sl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ol(Object(n),!0).forEach((function(e){al(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ol(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function al(t,e,n){return(e=hl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ll(t,e){if(t){if("string"==typeof t)return ul(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ul(t,e):void 0}}function ul(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function cl(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,hl(i.key),i)}}function hl(t){var e=function(t,e){if("object"!==rl(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==rl(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===rl(e)?e:String(e)}function dl(t,e){return dl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dl(t,e)}function fl(t,e){if(e&&("object"===rl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function gl(t){return gl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gl(t)}var pl=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&&dl(t,e)}(s,t);var e,n,i,r,o=(i=s,r=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}}(),function(){var t,e=gl(i);if(r){var n=gl(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return fl(this,t)});function s(t,e,n,i,r){var a,l;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),r.transform&&(n=(null!==(a=n)&&void 0!==a?a:[]).map(r.transform)),(l=o.call(this,t,e,n,r)).groups=i,l}return e=s,n=[{key:"plot",value:function(t,e){var n,i,r=this,o=(n=this.clearAndScaleSvg(t,e),i=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(n,i)||ll(n,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=o[0],a=o[1];if(this.drawTitle(),!this.dataIsValid)return this.showErrorMessage(t,e),this.wrapper.innerHTML;var l=Object.keys(this.data.overall[0]),u=Object.keys(this.data),c=Object.keys(this.data).reduce((function(t,e){return[].concat(function(t){return function(t){if(Array.isArray(t))return ul(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ll(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.")}()}(t),[sl(sl({},r.data[e][0]),{},{group:e})])}),[]),h=function(){var t=Ps([]),e=pa,n=ga,i=ma;function r(r){var o,s,a=Array.from(t.apply(this,arguments),ya),l=a.length,u=-1;for(const t of r)for(o=0,++u;o<l;++o)(a[o][u]=[0,+i(t,a[o].key,u,r)]).data=t;for(o=0,s=sa(e(a));o<l;++o)a[s[o]].index=o;return n(a,s),a}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:Ps(Array.from(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:Ps(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?pa:"function"==typeof t?t:Ps(Array.from(t)),r):e},r.offset=function(t){return arguments.length?(n=null==t?ga:t,r):n},r}().keys(l)(c),d=h[0][0][0],f=h[h.length-1][0][1],g=Ei().domain(u).range([0,s]).padding([.2]);this.g.append("g").attr("transform","translate(0, ".concat(a,")")).call(G(g).tickSizeOuter(0));var p=fr().domain([d,f]).range([a,0]);this.g.append("g").call(B(p));var m=ki().domain(["overall"]).range(this.colorRange);return this.g.append("g").selectAll("g").data(h).join("g").attr("fill",(function(t){return m(t.key)})).selectAll("rect").data((function(t){return t})).join("rect").attr("x",(function(t){return g(t.data.group)})).attr("x",(function(t){return g(t.data.group)})).attr("y",(function(t){return p(t[1])})).attr("height",(function(t){return p(t[0])-p(t[1])})).attr("width",g.bandwidth()),this.options.showLegend&&this.showLegend(l,m,t),this.wrapper.innerHTML}}],n&&cl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Ea)})(),i})())); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["dashboard-sdk"]=e():t["dashboard-sdk"]=e()}(self,(()=>(()=>{"use strict";var t={744:(t,e,n)=>{n.d(e,{Z:()=>d});var i=n(81),r=n.n(i),o=n(645),s=n.n(o),a=n(667),l=n.n(a),u=new URL(n(810),n.b),c=s()(r()),h=l()(u);c.push([t.id,":root .grid-stack-item>.ui-resizable-handle{filter:none}.grid-stack{position:relative}.grid-stack.grid-stack-rtl{direction:ltr}.grid-stack.grid-stack-rtl>.grid-stack-item{direction:rtl}.grid-stack .grid-stack-placeholder>.placeholder-content{background-color:rgba(0,0,0,0.1);margin:0;position:absolute;width:auto;z-index:0 !important;text-align:center}.grid-stack>.grid-stack-item{min-width:8.3333333333%;position:absolute;padding:0}.grid-stack>.grid-stack-item>.grid-stack-item-content{margin:0;position:absolute;width:auto;overflow-x:hidden;overflow-y:auto}.grid-stack>.grid-stack-item>.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.grid-stack>.grid-stack-item.ui-resizable-autohide>.ui-resizable-handle,.grid-stack>.grid-stack-item.ui-resizable-disabled>.ui-resizable-handle{display:none}.grid-stack>.grid-stack-item>.ui-resizable-se,.grid-stack>.grid-stack-item>.ui-resizable-sw{background-image:url("+h+');background-repeat:no-repeat;background-position:center;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.grid-stack>.grid-stack-item>.ui-resizable-se{-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.grid-stack>.grid-stack-item>.ui-resizable-nw{cursor:nw-resize;width:20px;height:20px;top:0}.grid-stack>.grid-stack-item>.ui-resizable-n{cursor:n-resize;height:10px;top:0;left:25px;right:25px}.grid-stack>.grid-stack-item>.ui-resizable-ne{cursor:ne-resize;width:20px;height:20px;top:0}.grid-stack>.grid-stack-item>.ui-resizable-e{cursor:e-resize;width:10px;top:15px;bottom:15px}.grid-stack>.grid-stack-item>.ui-resizable-se{cursor:se-resize;width:20px;height:20px}.grid-stack>.grid-stack-item>.ui-resizable-s{cursor:s-resize;height:10px;left:25px;bottom:0;right:25px}.grid-stack>.grid-stack-item>.ui-resizable-sw{cursor:sw-resize;width:20px;height:20px}.grid-stack>.grid-stack-item>.ui-resizable-w{cursor:w-resize;width:10px;top:15px;bottom:15px}.grid-stack>.grid-stack-item.ui-draggable-dragging>.ui-resizable-handle{display:none !important}.grid-stack>.grid-stack-item[gs-w="0"]{width:0%}.grid-stack>.grid-stack-item[gs-x="0"]{left:0}.grid-stack>.grid-stack-item[gs-min-w="0"]{min-width:0}.grid-stack>.grid-stack-item[gs-max-w="0"]{max-width:0%}.grid-stack>.grid-stack-item[gs-w="1"]{width:8.3333333333%}.grid-stack>.grid-stack-item[gs-x="1"]{left:8.3333333333%}.grid-stack>.grid-stack-item[gs-min-w="1"]{min-width:8.3333333333%}.grid-stack>.grid-stack-item[gs-max-w="1"]{max-width:8.3333333333%}.grid-stack>.grid-stack-item[gs-w="2"]{width:16.6666666667%}.grid-stack>.grid-stack-item[gs-x="2"]{left:16.6666666667%}.grid-stack>.grid-stack-item[gs-min-w="2"]{min-width:16.6666666667%}.grid-stack>.grid-stack-item[gs-max-w="2"]{max-width:16.6666666667%}.grid-stack>.grid-stack-item[gs-w="3"]{width:25%}.grid-stack>.grid-stack-item[gs-x="3"]{left:25%}.grid-stack>.grid-stack-item[gs-min-w="3"]{min-width:25%}.grid-stack>.grid-stack-item[gs-max-w="3"]{max-width:25%}.grid-stack>.grid-stack-item[gs-w="4"]{width:33.3333333333%}.grid-stack>.grid-stack-item[gs-x="4"]{left:33.3333333333%}.grid-stack>.grid-stack-item[gs-min-w="4"]{min-width:33.3333333333%}.grid-stack>.grid-stack-item[gs-max-w="4"]{max-width:33.3333333333%}.grid-stack>.grid-stack-item[gs-w="5"]{width:41.6666666667%}.grid-stack>.grid-stack-item[gs-x="5"]{left:41.6666666667%}.grid-stack>.grid-stack-item[gs-min-w="5"]{min-width:41.6666666667%}.grid-stack>.grid-stack-item[gs-max-w="5"]{max-width:41.6666666667%}.grid-stack>.grid-stack-item[gs-w="6"]{width:50%}.grid-stack>.grid-stack-item[gs-x="6"]{left:50%}.grid-stack>.grid-stack-item[gs-min-w="6"]{min-width:50%}.grid-stack>.grid-stack-item[gs-max-w="6"]{max-width:50%}.grid-stack>.grid-stack-item[gs-w="7"]{width:58.3333333333%}.grid-stack>.grid-stack-item[gs-x="7"]{left:58.3333333333%}.grid-stack>.grid-stack-item[gs-min-w="7"]{min-width:58.3333333333%}.grid-stack>.grid-stack-item[gs-max-w="7"]{max-width:58.3333333333%}.grid-stack>.grid-stack-item[gs-w="8"]{width:66.6666666667%}.grid-stack>.grid-stack-item[gs-x="8"]{left:66.6666666667%}.grid-stack>.grid-stack-item[gs-min-w="8"]{min-width:66.6666666667%}.grid-stack>.grid-stack-item[gs-max-w="8"]{max-width:66.6666666667%}.grid-stack>.grid-stack-item[gs-w="9"]{width:75%}.grid-stack>.grid-stack-item[gs-x="9"]{left:75%}.grid-stack>.grid-stack-item[gs-min-w="9"]{min-width:75%}.grid-stack>.grid-stack-item[gs-max-w="9"]{max-width:75%}.grid-stack>.grid-stack-item[gs-w="10"]{width:83.3333333333%}.grid-stack>.grid-stack-item[gs-x="10"]{left:83.3333333333%}.grid-stack>.grid-stack-item[gs-min-w="10"]{min-width:83.3333333333%}.grid-stack>.grid-stack-item[gs-max-w="10"]{max-width:83.3333333333%}.grid-stack>.grid-stack-item[gs-w="11"]{width:91.6666666667%}.grid-stack>.grid-stack-item[gs-x="11"]{left:91.6666666667%}.grid-stack>.grid-stack-item[gs-min-w="11"]{min-width:91.6666666667%}.grid-stack>.grid-stack-item[gs-max-w="11"]{max-width:91.6666666667%}.grid-stack>.grid-stack-item[gs-w="12"]{width:100%}.grid-stack>.grid-stack-item[gs-x="12"]{left:100%}.grid-stack>.grid-stack-item[gs-min-w="12"]{min-width:100%}.grid-stack>.grid-stack-item[gs-max-w="12"]{max-width:100%}.grid-stack.grid-stack-1>.grid-stack-item{min-width:100%}.grid-stack.grid-stack-1>.grid-stack-item[gs-w="1"]{width:100%}.grid-stack.grid-stack-1>.grid-stack-item[gs-x="1"]{left:100%}.grid-stack.grid-stack-1>.grid-stack-item[gs-min-w="1"]{min-width:100%}.grid-stack.grid-stack-1>.grid-stack-item[gs-max-w="1"]{max-width:100%}.grid-stack.grid-stack-animate,.grid-stack.grid-stack-animate .grid-stack-item{-webkit-transition:left .3s,top .3s,height .3s,width .3s;-moz-transition:left .3s,top .3s,height .3s,width .3s;-ms-transition:left .3s,top .3s,height .3s,width .3s;-o-transition:left .3s,top .3s,height .3s,width .3s;transition:left .3s,top .3s,height .3s,width .3s}.grid-stack.grid-stack-animate .grid-stack-item.grid-stack-placeholder,.grid-stack.grid-stack-animate .grid-stack-item.ui-draggable-dragging,.grid-stack.grid-stack-animate .grid-stack-item.ui-resizable-resizing{-webkit-transition:left 0s,top 0s,height 0s,width 0s;-moz-transition:left 0s,top 0s,height 0s,width 0s;-ms-transition:left 0s,top 0s,height 0s,width 0s;-o-transition:left 0s,top 0s,height 0s,width 0s;transition:left 0s,top 0s,height 0s,width 0s}.ui-draggable-dragging,.ui-resizable-resizing{z-index:100}.ui-draggable-dragging>.grid-stack-item-content,.ui-resizable-resizing>.grid-stack-item-content{box-shadow:1px 4px 6px rgba(0,0,0,0.2);opacity:.8}.ui-draggable-dragging{will-change:left,top;cursor:move}.ui-resizable-resizing{will-change:width,height}\n',""]);const d=c},466:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(81),r=n.n(i),o=n(645),s=n.n(o)()(r());s.push([t.id,'.chart-title{font-size:20px;font-weight:bold}.chart-error-message{font-size:15px;font-style:italic}.chart-path{fill:none;stroke-width:1.5}.chart-area{stroke-width:1.5}.listening-rect{stroke:grey;fill:white}.question-mark{cursor:pointer;opacity:0.2;transform:scale(0.05);-ms-transform:scale(0.05);-webkit-transform:scale(0.05)}.question-mark:hover{opacity:0.5}.grid-stack-item-content{overflow:hidden !important;box-shadow:0 1px 3px rgba(0,0,0,0.12),0 1px 2px rgba(0,0,0,0.24);transition:all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);background:#fff}.grid-stack-item-removing{opacity:0.5}.subgrid{margin-right:20px}.grid-stack>.grid-stack-item.grid-stack-sub-grid>.grid-stack-item-content{background:rgba(0,0,0,0.05)}.grid-stack.grid-stack-nested{background:none;position:absolute;inset:0}body{height:100%;margin:0;padding:0}.wrapper{display:flex;font-family:"Roboto"}.grid{width:100%;height:100%}.grid .grid-stack{min-height:500px}.sidebar-hidden{visibility:hidden;display:none}.sidebar{visibility:visible;display:flex;flex-direction:column;gap:10px;padding:10px}.dropzone-remove{border:3px dashed red;opacity:0.5;height:100px;display:flex;justify-content:center;align-items:center}.dropzone-remove:hover{opacity:1}.available-widgets{border:3px dashed grey;padding:10px;display:flex;flex-direction:column;gap:10px}\n',""]);const a=s},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,r,o){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(i)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var u=0;u<t.length;u++){var c=[].concat(t[u]);i&&s[c[0]]||(void 0!==o&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),e.push(c))}},e}},667:t=>{t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},81:t=>{t.exports=function(t){return t[1]}},249:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDBaseImplement=void 0,e.DDBaseImplement=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(t,e){this._eventRegister[t]=e}off(t){delete this._eventRegister[t]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(t,e){if(!this.disabled&&this._eventRegister&&this._eventRegister[t])return this._eventRegister[t](e)}}},529:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDDraggable=void 0;const i=n(427),r=n(284),o=n(249),s=n(168);class a extends o.DDBaseImplement{constructor(t,e={}){super(),this.el=t,this.option=e;let n=e.handle.substring(1);this.dragEl=t.classList.contains(n)?t:t.querySelector(e.handle)||t,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this.enable()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){!1!==this.disabled&&(super.enable(),this.dragEl.addEventListener("mousedown",this._mouseDown),s.isTouch&&(this.dragEl.addEventListener("touchstart",s.touchstart),this.dragEl.addEventListener("pointerdown",s.pointerdown)),this.el.classList.remove("ui-draggable-disabled"),this.el.classList.add("ui-draggable"))}disable(t=!1){!0!==this.disabled&&(super.disable(),this.dragEl.removeEventListener("mousedown",this._mouseDown),s.isTouch&&(this.dragEl.removeEventListener("touchstart",s.touchstart),this.dragEl.removeEventListener("pointerdown",s.pointerdown)),this.el.classList.remove("ui-draggable"),t||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.dragging&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(t){return Object.keys(t).forEach((e=>this.option[e]=t[e])),this}_mouseDown(t){if(i.DDManager.mouseHandled)return;if(0!==t.button)return!0;const e=t.target.nodeName.toLowerCase();return["input","textarea","button","select","option"].find((t=>t===e))||t.target.closest('[contenteditable="true"]')||(this.mouseDownEvent=t,delete this.dragging,delete i.DDManager.dragElement,delete i.DDManager.dropElement,document.addEventListener("mousemove",this._mouseMove,!0),document.addEventListener("mouseup",this._mouseUp,!0),s.isTouch&&(this.dragEl.addEventListener("touchmove",s.touchmove),this.dragEl.addEventListener("touchend",s.touchend)),t.preventDefault(),document.activeElement&&document.activeElement.blur(),i.DDManager.mouseHandled=!0),!0}_callDrag(t){if(!this.dragging)return;const e=r.Utils.initEvent(t,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(e,this.ui()),this.triggerEvent("drag",e)}_mouseMove(t){var e;let n=this.mouseDownEvent;if(this.dragging)if(this._dragFollow(t),i.DDManager.pauseDrag){const e=Number.isInteger(i.DDManager.pauseDrag)?i.DDManager.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout((()=>this._callDrag(t)),e)}else this._callDrag(t);else if(Math.abs(t.x-n.x)+Math.abs(t.y-n.y)>3){this.dragging=!0,i.DDManager.dragElement=this;let n=null===(e=this.el.gridstackNode)||void 0===e?void 0:e.grid;n?i.DDManager.dropElement=n.el.ddElement.ddDroppable:delete i.DDManager.dropElement,this.helper=this._createHelper(t),this._setupHelperContainmentStyle(),this.dragOffset=this._getDragOffset(t,this.el,this.helperContainment);const o=r.Utils.initEvent(t,{target:this.el,type:"dragstart"});this._setupHelperStyle(t),this.option.start&&this.option.start(o,this.ui()),this.triggerEvent("dragstart",o)}return t.preventDefault(),!0}_mouseUp(t){var e;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),s.isTouch&&(this.dragEl.removeEventListener("touchmove",s.touchmove,!0),this.dragEl.removeEventListener("touchend",s.touchend,!0)),this.dragging){delete this.dragging,(null===(e=i.DDManager.dropElement)||void 0===e?void 0:e.el)===this.el.parentElement&&delete i.DDManager.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper===this.el?this._removeHelperStyle():this.helper.remove();const n=r.Utils.initEvent(t,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(n),this.triggerEvent("dragstop",n),i.DDManager.dropElement&&i.DDManager.dropElement.drop(t)}delete this.helper,delete this.mouseDownEvent,delete i.DDManager.dragElement,delete i.DDManager.dropElement,delete i.DDManager.mouseHandled,t.preventDefault()}_createHelper(t){let e=this.el;return"function"==typeof this.option.helper?e=this.option.helper(t):"clone"===this.option.helper&&(e=r.Utils.cloneNode(this.el)),document.body.contains(e)||r.Utils.appendTo(e,"parent"===this.option.appendTo?this.el.parentNode:this.option.appendTo),e===this.el&&(this.dragElementOriginStyle=a.originStyleProp.map((t=>this.el.style[t]))),e}_setupHelperStyle(t){this.helper.classList.add("ui-draggable-dragging");const e=this.helper.style;return e.pointerEvents="none",e["min-width"]=0,e.width=this.dragOffset.width+"px",e.height=this.dragOffset.height+"px",e.willChange="left, top",e.position="fixed",this._dragFollow(t),e.transition="none",setTimeout((()=>{this.helper&&(e.transition=null)}),0),this}_removeHelperStyle(){var t;this.helper.classList.remove("ui-draggable-dragging");let e=null===(t=this.helper)||void 0===t?void 0:t.gridstackNode;if(this.dragElementOriginStyle&&(!e||!e._isAboutToRemove)){let t=this.helper,e=this.dragElementOriginStyle.transition||null;t.style.transition=this.dragElementOriginStyle.transition="none",a.originStyleProp.forEach((e=>t.style[e]=this.dragElementOriginStyle[e]||null)),setTimeout((()=>t.style.transition=e),50)}return delete this.dragElementOriginStyle,this}_dragFollow(t){const e=this.helper.style,n=this.dragOffset;e.left=t.clientX+n.offsetLeft-0+"px",e.top=t.clientY+n.offsetTop-0+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,"fixed"!==this.helper.style.position&&(this.parentOriginStylePosition=this.helperContainment.style.position,window.getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(t,e,n){let i=0,o=0;if(n){const t=document.createElement("div");r.Utils.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),n.appendChild(t);const e=t.getBoundingClientRect();n.removeChild(t),i=e.left,o=e.top}const s=e.getBoundingClientRect();return{left:s.left,top:s.top,offsetLeft:-t.clientX+s.left-i,offsetTop:-t.clientY+s.top-o,width:s.width,height:s.height}}ui(){const t=this.el.parentElement.getBoundingClientRect(),e=this.helper.getBoundingClientRect();return{position:{top:e.top-t.top,left:e.left-t.left}}}}e.DDDraggable=a,a.originStyleProp=["transition","pointerEvents","position","left","top"]},514:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDDroppable=void 0;const i=n(427),r=n(249),o=n(284),s=n(168);class a extends r.DDBaseImplement{constructor(t,e={}){super(),this.el=t,this.option=e,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){!1!==this.disabled&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),s.isTouch&&(this.el.addEventListener("pointerenter",s.pointerenter),this.el.addEventListener("pointerleave",s.pointerleave)))}disable(t=!1){!0!==this.disabled&&(super.disable(),this.el.classList.remove("ui-droppable"),t||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),s.isTouch&&(this.el.removeEventListener("pointerenter",s.pointerenter),this.el.removeEventListener("pointerleave",s.pointerleave)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(t){return Object.keys(t).forEach((e=>this.option[e]=t[e])),this._setupAccept(),this}_mouseEnter(t){if(!i.DDManager.dragElement)return;if(!this._canDrop(i.DDManager.dragElement.el))return;t.preventDefault(),t.stopPropagation(),i.DDManager.dropElement&&i.DDManager.dropElement!==this&&i.DDManager.dropElement._mouseLeave(t),i.DDManager.dropElement=this;const e=o.Utils.initEvent(t,{target:this.el,type:"dropover"});this.option.over&&this.option.over(e,this._ui(i.DDManager.dragElement)),this.triggerEvent("dropover",e),this.el.classList.add("ui-droppable-over")}_mouseLeave(t){var e;if(!i.DDManager.dragElement||i.DDManager.dropElement!==this)return;t.preventDefault(),t.stopPropagation();const n=o.Utils.initEvent(t,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(n,this._ui(i.DDManager.dragElement)),this.triggerEvent("dropout",n),i.DDManager.dropElement===this){let n;delete i.DDManager.dropElement;let r=this.el.parentElement;for(;!n&&r;)n=null===(e=r.ddElement)||void 0===e?void 0:e.ddDroppable,r=r.parentElement;n&&n._mouseEnter(t)}}drop(t){t.preventDefault();const e=o.Utils.initEvent(t,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(e,this._ui(i.DDManager.dragElement)),this.triggerEvent("drop",e)}_canDrop(t){return t&&(!this.accept||this.accept(t))}_setupAccept(){return this.option.accept?("string"==typeof this.option.accept?this.accept=t=>t.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(t){return Object.assign({draggable:t.el},t.ui())}}e.DDDroppable=a},474:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDElement=void 0;const i=n(945),r=n(529),o=n(514);class s{constructor(t){this.el=t}static init(t){return t.ddElement||(t.ddElement=new s(t)),t.ddElement}on(t,e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(t)>-1?this.ddDraggable.on(t,e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(t)>-1?this.ddDroppable.on(t,e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(t)>-1&&this.ddResizable.on(t,e),this}off(t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(t)>-1?this.ddDraggable.off(t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(t)>-1?this.ddDroppable.off(t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(t)>-1&&this.ddResizable.off(t),this}setupDraggable(t){return this.ddDraggable?this.ddDraggable.updateOption(t):this.ddDraggable=new r.DDDraggable(this.el,t),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(t){return this.ddResizable?this.ddResizable.updateOption(t):this.ddResizable=new i.DDResizable(this.el,t),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(t){return this.ddDroppable?this.ddDroppable.updateOption(t):this.ddDroppable=new o.DDDroppable(this.el,t),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}e.DDElement=s},470:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDGridStack=void 0;const i=n(523),r=n(929),o=n(284),s=n(427),a=n(474);class l{static get(){return u}resizable(t,e,n,i){return this._getDDElements(t).forEach((t=>{if("disable"===e||"enable"===e)t.ddResizable&&t.ddResizable[e]();else if("destroy"===e)t.ddResizable&&t.cleanResizable();else if("option"===e)t.setupResizable({[n]:i});else{const n=t.el.gridstackNode.grid;let i=t.el.getAttribute("gs-resize-handles")?t.el.getAttribute("gs-resize-handles"):n.opts.resizable.handles,r=!n.opts.alwaysShowResizeHandle;t.setupResizable(Object.assign(Object.assign(Object.assign({},n.opts.resizable),{handles:i,autoHide:r}),{start:e.start,stop:e.stop,resize:e.resize}))}})),this}draggable(t,e,n,i){return this._getDDElements(t).forEach((t=>{if("disable"===e||"enable"===e)t.ddDraggable&&t.ddDraggable[e]();else if("destroy"===e)t.ddDraggable&&t.cleanDraggable();else if("option"===e)t.setupDraggable({[n]:i});else{const n=t.el.gridstackNode.grid;t.setupDraggable(Object.assign(Object.assign({},n.opts.draggable),{start:e.start,stop:e.stop,drag:e.drag}))}})),this}dragIn(t,e){return this._getDDElements(t).forEach((t=>t.setupDraggable(e))),this}droppable(t,e,n,i){return"function"!=typeof e.accept||e._accept||(e._accept=e.accept,e.accept=t=>e._accept(t)),this._getDDElements(t).forEach((t=>{"disable"===e||"enable"===e?t.ddDroppable&&t.ddDroppable[e]():"destroy"===e?t.ddDroppable&&t.cleanDroppable():"option"===e?t.setupDroppable({[n]:i}):t.setupDroppable(e)})),this}isDroppable(t){return!(!(t&&t.ddElement&&t.ddElement.ddDroppable)||t.ddElement.ddDroppable.disabled)}isDraggable(t){return!(!(t&&t.ddElement&&t.ddElement.ddDraggable)||t.ddElement.ddDraggable.disabled)}isResizable(t){return!(!(t&&t.ddElement&&t.ddElement.ddResizable)||t.ddElement.ddResizable.disabled)}on(t,e,n){return this._getDDElements(t).forEach((t=>t.on(e,(t=>{n(t,s.DDManager.dragElement?s.DDManager.dragElement.el:t.target,s.DDManager.dragElement?s.DDManager.dragElement.helper:null)})))),this}off(t,e){return this._getDDElements(t).forEach((t=>t.off(e))),this}_getDDElements(t,e=!0){let n=o.Utils.getElements(t);if(!n.length)return[];let i=n.map((t=>t.ddElement||(e?a.DDElement.init(t):null)));return e||i.filter((t=>t)),i}}e.DDGridStack=l;const u=new l;function c(t,e){let n=t?t.gridstackNode:void 0;n&&n.grid&&(e?n._isAboutToRemove=!0:delete n._isAboutToRemove,e?t.classList.add("grid-stack-item-removing"):t.classList.remove("grid-stack-item-removing"))}r.GridStack.prototype._setupAcceptWidget=function(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return u.droppable(this.el,"destroy"),this;let t,e,n=(n,i,r)=>{let s=i.gridstackNode;if(!s)return;r=r||i;let a=this.el.getBoundingClientRect(),{top:l,left:c}=r.getBoundingClientRect();c-=a.left,l-=a.top;let h={position:{top:l,left:c}};if(s._temporaryRemoved){if(s.x=Math.max(0,Math.round(c/e)),s.y=Math.max(0,Math.round(l/t)),delete s.autoPosition,this.engine.nodeBoundFix(s),!this.engine.willItFit(s)){if(s.autoPosition=!0,!this.engine.willItFit(s))return void u.off(i,"drag");s._willFitPos&&(o.Utils.copyPos(s,s._willFitPos),delete s._willFitPos)}this._onStartMoving(r,n,h,s,e,t)}else this._dragOrResize(r,n,h,s,e,t)};return u.droppable(this.el,{accept:t=>{let e=t.gridstackNode;if((null==e?void 0:e.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let n=!0;if("function"==typeof this.opts.acceptWidgets)n=this.opts.acceptWidgets(t);else{let e=!0===this.opts.acceptWidgets?".grid-stack-item":this.opts.acceptWidgets;n=t.matches(e)}if(n&&e&&this.opts.maxRow){let t={w:e.w,h:e.h,minW:e.minW,minH:e.minH};n=this.engine.willItFit(t)}return n}}).on(this.el,"dropover",((i,r,o)=>{let s=r.gridstackNode;if((null==s?void 0:s.grid)===this&&!s._temporaryRemoved)return!1;(null==s?void 0:s.grid)&&s.grid!==this&&!s._temporaryRemoved&&s.grid._leave(r,o),e=this.cellWidth(),t=this.getCellHeight(!0),s||(s=this._readAttr(r)),s.grid||(s._isExternal=!0,r.gridstackNode=s),o=o||r;let a=s.w||Math.round(o.offsetWidth/e)||1,l=s.h||Math.round(o.offsetHeight/t)||1;return s.grid&&s.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=s),r.gridstackNode=s=Object.assign(Object.assign({},s),{w:a,h:l,grid:this}),this.engine.cleanupNode(s).nodeBoundFix(s),s._initDD=s._isExternal=s._temporaryRemoved=!0):(s.w=a,s.h=l,s._temporaryRemoved=!0),c(s.el,!1),u.on(r,"drag",n),n(i,r,o),!1})).on(this.el,"dropout",((t,e,n)=>{let i=e.gridstackNode;return!!i&&(i.grid&&i.grid!==this||(this._leave(e,n),this._isTemp&&this.removeAsSubGrid(i)),!1)})).on(this.el,"drop",((t,e,n)=>{var i,r;let s=e.gridstackNode;if((null==s?void 0:s.grid)===this&&!s._isExternal)return!1;let a=!!this.placeholder.parentElement;this.placeholder.remove();let l=e._gridstackNodeOrig;if(delete e._gridstackNodeOrig,a&&(null==l?void 0:l.grid)&&l.grid!==this){let t=l.grid;t.engine.removedNodes.push(l),t._triggerRemoveEvent(),t.parentGridItem&&!t.engine.nodes.length&&t.opts.subGridDynamic&&t.removeAsSubGrid()}if(!s)return!1;if(a&&(this.engine.cleanupNode(s),s.grid=this),u.off(e,"drag"),n!==e?(n.remove(),e.gridstackNode=l,a&&(e=e.cloneNode(!0))):(e.remove(),this._removeDD(e)),!a)return!1;e.gridstackNode=s,s.el=e;let c=null===(r=null===(i=s.subGrid)||void 0===i?void 0:i.el)||void 0===r?void 0:r.gridstack;return o.Utils.copyPos(s,this._readAttr(this.placeholder)),o.Utils.removePositioningStyles(e),this._writeAttr(e,s),this.el.appendChild(e),c&&(c.parentGridItem=s,c.opts.styleInHead||c._updateStyles(!0)),this._updateContainerHeight(),this.engine.addedNodes.push(s),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(Object.assign(Object.assign({},t),{type:"dropped"}),l&&l.grid?l:void 0,s),window.setTimeout((()=>{s.el&&s.el.parentElement?this._prepareDragDropByNode(s):this.engine.removeNode(s),delete s.grid._isTemp})),!1})),this},r.GridStack.prototype._setupRemoveDrop=function(){if(!this.opts.staticGrid&&"string"==typeof this.opts.removable){let t=document.querySelector(this.opts.removable);if(!t)return this;u.isDroppable(t)||u.droppable(t,this.opts.removableOptions).on(t,"dropover",((t,e)=>c(e,!0))).on(t,"dropout",((t,e)=>c(e,!1)))}return this},r.GridStack.setupDragIn=function(t,e){void 0!==(null==e?void 0:e.pause)&&(s.DDManager.pauseDrag=e.pause),"string"==typeof t&&(e=Object.assign(Object.assign({},i.dragInDefaultOptions),e||{}),o.Utils.getElements(t).forEach((t=>{u.isDraggable(t)||u.dragIn(t,e)})))},r.GridStack.prototype._prepareDragDropByNode=function(t){let e=t.el;const n=t.noMove||this.opts.disableDrag,i=t.noResize||this.opts.disableResize;if(this.opts.staticGrid||n&&i)return t._initDD&&(this._removeDD(e),delete t._initDD),e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!t._initDD){let n,i,r=(r,o)=>{this._gsEventHandler[r.type]&&this._gsEventHandler[r.type](r,r.target),n=this.cellWidth(),i=this.getCellHeight(!0),this._onStartMoving(e,r,o,t,n,i)},s=(r,o)=>{this._dragOrResize(e,r,o,t,n,i)},a=n=>{this.placeholder.remove(),delete t._moving,delete t._event,delete t._lastTried;let i=n.target;if(i.gridstackNode&&i.gridstackNode.grid===this){if(t.el=i,t._isAboutToRemove){let r=e.gridstackNode.grid;r._gsEventHandler[n.type]&&r._gsEventHandler[n.type](n,i),this._removeDD(e),r.engine.removedNodes.push(t),r._triggerRemoveEvent(),delete e.gridstackNode,delete t.el,e.remove()}else o.Utils.removePositioningStyles(i),t._temporaryRemoved?(o.Utils.copyPos(t,t._orig),this._writePosAttr(i,t),this.engine.addNode(t)):this._writePosAttr(i,t),this._gsEventHandler[n.type]&&this._gsEventHandler[n.type](n,i);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()}};u.draggable(e,{start:r,stop:a,drag:s}).resizable(e,{start:r,stop:a,resize:s}),t._initDD=!0}return u.draggable(e,n?"disable":"enable").resizable(e,i?"disable":"enable"),this},r.GridStack.prototype._onStartMoving=function(t,e,n,i,r,o){this.engine.cleanNodes().beginUpdate(i),this._writePosAttr(this.placeholder,i),this.el.appendChild(this.placeholder),i.el=this.placeholder,i._lastUiPosition=n.position,i._prevYPix=n.position.top,i._moving="dragstart"===e.type,delete i._lastTried,"dropover"===e.type&&i._temporaryRemoved&&(this.engine.addNode(i),i._moving=!0),this.engine.cacheRects(r,o,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),"resizestart"===e.type&&(u.resizable(t,"option","minWidth",r*(i.minW||1)).resizable(t,"option","minHeight",o*(i.minH||1)),i.maxW&&u.resizable(t,"option","maxWidth",r*i.maxW),i.maxH&&u.resizable(t,"option","maxHeight",o*i.maxH))},r.GridStack.prototype._leave=function(t,e){let n=t.gridstackNode;n&&(u.off(t,"drag"),n._temporaryRemoved||(n._temporaryRemoved=!0,this.engine.removeNode(n),n.el=n._isExternal&&e?e:t,!0===this.opts.removable&&c(t,!0),t._gridstackNodeOrig?(t.gridstackNode=t._gridstackNodeOrig,delete t._gridstackNodeOrig):n._isExternal&&(delete n.el,delete t.gridstackNode,this.engine.restoreInitial())))},r.GridStack.prototype._dragOrResize=function(t,e,n,i,r,s){let a,l=Object.assign({},i._orig),u=this.opts.marginLeft,c=this.opts.marginRight,h=this.opts.marginTop,d=this.opts.marginBottom,f=Math.round(.1*s),g=Math.round(.1*r);if(u=Math.min(u,g),c=Math.min(c,g),h=Math.min(h,f),d=Math.min(d,f),"drag"===e.type){if(i._temporaryRemoved)return;let e=n.position.top-i._prevYPix;i._prevYPix=n.position.top,o.Utils.updateScrollPosition(t,n.position,e);let a=n.position.left+(n.position.left>i._lastUiPosition.left?-c:u),f=n.position.top+(n.position.top>i._lastUiPosition.top?-d:h);l.x=Math.round(a/r),l.y=Math.round(f/s);let g=this._extraDragRow;if(this.engine.collide(i,l)){let t=this.getRow(),e=Math.max(0,l.y+i.h-t);this.opts.maxRow&&t+e>this.opts.maxRow&&(e=Math.max(0,this.opts.maxRow-t)),this._extraDragRow=e}else this._extraDragRow=0;if(this._extraDragRow!==g&&this._updateContainerHeight(),i.x===l.x&&i.y===l.y)return}else if("resize"===e.type){if(l.x<0)return;if(o.Utils.updateScrollResize(e,t,s),l.w=Math.round((n.size.width-u)/r),l.h=Math.round((n.size.height-h)/s),i.w===l.w&&i.h===l.h)return;if(i._lastTried&&i._lastTried.w===l.w&&i._lastTried.h===l.h)return;let c=n.position.left+u,d=n.position.top+h;l.x=Math.round(c/r),l.y=Math.round(d/s),a=!0}i._event=e,i._lastTried=l;let p={x:n.position.left+u,y:n.position.top+h,w:(n.size?n.size.width:i.w*r)-u-c,h:(n.size?n.size.height:i.h*s)-h-d};if(this.engine.moveNodeCheck(i,Object.assign(Object.assign({},l),{cellWidth:r,cellHeight:s,rect:p,resizing:a}))){i._lastUiPosition=n.position,this.engine.cacheRects(r,s,h,c,d,u),delete i._skipDown,a&&i.subGrid&&i.subGrid.onParentResize(),this._extraDragRow=0,this._updateContainerHeight();let t=e.target;this._writePosAttr(t,i),this._gsEventHandler[e.type]&&this._gsEventHandler[e.type](e,t)}},r.GridStack.prototype.movable=function(t,e){return this.opts.staticGrid||r.GridStack.getElements(t).forEach((t=>{let n=t.gridstackNode;n&&(e?delete n.noMove:n.noMove=!0,this._prepareDragDropByNode(n))})),this},r.GridStack.prototype.resizable=function(t,e){return this.opts.staticGrid||r.GridStack.getElements(t).forEach((t=>{let n=t.gridstackNode;n&&(e?delete n.noResize:n.noResize=!0,this._prepareDragDropByNode(n))})),this},r.GridStack.prototype.disable=function(){if(!this.opts.staticGrid)return this.enableMove(!1),this.enableResize(!1),this._triggerEvent("disable"),this},r.GridStack.prototype.enable=function(){if(!this.opts.staticGrid)return this.enableMove(!0),this.enableResize(!0),this._triggerEvent("enable"),this},r.GridStack.prototype.enableMove=function(t){return this.opts.staticGrid||(this.opts.disableDrag=!t,this.engine.nodes.forEach((e=>this.movable(e.el,t)))),this},r.GridStack.prototype.enableResize=function(t){return this.opts.staticGrid||(this.opts.disableResize=!t,this.engine.nodes.forEach((e=>this.resizable(e.el,t)))),this},r.GridStack.prototype._removeDD=function(t){return u.draggable(t,"destroy").resizable(t,"destroy"),t.gridstackNode&&delete t.gridstackNode._initDD,delete t.ddElement,this}},427:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDManager=void 0,e.DDManager=class{}},952:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDResizableHandle=void 0;const i=n(168);class r{constructor(t,e,n){this.moving=!1,this.host=t,this.dir=e,this.option=n,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._init()}_init(){const t=document.createElement("div");return t.classList.add("ui-resizable-handle"),t.classList.add(`${r.prefix}${this.dir}`),t.style.zIndex="100",t.style.userSelect="none",this.el=t,this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),i.isTouch&&(this.el.addEventListener("touchstart",i.touchstart),this.el.addEventListener("pointerdown",i.pointerdown)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),i.isTouch&&(this.el.removeEventListener("touchstart",i.touchstart),this.el.removeEventListener("pointerdown",i.pointerdown)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(t){this.mouseDownEvent=t,document.addEventListener("mousemove",this._mouseMove,!0),document.addEventListener("mouseup",this._mouseUp,!0),i.isTouch&&(this.el.addEventListener("touchmove",i.touchmove),this.el.addEventListener("touchend",i.touchend)),t.stopPropagation(),t.preventDefault()}_mouseMove(t){let e=this.mouseDownEvent;this.moving?this._triggerEvent("move",t):Math.abs(t.x-e.x)+Math.abs(t.y-e.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",t)),t.stopPropagation(),t.preventDefault()}_mouseUp(t){this.moving&&this._triggerEvent("stop",t),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),i.isTouch&&(this.el.removeEventListener("touchmove",i.touchmove),this.el.removeEventListener("touchend",i.touchend)),delete this.moving,delete this.mouseDownEvent,t.stopPropagation(),t.preventDefault()}_triggerEvent(t,e){return this.option[t]&&this.option[t](e),this}}e.DDResizableHandle=r,r.prefix="ui-resizable-"},945:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DDResizable=void 0;const i=n(952),r=n(249),o=n(284),s=n(427);class a extends r.DDBaseImplement{constructor(t,e={}){super(),this._ui=()=>{const t=this.el.parentElement.getBoundingClientRect(),e={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},n=this.temporalRect||e;return{position:{left:n.left-t.left,top:n.top-t.top},size:{width:n.width,height:n.height}}},this.el=t,this.option=e,this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){super.enable(),this.el.classList.add("ui-resizable"),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this.el.classList.remove("ui-resizable"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),this.el.classList.remove("ui-resizable"),delete this.el,super.destroy()}updateOption(t){let e=t.handles&&t.handles!==this.option.handles,n=t.autoHide&&t.autoHide!==this.option.autoHide;return Object.keys(t).forEach((e=>this.option[e]=t[e])),e&&(this._removeHandlers(),this._setupHandlers()),n&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(t){return t?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),s.DDManager.overResizeElement===this&&delete s.DDManager.overResizeElement),this}_mouseOver(t){s.DDManager.overResizeElement||s.DDManager.dragElement||(s.DDManager.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(t){s.DDManager.overResizeElement===this&&(delete s.DDManager.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){let t=this.option.handles||"e,s,se";return"all"===t&&(t="n,e,s,w,se,sw,ne,nw"),this.handlers=t.split(",").map((t=>t.trim())).map((t=>new i.DDResizableHandle(this.el,t,{start:t=>{this._resizeStart(t)},stop:t=>{this._resizeStop(t)},move:e=>{this._resizing(e,t)}}))),this}_resizeStart(t){this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=o.Utils.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=t,this._setupHelper(),this._applyChange();const e=o.Utils.initEvent(t,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(e,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",e),this}_resizing(t,e){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(t,e),this._applyChange();const n=o.Utils.initEvent(t,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(n,this._ui()),this.triggerEvent("resize",n),this}_resizeStop(t){const e=o.Utils.initEvent(t,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(e),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",e),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){return this.elOriginStyleVal=a._originStyleProp.map((t=>this.el.style[t])),this.parentOriginStylePosition=this.el.parentElement.style.position,window.getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return a._originStyleProp.forEach(((t,e)=>{this.el.style[t]=this.elOriginStyleVal[e]||null})),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(t,e){const n=this.startEvent,i={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=t.clientX-n.clientX,o=t.clientY-n.clientY;e.indexOf("e")>-1?i.width+=r:e.indexOf("w")>-1&&(i.width-=r,i.left+=r),e.indexOf("s")>-1?i.height+=o:e.indexOf("n")>-1&&(i.height-=o,i.top+=o);const s=this._constrainSize(i.width,i.height);return Math.round(i.width)!==Math.round(s.width)&&(e.indexOf("w")>-1&&(i.left+=i.width-s.width),i.width=s.width),Math.round(i.height)!==Math.round(s.height)&&(e.indexOf("n")>-1&&(i.top+=i.height-s.height),i.height=s.height),i}_constrainSize(t,e){const n=this.option.maxWidth||Number.MAX_SAFE_INTEGER,i=this.option.minWidth||t,r=this.option.maxHeight||Number.MAX_SAFE_INTEGER,o=this.option.minHeight||e;return{width:Math.min(n,Math.max(i,t)),height:Math.min(r,Math.max(o,e))}}_applyChange(){let t={left:0,top:0,width:0,height:0};if("absolute"===this.el.style.position){const e=this.el.parentElement,{left:n,top:i}=e.getBoundingClientRect();t={left:n,top:i,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach((e=>{const n=this.temporalRect[e];this.el.style[e]=n-t[e]+"px"})),this):this}_removeHandlers(){return this.handlers.forEach((t=>t.destroy())),delete this.handlers,this}}e.DDResizable=a,a._originStyleProp=["width","height","position","left","top","opacity","zIndex"]},168:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.pointerleave=e.pointerenter=e.pointerdown=e.touchend=e.touchmove=e.touchstart=e.isTouch=void 0;const i=n(427);e.isTouch="undefined"!=typeof window&&"undefined"!=typeof document&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class r{}function o(t,e){if(t.touches.length>1)return;t.cancelable&&t.preventDefault();const n=t.changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent(e,!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(i)}function s(t,e){t.cancelable&&t.preventDefault();const n=document.createEvent("MouseEvents");n.initMouseEvent(e,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(n)}e.touchstart=function(t){r.touchHandled||(r.touchHandled=!0,o(t,"mousedown"))},e.touchmove=function(t){r.touchHandled&&o(t,"mousemove")},e.touchend=function(t){if(!r.touchHandled)return;r.pointerLeaveTimeout&&(window.clearTimeout(r.pointerLeaveTimeout),delete r.pointerLeaveTimeout);const e=!!i.DDManager.dragElement;o(t,"mouseup"),e||o(t,"click"),r.touchHandled=!1},e.pointerdown=function(t){t.target.releasePointerCapture(t.pointerId)},e.pointerenter=function(t){i.DDManager.dragElement&&s(t,"mouseenter")},e.pointerleave=function(t){i.DDManager.dragElement&&(r.pointerLeaveTimeout=window.setTimeout((()=>{delete r.pointerLeaveTimeout,s(t,"mouseleave")}),10))}},935:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GridStackEngine=void 0;const i=n(284);class r{constructor(t={}){this.addedNodes=[],this.removedNodes=[],this.column=t.column||12,this.maxRow=t.maxRow,this._float=t.float,this.nodes=t.nodes||[],this.onChange=t.onChange}batchUpdate(t=!0){return!!this.batchMode===t||(this.batchMode=t,t?(this._prevFloat=this._float,this._float=!0,this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,this._packNodes()._notify())),this}_useEntireRowArea(t,e){return!this.float&&!this._hasLocked&&(!t._moving||t._skipDown||e.y<=t.y)}_fixCollisions(t,e=t,n,r={}){if(this.sortNodes(-1),!(n=n||this.collide(t,e)))return!1;if(t._moving&&!r.nested&&!this.float&&this.swap(t,n))return!0;let o=e;this._useEntireRowArea(t,e)&&(o={x:0,w:this.column,y:e.y,h:e.h},n=this.collide(t,o,r.skip));let s=!1,a={nested:!0,pack:!1};for(;n=n||this.collide(t,o,r.skip);){let o;if(n.locked||t._moving&&!t._skipDown&&e.y>t.y&&!this.float&&(!this.collide(n,Object.assign(Object.assign({},n),{y:t.y}),t)||!this.collide(n,Object.assign(Object.assign({},n),{y:e.y-n.h}),t))?(t._skipDown=t._skipDown||e.y>t.y,o=this.moveNode(t,Object.assign(Object.assign(Object.assign({},e),{y:n.y+n.h}),a)),n.locked&&o?i.Utils.copyPos(e,t):!n.locked&&o&&r.pack&&(this._packNodes(),e.y=n.y+n.h,i.Utils.copyPos(t,e)),s=s||o):o=this.moveNode(n,Object.assign(Object.assign(Object.assign({},n),{y:e.y+e.h,skip:t}),a)),!o)return s;n=void 0}return s}collide(t,e=t,n){return this.nodes.find((r=>r!==t&&r!==n&&i.Utils.isIntercepted(r,e)))}collideAll(t,e=t,n){return this.nodes.filter((r=>r!==t&&r!==n&&i.Utils.isIntercepted(r,e)))}directionCollideCoverage(t,e,n){if(!e.rect||!t._rect)return;let i,r=t._rect,o=Object.assign({},e.rect);return o.y>r.y?(o.h+=o.y-r.y,o.y=r.y):o.h+=r.y-o.y,o.x>r.x?(o.w+=o.x-r.x,o.x=r.x):o.w+=r.x-o.x,n.forEach((t=>{if(t.locked||!t._rect)return;let e=t._rect,n=Number.MAX_VALUE,s=Number.MAX_VALUE,a=.5;r.y<e.y?n=(o.y+o.h-e.y)/e.h:r.y+r.h>e.y+e.h&&(n=(e.y+e.h-o.y)/e.h),r.x<e.x?s=(o.x+o.w-e.x)/e.w:r.x+r.w>e.x+e.w&&(s=(e.x+e.w-o.x)/e.w);let l=Math.min(s,n);l>a&&(a=l,i=t)})),e.collide=i,i}cacheRects(t,e,n,i,r,o){return this.nodes.forEach((s=>s._rect={y:s.y*e+n,x:s.x*t+o,w:s.w*t-o-i,h:s.h*e-n-r})),this}swap(t,e){if(!e||e.locked||!t||t.locked)return!1;function n(){let n=e.x,i=e.y;return e.x=t.x,e.y=t.y,t.h!=e.h?(t.x=n,t.y=e.y+e.h):t.w!=e.w?(t.x=e.x+e.w,t.y=i):(t.x=n,t.y=i),t._dirty=e._dirty=!0,!0}let r;if(t.w===e.w&&t.h===e.h&&(t.x===e.x||t.y===e.y)&&(r=i.Utils.isTouching(t,e)))return n();if(!1!==r){if(t.w===e.w&&t.x===e.x&&(r||(r=i.Utils.isTouching(t,e)))){if(e.y<t.y){let n=t;t=e,e=n}return n()}if(!1!==r){if(t.h===e.h&&t.y===e.y&&(r||(r=i.Utils.isTouching(t,e)))){if(e.x<t.x){let n=t;t=e,e=n}return n()}return!1}}}isAreaEmpty(t,e,n,i){let r={x:t||0,y:e||0,w:n||1,h:i||1};return!this.collide(r)}compact(){if(0===this.nodes.length)return this;this.batchUpdate().sortNodes();let t=this.nodes;return this.nodes=[],t.forEach((t=>{t.locked||(t.autoPosition=!0),this.addNode(t,!1),t._dirty=!0})),this.batchUpdate(!1)}set float(t){this._float!==t&&(this._float=t||!1,t||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(t){return this.nodes=i.Utils.sort(this.nodes,t,this.column),this}_packNodes(){return this.batchMode||(this.sortNodes(),this.float?this.nodes.forEach((t=>{if(t._updating||void 0===t._orig||t.y===t._orig.y)return;let e=t.y;for(;e>t._orig.y;)--e,this.collide(t,{x:t.x,y:e,w:t.w,h:t.h})||(t._dirty=!0,t.y=e)})):this.nodes.forEach(((t,e)=>{if(!t.locked)for(;t.y>0;){let n=0===e?0:t.y-1;if(0!==e&&this.collide(t,{x:t.x,y:n,w:t.w,h:t.h}))break;t._dirty=t.y!==n,t.y=n}}))),this}prepareNode(t,e){(t=t||{})._id=t._id||r._idSeq++,void 0!==t.x&&void 0!==t.y&&null!==t.x&&null!==t.y||(t.autoPosition=!0);let n={x:0,y:0,w:1,h:1};return i.Utils.defaults(t,n),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,"string"==typeof t.x&&(t.x=Number(t.x)),"string"==typeof t.y&&(t.y=Number(t.y)),"string"==typeof t.w&&(t.w=Number(t.w)),"string"==typeof t.h&&(t.h=Number(t.h)),isNaN(t.x)&&(t.x=n.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=n.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=n.w),isNaN(t.h)&&(t.h=n.h),this.nodeBoundFix(t,e)}nodeBoundFix(t,e){let n=t._orig||i.Utils.copyPos({},t);if(t.maxW&&(t.w=Math.min(t.w,t.maxW)),t.maxH&&(t.h=Math.min(t.h,t.maxH)),t.minW&&t.minW<=this.column&&(t.w=Math.max(t.w,t.minW)),t.minH&&(t.h=Math.max(t.h,t.minH)),(1===this.column||t.x+t.w>this.column)&&this.column<12&&!this._inColumnResize&&!t.autoPosition&&t._id&&-1===this.findCacheLayout(t,12)){let e=Object.assign({},t);e.x=Math.min(11,e.x),e.w=Math.min(12,e.w),this.cacheOneLayout(e,12)}return t.w>this.column?t.w=this.column:t.w<1&&(t.w=1),this.maxRow&&t.h>this.maxRow?t.h=this.maxRow:t.h<1&&(t.h=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.w>this.column&&(e?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(e?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),i.Utils.samePos(t,n)||(t._dirty=!0),t}getDirtyNodes(t){return t?this.nodes.filter((t=>t._dirty&&!i.Utils.samePos(t,t._orig))):this.nodes.filter((t=>t._dirty))}_notify(t){if(this.batchMode||!this.onChange)return this;let e=(t||[]).concat(this.getDirtyNodes());return this.onChange(e),this}cleanNodes(){return this.batchMode||this.nodes.forEach((t=>{delete t._dirty,delete t._lastTried})),this}saveInitial(){return this.nodes.forEach((t=>{t._orig=i.Utils.copyPos({},t),delete t._dirty})),this._hasLocked=this.nodes.some((t=>t.locked)),this}restoreInitial(){return this.nodes.forEach((t=>{i.Utils.samePos(t,t._orig)||(i.Utils.copyPos(t,t._orig),t._dirty=!0)})),this._notify(),this}findEmptyPosition(t){this.sortNodes();let e=!1;for(let n=0;!e;++n){let r=n%this.column,o=Math.floor(n/this.column);if(r+t.w>this.column)continue;let s={x:r,y:o,w:t.w,h:t.h};this.nodes.find((t=>i.Utils.isIntercepted(s,t)))||(t.x=r,t.y=o,e=!0)}return e}addNode(t,e=!1){return this.nodes.find((e=>e._id===t._id))||(delete(t=this._inColumnResize?this.nodeBoundFix(t):this.prepareNode(t))._temporaryRemoved,delete t._removeDOM,t.autoPosition&&this.findEmptyPosition(t)&&delete t.autoPosition,this.nodes.push(t),e&&this.addedNodes.push(t),this._fixCollisions(t),this.batchMode||this._packNodes()._notify(),t)}removeNode(t,e=!0,n=!1){return this.nodes.find((e=>e===t))?(n&&this.removedNodes.push(t),e&&(t._removeDOM=!0),this.nodes=this.nodes.filter((e=>e!==t)),this._packNodes()._notify([t])):this}removeAll(t=!0){return delete this._layouts,0===this.nodes.length?this:(t&&this.nodes.forEach((t=>t._removeDOM=!0)),this.removedNodes=this.nodes,this.nodes=[],this._notify(this.removedNodes))}moveNodeCheck(t,e){if(!this.changedPosConstrain(t,e))return!1;if(e.pack=!0,!this.maxRow)return this.moveNode(t,e);let n,o=new r({column:this.column,float:this.float,nodes:this.nodes.map((e=>e===t?(n=Object.assign({},e),n):Object.assign({},e)))});if(!n)return!1;let s=o.moveNode(n,e)&&o.getRow()<=this.maxRow;if(!s&&!e.resizing&&e.collide){let n=e.collide.el.gridstackNode;if(this.swap(t,n))return this._notify(),!0}return!!s&&(o.nodes.filter((t=>t._dirty)).forEach((t=>{let e=this.nodes.find((e=>e._id===t._id));e&&(i.Utils.copyPos(e,t),e._dirty=!0)})),this._notify(),!0)}willItFit(t){if(delete t._willFitPos,!this.maxRow)return!0;let e=new r({column:this.column,float:this.float,nodes:this.nodes.map((t=>Object.assign({},t)))}),n=Object.assign({},t);return this.cleanupNode(n),delete n.el,delete n._id,delete n.content,delete n.grid,e.addNode(n),e.getRow()<=this.maxRow&&(t._willFitPos=i.Utils.copyPos({},n),!0)}changedPosConstrain(t,e){return e.w=e.w||t.w,e.h=e.h||t.h,t.x!==e.x||t.y!==e.y||(t.maxW&&(e.w=Math.min(e.w,t.maxW)),t.maxH&&(e.h=Math.min(e.h,t.maxH)),t.minW&&(e.w=Math.max(e.w,t.minW)),t.minH&&(e.h=Math.max(e.h,t.minH)),t.w!==e.w||t.h!==e.h)}moveNode(t,e){var n,r;if(!t||!e)return!1;let o;void 0===e.pack&&(o=e.pack=!0),"number"!=typeof e.x&&(e.x=t.x),"number"!=typeof e.y&&(e.y=t.y),"number"!=typeof e.w&&(e.w=t.w),"number"!=typeof e.h&&(e.h=t.h);let s=t.w!==e.w||t.h!==e.h,a=i.Utils.copyPos({},t,!0);if(i.Utils.copyPos(a,e),a=this.nodeBoundFix(a,s),i.Utils.copyPos(e,a),i.Utils.samePos(t,e))return!1;let l=i.Utils.copyPos({},t),u=this.collideAll(t,a,e.skip),c=!0;if(u.length){let s=t._moving&&!e.nested,l=s?this.directionCollideCoverage(t,e,u):u[0];if(s&&l&&(null===(r=null===(n=t.grid)||void 0===n?void 0:n.opts)||void 0===r?void 0:r.subGridDynamic)&&!t.grid._isTemp){let n=i.Utils.areaIntercept(e.rect,l._rect),r=i.Utils.area(e.rect),o=i.Utils.area(l._rect);n/(r<o?r:o)>.8&&(l.grid.makeSubGrid(l.el,void 0,t),l=void 0)}l?c=!this._fixCollisions(t,a,l,e):(c=!1,o&&delete e.pack)}return c&&(t._dirty=!0,i.Utils.copyPos(t,a)),e.pack&&this._packNodes()._notify(),!i.Utils.samePos(t,l)}getRow(){return this.nodes.reduce(((t,e)=>Math.max(t,e.y+e.h)),0)}beginUpdate(t){return t._updating||(t._updating=!0,delete t._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let t=this.nodes.find((t=>t._updating));return t&&(delete t._updating,delete t._skipDown),this}save(t=!0){var e;let n=null===(e=this._layouts)||void 0===e?void 0:e.length,r=n&&this.column!==n-1?this._layouts[n-1]:null,o=[];return this.sortNodes(),this.nodes.forEach((e=>{let n=null==r?void 0:r.find((t=>t._id===e._id)),s=Object.assign({},e);n&&(s.x=n.x,s.y=n.y,s.w=n.w),i.Utils.removeInternalForSave(s,!t),o.push(s)})),o}layoutsNodesChange(t){return!this._layouts||this._inColumnResize||this._layouts.forEach(((e,n)=>{if(!e||n===this.column)return this;if(n<this.column)this._layouts[n]=void 0;else{let i=n/this.column;t.forEach((t=>{if(!t._orig)return;let n=e.find((e=>e._id===t._id));n&&(t.y!==t._orig.y&&(n.y+=t.y-t._orig.y),t.x!==t._orig.x&&(n.x=Math.round(t.x*i)),t.w!==t._orig.w&&(n.w=Math.round(t.w*i)))}))}})),this}updateNodeWidths(t,e,n,r="moveScale"){var o;if(!this.nodes.length||!e||t===e)return this;this.cacheLayout(this.nodes,t),this.batchUpdate();let s=[],a=!1;if(1===e&&(null==n?void 0:n.length)){a=!0;let t=0;n.forEach((e=>{e.x=0,e.w=1,e.y=Math.max(e.y,t),t=e.y+e.h})),s=n,n=[]}else n=i.Utils.sort(this.nodes,-1,t);let l=[];if(e>t){l=this._layouts[e]||[];let i=this._layouts.length-1;!l.length&&t!==i&&(null===(o=this._layouts[i])||void 0===o?void 0:o.length)&&(t=i,this._layouts[i].forEach((t=>{let e=n.find((e=>e._id===t._id));e&&(e.x=t.x,e.y=t.y,e.w=t.w)})))}if(l.forEach((t=>{let e=n.findIndex((e=>e._id===t._id));-1!==e&&(n[e].x=t.x,n[e].y=t.y,n[e].w=t.w,s.push(n[e]),n.splice(e,1))})),n.length)if("function"==typeof r)r(e,t,s,n);else if(!a){let i=e/t,o="move"===r||"moveScale"===r,a="scale"===r||"moveScale"===r;n.forEach((n=>{n.x=1===e?0:o?Math.round(n.x*i):Math.min(n.x,e-1),n.w=1===e||1===t?1:a?Math.round(n.w*i)||1:Math.min(n.w,e),s.push(n)})),n=[]}return a||(s=i.Utils.sort(s,-1,e)),this._inColumnResize=!0,this.nodes=[],s.forEach((t=>{this.addNode(t,!1),delete t._orig})),this.batchUpdate(!1),delete this._inColumnResize,this}cacheLayout(t,e,n=!1){let i=[];return t.forEach(((t,e)=>{t._id=t._id||r._idSeq++,i[e]={x:t.x,y:t.y,w:t.w,_id:t._id}})),this._layouts=n?[]:this._layouts||[],this._layouts[e]=i,this}cacheOneLayout(t,e){t._id=t._id||r._idSeq++;let n={x:t.x,y:t.y,w:t.w,_id:t._id};this._layouts=this._layouts||[],this._layouts[e]=this._layouts[e]||[];let i=this.findCacheLayout(t,e);return-1===i?this._layouts[e].push(n):this._layouts[e][i]=n,this}findCacheLayout(t,e){var n,i,r;return null!==(r=null===(i=null===(n=this._layouts)||void 0===n?void 0:n[e])||void 0===i?void 0:i.findIndex((e=>e._id===t._id)))&&void 0!==r?r:-1}cleanupNode(t){for(let e in t)"_"===e[0]&&"_id"!==e&&delete t[e];return this}}e.GridStackEngine=r,r._idSeq=1},929:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.GridStack=void 0;const o=n(935),s=n(284),a=n(523);r(n(523),e),r(n(284),e),r(n(935),e);class l{constructor(t,e={}){var n,i;this._gsEventHandler={},this._extraDragRow=0,this.el=t,(e=e||{}).row&&(e.minRow=e.maxRow=e.row,delete e.row);let r=s.Utils.toNumber(t.getAttribute("gs-row"));"auto"===e.column&&delete e.column;let h=e;void 0!==h.minWidth&&(e.oneColumnSize=e.oneColumnSize||h.minWidth,delete h.minWidth),void 0!==e.alwaysShowResizeHandle&&(e._alwaysShowResizeHandle=e.alwaysShowResizeHandle);let d=Object.assign(Object.assign({},s.Utils.cloneDeep(a.gridDefaults)),{column:s.Utils.toNumber(t.getAttribute("gs-column"))||a.gridDefaults.column,minRow:r||s.Utils.toNumber(t.getAttribute("gs-min-row"))||a.gridDefaults.minRow,maxRow:r||s.Utils.toNumber(t.getAttribute("gs-max-row"))||a.gridDefaults.maxRow,staticGrid:s.Utils.toBool(t.getAttribute("gs-static"))||a.gridDefaults.staticGrid,draggable:{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||a.gridDefaults.draggable.handle},removableOptions:{accept:e.itemClass?"."+e.itemClass:a.gridDefaults.removableOptions.accept}});t.getAttribute("gs-animate")&&(d.animate=s.Utils.toBool(t.getAttribute("gs-animate"))),this.opts=s.Utils.defaults(e,d),e=null,this._initMargin(),1!==this.opts.column&&!this.opts.disableOneColumnMode&&this._widthOrContainer()<=this.opts.oneColumnSize&&(this._prevColumn=this.getColumn(),this.opts.column=1),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===t.style.direction),this.opts.rtl&&this.el.classList.add("grid-stack-rtl");let f=null===(n=s.Utils.closestUpByClass(this.el,a.gridDefaults.itemClass))||void 0===n?void 0:n.gridstackNode;f&&(f.subGrid=this,this.parentGridItem=f,this.el.classList.add("grid-stack-nested"),f.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight="auto"===this.opts.cellHeight,this._isAutoCellHeight||"initial"===this.opts.cellHeight?this.cellHeight(void 0,!1):("number"==typeof this.opts.cellHeight&&this.opts.cellHeightUnit&&this.opts.cellHeightUnit!==a.gridDefaults.cellHeightUnit&&(this.opts.cellHeight=this.opts.cellHeight+this.opts.cellHeightUnit,delete this.opts.cellHeightUnit),this.cellHeight(this.opts.cellHeight,!1)),"mobile"===this.opts.alwaysShowResizeHandle&&(this.opts.alwaysShowResizeHandle=u.isTouch),this._styleSheetClass="grid-stack-instance-"+o.GridStackEngine._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();let g=this.opts.engineClass||l.engineClass||o.GridStackEngine;if(this.engine=new g({column:this.getColumn(),float:this.opts.float,maxRow:this.opts.maxRow,onChange:t=>{let e=0;this.engine.nodes.forEach((t=>{e=Math.max(e,t.y+t.h)})),t.forEach((t=>{let e=t.el;e&&(t._removeDOM?(e&&e.remove(),delete t._removeDOM):this._writePosAttr(e,t))})),this._updateStyles(!1,e)}}),this.opts.auto){this.batchUpdate();let t=[],e=this.getColumn();1===e&&this._prevColumn&&(e=this._prevColumn),this.getGridItems().forEach((n=>{let i=parseInt(n.getAttribute("gs-x")),r=parseInt(n.getAttribute("gs-y"));t.push({el:n,i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(r)?1e3:r)*e})})),t.sort(((t,e)=>e.i-t.i)).forEach((t=>this._prepareElement(t.el))),this.batchUpdate(!1)}this.setAnimation(this.opts.animate),this._updateStyles(),12!=this.opts.column&&this.el.classList.add("grid-stack-"+this.opts.column),this.opts.dragIn&&l.setupDragIn(this.opts.dragIn,this.opts.dragInOptions),delete this.opts.dragIn,delete this.opts.dragInOptions,this.opts.subGridDynamic&&!c.DDManager.pauseDrag&&(c.DDManager.pauseDrag=!0),void 0!==(null===(i=this.opts.draggable)||void 0===i?void 0:i.pause)&&(c.DDManager.pauseDrag=this.opts.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateWindowResizeEvent()}static init(t={},e=".grid-stack"){let n=l.getGridElement(e);return n?(n.gridstack||(n.gridstack=new l(n,s.Utils.cloneDeep(t))),n.gridstack):("string"==typeof e?console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'):console.error("GridStack.init() no grid element was passed."),null)}static initAll(t={},e=".grid-stack"){let n=[];return l.getGridElements(e).forEach((e=>{e.gridstack||(e.gridstack=new l(e,s.Utils.cloneDeep(t)),delete t.dragIn,delete t.dragInOptions),n.push(e.gridstack)})),0===n.length&&console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'),n}static addGrid(t,e={}){if(!t)return null;let n=t;if(!t.classList.contains("grid-stack")){let i=document.implementation.createHTMLDocument("");i.body.innerHTML=`<div class="grid-stack ${e.class||""}"></div>`,n=i.body.children[0],t.appendChild(n)}let i=l.init(e,n);if(i.opts.children){let t=i.opts.children;delete i.opts.children,i.load(t)}return i}static registerEngine(t){l.engineClass=t}get placeholder(){if(!this._placeholder){let t=document.createElement("div");t.className="placeholder-content",this.opts.placeholderText&&(t.innerHTML=this.opts.placeholderText),this._placeholder=document.createElement("div"),this._placeholder.classList.add(this.opts.placeholderClass,a.gridDefaults.itemClass,this.opts.itemClass),this.placeholder.appendChild(t)}return this._placeholder}addWidget(t,e){let n;if("string"==typeof t){let e=document.implementation.createHTMLDocument("");e.body.innerHTML=t,n=e.body.children[0]}else if(0===arguments.length||1===arguments.length&&(void 0!==(i=t).x||void 0!==i.y||void 0!==i.w||void 0!==i.h||void 0!==i.content)){let i=t&&t.content||"";e=t;let r=document.implementation.createHTMLDocument("");r.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${i}</div></div>`,n=r.body.children[0]}else n=t;var i;let r=this._readAttr(n);e=s.Utils.cloneDeep(e)||{},s.Utils.defaults(e,r);let o=this.engine.prepareNode(e);return this._writeAttr(n,e),this._insertNotAppend?this.el.prepend(n):this.el.appendChild(n),this._prepareElement(n,!0,e),this._updateContainerHeight(),o.subGrid&&this.makeSubGrid(o.el,void 0,void 0,!1),this._prevColumn&&1===this.opts.column&&(this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,n}makeSubGrid(t,e,n,i=!0){var r;let o,a=t.gridstackNode;if(a||(a=this.makeWidget(t).gridstackNode),null===(r=a.subGrid)||void 0===r?void 0:r.el)return a.subGrid;(e=s.Utils.cloneDeep(e||a.subGrid||Object.assign(Object.assign({},this.opts.subGrid),{children:void 0}))).subGrid=s.Utils.cloneDeep(e),a.subGrid=e,"auto"===e.column&&(o=!0,e.column=Math.max(a.w||1,(null==n?void 0:n.w)||1),e.disableOneColumnMode=!0);let u,c,h=a.el.querySelector(".grid-stack-item-content");if(i){this._removeDD(a.el);let t=document.implementation.createHTMLDocument("");t.body.innerHTML='<div class="grid-stack-item"></div>',u=t.body.children[0],u.appendChild(h),c=Object.assign(Object.assign({},a),{x:0,y:0}),s.Utils.removeInternalForSave(c),delete c.subGrid,a.content&&(c.content=a.content,delete a.content),t.body.innerHTML='<div class="grid-stack-item-content"></div>',h=t.body.children[0],a.el.appendChild(h),this._prepareDragDropByNode(a)}if(n){let t=o?e.column:a.w,i=a.h+n.h,r=a.el.style;r.transition="none",this.update(a.el,{w:t,h:i}),setTimeout((()=>r.transition=null))}let d=a.subGrid=l.addGrid(h,e);return(null==n?void 0:n._moving)&&(d._isTemp=!0),o&&(d._autoColumn=!0),i&&d.addWidget(u,c),n&&(n._moving?window.setTimeout((()=>s.Utils.simulateMouseEvent(n._event,"mouseenter",d.el)),0):d.addWidget(a.el,a)),d}removeAsSubGrid(t){var e;let n=null===(e=this.parentGridItem)||void 0===e?void 0:e.grid;n&&(n.batchUpdate(),n.removeWidget(this.parentGridItem.el,!0,!0),this.engine.nodes.forEach((t=>{t.x+=this.parentGridItem.x,t.y+=this.parentGridItem.y,n.addWidget(t.el,t)})),n.batchUpdate(!1),delete this.parentGridItem,t&&window.setTimeout((()=>s.Utils.simulateMouseEvent(t._event,"mouseenter",n.el)),0))}save(t=!0,e=!1){let n=this.engine.save(t);if(n.forEach((e=>{if(t&&e.el&&!e.subGrid){let t=e.el.querySelector(".grid-stack-item-content");e.content=t?t.innerHTML:void 0,e.content||delete e.content}else t||delete e.content,e.subGrid&&(e.subGrid=e.subGrid.save(t,!0));delete e.el})),e){let t=s.Utils.cloneDeep(this.opts);t.marginBottom===t.marginTop&&t.marginRight===t.marginLeft&&t.marginTop===t.marginRight&&(t.margin=t.marginTop,delete t.marginTop,delete t.marginRight,delete t.marginBottom,delete t.marginLeft),t.rtl===("rtl"===this.el.style.direction)&&(t.rtl="auto"),this._isAutoCellHeight&&(t.cellHeight="auto"),this._autoColumn&&(t.column="auto",delete t.disableOneColumnMode);const e=t._alwaysShowResizeHandle;return delete t._alwaysShowResizeHandle,void 0!==e?t.alwaysShowResizeHandle=e:delete t.alwaysShowResizeHandle,s.Utils.removeInternalAndSame(t,a.gridDefaults),t.children=n,t}return n}load(t,e=!0){let n=l.Utils.sort([...t],-1,this._prevColumn||this.getColumn());this._insertNotAppend=!0,this._prevColumn&&this._prevColumn!==this.opts.column&&n.some((t=>t.x+t.w>this.opts.column))&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(n,this._prevColumn,!0));let i=[];return this.batchUpdate(),e&&[...this.engine.nodes].forEach((t=>{n.find((e=>t.id===e.id))||("function"==typeof e?e(this,t,!1):(i.push(t),this.removeWidget(t.el,!0,!1)))})),n.forEach((t=>{let n=t.id||0===t.id?this.engine.nodes.find((e=>e.id===t.id)):void 0;if(n){if(this.update(n.el,t),t.subGrid&&t.subGrid.children){let e=n.el.querySelector(".grid-stack");e&&e.gridstack&&(e.gridstack.load(t.subGrid.children),this._insertNotAppend=!0)}}else e&&(t="function"==typeof e?e(this,t,!0).gridstackNode:this.addWidget(t).gridstackNode)})),this.engine.removedNodes=i,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this._insertNotAppend,this}batchUpdate(t=!0){return this.engine.batchUpdate(t),t||(this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(t=!1){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight&&(!t||!this.opts.cellHeightUnit||"px"===this.opts.cellHeightUnit))return this.opts.cellHeight;let e=this.el.querySelector("."+this.opts.itemClass);if(e){let t=s.Utils.toNumber(e.getAttribute("gs-h"));return Math.round(e.offsetHeight/t)}let n=parseInt(this.el.getAttribute("gs-current-row"));return n?Math.round(this.el.getBoundingClientRect().height/n):this.opts.cellHeight}cellHeight(t,e=!0){if(e&&void 0!==t&&this._isAutoCellHeight!==("auto"===t)&&(this._isAutoCellHeight="auto"===t,this._updateWindowResizeEvent()),"initial"!==t&&"auto"!==t||(t=void 0),void 0===t){let e=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;t=this.cellWidth()+e}let n=s.Utils.parseHeight(t);return this.opts.cellHeightUnit===n.unit&&this.opts.cellHeight===n.h||(this.opts.cellHeightUnit=n.unit,this.opts.cellHeight=n.h,e&&this._updateStyles(!0)),this}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(){return this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}compact(){return this.engine.compact(),this._triggerChangeEvent(),this}column(t,e="moveScale"){if(t<1||this.opts.column===t)return this;let n,i=this.getColumn();return 1===t?this._prevColumn=i:delete this._prevColumn,this.el.classList.remove("grid-stack-"+i),this.el.classList.add("grid-stack-"+t),this.opts.column=this.engine.column=t,1===t&&this.opts.oneColumnModeDomSort&&(n=[],this.getGridItems().forEach((t=>{t.gridstackNode&&n.push(t.gridstackNode)})),n.length||(n=void 0)),this.engine.updateNodeWidths(i,t,n,e),this._isAutoCellHeight&&this.cellHeight(),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter((t=>t.matches("."+this.opts.itemClass)&&!t.matches("."+this.opts.placeholderClass)))}destroy(t=!0){if(this.el)return this._updateWindowResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.classList.remove(this._styleSheetClass)),this._removeStylesheet(),this.el.removeAttribute("gs-current-row"),delete this.parentGridItem,delete this.opts,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(t){return this.opts.float!==t&&(this.opts.float=this.engine.float=t,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(t,e=!1){let n,i=this.el.getBoundingClientRect();n=e?{top:i.top+document.documentElement.scrollTop,left:i.left}:{top:this.el.offsetTop,left:this.el.offsetLeft};let r=t.left-n.left,o=t.top-n.top,s=i.width/this.getColumn(),a=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/s),y:Math.floor(o/a)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(t,e,n,i){return this.engine.isAreaEmpty(t,e,n,i)}makeWidget(t){let e=l.getElement(t);return this._prepareElement(e,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),e}on(t,e){if(-1!==t.indexOf(" "))return t.split(" ").forEach((t=>this.on(t,e))),this;if("change"===t||"added"===t||"removed"===t||"enable"===t||"disable"===t){let n="enable"===t||"disable"===t;this._gsEventHandler[t]=n?t=>e(t):t=>e(t,t.detail),this.el.addEventListener(t,this._gsEventHandler[t])}else"drag"===t||"dragstart"===t||"dragstop"===t||"resizestart"===t||"resize"===t||"resizestop"===t||"dropped"===t?this._gsEventHandler[t]=e:console.log("GridStack.on("+t+') event not supported, but you can still use $(".grid-stack").on(...) while jquery-ui is still used internally.');return this}off(t){return-1!==t.indexOf(" ")?(t.split(" ").forEach((t=>this.off(t))),this):("change"!==t&&"added"!==t&&"removed"!==t&&"enable"!==t&&"disable"!==t||this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}removeWidget(t,e=!0,n=!0){return l.getElements(t).forEach((t=>{if(t.parentElement&&t.parentElement!==this.el)return;let i=t.gridstackNode;i||(i=this.engine.nodes.find((e=>t===e.el))),i&&(delete t.gridstackNode,this._removeDD(t),this.engine.removeNode(i,e,n),e&&t.parentElement&&t.remove())})),n&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this}removeAll(t=!0){return this.engine.nodes.forEach((t=>{delete t.el.gridstackNode,this._removeDD(t.el)})),this.engine.removeAll(t),this._triggerRemoveEvent(),this}setAnimation(t){return t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}setStatic(t,e=!0){return this.opts.staticGrid===t||(this.opts.staticGrid=t,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach((t=>this._prepareDragDropByNode(t))),e&&this._setStaticClass()),this}update(t,e){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update(el, {x, w, content, ...})`. It will be removed soon");let n=arguments,i=1;return e={x:n[i++],y:n[i++],w:n[i++],h:n[i++]},this.update(t,e)}return l.getElements(t).forEach((t=>{if(!t||!t.gridstackNode)return;let n=t.gridstackNode,i=s.Utils.cloneDeep(e);delete i.autoPosition;let r,o=["x","y","w","h"];if(o.some((t=>void 0!==i[t]&&i[t]!==n[t]))&&(r={},o.forEach((t=>{r[t]=void 0!==i[t]?i[t]:n[t],delete i[t]}))),!r&&(i.minW||i.minH||i.maxW||i.maxH)&&(r={}),i.content){let e=t.querySelector(".grid-stack-item-content");e&&e.innerHTML!==i.content&&(e.innerHTML=i.content),delete i.content}let a=!1,l=!1;for(const t in i)"_"!==t[0]&&n[t]!==i[t]&&(n[t]=i[t],a=!0,l=l||!this.opts.staticGrid&&("noResize"===t||"noMove"===t||"locked"===t));r&&(this.engine.cleanNodes().beginUpdate(n).moveNode(n,r),this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()),a&&this._writeAttr(t,n),l&&this._prepareDragDropByNode(n)})),this}margin(t){if(!("string"==typeof t&&t.split(" ").length>1)){let e=s.Utils.parseHeight(t);if(this.opts.marginUnit===e.unit&&this.opts.margin===e.h)return}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(t){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let t=arguments,e=0,n={x:t[e++],y:t[e++],w:t[e++],h:t[e++],autoPosition:t[e++]};return this.willItFit(n)}return this.engine.willItFit(t)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let t=this.engine.getDirtyNodes(!0);return t&&t.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine.saveInitial(),this}_triggerAddEvent(){return this.engine.batchMode||this.engine.addedNodes&&this.engine.addedNodes.length>0&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach((t=>{delete t._dirty})),this._triggerEvent("added",this.engine.addedNodes),this.engine.addedNodes=[]),this}_triggerRemoveEvent(){return this.engine.batchMode||this.engine.removedNodes&&this.engine.removedNodes.length>0&&(this._triggerEvent("removed",this.engine.removedNodes),this.engine.removedNodes=[]),this}_triggerEvent(t,e){let n=e?new CustomEvent(t,{bubbles:!1,detail:e}):new Event(t);return this.el.dispatchEvent(n),this}_removeStylesheet(){return this._styles&&(s.Utils.removeStylesheet(this._styleSheetClass),delete this._styles),this}_updateStyles(t=!1,e){if(t&&this._removeStylesheet(),e||(e=this.getRow()),this._updateContainerHeight(),0===this.opts.cellHeight)return this;let n=this.opts.cellHeight,i=this.opts.cellHeightUnit,r=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let t=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=s.Utils.createStylesheet(this._styleSheetClass,t),!this._styles)return this;this._styles._max=0,s.Utils.addCSSRule(this._styles,r,`min-height: ${n}${i}`);let e=this.opts.marginTop+this.opts.marginUnit,o=this.opts.marginBottom+this.opts.marginUnit,a=this.opts.marginRight+this.opts.marginUnit,l=this.opts.marginLeft+this.opts.marginUnit,u=`${r} > .grid-stack-item-content`,c=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;s.Utils.addCSSRule(this._styles,u,`top: ${e}; right: ${a}; bottom: ${o}; left: ${l};`),s.Utils.addCSSRule(this._styles,c,`top: ${e}; right: ${a}; bottom: ${o}; left: ${l};`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-ne`,`right: ${a}`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-e`,`right: ${a}`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-se`,`right: ${a}; bottom: ${o}`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-nw`,`left: ${l}`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-w`,`left: ${l}`),s.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-sw`,`left: ${l}; bottom: ${o}`)}if((e=e||this._styles._max)>this._styles._max){let t=t=>n*t+i;for(let n=this._styles._max+1;n<=e;n++){let e=t(n);s.Utils.addCSSRule(this._styles,`${r}[gs-y="${n-1}"]`,`top: ${t(n-1)}`),s.Utils.addCSSRule(this._styles,`${r}[gs-h="${n}"]`,`height: ${e}`),s.Utils.addCSSRule(this._styles,`${r}[gs-min-h="${n}"]`,`min-height: ${e}`),s.Utils.addCSSRule(this._styles,`${r}[gs-max-h="${n}"]`,`max-height: ${e}`)}this._styles._max=e}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.getRow()+this._extraDragRow;if(this.el.setAttribute("gs-current-row",String(t)),0===t)return this.el.style.removeProperty("min-height"),this;let e=this.opts.cellHeight,n=this.opts.cellHeightUnit;return e?(this.el.style.minHeight=t*e+n,this):this}_prepareElement(t,e=!1,n){n||(t.classList.add(this.opts.itemClass),n=this._readAttr(t)),t.gridstackNode=n,n.el=t,n.grid=this;let i=Object.assign({},n);return n=this.engine.addNode(n,e),s.Utils.same(n,i)||this._writeAttr(t,n),this._prepareDragDropByNode(n),this}_writePosAttr(t,e){return void 0!==e.x&&null!==e.x&&t.setAttribute("gs-x",String(e.x)),void 0!==e.y&&null!==e.y&&t.setAttribute("gs-y",String(e.y)),e.w&&t.setAttribute("gs-w",String(e.w)),e.h&&t.setAttribute("gs-h",String(e.h)),this}_writeAttr(t,e){if(!e)return this;this._writePosAttr(t,e);let n={autoPosition:"gs-auto-position",minW:"gs-min-w",minH:"gs-min-h",maxW:"gs-max-w",maxH:"gs-max-h",noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",resizeHandles:"gs-resize-handles"};for(const i in n)e[i]?t.setAttribute(n[i],String(e[i])):t.removeAttribute(n[i]);return this}_readAttr(t){let e={};e.x=s.Utils.toNumber(t.getAttribute("gs-x")),e.y=s.Utils.toNumber(t.getAttribute("gs-y")),e.w=s.Utils.toNumber(t.getAttribute("gs-w")),e.h=s.Utils.toNumber(t.getAttribute("gs-h")),e.maxW=s.Utils.toNumber(t.getAttribute("gs-max-w")),e.minW=s.Utils.toNumber(t.getAttribute("gs-min-w")),e.maxH=s.Utils.toNumber(t.getAttribute("gs-max-h")),e.minH=s.Utils.toNumber(t.getAttribute("gs-min-h")),e.autoPosition=s.Utils.toBool(t.getAttribute("gs-auto-position")),e.noResize=s.Utils.toBool(t.getAttribute("gs-no-resize")),e.noMove=s.Utils.toBool(t.getAttribute("gs-no-move")),e.locked=s.Utils.toBool(t.getAttribute("gs-locked")),e.resizeHandles=t.getAttribute("gs-resize-handles"),e.id=t.getAttribute("gs-id");for(const t in e){if(!e.hasOwnProperty(t))return;e[t]||0===e[t]||delete e[t]}return e}_setStaticClass(){let t=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...t),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...t),this.el.removeAttribute("gs-static")),this}onParentResize(){if(!this.el||!this.el.clientWidth)return;let t=!1;if(this._autoColumn&&this.parentGridItem)this.opts.column!==this.parentGridItem.w&&(t=!0,this.column(this.parentGridItem.w,"none"));else{let e=!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.oneColumnSize;1===this.opts.column!==e&&(t=!0,this.opts.animate&&this.setAnimation(!1),this.column(e?1:this._prevColumn),this.opts.animate&&this.setAnimation(!0))}return this._isAutoCellHeight&&(!t&&this.opts.cellHeightThrottle?(this._cellHeightThrottle||(this._cellHeightThrottle=s.Utils.throttle((()=>this.cellHeight()),this.opts.cellHeightThrottle)),this._cellHeightThrottle()):this.cellHeight()),this.engine.nodes.forEach((t=>{t.subGrid&&t.subGrid.onParentResize()})),this}_updateWindowResizeEvent(t=!1){const e=(this._isAutoCellHeight||!this.opts.disableOneColumnMode)&&!this.parentGridItem;return t||!e||this._windowResizeBind?!t&&e||!this._windowResizeBind||(window.removeEventListener("resize",this._windowResizeBind),delete this._windowResizeBind):(this._windowResizeBind=this.onParentResize.bind(this),window.addEventListener("resize",this._windowResizeBind)),this}static getElement(t=".grid-stack-item"){return s.Utils.getElement(t)}static getElements(t=".grid-stack-item"){return s.Utils.getElements(t)}static getGridElement(t){return l.getElement(t)}static getGridElements(t){return s.Utils.getElements(t)}_initMargin(){let t,e=0,n=[];return"string"==typeof this.opts.margin&&(n=this.opts.margin.split(" ")),2===n.length?(this.opts.marginTop=this.opts.marginBottom=n[0],this.opts.marginLeft=this.opts.marginRight=n[1]):4===n.length?(this.opts.marginTop=n[0],this.opts.marginRight=n[1],this.opts.marginBottom=n[2],this.opts.marginLeft=n[3]):(t=s.Utils.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,e=this.opts.margin=t.h),void 0===this.opts.marginTop?this.opts.marginTop=e:(t=s.Utils.parseHeight(this.opts.marginTop),this.opts.marginTop=t.h,delete this.opts.margin),void 0===this.opts.marginBottom?this.opts.marginBottom=e:(t=s.Utils.parseHeight(this.opts.marginBottom),this.opts.marginBottom=t.h,delete this.opts.margin),void 0===this.opts.marginRight?this.opts.marginRight=e:(t=s.Utils.parseHeight(this.opts.marginRight),this.opts.marginRight=t.h,delete this.opts.margin),void 0===this.opts.marginLeft?this.opts.marginLeft=e:(t=s.Utils.parseHeight(this.opts.marginLeft),this.opts.marginLeft=t.h,delete this.opts.margin),this.opts.marginUnit=t.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}static setupDragIn(t,e){}movable(t,e){return this}resizable(t,e){return this}disable(){return this}enable(){return this}enableMove(t){return this}enableResize(t){return this}_removeDD(t){return this}_setupAcceptWidget(){return this}_setupRemoveDrop(){return this}_prepareDragDropByNode(t){return this}_onStartMoving(t,e,n,i,r,o){}_dragOrResize(t,e,n,i,r,o){}_leave(t,e){}commit(){return s.obsolete(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}e.GridStack=l,l.Utils=s.Utils,l.Engine=o.GridStackEngine,l.GDRev="7.1.1";const u=n(168),c=n(427);r(n(470),e)},523:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dragInDefaultOptions=e.gridDefaults=void 0,e.gridDefaults={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body"},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,oneColumnSize:768,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:".grid-stack-item"},resizable:{handles:"se"},rtl:"auto"},e.dragInDefaultOptions={handle:".grid-stack-item-content",appendTo:"body"}},284:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Utils=e.obsoleteAttr=e.obsoleteOptsDel=e.obsoleteOpts=e.obsolete=void 0,e.obsolete=function(t,e,n,i,r){let o=(...o)=>(console.warn("gridstack.js: Function `"+n+"` is deprecated in "+r+" and has been replaced with `"+i+"`. It will be **removed** in a future release"),e.apply(t,o));return o.prototype=e.prototype,o},e.obsoleteOpts=function(t,e,n,i){void 0!==t[e]&&(t[n]=t[e],console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+" and has been replaced with `"+n+"`. It will be **removed** in a future release"))},e.obsoleteOptsDel=function(t,e,n,i){void 0!==t[e]&&console.warn("gridstack.js: Option `"+e+"` is deprecated in "+n+i)},e.obsoleteAttr=function(t,e,n,i){let r=t.getAttribute(e);null!==r&&(t.setAttribute(n,r),console.warn("gridstack.js: attribute `"+e+"`="+r+" is deprecated on this object in "+i+" and has been replaced with `"+n+"`. It will be **removed** in a future release"))};class n{static getElements(t){if("string"==typeof t){let e=document.querySelectorAll(t);return e.length||"."===t[0]||"#"===t[0]||(e=document.querySelectorAll("."+t),e.length||(e=document.querySelectorAll("#"+t))),Array.from(e)}return[t]}static getElement(t){if("string"==typeof t){if(!t.length)return null;if("#"===t[0])return document.getElementById(t.substring(1));if("."===t[0]||"["===t[0])return document.querySelector(t);if(!isNaN(+t[0]))return document.getElementById(t);let e=document.querySelector(t);return e||(e=document.getElementById(t)),e||(e=document.querySelector("."+t)),e}return t}static isIntercepted(t,e){return!(t.y>=e.y+e.h||t.y+t.h<=e.y||t.x+t.w<=e.x||t.x>=e.x+e.w)}static isTouching(t,e){return n.isIntercepted(t,{x:e.x-.5,y:e.y-.5,w:e.w+1,h:e.h+1})}static areaIntercept(t,e){let n=t.x>e.x?t.x:e.x,i=t.x+t.w<e.x+e.w?t.x+t.w:e.x+e.w;if(i<=n)return 0;let r=t.y>e.y?t.y:e.y,o=t.y+t.h<e.y+e.h?t.y+t.h:e.y+e.h;return o<=r?0:(i-n)*(o-r)}static area(t){return t.w*t.h}static sort(t,e,n){return n=n||t.reduce(((t,e)=>Math.max(e.x+e.w,t)),0)||12,-1===e?t.sort(((t,e)=>e.x+e.y*n-(t.x+t.y*n))):t.sort(((t,e)=>t.x+t.y*n-(e.x+e.y*n)))}static createStylesheet(t,e){let n=document.createElement("style");return n.setAttribute("type","text/css"),n.setAttribute("gs-style-id",t),n.styleSheet?n.styleSheet.cssText="":n.appendChild(document.createTextNode("")),e?e.insertBefore(n,e.firstChild):(e=document.getElementsByTagName("head")[0]).appendChild(n),n.sheet}static removeStylesheet(t){let e=document.querySelector("STYLE[gs-style-id="+t+"]");e&&e.parentNode&&e.remove()}static addCSSRule(t,e,n){"function"==typeof t.addRule?t.addRule(e,n):"function"==typeof t.insertRule&&t.insertRule(`${e}{${n}}`)}static toBool(t){return"boolean"==typeof t?t:"string"==typeof t?!(""===(t=t.toLowerCase())||"no"===t||"false"===t||"0"===t):Boolean(t)}static toNumber(t){return null===t||0===t.length?void 0:Number(t)}static parseHeight(t){let e,n="px";if("string"==typeof t){let i=t.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!i)throw new Error("Invalid height");n=i[2]||"px",e=parseFloat(i[1])}else e=t;return{h:e,unit:n}}static defaults(t,...e){return e.forEach((e=>{for(const n in e){if(!e.hasOwnProperty(n))return;null===t[n]||void 0===t[n]?t[n]=e[n]:"object"==typeof e[n]&&"object"==typeof t[n]&&this.defaults(t[n],e[n])}})),t}static same(t,e){if("object"!=typeof t)return t==e;if(typeof t!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}static copyPos(t,e,n=!1){return t.x=e.x,t.y=e.y,t.w=e.w,t.h=e.h,n&&(e.minW&&(t.minW=e.minW),e.minH&&(t.minH=e.minH),e.maxW&&(t.maxW=e.maxW),e.maxH&&(t.maxH=e.maxH)),t}static samePos(t,e){return t&&e&&t.x===e.x&&t.y===e.y&&t.w===e.w&&t.h===e.h}static removeInternalAndSame(t,e){if("object"==typeof t&&"object"==typeof e)for(let n in t){let i=t[n];if("_"===n[0]||i===e[n])delete t[n];else if(i&&"object"==typeof i&&void 0!==e[n]){for(let t in i)i[t]!==e[n][t]&&"_"!==t[0]||delete i[t];Object.keys(i).length||delete t[n]}}}static removeInternalForSave(t,e=!0){for(let e in t)"_"!==e[0]&&null!==t[e]&&void 0!==t[e]||delete t[e];delete t.grid,e&&delete t.el,t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,t.locked||delete t.locked,1!==t.w&&t.w!==t.minW||delete t.w,1!==t.h&&t.h!==t.minH||delete t.h}static closestUpByClass(t,e){for(;t;){if(t.classList.contains(e))return t;t=t.parentElement}return null}static throttle(t,e){let n=!1;return(...i)=>{n||(n=!0,setTimeout((()=>{t(...i),n=!1}),e))}}static removePositioningStyles(t){let e=t.style;e.position&&e.removeProperty("position"),e.left&&e.removeProperty("left"),e.top&&e.removeProperty("top"),e.width&&e.removeProperty("width"),e.height&&e.removeProperty("height")}static getScrollElement(t){if(!t)return document.scrollingElement||document.documentElement;const e=getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowY)?t:this.getScrollElement(t.parentElement)}static updateScrollPosition(t,e,n){let i=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight;if(i.top<0||i.bottom>r){let o=i.bottom-r,s=i.top,a=this.getScrollElement(t);if(null!==a){let l=a.scrollTop;i.top<0&&n<0?t.offsetHeight>r?a.scrollTop+=n:a.scrollTop+=Math.abs(s)>Math.abs(n)?n:s:n>0&&(t.offsetHeight>r?a.scrollTop+=n:a.scrollTop+=o>n?n:o),e.top+=a.scrollTop-l}}}static updateScrollResize(t,e,n){const i=this.getScrollElement(e),r=i.clientHeight,o=i===this.getScrollElement()?0:i.getBoundingClientRect().top,s=t.clientY-o,a=s>r-n;s<n?i.scrollBy({behavior:"smooth",top:s-n}):a&&i.scrollBy({behavior:"smooth",top:n-(r-s)})}static clone(t){return null==t||"object"!=typeof t?t:t instanceof Array?[...t]:Object.assign({},t)}static cloneDeep(t){const e=["parentGrid","el","grid","subGrid","engine"],i=n.clone(t);for(const r in i)i.hasOwnProperty(r)&&"object"==typeof i[r]&&"__"!==r.substring(0,2)&&!e.find((t=>t===r))&&(i[r]=n.cloneDeep(t[r]));return i}static cloneNode(t){const e=t.cloneNode(!0);return e.removeAttribute("id"),e}static appendTo(t,e){let n;n="string"==typeof e?document.querySelector(e):e,n&&n.appendChild(t)}static addElStyles(t,e){if(e instanceof Object)for(const n in e)e.hasOwnProperty(n)&&(Array.isArray(e[n])?e[n].forEach((e=>{t.style[n]=e})):t.style[n]=e[n])}static initEvent(t,e){const n={type:e.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:e.target?e.target:t.target};return t.dataTransfer&&(n.dataTransfer=t.dataTransfer),["altKey","ctrlKey","metaKey","shiftKey"].forEach((e=>n[e]=t[e])),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach((e=>n[e]=t[e])),Object.assign(Object.assign({},n),i)}static simulateMouseEvent(t,e,n){const i=document.createEvent("MouseEvents");i.initMouseEvent(e,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,0,t.target),(n||t.target).dispatchEvent(i)}}e.Utils=n},379:t=>{var e=[];function n(t){for(var n=-1,i=0;i<e.length;i++)if(e[i].identifier===t){n=i;break}return n}function i(t,i){for(var o={},s=[],a=0;a<t.length;a++){var l=t[a],u=i.base?l[0]+i.base:l[0],c=o[u]||0,h="".concat(u," ").concat(c);o[u]=c+1;var d=n(h),f={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var g=r(f,i);i.byIndex=a,e.splice(a,0,{identifier:h,updater:g,references:1})}s.push(h)}return s}function r(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,r){var o=i(t=t||[],r=r||{});return function(t){t=t||[];for(var s=0;s<o.length;s++){var a=n(o[s]);e[a].references--}for(var l=i(t,r),u=0;u<o.length;u++){var c=n(o[u]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}o=l}}},569:t=>{var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},216:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},795:t=>{t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},810:t=>{t.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMS42MjYgNTExLjYyNyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTExLjYyNiA1MTEuNjI3OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggZD0iTTMyOC45MDYsNDAxLjk5NGgtMzYuNTUzVjEwOS42MzZoMzYuNTUzYzQuOTQ4LDAsOS4yMzYtMS44MDksMTIuODQ3LTUuNDI2YzMuNjEzLTMuNjE1LDUuNDIxLTcuODk4LDUuNDIxLTEyLjg0NSAgIGMwLTQuOTQ5LTEuODAxLTkuMjMxLTUuNDI4LTEyLjg1MWwtNzMuMDg3LTczLjA5QzI2NS4wNDQsMS44MDksMjYwLjc2LDAsMjU1LjgxMywwYy00Ljk0OCwwLTkuMjI5LDEuODA5LTEyLjg0Nyw1LjQyNCAgIGwtNzMuMDg4LDczLjA5Yy0zLjYxOCwzLjYxOS01LjQyNCw3LjkwMi01LjQyNCwxMi44NTFjMCw0Ljk0NiwxLjgwNyw5LjIyOSw1LjQyNCwxMi44NDVjMy42MTksMy42MTcsNy45MDEsNS40MjYsMTIuODUsNS40MjYgICBoMzYuNTQ1djI5Mi4zNThoLTM2LjU0MmMtNC45NTIsMC05LjIzNSwxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MjEtNS40MjQsNy45MDUtNS40MjQsMTIuODU0ICAgYzAsNC45NDUsMS44MDcsOS4yMjcsNS40MjQsMTIuODQ3bDczLjA4OSw3My4wODhjMy42MTcsMy42MTcsNy44OTgsNS40MjQsMTIuODQ3LDUuNDI0YzQuOTUsMCw5LjIzNC0xLjgwNywxMi44NDktNS40MjQgICBsNzMuMDg3LTczLjA4OGMzLjYxMy0zLjYyLDUuNDIxLTcuOTAxLDUuNDIxLTEyLjg0N2MwLTQuOTQ4LTEuODA4LTkuMjMyLTUuNDIxLTEyLjg1NCAgIEMzMzguMTQyLDQwMy44MDIsMzMzLjg1Nyw0MDEuOTk0LDMyOC45MDYsNDAxLjk5NHoiIGZpbGw9IiM2NjY2NjYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K"}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={id:i,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.b=document.baseURI||self.location.href,n.nc=void 0;var i={};return(()=>{n.r(i),n.d(i,{AreaChartWidget:()=>ol,BarChartWidget:()=>Ya,BaseChartWidget:()=>Sa,GroupedBarChart:()=>kl,LineChartWidget:()=>za,PieChartWidget:()=>Qa,StackedBarChartWidget:()=>yl,getResult:()=>k,initGrid:()=>T});var t=n(379),e=n.n(t),r=n(795),o=n.n(r),s=n(569),a=n.n(s),l=n(565),u=n.n(l),c=n(216),h=n.n(c),d=n(589),f=n.n(d),g=n(466),p={};p.styleTagTransform=f(),p.setAttributes=u(),p.insert=a().bind(null,"head"),p.domAPI=o(),p.insertStyleElement=h(),e()(g.Z,p),g.Z&&g.Z.locals&&g.Z.locals;var m=n(744),y={};y.styleTagTransform=f(),y.setAttributes=u(),y.insert=a().bind(null,"head"),y.domAPI=o(),y.insertStyleElement=h(),e()(m.Z,y),m.Z&&m.Z.locals&&m.Z.locals;var v=n(929);function b(t){return b="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},b(t)}function w(){w=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,s=Object.create(o.prototype),a=new S(r||[]);return i(s,"_invoke",{value:M(t,n,a)}),s}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function d(){}function f(){}function g(){}var p={};l(p,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(A([])));y&&y!==e&&n.call(y,o)&&(p=y);var v=g.prototype=d.prototype=Object.create(p);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,s,a){var l=c(t[i],t,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==b(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,a)}))}a(l.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function M(t,e,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return{value:void 0,done:!0}}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=k(s,n);if(a){if(a===h)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=c(t,e,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function k(t,e){var n=e.method,i=t.iterator[n];if(void 0===i)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var r=c(i,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,r=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:C}}function C(){return{value:void 0,done:!0}}return f.prototype=g,i(v,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:f,configurable:!0}),f.displayName=l(g,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,a,"GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},_(x.prototype),l(x.prototype,s,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var s=new x(u(e,n,i,r),o);return t.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(v),l(v,a,"Generator"),l(v,o,(function(){return this})),l(v,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},t.values=A,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(n,i){return s.type="throw",s.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),D(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;D(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:A(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function x(t,e,n,i,r,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function M(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function s(t){x(o,i,r,s,a,"next",t)}function a(t){x(o,i,r,s,a,"throw",t)}s(void 0)}))}}function k(t,e){return E.apply(this,arguments)}function E(){return(E=M(w().mark((function t(e,n){var i,r;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(n,{headers:{Authorization:"Basic ".concat(e)}});case 2:return i=t.sent,t.next=5,i.json();case 5:if(r=t.sent,200===i.status){t.next=8;break}throw Error(r.message);case 8:return t.abrupt("return",r);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function D(t,e){var n,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return _(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.subGrid)D(r.subGrid.engine.nodes,e);else{var o=e[r.widgetId];if(o)S(r,o);else if(r.el.getAttribute("widgetId")){var s=r.el.getAttribute("widgetId");S(r,e[s])}else console.error("Couldn't find widget by id ".concat(r.widgetId))}}}catch(t){i.e(t)}finally{i.f()}}function S(t,e){var n=t.el.querySelector(".grid-stack-item-content"),i=n.offsetWidth,r=n.offsetHeight;n.innerHTML=e.plot(i,r)}function A(t,e){var n=t.plot(400,400),i=document.createElement("div");return i.innerHTML='<div class="newWidget grid-stack-item" widgetId="'.concat(e,'"><div class="grid-stack-item-content">').concat(n,"</div></div>"),i}function C(t){var e=t.srcElement.closest(".newWidget").cloneNode(!0);return e.style.removeProperty("newWidget"),e}function T(t,e){var n=t,i=v.GridStack.init({cellHeight:70,acceptWidgets:!0,removable:".dropzone-remove",minRow:2,subGrid:{disableOneColumnMode:!0,minRow:2,cellHeight:70,margin:5,acceptWidgets:!0,locked:!0,noResize:!0,noMove:!0,removable:".dropzone-remove"},subGridDynamic:!0});function r(){i.enableResize(!0),i.enableMove(!0),i.engine.nodes.map((function(t){t.subGrid&&(t.subGrid.enableResize(!0),t.subGrid.enableMove(!0))}))}function o(){i.enableResize(!1),i.enableMove(!1),i.engine.nodes.map((function(t){t.subGrid&&(t.subGrid.enableResize(!1),t.subGrid.enableMove(!1))}))}return i.load(e),i.setAnimation(!1),function(t){window.addEventListener("resize",(function(e){D(t.engine.nodes,n)}),!0)}(i),D(i.engine.nodes,n),o(),i.engine.nodes.map((function(t){t.subGrid&&t.subGrid.on("resizestop",(function(t,e){D(i.engine.nodes,n)}))})),i.on("removed change",(function(t,e){D(i.engine.nodes,n)})),i.on("added",(function(t,e){D(i.engine.nodes,n)})),{grid:i,toggleSidebar:function(){var t=document.getElementById("sidebar");"sidebar"===t.className?(o(),t.className="sidebar-hidden",function(t){for(;t.firstChild;)t.removeChild(t.firstChild)}(document.getElementById("available-widgets")),D(i.engine.nodes,n)):(t.className="sidebar",function(t){for(var e=document.getElementById("available-widgets"),n=0,i=Object.keys(t);n<i.length;n++){var r=i[n],o=A(t[r],r);e.appendChild(o,r)}}(n),v.GridStack.setupDragIn(".newWidget",{revert:"invalid",scroll:!1,appendTo:"body",helper:C}),r(),D(i.engine.nodes,n))},save:function(){return i.save().map((function(t){return t.subGrid?{x:t.x,y:t.y,w:t.w,h:t.h,subGrid:{x:t.subGrid.x,y:t.subGrid.y,w:t.subGrid.w,h:t.subGrid.h,children:t.subGrid.children.map((function(t){return{x:t.x,y:t.y,w:t.w,h:t.h,widgetId:t.widgetId}}))}}:{x:t.x,y:t.y,w:t.w,h:t.h,widgetId:t.widgetId}}))},load:function(t){i.removeAll(),i.load(t),D(i.engine.nodes,n),o()},enableWidgetMoveAndResize:r,disableWidgetMoveAndResize:o,refreshWidgets:function(t){n=t,D(i.engine.nodes,n)}}}function O(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(void 0===n?o>=o&&(n=i=o):(n>o&&(n=o),i<o&&(i=o)))}return[n,i]}function N(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function L(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o}function R(t,e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");if("function"!=typeof e)throw new TypeError("mapper is not a function");return Array.from(t,((n,i)=>e(n,i,t)))}class j extends Map{constructor(t,e=I){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(U(this,t))}has(t){return super.has(U(this,t))}set(t,e){return super.set(P(this,t),e)}delete(t){return super.delete(H(this,t))}}class z extends Set{constructor(t,e=I){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(U(this,t))}add(t){return super.add(P(this,t))}delete(t){return super.delete(H(this,t))}}function U({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function P({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function H({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function I(t){return null!==t&&"object"==typeof t?t.valueOf():t}function G(t){return t}var B=1e-6;function Y(t){return"translate("+t+",0)"}function W(t){return"translate(0,"+t+")"}function F(t){return e=>+t(e)}function $(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function q(){return!this.__axis}function X(t,e){var n=[],i=null,r=null,o=6,s=6,a=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,u=1===t||4===t?-1:1,c=4===t||2===t?"x":"y",h=1===t||3===t?Y:W;function d(d){var f=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,g=null==r?e.tickFormat?e.tickFormat.apply(e,n):G:r,p=Math.max(o,0)+a,m=e.range(),y=+m[0]+l,v=+m[m.length-1]+l,b=(e.bandwidth?$:F)(e.copy(),l),w=d.selection?d.selection():d,_=w.selectAll(".domain").data([null]),x=w.selectAll(".tick").data(f,e).order(),M=x.exit(),k=x.enter().append("g").attr("class","tick"),E=x.select("line"),D=x.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(k),E=E.merge(k.append("line").attr("stroke","currentColor").attr(c+"2",u*o)),D=D.merge(k.append("text").attr("fill","currentColor").attr(c,u*p).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),d!==w&&(_=_.transition(d),x=x.transition(d),E=E.transition(d),D=D.transition(d),M=M.transition(d).attr("opacity",B).attr("transform",(function(t){return isFinite(t=b(t))?h(t+l):this.getAttribute("transform")})),k.attr("opacity",B).attr("transform",(function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:b(t))+l)}))),M.remove(),_.attr("d",4===t||2===t?s?"M"+u*s+","+y+"H"+l+"V"+v+"H"+u*s:"M"+l+","+y+"V"+v:s?"M"+y+","+u*s+"V"+l+"H"+v+"V"+u*s:"M"+y+","+l+"H"+v),x.attr("opacity",1).attr("transform",(function(t){return h(b(t)+l)})),E.attr(c+"2",u*o),D.attr(c,u*p).text(g),w.filter(q).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),w.each((function(){this.__axis=b}))}return d.scale=function(t){return arguments.length?(e=t,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),d):n.slice()},d.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),d):i&&i.slice()},d.tickFormat=function(t){return arguments.length?(r=t,d):r},d.tickSize=function(t){return arguments.length?(o=s=+t,d):o},d.tickSizeInner=function(t){return arguments.length?(o=+t,d):o},d.tickSizeOuter=function(t){return arguments.length?(s=+t,d):s},d.tickPadding=function(t){return arguments.length?(a=+t,d):a},d.offset=function(t){return arguments.length?(l=+t,d):l},d}function Z(t){return X(3,t)}function V(t){return X(4,t)}function Q(){}function K(t){return null==t?Q:function(){return this.querySelector(t)}}function J(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function tt(){return[]}function et(t){return null==t?tt:function(){return this.querySelectorAll(t)}}function nt(t){return function(){return this.matches(t)}}function it(t){return function(e){return e.matches(t)}}var rt=Array.prototype.find;function ot(){return this.firstElementChild}var st=Array.prototype.filter;function at(){return Array.from(this.children)}function lt(t){return new Array(t.length)}function ut(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function ct(t){return function(){return t}}function ht(t,e,n,i,r,o){for(var s,a=0,l=e.length,u=o.length;a<u;++a)(s=e[a])?(s.__data__=o[a],i[a]=s):n[a]=new ut(t,o[a]);for(;a<l;++a)(s=e[a])&&(r[a]=s)}function dt(t,e,n,i,r,o,s){var a,l,u,c=new Map,h=e.length,d=o.length,f=new Array(h);for(a=0;a<h;++a)(l=e[a])&&(f[a]=u=s.call(l,l.__data__,a,e)+"",c.has(u)?r[a]=l:c.set(u,l));for(a=0;a<d;++a)u=s.call(t,o[a],a,o)+"",(l=c.get(u))?(i[a]=l,l.__data__=o[a],c.delete(u)):n[a]=new ut(t,o[a]);for(a=0;a<h;++a)(l=e[a])&&c.get(f[a])===l&&(r[a]=l)}function ft(t){return t.__data__}function gt(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function pt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}ut.prototype={constructor:ut,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var mt="http://www.w3.org/1999/xhtml";const yt={svg:"http://www.w3.org/2000/svg",xhtml:mt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vt(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),yt.hasOwnProperty(e)?{space:yt[e],local:t}:t}function bt(t){return function(){this.removeAttribute(t)}}function wt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _t(t,e){return function(){this.setAttribute(t,e)}}function xt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Mt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function kt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Et(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Dt(t){return function(){this.style.removeProperty(t)}}function St(t,e,n){return function(){this.style.setProperty(t,e,n)}}function At(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function Ct(t,e){return t.style.getPropertyValue(e)||Et(t).getComputedStyle(t,null).getPropertyValue(e)}function Tt(t){return function(){delete this[t]}}function Ot(t,e){return function(){this[t]=e}}function Nt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Lt(t){return t.trim().split(/^|\s+/)}function Rt(t){return t.classList||new jt(t)}function jt(t){this._node=t,this._names=Lt(t.getAttribute("class")||"")}function zt(t,e){for(var n=Rt(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function Ut(t,e){for(var n=Rt(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function Pt(t){return function(){zt(this,t)}}function Ht(t){return function(){Ut(this,t)}}function It(t,e){return function(){(e.apply(this,arguments)?zt:Ut)(this,t)}}function Gt(){this.textContent=""}function Bt(t){return function(){this.textContent=t}}function Yt(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Wt(){this.innerHTML=""}function Ft(t){return function(){this.innerHTML=t}}function $t(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function qt(){this.nextSibling&&this.parentNode.appendChild(this)}function Xt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Zt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===mt&&e.documentElement.namespaceURI===mt?e.createElement(t):e.createElementNS(n,t)}}function Vt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Qt(t){var e=vt(t);return(e.local?Vt:Zt)(e)}function Kt(){return null}function Jt(){var t=this.parentNode;t&&t.removeChild(this)}function te(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ee(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ne(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function ie(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,o=e.length;i<o;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function re(t,e,n){return function(){var i,r=this.__on,o=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),void(i.value=e);this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function oe(t,e,n){var i=Et(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function se(t,e){return function(){return oe(this,t,e)}}function ae(t,e){return function(){return oe(this,t,e.apply(this,arguments))}}jt.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var le=[null];function ue(t,e){this._groups=t,this._parents=e}function ce(){return new ue([[document.documentElement]],le)}ue.prototype=ce.prototype={constructor:ue,select:function(t){"function"!=typeof t&&(t=K(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s,a=e[r],l=a.length,u=i[r]=new Array(l),c=0;c<l;++c)(o=a[c])&&(s=t.call(o,o.__data__,c,a))&&("__data__"in o&&(s.__data__=o.__data__),u[c]=s);return new ue(i,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return J(t.apply(this,arguments))}}(t):et(t);for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var s,a=e[o],l=a.length,u=0;u<l;++u)(s=a[u])&&(i.push(t.call(s,s.__data__,u,a)),r.push(s));return new ue(i,r)},selectChild:function(t){return this.select(null==t?ot:function(t){return function(){return rt.call(this.children,t)}}("function"==typeof t?t:it(t)))},selectChildren:function(t){return this.selectAll(null==t?at:function(t){return function(){return st.call(this.children,t)}}("function"==typeof t?t:it(t)))},filter:function(t){"function"!=typeof t&&(t=nt(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],u=0;u<a;++u)(o=s[u])&&t.call(o,o.__data__,u,s)&&l.push(o);return new ue(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,ft);var n=e?dt:ht,i=this._parents,r=this._groups;"function"!=typeof t&&(t=ct(t));for(var o=r.length,s=new Array(o),a=new Array(o),l=new Array(o),u=0;u<o;++u){var c=i[u],h=r[u],d=h.length,f=gt(t.call(c,c&&c.__data__,u,i)),g=f.length,p=a[u]=new Array(g),m=s[u]=new Array(g),y=l[u]=new Array(d);n(c,h,p,m,y,f,e);for(var v,b,w=0,_=0;w<g;++w)if(v=p[w]){for(w>=_&&(_=w+1);!(b=m[_])&&++_<g;);v._next=b||null}}return(s=new ue(s,i))._enter=a,s._exit=l,s},enter:function(){return new ue(this._enter||this._groups.map(lt),this._parents)},exit:function(){return new ue(this._exit||this._groups.map(lt),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,o=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?o.remove():n(o),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,o=i.length,s=Math.min(r,o),a=new Array(r),l=0;l<s;++l)for(var u,c=n[l],h=i[l],d=c.length,f=a[l]=new Array(d),g=0;g<d;++g)(u=c[g]||h[g])&&(f[g]=u);for(;l<r;++l)a[l]=n[l];return new ue(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],o=r.length-1,s=r[o];--o>=0;)(i=r[o])&&(s&&4^i.compareDocumentPosition(s)&&s.parentNode.insertBefore(i,s),s=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=pt);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var s,a=n[o],l=a.length,u=r[o]=new Array(l),c=0;c<l;++c)(s=a[c])&&(u[c]=s);u.sort(e)}return new ue(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var s=i[r];if(s)return s}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,o=e[n],s=0,a=o.length;s<a;++s)(r=o[s])&&t.call(r,r.__data__,s,o);return this},attr:function(t,e){var n=vt(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?wt:bt:"function"==typeof e?n.local?kt:Mt:n.local?xt:_t)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Dt:"function"==typeof e?At:St)(t,e,null==n?"":n)):Ct(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Tt:"function"==typeof e?Nt:Ot)(t,e)):this.node()[t]},classed:function(t,e){var n=Lt(t+"");if(arguments.length<2){for(var i=Rt(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?It:e?Pt:Ht)(n,e))},text:function(t){return arguments.length?this.each(null==t?Gt:("function"==typeof t?Yt:Bt)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Wt:("function"==typeof t?$t:Ft)(t)):this.node().innerHTML},raise:function(){return this.each(qt)},lower:function(){return this.each(Xt)},append:function(t){var e="function"==typeof t?t:Qt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:Qt(t),i=null==e?Kt:"function"==typeof e?e:K(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(Jt)},clone:function(t){return this.select(t?ee:te)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,o=ne(t+""),s=o.length;if(!(arguments.length<2)){for(a=e?re:ie,i=0;i<s;++i)this.each(a(o[i],e,n));return this}var a=this.node().__on;if(a)for(var l,u=0,c=a.length;u<c;++u)for(i=0,l=a[u];i<s;++i)if((r=o[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?ae:se)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],o=0,s=r.length;o<s;++o)(i=r[o])&&(yield i)}};const he=ce;var de={value:()=>{}};function fe(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new ge(i)}function ge(t){this._=t}function pe(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function me(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function ye(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=de,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}ge.prototype=fe.prototype={constructor:ge,on:function(t,e){var n,i=this._,r=pe(t+"",i),o=-1,s=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=r[o]).type)i[n]=ye(i[n],t.name,e);else if(null==e)for(n in i)i[n]=ye(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=r[o]).type)&&(n=me(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ge(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};const ve=fe;var be,we,_e=0,xe=0,Me=0,ke=0,Ee=0,De=0,Se="object"==typeof performance&&performance.now?performance:Date,Ae="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ce(){return Ee||(Ae(Te),Ee=Se.now()+De)}function Te(){Ee=0}function Oe(){this._call=this._time=this._next=null}function Ne(t,e,n){var i=new Oe;return i.restart(t,e,n),i}function Le(){Ee=(ke=Se.now())+De,_e=xe=0;try{!function(){Ce(),++_e;for(var t,e=be;e;)(t=Ee-e._time)>=0&&e._call.call(void 0,t),e=e._next;--_e}()}finally{_e=0,function(){for(var t,e,n=be,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:be=e);we=t,je(i)}(),Ee=0}}function Re(){var t=Se.now(),e=t-ke;e>1e3&&(De-=e,ke=t)}function je(t){_e||(xe&&(xe=clearTimeout(xe)),t-Ee>24?(t<1/0&&(xe=setTimeout(Le,t-Se.now()-De)),Me&&(Me=clearInterval(Me))):(Me||(ke=Se.now(),Me=setInterval(Re,1e3)),_e=1,Ae(Le)))}function ze(t,e,n){var i=new Oe;return e=null==e?0:+e,i.restart((n=>{i.stop(),t(n+e)}),e,n),i}Oe.prototype=Ne.prototype={constructor:Oe,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Ce():+n)+(null==e?0:+e),this._next||we===this||(we?we._next=this:be=this,we=this),this._call=t,this._time=n,je()},stop:function(){this._call&&(this._call=null,this._time=1/0,je())}};var Ue=ve("start","end","cancel","interrupt"),Pe=[];function He(t,e,n,i,r,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function o(l){var u,c,h,d;if(1!==n.state)return a();for(u in r)if((d=r[u]).name===n.name){if(3===d.state)return ze(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[u]):+u<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[u])}if(ze((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(l))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(h=n.tween.length),u=0,c=-1;u<h;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=d);i.length=c+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(a),n.state=5,1),o=-1,s=i.length;++o<s;)i[o].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),a())}function a(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=Ne((function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}),0,n.time)}(t,n,{name:e,index:i,group:r,on:Ue,tween:Pe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function Ie(t,e){var n=Be(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function Ge(t,e){var n=Be(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Be(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ye(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var We,Fe=180/Math.PI,$e={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qe(t,e,n,i,r,o){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(e,t)*Fe,skewX:Math.atan(l)*Fe,scaleX:s,scaleY:a}}function Xe(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(o,s){var a=[],l=[];return o=t(o),s=t(s),function(t,i,r,o,s,a){if(t!==r||i!==o){var l=s.push("translate(",null,e,null,n);a.push({i:l-4,x:Ye(t,r)},{i:l-2,x:Ye(i,o)})}else(r||o)&&s.push("translate("+r+e+o+n)}(o.translateX,o.translateY,s.translateX,s.translateY,a,l),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:Ye(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,s.rotate,a,l),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:Ye(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,s.skewX,a,l),function(t,e,n,i,o,s){if(t!==n||e!==i){var a=o.push(r(o)+"scale(",null,",",null,")");s.push({i:a-4,x:Ye(t,n)},{i:a-2,x:Ye(e,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,l),o=s=null,function(t){for(var e,n=-1,i=l.length;++n<i;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var Ze=Xe((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?$e:qe(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Ve=Xe((function(t){return null==t?$e:(We||(We=document.createElementNS("http://www.w3.org/2000/svg","g")),We.setAttribute("transform",t),(t=We.transform.baseVal.consolidate())?qe((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):$e)}),", ",")",")");function Qe(t,e){var n,i;return function(){var r=Ge(this,t),o=r.tween;if(o!==n)for(var s=0,a=(i=n=o).length;s<a;++s)if(i[s].name===e){(i=i.slice()).splice(s,1);break}r.tween=i}}function Ke(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var o=Ge(this,t),s=o.tween;if(s!==i){r=(i=s).slice();for(var a={name:e,value:n},l=0,u=r.length;l<u;++l)if(r[l].name===e){r[l]=a;break}l===u&&r.push(a)}o.tween=r}}function Je(t,e,n){var i=t._id;return t.each((function(){var t=Ge(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Be(t,i).value[e]}}function tn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function en(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function nn(){}var rn=.7,on=1/rn,sn="\\s*([+-]?\\d+)\\s*",an="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ln="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",un=/^#([0-9a-f]{3,8})$/,cn=new RegExp(`^rgb\\(${sn},${sn},${sn}\\)$`),hn=new RegExp(`^rgb\\(${ln},${ln},${ln}\\)$`),dn=new RegExp(`^rgba\\(${sn},${sn},${sn},${an}\\)$`),fn=new RegExp(`^rgba\\(${ln},${ln},${ln},${an}\\)$`),gn=new RegExp(`^hsl\\(${an},${ln},${ln}\\)$`),pn=new RegExp(`^hsla\\(${an},${ln},${ln},${an}\\)$`),mn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function yn(){return this.rgb().formatHex()}function vn(){return this.rgb().formatRgb()}function bn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=un.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?wn(e):3===n?new kn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?_n(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?_n(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=cn.exec(t))?new kn(e[1],e[2],e[3],1):(e=hn.exec(t))?new kn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=dn.exec(t))?_n(e[1],e[2],e[3],e[4]):(e=fn.exec(t))?_n(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=gn.exec(t))?Tn(e[1],e[2]/100,e[3]/100,1):(e=pn.exec(t))?Tn(e[1],e[2]/100,e[3]/100,e[4]):mn.hasOwnProperty(t)?wn(mn[t]):"transparent"===t?new kn(NaN,NaN,NaN,0):null}function wn(t){return new kn(t>>16&255,t>>8&255,255&t,1)}function _n(t,e,n,i){return i<=0&&(t=e=n=NaN),new kn(t,e,n,i)}function xn(t){return t instanceof nn||(t=bn(t)),t?new kn((t=t.rgb()).r,t.g,t.b,t.opacity):new kn}function Mn(t,e,n,i){return 1===arguments.length?xn(t):new kn(t,e,n,null==i?1:i)}function kn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function En(){return`#${Cn(this.r)}${Cn(this.g)}${Cn(this.b)}`}function Dn(){const t=Sn(this.opacity);return`${1===t?"rgb(":"rgba("}${An(this.r)}, ${An(this.g)}, ${An(this.b)}${1===t?")":`, ${t})`}`}function Sn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function An(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Cn(t){return((t=An(t))<16?"0":"")+t.toString(16)}function Tn(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Nn(t,e,n,i)}function On(t){if(t instanceof Nn)return new Nn(t.h,t.s,t.l,t.opacity);if(t instanceof nn||(t=bn(t)),!t)return new Nn;if(t instanceof Nn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=e===o?(n-i)/a+6*(n<i):n===o?(i-e)/a+2:(e-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new Nn(s,a,l,t.opacity)}function Nn(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Ln(t){return(t=(t||0)%360)<0?t+360:t}function Rn(t){return Math.max(0,Math.min(1,t||0))}function jn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function zn(t,e,n,i,r){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*n+(1+3*t+3*o-3*s)*i+s*r)/6}tn(nn,bn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:yn,formatHex:yn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return On(this).formatHsl()},formatRgb:vn,toString:vn}),tn(kn,Mn,en(nn,{brighter(t){return t=null==t?on:Math.pow(on,t),new kn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?rn:Math.pow(rn,t),new kn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new kn(An(this.r),An(this.g),An(this.b),Sn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:En,formatHex:En,formatHex8:function(){return`#${Cn(this.r)}${Cn(this.g)}${Cn(this.b)}${Cn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Dn,toString:Dn})),tn(Nn,(function(t,e,n,i){return 1===arguments.length?On(t):new Nn(t,e,n,null==i?1:i)}),en(nn,{brighter(t){return t=null==t?on:Math.pow(on,t),new Nn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?rn:Math.pow(rn,t),new Nn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new kn(jn(t>=240?t-240:t+120,r,i),jn(t,r,i),jn(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Nn(Ln(this.h),Rn(this.s),Rn(this.l),Sn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Sn(this.opacity);return`${1===t?"hsl(":"hsla("}${Ln(this.h)}, ${100*Rn(this.s)}%, ${100*Rn(this.l)}%${1===t?")":`, ${t})`}`}}));const Un=t=>()=>t;function Pn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Un(isNaN(t)?e:t)}const Hn=function t(e){var n=function(t){return 1==(t=+t)?Pn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Un(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=Mn(t)).r,(e=Mn(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),s=Pn(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function In(t){return function(e){var n,i,r=e.length,o=new Array(r),s=new Array(r),a=new Array(r);for(n=0;n<r;++n)i=Mn(e[n]),o[n]=i.r||0,s[n]=i.g||0,a[n]=i.b||0;return o=t(o),s=t(s),a=t(a),i.opacity=1,function(t){return i.r=o(t),i.g=s(t),i.b=a(t),i+""}}}In((function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],o=t[i+1],s=i>0?t[i-1]:2*r-o,a=i<e-1?t[i+2]:2*o-r;return zn((n-i/e)*e,s,r,o,a)}})),In((function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],o=t[i%e],s=t[(i+1)%e],a=t[(i+2)%e];return zn((n-i/e)*e,r,o,s,a)}}));var Gn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Bn=new RegExp(Gn.source,"g");function Yn(t,e){var n,i,r,o=Gn.lastIndex=Bn.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=Gn.exec(t))&&(i=Bn.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Ye(n,i)})),o=Bn.lastIndex;return o<e.length&&(r=e.slice(o),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)a[(n=l[i]).i]=n.x(t);return a.join("")})}function Wn(t,e){var n;return("number"==typeof e?Ye:e instanceof bn?Hn:(n=bn(e))?(e=n,Hn):Yn)(t,e)}function Fn(t){return function(){this.removeAttribute(t)}}function $n(t){return function(){this.removeAttributeNS(t.space,t.local)}}function qn(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttribute(t);return s===o?null:s===i?r:r=e(i=s,n)}}function Xn(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===i?r:r=e(i=s,n)}}function Zn(t,e,n){var i,r,o;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttribute(t))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l));this.removeAttribute(t)}}function Vn(t,e,n){var i,r,o;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l));this.removeAttributeNS(t.space,t.local)}}function Qn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Kn(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Jn(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&Kn(t,r)),n}return r._value=e,r}function ti(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&Qn(t,r)),n}return r._value=e,r}function ei(t,e){return function(){Ie(this,t).delay=+e.apply(this,arguments)}}function ni(t,e){return e=+e,function(){Ie(this,t).delay=e}}function ii(t,e){return function(){Ge(this,t).duration=+e.apply(this,arguments)}}function ri(t,e){return e=+e,function(){Ge(this,t).duration=e}}function oi(t,e){if("function"!=typeof e)throw new Error;return function(){Ge(this,t).ease=e}}function si(t,e,n){var i,r,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Ie:Ge;return function(){var s=o(this,t),a=s.on;a!==i&&(r=(i=a).copy()).on(e,n),s.on=r}}var ai=he.prototype.constructor;function li(t){return function(){this.style.removeProperty(t)}}function ui(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function ci(t,e,n){var i,r;function o(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&ui(t,o,n)),i}return o._value=e,o}function hi(t){return function(e){this.textContent=t.call(this,e)}}function di(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&hi(i)),e}return i._value=t,i}var fi=0;function gi(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function pi(){return++fi}var mi=he.prototype;gi.prototype=function(t){return he().transition(t)}.prototype={constructor:gi,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=K(t));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s<r;++s)for(var a,l,u=i[s],c=u.length,h=o[s]=new Array(c),d=0;d<c;++d)(a=u[d])&&(l=t.call(a,a.__data__,d,u))&&("__data__"in a&&(l.__data__=a.__data__),h[d]=l,He(h[d],e,n,d,h,Be(a,n)));return new gi(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=et(t));for(var i=this._groups,r=i.length,o=[],s=[],a=0;a<r;++a)for(var l,u=i[a],c=u.length,h=0;h<c;++h)if(l=u[h]){for(var d,f=t.call(l,l.__data__,h,u),g=Be(l,n),p=0,m=f.length;p<m;++p)(d=f[p])&&He(d,e,n,p,f,g);o.push(f),s.push(l)}return new gi(o,s,e,n)},selectChild:mi.selectChild,selectChildren:mi.selectChildren,filter:function(t){"function"!=typeof t&&(t=nt(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],u=0;u<a;++u)(o=s[u])&&t.call(o,o.__data__,u,s)&&l.push(o);return new gi(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),s=new Array(i),a=0;a<o;++a)for(var l,u=e[a],c=n[a],h=u.length,d=s[a]=new Array(h),f=0;f<h;++f)(l=u[f]||c[f])&&(d[f]=l);for(;a<i;++a)s[a]=e[a];return new gi(s,this._parents,this._name,this._id)},selection:function(){return new ai(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=pi(),i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,u=0;u<l;++u)if(s=a[u]){var c=Be(s,e);He(s,t,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new gi(i,this._parents,t,n)},call:mi.call,nodes:mi.nodes,node:mi.node,size:mi.size,empty:mi.empty,each:mi.each,on:function(t,e){var n=this._id;return arguments.length<2?Be(this.node(),n).on.on(t):this.each(si(n,t,e))},attr:function(t,e){var n=vt(t),i="transform"===n?Ve:Wn;return this.attrTween(t,"function"==typeof e?(n.local?Vn:Zn)(n,i,Je(this,"attr."+t,e)):null==e?(n.local?$n:Fn)(n):(n.local?Xn:qn)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=vt(t);return this.tween(n,(i.local?Jn:ti)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?Ze:Wn;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var o=Ct(this,t),s=(this.style.removeProperty(t),Ct(this,t));return o===s?null:o===n&&s===i?r:r=e(n=o,i=s)}}(t,i)).on("end.style."+t,li(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,o;return function(){var s=Ct(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=Ct(this,t)),s===l?null:s===i&&l===r?o:(r=l,o=e(i=s,a))}}(t,i,Je(this,"style."+t,e))).each(function(t,e){var n,i,r,o,s="style."+e,a="end."+s;return function(){var l=Ge(this,t),u=l.on,c=null==l.value[s]?o||(o=li(e)):void 0;u===n&&r===c||(i=(n=u).copy()).on(a,r=c),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,o=n+"";return function(){var s=Ct(this,t);return s===o?null:s===i?r:r=e(i=s,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,ci(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Je(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,di(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=Be(this.node(),n).tween,o=0,s=r.length;o<s;++o)if((i=r[o]).name===t)return i.value;return null}return this.each((null==e?Qe:Ke)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?ei:ni)(e,t)):Be(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?ii:ri)(e,t)):Be(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(oi(e,t)):Be(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;Ge(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise((function(o,s){var a={value:s},l={value:function(){0==--r&&o()}};n.each((function(){var n=Ge(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e})),0===r&&o()}))},[Symbol.iterator]:mi[Symbol.iterator]};var yi={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function vi(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}he.prototype.interrupt=function(t){return this.each((function(){!function(t,e){var n,i,r,o=t.__transition,s=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[r]):s=!1;s&&delete t.__transition}}(this,t)}))},he.prototype.transition=function(t){var e,n;t instanceof gi?(e=t._id,t=t._name):(e=pi(),(n=yi).time=Ce(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,u=0;u<l;++u)(s=a[u])&&He(s,t,e,u,a,n||vi(s,e));return new gi(i,this._parents,t,e)};const{abs:bi,max:wi,min:_i}=Math;function xi(t){return{type:t}}function Mi(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}["w","e"].map(xi),["n","s"].map(xi),["n","w","e","s","nw","ne","sw","se"].map(xi);const ki=Symbol("implicit");function Ei(){var t=new j,e=[],n=[],i=ki;function r(r){let o=t.get(r);if(void 0===o){if(i!==ki)return i;t.set(r,o=e.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new j;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return Ei(e,n).unknown(i)},Mi.apply(r,arguments),r}function Di(){var t,e,n=Ei().unknown(void 0),i=n.domain,r=n.range,o=0,s=1,a=!1,l=0,u=0,c=.5;function h(){var n=i().length,h=s<o,d=h?s:o,f=h?o:s;t=(f-d)/Math.max(1,n-l+2*u),a&&(t=Math.floor(t)),d+=(f-d-t*(n-l))*c,e=t*(1-l),a&&(d=Math.round(d),e=Math.round(e));var g=L(n).map((function(e){return d+t*e}));return r(h?g.reverse():g)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([o,s]=t,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(t){return[o,s]=t,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,h()):a},n.padding=function(t){return arguments.length?(l=Math.min(1,u=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(u=+t,h()):u},n.align=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),h()):c},n.copy=function(){return Di(i(),[o,s]).round(a).paddingInner(l).paddingOuter(u).align(c)},Mi.apply(h(),arguments)}var Si=Math.sqrt(50),Ai=Math.sqrt(10),Ci=Math.sqrt(2);function Ti(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/Math.pow(10,r);return r>=0?(o>=Si?10:o>=Ai?5:o>=Ci?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=Si?10:o>=Ai?5:o>=Ci?2:1)}function Oi(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=Si?r*=10:o>=Ai?r*=5:o>=Ci&&(r*=2),e<t?-r:r}function Ni(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Li(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ri(t){let e,n,i;function r(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<0?r=e+1:o=e}while(r<o)}return r}return 2!==t.length?(e=Ni,n=(e,n)=>Ni(t(e),n),i=(e,n)=>t(e)-n):(e=t===Ni||t===Li?t:ji,n=t,i=t),{left:r,center:function(t,e,n=0,o=t.length){const s=r(t,e,n,o-1);return s>n&&i(t[s-1],e)>-i(t[s],e)?s-1:s},right:function(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<=0?r=e+1:o=e}while(r<o)}return r}}}function ji(){return 0}const zi=Ri(Ni),Ui=zi.right,Pi=(zi.left,Ri((function(t){return null===t?NaN:+t})).center,Ui);function Hi(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),s=new Array(i);for(n=0;n<r;++n)o[n]=Yi(t[n],e[n]);for(;n<i;++n)s[n]=e[n];return function(t){for(n=0;n<r;++n)s[n]=o[n](t);return s}}function Ii(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Gi(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=Yi(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}function Bi(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(o){for(n=0;n<i;++n)r[n]=t[n]*(1-o)+e[n]*o;return r}}function Yi(t,e){var n,i,r=typeof e;return null==e||"boolean"===r?Un(e):("number"===r?Ye:"string"===r?(n=bn(e))?(e=n,Hn):Yn:e instanceof bn?Hn:e instanceof Date?Ii:(i=e,!ArrayBuffer.isView(i)||i instanceof DataView?Array.isArray(e)?Hi:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Gi:Ye:Bi))(t,e)}function Wi(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Fi(t){return+t}var $i=[0,1];function qi(t){return t}function Xi(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Zi(t,e,n){var i=t[0],r=t[1],o=e[0],s=e[1];return r<i?(i=Xi(r,i),o=n(s,o)):(i=Xi(i,r),o=n(o,s)),function(t){return o(i(t))}}function Vi(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)r[s]=Xi(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(e){var n=Pi(t,e,1,i)-1;return o[n](r[n](e))}}function Qi(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ki(){return function(){var t,e,n,i,r,o,s=$i,a=$i,l=Yi,u=qi;function c(){var t,e,n,l=Math.min(s.length,a.length);return u!==qi&&(t=s[0],e=s[l-1],t>e&&(n=t,t=e,e=n),u=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?Vi:Zi,r=o=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(s.map(t),a,l)))(t(u(e)))}return h.invert=function(n){return u(e((o||(o=i(a,s.map(t),Ye)))(n)))},h.domain=function(t){return arguments.length?(s=Array.from(t,Fi),c()):s.slice()},h.range=function(t){return arguments.length?(a=Array.from(t),c()):a.slice()},h.rangeRound=function(t){return a=Array.from(t),l=Wi,c()},h.clamp=function(t){return arguments.length?(u=!!t||qi,c()):u!==qi},h.interpolate=function(t){return arguments.length?(l=t,c()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,c()}}()(qi,qi)}var Ji,tr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function er(t){if(!(e=tr.exec(t)))throw new Error("invalid format: "+t);var e;return new nr({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function nr(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function ir(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function rr(t){return(t=ir(Math.abs(t)))?t[1]:NaN}function or(t,e){var n=ir(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}er.prototype=nr.prototype,nr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const sr={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>or(100*t,e),r:or,s:function(t,e){var n=ir(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(Ji=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+ir(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ar(t){return t}var lr,ur,cr,hr=Array.prototype.map,dr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function fr(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var i,r,o,s,a=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((i=e<t)&&(r=t,t=e,e=r),0===(s=Ti(t,e,n))||!isFinite(s))return[];if(s>0){let n=Math.round(t/s),i=Math.round(e/s);for(n*s<t&&++n,i*s>e&&--i,o=new Array(r=i-n+1);++a<r;)o[a]=(n+a)*s}else{s=-s;let n=Math.round(t*s),i=Math.round(e*s);for(n/s<t&&++n,i/s>e&&--i,o=new Array(r=i-n+1);++a<r;)o[a]=(n+a)/s}return i&&o.reverse(),o}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return function(t,e,n,i){var r,o=Oi(t,e,n);switch((i=er(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(rr(e)/3)))-rr(Math.abs(t)))}(o,s))||(i.precision=r),cr(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,rr(e)-rr(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-rr(Math.abs(t)))}(o))||(i.precision=r-2*("%"===i.type))}return ur(i)}(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,o=e(),s=0,a=o.length-1,l=o[s],u=o[a],c=10;for(u<l&&(r=l,l=u,u=r,r=s,s=a,a=r);c-- >0;){if((r=Ti(l,u,n))===i)return o[s]=l,o[a]=u,e(o);if(r>0)l=Math.floor(l/r)*r,u=Math.ceil(u/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,u=Math.floor(u*r)/r}i=r}return t},t}function gr(){var t=Ki();return t.copy=function(){return Qi(t,gr())},Mi.apply(t,arguments),fr(t)}lr=function(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?ar:(e=hr.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,o=[],s=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[s=(s+1)%e.length];return o.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",s=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?ar:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(hr.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",u=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=er(t)).fill,n=t.align,h=t.sign,d=t.symbol,f=t.zero,g=t.width,p=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(p=!0,v="g"):sr[v]||(void 0===m&&(m=12),y=!0,v="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",w="$"===d?o:/[%p]/.test(v)?l:"",_=sr[v],x=/[defgprs%]/.test(v);function M(t){var r,o,l,d=b,M=w;if("c"===v)M=_(t)+M,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:_(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),k&&0==+t&&"+"!==h&&(k=!1),d=(k?"("===h?h:u:"-"===h||"("===h?"":h)+d,M=("s"===v?dr[8+Ji/3]:"")+M+(k&&"("===h?")":""),x)for(r=-1,o=t.length;++r<o;)if(48>(l=t.charCodeAt(r))||l>57){M=(46===l?s+t.slice(r+1):t.slice(r))+M,t=t.slice(0,r);break}}p&&!f&&(t=i(t,1/0));var E=d.length+t.length+M.length,D=E<g?new Array(g-E+1).join(e):"";switch(p&&f&&(t=i(D+t,D.length?g-M.length:1/0),D=""),n){case"<":t=d+t+M+D;break;case"=":t=d+D+t+M;break;case"^":t=D.slice(0,E=D.length>>1)+d+t+M+D.slice(E);break;default:t=D+d+t+M}return a(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),M.toString=function(){return t+""},M}return{format:h,formatPrefix:function(t,e){var n=h(((t=er(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(rr(e)/3))),r=Math.pow(10,-i),o=dr[8+i/3];return function(t){return n(r*t)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),ur=lr.format,cr=lr.formatPrefix;const pr=1e3,mr=6e4,yr=36e5,vr=864e5,br=6048e5,wr=31536e6,_r=new Date,xr=new Date;function Mr(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,o)=>{const s=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return s;let a;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<i);return s},r.filter=n=>Mr((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})),n&&(r.count=(e,i)=>(_r.setTime(+e),xr.setTime(+i),t(_r),t(xr),Math.floor(n(_r,xr))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t==0:e=>r.count(0,e)%t==0):r:null)),r}const kr=Mr((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));kr.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?Mr((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):kr:null),kr.range;const Er=Mr((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*pr)}),((t,e)=>(e-t)/pr),(t=>t.getUTCSeconds())),Dr=(Er.range,Mr((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*pr)}),((t,e)=>{t.setTime(+t+e*mr)}),((t,e)=>(e-t)/mr),(t=>t.getMinutes()))),Sr=(Dr.range,Mr((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*mr)}),((t,e)=>(e-t)/mr),(t=>t.getUTCMinutes()))),Ar=(Sr.range,Mr((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*pr-t.getMinutes()*mr)}),((t,e)=>{t.setTime(+t+e*yr)}),((t,e)=>(e-t)/yr),(t=>t.getHours()))),Cr=(Ar.range,Mr((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*yr)}),((t,e)=>(e-t)/yr),(t=>t.getUTCHours()))),Tr=(Cr.range,Mr((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*mr)/vr),(t=>t.getDate()-1))),Or=(Tr.range,Mr((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/vr),(t=>t.getUTCDate()-1))),Nr=(Or.range,Mr((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/vr),(t=>Math.floor(t/vr))));function Lr(t){return Mr((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*mr)/br))}Nr.range;const Rr=Lr(0),jr=Lr(1),zr=Lr(2),Ur=Lr(3),Pr=Lr(4),Hr=Lr(5),Ir=Lr(6);function Gr(t){return Mr((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/br))}Rr.range,jr.range,zr.range,Ur.range,Pr.range,Hr.range,Ir.range;const Br=Gr(0),Yr=Gr(1),Wr=Gr(2),Fr=Gr(3),$r=Gr(4),qr=Gr(5),Xr=Gr(6),Zr=(Br.range,Yr.range,Wr.range,Fr.range,$r.range,qr.range,Xr.range,Mr((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()))),Vr=(Zr.range,Mr((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()))),Qr=(Vr.range,Mr((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear())));Qr.every=t=>isFinite(t=Math.floor(t))&&t>0?Mr((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null,Qr.range;const Kr=Mr((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));function Jr(t,e,n,i,r,o){const s=[[Er,1,pr],[Er,5,5e3],[Er,15,15e3],[Er,30,3e4],[o,1,mr],[o,5,3e5],[o,15,9e5],[o,30,18e5],[r,1,yr],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,vr],[i,2,1728e5],[n,1,br],[e,1,2592e6],[e,3,7776e6],[t,1,wr]];function a(e,n,i){const r=Math.abs(n-e)/i,o=Ri((([,,t])=>t)).right(s,r);if(o===s.length)return t.every(Oi(e/wr,n/wr,i));if(0===o)return kr.every(Math.max(Oi(e,n,i),1));const[a,l]=s[r/s[o-1][2]<s[o][2]/r?o-1:o];return a.every(l)}return[function(t,e,n){const i=e<t;i&&([t,e]=[e,t]);const r=n&&"function"==typeof n.range?n:a(t,e,n),o=r?r.range(t,+e+1):[];return i?o.reverse():o},a]}Kr.every=t=>isFinite(t=Math.floor(t))&&t>0?Mr((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null,Kr.range;const[to,eo]=Jr(Kr,Vr,Br,Nr,Cr,Sr),[no,io]=Jr(Qr,Zr,Rr,Tr,Ar,Dr);function ro(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function oo(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function so(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var ao,lo,uo={"-":"",_:" ",0:"0"},co=/^\s*\d+/,ho=/^%/,fo=/[\\^$*+?|[\]().{}]/g;function go(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function po(t){return t.replace(fo,"\\$&")}function mo(t){return new RegExp("^(?:"+t.map(po).join("|")+")","i")}function yo(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function vo(t,e,n){var i=co.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function bo(t,e,n){var i=co.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function wo(t,e,n){var i=co.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function _o(t,e,n){var i=co.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function xo(t,e,n){var i=co.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Mo(t,e,n){var i=co.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function ko(t,e,n){var i=co.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Eo(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Do(t,e,n){var i=co.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function So(t,e,n){var i=co.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Ao(t,e,n){var i=co.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Co(t,e,n){var i=co.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function To(t,e,n){var i=co.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function Oo(t,e,n){var i=co.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function No(t,e,n){var i=co.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Lo(t,e,n){var i=co.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Ro(t,e,n){var i=co.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function jo(t,e,n){var i=ho.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function zo(t,e,n){var i=co.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Uo(t,e,n){var i=co.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Po(t,e){return go(t.getDate(),e,2)}function Ho(t,e){return go(t.getHours(),e,2)}function Io(t,e){return go(t.getHours()%12||12,e,2)}function Go(t,e){return go(1+Tr.count(Qr(t),t),e,3)}function Bo(t,e){return go(t.getMilliseconds(),e,3)}function Yo(t,e){return Bo(t,e)+"000"}function Wo(t,e){return go(t.getMonth()+1,e,2)}function Fo(t,e){return go(t.getMinutes(),e,2)}function $o(t,e){return go(t.getSeconds(),e,2)}function qo(t){var e=t.getDay();return 0===e?7:e}function Xo(t,e){return go(Rr.count(Qr(t)-1,t),e,2)}function Zo(t){var e=t.getDay();return e>=4||0===e?Pr(t):Pr.ceil(t)}function Vo(t,e){return t=Zo(t),go(Pr.count(Qr(t),t)+(4===Qr(t).getDay()),e,2)}function Qo(t){return t.getDay()}function Ko(t,e){return go(jr.count(Qr(t)-1,t),e,2)}function Jo(t,e){return go(t.getFullYear()%100,e,2)}function ts(t,e){return go((t=Zo(t)).getFullYear()%100,e,2)}function es(t,e){return go(t.getFullYear()%1e4,e,4)}function ns(t,e){var n=t.getDay();return go((t=n>=4||0===n?Pr(t):Pr.ceil(t)).getFullYear()%1e4,e,4)}function is(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+go(e/60|0,"0",2)+go(e%60,"0",2)}function rs(t,e){return go(t.getUTCDate(),e,2)}function os(t,e){return go(t.getUTCHours(),e,2)}function ss(t,e){return go(t.getUTCHours()%12||12,e,2)}function as(t,e){return go(1+Or.count(Kr(t),t),e,3)}function ls(t,e){return go(t.getUTCMilliseconds(),e,3)}function us(t,e){return ls(t,e)+"000"}function cs(t,e){return go(t.getUTCMonth()+1,e,2)}function hs(t,e){return go(t.getUTCMinutes(),e,2)}function ds(t,e){return go(t.getUTCSeconds(),e,2)}function fs(t){var e=t.getUTCDay();return 0===e?7:e}function gs(t,e){return go(Br.count(Kr(t)-1,t),e,2)}function ps(t){var e=t.getUTCDay();return e>=4||0===e?$r(t):$r.ceil(t)}function ms(t,e){return t=ps(t),go($r.count(Kr(t),t)+(4===Kr(t).getUTCDay()),e,2)}function ys(t){return t.getUTCDay()}function vs(t,e){return go(Yr.count(Kr(t)-1,t),e,2)}function bs(t,e){return go(t.getUTCFullYear()%100,e,2)}function ws(t,e){return go((t=ps(t)).getUTCFullYear()%100,e,2)}function _s(t,e){return go(t.getUTCFullYear()%1e4,e,4)}function xs(t,e){var n=t.getUTCDay();return go((t=n>=4||0===n?$r(t):$r.ceil(t)).getUTCFullYear()%1e4,e,4)}function Ms(){return"+0000"}function ks(){return"%"}function Es(t){return+t}function Ds(t){return Math.floor(+t/1e3)}function Ss(t){return new Date(t)}function As(t){return t instanceof Date?+t:+new Date(+t)}function Cs(t,e,n,i,r,o,s,a,l,u){var c=Ki(),h=c.invert,d=c.domain,f=u(".%L"),g=u(":%S"),p=u("%I:%M"),m=u("%I %p"),y=u("%a %d"),v=u("%b %d"),b=u("%B"),w=u("%Y");function _(t){return(l(t)<t?f:a(t)<t?g:s(t)<t?p:o(t)<t?m:i(t)<t?r(t)<t?y:v:n(t)<t?b:w)(t)}return c.invert=function(t){return new Date(h(t))},c.domain=function(t){return arguments.length?d(Array.from(t,As)):d().map(Ss)},c.ticks=function(e){var n=d();return t(n[0],n[n.length-1],null==e?10:e)},c.tickFormat=function(t,e){return null==e?_:u(e)},c.nice=function(t){var n=d();return t&&"function"==typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?d(function(t,e){var n,i=0,r=(t=t.slice()).length-1,o=t[i],s=t[r];return s<o&&(n=i,i=r,r=n,n=o,o=s,s=n),t[i]=e.floor(o),t[r]=e.ceil(s),t}(n,t)):c},c.copy=function(){return Qi(c,Cs(t,e,n,i,r,o,s,a,l,u))},c}function Ts(){return Mi.apply(Cs(no,io,Qr,Zr,Rr,Tr,Ar,Dr,Er,lo).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}ao=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,u=mo(r),c=yo(r),h=mo(o),d=yo(o),f=mo(s),g=yo(s),p=mo(a),m=yo(a),y=mo(l),v=yo(l),b={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:Po,e:Po,f:Yo,g:ts,G:ns,H:Ho,I:Io,j:Go,L:Bo,m:Wo,M:Fo,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Es,s:Ds,S:$o,u:qo,U:Xo,V:Vo,w:Qo,W:Ko,x:null,X:null,y:Jo,Y:es,Z:is,"%":ks},w={a:function(t){return s[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:rs,e:rs,f:us,g:ws,G:xs,H:os,I:ss,j:as,L:ls,m:cs,M:hs,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Es,s:Ds,S:ds,u:fs,U:gs,V:ms,w:ys,W:vs,x:null,X:null,y:bs,Y:_s,Z:Ms,"%":ks},_={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=g.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=y.exec(e.slice(n));return i?(t.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=p.exec(e.slice(n));return i?(t.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return k(t,e,n,i)},d:Ao,e:Ao,f:Ro,g:ko,G:Mo,H:To,I:To,j:Co,L:Lo,m:So,M:Oo,p:function(t,e,n){var i=u.exec(e.slice(n));return i?(t.p=c.get(i[0].toLowerCase()),n+i[0].length):-1},q:Do,Q:zo,s:Uo,S:No,u:bo,U:wo,V:_o,w:vo,W:xo,x:function(t,e,i){return k(t,n,e,i)},X:function(t,e,n){return k(t,i,e,n)},y:ko,Y:Mo,Z:Eo,"%":jo};function x(t,e){return function(n){var i,r,o,s=[],a=-1,l=0,u=t.length;for(n instanceof Date||(n=new Date(+n));++a<u;)37===t.charCodeAt(a)&&(s.push(t.slice(l,a)),null!=(r=uo[i=t.charAt(++a)])?i=t.charAt(++a):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),s.push(i),l=a+1);return s.push(t.slice(l,a)),s.join("")}}function M(t,e){return function(n){var i,r,o=so(1900,void 0,1);if(k(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=oo(so(o.y,0,1))).getUTCDay(),i=r>4||0===r?Yr.ceil(i):Yr(i),i=Or.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=ro(so(o.y,0,1))).getDay(),i=r>4||0===r?jr.ceil(i):jr(i),i=Tr.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?oo(so(o.y,0,1)).getUTCDay():ro(so(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,oo(o)):ro(o)}}function k(t,e,n,i){for(var r,o,s=0,a=e.length,l=n.length;s<a;){if(i>=l)return-1;if(37===(r=e.charCodeAt(s++))){if(r=e.charAt(s++),!(o=_[r in uo?e.charAt(s++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=x(n,b),b.X=x(i,b),b.c=x(e,b),w.x=x(n,w),w.X=x(i,w),w.c=x(e,w),{format:function(t){var e=x(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=M(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=x(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=M(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),lo=ao.format,ao.parse,ao.utcFormat,ao.utcParse;const Os=function(t){for(var e=t.length/6|0,n=new Array(e),i=0;i<e;)n[i]="#"+t.slice(6*i,6*++i);return n}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function Ns(t){return"string"==typeof t?new ue([[document.querySelector(t)]],[document.documentElement]):new ue([[t]],le)}const Ls=Math.PI,Rs=2*Ls,js=1e-6,zs=Rs-js;function Us(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ps(){return new Us}Us.prototype=Ps.prototype={constructor:Us,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,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,s=this._y1,a=n-t,l=i-e,u=o-t,c=s-e,h=u*u+c*c;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>js)if(Math.abs(c*a-l*u)>js&&r){var d=n-o,f=i-s,g=a*a+l*l,p=d*d+f*f,m=Math.sqrt(g),y=Math.sqrt(h),v=r*Math.tan((Ls-Math.acos((g+h-p)/(2*m*y)))/2),b=v/y,w=v/m;Math.abs(b-1)>js&&(this._+="L"+(t+b*u)+","+(e+b*c)),this._+="A"+r+","+r+",0,0,"+ +(c*d>u*f)+","+(this._x1=t+w*a)+","+(this._y1=e+w*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,i,r,o){t=+t,e=+e,o=!!o;var s=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+s,u=e+a,c=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>js||Math.abs(this._y1-u)>js)&&(this._+="L"+l+","+u),n&&(h<0&&(h=h%Rs+Rs),h>zs?this._+="A"+n+","+n+",0,1,"+c+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):h>js&&(this._+="A"+n+","+n+",0,"+ +(h>=Ls)+","+c+","+(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._}};const Hs=Ps;function Is(t){return function(){return t}}const Gs=Math.abs,Bs=Math.atan2,Ys=Math.cos,Ws=Math.max,Fs=Math.min,$s=Math.sin,qs=Math.sqrt,Xs=1e-12,Zs=Math.PI,Vs=Zs/2,Qs=2*Zs;function Ks(t){return t>1?0:t<-1?Zs:Math.acos(t)}function Js(t){return t>=1?Vs:t<=-1?-Vs:Math.asin(t)}function ta(t){return t.innerRadius}function ea(t){return t.outerRadius}function na(t){return t.startAngle}function ia(t){return t.endAngle}function ra(t){return t&&t.padAngle}function oa(t,e,n,i,r,o,s,a){var l=n-t,u=i-e,c=s-r,h=a-o,d=h*l-c*u;if(!(d*d<Xs))return[t+(d=(c*(e-o)-h*(t-r))/d)*l,e+d*u]}function sa(t,e,n,i,r,o,s){var a=t-n,l=e-i,u=(s?o:-o)/qs(a*a+l*l),c=u*l,h=-u*a,d=t+c,f=e+h,g=n+c,p=i+h,m=(d+g)/2,y=(f+p)/2,v=g-d,b=p-f,w=v*v+b*b,_=r-o,x=d*p-g*f,M=(b<0?-1:1)*qs(Ws(0,_*_*w-x*x)),k=(x*b-v*M)/w,E=(-x*v-b*M)/w,D=(x*b+v*M)/w,S=(-x*v+b*M)/w,A=k-m,C=E-y,T=D-m,O=S-y;return A*A+C*C>T*T+O*O&&(k=D,E=S),{cx:k,cy:E,x01:-c,y01:-h,x11:k*(r/_-1),y11:E*(r/_-1)}}function aa(){var t=ta,e=ea,n=Is(0),i=null,r=na,o=ia,s=ra,a=null;function l(){var l,u,c=+t.apply(this,arguments),h=+e.apply(this,arguments),d=r.apply(this,arguments)-Vs,f=o.apply(this,arguments)-Vs,g=Gs(f-d),p=f>d;if(a||(a=l=Hs()),h<c&&(u=h,h=c,c=u),h>Xs)if(g>Qs-Xs)a.moveTo(h*Ys(d),h*$s(d)),a.arc(0,0,h,d,f,!p),c>Xs&&(a.moveTo(c*Ys(f),c*$s(f)),a.arc(0,0,c,f,d,p));else{var m,y,v=d,b=f,w=d,_=f,x=g,M=g,k=s.apply(this,arguments)/2,E=k>Xs&&(i?+i.apply(this,arguments):qs(c*c+h*h)),D=Fs(Gs(h-c)/2,+n.apply(this,arguments)),S=D,A=D;if(E>Xs){var C=Js(E/c*$s(k)),T=Js(E/h*$s(k));(x-=2*C)>Xs?(w+=C*=p?1:-1,_-=C):(x=0,w=_=(d+f)/2),(M-=2*T)>Xs?(v+=T*=p?1:-1,b-=T):(M=0,v=b=(d+f)/2)}var O=h*Ys(v),N=h*$s(v),L=c*Ys(_),R=c*$s(_);if(D>Xs){var j,z=h*Ys(b),U=h*$s(b),P=c*Ys(w),H=c*$s(w);if(g<Zs&&(j=oa(O,N,P,H,z,U,L,R))){var I=O-j[0],G=N-j[1],B=z-j[0],Y=U-j[1],W=1/$s(Ks((I*B+G*Y)/(qs(I*I+G*G)*qs(B*B+Y*Y)))/2),F=qs(j[0]*j[0]+j[1]*j[1]);S=Fs(D,(c-F)/(W-1)),A=Fs(D,(h-F)/(W+1))}}M>Xs?A>Xs?(m=sa(P,H,O,N,h,A,p),y=sa(z,U,L,R,h,A,p),a.moveTo(m.cx+m.x01,m.cy+m.y01),A<D?a.arc(m.cx,m.cy,A,Bs(m.y01,m.x01),Bs(y.y01,y.x01),!p):(a.arc(m.cx,m.cy,A,Bs(m.y01,m.x01),Bs(m.y11,m.x11),!p),a.arc(0,0,h,Bs(m.cy+m.y11,m.cx+m.x11),Bs(y.cy+y.y11,y.cx+y.x11),!p),a.arc(y.cx,y.cy,A,Bs(y.y11,y.x11),Bs(y.y01,y.x01),!p))):(a.moveTo(O,N),a.arc(0,0,h,v,b,!p)):a.moveTo(O,N),c>Xs&&x>Xs?S>Xs?(m=sa(L,R,z,U,c,-S,p),y=sa(O,N,P,H,c,-S,p),a.lineTo(m.cx+m.x01,m.cy+m.y01),S<D?a.arc(m.cx,m.cy,S,Bs(m.y01,m.x01),Bs(y.y01,y.x01),!p):(a.arc(m.cx,m.cy,S,Bs(m.y01,m.x01),Bs(m.y11,m.x11),!p),a.arc(0,0,c,Bs(m.cy+m.y11,m.cx+m.x11),Bs(y.cy+y.y11,y.cx+y.x11),p),a.arc(y.cx,y.cy,S,Bs(y.y11,y.x11),Bs(y.y01,y.x01),!p))):a.arc(0,0,c,_,w,p):a.lineTo(L,R)}else a.moveTo(0,0);if(a.closePath(),l)return a=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-Zs/2;return[Ys(i)*n,$s(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Is(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Is(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Is(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Is(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Is(+t),l):r},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Is(+t),l):o},l.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Is(+t),l):s},l.context=function(t){return arguments.length?(a=null==t?null:t,l):a},l}function la(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ua(t){this._context=t}function ca(t){return new ua(t)}function ha(t){return t[0]}function da(t){return t[1]}function fa(t,e){var n=Is(!0),i=null,r=ca,o=null;function s(s){var a,l,u,c=(s=la(s)).length,h=!1;for(null==i&&(o=r(u=Hs())),a=0;a<=c;++a)!(a<c&&n(l=s[a],a,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(l,a,s),+e(l,a,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?ha:Is(t),e="function"==typeof e?e:void 0===e?da:Is(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Is(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Is(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Is(!!t),s):n},s.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),s):r},s.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),s):i},s}function ga(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function pa(t){return t}function ma(t,e){if((r=t.length)>1)for(var n,i,r,o=1,s=t[e[0]],a=s.length;o<r;++o)for(i=s,s=t[e[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function ya(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function va(t,e){return t[e]}function ba(t){const e=[];return e.key=t,e}function wa(t,e,n){this.k=t,this.x=e,this.y=n}function _a(t){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},_a(t)}function xa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ma(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ea(i.key),i)}}function ka(t,e,n){return(e=Ea(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ea(t){var e=function(t,e){if("object"!==_a(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==_a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===_a(e)?e:String(e)}Array.prototype.slice,ua.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)}}},wa.prototype={constructor:wa,scale:function(t){return 1===t?this:new wa(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new wa(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new wa(1,0,0),wa.prototype;var Da=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5","salmon","lightsalmon","lightsteelblue","steelblue","yellow","orange","#cccccc","#dddddd","#eee","#aaa","#123456","black"],Sa=function(){function t(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};xa(this,t),ka(this,"marginRight",150),ka(this,"marginBottom",150),ka(this,"colorRange",Da),this.title=e,this.description=n,this.data=i,this.options=r,this.dataIsValid=Array.isArray(i)?i.length>0:!!i,this.wrapper=document.createElement("div"),this.svg=Ns(this.wrapper).append("svg")}var e,n;return e=t,n=[{key:"clearAndScaleSvg",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.g&&this.g.remove(),this.svg.selectAll("*").remove();var r=n||100,o=i||50;this.g=this.svg.append("g").attr("transform","translate(".concat(r,",").concat(o,")")),this.svg.attr("height",e).attr("width",t);var s=this.svg.attr("width")-this.marginRight,a=this.svg.attr("height")-this.marginBottom;return[s,a]}},{key:"drawTitle",value:function(){var t=this;if(this.title&&this.svg.append("g").attr("transform","translate(10, 0)").append("text").attr("text-anchor","start").attr("x",0).attr("y",25).attr("class","chart-title").text(this.title),this.description){var e=Date.now();this.svg.append("g").attr("transform","translate(".concat(this.svg.attr("width")-40,", 5)")).append("path").attr("class","question-mark").attr("id","id-".concat(e)).attr("d","M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z"),setTimeout((function(){var n=document.getElementById("id-".concat(e));n&&n.addEventListener("click",(function(e){t.options.onShowDesc(t.description)}))}))}}},{key:"appendXAxis",value:function(t,e){var n=this.options.ticks?Z(t).ticks(this.options.ticks).tickFormat(lo("%d.%m.%Y %H:%M")):Z(t).tickFormat(lo("%d.%m.%Y %H:%M"));this.g.append("g").attr("transform","translate(0,"+e+")").call(n)}},{key:"appendXAxisLabel",value:function(t,e){this.options.xAxisLabel&&this.g.append("g").append("text").attr("x",t).attr("y",e+50).attr("text-anchor","end").attr("font-size","18px").attr("fill","black").text(this.options.xAxisLabel)}},{key:"appendYAxisLabel",value:function(){this.options.yAxisLabel&&this.g.append("g").append("text").attr("transform","rotate(-90)").attr("y",6).attr("dy","-4em").attr("text-anchor","end").attr("font-size","18px").attr("fill","black").text(this.options.yAxisLabel)}},{key:"showErrorMessage",value:function(t,e){this.g.append("g").append("text").attr("x",t/2-140).attr("y",e/2-20).attr("class","chart-error-message").text("No data available.")}},{key:"showLegend",value:function(t,e,n){this.svg.append("g").selectAll("g").data(t).enter().append("circle").attr("cx",n-120).attr("cy",(function(t,e){return 25+25*e})).attr("r",7).style("fill",(function(t){return e(t)})),this.svg.selectAll("label").data(t).enter().append("text").attr("x",n-100).attr("y",(function(t,e){return 25+25*e})).style("fill",(function(t){return e(t)})).text((function(t){return t})).attr("text-anchor","left").style("alignment-baseline","middle")}}],n&&Ma(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Aa(t){return Aa="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},Aa(t)}function Ca(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ta(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ta(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ta(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Oa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Na(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,r=function(t,e){if("object"!==Aa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==Aa(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===Aa(r)?r:String(r)),i)}var r}function La(t,e){return La=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},La(t,e)}function Ra(t,e){if(e&&("object"===Aa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ja(t){return ja=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ja(t)}var za=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&&La(t,e)}(s,t);var e,n,i,r,o=(i=s,r=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}}(),function(){var t,e=ja(i);if(r){var n=ja(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ra(this,t)});function s(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Oa(this,s),r.transform&&(i=(null!==(t=i)&&void 0!==t?t:[]).map(r.transform)),o.call(this,e,n,i,r)}return e=s,n=[{key:"plot",value:function(t,e){var n=Ca(this.clearAndScaleSvg(t,e),2),i=n[0],r=n[1];if(this.drawTitle(),!this.dataIsValid)return this.showErrorMessage(t,e),this.wrapper.innerHTML;var o=Ca(O(this.data,(function(t){return t.column1})),2),s=o[0],a=o[1],l=Ts().domain([s,a]).range([0,i]);this.appendXAxis(l,r),this.appendXAxisLabel(i,r),this.appendYAxisLabel();var u=N(this.data,(function(t){return+t.column2})),c=gr().domain([0,u]).range([r,0]);this.g.append("g").call(V(c));var h=Ei().range(this.colorRange);return this.g.append("path").datum(this.data).attr("stroke",(function(t){return h(t.column2)})).attr("class","chart-path").attr("d",fa().x((function(t){return l(t.column1)})).y((function(t){return c(t.column2)}))),this.options.showLegend&&this.showLegend(this.data.map((function(t){return t.column1})),h,t),this.wrapper.innerHTML}}],n&&Na(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Sa);function Ua(t){return Ua="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},Ua(t)}function Pa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Ha(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,r=function(t,e){if("object"!==Ua(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==Ua(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===Ua(r)?r:String(r)),i)}var r}function Ia(t,e){return Ia=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ia(t,e)}function Ga(t,e){if(e&&("object"===Ua(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ba(t){return Ba=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ba(t)}var Ya=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&&Ia(t,e)}(s,t);var e,n,i,r,o=(i=s,r=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}}(),function(){var t,e=Ba(i);if(r){var n=Ba(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ga(this,t)});function s(t,e,n,i){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),i.transform&&(n=(null!==(r=n)&&void 0!==r?r:[]).map(i.transform)),o.call(this,t,e,n,i)}return e=s,n=[{key:"plot",value:function(t,e){var n,i,r=(n=this.clearAndScaleSvg(t,e),i=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(n,i)||function(t,e){if(t){if("string"==typeof t)return Pa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pa(t,e):void 0}}(n,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],s=r[1];if(this.drawTitle(),!this.dataIsValid)return this.showErrorMessage(t,e),this.wrapper.innerHTML;var a=Di().range([0,o]).padding(.4),l=gr().range([s,0]),u=N(this.data,(function(t){return t.column2}));a.domain(this.data.map((function(t){return t.column1}))),l.domain([0,u]),this.appendXAxis(a,s),this.appendXAxisLabel(o,s),this.appendYAxisLabel(),this.g.append("g").attr("transform","translate(0, 0)").call(V(l));var c=Ei().range(this.colorRange);return this.g.selectAll(".bar").data(this.data).enter().append("rect").attr("fill",(function(t){return c(t.column2)})).attr("x",(function(t){return a(t.column1)})).attr("y",(function(t){return l(t.column2)})).attr("width",a.bandwidth()).attr("height",(function(t){return s-l(t.column2)})),this.options.showLegend&&this.showLegend(this.data.map((function(t){return t.column1})),c,t),this.wrapper.innerHTML}}],n&&Ha(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Sa);function Wa(t){return Wa="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},Wa(t)}function Fa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function $a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qa(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,r=function(t,e){if("object"!==Wa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==Wa(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===Wa(r)?r:String(r)),i)}var r}function Xa(t,e){return Xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xa(t,e)}function Za(t,e){if(e&&("object"===Wa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Va(t){return Va=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Va(t)}var Qa=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&&Xa(t,e)}(s,t);var e,n,i,r,o=(i=s,r=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}}(),function(){var t,e=Va(i);if(r){var n=Va(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Za(this,t)});function s(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return $a(this,s),r.transform&&(i=(null!==(t=i)&&void 0!==t?t:[]).map(r.transform)),o.call(this,e,n,i,r)}return e=s,n=[{key:"plot",value:function(t,e){var n=t/2,i=e/2;if(!this.dataIsValid)return this.clearAndScaleSvg(t,e),this.drawTitle(),this.showErrorMessage(t,e),this.wrapper.innerHTML;var r,o,s=(r=this.clearAndScaleSvg(t,e,n,i),o=2,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(r,o)||function(t,e){if(t){if("string"==typeof t)return Fa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fa(t,e):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=s[0],l=s[1];this.drawTitle();var u=Math.min(a,l)/1.5,c=function(){var t=pa,e=ga,n=null,i=Is(0),r=Is(Qs),o=Is(0);function s(s){var a,l,u,c,h,d=(s=la(s)).length,f=0,g=new Array(d),p=new Array(d),m=+i.apply(this,arguments),y=Math.min(Qs,Math.max(-Qs,r.apply(this,arguments)-m)),v=Math.min(Math.abs(y)/d,o.apply(this,arguments)),b=v*(y<0?-1:1);for(a=0;a<d;++a)(h=p[g[a]=a]=+t(s[a],a,s))>0&&(f+=h);for(null!=e?g.sort((function(t,n){return e(p[t],p[n])})):null!=n&&g.sort((function(t,e){return n(s[t],s[e])})),a=0,u=f?(y-d*b)/f:0;a<d;++a,m=c)l=g[a],c=m+((h=p[l])>0?h*u:0)+b,p[l]={data:s[l],index:a,value:h,startAngle:m,endAngle:c,padAngle:v};return p}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:Is(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Is(+t),s):i},s.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:Is(+t),s):r},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Is(+t),s):o},s}().value((function(t){return t.column2})),h=aa().outerRadius(u-10).innerRadius(0),d=(aa().outerRadius(u).innerRadius(u-80),this.g.selectAll(".arc").data(c(this.data)).enter().append("g").attr("class","arc")),f=Ei().domain(this.data).range(this.colorRange);return d.append("path").attr("d",h).attr("fill",(function(t){return f(t.data.column1)})),d.append("text").attr("transform",(function(t){return"translate("+(u+50)*Math.sin((t.endAngle-t.startAngle)/2+t.startAngle)+", "+-1*(u-10)*Math.cos((t.endAngle-t.startAngle)/2+t.startAngle)+")"})).attr("dy",".5em").text((function(t){return"".concat(t.data.column2," %")})),this.options.showLegend&&this.showLegend(this.data.map((function(t){return t.column1})),f,t),this.wrapper.innerHTML}}],n&&qa(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Sa);function Ka(t){return Ka="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},Ka(t)}function Ja(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function tl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function el(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,r=function(t,e){if("object"!==Ka(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==Ka(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===Ka(r)?r:String(r)),i)}var r}function nl(t,e){return nl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nl(t,e)}function il(t,e){if(e&&("object"===Ka(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function rl(t){return rl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rl(t)}var ol=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&&nl(t,e)}(s,t);var e,n,i,r,o=(i=s,r=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}}(),function(){var t,e=rl(i);if(r){var n=rl(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return il(this,t)});function s(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return tl(this,s),r.transform&&(i=(null!==(t=i)&&void 0!==t?t:[]).map(r.transform)),o.call(this,e,n,i,r)}return e=s,n=[{key:"plot",value:function(t,e){var n,i,r=(n=this.clearAndScaleSvg(t,e),i=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(n,i)||function(t,e){if(t){if("string"==typeof t)return Ja(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ja(t,e):void 0}}(n,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],s=r[1];if(this.drawTitle(),!this.dataIsValid)return this.showErrorMessage(t,e),this.wrapper.innerHTML;var a=Ts().domain(O(this.data,(function(t){return t.column1}))).range([0,o]);this.appendXAxis(a,s),this.appendXAxisLabel(o,s),this.appendYAxisLabel();var l=gr().domain([0,N(this.data,(function(t){return+t.column2}))]).range([s,0]);this.g.append("g").call(V(l));var u=Ei().range(this.colorRange);return this.g.append("path").datum(this.data).attr("fill",(function(t){return u(t.column2)})).attr("class","chart-area").attr("d",function(t,e,n){var i=null,r=Is(!0),o=null,s=ca,a=null;function l(l){var u,c,h,d,f,g=(l=la(l)).length,p=!1,m=new Array(g),y=new Array(g);for(null==o&&(a=s(f=Hs())),u=0;u<=g;++u){if(!(u<g&&r(d=l[u],u,l))===p)if(p=!p)c=u,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=u-1;h>=c;--h)a.point(m[h],y[h]);a.lineEnd(),a.areaEnd()}p&&(m[u]=+t(d,u,l),y[u]=+e(d,u,l),a.point(i?+i(d,u,l):m[u],n?+n(d,u,l):y[u]))}if(f)return a=null,f+""||null}function u(){return fa().defined(r).curve(s).context(o)}return t="function"==typeof t?t:void 0===t?ha:Is(+t),e="function"==typeof e?e:Is(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?da:Is(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Is(+e),i=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Is(+e),l):t},l.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Is(+t),l):i},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Is(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Is(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Is(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(i).y(e)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:Is(!!t),l):r},l.curve=function(t){return arguments.length?(s=t,null!=o&&(a=s(o)),l):s},l.context=function(t){return arguments.length?(null==t?o=a=null:a=s(o=t),l):o},l}().x((function(t){return a(t.column1)})).y0(l(0)).y1((function(t){return l(t.column2)}))),this.options.showLegend&&this.showLegend(this.data.map((function(t){return t.column1})),u,t),this.wrapper.innerHTML}}],n&&el(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Sa);function sl(t){return sl="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},sl(t)}function al(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function ll(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?al(Object(n),!0).forEach((function(e){ul(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):al(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ul(t,e,n){return(e=fl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cl(t,e){if(t){if("string"==typeof t)return hl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hl(t,e):void 0}}function hl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function dl(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,fl(i.key),i)}}function fl(t){var e=function(t,e){if("object"!==sl(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==sl(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===sl(e)?e:String(e)}function gl(t,e){return gl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gl(t,e)}function pl(t,e){if(e&&("object"===sl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ml(t){return ml=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ml(t)}var yl=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&&gl(t,e)}(s,t);var e,n,i,r,o=(i=s,r=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}}(),function(){var t,e=ml(i);if(r){var n=ml(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return pl(this,t)});function s(t,e,n,i,r){var a,l;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),r.transform&&(n=(null!==(a=n)&&void 0!==a?a:[]).map(r.transform)),(l=o.call(this,t,e,n,r)).groups=i,l}return e=s,n=[{key:"plot",value:function(t,e){var n,i,r=this,o=(n=this.clearAndScaleSvg(t,e),i=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(n,i)||cl(n,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=o[0],a=o[1];if(this.drawTitle(),!this.dataIsValid)return this.showErrorMessage(t,e),this.wrapper.innerHTML;var l=Object.keys(this.data.overall[0]),u=Object.keys(this.data),c=Object.keys(this.data).reduce((function(t,e){return[].concat(function(t){return function(t){if(Array.isArray(t))return hl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||cl(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.")}()}(t),[ll(ll({},r.data[e][0]),{},{group:e})])}),[]),h=function(){var t=Is([]),e=ya,n=ma,i=va;function r(r){var o,s,a=Array.from(t.apply(this,arguments),ba),l=a.length,u=-1;for(const t of r)for(o=0,++u;o<l;++o)(a[o][u]=[0,+i(t,a[o].key,u,r)]).data=t;for(o=0,s=la(e(a));o<l;++o)a[s[o]].index=o;return n(a,s),a}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:Is(Array.from(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:Is(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?ya:"function"==typeof t?t:Is(Array.from(t)),r):e},r.offset=function(t){return arguments.length?(n=null==t?ma:t,r):n},r}().keys(l)(c),d=h[0][0][0],f=h[h.length-1][0][1],g=Di().domain(u).range([0,s]).padding([.2]);this.g.append("g").attr("transform","translate(0, ".concat(a,")")).call(Z(g).tickSizeOuter(0));var p=gr().domain([d,f]).range([a,0]);this.g.append("g").call(V(p));var m=Ei().domain(["overall"]).range(this.colorRange);return this.g.append("g").selectAll("g").data(h).join("g").attr("fill",(function(t){return m(t.key)})).selectAll("rect").data((function(t){return t})).join("rect").attr("x",(function(t){return g(t.data.group)})).attr("x",(function(t){return g(t.data.group)})).attr("y",(function(t){return p(t[1])})).attr("height",(function(t){return p(t[0])-p(t[1])})).attr("width",g.bandwidth()),this.options.showLegend&&this.showLegend(l,m,t),this.wrapper.innerHTML}}],n&&dl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Sa);function vl(t){return vl="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},vl(t)}function bl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function wl(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,r=function(t,e){if("object"!==vl(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==vl(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===vl(r)?r:String(r)),i)}var r}function _l(t,e){return _l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_l(t,e)}function xl(t,e){if(e&&("object"===vl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ml(t){return Ml=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ml(t)}var kl=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&&_l(t,e)}(s,t);var e,n,i,r,o=(i=s,r=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}}(),function(){var t,e=Ml(i);if(r){var n=Ml(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return xl(this,t)});function s(t,e,n,i){var r,a,l=i.transform,u=i.x,c=void 0===u?function(t,e){return e}:u,h=i.y,d=void 0===h?function(t){return t}:h,f=i.z,g=void 0===f?function(){return 1}:f,p=i.title,m=i.marginTop,y=void 0===m?0:m,v=i.marginRight,b=void 0===v?0:v,w=i.marginBottom,_=void 0===w?0:w,x=i.marginLeft,M=void 0===x?40:x,k=i.width,E=void 0===k?640:k,D=i.height,S=void 0===D?400:D,A=i.xDomain,C=i.xRange,T=void 0===C?[M,E-b]:C,O=i.xPadding,N=void 0===O?.1:O,L=i.yType,R=void 0===L?gr:L,j=i.yDomain,z=i.yRange,U=void 0===z?[S-_,y]:z,P=i.zDomain,H=i.zPadding,I=void 0===H?.05:H,G=i.yFormat,B=i.yLabel,Y=i.colors,W=void 0===Y?Os:Y,F=i.drawLegend,$=void 0===F||F;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),l&&(n=(null!==(r=n)&&void 0!==r?r:[]).map(l));var q={transform:l,x:c,y:d,z:g,title:p,marginTop:y,marginRight:b,marginBottom:_,marginLeft:M,width:E,height:S,xDomain:A,xRange:T,xPadding:N,yType:R,yDomain:j,yRange:U,zDomain:P,zPadding:I,yFormat:G,yLabel:B,colors:W,drawLegend:$};return(a=o.call(this,p,e,n,q)).options=q,a.data=n,a.wrapper=document.createElement("div"),a.svg=Ns(a.wrapper).append("svg"),a}return e=s,n=[{key:"plot",value:function(t,e){var n,i,r,o=this,s=(i=this.clearAndScaleSvg(t,e),r=2,function(t){if(Array.isArray(t))return t}(i)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(i,r)||function(t,e){if(t){if("string"==typeof t)return bl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bl(t,e):void 0}}(i,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=s[0],l=s[1],u=this.options,c=u.x,h=u.y,d=u.z,f=u.title,g=u.marginTop,p=u.marginRight,m=u.marginBottom,y=u.marginLeft,v=u.width,b=u.height,w=u.xDomain,_=u.xRange,x=u.xPadding,M=u.yType,k=u.yDomain,E=u.yRange,D=u.zDomain,S=u.zPadding,A=u.yFormat,C=u.yLabel,T=u.colors,O=u.drawLegend;v=a,b=l+150,g=15*(null!==(n=D)&&void 0!==n?n:[]).length,p=this.marginRight,E=[b-(m=this.marginBottom),g],_=[y,v-p];var j=this.data,U=R(j,c),P=R(j,h),H=R(j,d);void 0===w&&(w=U),void 0===k&&(k=[0,N(P)]),void 0===D&&(D=H),w=new z(w),D=new z(D);var I=L(U.length).filter((function(t){return w.has(U[t])&&D.has(H[t])})),G=Di(w,_).paddingInner(x),B=Di(D,[0,G.bandwidth()]).padding(S),Y=M(k,E),W=Ei(D,T),F=Z(G).tickSizeOuter(0),$=V(Y).ticks(b/60,A);if(void 0===f){var q=Y.tickFormat(100,A);f=function(t){return"".concat(U[t],"\n").concat(H[t],"\n").concat(q(P[t]))}}else{var X=R(j,(function(t){return t})),Q=f;f=function(t){return Q(X[t],t,j)}}if(this.g.append("g").attr("transform","translate(".concat(y,",0)")).call($).call((function(t){return t.select(".domain").remove()})).call((function(t){return t.selectAll(".tick line").clone().attr("x2",v-y-p).attr("stroke-opacity",.1)})).call((function(t){return t.append("text").attr("x",-y).attr("y",100).attr("fill","currentColor").attr("text-anchor","start").text(C)})),this.g.append("g").selectAll("rect").data(I).join("rect").attr("x",(function(t){return G(U[t])+B(H[t])})).attr("y",(function(t){return Y(P[t])})).attr("width",B.bandwidth()).attr("height",(function(t){return Y(0)-Y(P[t])})).attr("fill",(function(t){return W(H[t])})),O){var K,J=2;(null!==(K=D)&&void 0!==K?K:[]).forEach((function(t){J+=1;var e=W(t),n=15*J/2,i=J%2?0:200;o.g.append("circle").attr("cx",i).attr("cy",n).attr("r",5).style("fill",e),o.g.append("text").attr("x",i+10).attr("y",n+4).text(t).style("font-size","15px").attr("alignment-baseline","middle")}))}return f&&this.g.append("title").text(f),this.g.append("g").attr("transform","translate(0,".concat(b-m,")")).call(F),this.wrapper.innerHTML}}],n&&wl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(Sa)})(),i})())); \ No newline at end of file diff --git a/index.js b/index.js index cfbf78a98b4a41404e129d73096a668f903bb051..599ed8e918918eb48aaeec515d807d789da720a1 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,12 @@ import "./src/css/styles.scss" import { getResult, initGrid } from "./src/js/utils"; -import { BaseChartWidget, LineChartWidget, BarChartWidget, AreaChartWidget, PieChartWidget, StackedBarChartWidget } from "./src/js/charts"; +import { BaseChartWidget } from "./src/js/charts/base"; +import { LineChartWidget } from"./src/js/charts/linechart"; +import { BarChartWidget } from "./src/js/charts/barchart"; +import { PieChartWidget } from "./src/js/charts/piechart"; +import { AreaChartWidget } from "./src/js/charts/areachart"; +import { StackedBarChartWidget } from "./src/js/charts/stacked_barchart"; +import { GroupedBarChart } from "./src/js/charts/grouped_barchart"; export { getResult, @@ -10,5 +16,6 @@ export { AreaChartWidget, PieChartWidget, StackedBarChartWidget, - BaseChartWidget + BaseChartWidget, + GroupedBarChart }; diff --git a/src/js/app.js b/src/js/app.js deleted file mode 100644 index 22ef01199b4e6fab914382416ed6f85b26025390..0000000000000000000000000000000000000000 --- a/src/js/app.js +++ /dev/null @@ -1,2 +0,0 @@ -import "../css/styles.scss" -import "./main" \ No newline at end of file diff --git a/src/js/charts/grouped_barchart.js b/src/js/charts/grouped_barchart.js new file mode 100644 index 0000000000000000000000000000000000000000..b6f452b8ac649107a5948a30eac511f8d55bfb7a --- /dev/null +++ b/src/js/charts/grouped_barchart.js @@ -0,0 +1,196 @@ +import * as d3 from "d3"; +import {BaseChartWidget} from "./base"; + +// Copyright 2021 Observable, Inc. +// Released under the ISC license. +// https://observablehq.com/@d3/grouped-bar-chart + + +export class GroupedBarChart extends BaseChartWidget{ + + constructor(titleText, description, data, { + transform, // data transformation function + x = (d, i) => i, // given d in data, returns the (ordinal) x-value + y = d => d, // given d in data, returns the (quantitative) y-value + z = () => 1, // given d in data, returns the (categorical) z-value + title, // given d in data, returns the title text + marginTop = 0, // top margin, in pixels + marginRight = 0, // right margin, in pixels + marginBottom = 0, // bottom margin, in pixels + marginLeft = 40, // left margin, in pixels + width = 640, // outer width, in pixels + height = 400, // outer height, in pixels + xDomain, // array of x-values + xRange = [marginLeft, width - marginRight], // [xmin, xmax] + xPadding = 0.1, // amount of x-range to reserve to separate groups + yType = d3.scaleLinear, // type of y-scale + yDomain, // [ymin, ymax] + yRange = [height - marginBottom, marginTop], // [ymin, ymax] + zDomain, // array of z-values + zPadding = 0.05, // amount of x-range to reserve to separate bars + yFormat, // a format specifier string for the y-axis + yLabel, // a label for the y-axis + colors = d3.schemeTableau10, // array of colors + drawLegend = true + }) { + + if (transform) + data = (data ?? []).map(transform); + + const options = { + transform, + x, + y, + z, + title, + marginTop, + marginRight, + marginBottom, + marginLeft, + width, + height, + xDomain, + xRange, + xPadding, + yType, + yDomain, + yRange, + zDomain, + zPadding, + yFormat, // a format specifier string for the y-axis + yLabel, // a label for the y-axis + colors, + drawLegend + } + super(title, description, data, options); + + this.options = options + this.data = data + + this.wrapper = document.createElement("div"); + this.svg = d3.select(this.wrapper).append("svg"); + } + + plot(divWidth, divHeight) { + let [w, h] = this.clearAndScaleSvg(divWidth, divHeight); + // this.drawTitle(); + + let { + x, + y, + z, + title, + marginTop, + marginRight, + marginBottom, + marginLeft, + width, + height, + xDomain, + xRange, + xPadding, + yType, + yDomain, + yRange, + zDomain, + zPadding, + yFormat, // a format specifier string for the y-axis + yLabel, // a label for the y-axis + colors, + drawLegend + } = this.options + + const labelOffset = 15 + + width = w + height = h + 150 + marginTop = labelOffset * (zDomain??[]).length + marginRight = this.marginRight + marginBottom = this.marginBottom + yRange = [height - marginBottom, marginTop] + xRange = [marginLeft, width - marginRight] + + const data = this.data + const X = d3.map(data, x); + const Y = d3.map(data, y); + const Z = d3.map(data, z); + + // Compute default domains, and unique the x- and z-domains. + if (xDomain === undefined) xDomain = X; + if (yDomain === undefined) yDomain = [0, d3.max(Y)]; + if (zDomain === undefined) zDomain = Z; + xDomain = new d3.InternSet(xDomain); + zDomain = new d3.InternSet(zDomain); + + // Omit any data not present in both the x- and z-domain. + const I = d3.range(X.length).filter(i => xDomain.has(X[i]) && zDomain.has(Z[i])); + + // Construct scales, axes, and formats. + const xScale = d3.scaleBand(xDomain, xRange).paddingInner(xPadding); + const xzScale = d3.scaleBand(zDomain, [0, xScale.bandwidth()]).padding(zPadding); + const yScale = yType(yDomain, yRange); + const zScale = d3.scaleOrdinal(zDomain, colors); + const xAxis = d3.axisBottom(xScale).tickSizeOuter(0); + const yAxis = d3.axisLeft(yScale).ticks(height / 60, yFormat); + + // Compute titles. + if (title === undefined) { + const formatValue = yScale.tickFormat(100, yFormat); + title = i => `${X[i]}\n${Z[i]}\n${formatValue(Y[i])}`; + } else { + const O = d3.map(data, d => d); + const T = title; + title = i => T(O[i], i, data); + } + + this.g.append("g") + .attr("transform", `translate(${marginLeft},0)`) + .call(yAxis) + .call(g => g.select(".domain").remove()) + .call(g => g.selectAll(".tick line").clone() + .attr("x2", width - marginLeft - marginRight) + .attr("stroke-opacity", 0.1)) + .call(g => g.append("text") + .attr("x", -marginLeft) + .attr("y", 100) + .attr("fill", "currentColor") + .attr("text-anchor", "start") + .text(yLabel)); + + this.g.append("g") + .selectAll("rect") + .data(I) + .join("rect") + .attr("x", i => xScale(X[i]) + xzScale(Z[i])) + .attr("y", i => yScale(Y[i])) + .attr("width", xzScale.bandwidth()) + .attr("height", i => yScale(0) - yScale(Y[i])) + .attr("fill", i => zScale(Z[i])) + + if(drawLegend) + { + // custom legend + let runner = 2; + (zDomain??[]).forEach( (ele) => { + runner+=1 + const color = zScale(ele) + const yOffset = (labelOffset * runner) / 2 + const xOffset = runner%2? 0 : 200 + this.g.append("circle").attr("cx",xOffset).attr("cy",yOffset).attr("r", 5).style("fill",color) + this.g.append("text").attr("x", xOffset + 10).attr("y", yOffset +4).text(ele).style("font-size", "15px").attr("alignment-baseline","middle") + }) + } + + + if (title) this.g.append("title") + .text(title); + + this.g.append("g") + .attr("transform", `translate(0,${height - marginBottom})`) + .call(xAxis); + + return this.wrapper.innerHTML; + + } + +} \ No newline at end of file diff --git a/src/js/charts/index.js b/src/js/charts/index.js deleted file mode 100644 index fc262cdb245066ea3e1e3ed65e779cb6a3467396..0000000000000000000000000000000000000000 --- a/src/js/charts/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import { BaseChartWidget } from "./base"; -import { LineChartWidget } from "./linechart"; -import { BarChartWidget } from "./barchart"; -import { PieChartWidget } from "./piechart"; -import { AreaChartWidget } from "./areachart"; -import { StackedBarChartWidget } from "./stacked_barchart"; - -export { - BaseChartWidget, - LineChartWidget, - BarChartWidget, - PieChartWidget, - AreaChartWidget, - StackedBarChartWidget, -}; diff --git a/src/js/main.js b/src/js/main.js deleted file mode 100644 index 05e3dc660f043c21c7543e336a6dc0295434e488..0000000000000000000000000000000000000000 --- a/src/js/main.js +++ /dev/null @@ -1,204 +0,0 @@ -import { getResult, initGrid } from "./utils"; -import { - LineChartWidget, - BarChartWidget, - AreaChartWidget, - PieChartWidget, - StackedBarChartWidget, -} from "./charts"; -import { CourseRatingChart } from "./charts/custom/courseRatingChart"; - -/** - * JWT Token - hardcoded for demotrastion - * This jwt token is generated in the backend. - */ -const TOKEN = - "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJjb250ZXh0X2lkIjoidXNlcjFAcG9sYXJpcy5jb20iLCJleHAiOjE2NzQwNDc1MTUsImVuZ2luZXMiOlsyLDQsNSw2LDUsMTNdLCJlbmdpbmVzX3dpdGhfY29udGV4dCI6WzExLDEyXX0.ASnyAZ9jalb2vzx4zoT7tf9_BLhgsHfLt0GRLYag-9AqojLbL7y6NKr_3eKNVmE5yylYttN705zaTVW8pzGAfmYpM0OFlWwr1Je_AXd3sNvAxERjV2cBNg5uDggi4gUCT6xqQ7K3nwy1l_q1SsWBPHmhDmcJbVmfH3Y0DNeUaf0WyXjKDLIalKLQV9DwuRUcDUqq6FT0P9EG1_DyBTihJKEInD4gNQzNHwTibJrLdK8UMz_PeDRZT1jrv40bsKoyc4vIJvZdiE9q3ti93fZXLkc9I6OOqsBqEl7l2H2WEuEEUXoLEK0j2tb7_X367y8d9i-7jLuvc406uFVdAqPQ_XoRK689eL7wPDwl2KU7mvrZv1mIxnxe-OIVAPLq8LTzMFdCnf1rdDORLRjjAHOCrszE_2oKE9ciE3pW_0OxeOkR8dAX6uKXIURgZd2fYIO4Cn97LQBTEGR04eKe2YAIovGM9_SqC2x10H7VwcEkHLHpUTNLeR9rrrNu36hPgIvH"; -const URL = "http://vs-code-cloud.digitallearning.gmbh:8003/api/v1/provider/result" - -/** - * Setup initial widget position and sizes - */ -const items = [ - { - x: 4, - y: 0, - w: 4, - h: 8, - widgetId: "second-widget", - }, - { - x: 4, - y: 0, - w: 4, - h: 4, - widgetId: "fourth-widget", - }, - { - x: 8, - y: 4, - w: 4, - h: 8, - widgetId: "sixth-widget", - }, - { - x: 4, - y: 8, - w: 4, - h: 8, - widgetId: "seventh-widget", - }, - { - x: 8, - y: 8, - w: 4, - h: 8, - widgetId: "eigth-widget", - }, - { - x: 8, - y: 12, - w: 4, - h: 8, - widgetId: "ninth-widget", - }, - { - x: 0, - y: 12, - w: 4, - h: 8, - widgetId: "tenth-widget", - }, - { - x: 0, - y: 12, - w: 4, - h: 8, - widgetId: "eleventh-widget", - }, -]; - -/** - * Get analytics engine results and render widgets - */ -getResult(TOKEN, URL).then((data) => { - - // Create widgets with data from analytics engine results - const widgets = { - "second-widget": new BarChartWidget( - "Statements H5P", - data["count_h5p_statements"]?.description, - data["count_h5p_statements"]?.latest_result, - { - xAxisLabel: "Datum", - yAxisLabel: "#Statements", - transform: (d) => ({ - column1: new Date(d.column1 * 1000), - column2: d.column2, - }), - } - ), - "fourth-widget": new PieChartWidget( - "Persönliche Statement Verteilung", - data["h5p_statements_distribution"]?.description, - data["h5p_statements_distribution"]?.latest_result, - { - showLegend: true, - xAxisLabel: "Jahr", - yAxisLabel: "#Akitivitäten", - } - ), - "sixth-widget": new LineChartWidget( - "Semesterabschluss", - data["collect_h5p_count_statements"]?.description, - data["collect_h5p_count_statements"]?.latest_result, - { - xAxisLabel: "Monat", - yAxisLabel: "Index", - transform: (d) => ({ - column1: new Date(d.column1 * 1000), - column2: d.column2, - }), - } - ), - "seventh-widget": new CourseRatingChart( - "Bewertungen für Kurse", - data["random_course_rating"]?.description, - data["random_course_rating"]?.latest_result, - { - xAxisLabel: "Note", - yAxisLabel: "Kurs", - } - ), - "eigth-widget": new AreaChartWidget( - "Statements H5P", - data["collect_h5p_count_statements"]?.description, - data["collect_h5p_count_statements"]?.latest_result, - { - xAxisLabel: "Monat", - yAxisLabel: "Index", - transform: (d) => ({ - column1: new Date(d.column1 * 1000), - column2: d.column2, - }), - } - ), - "ninth-widget": new BarChartWidget( - "Statements Moodle", - data["count_moodle_statements"]?.description, - data["count_moodle_statements"]?.latest_result, - { - xAxisLabel: "Datum", - yAxisLabel: "#Statements", - transform: (d) => ({ - column1: new Date(d.column1 * 1000), - column2: d.column2, - }), - } - ), - "tenth-widget": new StackedBarChartWidget( - "Statements", - data["collect_counts_all_providers"]?.description, - data["collect_counts_all_providers"]?.latest_result, - ["overall"], - { - showLegend: true, - xAxisLabel: "Provider", - yAxisLabel: "#Statements", - } - ), - "eleventh-widget": new BarChartWidget( - "Personal H5P xAPI Statements", - data["h5p_count_user_statements"]?.description, - data["h5p_count_user_statements"]?.latest_result, - { - xAxisLabel: "Datum", - yAxisLabel: "#Statements", - transform: (d) => ({ - column1: new Date(d.column1 * 1000), - column2: d.column2, - }), - } - ), - }; - - // Initialize grid with widgets at configured positions - const grid = initGrid(widgets, items); - - // Handle toggle button click - const toggleBtn = document.getElementById("toggle-sidebar-btn"); - toggleBtn.onclick = grid.toggleSidebar; - - // Handle save button click - const saveBtn = document.getElementById("save-btn"); - saveBtn.onclick = () => { - // Get current grid configuration -> we might want to store this configuration - const oldGrid = grid.save(); - - // Reload grid with saved grid configuration (just for demonstration) - grid.grid.removeAll(); - setTimeout(() => { - grid.load(oldGrid); - }, 2000); - }; -});