@hpcc-js/composite 3.2.11 → 3.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,3 @@
1
- (function(global2,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/api"),require("@hpcc-js/form"),require("@hpcc-js/other")):typeof define=="function"&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/dgrid","@hpcc-js/api","@hpcc-js/form","@hpcc-js/other"],factory):(global2=typeof globalThis<"u"?globalThis:global2||self,factory(global2["@hpcc-js/composite"]={},global2["@hpcc-js/common"],global2["@hpcc-js/dgrid"],global2["@hpcc-js/api"],global2["@hpcc-js/form"],global2["@hpcc-js/other"]))})(this,function(exports2,common,dgrid,api,form,other){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);const PKG_NAME="@hpcc-js/composite",PKG_VERSION="3.1.1",BUILD_VERSION="3.2.1";var __defProp2=Object.defineProperty,__defNormalProp2=(obj,key,value)=>key in obj?__defProp2(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__publicField2=(obj,key,value)=>__defNormalProp2(obj,typeof key!="symbol"?key+"":key,value);function _mergeNamespaces$1(n,m){for(var i=0;i<m.length;i++){const e=m[i];if(typeof e!="string"&&!Array.isArray(e)){for(const k2 in e)if(k2!=="default"&&!(k2 in n)){const d=Object.getOwnPropertyDescriptor(e,k2);d&&Object.defineProperty(n,k2,d.get?d:{enumerable:!0,get:()=>e[k2]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}class AbsoluteSurface extends common.HTMLWidget{constructor(){super(),this._tag="div"}enter(domNode,element){super.enter(domNode,element)}update(domNode,element){super.update(domNode,element);let xPos=0,yPos=0,width=this.clientWidth(),height=this.clientHeight();switch(this.units()){case"pixels":xPos=this.widgetX(),yPos=this.widgetY(),width=this.widgetWidth()===""?width-xPos:Number(this.widgetWidth()),height=this.widgetHeight()===""?height-yPos:Number(this.widgetHeight());break;case"percent":xPos=this.widgetX()*width/100,yPos=this.widgetY()*height/100,width=this.widgetWidth()===""?width-xPos:Number(this.widgetWidth())*width/100,height=this.widgetHeight()===""?height-yPos:Number(this.widgetHeight())*height/100;break}element.style("opacity",this.opacity());const widgets=element.selectAll("#"+this._id+" > .placeholder").data(this.widget()?[this.widget()]:[],function(d){return d._id});widgets.enter().append("div").attr("class","placeholder").each(function(d){d.target(this)}).merge(widgets).style("left",xPos+"px").style("top",yPos+"px").style("width",width+"px").style("bottom",height+"px").each(function(d){d.resize({width,height})}),widgets.exit().each(function(d){d.target(null)}).remove()}exit(domNode,element){this.widget()&&this.widget().target(null),super.exit(domNode,element)}}AbsoluteSurface.prototype._class+=" layout_AbsoluteSurface",AbsoluteSurface.prototype.publish("units","percent","set","Units",["pixels","percent"]),AbsoluteSurface.prototype.publish("widgetX",0,"number","Widget XPos"),AbsoluteSurface.prototype.publish("widgetY",0,"number","Widget YPos"),AbsoluteSurface.prototype.publish("widgetWidth","100","string","Widget Width, omit for full"),AbsoluteSurface.prototype.publish("widgetHeight","100","string","Widget Height, omit for full"),AbsoluteSurface.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]}),AbsoluteSurface.prototype.publish("opacity",1,"number","Opacity");class Accordion extends common.HTMLWidget{constructor(){super(),__publicField2(this,"_isClosed"),__publicField2(this,"titleSpan"),__publicField2(this,"iconDiv"),__publicField2(this,"ul"),__publicField2(this,"icon"),this._tag="div",this._isClosed=!1}pushListItem(widget,prepend=!1,protect=!1){const contentArr=this.content();return widget._protected=protect,prepend?contentArr.unshift(widget):contentArr.push(widget),this.content(contentArr),this}clearListItems(){const arr=[];for(const i in this.content())this.content()[i]._protected&&arr.push(this.content()[i]);return this.content(arr),this}collapseClick(element){element.classed("closed")?(this._isClosed=!1,element.classed("open",!0),element.classed("closed",!1)):(this._isClosed=!0,element.classed("open",!1),element.classed("closed",!0))}enter(domNode,element){super.enter(domNode,element);const context=this;this._isClosed=this.defaultCollapsed(),element.classed(this._isClosed?"closed":"open",!0),this.titleSpan=element.append("span").classed("collapsible-title",!0),this.iconDiv=element.append("div").classed("collapsible-icon",!0),this.ul=element.append("ul"),this.icon=new common.FAChar().size({height:24,width:24}).target(this.iconDiv.node()),this.iconDiv.on("click",function(){context.collapseClick(element),context.render()}),this.titleSpan.on("click",function(){context.collapseClick(element),context.render()})}update(domNode,element){super.update(domNode,element);const context=this,this_id="";this.titleSpan.text(context.title().length>0?context.title()+this_id:"Accordion ["+context._id+"]"+this_id);const rows=this.ul.selectAll("#"+context._id+" > ul > li").data(this.content(),function(d){return d._id});rows.enter().append(function(widget){const li=document.createElement("li");if(widget._target===null){const wSize=widget.size();if(wSize.width===0||wSize.height===0){const cSize=context.size();widget.size({width:cSize.width,height:cSize.width})}widget.target(li)}else return widget._target;return li}),rows.exit().remove(),this.icon.text_colorFill(this.titleFontColor()).char(this._isClosed?this.closedIcon():this.openIcon()).render()}exit(domNode,element){super.exit(domNode,element)}}Accordion.prototype._class+=" layout_Accordion",Accordion.prototype.publish("content",[],"widgetArray","Array of widgets",null,{tags:["Basic"]}),Accordion.prototype.publish("title","","string","Title of collapsible section",null,{tags:["Private"]}),Accordion.prototype.publish("openIcon","","string","Icon to display when list is open",null,{tags:["Private"]}),Accordion.prototype.publish("closedIcon","","string","Icon to display when list is closed",null,{tags:["Private"]}),Accordion.prototype.publish("titleFontColor","#FFFFFF","html-color","Title font color",null,{tags:["Private"]}),Accordion.prototype.publish("titleBackgroundColor","#333333","html-color","Title background color",null,{tags:["Private"]}),Accordion.prototype.publish("defaultCollapsed",!1,"boolean","Collapsed by default if true",null,{tags:["Private"]});class Surface extends common.HTMLWidget{constructor(){super(),__publicField2(this,"_surfaceButtons"),this._tag="div",this._surfaceButtons=[]}widgetSize(titleDiv,widgetDiv){let width=this.clientWidth(),height=this.clientHeight();return this.title()&&(height-=this.calcHeight(titleDiv)),height-=this.calcFrameHeight(widgetDiv),width-=this.calcFrameWidth(widgetDiv),{width,height}}enter(domNode,element){super.enter(domNode,element)}update(domNode,element2){super.update(domNode,element2);const context=this;element2.classed("shadow2",this.surfaceShadow()).style("border-width",this.surfaceBorderWidth_exists()?this.surfaceBorderWidth()+"px":null).style("border-color",this.surfaceBorderColor()).style("border-radius",this.surfaceBorderRadius_exists()?this.surfaceBorderRadius()+"px":null).style("background-color",this.surfaceBackgroundColor());const titles=element2.selectAll(".surfaceTitle").data(this.title()?[this.title()]:[]);titles.enter().insert("h3","div").attr("class","surfaceTitle").merge(titles).text(function(d){return d}).style("text-align",this.surfaceTitleAlignment()).style("color",this.surfaceTitleFontColor()).style("font-size",this.surfaceTitleFontSize_exists()?this.surfaceTitleFontSize()+"px":null).style("font-family",this.surfaceTitleFontFamily()).style("font-weight",this.surfaceTitleFontBold()?"bold":"normal").style("background-color",this.surfaceTitleBackgroundColor()).style("padding",this.surfaceTitlePadding_exists()?this.surfaceTitlePadding()+"px":null).style("title",this.altText_exists()?this.altText():null),titles.exit().remove();const surfaceButtons=element2.select(".surfaceTitle").append("div").attr("class","html-button-container").selectAll(".surface-button").data(this.buttonAnnotations());surfaceButtons.enter().append("button").classed("surface-button",!0).each(function(button,idx){const el=context._surfaceButtons[idx]=common.select(this).attr("class","surface-button"+(button.class?" "+button.class:"")).attr("id",button.id).style("padding",button.padding).style("width",button.width).style("height",button.height).style("cursor","pointer");button.font==="FontAwesome"?el.style("background","transparent").style("border","none").on("click",function(d){context.click(d)}).append("i").attr("class","fa").text(function(){return button.label}):el.text(function(){return button.label}).on("click",function(d){context.click(d)})}),surfaceButtons.exit().each(function(_d,idx){const element=common.select(this);delete context._surfaceButtons[idx],element.remove()});const widgets=element2.selectAll("#"+this._id+" > .surfaceWidget").data(this.widget()?[this.widget()]:[],function(d){return d._id});widgets.enter().append("div").attr("class","surfaceWidget").each(function(d){common.select(context.element().node().parentElement).classed("content-icon content-icon-"+d.classID().split("_")[1],!0),d.target(this)}).merge(widgets).style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null).each(function(d){const widgetSize=context.widgetSize(element2.select("h3"),common.select(this));widgetSize.width<0&&(widgetSize.width=0),widgetSize.height<0&&(widgetSize.height=0),d.resize({width:widgetSize.width,height:widgetSize.height})}),widgets.exit().each(function(d){d.target(null)}).remove()}exit(domNode,element){this.widget()&&this.widget().target(null),super.exit(domNode,element)}click(obj){}}Surface.prototype._class+=" layout_Surface",Surface.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),Surface.prototype.publish("altText",null,"string","Alt text",null,{optional:!0}),Surface.prototype.publish("surfaceTitlePadding",null,"number","Title Padding (px)",null,{tags:["Advanced"],disable:w=>!w.title()}),Surface.prototype.publish("surfaceTitleFontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],disable:w=>!w.title()}),Surface.prototype.publish("surfaceTitleFontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],disable:w=>!w.title()}),Surface.prototype.publish("surfaceTitleFontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],disable:w=>!w.title()}),Surface.prototype.publish("surfaceTitleFontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],disable:w=>!w.title()}),Surface.prototype.publish("surfaceTitleBackgroundColor",null,"html-color","Title Background Color",null,{tags:["Advanced"],disable:w=>!w.title()}),Surface.prototype.publish("surfaceTitleAlignment","center","set","Title Alignment",["left","right","center"],{tags:["Basic"],disable:w=>!w.title()}),Surface.prototype.publish("surfaceShadow",!1,"boolean","3D Shadow"),Surface.prototype.publish("surfacePadding",null,"string","Surface Padding (px)",null,{tags:["Intermediate"]}),Surface.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),Surface.prototype.publish("surfaceBorderWidth",null,"number","Surface Border Width (px)",null,{tags:["Advanced"]}),Surface.prototype.publish("surfaceBorderColor",null,"html-color","Surface Border Color",null,{tags:["Advanced"]}),Surface.prototype.publish("surfaceBorderRadius",null,"number","Surface Border Radius (px)",null,{tags:["Advanced"]}),Surface.prototype.publish("buttonAnnotations",[],"array","Button Array",null,{tags:["Private"]}),Surface.prototype.publish("widget",null,"widget","Widget",null,{tags:["Basic"]});class Cell extends Surface{constructor(){super(),__publicField2(this,"_indicateTheseIds"),this._indicateTheseIds=[]}indicateTheseIds(_){return arguments.length?(this._indicateTheseIds=_,this):this._indicateTheseIds}enter(domNode,element){super.enter(domNode,element);const context=this;element.classed("layout_Surface",!0).on("mouseenter",function(){context.onMouseEnter()}).on("mouseleave",function(){context.onMouseLeave()})}update(domNode,element){super.update(domNode,element)}onMouseEnter(){const arr=this.indicateTheseIds(),opacity=this.indicatorOpacity(),indicatorBorderColor=this.indicatorBorderColor(),indicatorGlowColor=this.indicatorGlowColor();for(let i=0;i<arr.length;i++){const otherElement=common.select("#"+arr[i]),otherWidget=otherElement.datum();otherElement&&otherWidget&&otherElement.append("div").attr("class","update-indicator").style("width",otherWidget.width()+"px").style("height",otherWidget.height()+"px").style("opacity",opacity).style("border-color",indicatorBorderColor).style("-webkit-box-shadow","inset 0px 0px 30px 0px "+indicatorGlowColor).style("-moz-box-shadow","inset 0px 0px 30px 0px "+indicatorGlowColor).style("box-shadow","inset 0px 0px 30px 0px "+indicatorGlowColor)}}onMouseLeave(){const arr=this.indicateTheseIds();for(let i=0;i<arr.length;i++)common.selectAll("#"+arr[i]+" > div.update-indicator").remove()}}Cell.prototype._class+=" layout_Cell",Cell.prototype.publish("gridRow",0,"number","Grid Row Position",null,{tags:["Private"]}),Cell.prototype.publish("gridCol",0,"number","Grid Column Position",null,{tags:["Private"]}),Cell.prototype.publish("gridRowSpan",1,"number","Grid Row Span",null,{tags:["Private"]}),Cell.prototype.publish("gridColSpan",1,"number","Grid Column Span",null,{tags:["Private"]}),Cell.prototype.publish("indicatorGlowColor","#EEEE11","html-color","Glow color of update-indicator",null,{tags:["Basic"]}),Cell.prototype.publish("indicatorBorderColor","#F48A00","html-color","Border color of update-indicator",null,{tags:["Basic"]}),Cell.prototype.publish("indicatorOpacity",.8,"number","Opacity of update-indicator",null,{tags:["Basic"]});class Border extends common.HTMLWidget{constructor(){super(),__publicField2(this,"_colCount"),__publicField2(this,"_rowCount"),__publicField2(this,"_colSize"),__publicField2(this,"_rowSize"),__publicField2(this,"_shrinkWrapBoxes"),__publicField2(this,"_watch"),__publicField2(this,"_offsetX"),__publicField2(this,"_offsetY"),__publicField2(this,"_dragCell"),__publicField2(this,"_dragCellSize"),__publicField2(this,"_dragCellStartSize"),__publicField2(this,"_handleTop"),__publicField2(this,"_handleLeft"),__publicField2(this,"_dragPrevX"),__publicField2(this,"_dragPrevY"),__publicField2(this,"_cellSizes"),__publicField2(this,"contentDiv"),__publicField2(this,"_scrollBarWidth"),__publicField2(this,"_borderHandles"),__publicField2(this,"_sectionTypeArr"),__publicField2(this,"lazyPostUpdate",common.Utility.debounce(function(){this.postUpdate()},100)),this._tag="div",this._colCount=0,this._rowCount=0,this._colSize=0,this._rowSize=0,this._shrinkWrapBoxes={},this.content([]),this.sectionTypes([])}watchWidget(widget){if(this._watch===void 0&&(this._watch={}),this._watch[widget.id()]&&(this._watch[widget.id()].remove(),delete this._watch[widget.id()]),widget){const context=this;this._watch[widget.id()]=widget.monitor(function(paramId,newVal,oldVal){oldVal!==newVal&&context.lazyPostUpdate()})}}applyLayoutType(){const layoutObj=this.borderLayoutObject();this.content().forEach(function(cell,i){cell._fixedLeft=layoutObj[this.sectionTypes()[i]].left,cell._fixedTop=layoutObj[this.sectionTypes()[i]].top,cell._fixedWidth=layoutObj[this.sectionTypes()[i]].width,cell._fixedHeight=layoutObj[this.sectionTypes()[i]].height,cell._dragHandles=this.cellSpecificDragHandles(this.sectionTypes()[i])},this)}cellSpecificDragHandles(sectionType){switch(sectionType){case"top":return["s"];case"right":return["w"];case"bottom":return["n"];case"left":return["e"];case"center":return[]}}borderLayoutObject(layoutType){const retObj={},context=this;let topSize,topPerc,bottomSize,bottomPerc,leftSize,leftPerc,rightSize,rightPerc;const bcRect=this.target().getBoundingClientRect();bcRect.top,bcRect.left,bcRect.bottom,bcRect.right,this.target()instanceof SVGElement?(parseFloat(this.target().getAttribute("width")),parseFloat(this.target().getAttribute("height"))):(bcRect.width,bcRect.height),this.sectionTypes().indexOf("top")!==-1&&(topSize=this.topSize(),topPerc=this.topPercentage(),typeof this._shrinkWrapBoxes.top<"u"&&(topSize=this._shrinkWrapBoxes.top.height+this.gutter(),topPerc=0)),this.sectionTypes().indexOf("bottom")!==-1&&(bottomSize=this.bottomSize(),bottomPerc=this.bottomPercentage(),typeof this._shrinkWrapBoxes.bottom<"u"&&(bottomSize=this._shrinkWrapBoxes.bottom.height+this.gutter(),bottomPerc=0)),this.sectionTypes().indexOf("left")!==-1&&(leftSize=this.leftSize(),leftPerc=this.leftPercentage(),typeof this._shrinkWrapBoxes.left<"u"&&(leftSize=this._shrinkWrapBoxes.left.width+this.gutter(),leftPerc=0)),this.sectionTypes().indexOf("right")!==-1&&(rightSize=this.rightSize(),rightPerc=this.rightPercentage(),typeof this._shrinkWrapBoxes.right<"u"&&(rightSize=this._shrinkWrapBoxes.right.width+this.gutter(),rightPerc=0));const t=_sectionPlacementObject({width:{px:0,"%":100},height:{px:topSize,"%":topPerc},top:{px:0,"%":0},left:{px:0,"%":0}}),b=_sectionPlacementObject({width:{px:0,"%":100},height:{px:bottomSize,"%":bottomPerc},top:{px:0,"%":100},left:{px:0,"%":0}});b.top-=b.height;const l=_sectionPlacementObject({width:{px:leftSize,"%":leftPerc},height:{px:-t.height-b.height,"%":100},top:{px:t.height,"%":0},left:{px:0,"%":0}}),r=_sectionPlacementObject({width:{px:rightSize,"%":rightPerc},height:{px:-t.height-b.height,"%":100},top:{px:t.height,"%":0},left:{px:0,"%":100}});r.left-=r.width;const c2=_sectionPlacementObject({width:{px:-r.width-l.width,"%":100},height:{px:-t.height-b.height,"%":100},top:{px:t.height,"%":0},left:{px:l.width,"%":0}});return retObj.top=t,retObj.bottom=b,retObj.right=r,retObj.left=l,retObj.center=c2,retObj;function _sectionPlacementObject(obj){return obj.width.px=typeof obj.width.px<"u"?obj.width.px:0,obj.width["%"]=typeof obj.width["%"]<"u"?obj.width["%"]:0,obj.height.px=typeof obj.height.px<"u"?obj.height.px:0,obj.height["%"]=typeof obj.height["%"]<"u"?obj.height["%"]:0,{width:obj.width.px+obj.width["%"]/100*context.width(),height:obj.height.px+obj.height["%"]/100*context.height(),top:obj.top.px+obj.top["%"]/100*context.height()+context.gutter()/2,left:obj.left.px+obj.left["%"]/100*context.width()+context.gutter()/2}}}clearContent(sectionType){if(!sectionType)this.content().forEach(function(contentWidget){return contentWidget.target(null),!1}),common.select("#"+this.id()+" > div.borderHandle").classed("borderHandleDisabled",!0),delete this._watch,this.content([]),this.sectionTypes([]);else{const idx=this.sectionTypes().indexOf(sectionType);idx>=0&&(this._watch&&this.content()[idx]&&delete this._watch[this.content()[idx].id()],this.content()[idx].target(null),common.select("#"+this.id()+" > div.borderHandle_"+sectionType).classed("borderHandleDisabled",!0),this.content().splice(idx,1),this.sectionTypes().splice(idx,1))}}hasContent(sectionType,widget,title){return this.sectionTypes().indexOf(sectionType)>=0}setContent(sectionType,widget,title){if(this.clearContent(sectionType),title=typeof title<"u"?title:"",widget){const cell=new Cell().surfaceBorderWidth(0).widget(widget).title(title);this.watchWidget(widget),this.content().push(cell),this.sectionTypes().push(sectionType)}return this}getCell(id){const idx=this.sectionTypes().indexOf(id);return idx>=0?this.content()[idx]:null}getContent(id){const idx=this.sectionTypes().indexOf(id);return idx>=0?this.content()[idx].widget():null}setLayoutOffsets(){this._offsetX=this._element.node().getBoundingClientRect().left+this.gutter()/2,this._offsetY=this._element.node().getBoundingClientRect().top+this.gutter()/2}dragStart(handle){const event=common.d3Event();event.sourceEvent.stopPropagation();const context=this;this._dragCell=handle,this._dragCellStartSize=this[handle+"Size"](),this[handle+"ShrinkWrap"]()&&(this[handle+"Percentage"](0),this[handle+"ShrinkWrap"](!1));const handleElm=common.select("#"+context.id()+" > div.borderHandle_"+handle);context._handleTop=parseFloat(handleElm.style("top").split("px")[0]),context._handleLeft=parseFloat(handleElm.style("left").split("px")[0]),this._dragPrevX=event.sourceEvent.clientX,this._dragPrevY=event.sourceEvent.clientY}dragTick(handle){const context=this,event=common.d3Event(),xDelta=this._dragPrevX-event.sourceEvent.clientX,yDelta=this._dragPrevY-event.sourceEvent.clientY;switch(handle){case"top":case"bottom":_moveHandles(handle,yDelta);break;case"right":case"left":_moveHandles(handle,xDelta);break}function _moveHandles(handle2,delta){if(delta===0)return;const handles=common.selectAll("#"+context.id()+" > div.borderHandle"),grabbedHandle=common.select("#"+context.id()+" > div.borderHandle_"+handle2);grabbedHandle.classed("borderHandle_top")?(grabbedHandle.style("top",context._handleTop-delta+"px"),context._cellSizes.topHeight=context._handleTop-delta,context._cellSizes.leftHeight=context._cellSizes.height,context._cellSizes.leftHeight-=context._cellSizes.topHeight,context._cellSizes.leftHeight-=context._cellSizes.bottomHeight,context._cellSizes.rightHeight=context._cellSizes.leftHeight):grabbedHandle.classed("borderHandle_right")?(grabbedHandle.style("left",context._handleLeft-delta+"px"),context._cellSizes.rightWidth=context._cellSizes.width-context._handleLeft+delta):grabbedHandle.classed("borderHandle_bottom")?(grabbedHandle.style("top",context._handleTop-delta+"px"),context._cellSizes.bottomHeight=context._cellSizes.height-context._handleTop+delta,context._cellSizes.leftHeight=context._cellSizes.height,context._cellSizes.leftHeight-=context._cellSizes.bottomHeight,context._cellSizes.leftHeight-=context._cellSizes.topHeight,context._cellSizes.rightHeight=context._cellSizes.leftHeight):grabbedHandle.classed("borderHandle_left")&&(grabbedHandle.style("left",context._handleLeft-delta+"px"),context._cellSizes.leftWidth=context._handleLeft-delta),handles.each(function(){const handle3=common.select(this);handle3.classed("borderHandle_top")?(handle3.style("width",context._cellSizes.width+"px"),handle3.style("top",context._cellSizes.topHeight-3+"px")):handle3.classed("borderHandle_right")?(handle3.style("left",context._cellSizes.width-context._cellSizes.rightWidth+"px"),handle3.style("top",context._cellSizes.topHeight+3+"px"),handle3.style("height",context._cellSizes.rightHeight+"px")):handle3.classed("borderHandle_bottom")?(handle3.style("width",context._cellSizes.width+"px"),handle3.style("top",context._cellSizes.height-context._cellSizes.bottomHeight-3+"px")):handle3.classed("borderHandle_left")&&(handle3.style("left",context._cellSizes.leftWidth+"px"),handle3.style("height",context._cellSizes.leftHeight+"px"),handle3.style("top",context._cellSizes.topHeight+3+"px"))})}}dragEnd(handle){if(handle){const event=common.d3Event(),xDelta=this._dragPrevX-event.sourceEvent.clientX,yDelta=this._dragPrevY-event.sourceEvent.clientY;switch(handle){case"top":yDelta!==0&&(this.topPercentage(0),this.topSize(this.topSize()===0?this.getContent("top").getBBox().height-yDelta:this.topSize()-yDelta));break;case"right":xDelta!==0&&(this.rightPercentage(0),this.rightSize(this.rightSize()===0?this.getContent("right").getBBox().width+xDelta:this.rightSize()+xDelta));break;case"bottom":yDelta!==0&&(this.bottomPercentage(0),this.bottomSize(this.bottomSize()===0?this.getContent("bottom").getBBox().height+yDelta:this.bottomSize()+yDelta));break;case"left":xDelta!==0&&(this.leftPercentage(0),this.leftSize(this.leftSize()===0?this.getContent("left").getBBox().width-xDelta:this.leftSize()-xDelta));break}this._dragPrevX=event.sourceEvent.clientX,this._dragPrevY=event.sourceEvent.clientY}this.render()}size(_){const retVal=common.HTMLWidget.prototype.size.apply(this,arguments);return arguments.length&&this.contentDiv&&this.contentDiv.style("width",this._size.width+"px").style("height",this._size.height+"px"),retVal}enter(domNode,element){super.enter(domNode,element);const context=this;element.style("position","relative"),this.contentDiv=element.append("div").classed("border-content",!0),this._scrollBarWidth=common.Platform.getScrollbarWidth(),this._borderHandles=["top","left","right","bottom"],element.selectAll("div.borderHandle").data(this._borderHandles).enter().append("div").classed("borderHandle",!0).each(function(handle){common.select(this).classed("borderHandle_"+handle,!0).classed("borderHandleDisabled",context.getContent(handle)===null)})}update(domNode,element){super.update(domNode,element),this._sectionTypeArr=this.sectionTypes();const context=this;element.classed("design-mode",this.designMode()),this.setLayoutOffsets();const rows=this.contentDiv.selectAll(".cell_"+this._id).data(this.content(),function(d){return d._id}),rowsUpdate=rows.enter().append("div").classed("cell_"+this._id,!0).style("position","absolute").each(function(d,i){common.select(this).classed("border-cell border-cell-"+context._sectionTypeArr[i],!0),d.target(this),common.select("#"+context.id()+" > div.borderHandle_"+context._sectionTypeArr[i]).classed("borderHandleDisabled",!1)}).merge(rows);rowsUpdate.each(function(d,idx){const sectionType=context.sectionTypes()[idx];typeof context[sectionType+"ShrinkWrap"]<"u"&&context[sectionType+"ShrinkWrap"]()?(d.render(),context._shrinkWrapBoxes[sectionType]=d.widget().getBBox(!0)):delete context._shrinkWrapBoxes[sectionType]});const drag$1=common.drag().on("start",function(d,i){context.dragStart.call(context,d,i)}).on("drag",function(d,i){context.dragTick.call(context,d,i)}).on("end",function(d,i){context.dragEnd.call(context,d,i)});this.designMode()?element.selectAll("#"+this.id()+" > div.borderHandle").call(drag$1):element.selectAll("#"+this.id()+" > div.borderHandle").on(".drag",null);const layoutObj=this.borderLayoutObject();this.content().forEach(function(cell,i){cell._fixedLeft=layoutObj[this.sectionTypes()[i]].left,cell._fixedTop=layoutObj[this.sectionTypes()[i]].top,cell._fixedWidth=layoutObj[this.sectionTypes()[i]].width,cell._fixedHeight=layoutObj[this.sectionTypes()[i]].height,cell._dragHandles=[]},this),rowsUpdate.style("left",function(d){return d._fixedLeft+"px"}).style("top",function(d){return d._fixedTop+"px"}).style("width",function(d){return d._fixedWidth-context.gutter()+"px"}).style("height",function(d){return d._fixedHeight-context.gutter()+"px"}).each(function(d){d._placeholderElement.attr("draggable",context.designMode()).selectAll(".dragHandle").attr("draggable",context.designMode()),d.surfacePadding(context.surfacePadding()).resize()}),rows.exit().each(function(d){d.target(null)}).remove(),this.getCellSizes(),element.selectAll("#"+this.id()+" > div.borderHandle").each(function(){const handle=common.select(this);handle.classed("borderHandle_top")?(handle.style("width",context._cellSizes.width+"px"),handle.style("top",context._cellSizes.topHeight-3+"px")):handle.classed("borderHandle_right")?(handle.style("left",context._cellSizes.width-context._cellSizes.rightWidth+"px"),handle.style("top",context._cellSizes.topHeight+3+"px"),handle.style("height",context._cellSizes.rightHeight+"px")):handle.classed("borderHandle_bottom")?(handle.style("width",context._cellSizes.width+"px"),handle.style("top",context._cellSizes.height-context._cellSizes.bottomHeight-3+"px")):handle.classed("borderHandle_left")&&(handle.style("left",context._cellSizes.leftWidth+"px"),handle.style("height",context._cellSizes.leftHeight+"px"),handle.style("top",context._cellSizes.topHeight+3+"px"))})}getCellSizes(){const context=this;context._cellSizes={};const contentRect=this.element().node().getBoundingClientRect();context._cellSizes.width=contentRect.width,context._cellSizes.height=contentRect.height,this.element().selectAll("#"+this.id()+" > div > div.border-cell").each(function(){const cell=common.select(this);if(typeof cell.node=="function"){const rect=cell.node().getBoundingClientRect();cell.classed("border-cell-top")?context._cellSizes.topHeight=rect.height:cell.classed("border-cell-left")?(context._cellSizes.leftWidth=rect.width,context._cellSizes.leftHeight=rect.height):cell.classed("border-cell-right")?(context._cellSizes.rightWidth=rect.width,context._cellSizes.rightHeight=rect.height):cell.classed("border-cell-bottom")&&(context._cellSizes.bottomHeight=rect.height)}}),["height","width","topHeight","bottomHeight","leftHeight","rightHeight","leftWidth","rightWidth"].forEach(function(size){context._cellSizes[size]=context._cellSizes[size]===void 0?0:context._cellSizes[size]})}postUpdate(domNode,element){const context=this;this.content().forEach(function(n){if(n._element.node()!==null&&n.widget()){const prevBox=n.widget().getBBox(!1,!0),currBox=n.widget().getBBox(!0,!0);(prevBox.width!==currBox.width||prevBox.height!==currBox.height)&&context.lazyRender()}})}exit(domNode,element){this.content().forEach(w=>w.target(null)),super.exit(domNode,element)}}Border.prototype._class+=" layout_Border",Border.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),Border.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Intermediate"]}),Border.prototype.publish("gutter",0,"number","Gap Between Widgets",null,{tags:["Basic"]}),Border.prototype.publish("topShrinkWrap",!1,"boolean","'Top' Cell shrinks to fit content",null,{tags:["Intermediate"]}),Border.prototype.publish("leftShrinkWrap",!1,"boolean","'Left' Cell shrinks to fit content",null,{tags:["Intermediate"]}),Border.prototype.publish("rightShrinkWrap",!1,"boolean","'Right' Cell shrinks to fit content",null,{tags:["Intermediate"]}),Border.prototype.publish("bottomShrinkWrap",!1,"boolean","'Bottom' Cell shrinks to fit content",null,{tags:["Intermediate"]}),Border.prototype.publish("topSize",0,"number","Height of the 'Top' Cell (px)",null,{tags:["Private"]}),Border.prototype.publish("leftSize",0,"number","Width of the 'Left' Cell (px)",null,{tags:["Private"]}),Border.prototype.publish("rightSize",0,"number","Width of the 'Right' Cell (px)",null,{tags:["Private"]}),Border.prototype.publish("bottomSize",0,"number","Height of the 'Bottom' Cell (px)",null,{tags:["Private"]}),Border.prototype.publish("topPercentage",20,"number","Percentage (of parent) Height of the 'Top' Cell",null,{tags:["Private"]}),Border.prototype.publish("leftPercentage",20,"number","Percentage (of parent) Width of the 'Left' Cell",null,{tags:["Private"]}),Border.prototype.publish("rightPercentage",20,"number","Percentage (of parent) Width of the 'Right' Cell",null,{tags:["Private"]}),Border.prototype.publish("bottomPercentage",20,"number","Percentage (of parent) Height of the 'Bottom' Cell",null,{tags:["Private"]}),Border.prototype.publish("surfacePadding",0,"number","Cell Padding (px)",null,{tags:["Intermediate"]}),Border.prototype.publish("sectionTypes",[],"array","Section Types sharing an index with 'content' - Used to determine position/size.",null,{tags:["Private"]});class WidgetDiv{constructor(div){__publicField2(this,"_div"),__publicField2(this,"_overlay",!1),__publicField2(this,"_overflowX","visible"),__publicField2(this,"_overflowY","visible"),__publicField2(this,"_widget"),this._div=div}overlay(_){return arguments.length?(this._overlay=_,this):this._overlay}overflowX(_){return arguments.length?(this._overflowX=_,this._div.style("overflow-x",_),this):this._overflowX}overflowY(_){return arguments.length?(this._overflowY=_,this._div.style("overflow-y",_),this):this._overflowY}element(){return this._div}node(){return this._div.node()}widget(_){return arguments.length?(this._widget!==_&&(this._widget&&this._widget.target(null),this._widget=_,this._widget&&this._widget.target(this._div.node())),this):this._widget}resize(size){return this._widget&&(this._div.style("width",`${size.width}px`).style("height",`${size.height}px`),this._widget.resize(size)),this}async render(getBBox,availableHeight,availableWidth){let overflowX=this.overflowX();!this.overlay()&&overflowX==="visible"&&(overflowX=null);let overflowY=this.overflowY();return!this.overlay()&&overflowY==="visible"&&(overflowY=null),this._div.style("height",this.overlay()?"0px":null).style("overflow-x",overflowX).style("overflow-y",overflowY),this._widget?this._widget.renderPromise().then(w=>{if(getBBox&&this._widget.visible()){const retVal=this._widget.getBBox();return retVal.width+=8,availableHeight!==void 0&&retVal.height>availableHeight&&(retVal.width+=common.Platform.getScrollbarWidth()),availableWidth!==void 0&&retVal.width>availableWidth&&(retVal.height+=common.Platform.getScrollbarWidth()),this.overlay()?retVal.height=0:retVal.height+=4,retVal}return getBBox?{x:0,y:0,width:0,height:0}:void 0}):Promise.resolve(getBBox?{x:0,y:0,width:0,height:0}:void 0)}}class Border2 extends common.HTMLWidget{constructor(){super(),__publicField2(this,"_bodyElement"),__publicField2(this,"_topWA"),__publicField2(this,"_leftWA"),__publicField2(this,"_centerWA"),__publicField2(this,"_rightWA"),__publicField2(this,"_bottomWA"),__publicField2(this,"_topPrevOverflow"),__publicField2(this,"_leftPrevOverflow"),__publicField2(this,"_rightPrevOverflow"),__publicField2(this,"_bottomPrevOverflow"),this._tag="div"}enter(domNode,element){super.enter(domNode,element);const topElement=element.append("header");this._bodyElement=element.append("div").attr("class","body");const centerElement=this._bodyElement.append("div").attr("class","center"),leftElement=this._bodyElement.append("div").attr("class","lhs"),rightElement=this._bodyElement.append("div").attr("class","rhs"),bottomElement=element.append("div").attr("class","footer");this._topWA=new WidgetDiv(topElement),this._centerWA=new WidgetDiv(centerElement),this._leftWA=new WidgetDiv(leftElement),this._rightWA=new WidgetDiv(rightElement),this._bottomWA=new WidgetDiv(bottomElement)}update(domNode,element){super.update(domNode,element),this._topWA.element().style("display",this.showTop()?null:"none"),this._rightWA.element().style("display",this.showRight()?null:"none"),this._bottomWA.element().style("display",this.showBottom()?null:"none"),this._leftWA.element().style("display",this.showLeft()?null:"none"),this.topOverflowX()!==this._topWA.overflowX()&&this._topWA.overflowX(this.topOverflowX()),this.rightOverflowX()!==this._rightWA.overflowX()&&this._rightWA.overflowX(this.rightOverflowX()),this.bottomOverflowX()!==this._bottomWA.overflowX()&&this._bottomWA.overflowX(this.bottomOverflowX()),this.leftOverflowX()!==this._leftWA.overflowX()&&this._leftWA.overflowX(this.leftOverflowX()),this.topOverflowY()!==this._topWA.overflowY()&&this._topWA.overflowY(this.topOverflowY()),this.rightOverflowY()!==this._rightWA.overflowY()&&this._rightWA.overflowY(this.rightOverflowY()),this.bottomOverflowY()!==this._bottomWA.overflowY()&&this._bottomWA.overflowY(this.bottomOverflowY()),this.leftOverflowY()!==this._leftWA.overflowY()&&this._leftWA.overflowY(this.leftOverflowY()),this.element().style("width",`${this.width()}px`).style("height",`${this.height()}px`)}targetNull(w){w&&w.target(null)}exit(domNode,element){this.targetNull(this.center()),this.targetNull(this.bottom()),this.targetNull(this.right()),this.targetNull(this.left()),this.targetNull(this.top()),super.exit(domNode,element)}swap(sectionA,sectionB){const a2=this[sectionA](),b=this[sectionB]();return this.targetNull(a2),this.targetNull(b),this[`_${sectionA}WA`].widget(null),this[`_${sectionB}WA`].widget(null),this[sectionA](b),this[sectionB](a2),this}render(callback){return super.render(w=>{this._topWA?this._topWA.widget(this.top()).overlay(this.topOverlay()).render(!0).then(async topBBox=>{const bottomBBox=await this._bottomWA.widget(this.bottom()).render(!0,void 0,this.width()),availableHeight=this.height()-(topBBox.height+bottomBBox.height),leftBBox=await this._leftWA.widget(this.left()).render(!0,availableHeight),rightBBox=await this._rightWA.widget(this.right()).render(!0,availableHeight);this.bottomHeight_exists()&&(bottomBBox.height=this.bottomHeight());const bodyWidth=this.width()-(leftBBox.width+rightBBox.width),bodyHeight=this.height()-(topBBox.height+bottomBBox.height),centerOverflowX=this.centerOverflowX(),centerOverflowY=this.centerOverflowY(),scrollCenterX=["auto","scroll"].indexOf(centerOverflowX)!==-1,scrollCenterY=["auto","scroll"].indexOf(centerOverflowY)!==-1;(scrollCenterX||scrollCenterY)&&this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:bodyWidth,height:bodyHeight}).render(),this._bodyElement.style("height",`${bodyHeight}px`);const promises=[this._topWA.overflowX(this.topOverflowX()).overflowY(this.topOverflowY()).resize({width:this.width(),height:topBBox.height}).render(),this._leftWA.overflowX(this.leftOverflowX()).overflowY(this.leftOverflowY()).resize({width:leftBBox.width,height:bodyHeight}).render(),this._rightWA.overflowX(this.rightOverflowX()).overflowY(this.rightOverflowY()).resize({width:rightBBox.width,height:bodyHeight}).render(),this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:bodyWidth,height:bodyHeight}).render(),this._bottomWA.overflowX(this.bottomOverflowX()).overflowY(this.bottomOverflowY()).resize({width:this.width(),height:bottomBBox.height}).render()];Promise.all(promises).then(promises2=>{callback&&callback(this)})}):callback&&callback(this)})}}Border2.prototype._class+=" layout_Border2",Border2.prototype.publish("showTop",!0,"boolean","If true, top widget adapter will display"),Border2.prototype.publish("showRight",!0,"boolean","If true, right widget adapter will display"),Border2.prototype.publish("showBottom",!0,"boolean","If true, bottom widget adapter will display"),Border2.prototype.publish("showLeft",!0,"boolean","If true, left widget adapter will display"),Border2.prototype.publish("topOverflowX","visible","set","Sets the overflow-x css style for the top widget adapter",["hidden","scroll","visible","auto"]),Border2.prototype.publish("rightOverflowX","visible","set","Sets the overflow-x css style for the right widget adapter",["hidden","scroll","visible","auto"]),Border2.prototype.publish("bottomOverflowX","visible","set","Sets the overflow-x css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),Border2.prototype.publish("leftOverflowX","visible","set","Sets the overflow-x css style for the left widget adapter",["hidden","scroll","visible","auto"]),Border2.prototype.publish("centerOverflowX","visible","set","Sets the overflow-x css style for the center widget adapter",["hidden","scroll","visible","auto"]),Border2.prototype.publish("topOverflowY","visible","set","Sets the overflow-y css style for the top widget adapter",["hidden","scroll","visible","auto"]),Border2.prototype.publish("rightOverflowY","visible","set","Sets the overflow-y css style for the right widget adapter",["hidden","scroll","visible","auto"]),Border2.prototype.publish("bottomOverflowY","visible","set","Sets the overflow-y css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),Border2.prototype.publish("leftOverflowY","visible","set","Sets the overflow-y css style for the left widget adapter",["hidden","scroll","visible","auto"]),Border2.prototype.publish("centerOverflowY","visible","set","Sets the overflow-y css style for the center widget adapter",["hidden","scroll","visible","auto"]),Border2.prototype.publish("top",null,"widget","Top Widget",void 0,{render:!1}),Border2.prototype.publish("topOverlay",!1,"boolean","Overlay Top Widget"),Border2.prototype.publish("left",null,"widget","Left Widget",void 0,{render:!1}),Border2.prototype.publish("center",null,"widget","Center Widget",void 0,{render:!1}),Border2.prototype.publish("right",null,"widget","Right Widget",void 0,{render:!1}),Border2.prototype.publish("bottom",null,"widget","Bottom Widget",void 0,{render:!1}),Border2.prototype.publish("bottomHeight",null,"number","Bottom Fixed Height",void 0,{optional:!0});class Carousel extends common.HTMLWidget{constructor(){super(...arguments),__publicField2(this,"_prevActive",0),__publicField2(this,"_root")}activeWidget(){return this.widgets()[this.active()]}enter(domNode,element){super.enter(domNode,element),this._root=element.append("div").attr("id",`${this.id()}_root`)}update(domNode,element){super.update(domNode,element);const active=this.active(),width=this.width();this._root.style("width",`${width}px`).style("height",`${this.height()}px`);const widgetElements=this._root.selectAll(`#${this.id()}_root > .carouselItem`).data(this.widgets(),d=>d.id()),update=widgetElements.enter().append("div").attr("class","carouselItem").each(function(w){w.target(this)}).merge(widgetElements).style("left",(d,i)=>`${(i-this._prevActive)*width}px`).style("width",`${width}px`);this._prevActive!==active&&(update.style("display",(d,i)=>i===this._prevActive||i===active?null:"none").transition().duration(this.transitionDuration()).style("left",(d,i)=>`${(i-active)*width}px`).on("end",function(d,i){common.select(this).style("display",()=>i===active?null:"none")}),this._prevActive=active),widgetElements.exit().each(function(w){w.target(null)}).remove()}exit(domNode,element){this.widgets().forEach(w=>w.target(null)),super.exit(domNode,element)}render(callback){return super.render(w=>{if(!this.visible()||this.isDOMHidden())callback&&callback(w);else{const aw=this.activeWidget();aw&&aw.resize(this.size()).render(w2=>{callback&&callback(w)})}})}}Carousel.prototype._class+=" layout_Carousel",Carousel.prototype.publish("widgets",[],"widgetArray","Widgets",null,{render:!1}),Carousel.prototype.publish("active",0,"number","Active widget"),Carousel.prototype.publish("transitionDuration",500,"number","Transition duration");var pi$1=Math.PI,tau$1=2*pi$1,epsilon=1e-6,tauEpsilon=tau$1-epsilon;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function path(){return new Path}Path.prototype=path.prototype={constructor:Path,moveTo:function(x,y){this._+="M"+(this._x0=this._x1=+x)+","+(this._y0=this._y1=+y)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(x,y){this._+="L"+(this._x1=+x)+","+(this._y1=+y)},quadraticCurveTo:function(x1,y1,x,y){this._+="Q"+ +x1+","+ +y1+","+(this._x1=+x)+","+(this._y1=+y)},bezierCurveTo:function(x1,y1,x2,y2,x,y){this._+="C"+ +x1+","+ +y1+","+ +x2+","+ +y2+","+(this._x1=+x)+","+(this._y1=+y)},arcTo:function(x1,y1,x2,y2,r){x1=+x1,y1=+y1,x2=+x2,y2=+y2,r=+r;var x0=this._x1,y0=this._y1,x21=x2-x1,y21=y2-y1,x01=x0-x1,y01=y0-y1,l01_2=x01*x01+y01*y01;if(r<0)throw new Error("negative radius: "+r);if(this._x1===null)this._+="M"+(this._x1=x1)+","+(this._y1=y1);else if(l01_2>epsilon)if(!(Math.abs(y01*x21-y21*x01)>epsilon)||!r)this._+="L"+(this._x1=x1)+","+(this._y1=y1);else{var x20=x2-x0,y20=y2-y0,l21_2=x21*x21+y21*y21,l20_2=x20*x20+y20*y20,l21=Math.sqrt(l21_2),l01=Math.sqrt(l01_2),l=r*Math.tan((pi$1-Math.acos((l21_2+l01_2-l20_2)/(2*l21*l01)))/2),t01=l/l01,t21=l/l21;Math.abs(t01-1)>epsilon&&(this._+="L"+(x1+t01*x01)+","+(y1+t01*y01)),this._+="A"+r+","+r+",0,0,"+ +(y01*x20>x01*y20)+","+(this._x1=x1+t21*x21)+","+(this._y1=y1+t21*y21)}},arc:function(x,y,r,a0,a1,ccw){x=+x,y=+y,r=+r,ccw=!!ccw;var dx=r*Math.cos(a0),dy=r*Math.sin(a0),x0=x+dx,y0=y+dy,cw=1^ccw,da=ccw?a0-a1:a1-a0;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+x0+","+y0:(Math.abs(this._x1-x0)>epsilon||Math.abs(this._y1-y0)>epsilon)&&(this._+="L"+x0+","+y0),r&&(da<0&&(da=da%tau$1+tau$1),da>tauEpsilon?this._+="A"+r+","+r+",0,1,"+cw+","+(x-dx)+","+(y-dy)+"A"+r+","+r+",0,1,"+cw+","+(this._x1=x0)+","+(this._y1=y0):da>epsilon&&(this._+="A"+r+","+r+",0,"+ +(da>=pi$1)+","+cw+","+(this._x1=x+r*Math.cos(a1))+","+(this._y1=y+r*Math.sin(a1))))},rect:function(x,y,w,h){this._+="M"+(this._x0=this._x1=+x)+","+(this._y0=this._y1=+y)+"h"+ +w+"v"+ +h+"h"+-w+"Z"},toString:function(){return this._}};function constant(x){return function(){return x}}var pi=Math.PI,tau=2*pi;const d3SymbolCircle={draw:function(context,size){var r=Math.sqrt(size/pi);context.moveTo(r,0),context.arc(0,0,r,0,tau)}},d3SymbolCross={draw:function(context,size){var r=Math.sqrt(size/5)/2;context.moveTo(-3*r,-r),context.lineTo(-r,-r),context.lineTo(-r,-3*r),context.lineTo(r,-3*r),context.lineTo(r,-r),context.lineTo(3*r,-r),context.lineTo(3*r,r),context.lineTo(r,r),context.lineTo(r,3*r),context.lineTo(-r,3*r),context.lineTo(-r,r),context.lineTo(-3*r,r),context.closePath()}};var tan30=Math.sqrt(1/3),tan30_2=tan30*2;const d3SymbolDiamond={draw:function(context,size){var y=Math.sqrt(size/tan30_2),x=y*tan30;context.moveTo(0,-y),context.lineTo(x,0),context.lineTo(0,y),context.lineTo(-x,0),context.closePath()}};var ka=.8908130915292852,kr=Math.sin(pi/10)/Math.sin(7*pi/10),kx=Math.sin(tau/10)*kr,ky=-Math.cos(tau/10)*kr;const d3SymbolStar={draw:function(context,size){var r=Math.sqrt(size*ka),x=kx*r,y=ky*r;context.moveTo(0,-r),context.lineTo(x,y);for(var i=1;i<5;++i){var a2=tau*i/5,c2=Math.cos(a2),s2=Math.sin(a2);context.lineTo(s2*r,-c2*r),context.lineTo(c2*x-s2*y,s2*x+c2*y)}context.closePath()}},d3SymbolSquare={draw:function(context,size){var w=Math.sqrt(size),x=-w/2;context.rect(x,x,w,w)}};var sqrt3=Math.sqrt(3);const d3SymbolTriangle={draw:function(context,size){var y=-Math.sqrt(size/(sqrt3*3));context.moveTo(0,y*2),context.lineTo(-sqrt3*y,-y),context.lineTo(sqrt3*y,-y),context.closePath()}};var c=-.5,s=Math.sqrt(3)/2,k=1/Math.sqrt(12),a=(k/2+1)*3;const d3SymbolWye={draw:function(context,size){var r=Math.sqrt(size/a),x0=r/2,y0=r*k,x1=x0,y1=r*k+r,x2=-x1,y2=y1;context.moveTo(x0,y0),context.lineTo(x1,y1),context.lineTo(x2,y2),context.lineTo(c*x0-s*y0,s*x0+c*y0),context.lineTo(c*x1-s*y1,s*x1+c*y1),context.lineTo(c*x2-s*y2,s*x2+c*y2),context.lineTo(c*x0+s*y0,c*y0-s*x0),context.lineTo(c*x1+s*y1,c*y1-s*x1),context.lineTo(c*x2+s*y2,c*y2-s*x2),context.closePath()}};function d3Symbol(){var type=constant(d3SymbolCircle),size=constant(64),context=null;function symbol(){var buffer;if(context||(context=buffer=path()),type.apply(this,arguments).draw(context,+size.apply(this,arguments)),buffer)return context=null,buffer+""||null}return symbol.type=function(_){return arguments.length?(type=typeof _=="function"?_:constant(_),symbol):type},symbol.size=function(_){return arguments.length?(size=typeof _=="function"?_:constant(+_),symbol):size},symbol.context=function(_){return arguments.length?(context=_??null,symbol):context},symbol}var _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol=="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},d3_identity=function(d){return d},d3_reverse=function(arr){for(var mirror=[],i=0,l=arr.length;i<l;i++)mirror[i]=arr[l-i-1];return mirror},d3_textWrapping=function(text,width){text.each(function(){var text2=common.select(this),words=text2.text().split(/\s+/).reverse(),word,line=[],lineHeight=1.2;text2.attr("y");for(var dy=parseFloat(text2.attr("dy"))||0,tspan=text2.text(null).append("tspan").attr("x",0).attr("dy",dy+"em");word=words.pop();)line.push(word),tspan.text(line.join(" ")),tspan.node().getComputedTextLength()>width&&line.length>1&&(line.pop(),tspan.text(line.join(" ")),line=[word],tspan=text2.append("tspan").attr("x",0).attr("dy",lineHeight+dy+"em").text(word))})},d3_mergeLabels=function(){var gen=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],labels=arguments[1],domain=arguments[2],range=arguments[3],labelDelimiter=arguments[4];if((typeof labels>"u"?"undefined":_typeof(labels))==="object"){if(labels.length===0)return gen;for(var i=labels.length;i<gen.length;i++)labels.push(gen[i]);return labels}else if(typeof labels=="function"){for(var customLabels=[],genLength=gen.length,_i=0;_i<genLength;_i++)customLabels.push(labels({i:_i,genLength,generatedLabels:gen,domain,range,labelDelimiter}));return customLabels}return gen},d3_linearLegend=function(scale,cells,labelFormat){var data=[];if(cells.length>1)data=cells;else for(var domain=scale.domain(),increment=(domain[domain.length-1]-domain[0])/(cells-1),i=0;i<cells;i++)data.push(domain[0]+i*increment);var labels=data.map(labelFormat);return{data,labels,feature:function(d){return scale(d)}}},d3_quantLegend=function(scale,labelFormat,labelDelimiter){var labels=scale.range().map(function(d){var invert=scale.invertExtent(d);return labelFormat(invert[0])+" "+labelDelimiter+" "+labelFormat(invert[1])});return{data:scale.range(),labels,feature:d3_identity}},d3_ordinalLegend=function(scale){return{data:scale.domain(),labels:scale.domain(),feature:function(d){return scale(d)}}},d3_cellOver=function(cellDispatcher,d,obj){cellDispatcher.call("cellover",obj,d)},d3_cellOut=function(cellDispatcher,d,obj){cellDispatcher.call("cellout",obj,d)},d3_cellClick=function(cellDispatcher,d,obj){cellDispatcher.call("cellclick",obj,d)},helper={d3_drawShapes:function(shape,shapes,shapeHeight,shapeWidth,shapeRadius,path2){shape==="rect"?shapes.attr("height",shapeHeight).attr("width",shapeWidth):shape==="circle"?shapes.attr("r",shapeRadius):shape==="line"?shapes.attr("x1",0).attr("x2",shapeWidth).attr("y1",0).attr("y2",0):shape==="path"&&shapes.attr("d",path2)},d3_addText:function(svg,enter,labels,classPrefix,labelWidth){enter.append("text").attr("class",classPrefix+"label");var text=svg.selectAll("g."+classPrefix+"cell text."+classPrefix+"label").data(labels).text(d3_identity);return labelWidth&&svg.selectAll("g."+classPrefix+"cell text."+classPrefix+"label").call(d3_textWrapping,labelWidth),text},d3_calcType:function(scale,ascending,cells,labels,labelFormat,labelDelimiter){var type=scale.invertExtent?d3_quantLegend(scale,labelFormat,labelDelimiter):scale.ticks?d3_linearLegend(scale,cells,labelFormat):d3_ordinalLegend(scale),range=scale.range&&scale.range()||scale.domain();return type.labels=d3_mergeLabels(type.labels,labels,scale.domain(),range,labelDelimiter),ascending&&(type.labels=d3_reverse(type.labels),type.data=d3_reverse(type.data)),type},d3_filterCells:function(type,cellFilter){var filterCells=type.data.map(function(d,i){return{data:d,label:type.labels[i]}}).filter(cellFilter),dataValues=filterCells.map(function(d){return d.data}),labelValues=filterCells.map(function(d){return d.label});return type.data=type.data.filter(function(d){return dataValues.indexOf(d)!==-1}),type.labels=type.labels.filter(function(d){return labelValues.indexOf(d)!==-1}),type},d3_placement:function(orient,cell,cellTrans,text,textTrans,labelAlign){cell.attr("transform",cellTrans),text.attr("transform",textTrans),orient==="horizontal"&&text.style("text-anchor",labelAlign)},d3_addEvents:function(cells,dispatcher){cells.on("mouseover.legend",function(d){d3_cellOver(dispatcher,d,this)}).on("mouseout.legend",function(d){d3_cellOut(dispatcher,d,this)}).on("click.legend",function(d){d3_cellClick(dispatcher,d,this)})},d3_title:function(svg,title,classPrefix,titleWidth){if(title!==""){var titleText=svg.selectAll("text."+classPrefix+"legendTitle");titleText.data([title]).enter().append("text").attr("class",classPrefix+"legendTitle"),svg.selectAll("text."+classPrefix+"legendTitle").text(title),titleWidth&&svg.selectAll("text."+classPrefix+"legendTitle").call(d3_textWrapping,titleWidth);var cellsSvg=svg.select("."+classPrefix+"legendCells"),yOffset=svg.select("."+classPrefix+"legendTitle").nodes().map(function(d){return d.getBBox().height})[0],xOffset=-cellsSvg.nodes().map(function(d){return d.getBBox().x})[0];cellsSvg.attr("transform","translate("+xOffset+","+yOffset+")")}},d3_defaultLocale:{format:common.format,formatPrefix:common.formatPrefix},d3_defaultFormatSpecifier:".01f",d3_defaultDelimiter:"to"};function color(){var scale=common.scaleLinear(),shape="rect",shapeWidth=15,shapeHeight=15,shapeRadius=10,shapePadding=2,cells=[5],cellFilter=void 0,labels=[],classPrefix="",useClass=!1,title="",locale=helper.d3_defaultLocale,specifier=helper.d3_defaultFormatSpecifier,labelOffset=10,labelAlign="middle",labelDelimiter=helper.d3_defaultDelimiter,labelWrap=void 0,orient="vertical",ascending=!1,path2=void 0,titleWidth=void 0,legendDispatcher=common.dispatch("cellover","cellout","cellclick");function legend(svg){var type=helper.d3_calcType(scale,ascending,cells,labels,locale.format(specifier),labelDelimiter),legendG=svg.selectAll("g").data([scale]);legendG.enter().append("g").attr("class",classPrefix+"legendCells"),cellFilter&&helper.d3_filterCells(type,cellFilter);var cell=svg.select("."+classPrefix+"legendCells").selectAll("."+classPrefix+"cell").data(type.data),cellEnter=cell.enter().append("g").attr("class",classPrefix+"cell");cellEnter.append(shape).attr("class",classPrefix+"swatch");var shapes=svg.selectAll("g."+classPrefix+"cell "+shape+"."+classPrefix+"swatch").data(type.data);helper.d3_addEvents(cellEnter,legendDispatcher),cell.exit().transition().style("opacity",0).remove(),shapes.exit().transition().style("opacity",0).remove(),shapes=shapes.merge(shapes),helper.d3_drawShapes(shape,shapes,shapeHeight,shapeWidth,shapeRadius,path2);var text=helper.d3_addText(svg,cellEnter,type.labels,classPrefix,labelWrap);cell=cellEnter.merge(cell);var textSize=text.nodes().map(function(d){return d.getBBox()}),shapeSize=shapes.nodes().map(function(d){return d.getBBox()});useClass?shapes.attr("class",function(d){return classPrefix+"swatch "+type.feature(d)}):shape=="line"?shapes.style("stroke",type.feature):shapes.style("fill",type.feature);var cellTrans=void 0,textTrans=void 0,textAlign=labelAlign=="start"?0:labelAlign=="middle"?.5:1;orient==="vertical"?function(){var cellSize=textSize.map(function(d,i){return Math.max(d.height,shapeSize[i].height)});cellTrans=function(d,i){var height=common.sum(cellSize.slice(0,i));return"translate(0, "+(height+i*shapePadding)+")"},textTrans=function(d,i){return"translate( "+(shapeSize[i].width+shapeSize[i].x+labelOffset)+", "+(shapeSize[i].y+shapeSize[i].height/2+5)+")"}}():orient==="horizontal"&&(cellTrans=function(d,i){return"translate("+i*(shapeSize[i].width+shapePadding)+",0)"},textTrans=function(d,i){return"translate("+(shapeSize[i].width*textAlign+shapeSize[i].x)+`,
2
- `+(shapeSize[i].height+shapeSize[i].y+labelOffset+8)+")"}),helper.d3_placement(orient,cell,cellTrans,text,textTrans,labelAlign),helper.d3_title(svg,title,classPrefix,titleWidth),cell.transition().style("opacity",1)}return legend.scale=function(_){return arguments.length?(scale=_,legend):scale},legend.cells=function(_){return arguments.length?((_.length>1||_>=2)&&(cells=_),legend):cells},legend.cellFilter=function(_){return arguments.length?(cellFilter=_,legend):cellFilter},legend.shape=function(_,d){return arguments.length?((_=="rect"||_=="circle"||_=="line"||_=="path"&&typeof d=="string")&&(shape=_,path2=d),legend):shape},legend.shapeWidth=function(_){return arguments.length?(shapeWidth=+_,legend):shapeWidth},legend.shapeHeight=function(_){return arguments.length?(shapeHeight=+_,legend):shapeHeight},legend.shapeRadius=function(_){return arguments.length?(shapeRadius=+_,legend):shapeRadius},legend.shapePadding=function(_){return arguments.length?(shapePadding=+_,legend):shapePadding},legend.labels=function(_){return arguments.length?(labels=_,legend):labels},legend.labelAlign=function(_){return arguments.length?((_=="start"||_=="end"||_=="middle")&&(labelAlign=_),legend):labelAlign},legend.locale=function(_){return arguments.length?(locale=common.formatLocale(_),legend):locale},legend.labelFormat=function(_){return arguments.length?(specifier=common.formatSpecifier(_),legend):legend.locale().format(specifier)},legend.labelOffset=function(_){return arguments.length?(labelOffset=+_,legend):labelOffset},legend.labelDelimiter=function(_){return arguments.length?(labelDelimiter=_,legend):labelDelimiter},legend.labelWrap=function(_){return arguments.length?(labelWrap=_,legend):labelWrap},legend.useClass=function(_){return arguments.length?((_===!0||_===!1)&&(useClass=_),legend):useClass},legend.orient=function(_){return arguments.length?(_=_.toLowerCase(),(_=="horizontal"||_=="vertical")&&(orient=_),legend):orient},legend.ascending=function(_){return arguments.length?(ascending=!!_,legend):ascending},legend.classPrefix=function(_){return arguments.length?(classPrefix=_,legend):classPrefix},legend.title=function(_){return arguments.length?(title=_,legend):title},legend.titleWidth=function(_){return arguments.length?(titleWidth=_,legend):titleWidth},legend.textWrap=function(_){return arguments.length?(textWrap=_,legend):textWrap},legend.on=function(){var value=legendDispatcher.on.apply(legendDispatcher,arguments);return value===legendDispatcher?legend:value},legend}class Legend extends common.SVGWidget{constructor(owner){super(),__publicField2(this,"_owner"),__publicField2(this,"_targetWidget"),__publicField2(this,"_targetWidgetMonitor"),__publicField2(this,"_legendOrdinal"),__publicField2(this,"_disabled",[]),__publicField2(this,"_symbolTypeMap",{circle:d3SymbolCircle,cross:d3SymbolCross,diamond:d3SymbolDiamond,square:d3SymbolSquare,star:d3SymbolStar,triangle:d3SymbolTriangle,wye:d3SymbolWye}),__publicField2(this,"_g"),__publicField2(this,"_containerSize"),this._owner=owner,this._drawStartPos="origin";const context=this;this._legendOrdinal=color().shape("path",d3Symbol().type(d3SymbolCircle).size(150)()).shapePadding(10).shapeRadius(10).on("cellclick",function(d){context.onClick(d,this)}).on("cellover",d=>{context.onOver(d,this)}).on("cellout",d=>{context.onOut(d,this)})}isDisabled(d){return typeof d>"u"?!1:typeof d=="string"?d.indexOf("__")===0||this._disabled.indexOf(d)>=0:d instanceof common.Database.Field?d.id().indexOf("__")===0||this._disabled.indexOf(d.id())>=0:this._disabled.indexOf(d)>=0}filteredFields(){switch(this.dataFamily()){case"2D":return this.fields();case"ND":return this.fields().filter(d=>!this.isDisabled(d))}return this.fields()}filteredColumns(){switch(this.dataFamily()){case"2D":return this.columns();case"ND":return this.columns().filter(d=>!this.isDisabled(d))}return this.columns()}filteredData(){switch(this.dataFamily()){case"2D":return this.data().filter(row=>!this.isDisabled(row[0]));case"ND":const disabledCols={};let anyDisabled=!1;return this.columns().forEach((col,idx)=>{const disabled=this.isDisabled(col);disabledCols[idx]=disabled,disabled&&(anyDisabled=!0)}),anyDisabled?this.data().map(row=>row.filter((cell,idx)=>!disabledCols[idx])):this.data()}return this.data()}isRainbow(){const widget=this.getWidget();return widget&&widget._palette&&widget._palette.type()==="rainbow"}targetWidget(_){if(!arguments.length)return this._targetWidget;if(this._targetWidget=_,this._targetWidgetMonitor&&(this._targetWidgetMonitor.remove(),delete this._targetWidgetMonitor),this._targetWidget){const context=this;this._targetWidgetMonitor=this._targetWidget.monitor(function(key,newProp,oldProp,source){switch(key){case"chart":case"columns":case"data":case"paletteID":context.lazyRender();break}})}return this}getWidget(){if(this._targetWidget)switch(this._targetWidget.classID()){case"composite_MultiChart":return this._targetWidget.chart()}return this._targetWidget}getPalette(){const widget=this.getWidget();if(widget&&widget._palette)switch(widget._palette.type()){case"ordinal":return common.Palette.ordinal(widget._palette.id());case"rainbow":return common.Palette.rainbow(widget._palette.id())}return common.Palette.ordinal("default")}getPaletteType(){return this.getPalette().type()}fillColorFunc(){const widget=this.getWidget();if(widget&&widget.fillColor)return widget._palette&&widget.paletteID&&widget._palette.name!==widget.paletteID()&&(widget._palette=widget._palette.switch(widget.paletteID())),(row,col,sel)=>widget.fillColor(row,col,sel);const palette=common.Palette.ordinal(widget&&widget.paletteID&&widget.paletteID()||"default");return(row,col,sel)=>palette(col)}fillColor(row,col,sel){return this.fillColorFunc()(row,col,sel)}enter(domNode,element){super.enter(domNode,element),this._g=element.append("g").attr("class","legendOrdinal")}calcMetaData(){let dataArr=[],total=0,maxLabelWidth=0;const colLength=this.columns().length;if(this._targetWidget){const columns=this.columns();switch(this.getPaletteType()){case"ordinal":const fillColor=this.fillColorFunc();let val=0;switch(this.dataFamily()){case"2D":dataArr=this.data().map(function(n,i){val=this.data()[i].slice(1,colLength).reduce((acc,n2)=>acc+n2,0);const disabled=this.isDisabled(n[0]);disabled||(total+=val);const label=n[0]+(!disabled&&this.showSeriesTotal()?` (${val})`:""),textSize=this.textSize(label);return maxLabelWidth<textSize.width&&(maxLabelWidth=textSize.width),[fillColor(n,n[0],!1),n[0],label]},this);break;case"ND":dataArr=this.columns().filter(col=>col.indexOf("__")!==0).filter(function(n,i){return i>0}).map(function(n,i){val=this.data().reduce((acc,n2)=>acc+n2[i+1],0);const disabled=this.isDisabled(columns[i+1]),label=n+(!disabled&&this.showSeriesTotal()?` (${val})`:"");disabled||(total+=val);const textSize=this.textSize(label);return maxLabelWidth<textSize.width&&(maxLabelWidth=textSize.width),[fillColor(void 0,n,!1),n,label]},this);break;default:dataArr=this.columns().map(function(n){return[fillColor(void 0,n,!1),n]},this);break}break;case"rainbow":const palette=this.getPalette(),format$1=common.format(this.rainbowFormat()),widget=this.getWidget(),steps=this.rainbowBins(),weightMin=widget._dataMinWeight,weightMax=widget._dataMaxWeight,stepWeightDiff=(weightMax-weightMin)/(steps-1);dataArr.push([palette(weightMin,weightMin,weightMax),format$1(weightMin)]);for(let x=1;x<steps-1;++x){let mid=stepWeightDiff*x;Math.floor(mid)>parseInt(dataArr[0][1])&&(mid=Math.floor(mid)),dataArr.push([palette(mid,weightMin,weightMax),format$1(mid)])}dataArr.push([palette(weightMax,weightMin,weightMax),format$1(weightMax)]);break}}return{dataArr,total,maxLabelWidth}}update(domNode,element){super.update(domNode,element);const{dataArr,maxLabelWidth,total}=this.calcMetaData(),radius=this.shapeRadius(),size=this.radiusToSymbolSize(radius),strokeWidth=1;let shapePadding=this.itemPadding();this.orientation()==="horizontal"&&(shapePadding+=maxLabelWidth-radius*2);const ordinal=common.scaleOrdinal().domain(dataArr.map(row=>row[1])).range(dataArr.map(row=>row[0]));this._legendOrdinal.shape("path",d3Symbol().type(this._symbolTypeMap[this.symbolType()]).size(size)()).orient(this.orientation()).title(this.title()).labelWrap(this.labelMaxWidth()).labelAlign(this.labelAlign()).shapePadding(shapePadding).scale(ordinal).labels(d=>dataArr[d.i][2]),this._g.call(this._legendOrdinal),this.updateDisabled(element,dataArr);const legendCellsBbox=this._g.select(".legendCells").node().getBBox();let offsetX=Math.abs(legendCellsBbox.x),offsetY=Math.abs(legendCellsBbox.y)+strokeWidth;if(this.orientation()==="horizontal"){if(this.labelAlign()==="start"?offsetX+=strokeWidth:this.labelAlign()==="end"&&(offsetX-=strokeWidth),this.width()>legendCellsBbox.width){const extraWidth=this.width()-legendCellsBbox.width;offsetX+=extraWidth/2}}else if(this.orientation()==="vertical"&&(offsetX+=strokeWidth,this._containerSize.height>legendCellsBbox.height)){const extraHeight=this.height()-legendCellsBbox.height;offsetY+=extraHeight/2}this._g.attr("transform",`translate(${offsetX}, ${offsetY})`),this.pos({x:0,y:0}),this._legendOrdinal.labelOffset(this.itemPadding());const legendTotal=this._g.selectAll(".legendTotal").data(dataArr.length&&this.showLegendTotal()?[total]:[]),totalText=`Total: ${total}`,totalOffsetX=-offsetX,totalOffsetY=legendCellsBbox.height+this.itemPadding()+strokeWidth;this.enableOverflowScroll(!1),this.enableOverflow(!0),legendTotal.enter().append("text").classed("legendTotal",!0).merge(legendTotal).attr("transform",`translate(${totalOffsetX}, ${totalOffsetY})`).text(totalText),legendTotal.exit().remove()}updateDisabled(element,dataArr){element.style("cursor","pointer").selectAll("path.swatch").filter((d,i)=>i<dataArr.length).style("stroke",(d,i)=>dataArr[i][0]).style("fill",(d,i)=>this._disabled.indexOf(d)<0?dataArr[i][0]:"white")}postUpdate(domNode,element){let w;this._boundingBox&&(w=this._boundingBox.width,this._boundingBox.width=this._size.width),super.postUpdate(domNode,element),w!==void 0&&(this._boundingBox.width=w),this._parentRelativeDiv.style("overflow","hidden")}exit(domNode,element){super.exit(domNode,element)}radiusToSymbolSize(radius){const circleSize=Math.pow(radius,2)*Math.PI;switch(this.symbolType()){case"star":return circleSize*.45;case"triangle":return circleSize*.65;case"cross":case"diamond":case"wye":return circleSize*.75;case"circle":return circleSize;case"square":return circleSize*1.3}}onClick(d,domNode){switch(this.getPaletteType()){case"ordinal":switch(this.dataFamily()){case"2D":case"ND":const disabledIdx=this._disabled.indexOf(d);disabledIdx<0?this._disabled.push(d):this._disabled.splice(disabledIdx,1),this._owner.refreshColumns(),this._owner.refreshData(),this._owner.render();break}break}}onOver(d,domNode){if(api.instanceOfIHighlight(this._owner))switch(this.getPaletteType()){case"ordinal":switch(this.dataFamily()){case"2D":case"ND":this._disabled.indexOf(d)<0&&this._owner.highlightColumn(d);break}break}}onOut(d,domNode){if(api.instanceOfIHighlight(this._owner))switch(this.getPaletteType()){case"ordinal":switch(this.dataFamily()){case"2D":case"ND":this._owner.highlightColumn();break}break}}onDblClick(rowData,rowIdx){}onMouseOver(rowData,rowIdx){}resize(_size){let retVal;if(this.fitToContent()){this._containerSize=_size;const bbox=this.getBBox();_size.width>bbox.width&&(bbox.width=_size.width),_size.height>bbox.height&&(bbox.height=_size.height),retVal=super.resize.apply(this,[{...bbox}])}else retVal=super.resize.apply(this,arguments);return retVal}}Legend.prototype._class+=" layout_Legend",Legend.prototype.publish("title","","string","Title"),Legend.prototype.publish("symbolType","circle","set","Shape of each legend item",["circle","cross","diamond","square","star","triangle","wye"]),Legend.prototype.publish("labelMaxWidth",null,"number","Max Label Width (pixels)",null,{optional:!0}),Legend.prototype.publish("orientation","vertical","set","Orientation of Legend rows",["vertical","horizontal"],{tags:["Private"]}),Legend.prototype.publish("dataFamily","ND","set","Type of data",["1D","2D","ND","map","graph","any"],{tags:["Private"]}),Legend.prototype.publish("rainbowFormat",",","string","Rainbow number formatting",null,{tags:["Private"],optional:!0,disable:w=>!w.isRainbow()}),Legend.prototype.publish("rainbowBins",8,"number","Number of rainbow bins",null,{tags:["Private"],disable:w=>!w.isRainbow()}),Legend.prototype.publish("showSeriesTotal",!1,"boolean","Show value next to series"),Legend.prototype.publish("showLegendTotal",!1,"boolean","Show a total of the series values under the legend",null),Legend.prototype.publish("itemPadding",8,"number","Padding between legend items (pixels)"),Legend.prototype.publish("shapeRadius",7,"number","Radius of legend shape (pixels)"),Legend.prototype.publish("fitToContent",!0,"boolean","If true, resize will simply reapply the bounding box dimensions"),Legend.prototype.publish("labelAlign","start","set","Horizontal alignment of legend item label (for horizontal orientation only)",["start","middle","end"],{optional:!0,disable:w=>w.orientation()==="vertical"});class Modal extends common.HTMLWidget{constructor(){super(),__publicField2(this,"_widget"),__publicField2(this,"_relativeTarget"),__publicField2(this,"_fade"),__publicField2(this,"_modal"),__publicField2(this,"_modalHeader"),__publicField2(this,"_modalBody"),__publicField2(this,"_modalHeaderAnnotations"),__publicField2(this,"_modalHeaderCloseButton"),__publicField2(this,"_close"),this._tag="div"}closeModal(){this.visible(!1)}getRelativeTarget(){let relativeTarget;return this.relativeTargetId()&&(relativeTarget=document.getElementById(this.relativeTargetId()),relativeTarget)?relativeTarget:!relativeTarget&&(relativeTarget=this.locateAncestor("layout_Grid"),relativeTarget&&relativeTarget.element)?relativeTarget.element().node():document.body}setModalSize(){this.fixedHeight()!==null&&this.fixedWidth()!==null?this._modal.style("height",this.fixedHeight()).style("width",this.fixedWidth()).style("min-height",null).style("min-width",null).style("max-height",null).style("max-width",null):(this.minHeight()||this.minWidth())&&this._modal.style("min-height",this.minHeight()).style("min-width",this.minWidth()).style("max-height",this.maxHeight()).style("max-width",this.maxWidth());const modalRect=this._modal.node().getBoundingClientRect(),headerRect=this._modalHeader.node().getBoundingClientRect();return this._modalBody.style("height",modalRect.height-headerRect.height+"px").style("width",modalRect.width),modalRect}setFadePosition(rect){this._fade.style("top",rect.top+"px").style("left",rect.left+"px").style("width",rect.width+"px").style("height",rect.height+"px")}setModalPosition(rect){const modalRect=this.setModalSize();if(this.fixedTop()!==null&&this.fixedLeft()!==null)this._modal.style("top",`calc(${this.fixedTop()} + ${rect.top}px)`).style("left",`calc(${this.fixedLeft()} + ${rect.left}px)`);else if(this.fixedHeight()!==null&&this.fixedWidth()!==null)this._modal.style("top",rect.top+rect.height/2-modalRect.height/2+"px").style("left",rect.left+rect.width/2-modalRect.width/2+"px");else if(this.minHeight()||this.minWidth()){const contentRect=this._modal.node().getBoundingClientRect();this._modal.style("top",rect.top+rect.height/2-contentRect.height/2+"px").style("left",rect.left+rect.width/2-contentRect.width/2+"px")}}resize(size){return super.resize(),this._modal&&this.setModalSize(),this}resizeBodySync(width,height){const headerRect=this._modalHeader.node().getBoundingClientRect();return this._modal.style("width",width+"px").style("height",height+headerRect.height+"px").style("min-width",width+"px").style("min-height",height+headerRect.height+"px"),this._modalHeader.style("width",width+"px"),this._modalBody.style("width",width+"px").style("height",height+"px"),this.minWidth(width+"px").minHeight(height+headerRect.height+"px").resize({height:height+headerRect.height,width})}enter(domNode,element){super.enter(domNode,element),this._fade=element.append("div").classed("layout_Modal-fade",!0).classed("layout_Modal-fadeClickable",this.enableClickFadeToClose()).classed("layout_Modal-fade-hidden",!this.showFade());const header_h=this.titleFontSize()*2;this._modal=element.append("div").classed("layout_Modal-content",!0),this._modalHeader=this._modal.append("div").classed("layout_Modal-header",!0).style("color",this.titleFontColor()).style("font-size",this.titleFontSize()+"px").style("height",header_h+"px"),this._modalBody=this._modal.append("div").classed("layout_Modal-body",!0).style("height",`calc( 100% - ${header_h}px )`).style("overflow-x",this.overflowX()).style("overflow-y",this.overflowY()),this._modalHeader.append("div").classed("layout_Modal-title",!0).style("line-height",this.titleFontSize()+"px").style("top",this.titleFontSize()/2+"px").style("left",this.titleFontSize()/2+"px").text(this.formattedTitle()),this._modalHeaderAnnotations=this._modalHeader.append("div").classed("layout_Modal-annotations",!0),this._modalHeaderCloseButton=this._modalHeaderAnnotations.append("div").classed("layout_Modal-closeButton",!0).html('<i class="fa fa-close"></i>'),this._modalHeaderAnnotations.style("line-height",this.titleFontSize()+"px").style("right",this.titleFontSize()/2+"px").style("top",this.titleFontSize()/2+"px"),this._modalHeaderCloseButton.on("click",()=>{this.closeModal()}),this._fade.on("click",n=>{this.enableClickFadeToClose()&&this.closeModal()})}update(domNode,element){super.update(domNode,element),element.style("display",this.show()?null:"none"),this._fade.classed("layout_Modal-fade-hidden",!this.showFade()),this._relativeTarget=this.getRelativeTarget(),this.setModalSize();const rect=this._relativeTarget.getBoundingClientRect();this.setFadePosition(rect),this.setModalPosition(rect),this.show()?(this._widget.target()||this._widget.target(this._modalBody.node()),this._widget.resize().render()):this._widget.target(null).render()}exit(domNode,element){this._widget&&this._widget.target(null),super.exit(domNode,element)}formattedTitle(){const title=this.title_exists()?this.title().trim():"";return title.length>0&&title.slice(0,1)==="("&&title.slice(-1)===")"?title.slice(1,-1):this.title()}}Modal.prototype._class+=" layout_Modal",Modal.prototype.publish("title",null,"string","title"),Modal.prototype.publish("widget",null,"widget","widget"),Modal.prototype.publish("titleFontSize",18,"number","titleFontSize (in pixels)"),Modal.prototype.publish("titleFontColor","#ffffff","html-color","titleFontColor"),Modal.prototype.publish("relativeTargetId",null,"string","relativeTargetId"),Modal.prototype.publish("show",!0,"boolean","show"),Modal.prototype.publish("showFade",!0,"boolean","showFade"),Modal.prototype.publish("enableClickFadeToClose",!0,"boolean","enableClickFadeToClose"),Modal.prototype.publish("minWidth","400px","string","minWidth"),Modal.prototype.publish("minHeight","400px","string","minHeight"),Modal.prototype.publish("maxWidth","800px","string","maxWidth"),Modal.prototype.publish("maxHeight","800px","string","maxHeight"),Modal.prototype.publish("fixedWidth",null,"string","fixedWidth"),Modal.prototype.publish("fixedHeight",null,"string","fixedHeight"),Modal.prototype.publish("fixedTop",null,"string","fixedTop"),Modal.prototype.publish("fixedLeft",null,"string","fixedLeft"),Modal.prototype.publish("overflowX","hidden","string","overflowX"),Modal.prototype.publish("overflowY","scroll","string","overflowY");class ChartPanel extends Border2{constructor(){super(),__publicField2(this,"_legend",new Legend(this).enableOverflow(!0)),__publicField2(this,"_progressBar",new common.ProgressBar),__publicField2(this,"_autoScale",!1),__publicField2(this,"_resolutions",{tiny:{width:100,height:100},small:{width:300,height:300}}),__publicField2(this,"_modal",new Modal),__publicField2(this,"_highlight"),__publicField2(this,"_scale"),__publicField2(this,"_orig_size"),__publicField2(this,"_toggleInfo",new common.ToggleButton().faChar("fa-info-circle").tooltip(".Description").selected(!1).on("enabled",()=>this.description()!=="").on("click",()=>{if(this._toggleInfo.selected()){this._modal.title(this.title()).widget(new common.Text().text(this.description())).show(!0).render();const origCloseFunc=this._modal._close;this._modal._close=()=>{this._toggleInfo.selected(!1).render(),this._modal._close=origCloseFunc}}}).on("mouseMove",()=>{}).on("mouseOut",()=>{})),__publicField2(this,"_toggleData",new common.ToggleButton().faChar("fa-table").tooltip("Data").on("click",()=>{this.dataVisible(this._toggleData.selected()),this.render()})),__publicField2(this,"_buttonDownload",new common.Button().faChar("fa-download").tooltip("Download").on("click",()=>{this.downloadCSV()})),__publicField2(this,"_buttonDownloadImage",new common.Button().faChar("fa-image").tooltip("Download Image").on("click",()=>{this.downloadPNG()})),__publicField2(this,"_toggleLegend",new common.ToggleButton().faChar("fa-list-ul").tooltip("Legend").selected(!1).on("click",()=>{const selected=this._toggleLegend.selected();this.legendPosition()==="bottom"?this.showBottom(selected):this.legendPosition()==="right"&&this.showRight(selected),this.legendVisible(selected),this.render()})),__publicField2(this,"_spacer",new common.Spacer),__publicField2(this,"_titleBar",new common.TitleBar().buttons([this._toggleData,this._buttonDownload,this._buttonDownloadImage,this._spacer,this._toggleLegend])),__publicField2(this,"_carousel",new Carousel),__publicField2(this,"_table",new dgrid.Table),__publicField2(this,"_widget"),__publicField2(this,"_hideLegendToggleList",["dgrid_Table"]),__publicField2(this,"_prevdataVisible"),__publicField2(this,"_prevlegendVisible"),__publicField2(this,"_prevLegendPosition"),__publicField2(this,"_prevChartDataFamily"),__publicField2(this,"_prevChart"),__publicField2(this,"_prevButtons"),this._tag="div"}fields(_){return arguments.length?(super.fields(_),this._legend.fields(_),this.refreshFields(),this):super.fields()}refreshFields(){return this._widget.fields(this._legend.filteredFields()),this._table.fields(this._legend.filteredFields()),this}columns(_,asDefault){return arguments.length?(super.columns(_,asDefault),this._legend.columns(_,asDefault),this.refreshColumns(),this):super.columns()}refreshColumns(){return this._widget.columns(this._legend.filteredColumns()),this._table.columns(this._legend.filteredColumns()),this}data(_){return arguments.length?(super.data(_),this._legend.data(_),this.refreshData(),this):super.data()}refreshData(){return this._widget.data(this._legend.filteredData()),this._table.data(this._legend.filteredData()),this}highlight(_){return arguments.length?(this._highlight=_,this):this._highlight}startProgress(){this._progressBar.start()}finishProgress(){this._progressBar.finish()}buttons(_){return arguments.length?(this._titleBar.buttons(_),this):this._titleBar.buttons()}downloadCSV(){const namePrefix=this.downloadTitle()?this.downloadTitle():this.title()?this.title():"data",nameSuffix=this.downloadTimestampSuffix()?"_"+common.Utility.timestamp():"";return common.Utility.downloadString("CSV",this._widget.export("CSV"),namePrefix+nameSuffix),this}downloadPNG(){const widget=this.widget();return widget instanceof common.SVGWidget&&(this.legendVisible()?widget.downloadPNG(this.title(),void 0,this._legend):widget.downloadPNG(this.title())),this}highlightColumn(column){if(column){const cssTag=`series-${this.cssTag(column)}`;this._centerWA.element().selectAll(".series").each(function(){const element=common.select(this),highlight=element.classed(cssTag);element.classed("highlight",highlight).classed("lowlight",!highlight)})}else this._centerWA.element().selectAll(".series").classed("highlight",!1).classed("lowlight",!1);return this}getResponsiveMode(){return this.enableAutoscaling()?this._autoScale?this.size().width<=this._resolutions.tiny.width||this.size().height<=this._resolutions.tiny.height?"tiny":this.size().width<=this._resolutions.small.width||this.size().height<=this._resolutions.small.height?"small":"regular":"regular":"none"}setOrigSize(){this._orig_size=JSON.parse(JSON.stringify(this.size()))}enter(domNode,element){super.enter(domNode,element),this._modal.target(this.target()).relativeTargetId(this.id()),this.top(this._titleBar),this.center(this._carousel),this._legend.targetWidget(this._widget).orientation("vertical").title("").visible(!1),this._progressBar.enter(domNode,element),this.setOrigSize()}preUpdateTiny(element){element.selectAll("div.body,div.title-text,div.icon-bar").style("display","none")}preUpdateSmall(element){const scale_x=this._orig_size.width/this._resolutions.small.width,scale_y=this._orig_size.height/this._resolutions.small.height;this._scale=Math.min(scale_x,scale_y);const x_is_smaller=this._scale===scale_x;this.size({width:x_is_smaller?this._resolutions.small.width:this._orig_size.width*(1/this._scale),height:x_is_smaller?this._orig_size.height*(1/this._scale):this._resolutions.small.height}),element.select("div.title-icon").style("position","static"),element.selectAll("lhs").style("display","none"),element.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),element.selectAll("div.data-count").style("visibility","hidden"),element.style("transform",`scale(${this._scale})`)}preUpdateRegular(element){element.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),element.selectAll("div.data-count").style("visibility","hidden"),element.select("div.title-icon").style("position","static"),element.style("transform","translate(0px,0px) scale(1)")}update(domNode,element){super.update(domNode,element)}preUpdate(domNode,element){switch(super.preUpdate(domNode,element),this._prevLegendPosition!==this.legendPosition()&&(this._legend.target()!==null&&this._legend.target(null),this._prevLegendPosition!==void 0?this.swap(this._prevLegendPosition,this.legendPosition()):this[this.legendPosition()](this._legend),this.legendPosition()==="right"?(this.rightOverflowX("hidden"),this.rightOverflowY("auto"),this.bottomOverflowX("visible"),this.bottomOverflowY("visible")):(this.rightOverflowX("visible"),this.rightOverflowY("visible"),this.bottomOverflowX("auto"),this.bottomOverflowY("hidden")),this._prevLegendPosition=this.legendPosition()),this._prevdataVisible!==this.dataVisible()&&(this._prevdataVisible=this.dataVisible(),this._toggleData.selected(this._prevdataVisible),this._legend.visible(this._prevlegendVisible&&!this._prevdataVisible),this._carousel.active(this._prevdataVisible?1:0)),this._prevlegendVisible!==this.legendVisible()&&(this._prevlegendVisible=this.legendVisible(),this._toggleLegend.selected(this._prevlegendVisible),this._legend.visible(this._prevlegendVisible&&!this._prevdataVisible)),this._legend.orientation(this.legendPosition()==="bottom"?"horizontal":"vertical"),this.showLeft(!this.left()),this.getResponsiveMode()){case"tiny":this.preUpdateTiny(element);break;case"small":this.preUpdateSmall(element);break;case"regular":this.preUpdateRegular(element);break}const chart=this._widget.classID()==="composite_MultiChart"?this._widget.chart():this._widget;if(this._legend.dataFamily(chart._dataFamily||"any"),this._prevChartDataFamily!==this._legend.dataFamily())switch(this._prevChartDataFamily=this._legend.dataFamily(),this._prevChartDataFamily){case"any":this._toggleLegend.selected(!1),this._legend.visible(!1);break}if(element.style("box-shadow",this.highlight()?`inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}`:"none"),this._hideLegendToggleList.indexOf(chart.classID())!==-1?(this._spacer.visible(!1),this._toggleLegend.visible(!1)):(this._spacer.visible(!0),this._toggleLegend.visible(!0)),this._prevChart!==chart){this._prevChart=chart;const widgetIconBar=chart?chart._titleBar||chart._iconBar:void 0;if(widgetIconBar&&widgetIconBar instanceof common.IconBar){this._prevButtons=this._prevButtons||[...this.buttons()];const buttons=[...widgetIconBar.buttons(),new common.Spacer,...this._prevButtons];widgetIconBar.buttons([]).render(),this.buttons(buttons)}else this._prevButtons&&this.buttons(this._prevButtons)}const hiddenButtons=[];this.dataButtonVisible()||hiddenButtons.push(this._toggleData),this.downloadButtonVisible()||hiddenButtons.push(this._buttonDownload),this.downloadImageButtonVisible()||hiddenButtons.push(this._buttonDownloadImage),this.legendButtonVisible()||hiddenButtons.push(this._toggleLegend),this._buttonDownloadImage.enabled(this.widget()instanceof common.SVGWidget),this._titleBar.hiddenButtons(hiddenButtons).visible(this.titleVisible()),this.topOverlay(this.titleOverlay()||!this.titleVisible())}postUpdate(domNode,element){switch(super.postUpdate(domNode,element),this.getResponsiveMode()){case"tiny":this.postUpdateTiny(element);break;case"small":this.postUpdateSmall(element);break;case"regular":this.postUpdateRegular(element);break}}postUpdateTiny(element){element.selectAll("div.body,div.title-text,div.icon-bar").style("display","none"),element.selectAll("div.data-count").style("visibility","visible").style("font-size",this.titleIconFontSize()/3+"px").style("line-height",this.titleIconFontSize()/3+"px").style("left",this.titleIconFontSize()+"px").text(this.data().length),element.style("transform","translate(0px,0px) scale(1)");const iconDiv=element.selectAll("div.title-icon"),_node=iconDiv.node(),containerRect=element.node().parentElement.getBoundingClientRect();if(_node){const rect=iconDiv.node().getBoundingClientRect(),icon_top=containerRect.height/2;iconDiv.style("position","absolute").style("left",`calc(50% - ${rect.width/2}px)`).style("top",`${icon_top-rect.height/2}px`),element.selectAll("div.data-count").style("position","absolute").style("left",`calc(50% + ${rect.width/2}px)`).style("top",`${icon_top-rect.height/2}px`)}}postUpdateSmall(element){element.selectAll("lhs").style("display","none"),element.selectAll("div.title-icon").style("position","static"),element.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),element.selectAll("div.data-count").style("visibility","hidden");const rect=element.node().getBoundingClientRect(),parentRect=element.node().parentElement.getBoundingClientRect();element.style("transform",`translate(${parentRect.x-rect.x}px, ${parentRect.y-rect.y}px) scale(${this._scale})`)}postUpdateRegular(element){element.selectAll("div.title-icon").style("position","static"),element.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),element.selectAll("div.data-count").style("visibility","hidden")}exit(domNode,element){this._progressBar.exit(domNode,element),this.right(null),this._legend.target(null),this.center(null),this._carousel.target(null),this.top(null),this._titleBar.target(null),this._modal.target(null),delete this._prevChart,delete this._prevButtons,delete this._prevChartDataFamily,delete this._prevPos,delete this._prevdataVisible,delete this._prevlegendVisible,super.exit(domNode,element)}click(row,column,selected){}dblclick(row,column,selected){}vertex_click(row,col,sel,more){more&&more.vertex}vertex_dblclick(row,col,sel,more){more&&more.vertex}edge_click(row,col,sel,more){more&&more.edge}edge_dblclick(row,col,sel,more){more&&more.edge}}ChartPanel.prototype._class+=" layout_ChartPanel",ChartPanel.prototype.publishReset(),ChartPanel.prototype.publishProxy("title","_titleBar"),ChartPanel.prototype.publish("titleVisible",!0,"boolean"),ChartPanel.prototype.publish("titleOverlay",!1,"boolean"),ChartPanel.prototype.publishProxy("titleIcon","_titleBar"),ChartPanel.prototype.publishProxy("titleIconFont","_titleBar"),ChartPanel.prototype.publishProxy("titleFont","_titleBar"),ChartPanel.prototype.publishProxy("titleIconFontSize","_titleBar"),ChartPanel.prototype.publishProxy("titleFontSize","_titleBar"),ChartPanel.prototype.publishProxy("description","_titleBar"),ChartPanel.prototype.publishProxy("descriptionFont","_titleBar"),ChartPanel.prototype.publishProxy("descriptionFontSize","_titleBar"),ChartPanel.prototype.publish("dataVisible",!1,"boolean","Show data table"),ChartPanel.prototype.publish("dataButtonVisible",!0,"boolean","Show data table button"),ChartPanel.prototype.publish("downloadButtonVisible",!0,"boolean","Show data download button"),ChartPanel.prototype.publish("downloadImageButtonVisible",!1,"boolean","Show image download button"),ChartPanel.prototype.publish("downloadTitle","","string","File name when downloaded"),ChartPanel.prototype.publish("downloadTimestampSuffix",!0,"boolean","Use timestamp as file name suffix"),ChartPanel.prototype.publish("legendVisible",!1,"boolean","Show legend"),ChartPanel.prototype.publish("legendButtonVisible",!0,"boolean","Show legend button"),ChartPanel.prototype.publish("legendPosition","right","set","Position of legend",["right","bottom"]),ChartPanel.prototype.publishProxy("legend_labelMaxWidth","_legend","labelMaxWidth"),ChartPanel.prototype.publishProxy("legend_showSeriesTotal","_legend","showSeriesTotal"),ChartPanel.prototype.publishProxy("legend_showLegendTotal","_legend","showLegendTotal"),ChartPanel.prototype.publishProxy("legend_itemPadding","_legend","itemPadding"),ChartPanel.prototype.publishProxy("legend_shapeRadius","_legend","shapeRadius"),ChartPanel.prototype.publishProxy("legend_symbolType","_legend","symbolType"),ChartPanel.prototype.publishProxy("legend_labelAlign","_legend","labelAlign"),ChartPanel.prototype.publish("widget",null,"widget","Widget",void 0,{render:!1}),ChartPanel.prototype.publish("enableAutoscaling",!1,"boolean"),ChartPanel.prototype.publish("highlightSize",4,"number"),ChartPanel.prototype.publish("highlightColor","#e67e22","html-color"),ChartPanel.prototype.publishProxy("progress_halfLife","_progressBar","halfLife"),ChartPanel.prototype.publishProxy("progress_decay","_progressBar","decay"),ChartPanel.prototype.publishProxy("progress_size","_progressBar","size"),ChartPanel.prototype.publishProxy("progress_color","_progressBar","color"),ChartPanel.prototype.publishProxy("progress_blurBar","_progressBar","blurBar"),ChartPanel.prototype.publishProxy("progress_blurSize","_progressBar","blurSize"),ChartPanel.prototype.publishProxy("progress_blurColor","_progressBar","blurColor"),ChartPanel.prototype.publishProxy("progress_blurOpacity","_progressBar","blurOpacity"),ChartPanel.prototype.widget=function(_){if(!arguments.length)return this._widget;this._carousel.widgets([_,this._table]),this._widget=_,this._widget.fields(this._legend.filteredFields()).data(this._legend.filteredData());const context=this,tmpAny=this._widget;return tmpAny.click=function(){context.click.apply(context,arguments)},tmpAny.dblclick=function(){context.dblclick.apply(context,arguments)},tmpAny.vertex_click=function(){context.vertex_click.apply(context,arguments)},tmpAny.vertex_dblclick=function(){context.vertex_dblclick.apply(context,arguments)},tmpAny.edge_click=function(){context.edge_click.apply(context,arguments)},tmpAny.edge_dblclick=function(){context.edge_dblclick.apply(context,arguments)},this};class FlexGrid extends common.HTMLWidget{constructor(){super()}enter(domNode,element){super.enter(domNode,element),common.select(domNode.parentNode).style("height","100%").style("width","100%")}update(domNode,element){super.update(domNode,element);const context=this,cachedSizes=[];this.updateFlexParent(element);const listItems=element.selectAll(".FlexGrid-list-item").data(this.widgets(),w=>w.id());listItems.enter().append("div").classed("FlexGrid-list-item",!0).each(function(w){w.target(this)}).merge(listItems).style("min-height",this.itemMinHeight()+"px").style("min-width",this.itemMinWidth()+"px").style("flex-basis",(n,i)=>{const flexBasis=this.widgetsFlexBasis()[i];return typeof flexBasis<"u"?flexBasis:this.flexBasis()}).style("flex-grow",(n,i)=>{const flexGrow=this.widgetsFlexGrow()[i];return typeof flexGrow<"u"?flexGrow:this.flexGrow()}).style("border-width",this.borderWidth()+"px").style("border-color",this.itemBorderColor()).each(function(){this.firstChild.style.display="none"}).each(function(){const rect=this.getBoundingClientRect();cachedSizes.push([rect.width,rect.height])}).each(function(w,i){this.firstChild.style.display="block",w.resize({width:cachedSizes[i][0]-2*context.borderWidth(),height:cachedSizes[i][1]-2*context.borderWidth()})}),listItems.exit().remove()}exit(domNode,element){super.exit(domNode,element)}updateFlexParent(element){element.style("height","100%").style("flex-direction",this.orientation()==="horizontal"?"row":"column").style("flex-wrap",this.flexWrap()).style("align-items",this.alignItems()).style("align-content",this.alignContent()).style("overflow-x",()=>this.forceXScroll()||this.orientation()==="horizontal"&&this.flexWrap()==="nowrap"&&!this.disableScroll()?"scroll":"hidden").style("overflow-y",()=>this.forceYScroll()||this.orientation()==="vertical"&&this.flexWrap()==="nowrap"&&!this.disableScroll()?"scroll":"hidden")}}FlexGrid.prototype._class+=" layout_FlexGrid",FlexGrid.prototype.publish("itemBorderColor","transparent","html-color","Color of list item borders"),FlexGrid.prototype.publish("borderWidth",0,"number","Width of list item borders (pixels)"),FlexGrid.prototype.publish("orientation","horizontal","set","Controls the flex-direction of the list items",["horizontal","vertical"]),FlexGrid.prototype.publish("flexWrap","wrap","set","Controls the line wrap when overflow occurs",["nowrap","wrap","wrap-reverse"]),FlexGrid.prototype.publish("disableScroll",!1,"boolean","If false, scrollbar will show (when flexWrap is set to 'nowrap')",null,{disable:w=>w.flexWrap()!=="nowrap"}),FlexGrid.prototype.publish("forceXScroll",!1,"boolean","If true, horzontal scrollbar will show"),FlexGrid.prototype.publish("forceYScroll",!1,"boolean","If true, vertical scrollbar will show"),FlexGrid.prototype.publish("itemMinHeight",64,"number","Minimum height of a list item (pixels)"),FlexGrid.prototype.publish("itemMinWidth",64,"number","Minimum width of a list item (pixels)"),FlexGrid.prototype.publish("alignItems","stretch","set","Controls normal alignment of items",["flex-start","center","flex-end","stretch"]),FlexGrid.prototype.publish("alignContent","stretch","set","Controls normal alignment of item rows",["flex-start","center","flex-end","stretch","space-between","space-around"]),FlexGrid.prototype.publish("flexGrow",1,"number","Default flex-grow style for all list items"),FlexGrid.prototype.publish("flexBasis","10%","string","Default flex-basis style for all list items"),FlexGrid.prototype.publish("widgetsFlexGrow",[],"array","Array of flex-grow values keyed on the widgets array"),FlexGrid.prototype.publish("widgetsFlexBasis",[],"array","Array of flex-basis values keyed on the widgets array"),FlexGrid.prototype.publish("widgets",[],"widgetArray","Array of widgets to be rendered as list items");var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}var gridList$1={exports:{}};(function(module2,exports3){(function(root,factory){module2.exports=factory()})(commonjsGlobal,function(){var GridList2=function(items,options){this._options=options;for(var k2 in this.defaults)this._options.hasOwnProperty(k2)||(this._options[k2]=this.defaults[k2]);this.items=items,this._adjustSizeOfItems(),this.generateGrid()};GridList2.cloneItems=function(items,_items){var i,k2;for(_items===void 0&&(_items=[]),i=0;i<items.length;i++){_items[i]||(_items[i]={});for(k2 in items[i])_items[i][k2]=items[i][k2]}return _items},GridList2.prototype={defaults:{lanes:5,direction:"horizontal"},toString:function(){var widthOfGrid=this.grid.length,output=`
3
- #|`,border=`
4
- --`,item,i,j;for(i=0;i<widthOfGrid;i++)output+=" "+this._padNumber(i," "),border+="---";for(output+=border,i=0;i<this._options.lanes;i++)for(output+=`
5
- `+this._padNumber(i," ")+"|",j=0;j<widthOfGrid;j++)output+=" ",item=this.grid[j][i],output+=item?this._padNumber(this.items.indexOf(item),"0"):"--";return output+=`
6
- `,output},generateGrid:function(){var i;for(this._resetGrid(),i=0;i<this.items.length;i++)this._markItemPositionToGrid(this.items[i])},resizeGrid:function(lanes){var currentColumn=0;this._options.lanes=lanes,this._adjustSizeOfItems(),this._sortItemsByPosition(),this._resetGrid();for(var i=0;i<this.items.length;i++){var item=this.items[i],position=this._getItemPosition(item);this._updateItemPosition(item,this.findPositionForItem(item,{x:currentColumn,y:0})),currentColumn=Math.max(currentColumn,position.x)}this._pullItemsToLeft()},findPositionForItem:function(item,start,fixedRow){var x,y,position;for(x=start.x;x<this.grid.length;x++)if(fixedRow!==void 0){if(position=[x,fixedRow],this._itemFitsAtPosition(item,position))return position}else for(y=start.y;y<this._options.lanes;y++)if(position=[x,y],this._itemFitsAtPosition(item,position))return position;var newCol=this.grid.length,newRow=0;return fixedRow!==void 0&&this._itemFitsAtPosition(item,[newCol,fixedRow])&&(newRow=fixedRow),[newCol,newRow]},moveItemToPosition:function(item,newPosition){var position=this._getItemPosition({x:newPosition[0],y:newPosition[1],w:item.w,h:item.h});this._updateItemPosition(item,[position.x,position.y]),this._resolveCollisions(item)},resizeItem:function(item,size){var width=size.w||item.w,height=size.h||item.h;this._updateItemSize(item,width,height),this._resolveCollisions(item),this._pullItemsToLeft()},getChangedItems:function(initialItems,idAttribute){for(var changedItems=[],i=0;i<initialItems.length;i++){var item=this._getItemByAttribute(idAttribute,initialItems[i][idAttribute]);(item.x!==initialItems[i].x||item.y!==initialItems[i].y||item.w!==initialItems[i].w||item.h!==initialItems[i].h)&&changedItems.push(item)}return changedItems},_sortItemsByPosition:function(){this.items.sort((function(item1,item2){var position1=this._getItemPosition(item1),position2=this._getItemPosition(item2);return position1.x!=position2.x?position1.x-position2.x:position1.y!=position2.y?position1.y-position2.y:0}).bind(this))},_adjustSizeOfItems:function(){for(var i=0;i<this.items.length;i++){var item=this.items[i];item.autoSize===void 0&&(item.autoSize=item.w===0||item.h===0),item.autoSize&&(this._options.direction==="horizontal"?item.h=this._options.lanes:item.w=this._options.lanes)}},_resetGrid:function(){this.grid=[]},_itemFitsAtPosition:function(item,newPosition){var position=this._getItemPosition(item),x,y;if(newPosition[0]<0||newPosition[1]<0||newPosition[1]+position.h>this._options.lanes)return!1;for(x=newPosition[0];x<newPosition[0]+position.w;x++){var col=this.grid[x];if(col){for(y=newPosition[1];y<newPosition[1]+position.h;y++)if(col[y]&&col[y]!==item)return!1}}return!0},_updateItemPosition:function(item,position){item.x!==null&&item.y!==null&&this._deleteItemPositionFromGrid(item),this._setItemPosition(item,position),this._markItemPositionToGrid(item)},_updateItemSize:function(item,width,height){item.x!==null&&item.y!==null&&this._deleteItemPositionFromGrid(item),item.w=width,item.h=height,this._markItemPositionToGrid(item)},_markItemPositionToGrid:function(item){var position=this._getItemPosition(item),x,y;for(this._ensureColumns(position.x+position.w),x=position.x;x<position.x+position.w;x++)for(y=position.y;y<position.y+position.h;y++)this.grid[x][y]=item},_deleteItemPositionFromGrid:function(item){var position=this._getItemPosition(item),x,y;for(x=position.x;x<position.x+position.w;x++)if(this.grid[x])for(y=position.y;y<position.y+position.h;y++)this.grid[x][y]==item&&(this.grid[x][y]=null)},_ensureColumns:function(N){var i;for(i=0;i<N;i++)this.grid[i]||this.grid.push(new GridCol(this._options.lanes))},_getItemsCollidingWithItem:function(item){for(var collidingItems=[],i=0;i<this.items.length;i++)item!=this.items[i]&&this._itemsAreColliding(item,this.items[i])&&collidingItems.push(i);return collidingItems},_itemsAreColliding:function(item1,item2){var position1=this._getItemPosition(item1),position2=this._getItemPosition(item2);return!(position2.x>=position1.x+position1.w||position2.x+position2.w<=position1.x||position2.y>=position1.y+position1.h||position2.y+position2.h<=position1.y)},_resolveCollisions:function(item){this._tryToResolveCollisionsLocally(item)||this._pullItemsToLeft(item),this._pullItemsToLeft()},_tryToResolveCollisionsLocally:function(item){var collidingItems=this._getItemsCollidingWithItem(item);if(!collidingItems.length)return!0;var _gridList=new GridList2([],this._options),leftOfItem,rightOfItem,aboveOfItem,belowOfItem;GridList2.cloneItems(this.items,_gridList.items),_gridList.generateGrid();for(var i=0;i<collidingItems.length;i++){var collidingItem=_gridList.items[collidingItems[i]],collidingPosition=this._getItemPosition(collidingItem),position=this._getItemPosition(item);if(leftOfItem=[position.x-collidingPosition.w,collidingPosition.y],rightOfItem=[position.x+position.w,collidingPosition.y],aboveOfItem=[collidingPosition.x,position.y-collidingPosition.h],belowOfItem=[collidingPosition.x,position.y+position.h],_gridList._itemFitsAtPosition(collidingItem,leftOfItem))_gridList._updateItemPosition(collidingItem,leftOfItem);else if(_gridList._itemFitsAtPosition(collidingItem,aboveOfItem))_gridList._updateItemPosition(collidingItem,aboveOfItem);else if(_gridList._itemFitsAtPosition(collidingItem,belowOfItem))_gridList._updateItemPosition(collidingItem,belowOfItem);else if(_gridList._itemFitsAtPosition(collidingItem,rightOfItem))_gridList._updateItemPosition(collidingItem,rightOfItem);else return!1}return GridList2.cloneItems(_gridList.items,this.items),this.generateGrid(),!0},_pullItemsToLeft:function(fixedItem){if(this._sortItemsByPosition(),this._resetGrid(),fixedItem){var fixedPosition=this._getItemPosition(fixedItem);this._updateItemPosition(fixedItem,[fixedPosition.x,fixedPosition.y])}for(var i=0;i<this.items.length;i++){var item=this.items[i],position=this._getItemPosition(item);if(!(fixedItem&&item==fixedItem)){var x=this._findLeftMostPositionForItem(item),newPosition=this.findPositionForItem(item,{x,y:0},position.y);this._updateItemPosition(item,newPosition)}}},_findLeftMostPositionForItem:function(item){for(var tail=0,position=this._getItemPosition(item),i=0;i<this.grid.length;i++)for(var j=position.y;j<position.y+position.h;j++){var otherItem=this.grid[i][j];if(otherItem){var otherPosition=this._getItemPosition(otherItem);this.items.indexOf(otherItem)<this.items.indexOf(item)&&(tail=otherPosition.x+otherPosition.w)}}return tail},_getItemByAttribute:function(key,value){for(var i=0;i<this.items.length;i++)if(this.items[i][key]===value)return this.items[i];return null},_padNumber:function(nr,prefix){return nr>=10?nr:prefix+nr},_getItemPosition:function(item){return this._options.direction==="horizontal"?item:{x:item.y,y:item.x,w:item.h,h:item.w}},_setItemPosition:function(item,position){this._options.direction==="horizontal"?(item.x=position[0],item.y=position[1]):(item.x=position[1],item.y=position[0])}};var GridCol=function(lanes){for(var i=0;i<lanes;i++)this.push(null)};return GridCol.prototype=[],GridList2})})(gridList$1);var gridListExports=gridList$1.exports;const gridList=getDefaultExportFromCjs(gridListExports),_GridList=_mergeNamespaces$1({__proto__:null,default:gridList},[gridListExports]),GridList=_GridList&&gridList||_GridList;class Grid extends common.HTMLWidget{constructor(){super(),__publicField2(this,"divItems"),__publicField2(this,"gridList"),__publicField2(this,"items"),__publicField2(this,"itemsMap"),__publicField2(this,"origItems"),__publicField2(this,"cellWidth"),__publicField2(this,"cellHeight"),__publicField2(this,"dragItem"),__publicField2(this,"dragItemPos"),__publicField2(this,"_d3Drag"),__publicField2(this,"_d3DragResize"),__publicField2(this,"_selectionBag"),__publicField2(this,"_scrollBarWidth"),this._tag="div",this._selectionBag=new common.Utility.Selection(this),this.content([])}getDimensions(){const size={width:0,height:0};return this.content().forEach(function(cell){size.width<cell.gridCol()+cell.gridColSpan()&&(size.width=cell.gridCol()+cell.gridColSpan()),size.height<cell.gridRow()+cell.gridRowSpan()&&(size.height=cell.gridRow()+cell.gridRowSpan())},this),size}clearContent(widget){this.content(this.content().filter(function(contentWidget){if(!widget)return contentWidget.target(null),!1;let w=contentWidget;for(;w;){if(widget===w)return contentWidget.target(null),!1;w=w.widget?w.widget():null}return!0}))}setContent(row,col,widget,title,rowSpan,colSpan){if(rowSpan=rowSpan||1,colSpan=colSpan||1,title=title||"",this.content(this.content().filter(function(contentWidget){return contentWidget.gridRow()===row&&contentWidget.gridCol()===col?(contentWidget.target(null),!1):!0})),widget){const cell=new Cell().gridRow(row).gridCol(col).widget(widget).title(title).gridRowSpan(rowSpan).gridColSpan(colSpan);this.content().push(cell)}return this}sortedContent(){return this.content().sort(function(l,r){return l.gridRow()===r.gridRow()?l.gridCol()-r.gridCol():l.gridRow()-r.gridRow()})}getCell(row,col){let retVal=null;return this.content().some(function(cell){return row>=cell.gridRow()&&row<cell.gridRow()+cell.gridRowSpan()&&col>=cell.gridCol()&&col<cell.gridCol()+cell.gridColSpan()?(retVal=cell,!0):!1}),retVal}getWidgetCell(id){let retVal=null;return this.content().some(function(cell){return cell.widget().id()===id?(retVal=cell,!0):!1}),retVal}getContent(id){let retVal=null;return this.content().some(function(cell){return cell.widget().id()===id?(retVal=cell.widget(),!0):!1}),retVal}cellToGridItem(cell){return{x:cell.gridCol(),y:cell.gridRow(),w:cell.gridColSpan(),h:cell.gridRowSpan(),id:cell.id(),cell}}gridItemToCell(item){item.cell.gridCol(item.x).gridRow(item.y).gridColSpan(item.w).gridRowSpan(item.h)}resetItemsPos(){this.origItems.forEach(function(origItem){const item=this.itemsMap[origItem.id];item.x=origItem.x,item.y=origItem.y},this)}initGridList(){this.itemsMap={},this.items=this.content().map(function(cell){const retVal=this.cellToGridItem(cell);return this.itemsMap[retVal.id]=retVal,retVal},this),this.origItems=this.content().map(this.cellToGridItem),this.gridList=new GridList(this.items,{direction:this.snapping(),lanes:this.snapping()==="horizontal"?this.snappingRows():this.snappingColumns()})}killGridList(){this.gridList=null,delete this.items,delete this.itemsMap}enter(domNode,element){super.enter(domNode,element),this._scrollBarWidth=common.Platform.getScrollbarWidth();const context=this;this._d3Drag=common.drag().subject(function(_d){const d=context.cellToGridItem(_d);return{x:d.x*context.cellWidth,y:d.y*context.cellHeight}}).on("start",function(_d){if(!context.designMode())return;common.d3Event().sourceEvent.stopPropagation(),context.initGridList();const d=context.itemsMap[_d.id()];context.dragItem=element.append("div").attr("class","dragging").style("transform",function(){return"translate("+d.x*context.cellWidth+"px, "+d.y*context.cellHeight+"px)"}).style("width",function(){return d.w*context.cellWidth-context.gutter()+"px"}).style("height",function(){return d.h*context.cellHeight-context.gutter()+"px"}),context.selectionBagClick(_d)}).on("drag",function(_d){if(!context.designMode())return;const event=common.d3Event();event.sourceEvent.stopPropagation();const d=context.itemsMap[_d.id()];event.x<0&&(event.x=0),event.x+d.w*context.cellWidth>context.snappingColumns()*context.cellWidth&&(event.x=context.snappingColumns()*context.cellWidth-d.w*context.cellWidth),event.y<0&&(event.y=0),event.y+d.h*context.cellWidth>context.snappingRows()*context.cellWidth&&(event.y=context.snappingRows()*context.cellWidth-d.h*context.cellWidth);const pos=[Math.max(0,Math.floor((event.x+context.cellWidth/2)/context.cellWidth)),Math.max(0,Math.floor((event.y+context.cellHeight/2)/context.cellHeight))];(d.x!==pos[0]||d.y!==pos[1])&&(context.snapping()!=="none"?(context.resetItemsPos(),context.gridList.moveItemToPosition(d,pos)):(d.x=pos[0],d.y=pos[1]),(_d.gridCol()!==d.x||_d.gridRow()!==d.y)&&(context.items.forEach(context.gridItemToCell),context.updateGrid(!1,100))),context.dragItem.style("transform",function(){return"translate("+event.x+"px, "+event.y+"px)"}).style("width",function(){return d.w*context.cellWidth+"px"}).style("height",function(){return d.h*context.cellHeight+"px"})}).on("end",function(){context.designMode()&&(common.d3Event().sourceEvent.stopPropagation(),context.dragItem.remove(),context.dragItem=null,context.killGridList())}),this._d3DragResize=common.drag().subject(function(_d){const d=context.cellToGridItem(_d);return{x:(d.x+d.w-1)*context.cellWidth,y:(d.y+d.h-1)*context.cellHeight}}).on("start",function(_d){if(!context.designMode())return;common.d3Event().sourceEvent.stopPropagation(),context.initGridList();const d=context.itemsMap[_d.id()];context.dragItem=element.append("div").attr("class","resizing").style("transform",function(){return"translate("+d.x*context.cellWidth+"px, "+d.y*context.cellHeight+"px)"}).style("width",function(){return d.w*context.cellWidth-context.gutter()+"px"}).style("height",function(){return d.h*context.cellHeight-context.gutter()+"px"}),context.dragItemPos={x:d.x,y:d.y}}).on("drag",function(_d){if(!context.designMode())return;const event=common.d3Event();event.sourceEvent.stopPropagation();const d=context.itemsMap[_d.id()],pos=[Math.max(0,Math.round(event.x/context.cellWidth)),Math.max(0,Math.round(event.y/context.cellHeight))],size={w:Math.max(1,pos[0]-d.x+1),h:Math.max(1,pos[1]-d.y+1)};(d.w!==size.w||d.h!==size.h)&&(context.snapping()!=="none"?(context.resetItemsPos(),context.gridList.resizeItem(d,size)):(d.w=size.w,d.h=size.h),(_d.gridColSpan()!==d.w||_d.gridRowSpan()!==d.h)&&(context.items.forEach(context.gridItemToCell),context.updateGrid(d.id,100))),context.dragItem.style("width",function(){return(-d.x+1)*context.cellWidth+event.x-context.gutter()+"px"}).style("height",function(){return(-d.y+1)*context.cellHeight+event.y-context.gutter()+"px"})}).on("end",function(){context.designMode()&&(common.d3Event().sourceEvent.stopPropagation(),context.dragItem.remove(),context.dragItem=null,context.killGridList())})}updateGrid(resize,transitionDuration=0,_noRender=!1){transitionDuration=transitionDuration||0;const context=this;this.divItems.classed("draggable",this.designMode()).transition().duration(transitionDuration).style("left",function(d){return d.gridCol()*context.cellWidth+context.gutter()/2+"px"}).style("top",function(d){return d.gridRow()*context.cellHeight+context.gutter()/2+"px"}).style("width",function(d){return d.gridColSpan()*context.cellWidth-context.gutter()+"px"}).style("height",function(d){return d.gridRowSpan()*context.cellHeight-context.gutter()+"px"}).on("end",function(d){d.surfaceShadow_default(context.surfaceShadow()).surfacePadding_default(context.surfacePadding()).surfaceBorderWidth_default(context.surfaceBorderWidth()).surfaceBackgroundColor_default(context.surfaceBackgroundColor()),(resize===!0||resize===d.id())&&d.resize().lazyRender()})}update(domNode,element2){super.update(domNode,element2),this._placeholderElement.style("overflow-x",this.fitTo()==="width"?"hidden":null),this._placeholderElement.style("overflow-y",this.fitTo()==="width"?"scroll":null);const dimensions=this.getDimensions(),clientWidth=this.width()-(this.fitTo()==="width"?this._scrollBarWidth:0);if(this.cellWidth=clientWidth/dimensions.width,this.cellHeight=this.fitTo()==="all"?this.height()/dimensions.height:this.cellWidth,this.designMode()){const cellLaneRatio=Math.min(this.width()/this.snappingColumns(),this.height()/this.snappingRows()),laneWidth=Math.floor(cellLaneRatio);this.cellWidth=laneWidth,this.cellHeight=this.cellWidth}const context=this,divItems=element2.selectAll("#"+this.id()+" > .ddCell").data(this.content(),function(d){return d.id()});this.divItems=divItems.enter().append("div").attr("class","ddCell").each(function(d){d.target(this),d.__grid_watch=d.monitor(function(key,newVal,oldVal){context._renderCount&&(key==="snapping"||key.indexOf("grid")===0)&&newVal!==oldVal&&(context.gridList||(context.initGridList(),context.snapping()!=="none"&&context.gridList.resizeGrid(context.snapping()==="horizontal"?context.snappingRows():context.snappingColumns()),context.items.forEach(context.gridItemToCell),context.updateGrid(d.id(),100),context.killGridList()))}),common.select(this).append("div").attr("class","resizeHandle").call(context._d3DragResize).append("div").attr("class","resizeHandleDisplay")}).merge(divItems),this.divItems.each(function(d){const element=common.select(this);context.designMode()?element.call(context._d3Drag):element.on("mousedown.drag",null).on("touchstart.drag",null)}),this.divItems.select(".resizeHandle").style("display",this.designMode()?null:"none"),this.updateGrid(!0),divItems.exit().each(function(d){d.target(null),d.__grid_watch&&d.__grid_watch.remove()}).remove();const lanesBackground=element2.selectAll("#"+this.id()+" > .laneBackground").data(this.designMode()?[""]:[]);lanesBackground.enter().insert("div",":first-child").attr("class","laneBackground").style("left","1px").style("top","1px").on("click",function(){context.selectionBagClear()}).merge(lanesBackground).style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px"),lanesBackground.exit().each(function(){context.selectionBagClear()}).remove();const lanes=element2.selectAll("#"+this.id()+" > .lane").data(this.designMode()?[""]:[]);lanes.enter().append("div").attr("class","lane").style("left","1px").style("top","1px"),lanes.style("display",this.showLanes()?null:"none").style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px").style("background-image","linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px)").style("background-size",this.cellWidth+"px "+this.cellHeight+"px"),lanes.exit().remove()}exit(domNode,element){this.content().forEach(w=>w.target(null)),super.exit(domNode,element)}_createSelectionObject(d){return{_id:d._id,element:()=>d._element,widget:d}}selection(_){return arguments.length?(this._selectionBag.set(_.map(function(row){return this._createSelectionObject(row)},this)),this):this._selectionBag.get().map(function(d){return d._id})}selectionBagClear(){this._selectionBag.isEmpty()||(this._selectionBag.clear(),this.postSelectionChange())}selectionBagClick(d){if(d!==null){const selectionObj=this._createSelectionObject(d);if(common.d3Event().sourceEvent.ctrlKey)this._selectionBag.isSelected(selectionObj)?(this._selectionBag.remove(selectionObj),this.postSelectionChange()):(this._selectionBag.append(selectionObj),this.postSelectionChange());else{const selected=this._selectionBag.get();selected.length===1&&selected[0]._id===selectionObj._id?this.selectionBagClear():this._selectionBag.set([selectionObj]),this.postSelectionChange()}}}postSelectionChange(){}applyLayout(layoutArr){this.divItems.each((d,i)=>{if(layoutArr[i]){const[x,y,w,h]=layoutArr[i];d.gridCol(x).gridRow(y).gridColSpan(w).gridRowSpan(h)}}),this.updateGrid(!0)}vizActivation(elem){}}Grid.prototype._class+=" layout_Grid",Grid.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),Grid.prototype.publish("showLanes",!0,"boolean","Show snapping lanes when in design mode",null,{tags:["Basic"],disable:w=>!w.designMode()}),Grid.prototype.publish("fitTo","all","set","Sizing Strategy",["all","width"],{tags:["Basic"]}),Grid.prototype.publish("snapping","vertical","set","Snapping Strategy",["vertical","horizontal","none"]),Grid.prototype.publish("snappingColumns",12,"number","Snapping Columns"),Grid.prototype.publish("snappingRows",16,"number","Snapping Rows"),Grid.prototype.publish("gutter",6,"number","Gap Between Widgets",null,{tags:["Basic"]}),Grid.prototype.publish("surfaceShadow",!0,"boolean","3D Shadow"),Grid.prototype.publish("surfacePadding",null,"string","Cell Padding (px)",null,{tags:["Intermediate"]}),Grid.prototype.publish("surfaceBorderWidth",1,"number","Width (px) of Cell Border",null,{tags:["Intermediate"]}),Grid.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),Grid.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Basic"],render:!1});class HorizontalList extends FlexGrid{constructor(){super(),this.orientation_default("horizontal"),this.flexWrap_default("nowrap")}}HorizontalList.prototype._class+=" layout_HorizontalList";class Layered extends common.HTMLWidget{constructor(){super(),__publicField2(this,"_contentContainer"),__publicField2(this,"_widgetPlacements"),__publicField2(this,"_widgetRatios"),this._tag="div",this._widgetPlacements=[],this._widgetRatios=[]}addLayer(widget,placement="default",widthRatio=1,heightRatio=1){const widgets=this.widgets();return widgets.push(widget||new common.Text().text("No widget defined for layer.")),this.widgets(widgets),this._widgetPlacements.push(placement),this._widgetRatios.push([widthRatio,heightRatio]),this}enter(domNode,element){super.enter(domNode,element),this._contentContainer=element.append("div").attr("class","container")}update(domNode,element){super.update(domNode,element);const context=this;element.style("padding",this.surfacePadding()+"px");const content=this._contentContainer.selectAll(".content.id"+this.id()).data(this.widgets(),function(d){return d.id()});content.enter().append("div").attr("class","content id"+this.id()).each(function(widget,idx){widget.target(this)}).merge(content).each(function(widget,idx){const clientSize={width:context.clientWidth(),height:context.clientHeight()},widgetSize=context.widgetSize(idx,clientSize),widgetPosition=context.widgetPosition(idx,clientSize,widgetSize);this.style.top=widgetPosition.y+"px",this.style.left=widgetPosition.x+"px",widget.resize(widgetSize).render()}),content.exit().each(function(widget,idx){widget.target(null)}).remove(),content.order()}widgetSize(idx,clientSize){return this._widgetPlacements[idx]==="default"?{width:clientSize.width*this._widgetRatios[idx][0],height:clientSize.height*this._widgetRatios[idx][1]}:{width:clientSize.width*this._widgetRatios[idx][0],height:clientSize.height*this._widgetRatios[idx][1]}}widgetPosition(idx,clientSize,widgetSize){switch(this._widgetPlacements[idx]){default:return{x:0,y:0};case"top":return{x:clientSize.width/2-widgetSize.width/2,y:0};case"bottom":return{x:clientSize.width/2-widgetSize.width/2,y:clientSize.height-widgetSize.height};case"left":return{x:0,y:clientSize.height/2-widgetSize.height/2};case"right":return{x:clientSize.width-widgetSize.width,y:clientSize.height/2-widgetSize.height/2};case"center":return{x:clientSize.width/2-widgetSize.width/2,y:clientSize.height/2-widgetSize.height/2}}}}Layered.prototype._class+=" layout_Layered",Layered.prototype.publish("surfacePadding",0,"number","Padding"),Layered.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});class Popup extends common.HTMLWidget{constructor(){super(),__publicField2(this,"_surfaceButtons"),__publicField2(this,"_originalPosition"),this._tag="div",this._surfaceButtons=[]}updateState(visible){visible=visible||!this.popupState(),this.popupState(visible).render()}enter(domNode,element){super.enter(domNode,element),this.widget().target(domNode),this._originalPosition=this.position()}update(domNode,element){super.update(domNode,element),element.style("visibility",this.popupState()?null:"hidden").style("opacity",this.popupState()?null:0).style("width",this.shrinkWrap()?this.widget().width()+"px":this._size.width+"px").style("height",this.shrinkWrap()?this.widget().height()+"px":this._size.height+"px"),this.widget().size().height===0&&this.widget().resize(this.size())}postUpdate(domNode,element){let left,top;switch(this.centerPopup()){case"container":this._placeholderElement&&(left=parseInt(this._placeholderElement.style("width"))/2-this.widget().width()/2,top=parseInt(this._placeholderElement.style("height"))/2-this.widget().height()/2),this.position("absolute");break;case"window":left=window.innerWidth/2-this.widget().width()/2,top=window.innerHeight/2-this.widget().height()/2,this.position("fixed");break;default:left=0,top=0,this.position(this._originalPosition);break}this.pos({x:left,y:top}),super.postUpdate(domNode,element),element.style("position",this.position()).style("left",this.left()+"px").style("right",this.right()+"px").style("top",this.top()+"px").style("bottom",this.bottom()+"px")}exit(domNode,element){this.widget()&&this.widget().target(null),super.exit(domNode,element)}click(obj){}}Popup.prototype._class+=" layout_Popup",Popup.prototype.publish("popupState",!1,"boolean","State of the popup, visible (true) or hidden (false)",null,{}),Popup.prototype.publish("shrinkWrap",!1,"boolean","The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)",null,{}),Popup.prototype.publish("centerPopup","none","set","Center the widget in its container element (target) or in the window",["none","container","window"],{}),Popup.prototype.publish("top",null,"number","Top position property of popup",null,{}),Popup.prototype.publish("bottom",null,"number","Bottom position property of popup",null,{}),Popup.prototype.publish("left",null,"number","Left position property of popup",null,{}),Popup.prototype.publish("right",null,"number","Right position property of popup",null,{}),Popup.prototype.publish("position","relative","set","Value of the 'position' property",["absolute","relative","fixed","static","initial","inherit"],{tags:["Private"]}),Popup.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]});class Tabbed extends common.HTMLWidget{constructor(){super(),__publicField2(this,"_tabContainer"),__publicField2(this,"_contentContainer"),this._tag="div"}clearTabs(){return this.labels([]),this.widgets([]),this}addTab(widget,label,isActive,callback){const widgetSize=widget.size();widgetSize.width===0&&widgetSize.height===0&&widget.size({width:"100%",height:"100%"});const labels=this.labels(),widgets=this.widgets();isActive&&this.activeTabIdx(this.widgets().length),labels.push(label);const surface=new Surface().widget(widget||new common.Text().text("No widget defined for tab"));return widgets.push(surface),this.labels(labels),this.widgets(widgets),callback&&callback(surface),this}widgetSize(widgetDiv){const width=this.clientWidth();let height=this.clientHeight();const tcBox=this._tabContainer.node().getBoundingClientRect();return typeof tcBox.height<"u"&&(height-=tcBox.height),{width,height}}enter(domNode,element){super.enter(domNode,element),this._tabContainer=element.append("div"),this._contentContainer=element.append("div")}update(domNode,element){super.update(domNode,element);const context=this;element.style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null);const tabs=this._tabContainer.selectAll(".tab-button.id"+this.id()).data(this.showTabs()?this.labels():[],function(d){return d});tabs.enter().append("span").attr("class","tab-button id"+this.id()).style("cursor","pointer").on("click",function(d,idx){context.click(context.widgets()[idx].widget(),d,idx),context.activeTabIdx(idx).render()}).merge(tabs).classed("active",function(d,idx){return context.activeTabIdx()===idx}).text(function(d){return d}),tabs.exit().remove();const content=this._contentContainer.selectAll(".tab-content.id"+this.id()).data(this.widgets(),function(d){return d.id()});switch(content.enter().append("div").attr("class","tab-content id"+this.id()).each(function(widget,idx){widget.target(this)}).merge(content).classed("active",function(d,idx){return context.activeTabIdx()===idx}).style("display",function(d,idx){return context.activeTabIdx()===idx?"block":"none"}).each(function(surface,idx){if(surface.visible(context.activeTabIdx()===idx),context.activeTabIdx()===idx){const wSize=context.widgetSize(common.select(this));surface.surfaceBorderWidth(context.showTabs()?null:0).surfacePadding(context.showTabs()?null:0).resize(wSize)}}),content.exit().each(function(widget,idx){widget.target(null)}).remove(),this.tabLocation()){case"bottom":this._tabContainer.attr("class","on_bottom").style("top",this._contentContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute"),this._contentContainer.style("top",this.surfacePadding_exists()?this.surfacePadding()+"px":null).style("position","absolute");break;default:this._tabContainer.attr("class","on_top").style("top",null).style("position","relative"),this._contentContainer.style("top",this._tabContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute");break}}click(widget,column,idx){}}Tabbed.prototype._class+=" layout_Tabbed",Tabbed.prototype.publish("showTabs",!0,"boolean","Show Tabs",null,{}),Tabbed.prototype.publish("surfacePadding",4,"number","Padding"),Tabbed.prototype.publish("activeTabIdx",0,"number","Index of active tab",null,{}),Tabbed.prototype.publish("labels",[],"array","Array of tab labels sharing an index with ",null,{tags:["Private"]}),Tabbed.prototype.publish("tabLocation","top","set","Position the tabs at the bottom of the widget",["top","bottom"],{tags:["Private"]}),Tabbed.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});class Toolbar extends common.HTMLWidget{constructor(){super(),this._tag="div"}enter(domNode,element){super.enter(domNode,element)}update(domNode,element){super.update(domNode,element);const context=this;element.attr("title",context.title()).style("background-color",this.backgroundColor());const title=element.selectAll("div.toolbar-title").data(this.title()?[this.title()]:[]);title.enter().append("div").classed("toolbar-title",!0).append("span"),title.selectAll("div.toolbar-title > span").style("font-size",this.fontSize_exists()?this.fontSize()+"px":null).style("color",this.fontColor_exists()?this.fontColor():null).style("font-family",this.fontFamily_exists()?this.fontFamily():null).style("font-weight",this.fontBold_exists()?this.fontBold()?"bold":"normal":null).style("background-color",this.backgroundColor_exists()?this.backgroundColor():null).text(context.title()),title.exit().remove();const childWidgets=element.selectAll("div.toolbar-child").data(this.widgets()!==null?this.widgets():[],function(d){return d.id()});childWidgets.enter().insert("div","div.toolbar-title").each(function(d,i){const widgetClass=context.widgetClasses()[i]?context.widgetClasses()[i]+" toolbar-child":"toolbar-child";common.select(this).classed(widgetClass,!0),d.target(this)}),childWidgets.exit().each(function(d){d.target(null)}).remove(),childWidgets.order()}render(callback){const context=this;return super.render(function(w){const toolbarBBox=context.element().node().getBoundingClientRect();let minX=toolbarBBox.left+toolbarBBox.width;context.element().selectAll("div.toolbar-child").each(function(d,i){const childBBox=this.getBoundingClientRect();minX>childBBox.left&&(minX=childBBox.left)}),context.element().select(".toolbar-title").style("width",minX-toolbarBBox.left-4+"px"),callback&&callback(w)})}exit(domNode,element){this.widgets().forEach(function(w){w.target(null)}),super.exit(domNode,element)}}Toolbar.prototype._class+=" layout_Toolbar",Toolbar.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),Toolbar.prototype.publish("fontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],optional:!0}),Toolbar.prototype.publish("fontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],optional:!0}),Toolbar.prototype.publish("fontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],optional:!0}),Toolbar.prototype.publish("fontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],optional:!0}),Toolbar.prototype.publish("backgroundColor",null,"html-color","Background Color",null,{tags:["Intermediate"],optional:!0}),Toolbar.prototype.publish("responsive",!0,"boolean","Adapts to pixel width",null,{tags:["Basic"]}),Toolbar.prototype.publish("widgets",[],"widgetArray","Child widgets of the toolbar",null,{tags:["Basic"]}),Toolbar.prototype.publish("widgetClasses",[],"array","Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)",null,{tags:["Basic"]});class VerticalList extends FlexGrid{constructor(){super(),this.orientation_default("vertical"),this.flexWrap_default("nowrap")}}VerticalList.prototype._class+=" layout_VerticalList",function(){try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.layout_AbsoluteSurface{pointer-events:none!important}.layout_AbsoluteSurface>.placeholder{position:relative;overflow:hidden;pointer-events:all}.layout_Accordion>ul{position:relative}.layout_Accordion.open>span{font-style:italic}.layout_Accordion.closed>ul{height:0px;overflow:hidden}.layout_Accordion.open>ul{display:block}.layout_Accordion>.collapsible-icon,.layout_Accordion>.collapsible-title{cursor:pointer;box-sizing:border-box}.layout_Accordion>.collapsible-title{display:block;width:100%}.layout_Accordion>.collapsible-title{font-size:13px;color:#fff;padding:4px 8px;height:26px;-webkit-box-shadow:inset 0px -1px 1px 0px rgba(0,0,0,.2);-moz-box-shadow:inset 0px -1px 1px 0px rgba(0,0,0,.2);box-shadow:inset 0 -1px 1px #0003}.layout_Accordion li{background-color:#fff}.layout_Accordion>ul,.layout_Accordion>.collapsible-title{background-color:#333}.layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion>.collapsible-title{background-color:#555}.layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#777}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#999}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#bbb}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#ccc}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#ddd}.layout_Accordion>ul,.layout_Accordion>span{padding-left:0}.layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion>span{padding-left:12px}.layout_Accordion>.collapsible-title:before{padding:4px 8px;position:absolute;left:0;top:0}.layout_Accordion>.collapsible-icon{position:absolute;top:0;right:0;width:24px;height:24px;color:#fff}.layout_Surface{box-sizing:border-box;margin:0;border:1px solid #e5e5e5;overflow:hidden;height:100%;width:100%}.layout_Surface.shadow2{box-shadow:0 2px 2px #00000024,0 3px 1px -2px #0003,0 1px 5px #0000001f}.layout_Surface>h3{margin:0;padding:2px;background-color:#e5e5e5}.layout_Surface .html-button-container{position:absolute;right:0;top:3px}.layout_Surface>div{padding:8px}.layout_Surface .html-button-container .surface-button{margin-right:5px}.layout_Surface .html-button-container .surface-button i{opacity:.8}.layout_Surface .html-button-container .surface-button:hover{opacity:1}.layout_Surface .html-button-container .surface-button:active{opacity:.5}div[draggable=true].hideDragCellContent.content-icon:before{content:"";font-family:FontAwesome;position:absolute;top:calc(50% - 74px);left:calc(50% - 56px);font-size:100px}div[draggable=true].hideDragCellContent.content-icon-Line:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Pie:before{top:calc(50% - 72px);left:calc(50% - 45px);content:""}div[draggable=true].hideDragCellContent.content-icon-Area:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Gauge:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Table:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Form:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Grid:before,div[draggable=true].hideDragCellContent.content-icon-Graph:before,div[draggable=true].hideDragCellContent.content-icon-Border:before,div[draggable=true].hideDragCellContent.content-icon-Tabbed:before,div[draggable=true].hideDragCellContent.content-icon-Accordion:before,div[draggable=true].hideDragCellContent.content-icon-MultiChart:before,div[draggable=true].hideDragCellContent.content-icon-MultiChartSurface:before{content:""}div[draggable=true].hideDragCellContent.content-icon-ChoroplethStates:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethStatesHeat:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethCounties:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethCountries:before,div[draggable=true].hideDragCellContent.content-icon-GMap:before,div[draggable=true].hideDragCellContent.content-icon-GMapHeat:before,div[draggable=true].hideDragCellContent.content-icon-GMapGraph:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Text:before,div[draggable=true].hideDragCellContent.content-icon-TextBox:before,div[draggable=true].hideDragCellContent.content-icon-FAChar:before{content:""}.layout_Cell .update-indicator{box-sizing:border-box;position:absolute;top:0;left:0;padding:0;z-index:1000;border-width:0px;border-style:solid;pointer-events:none}.layout_Border{width:100%;height:100%}.layout_Border>.border-content{width:100%;height:100%;position:relative}.layout_Border>.borderHandle{width:6px;height:6px;background-color:#444;opacity:.3;position:absolute;visibility:hidden}.layout_Border.design-mode>.borderHandle{visibility:visible}.layout_Border>.borderHandle:hover{background-color:#666}.layout_Border>.borderHandle.borderHandleDisabled{display:none}.layout_Border>.borderHandle_top,.layout_Border>.borderHandle_bottom{cursor:ns-resize}.layout_Border>.borderHandle_left,.layout_Border>.borderHandle_right{cursor:ew-resize}.layout_Border .cell{border-radius:5px;border:1px solid #e5e5e5;display:inline-block;overflow:hidden}.layout_Border .cell h2{margin:0;padding-top:4px;-webkit-margin:0px;text-align:center}.layout_Border .layout_BorderCell.over{border:2px dashed #000}.layout_Border .dragItem{z-index:-1;opacity:.33}.layout_Border .notDragItem{z-index:-1;opacity:1}.layout_Border div[draggable=true]{opacity:.75;cursor:default}.layout_Border div[draggable=true] .dragHandle{opacity:1}.layout_Border div[draggable=true] .dragHandle_n,.layout_Border div[draggable=true] .dragHandle_e,.layout_Border div[draggable=true] .dragHandle_s,.layout_Border div[draggable=true] .dragHandle_w{background-color:#aaa}.layout_Border div[draggable=true] .dragHandle_nw,.layout_Border div[draggable=true] .dragHandle_ne,.layout_Border div[draggable=true] .dragHandle_se,.layout_Border div[draggable=true] .dragHandle_sw{background-color:#333}.layout_Border div[draggable=true] .dragHandle_nw{cursor:nw-resize}.layout_Border div[draggable=true] .dragHandle_n{cursor:n-resize}.layout_Border div[draggable=true] .dragHandle_ne{cursor:ne-resize}.layout_Border div[draggable=true] .dragHandle_e{cursor:e-resize}.layout_Border div[draggable=true] .dragHandle_se{cursor:se-resize}.layout_Border div[draggable=true] .dragHandle_s{cursor:s-resize}.layout_Border div[draggable=true] .dragHandle_sw{cursor:sw-resize}.layout_Border div[draggable=true] .dragHandle_w{cursor:w-resize}.layout_Border div[draggable=false]>div>.dragHandle{display:none}.layout_Border .grid-drop-target{position:fixed;box-sizing:border-box;border:2px dashed #7f8c8d;border-radius:0;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,#6464641a 4px,#6464641a 8px)}.layout_Border .grid-drop-target.drop-target-over{border:2px dashed #179BD7;background:repeating-linear-gradient(-45deg,#0000,#0000 6px,#119bd71a 6px,#119bd71a 12px)}.layout_Border2{display:flex;flex-direction:column}.layout_Border2>.body{margin:0;padding:0;display:flex;flex-flow:row}.layout_Border2>.body>.center{flex:1}.layout_Border2>.header{display:block}.layout_Border2>.footer{display:block}.layout_Carousel>div{position:relative;overflow:hidden}.layout_Carousel>div>.carouselItem{position:absolute}.layout_Modal-header{background-color:#3f51b5;overflow:hidden}.layout_Modal-body{background-color:#fff;overflow-y:scroll;overflow-x:hidden}.layout_Modal-title,.layout_Modal-annotations{position:absolute}.layout_Modal-closeButton{cursor:pointer}.layout_Modal-closeButton:hover{opacity:.7}.layout_Modal-closeButton:active{opacity:.5}.layout_Modal-fade{position:fixed;background-color:#000;opacity:.5;z-index:10000}.layout_Modal-content{position:fixed;background-color:#fff;z-index:10100}.layout_Modal-fade-hidden{display:none}.layout_Modal-fadeClickable{cursor:pointer}.layout_ChartPanel .series.highlight{stroke-width:2px;opacity:1}.layout_ChartPanel .series.lowlight{opacity:.3!important}.layout_FlexGrid{display:flex}.FlexGrid-list-item{overflow:hidden;border-style:solid;flex-grow:1}.layout_Grid>.ddCell{position:absolute}.layout_Grid>.laneBackground{position:absolute;border-style:solid;border-width:1px;background:#f5f5f5}.layout_Grid>.lane{position:absolute;border-style:none;opacity:.25;border-radius:0;pointer-events:none}.layout_Grid>.ddCell.draggable{border-style:solid;border-width:1px;background-color:#f8f8ff;border-radius:0;cursor:move}.layout_Grid>.ddCell.draggable>.resizeHandle{bottom:0;right:0;width:8px;height:8px;border-style:none;position:absolute;cursor:nwse-resize}.layout_Grid>.ddCell.draggable .resizeHandleDisplay{bottom:2px;right:2px;width:4px;height:4px;border-style:solid;border-left-width:0px;border-top-width:0px;border-right-width:2px;border-bottom-width:2px;border-color:#a9a9a9;background-color:none;position:absolute}.layout_Grid>.ddCell.draggable .resizeHandleDisplay:hover{border-color:orange}.layout_Grid>.dragging{border-style:solid;border-width:1px;border-color:gray;border-radius:0;position:absolute;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,#6464641a 4px,#6464641a 8px)}.layout_Grid>.resizing{border-style:solid;border-width:1px;border-color:gray;background-color:orange;border-radius:0;position:absolute;opacity:.3;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,orange 4px,orange 8px)}.layout_Grid>.ddCell.draggable .common_Widget.selected{border-style:solid;border-width:1px;border-color:red;background-color:gray;border-radius:0;position:absolute;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,#6400001a 4px,#6400001a 8px)}.layout_Grid #drag-me:before{content:"#" attr(id);font-weight:700}.layout_Layered{pointer-events:none}.layout_Layered>.container>.content{position:absolute}.layout_Layered>.container>.content>div>.common_Widget,.layout_Layered>.container>.content>div>svg>.common_Widget{pointer-events:all}.layout_Tabbed .tab-button{position:relative;top:1px;display:inline-block;border-left:1px solid #ddd;border-top:1px solid #ddd;border-right:1px solid #ddd;background-color:transparent;margin-right:4px;padding:2px 2px 4px;background-color:#ccc}.layout_Tabbed .tab-button.active{background-color:#fff;z-index:999}.layout_Tabbed .on_bottom .tab-button{border-bottom:1px solid #ddd;border-top:none;top:-1px}.layout_Toolbar{height:100%;background-color:#ddd;white-space:nowrap;overflow:hidden}.layout_Toolbar .toolbar-title{display:inline-block;position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%);margin-left:4px;font-weight:700;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.layout_Toolbar .toolbar-child{position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%);float:right;margin-left:4px;margin-right:4px;line-height:16px}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();function requireWidget(classID){return new Promise(function(resolve,_reject){const parsedClassID=common.Utility.parseClassID(classID);require&&require([parsedClassID.package],function(Package){let Widget=null;Package&&Package[parsedClassID.widgetID]&&(Widget=Package[parsedClassID.widgetID]),resolve(parsedClassID.memberWidgetID?Widget.prototype?Widget.prototype[parsedClassID.memberWidgetID]:Widget[parsedClassID.memberWidgetID]:Widget)})})}function requireWidgets(classIDs){return Promise.all(classIDs.map(requireWidget))}const Utility=Object.freeze(Object.defineProperty({__proto__:null,requireWidget,requireWidgets},Symbol.toStringTag,{value:"Module"}));class MultiChart extends common.HTMLWidget{constructor(){super();__publicField(this,"_allCharts",{});__publicField(this,"_chartTypeDefaults");__publicField(this,"_chartTypeProperties");__publicField(this,"_chartMonitor");__publicField(this,"_switchingTo");api.INDChart.call(this),api.IGraph.call(this),this._tag="div",this._allCharts={},this._allChartTypes.forEach(function(item){const newItem=JSON.parse(JSON.stringify(item));newItem.widget=null,this._allCharts[item.id]=newItem,this._allCharts[item.display]=newItem,this._allCharts[item.widgetClass]=newItem},this),this._chartTypeDefaults={},this._chartTypeProperties={}}fields(_){const retVal=super.fields.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().fields();this.chart().fields(_)}return retVal}columns(_,asDefault){const retVal=common.HTMLWidget.prototype.columns.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().columns();this.chart().columns(_,asDefault)}return retVal}data(_){const retVal=common.HTMLWidget.prototype.data.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().data();this.chart().data(_)}return retVal}hasOverlay(){return this.chart()&&this.chart().hasOverlay()}visible(_){return arguments.length?(this.chart()&&this.chart().visible(_),this):this.chart()&&this.chart().visible()}chartTypeDefaults(_){return arguments.length?(this._chartTypeDefaults=_,this):this._chartTypeDefaults}chartTypeProperties(_){return arguments.length?(this._chartTypeProperties=_,this):this._chartTypeProperties}getChartDataFamily(){return this._allCharts[this.chartType()].family}requireContent(chartType,callback){const classInfo=common.Utility.parseClassID(this._allCharts[chartType].widgetClass);switch(classInfo.package){case"@hpcc-js/chart":import("@hpcc-js/chart").then(mod=>{callback(new mod[classInfo.widgetID])});break;case"@hpcc-js/dgrid":import("@hpcc-js/dgrid").then(mod=>{callback(new mod[classInfo.widgetID])});break;default:requireWidget(this._allCharts[chartType].widgetClass).then(function(WidgetClass){callback(new WidgetClass)})}}switchChart(callback){if(this._switchingTo===this.chartType()){callback&&callback(this);return}else this._switchingTo&&console.warn("Attempting switch to: "+this.chartType()+", before previous switch is complete ("+this._switchingTo+")");this._switchingTo=this.chartType();const oldContent=this.chart(),context=this;this.requireContent(this.chartType(),function(newContent){if(newContent!==oldContent){const size=context.size();newContent.fields(context.fields()).data(context.data()).size(size),context.chart(newContent),oldContent&&oldContent.size({width:1,height:1}).render()}delete context._switchingTo,callback&&callback(this)})}update(domNode,element){super.update(domNode,element);const content=element.selectAll(".multiChart").data(this.chart()?[this.chart()]:[],function(d){return d._id});content.enter().append("div").attr("class","multiChart").each(function(d){d.target(this)});const currChart=this.chart();if(currChart){for(const key in this._chartTypeDefaults)if(currChart[key+"_default"])try{currChart[key+"_default"](this._chartTypeDefaults[key])}catch{console.warn("Exception Setting Default: "+key)}else console.warn("Unknown Default: "+key);this._chartTypeDefaults={};for(const propKey in this._chartTypeProperties)if(currChart[propKey])try{currChart[propKey](this._chartTypeProperties[propKey])}catch{console.warn("Exception Setting Property: "+propKey)}else console.warn("Unknown Property: "+propKey);this._chartTypeProperties={}}const context=this;content.each(function(d){d.resize(context.size())}),content.exit().transition().each(function(d){d.target(null)}).remove()}exit(domNode,element){this._chartMonitor&&(this._chartMonitor.remove(),delete this._chartMonitor),this.chart()&&this.chart().target(null),super.exit(domNode,element)}render(_callback){if(this.chartType()&&(!this.chart()||this.chart().classID()!==this._allCharts[this.chartType()].widgetClass)){const context=this,args=arguments;return this.switchChart(function(){common.HTMLWidget.prototype.render.apply(context,args)}),this}return common.HTMLWidget.prototype.render.apply(this,arguments)}}MultiChart.prototype._class+=" composite_MultiChart",MultiChart.prototype.implements(api.INDChart.prototype),MultiChart.prototype.implements(api.IGraph.prototype),MultiChart.prototype._otherChartTypes=[{id:"FORM",display:"Form",widgetClass:"form_FieldForm"}].map(function(item){return item.family="other",item}),MultiChart.prototype._graphChartTypes=[{id:"GRAPH",display:"Graph",widgetClass:"graph_Graph"},{id:"ADJACENCY_GRAPH",display:"Graph",widgetClass:"graph_AdjacencyGraph"},{id:"GRAPHC",display:"GraphC",widgetClass:"graph_GraphC"}].map(function(item){return item.family="GRAPH",item}),MultiChart.prototype._1DChartTypes=[].map(function(item){return item.family="1D",item}),MultiChart.prototype._2DChartTypes=[{id:"SUMMARY",display:"Summary",widgetClass:"chart_Summary"},{id:"BUBBLE",display:"Bubble",widgetClass:"chart_Bubble"},{id:"PIE",display:"Pie",widgetClass:"chart_Pie"},{id:"WORD_CLOUD",display:"Word Cloud",widgetClass:"other_WordCloud"}].map(function(item){return item.family="2D",item}),MultiChart.prototype._NDChartTypes=[{id:"COLUMN",display:"Column",widgetClass:"chart_Column"},{id:"BAR",display:"Bar",widgetClass:"chart_Bar"},{id:"LINE",display:"Line",widgetClass:"chart_Line"},{id:"AREA",display:"Area",widgetClass:"chart_Area"},{id:"STEP",display:"Step",widgetClass:"chart_Step"},{id:"SCATTER",display:"Scatter",widgetClass:"chart_Scatter"},{id:"HEXBIN",display:"Hex Bin",widgetClass:"chart_HexBin"}].map(function(item){return item.family="ND",item}),MultiChart.prototype._mapChartTypes=[{id:"CHORO_USSTATES",display:"US State Choropleth",widgetClass:"map_ChoroplethStates"},{id:"CHORO_USCOUNTIES",display:"US County Choropleth",widgetClass:"map_ChoroplethCounties"},{id:"CHORO_COUNTRIES",display:"Country Choropleth",widgetClass:"map_ChoroplethCountries"},{id:"GMAP_CHORO_USCOUNTIES",display:"Google Map US County Choropleth",widgetClass:"map_GMapCounties"},{id:"GOOGLE_MAP",display:"Google Map",widgetClass:"map_GMapLayered"},{id:"OPENSTREET",display:"Open Street Map",widgetClass:"map_OpenStreet"}].map(function(item){return item.family="map",item}),MultiChart.prototype._anyChartTypes=[{id:"TABLE",display:"Table",widgetClass:"dgrid_Table"},{id:"TABLE_LEGACY",display:"Table (legacy)",widgetClass:"other_Table"},{id:"TABLE_NESTED",display:"Nested Table",widgetClass:"other_NestedTable"},{id:"TABLE_CALENDAR",display:"Table driven Calendar Heat Map",widgetClass:"other_CalendarHeatMap"},{id:"TABLE_BULLET",display:"Table driven bullet chart",widgetClass:"chart_Bullet"},{id:"TABLE_SELECT",display:"Table driven select",widgetClass:"other_Select"},{id:"TABLE_AUTOCOMPLETE",display:"Table driven auto complete",widgetClass:"other_AutoCompleteText"},{id:"TABLE_OPPORTUNITY",display:"Table driven opportunity widget",widgetClass:"graph_Opportunity"},{id:"TABLE_TREE",display:"Table driven tree",widgetClass:"tree_Dendrogram"},{id:"TABLE_TREEMAP",display:"Table driven Treemap",widgetClass:"tree_Treemap"},{id:"TABLE_SANKEY",display:"Table driven Sankey",widgetClass:"graph_Sankey"},{id:"TABLE_GMAP_PIN",display:"Table driven Google Map (pins)",widgetClass:"map_GMapPin"},{id:"TABLE_GMAP_PINLINE",display:"Table driven Google Map (pins/lines)",widgetClass:"map_GMapPinLine"},{id:"TABLE_XML_TREE",display:"Table driven XML Tree",widgetClass:"tree_Indented"}].map(function(item){return item.family="any",item}),MultiChart.prototype._allChartTypes=MultiChart.prototype._otherChartTypes.concat(MultiChart.prototype._graphChartTypes.concat(MultiChart.prototype._1DChartTypes.concat(MultiChart.prototype._2DChartTypes.concat(MultiChart.prototype._NDChartTypes.concat(MultiChart.prototype._mapChartTypes.concat(MultiChart.prototype._anyChartTypes)))))),MultiChart.prototype._allMap=common.map(MultiChart.prototype._allChartTypes,function(item){return item.family}),MultiChart.prototype._allFamilies=MultiChart.prototype._allMap.keys(),MultiChart.prototype._allChartTypesMap={},MultiChart.prototype._allChartTypesByClass={},MultiChart.prototype._allChartTypes.forEach(function(item){item.widgetPath=common.Utility.widgetPath(item.widgetClass),MultiChart.prototype._allChartTypesMap[item.id]=item,MultiChart.prototype._allChartTypesByClass[item.widgetClass]=item}),MultiChart.prototype.publishReset(),MultiChart.prototype.publish("hideRowOnLegendClick",!1,"boolean","Enable/Disable hiding row on legend clicks",null,{tags:["Basic"]}),MultiChart.prototype.publish("chartType","BUBBLE","set","Chart Type",MultiChart.prototype._allChartTypes.map(function(item){return item.id}),{tags:["Basic"]}),MultiChart.prototype.publish("chart",null,"widget","Chart",null,{tags:["Basic"]});const _origChart=MultiChart.prototype.chart;MultiChart.prototype.chart=function(_){const retVal=_origChart.apply(this,arguments);if(arguments.length){const context=this;this._allChartTypesByClass[_.classID()]?this.chartType(this._allChartTypesByClass[_.classID()].id):console.warn("Unknown Class ID: "+_.classID()),_.click=function(_row,_column,_selected){context.click.apply(context,arguments)},_.dblclick=function(_row,_column,_selected){context.dblclick.apply(context,arguments)},_.vertex_click=function(row,column,selected,more){context.vertex_click.apply(context,arguments)},_.vertex_dblclick=function(row,column,selected,more){context.vertex_dblclick.apply(context,arguments)},_.edge_click=function(row,column,selected,more){context.edge_click.apply(context,arguments)},_.edge_dblclick=function(row,column,selected,more){context.edge_dblclick.apply(context,arguments)},this._chartMonitor&&(this._chartMonitor.remove(),delete this._chartMonitor),this._chartMonitor=_.monitor(function(key,newVal,oldVal){context.broadcast(key,newVal,oldVal,_)})}return retVal};class Summary extends common.HTMLWidget{constructor(){super()}enter(domNode,element){super.enter(domNode,element),element.append("p")}update(domNode,element){super.update(domNode,element),element.select("p").text(this.text())}}Summary.prototype.publish("text","","string");class MultiChartPanel extends ChartPanel{constructor(){super(),this.widget(new MultiChart().chartType("COLUMN"))}multiChart(){return this._widget}chartType(_){return arguments.length?(this._widget.chartType(_),this):this._widget.chartType()}chart(_){return arguments.length?(this._widget.chart(_),this):this._widget.chart()}chartTypeDefaults(_){return arguments.length?(this._widget.chartTypeDefaults(_),this):this._widget.chartTypeDefaults()}chartTypeProperties(_){return arguments.length?(this._widget.chartTypeProperties(_),this):this._widget.chartTypeProperties()}update(domNode,element){super.update(domNode,element),this._widget instanceof MultiChart&&this._legend.dataFamily(this._widget.getChartDataFamily()),super.update(domNode,element)}}MultiChartPanel.prototype._class+=" composite_MultiChartPanel";class Dermatology extends Border{constructor(){super();__publicField(this,"_toolbar");__publicField(this,"_propEditor");__publicField(this,"_showProperties");__publicField(this,"_propsButton");__publicField(this,"_prevWidget");__publicField(this,"showToolbar");__publicField(this,"showToolbar_exists");__publicField(this,"widget");__publicField(this,"widget_exists");this._toolbar=new Toolbar().title("Dermatology"),this._propEditor=new other.PropertyEditor().show_settings(!0)}showProperties(_){if(!arguments.length)return this._showProperties;this._showProperties=_,this.rightPercentage(0).rightSize(this._showProperties?360:0).setContent("right",this._showProperties?this._propEditor:null);const widget=this.widget();return widget&&widget.designMode&&widget.designMode(this._showProperties),this}toggleProperties(){return this.showProperties(!this.showProperties())}enter(domNode,element){super.enter(domNode,element),this.topPercentage(0).topSize(0).setContent("top",this._toolbar),this.getCell("top").surfaceShadow(!0);const context=this;this._propsButton=new form.OnOff().id(this.id()+"_props").value("Properties").on("click",function(){context.toggleProperties().render()}),this._toolbar.widgets([this._propsButton])}update(domNode,element){this.topPercentage(0).topSize(this.showToolbar()?32:0),super.update(domNode,element);const widget=this.widget();element.style("background-color",widget&&widget.surfaceShadow?null:"white")}render(callback){const widget=this.widget();return widget!==this._prevWidget&&(widget&&widget.surfaceShadow&&widget.surfaceBackgroundColor_default("white"),this.setContent("center",widget),this._propEditor.widget(widget),this._prevWidget=widget),super.render(callback)}}Dermatology.prototype._class+=" composite_Dermatology",Dermatology.prototype.publish("showToolbar",!0,"boolean","Show Toolbar"),Dermatology.prototype.publish("widget",null,"widget","Widget");class MegaChart extends Border{constructor(){super();__publicField(this,"_chart",new MultiChart);__publicField(this,"_toolbar",new Toolbar);__publicField(this,"_valueTitle",new common.Text);__publicField(this,"_domainTitle",new common.Text);__publicField(this,"_legend",new other.Legend);__publicField(this,"_csvButton");__publicField(this,"_infoButton");__publicField(this,"_maximizeButton");__publicField(this,"_legendButton");__publicField(this,"_chartTypeSelect");__publicField(this,"_prevLegendPosition");__publicField(this,"_prevShowToolbar");__publicField(this,"_1DChartTypes");__publicField(this,"_2DChartTypes");__publicField(this,"_NDChartTypes");__publicField(this,"_anyChartTypes");__publicField(this,"_allChartTypes");__publicField(this,"_contentClasses");__publicField(this,"_dataCount");__publicField(this,"hideRowOnLegendClick");__publicField(this,"hideRowOnLegendClick_exists");__publicField(this,"showToolbar");__publicField(this,"showToolbar_exists");__publicField(this,"titleFontSize");__publicField(this,"titleFontSize_exists");__publicField(this,"titleFontColor");__publicField(this,"titleFontColor_exists");__publicField(this,"titleFontFamily");__publicField(this,"titleFontFamily_exists");__publicField(this,"titleFontBold");__publicField(this,"titleFontBold_exists");__publicField(this,"titleBackgroundColor");__publicField(this,"titleBackgroundColor_exists");__publicField(this,"maximizedBackgroundColor");__publicField(this,"maximizedBackgroundColor_exists");__publicField(this,"showChartSelect");__publicField(this,"showChartSelect_exists");__publicField(this,"showCSV");__publicField(this,"showCSV_exists");__publicField(this,"showCount");__publicField(this,"showCount_exists");__publicField(this,"showMaximize");__publicField(this,"showMaximize_exists");__publicField(this,"toolbarShowLegend");__publicField(this,"toolbarShowLegend_exists");__publicField(this,"showInfoButton");__publicField(this,"showInfoButton_exists");__publicField(this,"infoIcon");__publicField(this,"infoIcon_exists");__publicField(this,"legendPosition");__publicField(this,"legendPosition_exists");__publicField(this,"title");__publicField(this,"title_exists");__publicField(this,"domainAxisTitle");__publicField(this,"domainAxisTitle_exists");__publicField(this,"valueAxisTitle");__publicField(this,"valueAxisTitle_exists");__publicField(this,"chartType");__publicField(this,"chartType_exists");__publicField(this,"chart");__publicField(this,"chart_exists");this._tag="div";const context=this;this._chart.click=function(){context.click.apply(context,arguments)},this._chart.dblclick=function(){context.dblclick.apply(context,arguments)},this._chart.vertex_click=function(){context.vertex_click.apply(context,arguments)},this._chart.vertex_dblclick=function(){context.vertex_dblclick.apply(context,arguments)},this._chart.edge_click=function(){context.edge_click.apply(context,arguments)},this._chart.edge_dblclick=function(){context.edge_dblclick.apply(context,arguments)}}toolbarWidgets(_){return arguments.length?(this._toolbar.widgets(_),this):this._toolbar.widgets()}chartTypeDefaults(_){return arguments.length?(this._chart.chartTypeDefaults(_),this):this._chart.chartTypeDefaults()}chartTypeProperties(_){return arguments.length?(this._chart.chartTypeProperties(_),this):this._chart.chartTypeProperties()}fields(_){return arguments.length?(this._chart.fields(_),this):this._chart.fields()}columns(_,asDefault){return arguments.length?(this._chart.columns(_,asDefault),this):this._chart.columns()}data(_){return arguments.length?(this._chart.data(_),this):this._chart.data()}downloadCSV(){return common.Utility.downloadString("CSV",this._chart.export("CSV")),this}enter(domNode,element){super.enter(domNode,element);const context=this;this.topShrinkWrap(!1).topPercentage(0).topSize(30),this._dataCount=new other.Html().classed({"composite_MegaChart-dataCount":!0}).id(this.id()+"_dataCount").html('<span class="MegaChart-dataCount-label">Count:</span>&nbsp;<span class="MegaChart-dataCount-value">'+(this.data()?this.data().length:"0")+"</span>").overflowX("visible").overflowY("visible"),this._csvButton=new form.Button().classed({"composite_MegaChart-CSV":!0}).id(this.id()+"_csv").value("CSV"),this._csvButton.click=function(a2){context.downloadCSV()},this._infoButton=new form.Button().classed({"composite_MegaChart-Info":!0}).id(this.id()+"_info").value(this.infoIcon()),this._maximizeButton=new form.Button().classed({"composite_MegaChart-Maximize":!0}).id(this.id()+"_maximize").value(""),this._maximizeButton.click=function(buttonWidget){const target=context.target();let node=target;const isMaximized=common.select(target).classed("__hpccisMaximized"),parentGrid=context.locateAncestor("layout_Grid");parentGrid?node=parentGrid.element().node():node=document.body;const targetElement=common.select(context.target());if(isMaximized){const targetParentBox=target.parentElement.getBoundingClientRect(),targetPaddingTop=parseInt(getComputedStyle(target,null).getPropertyValue("padding-top").replace("px","")),targetPaddingLeft=parseInt(getComputedStyle(target,null).getPropertyValue("padding-left").replace("px","")),targetPaddingRight=parseInt(getComputedStyle(target,null).getPropertyValue("padding-right").replace("px","")),targetPaddingBottom=parseInt(getComputedStyle(target,null).getPropertyValue("padding-bottom").replace("px",""));context.contentDiv.style("opacity",0).transition(100),targetElement.transition().style("top",targetParentBox.top+"px").style("left",targetParentBox.left+"px").style("width",targetParentBox.width-targetPaddingLeft-targetPaddingRight+"px").style("height",targetParentBox.height-targetPaddingTop-targetPaddingBottom+"px").each("end",function(){targetElement.style("position",target.__old_position),targetElement.style("z-index",target.__old_zindex),targetElement.style("background-color",target.__old_backgroundColor),targetElement.style("box-shadow",target.__old_boxshadow),context.resize({width:targetParentBox.width-targetPaddingLeft-targetPaddingRight,height:targetParentBox.height-targetPaddingTop-targetPaddingBottom}).render(function(){context.contentDiv.transition().style("opacity",1)}),buttonWidget.value("").render()})}else{target.__old_position=target.style.position,target.__old_zindex=target.style.zIndex,target.__old_boxshadow=target.style.boxShadow,target.__old_backgroundColor=context.element().style("background-color");const grid=common.select(node).datum(),gridTarget=grid.target(),gridBox=grid?gridTarget.getBoundingClientRect():node.getBoundingClientRect(),gridPaddingTop=parseInt(getComputedStyle(gridTarget,null).getPropertyValue("padding-top").replace("px","")),gridPaddingLeft=parseInt(getComputedStyle(gridTarget,null).getPropertyValue("padding-left").replace("px","")),gridPaddingRight=parseInt(getComputedStyle(gridTarget,null).getPropertyValue("padding-right").replace("px","")),gridPaddingBottom=parseInt(getComputedStyle(gridTarget,null).getPropertyValue("padding-bottom").replace("px",""));context.contentDiv.style("opacity",0).transition(100),targetElement.style("position","fixed").style("z-index",999999).style("box-shadow","0 8px 8px 0 rgba(0,0,0,.14),0 12px 4px -8px rgba(0,0,0,.2),0 4px 20px 0 rgba(0,0,0,.12)").style("background-color",target.__old_backgroundColor).transition().style("top",gridBox.top+gridPaddingTop+"px").style("left",gridBox.left+gridPaddingLeft+"px").style("width",gridBox.width-gridPaddingLeft-gridPaddingRight+"px").style("height",gridBox.height-gridPaddingTop-gridPaddingBottom+"px").each("end",function(){targetElement.style("background-color",context.maximizedBackgroundColor()),context.resize({width:gridBox.width-gridPaddingLeft-gridPaddingRight,height:gridBox.height-gridPaddingTop-gridPaddingBottom}).render(function(){context.contentDiv.transition().style("opacity",1)}),buttonWidget.value("").render()})}common.select(target).classed("__hpccisMaximized",!isMaximized)},this._legendButton=new form.Input().classed({"composite_MegaChart-legend":!0}).id(this.id()+"_legend").type("checkbox").inlineLabel("Legend: "),this._legendButton.click=function(a2){context.render()},this._chartTypeSelect=new form.Select().classed({"composite_MegaChart-chartType":!0}).id(this.id()+"_chartType").selectOptions(this._allChartTypes.map(function(a2){return[a2.id,a2.display]})).value(this.chartType()),this._chartTypeSelect.change=function(a2){context.chartType(a2.value()).render()},this.setContent("center",this._chart),this._legend.targetWidget(this._chart).orientation(["top","bottom"].indexOf(this.legendPosition())!==-1?"horizontal":"vertical").fixedSize(!0),this._prevLegendPosition=this.legendPosition(),this.valueAxisTitle()&&this.setContent("left",this._valueTitle.rotation(-90)).leftShrinkWrap(!0),this.domainAxisTitle()&&this.setContent("bottom",this._domainTitle).bottomShrinkWrap(!0),this.legendPosition()!=="none"&&this.setContent(this.legendPosition(),this._legend)[this.legendPosition()+"ShrinkWrap"](!0)}update(domNode,element){function showHideButton(twArr2,button,show){if(show&&twArr2.indexOf(button)===-1)twArr2.push(button);else if(!show){const idx=twArr2.indexOf(button);idx>=0&&twArr2.splice(idx,1)}}this._chart&&typeof this._chart.hideRowOnLegendClick=="function"&&this._chart.hideRowOnLegendClick(this.hideRowOnLegendClick()),this._dataCount.html('<span class="MegaChart-dataCount-label">Count:</span>&nbsp;<span class="MegaChart-dataCount-value">'+(this.data()?this.data().length:"0")+"</span>"),this._chartTypeSelect.value(this.chartType());const twArr=this.toolbarWidgets();showHideButton(twArr,this._csvButton,this.showCSV()),showHideButton(twArr,this._maximizeButton,this.showMaximize()),showHideButton(twArr,this._legendButton,this.toolbarShowLegend()),showHideButton(twArr,this._chartTypeSelect,this.showChartSelect()),showHideButton(twArr,this._infoButton,this.showInfoButton()),showHideButton(twArr,this._dataCount,this.showCount()),this.toolbarWidgets(twArr),this._prevShowToolbar!==this.showToolbar()&&(this.setContent("top",this.showToolbar()?this._toolbar:null),this._prevShowToolbar=this.showToolbar()),this._toolbar.fontSize(this.titleFontSize()).fontColor(this.titleFontColor()).fontFamily(this.titleFontFamily()).fontBold(this.titleFontBold()).backgroundColor(this.titleBackgroundColor()),this._chart.data(this.data()),this._chart.chartType()!==this.chartType()&&this._chart.chartType(this.chartType());let legendPosition=this.legendPosition();this.toolbarShowLegend()&&!this._legendButton.checked()&&(legendPosition="none"),this._prevLegendPosition!==legendPosition&&(this._prevLegendPosition!=="none"&&this.clearContent(this._prevLegendPosition),this._prevLegendPosition=legendPosition,legendPosition!=="none"&&(this._legend=new other.Legend().targetWidget(this.getContent("center").fixedSize(!0)),this.setContent(legendPosition,this._legend),this._legend.orientation(["top","bottom"].indexOf(legendPosition)!==-1?"horizontal":"vertical"))),this._contentClasses=this.getContentClasses(),this.valueAxisTitle()&&this._contentClasses.left!=="common_Text"&&legendPosition!=="left"&&this.setContent("left",this._valueTitle.rotation(-90)),this.domainAxisTitle()&&this._contentClasses.bottom!=="common_Text"&&legendPosition!=="bottom"&&this.setContent("bottom",this._domainTitle).bottomShrinkWrap(!0),this._legend.dataFamily(this._chart.getChartDataFamily()),super.update(domNode,element)}exit(domNode,element){super.exit(domNode,element)}getContentClasses(){const obj={},t=this.getContent("top"),r=this.getContent("right"),b=this.getContent("bottom"),l=this.getContent("left");return obj.top=t!==null?t.classID():void 0,obj.right=r!==null?r.classID():void 0,obj.bottom=b!==null?b.classID():void 0,obj.left=l!==null?l.classID():void 0,obj}serializeState(){const state={title:this.title(),data:this.data()},chart=this.chart();return chart&&chart.serializeState&&(state.chart=chart.serializeState(),delete state.chart.data),state}deserializeState(state){if(state){this.title(state.title).data(state.data);const chart=this.chart();chart&&state.chart&&chart.serializeState&&chart.deserializeState(state.chart)}return this}click(row,column,selected){}dblclick(row,column,selected){}vertex_click(row,col,sel,more){more&&more.vertex}vertex_dblclick(row,col,sel,more){more&&more.vertex}edge_click(row,col,sel,more){more&&more.edge}edge_dblclick(row,col,sel,more){more&&more.edge}}MegaChart.prototype._class+=" composite_MegaChart",MegaChart.prototype._1DChartTypes=MultiChart.prototype._1DChartTypes,MegaChart.prototype._2DChartTypes=MultiChart.prototype._2DChartTypes,MegaChart.prototype._NDChartTypes=MultiChart.prototype._NDChartTypes,MegaChart.prototype._anyChartTypes=MultiChart.prototype._anyChartTypes,MegaChart.prototype._allChartTypes=MultiChart.prototype._allChartTypes,MegaChart.prototype.publishReset(),MegaChart.prototype.publish("hideRowOnLegendClick",!1,"boolean","Enable/Disable hiding row on legend clicks",null,{tags:["Basic"]}),MegaChart.prototype.publish("showToolbar",!0,"boolean","Enable/Disable Toolbar widget",null,{tags:["Basic"]}),MegaChart.prototype.publishProxy("title","_toolbar","title"),MegaChart.prototype.publish("ddlParamsFormat","","string","DDL Param Format '{fname}, {lname}'",null,{tags:["Advanced"],optional:!0}),MegaChart.prototype.publish("titleFontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],optional:!0}),MegaChart.prototype.publish("titleFontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],optional:!0}),MegaChart.prototype.publish("titleFontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],optional:!0}),MegaChart.prototype.publish("titleFontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],optional:!0}),MegaChart.prototype.publish("titleBackgroundColor",null,"html-color","Background Color",null,{tags:["Intermediate"],optional:!0}),MegaChart.prototype.publish("maximizedBackgroundColor","#FFFFFF","html-color","Background Color while maximized",null,{tags:["Intermediate"],optional:!0}),MegaChart.prototype.publish("showChartSelect",!0,"boolean","Show/Hide the chartType dropdown in the toolbar",null,{tags:["Basic"]}),MegaChart.prototype.publish("showCSV",!0,"boolean","Show/Hide CSV button",null,{tags:["Basic"]}),MegaChart.prototype.publish("showCount",!1,"boolean","Show/Hide Data Count",null,{tags:["Basic"]}),MegaChart.prototype.publish("showMaximize",!1,"boolean","Show/Hide Maximize button",null,{tags:["Basic"]}),MegaChart.prototype.publish("toolbarShowLegend",!1,"boolean","Show/Hide Legend button",null,{tags:["Basic"]}),MegaChart.prototype.publish("showInfoButton",!1,"boolean","Show/Hide Info button in toolbar",null,{tags:["Basic"]}),MegaChart.prototype.publish("infoIcon","","string","Help Icon",null,{tags:["Basic"]}),MegaChart.prototype.publish("legendPosition","none","set","Position of the Legend widget",["none","top","right","bottom","left"],{tags:["Basic"]}),MegaChart.prototype.publishProxy("legendFormat","_legend","rainbowFormat"),MegaChart.prototype.publishProxy("legendBins","_legend","rainbowBins"),MegaChart.prototype.publishProxy("domainAxisTitle","_domainTitle","text"),MegaChart.prototype.publishProxy("valueAxisTitle","_valueTitle","text"),MegaChart.prototype.publishProxy("chartType","_chart","chartType"),MegaChart.prototype.publishProxy("chart","_chart","chart");function retrofit_114_serialization(state,replacement_version){if(replacement_version=!replacement_version||replacement_version==="1.14.2-dev"?"1.18.0":replacement_version,!state.__version)return state;const state_version_obj=common.Utility.parseVersionString(state.__version),target_version_obj=common.Utility.parseVersionString(replacement_version);if(state_version_obj.major===1&&state_version_obj.minor===14){console.info("Upgrading old persist from "+state.__version+" to "+replacement_version);let _json_str=JSON.stringify(state);_json_str=_json_str.split('"'+state.__version).join('"'+replacement_version);const ret_obj=JSON.parse(_json_str);return ret_obj.__properties&&ret_obj.__properties.content&&ret_obj.__properties.content.forEach(function(n){JSON.stringify(n).split("graph_Graph").length>1&&target_version_obj.minor>=16&&(n.__properties.widget.__id=n.__properties.widget.__properties.widget.__id,n.__properties.widget.__class="composite_MegaChart",n.__properties.widget.__properties.showCSV=!1,n.__properties.widget.__properties.chartType="GRAPH",n.__properties.widget.__properties.chart=n.__properties.widget.__properties.widget,delete n.__properties.widget.__properties.chart.__id,delete n.__properties.widget.__properties.widget),typeof n.__properties.fields>"u"&&(n.__properties.fields=[])}),ret_obj}else return state}function deserializeFromObject(widget,state){const promises=[];return other.Persist.widgetPropertyWalker(widget,null,(w,item)=>{if(w[item.id+"_reset"](),state.__properties[item.id]!==void 0)switch(item.type){case"widget":const widgetKey=item.id;promises.push(create(state.__properties[item.id]).then(w2=>(w2._owner=w,w[widgetKey](w2),w2)));break;case"widgetArray":case"propertyArray":const widgetArrayKey=item.id,widgetStateArray=state.__properties[item.id];if(widgetStateArray.length){const arrPromises=[];for(const widgetState of widgetStateArray)arrPromises.push(create(widgetState).then(widgetItem=>(widgetItem._owner=w,widgetItem)));promises.push(Promise.all(arrPromises).then(widgetArray=>{w[widgetArrayKey](widgetArray)}))}break;default:w[item.id](state.__properties[item.id]);break}}),Promise.all(promises).then(widgets=>{if(state.__data){for(const key in state.__data)if(state.__data.HasOwnProperty(key))switch(key){case"data":widget.data(state.__data[key]);break;default:console.warn("Unexpected __data item: "+key),widget[key](state.__data[key]);break}}return state.__state&&(widget.deserializeState?widget.deserializeState(state.__state):state.__state.data&&widget.data&&widget.data(state.__state.data)),widget})}function deserialize(widget,state){typeof state=="string"&&(state=JSON.parse(state)),state.__id&&state.__id.indexOf(widget._idSeed)!==0&&widget._id!==state.__id&&console.warn("Deserialize: IDs do not match - "+widget._id),deserializeFromObject(widget,state)}function create(state){return typeof state=="string"&&(state=JSON.parse(state)),state=retrofit_114_serialization(state,common.Platform.version()),requireWidget(state.__class).then(WidgetClass=>{const widget=new WidgetClass;return state.__id&&state.__id.indexOf(widget._idSeed)!==0&&state.__id.indexOf("_pe")!==0&&(widget._id=state.__id),deserializeFromObject(widget,state)}).catch(function(e){console.error("Persist.create: ***exception***"),console.error(e)})}function clone(widget){create(other.Persist.serializeToObject(widget,void 0,!0,!0))}const Persist=Object.freeze(Object.defineProperty({__proto__:null,clone,create,deserialize,deserializeFromObject,retrofit_114_serialization},Symbol.toStringTag,{value:"Module"}));exports2.BUILD_VERSION=BUILD_VERSION,exports2.Dermatology=Dermatology,exports2.MegaChart=MegaChart,exports2.MultiChart=MultiChart,exports2.MultiChartPanel=MultiChartPanel,exports2.PKG_NAME=PKG_NAME,exports2.PKG_VERSION=PKG_VERSION,exports2.Persist=Persist,exports2.Utility=Utility,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/api"),require("@hpcc-js/form"),require("@hpcc-js/other")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/dgrid","@hpcc-js/api","@hpcc-js/form","@hpcc-js/other"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/composite"]={},t["@hpcc-js/common"],t["@hpcc-js/dgrid"],t["@hpcc-js/api"],t["@hpcc-js/form"],t["@hpcc-js/other"])}(this,function(t,e,i,o,s,l){"use strict";var r,n,a,h,d,c,p,u,g,_,y,f,b,w,m,x,v,C,T,S=Object.defineProperty,P=(t,e)=>S(t,"name",{value:e,configurable:!0});var B=Object.defineProperty,z=P((t,e)=>B(t,"name",{value:e,configurable:!0}),"__name");function A(t,e){for(var i=0;i<e.length;i++){const o=e[i];if("string"!=typeof o&&!Array.isArray(o))for(const e in o)if("default"!==e&&!(e in t)){const i=Object.getOwnPropertyDescriptor(o,e);i&&Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:z(()=>o[e],"get")})}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}P(A,"_mergeNamespaces$1"),z(A,"_mergeNamespaces");const W=(r=class extends e.HTMLWidget{constructor(){super(),this._tag="div"}enter(t,e){super.enter(t,e)}update(t,e){super.update(t,e);let i=0,o=0,s=this.clientWidth(),l=this.clientHeight();switch(this.units()){case"pixels":i=this.widgetX(),o=this.widgetY(),s=""===this.widgetWidth()?s-i:Number(this.widgetWidth()),l=""===this.widgetHeight()?l-o:Number(this.widgetHeight());break;case"percent":i=this.widgetX()*s/100,o=this.widgetY()*l/100,s=""===this.widgetWidth()?s-i:Number(this.widgetWidth())*s/100,l=""===this.widgetHeight()?l-o:Number(this.widgetHeight())*l/100}e.style("opacity",this.opacity());const r=e.selectAll("#"+this._id+" > .placeholder").data(this.widget()?[this.widget()]:[],function(t){return t._id});r.enter().append("div").attr("class","placeholder").each(function(t){t.target(this)}).merge(r).style("left",i+"px").style("top",o+"px").style("width",s+"px").style("bottom",l+"px").each(function(t){t.resize({width:s,height:l})}),r.exit().each(function(t){t.target(null)}).remove()}exit(t,e){this.widget()&&this.widget().target(null),super.exit(t,e)}},P(r,"_AbsoluteSurface"),r);z(W,"AbsoluteSurface");let k=W;k.prototype._class+=" layout_AbsoluteSurface",k.prototype.publish("units","percent","set","Units",["pixels","percent"]),k.prototype.publish("widgetX",0,"number","Widget XPos"),k.prototype.publish("widgetY",0,"number","Widget YPos"),k.prototype.publish("widgetWidth","100","string","Widget Width, omit for full"),k.prototype.publish("widgetHeight","100","string","Widget Height, omit for full"),k.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]}),k.prototype.publish("opacity",1,"number","Opacity");const I=(n=class extends e.HTMLWidget{_isClosed;titleSpan;iconDiv;ul;icon;constructor(){super(),this._tag="div",this._isClosed=!1}pushListItem(t,e=!1,i=!1){const o=this.content();return t._protected=i,e?o.unshift(t):o.push(t),this.content(o),this}clearListItems(){const t=[];for(const e in this.content())this.content()[e]._protected&&t.push(this.content()[e]);return this.content(t),this}collapseClick(t){t.classed("closed")?(this._isClosed=!1,t.classed("open",!0),t.classed("closed",!1)):(this._isClosed=!0,t.classed("open",!1),t.classed("closed",!0))}enter(t,i){super.enter(t,i);const o=this;this._isClosed=this.defaultCollapsed(),i.classed(this._isClosed?"closed":"open",!0),this.titleSpan=i.append("span").classed("collapsible-title",!0),this.iconDiv=i.append("div").classed("collapsible-icon",!0),this.ul=i.append("ul"),this.icon=(new e.FAChar).size({height:24,width:24}).target(this.iconDiv.node()),this.iconDiv.on("click",function(){o.collapseClick(i),o.render()}),this.titleSpan.on("click",function(){o.collapseClick(i),o.render()})}update(t,e){super.update(t,e);const i=this;this.titleSpan.text(i.title().length>0?i.title()+"":"Accordion ["+i._id+"]");const o=this.ul.selectAll("#"+i._id+" > ul > li").data(this.content(),function(t){return t._id});o.enter().append(function(t){const e=document.createElement("li");if(null!==t._target)return t._target;{const o=t.size();if(0===o.width||0===o.height){const e=i.size();t.size({width:e.width,height:e.width})}t.target(e)}return e}),o.exit().remove(),this.icon.text_colorFill(this.titleFontColor()).char(this._isClosed?this.closedIcon():this.openIcon()).render()}exit(t,e){super.exit(t,e)}},P(n,"_Accordion"),n);z(I,"Accordion");let M=I;M.prototype._class+=" layout_Accordion",M.prototype.publish("content",[],"widgetArray","Array of widgets",null,{tags:["Basic"]}),M.prototype.publish("title","","string","Title of collapsible section",null,{tags:["Private"]}),M.prototype.publish("openIcon","","string","Icon to display when list is open",null,{tags:["Private"]}),M.prototype.publish("closedIcon","","string","Icon to display when list is closed",null,{tags:["Private"]}),M.prototype.publish("titleFontColor","#FFFFFF","html-color","Title font color",null,{tags:["Private"]}),M.prototype.publish("titleBackgroundColor","#333333","html-color","Title background color",null,{tags:["Private"]}),M.prototype.publish("defaultCollapsed",!1,"boolean","Collapsed by default if true",null,{tags:["Private"]});const H=(a=class extends e.HTMLWidget{_surfaceButtons;constructor(){super(),this._tag="div",this._surfaceButtons=[]}widgetSize(t,e){let i=this.clientWidth(),o=this.clientHeight();return this.title()&&(o-=this.calcHeight(t)),o-=this.calcFrameHeight(e),i-=this.calcFrameWidth(e),{width:i,height:o}}enter(t,e){super.enter(t,e)}update(t,i){super.update(t,i);const o=this;i.classed("shadow2",this.surfaceShadow()).style("border-width",this.surfaceBorderWidth_exists()?this.surfaceBorderWidth()+"px":null).style("border-color",this.surfaceBorderColor()).style("border-radius",this.surfaceBorderRadius_exists()?this.surfaceBorderRadius()+"px":null).style("background-color",this.surfaceBackgroundColor());const s=i.selectAll(".surfaceTitle").data(this.title()?[this.title()]:[]);s.enter().insert("h3","div").attr("class","surfaceTitle").merge(s).text(function(t){return t}).style("text-align",this.surfaceTitleAlignment()).style("color",this.surfaceTitleFontColor()).style("font-size",this.surfaceTitleFontSize_exists()?this.surfaceTitleFontSize()+"px":null).style("font-family",this.surfaceTitleFontFamily()).style("font-weight",this.surfaceTitleFontBold()?"bold":"normal").style("background-color",this.surfaceTitleBackgroundColor()).style("padding",this.surfaceTitlePadding_exists()?this.surfaceTitlePadding()+"px":null).style("title",this.altText_exists()?this.altText():null),s.exit().remove();const l=i.select(".surfaceTitle").append("div").attr("class","html-button-container").selectAll(".surface-button").data(this.buttonAnnotations());l.enter().append("button").classed("surface-button",!0).each(function(t,i){const s=o._surfaceButtons[i]=e.select(this).attr("class","surface-button"+(t.class?" "+t.class:"")).attr("id",t.id).style("padding",t.padding).style("width",t.width).style("height",t.height).style("cursor","pointer");"FontAwesome"===t.font?s.style("background","transparent").style("border","none").on("click",function(t){o.click(t)}).append("i").attr("class","fa").text(function(){return t.label}):s.text(function(){return t.label}).on("click",function(t){o.click(t)})}),l.exit().each(function(t,i){const s=e.select(this);delete o._surfaceButtons[i],s.remove()});const r=i.selectAll("#"+this._id+" > .surfaceWidget").data(this.widget()?[this.widget()]:[],function(t){return t._id});r.enter().append("div").attr("class","surfaceWidget").each(function(t){e.select(o.element().node().parentElement).classed("content-icon content-icon-"+t.classID().split("_")[1],!0),t.target(this)}).merge(r).style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null).each(function(t){const s=o.widgetSize(i.select("h3"),e.select(this));s.width<0&&(s.width=0),s.height<0&&(s.height=0),t.resize({width:s.width,height:s.height})}),r.exit().each(function(t){t.target(null)}).remove()}exit(t,e){this.widget()&&this.widget().target(null),super.exit(t,e)}click(t){}},P(a,"_Surface"),a);z(H,"Surface");let D=H;D.prototype._class+=" layout_Surface",D.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),D.prototype.publish("altText",null,"string","Alt text",null,{optional:!0}),D.prototype.publish("surfaceTitlePadding",null,"number","Title Padding (px)",null,{tags:["Advanced"],disable:z(t=>!t.title(),"disable")}),D.prototype.publish("surfaceTitleFontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],disable:z(t=>!t.title(),"disable")}),D.prototype.publish("surfaceTitleFontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],disable:z(t=>!t.title(),"disable")}),D.prototype.publish("surfaceTitleFontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],disable:z(t=>!t.title(),"disable")}),D.prototype.publish("surfaceTitleFontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],disable:z(t=>!t.title(),"disable")}),D.prototype.publish("surfaceTitleBackgroundColor",null,"html-color","Title Background Color",null,{tags:["Advanced"],disable:z(t=>!t.title(),"disable")}),D.prototype.publish("surfaceTitleAlignment","center","set","Title Alignment",["left","right","center"],{tags:["Basic"],disable:z(t=>!t.title(),"disable")}),D.prototype.publish("surfaceShadow",!1,"boolean","3D Shadow"),D.prototype.publish("surfacePadding",null,"string","Surface Padding (px)",null,{tags:["Intermediate"]}),D.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),D.prototype.publish("surfaceBorderWidth",null,"number","Surface Border Width (px)",null,{tags:["Advanced"]}),D.prototype.publish("surfaceBorderColor",null,"html-color","Surface Border Color",null,{tags:["Advanced"]}),D.prototype.publish("surfaceBorderRadius",null,"number","Surface Border Radius (px)",null,{tags:["Advanced"]}),D.prototype.publish("buttonAnnotations",[],"array","Button Array",null,{tags:["Private"]}),D.prototype.publish("widget",null,"widget","Widget",null,{tags:["Basic"]});const L=(h=class extends D{_indicateTheseIds;constructor(){super(),this._indicateTheseIds=[]}indicateTheseIds(t){return arguments.length?(this._indicateTheseIds=t,this):this._indicateTheseIds}enter(t,e){super.enter(t,e);const i=this;e.classed("layout_Surface",!0).on("mouseenter",function(){i.onMouseEnter()}).on("mouseleave",function(){i.onMouseLeave()})}update(t,e){super.update(t,e)}onMouseEnter(){const t=this.indicateTheseIds(),i=this.indicatorOpacity(),o=this.indicatorBorderColor(),s=this.indicatorGlowColor();for(let l=0;l<t.length;l++){const r=e.select("#"+t[l]),n=r.datum();r&&n&&r.append("div").attr("class","update-indicator").style("width",n.width()+"px").style("height",n.height()+"px").style("opacity",i).style("border-color",o).style("-webkit-box-shadow","inset 0px 0px 30px 0px "+s).style("-moz-box-shadow","inset 0px 0px 30px 0px "+s).style("box-shadow","inset 0px 0px 30px 0px "+s)}}onMouseLeave(){const t=this.indicateTheseIds();for(let i=0;i<t.length;i++)e.selectAll("#"+t[i]+" > div.update-indicator").remove()}},P(h,"_Cell"),h);z(L,"Cell");let O=L;O.prototype._class+=" layout_Cell",O.prototype.publish("gridRow",0,"number","Grid Row Position",null,{tags:["Private"]}),O.prototype.publish("gridCol",0,"number","Grid Column Position",null,{tags:["Private"]}),O.prototype.publish("gridRowSpan",1,"number","Grid Row Span",null,{tags:["Private"]}),O.prototype.publish("gridColSpan",1,"number","Grid Column Span",null,{tags:["Private"]}),O.prototype.publish("indicatorGlowColor","#EEEE11","html-color","Glow color of update-indicator",null,{tags:["Basic"]}),O.prototype.publish("indicatorBorderColor","#F48A00","html-color","Border color of update-indicator",null,{tags:["Basic"]}),O.prototype.publish("indicatorOpacity",.8,"number","Opacity of update-indicator",null,{tags:["Basic"]});const F=(d=class extends e.HTMLWidget{_colCount;_rowCount;_colSize;_rowSize;_shrinkWrapBoxes;_watch;_offsetX;_offsetY;_dragCell;_dragCellSize;_dragCellStartSize;_handleTop;_handleLeft;_dragPrevX;_dragPrevY;_cellSizes;contentDiv;_scrollBarWidth;_borderHandles;_sectionTypeArr;constructor(){super(),this._tag="div",this._colCount=0,this._rowCount=0,this._colSize=0,this._rowSize=0,this._shrinkWrapBoxes={},this.content([]),this.sectionTypes([])}watchWidget(t){if(void 0===this._watch&&(this._watch={}),this._watch[t.id()]&&(this._watch[t.id()].remove(),delete this._watch[t.id()]),t){const e=this;this._watch[t.id()]=t.monitor(function(t,i,o){o!==i&&e.lazyPostUpdate()})}}lazyPostUpdate=e.Utility.debounce(function(){this.postUpdate()},100);applyLayoutType(){const t=this.borderLayoutObject();this.content().forEach(function(e,i){e._fixedLeft=t[this.sectionTypes()[i]].left,e._fixedTop=t[this.sectionTypes()[i]].top,e._fixedWidth=t[this.sectionTypes()[i]].width,e._fixedHeight=t[this.sectionTypes()[i]].height,e._dragHandles=this.cellSpecificDragHandles(this.sectionTypes()[i])},this)}cellSpecificDragHandles(t){switch(t){case"top":return["s"];case"right":return["w"];case"bottom":return["n"];case"left":return["e"];case"center":return[]}}borderLayoutObject(t){const e={},i=this;let o,s,l,r,n,a,h,d;const c=this.target().getBoundingClientRect();c.top,c.left,c.bottom,c.right,this.target()instanceof SVGElement?(parseFloat(this.target().getAttribute("width")),parseFloat(this.target().getAttribute("height"))):(c.width,c.height),-1!==this.sectionTypes().indexOf("top")&&(o=this.topSize(),s=this.topPercentage(),void 0!==this._shrinkWrapBoxes.top&&(o=this._shrinkWrapBoxes.top.height+this.gutter(),s=0)),-1!==this.sectionTypes().indexOf("bottom")&&(l=this.bottomSize(),r=this.bottomPercentage(),void 0!==this._shrinkWrapBoxes.bottom&&(l=this._shrinkWrapBoxes.bottom.height+this.gutter(),r=0)),-1!==this.sectionTypes().indexOf("left")&&(n=this.leftSize(),a=this.leftPercentage(),void 0!==this._shrinkWrapBoxes.left&&(n=this._shrinkWrapBoxes.left.width+this.gutter(),a=0)),-1!==this.sectionTypes().indexOf("right")&&(h=this.rightSize(),d=this.rightPercentage(),void 0!==this._shrinkWrapBoxes.right&&(h=this._shrinkWrapBoxes.right.width+this.gutter(),d=0));const p=f({width:{px:0,"%":100},height:{px:o,"%":s},top:{px:0,"%":0},left:{px:0,"%":0}}),u=f({width:{px:0,"%":100},height:{px:l,"%":r},top:{px:0,"%":100},left:{px:0,"%":0}});u.top-=u.height;const g=f({width:{px:n,"%":a},height:{px:-p.height-u.height,"%":100},top:{px:p.height,"%":0},left:{px:0,"%":0}}),_=f({width:{px:h,"%":d},height:{px:-p.height-u.height,"%":100},top:{px:p.height,"%":0},left:{px:0,"%":100}});_.left-=_.width;const y=f({width:{px:-_.width-g.width,"%":100},height:{px:-p.height-u.height,"%":100},top:{px:p.height,"%":0},left:{px:g.width,"%":0}});return e.top=p,e.bottom=u,e.right=_,e.left=g,e.center=y,e;function f(t){t.width.px=void 0!==t.width.px?t.width.px:0,t.width["%"]=void 0!==t.width["%"]?t.width["%"]:0,t.height.px=void 0!==t.height.px?t.height.px:0,t.height["%"]=void 0!==t.height["%"]?t.height["%"]:0;return{width:t.width.px+t.width["%"]/100*i.width(),height:t.height.px+t.height["%"]/100*i.height(),top:t.top.px+t.top["%"]/100*i.height()+i.gutter()/2,left:t.left.px+t.left["%"]/100*i.width()+i.gutter()/2}}}clearContent(t){if(t){const i=this.sectionTypes().indexOf(t);i>=0&&(this._watch&&this.content()[i]&&delete this._watch[this.content()[i].id()],this.content()[i].target(null),e.select("#"+this.id()+" > div.borderHandle_"+t).classed("borderHandleDisabled",!0),this.content().splice(i,1),this.sectionTypes().splice(i,1))}else this.content().forEach(function(t){return t.target(null),!1}),e.select("#"+this.id()+" > div.borderHandle").classed("borderHandleDisabled",!0),delete this._watch,this.content([]),this.sectionTypes([])}hasContent(t,e,i){return this.sectionTypes().indexOf(t)>=0}setContent(t,e,i){if(this.clearContent(t),i=void 0!==i?i:"",e){const o=(new O).surfaceBorderWidth(0).widget(e).title(i);this.watchWidget(e),this.content().push(o),this.sectionTypes().push(t)}return this}getCell(t){const e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e]:null}getContent(t){const e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e].widget():null}setLayoutOffsets(){this._offsetX=this._element.node().getBoundingClientRect().left+this.gutter()/2,this._offsetY=this._element.node().getBoundingClientRect().top+this.gutter()/2}dragStart(t){const i=e.d3Event();i.sourceEvent.stopPropagation();const o=this;this._dragCell=t,this._dragCellStartSize=this[t+"Size"](),this[t+"ShrinkWrap"]()&&(this[t+"Percentage"](0),this[t+"ShrinkWrap"](!1));const s=e.select("#"+o.id()+" > div.borderHandle_"+t);o._handleTop=parseFloat(s.style("top").split("px")[0]),o._handleLeft=parseFloat(s.style("left").split("px")[0]),this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY}dragTick(t){const i=this,o=e.d3Event(),s=this._dragPrevX-o.sourceEvent.clientX,l=this._dragPrevY-o.sourceEvent.clientY;switch(t){case"top":case"bottom":r(t,l);break;case"right":case"left":r(t,s)}function r(t,o){if(0===o)return;const s=e.selectAll("#"+i.id()+" > div.borderHandle"),l=e.select("#"+i.id()+" > div.borderHandle_"+t);l.classed("borderHandle_top")?(l.style("top",i._handleTop-o+"px"),i._cellSizes.topHeight=i._handleTop-o,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):l.classed("borderHandle_right")?(l.style("left",i._handleLeft-o+"px"),i._cellSizes.rightWidth=i._cellSizes.width-i._handleLeft+o):l.classed("borderHandle_bottom")?(l.style("top",i._handleTop-o+"px"),i._cellSizes.bottomHeight=i._cellSizes.height-i._handleTop+o,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):l.classed("borderHandle_left")&&(l.style("left",i._handleLeft-o+"px"),i._cellSizes.leftWidth=i._handleLeft-o),s.each(function(){const t=e.select(this);t.classed("borderHandle_top")?(t.style("width",i._cellSizes.width+"px"),t.style("top",i._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",i._cellSizes.width-i._cellSizes.rightWidth+"px"),t.style("top",i._cellSizes.topHeight+3+"px"),t.style("height",i._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",i._cellSizes.width+"px"),t.style("top",i._cellSizes.height-i._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",i._cellSizes.leftWidth+"px"),t.style("height",i._cellSizes.leftHeight+"px"),t.style("top",i._cellSizes.topHeight+3+"px"))})}P(r,"_moveHandles"),z(r,"_moveHandles")}dragEnd(t){if(t){const i=e.d3Event(),o=this._dragPrevX-i.sourceEvent.clientX,s=this._dragPrevY-i.sourceEvent.clientY;switch(t){case"top":0!==s&&(this.topPercentage(0),this.topSize(0===this.topSize()?this.getContent("top").getBBox().height-s:this.topSize()-s));break;case"right":0!==o&&(this.rightPercentage(0),this.rightSize(0===this.rightSize()?this.getContent("right").getBBox().width+o:this.rightSize()+o));break;case"bottom":0!==s&&(this.bottomPercentage(0),this.bottomSize(0===this.bottomSize()?this.getContent("bottom").getBBox().height+s:this.bottomSize()+s));break;case"left":0!==o&&(this.leftPercentage(0),this.leftSize(0===this.leftSize()?this.getContent("left").getBBox().width-o:this.leftSize()-o))}this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY}this.render()}size(t){const i=e.HTMLWidget.prototype.size.apply(this,arguments);return arguments.length&&this.contentDiv&&this.contentDiv.style("width",this._size.width+"px").style("height",this._size.height+"px"),i}enter(t,i){super.enter(t,i);const o=this;i.style("position","relative"),this.contentDiv=i.append("div").classed("border-content",!0),this._scrollBarWidth=e.Platform.getScrollbarWidth(),this._borderHandles=["top","left","right","bottom"];i.selectAll("div.borderHandle").data(this._borderHandles).enter().append("div").classed("borderHandle",!0).each(function(t){e.select(this).classed("borderHandle_"+t,!0).classed("borderHandleDisabled",null===o.getContent(t))})}update(t,i){super.update(t,i),this._sectionTypeArr=this.sectionTypes();const o=this;i.classed("design-mode",this.designMode()),this.setLayoutOffsets();const s=this.contentDiv.selectAll(".cell_"+this._id).data(this.content(),function(t){return t._id}),l=s.enter().append("div").classed("cell_"+this._id,!0).style("position","absolute").each(function(t,i){e.select(this).classed("border-cell border-cell-"+o._sectionTypeArr[i],!0),t.target(this),e.select("#"+o.id()+" > div.borderHandle_"+o._sectionTypeArr[i]).classed("borderHandleDisabled",!1)}).merge(s);l.each(function(t,e){const i=o.sectionTypes()[e];void 0!==o[i+"ShrinkWrap"]&&o[i+"ShrinkWrap"]()?(t.render(),o._shrinkWrapBoxes[i]=t.widget().getBBox(!0)):delete o._shrinkWrapBoxes[i]});const r=e.drag().on("start",function(t,e){o.dragStart.call(o,t,e)}).on("drag",function(t,e){o.dragTick.call(o,t,e)}).on("end",function(t,e){o.dragEnd.call(o,t,e)});this.designMode()?i.selectAll("#"+this.id()+" > div.borderHandle").call(r):i.selectAll("#"+this.id()+" > div.borderHandle").on(".drag",null);const n=this.borderLayoutObject();this.content().forEach(function(t,e){t._fixedLeft=n[this.sectionTypes()[e]].left,t._fixedTop=n[this.sectionTypes()[e]].top,t._fixedWidth=n[this.sectionTypes()[e]].width,t._fixedHeight=n[this.sectionTypes()[e]].height,t._dragHandles=[]},this),l.style("left",function(t){return t._fixedLeft+"px"}).style("top",function(t){return t._fixedTop+"px"}).style("width",function(t){return t._fixedWidth-o.gutter()+"px"}).style("height",function(t){return t._fixedHeight-o.gutter()+"px"}).each(function(t){t._placeholderElement.attr("draggable",o.designMode()).selectAll(".dragHandle").attr("draggable",o.designMode()),t.surfacePadding(o.surfacePadding()).resize()}),s.exit().each(function(t){t.target(null)}).remove(),this.getCellSizes(),i.selectAll("#"+this.id()+" > div.borderHandle").each(function(){const t=e.select(this);t.classed("borderHandle_top")?(t.style("width",o._cellSizes.width+"px"),t.style("top",o._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",o._cellSizes.width-o._cellSizes.rightWidth+"px"),t.style("top",o._cellSizes.topHeight+3+"px"),t.style("height",o._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",o._cellSizes.width+"px"),t.style("top",o._cellSizes.height-o._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",o._cellSizes.leftWidth+"px"),t.style("height",o._cellSizes.leftHeight+"px"),t.style("top",o._cellSizes.topHeight+3+"px"))})}getCellSizes(){const t=this;t._cellSizes={};const i=this.element().node().getBoundingClientRect();t._cellSizes.width=i.width,t._cellSizes.height=i.height,this.element().selectAll("#"+this.id()+" > div > div.border-cell").each(function(){const i=e.select(this);if("function"==typeof i.node){const e=i.node().getBoundingClientRect();i.classed("border-cell-top")?t._cellSizes.topHeight=e.height:i.classed("border-cell-left")?(t._cellSizes.leftWidth=e.width,t._cellSizes.leftHeight=e.height):i.classed("border-cell-right")?(t._cellSizes.rightWidth=e.width,t._cellSizes.rightHeight=e.height):i.classed("border-cell-bottom")&&(t._cellSizes.bottomHeight=e.height)}});["height","width","topHeight","bottomHeight","leftHeight","rightHeight","leftWidth","rightWidth"].forEach(function(e){t._cellSizes[e]=void 0===t._cellSizes[e]?0:t._cellSizes[e]})}postUpdate(t,e){const i=this;this.content().forEach(function(t){if(null!==t._element.node()&&t.widget()){const e=t.widget().getBBox(!1,!0),o=t.widget().getBBox(!0,!0);e.width===o.width&&e.height===o.height||i.lazyRender()}})}exit(t,e){this.content().forEach(t=>t.target(null)),super.exit(t,e)}},P(d,"_Border"),d);z(F,"Border");let E=F;E.prototype._class+=" layout_Border",E.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),E.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Intermediate"]}),E.prototype.publish("gutter",0,"number","Gap Between Widgets",null,{tags:["Basic"]}),E.prototype.publish("topShrinkWrap",!1,"boolean","'Top' Cell shrinks to fit content",null,{tags:["Intermediate"]}),E.prototype.publish("leftShrinkWrap",!1,"boolean","'Left' Cell shrinks to fit content",null,{tags:["Intermediate"]}),E.prototype.publish("rightShrinkWrap",!1,"boolean","'Right' Cell shrinks to fit content",null,{tags:["Intermediate"]}),E.prototype.publish("bottomShrinkWrap",!1,"boolean","'Bottom' Cell shrinks to fit content",null,{tags:["Intermediate"]}),E.prototype.publish("topSize",0,"number","Height of the 'Top' Cell (px)",null,{tags:["Private"]}),E.prototype.publish("leftSize",0,"number","Width of the 'Left' Cell (px)",null,{tags:["Private"]}),E.prototype.publish("rightSize",0,"number","Width of the 'Right' Cell (px)",null,{tags:["Private"]}),E.prototype.publish("bottomSize",0,"number","Height of the 'Bottom' Cell (px)",null,{tags:["Private"]}),E.prototype.publish("topPercentage",20,"number","Percentage (of parent) Height of the 'Top' Cell",null,{tags:["Private"]}),E.prototype.publish("leftPercentage",20,"number","Percentage (of parent) Width of the 'Left' Cell",null,{tags:["Private"]}),E.prototype.publish("rightPercentage",20,"number","Percentage (of parent) Width of the 'Right' Cell",null,{tags:["Private"]}),E.prototype.publish("bottomPercentage",20,"number","Percentage (of parent) Height of the 'Bottom' Cell",null,{tags:["Private"]}),E.prototype.publish("surfacePadding",0,"number","Cell Padding (px)",null,{tags:["Intermediate"]}),E.prototype.publish("sectionTypes",[],"array","Section Types sharing an index with 'content' - Used to determine position/size.",null,{tags:["Private"]});const R=(c=class{_div;_overlay=!1;_overflowX="visible";_overflowY="visible";_widget;constructor(t){this._div=t}overlay(t){return arguments.length?(this._overlay=t,this):this._overlay}overflowX(t){return arguments.length?(this._overflowX=t,this._div.style("overflow-x",t),this):this._overflowX}overflowY(t){return arguments.length?(this._overflowY=t,this._div.style("overflow-y",t),this):this._overflowY}element(){return this._div}node(){return this._div.node()}widget(t){return arguments.length?(this._widget!==t&&(this._widget&&this._widget.target(null),this._widget=t,this._widget&&this._widget.target(this._div.node())),this):this._widget}resize(t){return this._widget&&(this._div.style("width",`${t.width}px`).style("height",`${t.height}px`),this._widget.resize(t)),this}async render(t,i,o){let s=this.overflowX();this.overlay()||"visible"!==s||(s=null);let l=this.overflowY();return this.overlay()||"visible"!==l||(l=null),this._div.style("height",this.overlay()?"0px":null).style("overflow-x",s).style("overflow-y",l),this._widget?this._widget.renderPromise().then(s=>{if(t&&this._widget.visible()){const t=this._widget.getBBox();return t.width+=8,void 0!==i&&t.height>i&&(t.width+=e.Platform.getScrollbarWidth()),void 0!==o&&t.width>o&&(t.height+=e.Platform.getScrollbarWidth()),this.overlay()?t.height=0:t.height+=4,t}return t?{x:0,y:0,width:0,height:0}:void 0}):Promise.resolve(t?{x:0,y:0,width:0,height:0}:void 0)}},P(c,"_WidgetDiv"),c);z(R,"WidgetDiv");let G=R;const N=(p=class extends e.HTMLWidget{_bodyElement;_topWA;_leftWA;_centerWA;_rightWA;_bottomWA;_topPrevOverflow;_leftPrevOverflow;_rightPrevOverflow;_bottomPrevOverflow;constructor(){super(),this._tag="div"}enter(t,e){super.enter(t,e);const i=e.append("header");this._bodyElement=e.append("div").attr("class","body");const o=this._bodyElement.append("div").attr("class","center"),s=this._bodyElement.append("div").attr("class","lhs"),l=this._bodyElement.append("div").attr("class","rhs"),r=e.append("div").attr("class","footer");this._topWA=new G(i),this._centerWA=new G(o),this._leftWA=new G(s),this._rightWA=new G(l),this._bottomWA=new G(r)}update(t,e){super.update(t,e),this._topWA.element().style("display",this.showTop()?null:"none"),this._rightWA.element().style("display",this.showRight()?null:"none"),this._bottomWA.element().style("display",this.showBottom()?null:"none"),this._leftWA.element().style("display",this.showLeft()?null:"none"),this.topOverflowX()!==this._topWA.overflowX()&&this._topWA.overflowX(this.topOverflowX()),this.rightOverflowX()!==this._rightWA.overflowX()&&this._rightWA.overflowX(this.rightOverflowX()),this.bottomOverflowX()!==this._bottomWA.overflowX()&&this._bottomWA.overflowX(this.bottomOverflowX()),this.leftOverflowX()!==this._leftWA.overflowX()&&this._leftWA.overflowX(this.leftOverflowX()),this.topOverflowY()!==this._topWA.overflowY()&&this._topWA.overflowY(this.topOverflowY()),this.rightOverflowY()!==this._rightWA.overflowY()&&this._rightWA.overflowY(this.rightOverflowY()),this.bottomOverflowY()!==this._bottomWA.overflowY()&&this._bottomWA.overflowY(this.bottomOverflowY()),this.leftOverflowY()!==this._leftWA.overflowY()&&this._leftWA.overflowY(this.leftOverflowY()),this.element().style("width",`${this.width()}px`).style("height",`${this.height()}px`)}targetNull(t){t&&t.target(null)}exit(t,e){this.targetNull(this.center()),this.targetNull(this.bottom()),this.targetNull(this.right()),this.targetNull(this.left()),this.targetNull(this.top()),super.exit(t,e)}swap(t,e){const i=this[t](),o=this[e]();return this.targetNull(i),this.targetNull(o),this[`_${t}WA`].widget(null),this[`_${e}WA`].widget(null),this[t](o),this[e](i),this}render(t){return super.render(e=>{this._topWA?this._topWA.widget(this.top()).overlay(this.topOverlay()).render(!0).then(async e=>{const i=await this._bottomWA.widget(this.bottom()).render(!0,void 0,this.width()),o=this.height()-(e.height+i.height),s=await this._leftWA.widget(this.left()).render(!0,o),l=await this._rightWA.widget(this.right()).render(!0,o);this.bottomHeight_exists()&&(i.height=this.bottomHeight());const r=this.width()-(s.width+l.width),n=this.height()-(e.height+i.height),a=this.centerOverflowX(),h=this.centerOverflowY(),d=-1!==["auto","scroll"].indexOf(a),c=-1!==["auto","scroll"].indexOf(h);(d||c)&&this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:r,height:n}).render(),this._bodyElement.style("height",`${n}px`);const p=[this._topWA.overflowX(this.topOverflowX()).overflowY(this.topOverflowY()).resize({width:this.width(),height:e.height}).render(),this._leftWA.overflowX(this.leftOverflowX()).overflowY(this.leftOverflowY()).resize({width:s.width,height:n}).render(),this._rightWA.overflowX(this.rightOverflowX()).overflowY(this.rightOverflowY()).resize({width:l.width,height:n}).render(),this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:r,height:n}).render(),this._bottomWA.overflowX(this.bottomOverflowX()).overflowY(this.bottomOverflowY()).resize({width:this.width(),height:i.height}).render()];Promise.all(p).then(e=>{t&&t(this)})}):t&&t(this)})}},P(p,"_Border2"),p);z(N,"Border2");let Y=N;Y.prototype._class+=" layout_Border2",Y.prototype.publish("showTop",!0,"boolean","If true, top widget adapter will display"),Y.prototype.publish("showRight",!0,"boolean","If true, right widget adapter will display"),Y.prototype.publish("showBottom",!0,"boolean","If true, bottom widget adapter will display"),Y.prototype.publish("showLeft",!0,"boolean","If true, left widget adapter will display"),Y.prototype.publish("topOverflowX","visible","set","Sets the overflow-x css style for the top widget adapter",["hidden","scroll","visible","auto"]),Y.prototype.publish("rightOverflowX","visible","set","Sets the overflow-x css style for the right widget adapter",["hidden","scroll","visible","auto"]),Y.prototype.publish("bottomOverflowX","visible","set","Sets the overflow-x css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),Y.prototype.publish("leftOverflowX","visible","set","Sets the overflow-x css style for the left widget adapter",["hidden","scroll","visible","auto"]),Y.prototype.publish("centerOverflowX","visible","set","Sets the overflow-x css style for the center widget adapter",["hidden","scroll","visible","auto"]),Y.prototype.publish("topOverflowY","visible","set","Sets the overflow-y css style for the top widget adapter",["hidden","scroll","visible","auto"]),Y.prototype.publish("rightOverflowY","visible","set","Sets the overflow-y css style for the right widget adapter",["hidden","scroll","visible","auto"]),Y.prototype.publish("bottomOverflowY","visible","set","Sets the overflow-y css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),Y.prototype.publish("leftOverflowY","visible","set","Sets the overflow-y css style for the left widget adapter",["hidden","scroll","visible","auto"]),Y.prototype.publish("centerOverflowY","visible","set","Sets the overflow-y css style for the center widget adapter",["hidden","scroll","visible","auto"]),Y.prototype.publish("top",null,"widget","Top Widget",void 0,{render:!1}),Y.prototype.publish("topOverlay",!1,"boolean","Overlay Top Widget"),Y.prototype.publish("left",null,"widget","Left Widget",void 0,{render:!1}),Y.prototype.publish("center",null,"widget","Center Widget",void 0,{render:!1}),Y.prototype.publish("right",null,"widget","Right Widget",void 0,{render:!1}),Y.prototype.publish("bottom",null,"widget","Bottom Widget",void 0,{render:!1}),Y.prototype.publish("bottomHeight",null,"number","Bottom Fixed Height",void 0,{optional:!0});const V=(u=class extends e.HTMLWidget{_prevActive=0;_root;activeWidget(){return this.widgets()[this.active()]}enter(t,e){super.enter(t,e),this._root=e.append("div").attr("id",`${this.id()}_root`)}update(t,i){super.update(t,i);const o=this.active(),s=this.width();this._root.style("width",`${s}px`).style("height",`${this.height()}px`);const l=this._root.selectAll(`#${this.id()}_root > .carouselItem`).data(this.widgets(),t=>t.id()),r=l.enter().append("div").attr("class","carouselItem").each(function(t){t.target(this)}).merge(l).style("left",(t,e)=>(e-this._prevActive)*s+"px").style("width",`${s}px`);this._prevActive!==o&&(r.style("display",(t,e)=>e===this._prevActive||e===o?null:"none").transition().duration(this.transitionDuration()).style("left",(t,e)=>(e-o)*s+"px").on("end",function(t,i){e.select(this).style("display",()=>i===o?null:"none")}),this._prevActive=o),l.exit().each(function(t){t.target(null)}).remove()}exit(t,e){this.widgets().forEach(t=>t.target(null)),super.exit(t,e)}render(t){return super.render(e=>{if(!this.visible()||this.isDOMHidden())t&&t(e);else{const i=this.activeWidget();i&&i.resize(this.size()).render(i=>{t&&t(e)})}})}},P(u,"_Carousel"),u);z(V,"Carousel");let X=V;X.prototype._class+=" layout_Carousel",X.prototype.publish("widgets",[],"widgetArray","Widgets",null,{render:!1}),X.prototype.publish("active",0,"number","Active widget"),X.prototype.publish("transitionDuration",500,"number","Transition duration");var U=Math.PI,j=2*U,q=1e-6,$=j-q;function J(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function K(){return new J}function Z(t){return z(P(function(){return t},"constant2"),"constant")}P(J,"Path"),z(J,"Path"),P(K,"path"),z(K,"path"),J.prototype=K.prototype={constructor:J,moveTo:z(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:z(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:z(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:z(function(t,e,i,o){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+o)},"quadraticCurveTo"),bezierCurveTo:z(function(t,e,i,o,s,l){this._+="C"+ +t+","+ +e+","+ +i+","+ +o+","+(this._x1=+s)+","+(this._y1=+l)},"bezierCurveTo"),arcTo:z(function(t,e,i,o,s){t=+t,e=+e,i=+i,o=+o,s=+s;var l=this._x1,r=this._y1,n=i-t,a=o-e,h=l-t,d=r-e,c=h*h+d*d;if(s<0)throw new Error("negative radius: "+s);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(c>q)if(Math.abs(d*n-a*h)>q&&s){var p=i-l,u=o-r,g=n*n+a*a,_=p*p+u*u,y=Math.sqrt(g),f=Math.sqrt(c),b=s*Math.tan((U-Math.acos((g+c-_)/(2*y*f)))/2),w=b/f,m=b/y;Math.abs(w-1)>q&&(this._+="L"+(t+w*h)+","+(e+w*d)),this._+="A"+s+","+s+",0,0,"+ +(d*p>h*u)+","+(this._x1=t+m*n)+","+(this._y1=e+m*a)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},"arcTo"),arc:z(function(t,e,i,o,s,l){t=+t,e=+e,l=!!l;var r=(i=+i)*Math.cos(o),n=i*Math.sin(o),a=t+r,h=e+n,d=1^l,c=l?o-s:s-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+a+","+h:(Math.abs(this._x1-a)>q||Math.abs(this._y1-h)>q)&&(this._+="L"+a+","+h),i&&(c<0&&(c=c%j+j),c>$?this._+="A"+i+","+i+",0,1,"+d+","+(t-r)+","+(e-n)+"A"+i+","+i+",0,1,"+d+","+(this._x1=a)+","+(this._y1=h):c>q&&(this._+="A"+i+","+i+",0,"+ +(c>=U)+","+d+","+(this._x1=t+i*Math.cos(s))+","+(this._y1=e+i*Math.sin(s))))},"arc"),rect:z(function(t,e,i,o){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +o+"h"+-i+"Z"},"rect"),toString:z(function(){return this._},"toString")},P(Z,"constant"),z(Z,"constant");var Q=Math.PI,tt=2*Q;const et={draw:z(function(t,e){var i=Math.sqrt(e/Q);t.moveTo(i,0),t.arc(0,0,i,0,tt)},"draw")},it={draw:z(function(t,e){var i=Math.sqrt(e/5)/2;t.moveTo(-3*i,-i),t.lineTo(-i,-i),t.lineTo(-i,-3*i),t.lineTo(i,-3*i),t.lineTo(i,-i),t.lineTo(3*i,-i),t.lineTo(3*i,i),t.lineTo(i,i),t.lineTo(i,3*i),t.lineTo(-i,3*i),t.lineTo(-i,i),t.lineTo(-3*i,i),t.closePath()},"draw")};var ot=Math.sqrt(1/3),st=2*ot;const lt={draw:z(function(t,e){var i=Math.sqrt(e/st),o=i*ot;t.moveTo(0,-i),t.lineTo(o,0),t.lineTo(0,i),t.lineTo(-o,0),t.closePath()},"draw")};var rt=Math.sin(Q/10)/Math.sin(7*Q/10),nt=Math.sin(tt/10)*rt,at=-Math.cos(tt/10)*rt;const ht={draw:z(function(t,e){var i=Math.sqrt(.8908130915292852*e),o=nt*i,s=at*i;t.moveTo(0,-i),t.lineTo(o,s);for(var l=1;l<5;++l){var r=tt*l/5,n=Math.cos(r),a=Math.sin(r);t.lineTo(a*i,-n*i),t.lineTo(n*o-a*s,a*o+n*s)}t.closePath()},"draw")},dt={draw:z(function(t,e){var i=Math.sqrt(e),o=-i/2;t.rect(o,o,i,i)},"draw")};var ct=Math.sqrt(3);const pt={draw:z(function(t,e){var i=-Math.sqrt(e/(3*ct));t.moveTo(0,2*i),t.lineTo(-ct*i,-i),t.lineTo(ct*i,-i),t.closePath()},"draw")};var ut=-.5,gt=Math.sqrt(3)/2,_t=1/Math.sqrt(12),yt=3*(_t/2+1);const ft={draw:z(function(t,e){var i=Math.sqrt(e/yt),o=i/2,s=i*_t,l=o,r=i*_t+i,n=-l,a=r;t.moveTo(o,s),t.lineTo(l,r),t.lineTo(n,a),t.lineTo(ut*o-gt*s,gt*o+ut*s),t.lineTo(ut*l-gt*r,gt*l+ut*r),t.lineTo(ut*n-gt*a,gt*n+ut*a),t.lineTo(ut*o+gt*s,ut*s-gt*o),t.lineTo(ut*l+gt*r,ut*r-gt*l),t.lineTo(ut*n+gt*a,ut*a-gt*n),t.closePath()},"draw")};function bt(){var t=Z(et),e=Z(64),i=null;function o(){var o;if(i||(i=o=K()),t.apply(this,arguments).draw(i,+e.apply(this,arguments)),o)return i=null,o+""||null}return P(o,"symbol"),z(o,"symbol"),o.type=function(e){return arguments.length?(t="function"==typeof e?e:Z(e),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),o):e},o.context=function(t){return arguments.length?(i=null==t?null:t,o):i},o}P(bt,"d3Symbol"),z(bt,"d3Symbol");var wt="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},mt=z(P(function(t){return t},"d3_identity2"),"d3_identity"),xt=z(P(function(t){for(var e=[],i=0,o=t.length;i<o;i++)e[i]=t[o-i-1];return e},"d3_reverse2"),"d3_reverse"),vt=z(P(function(t,i){t.each(function(){var t,o=e.select(this),s=o.text().split(/\s+/).reverse(),l=[];o.attr("y");for(var r=parseFloat(o.attr("dy"))||0,n=o.text(null).append("tspan").attr("x",0).attr("dy",r+"em");t=s.pop();)l.push(t),n.text(l.join(" ")),n.node().getComputedTextLength()>i&&l.length>1&&(l.pop(),n.text(l.join(" ")),l=[t],n=o.append("tspan").attr("x",0).attr("dy",1.2+r+"em").text(t))})},"d3_textWrapping2"),"d3_textWrapping"),Ct=z(P(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],i=arguments[2],o=arguments[3],s=arguments[4];if("object"===(void 0===e?"undefined":wt(e))){if(0===e.length)return t;for(var l=e.length;l<t.length;l++)e.push(t[l]);return e}if("function"==typeof e){for(var r=[],n=t.length,a=0;a<n;a++)r.push(e({i:a,genLength:n,generatedLabels:t,domain:i,range:o,labelDelimiter:s}));return r}return t},"d3_mergeLabels2"),"d3_mergeLabels"),Tt=z(P(function(t,e,i){var o=[];if(e.length>1)o=e;else for(var s=t.domain(),l=(s[s.length-1]-s[0])/(e-1),r=0;r<e;r++)o.push(s[0]+r*l);var n=o.map(i);return{data:o,labels:n,feature:z(P(function(e){return t(e)},"feature"),"feature")}},"d3_linearLegend2"),"d3_linearLegend"),St=z(P(function(t,e,i){var o=t.range().map(function(o){var s=t.invertExtent(o);return e(s[0])+" "+i+" "+e(s[1])});return{data:t.range(),labels:o,feature:mt}},"d3_quantLegend2"),"d3_quantLegend"),Pt=z(P(function(t){return{data:t.domain(),labels:t.domain(),feature:z(P(function(e){return t(e)},"feature"),"feature")}},"d3_ordinalLegend2"),"d3_ordinalLegend"),Bt=z(P(function(t,e,i){t.call("cellover",i,e)},"d3_cellOver2"),"d3_cellOver"),zt=z(P(function(t,e,i){t.call("cellout",i,e)},"d3_cellOut2"),"d3_cellOut"),At=z(P(function(t,e,i){t.call("cellclick",i,e)},"d3_cellClick2"),"d3_cellClick"),Wt={d3_drawShapes:z(P(function(t,e,i,o,s,l){"rect"===t?e.attr("height",i).attr("width",o):"circle"===t?e.attr("r",s):"line"===t?e.attr("x1",0).attr("x2",o).attr("y1",0).attr("y2",0):"path"===t&&e.attr("d",l)},"d3_drawShapes"),"d3_drawShapes"),d3_addText:z(P(function(t,e,i,o,s){e.append("text").attr("class",o+"label");var l=t.selectAll("g."+o+"cell text."+o+"label").data(i).text(mt);return s&&t.selectAll("g."+o+"cell text."+o+"label").call(vt,s),l},"d3_addText"),"d3_addText"),d3_calcType:z(P(function(t,e,i,o,s,l){var r=t.invertExtent?St(t,s,l):t.ticks?Tt(t,i,s):Pt(t),n=t.range&&t.range()||t.domain();return r.labels=Ct(r.labels,o,t.domain(),n,l),e&&(r.labels=xt(r.labels),r.data=xt(r.data)),r},"d3_calcType"),"d3_calcType"),d3_filterCells:z(P(function(t,e){var i=t.data.map(function(e,i){return{data:e,label:t.labels[i]}}).filter(e),o=i.map(function(t){return t.data}),s=i.map(function(t){return t.label});return t.data=t.data.filter(function(t){return-1!==o.indexOf(t)}),t.labels=t.labels.filter(function(t){return-1!==s.indexOf(t)}),t},"d3_filterCells"),"d3_filterCells"),d3_placement:z(P(function(t,e,i,o,s,l){e.attr("transform",i),o.attr("transform",s),"horizontal"===t&&o.style("text-anchor",l)},"d3_placement"),"d3_placement"),d3_addEvents:z(P(function(t,e){t.on("mouseover.legend",function(t){Bt(e,t,this)}).on("mouseout.legend",function(t){zt(e,t,this)}).on("click.legend",function(t){At(e,t,this)})},"d3_addEvents"),"d3_addEvents"),d3_title:z(P(function(t,e,i,o){if(""!==e){t.selectAll("text."+i+"legendTitle").data([e]).enter().append("text").attr("class",i+"legendTitle"),t.selectAll("text."+i+"legendTitle").text(e),o&&t.selectAll("text."+i+"legendTitle").call(vt,o);var s=t.select("."+i+"legendCells"),l=t.select("."+i+"legendTitle").nodes().map(function(t){return t.getBBox().height})[0],r=-s.nodes().map(function(t){return t.getBBox().x})[0];s.attr("transform","translate("+r+","+l+")")}},"d3_title"),"d3_title"),d3_defaultLocale:{format:e.format,formatPrefix:e.formatPrefix},d3_defaultFormatSpecifier:".01f",d3_defaultDelimiter:"to"};function kt(){var t=e.scaleLinear(),i="rect",o=15,s=15,l=10,r=2,n=[5],a=void 0,h=[],d="",c=!1,p="",u=Wt.d3_defaultLocale,g=Wt.d3_defaultFormatSpecifier,_=10,y="middle",f=Wt.d3_defaultDelimiter,b=void 0,w="vertical",m=!1,x=void 0,v=void 0,C=e.dispatch("cellover","cellout","cellclick");function T(T){var S=Wt.d3_calcType(t,m,n,h,u.format(g),f);T.selectAll("g").data([t]).enter().append("g").attr("class",d+"legendCells"),a&&Wt.d3_filterCells(S,a);var B=T.select("."+d+"legendCells").selectAll("."+d+"cell").data(S.data),A=B.enter().append("g").attr("class",d+"cell");A.append(i).attr("class",d+"swatch");var W=T.selectAll("g."+d+"cell "+i+"."+d+"swatch").data(S.data);Wt.d3_addEvents(A,C),B.exit().transition().style("opacity",0).remove(),W.exit().transition().style("opacity",0).remove(),W=W.merge(W),Wt.d3_drawShapes(i,W,s,o,l,x);var k=Wt.d3_addText(T,A,S.labels,d,b);B=A.merge(B);var I=k.nodes().map(function(t){return t.getBBox()}),M=W.nodes().map(function(t){return t.getBBox()});c?W.attr("class",function(t){return d+"swatch "+S.feature(t)}):"line"==i?W.style("stroke",S.feature):W.style("fill",S.feature);var H,D=void 0,L=void 0,O="start"==y?0:"middle"==y?.5:1;"vertical"===w?(H=I.map(function(t,e){return Math.max(t.height,M[e].height)}),D=z(P(function(t,i){return"translate(0, "+(e.sum(H.slice(0,i))+i*r)+")"},"cellTrans2"),"cellTrans"),L=z(P(function(t,e){return"translate( "+(M[e].width+M[e].x+_)+", "+(M[e].y+M[e].height/2+5)+")"},"textTrans2"),"textTrans")):"horizontal"===w&&(D=z(P(function(t,e){return"translate("+e*(M[e].width+r)+",0)"},"cellTrans2"),"cellTrans"),L=z(P(function(t,e){return"translate("+(M[e].width*O+M[e].x)+",\n "+(M[e].height+M[e].y+_+8)+")"},"textTrans2"),"textTrans")),Wt.d3_placement(w,B,D,k,L,y),Wt.d3_title(T,p,d,v),B.transition().style("opacity",1)}return P(T,"legend"),z(T,"legend"),T.scale=function(e){return arguments.length?(t=e,T):t},T.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(n=t),T):n},T.cellFilter=function(t){return arguments.length?(a=t,T):a},T.shape=function(t,e){return arguments.length?(("rect"==t||"circle"==t||"line"==t||"path"==t&&"string"==typeof e)&&(i=t,x=e),T):i},T.shapeWidth=function(t){return arguments.length?(o=+t,T):o},T.shapeHeight=function(t){return arguments.length?(s=+t,T):s},T.shapeRadius=function(t){return arguments.length?(l=+t,T):l},T.shapePadding=function(t){return arguments.length?(r=+t,T):r},T.labels=function(t){return arguments.length?(h=t,T):h},T.labelAlign=function(t){return arguments.length?("start"!=t&&"end"!=t&&"middle"!=t||(y=t),T):y},T.locale=function(t){return arguments.length?(u=e.formatLocale(t),T):u},T.labelFormat=function(t){return arguments.length?(g=e.formatSpecifier(t),T):T.locale().format(g)},T.labelOffset=function(t){return arguments.length?(_=+t,T):_},T.labelDelimiter=function(t){return arguments.length?(f=t,T):f},T.labelWrap=function(t){return arguments.length?(b=t,T):b},T.useClass=function(t){return arguments.length?(!0!==t&&!1!==t||(c=t),T):c},T.orient=function(t){return arguments.length?("horizontal"!=(t=t.toLowerCase())&&"vertical"!=t||(w=t),T):w},T.ascending=function(t){return arguments.length?(m=!!t,T):m},T.classPrefix=function(t){return arguments.length?(d=t,T):d},T.title=function(t){return arguments.length?(p=t,T):p},T.titleWidth=function(t){return arguments.length?(v=t,T):v},T.textWrap=function(t){return arguments.length?(textWrap=t,T):textWrap},T.on=function(){var t=C.on.apply(C,arguments);return t===C?T:t},T}P(kt,"color"),z(kt,"color");const It=(g=class extends e.SVGWidget{_owner;_targetWidget;_targetWidgetMonitor;_legendOrdinal;_disabled=[];_symbolTypeMap={circle:et,cross:it,diamond:lt,square:dt,star:ht,triangle:pt,wye:ft};constructor(t){super(),this._owner=t,this._drawStartPos="origin";const e=this;this._legendOrdinal=kt().shape("path",bt().type(et).size(150)()).shapePadding(10).shapeRadius(10).on("cellclick",function(t){e.onClick(t,this)}).on("cellover",t=>{e.onOver(t,this)}).on("cellout",t=>{e.onOut(t,this)})}isDisabled(t){return void 0!==t&&("string"==typeof t?0===t.indexOf("__")||this._disabled.indexOf(t)>=0:t instanceof e.Database.Field?0===t.id().indexOf("__")||this._disabled.indexOf(t.id())>=0:this._disabled.indexOf(t)>=0)}filteredFields(){switch(this.dataFamily()){case"2D":return this.fields();case"ND":return this.fields().filter(t=>!this.isDisabled(t))}return this.fields()}filteredColumns(){switch(this.dataFamily()){case"2D":return this.columns();case"ND":return this.columns().filter(t=>!this.isDisabled(t))}return this.columns()}filteredData(){switch(this.dataFamily()){case"2D":return this.data().filter(t=>!this.isDisabled(t[0]));case"ND":const t={};let e=!1;return this.columns().forEach((i,o)=>{const s=this.isDisabled(i);t[o]=s,s&&(e=!0)}),e?this.data().map(e=>e.filter((e,i)=>!t[i])):this.data()}return this.data()}isRainbow(){const t=this.getWidget();return t&&t._palette&&"rainbow"===t._palette.type()}targetWidget(t){if(!arguments.length)return this._targetWidget;if(this._targetWidget=t,this._targetWidgetMonitor&&(this._targetWidgetMonitor.remove(),delete this._targetWidgetMonitor),this._targetWidget){const t=this;this._targetWidgetMonitor=this._targetWidget.monitor(function(e,i,o,s){switch(e){case"chart":case"columns":case"data":case"paletteID":t.lazyRender()}})}return this}getWidget(){return this._targetWidget&&"composite_MultiChart"===this._targetWidget.classID()?this._targetWidget.chart():this._targetWidget}getPalette(){const t=this.getWidget();if(t&&t._palette)switch(t._palette.type()){case"ordinal":return e.Palette.ordinal(t._palette.id());case"rainbow":return e.Palette.rainbow(t._palette.id())}return e.Palette.ordinal("default")}getPaletteType(){return this.getPalette().type()}fillColorFunc(){const t=this.getWidget();if(t&&t.fillColor)return t._palette&&t.paletteID&&t._palette.name!==t.paletteID()&&(t._palette=t._palette.switch(t.paletteID())),(e,i,o)=>t.fillColor(e,i,o);const i=e.Palette.ordinal(t&&t.paletteID&&t.paletteID()||"default");return(t,e,o)=>i(e)}fillColor(t,e,i){return this.fillColorFunc()(t,e,i)}_g;enter(t,e){super.enter(t,e),this._g=e.append("g").attr("class","legendOrdinal")}calcMetaData(){let t=[],i=0,o=0;const s=this.columns().length;if(this._targetWidget){const l=this.columns();switch(this.getPaletteType()){case"ordinal":const r=this.fillColorFunc();let n=0;switch(this.dataFamily()){case"2D":t=this.data().map(function(t,e){n=this.data()[e].slice(1,s).reduce((t,e)=>t+e,0);const l=this.isDisabled(t[0]);l||(i+=n);const a=t[0]+(!l&&this.showSeriesTotal()?` (${n})`:""),h=this.textSize(a);return o<h.width&&(o=h.width),[r(t,t[0],!1),t[0],a]},this);break;case"ND":t=this.columns().filter(t=>0!==t.indexOf("__")).filter(function(t,e){return e>0}).map(function(t,e){n=this.data().reduce((t,i)=>t+i[e+1],0);const s=this.isDisabled(l[e+1]),a=t+(!s&&this.showSeriesTotal()?` (${n})`:"");s||(i+=n);const h=this.textSize(a);return o<h.width&&(o=h.width),[r(void 0,t,!1),t,a]},this);break;default:t=this.columns().map(function(t){return[r(void 0,t,!1),t]},this)}break;case"rainbow":const a=this.getPalette(),h=e.format(this.rainbowFormat()),d=this.getWidget(),c=this.rainbowBins(),p=d._dataMinWeight,u=d._dataMaxWeight,g=(u-p)/(c-1);t.push([a(p,p,u),h(p)]);for(let e=1;e<c-1;++e){let i=g*e;Math.floor(i)>parseInt(t[0][1])&&(i=Math.floor(i)),t.push([a(i,p,u),h(i)])}t.push([a(u,p,u),h(u)])}}return{dataArr:t,total:i,maxLabelWidth:o}}update(t,i){super.update(t,i);const{dataArr:o,maxLabelWidth:s,total:l}=this.calcMetaData(),r=this.shapeRadius(),n=this.radiusToSymbolSize(r);let a=this.itemPadding();"horizontal"===this.orientation()&&(a+=s-2*r);const h=e.scaleOrdinal().domain(o.map(t=>t[1])).range(o.map(t=>t[0]));this._legendOrdinal.shape("path",bt().type(this._symbolTypeMap[this.symbolType()]).size(n)()).orient(this.orientation()).title(this.title()).labelWrap(this.labelMaxWidth()).labelAlign(this.labelAlign()).shapePadding(a).scale(h).labels(t=>o[t.i][2]),this._g.call(this._legendOrdinal),this.updateDisabled(i,o);const d=this._g.select(".legendCells").node().getBBox();let c=Math.abs(d.x),p=Math.abs(d.y)+1;if("horizontal"===this.orientation()){if("start"===this.labelAlign()?c+=1:"end"===this.labelAlign()&&(c-=1),this.width()>d.width){c+=(this.width()-d.width)/2}}else if("vertical"===this.orientation()&&(c+=1,this._containerSize.height>d.height)){p+=(this.height()-d.height)/2}this._g.attr("transform",`translate(${c}, ${p})`),this.pos({x:0,y:0}),this._legendOrdinal.labelOffset(this.itemPadding());const u=this._g.selectAll(".legendTotal").data(o.length&&this.showLegendTotal()?[l]:[]),g=`Total: ${l}`,_=-c,y=d.height+this.itemPadding()+1;this.enableOverflowScroll(!1),this.enableOverflow(!0),u.enter().append("text").classed("legendTotal",!0).merge(u).attr("transform",`translate(${_}, ${y})`).text(g),u.exit().remove()}updateDisabled(t,e){t.style("cursor","pointer").selectAll("path.swatch").filter((t,i)=>i<e.length).style("stroke",(t,i)=>e[i][0]).style("fill",(t,i)=>this._disabled.indexOf(t)<0?e[i][0]:"white")}postUpdate(t,e){let i;this._boundingBox&&(i=this._boundingBox.width,this._boundingBox.width=this._size.width),super.postUpdate(t,e),void 0!==i&&(this._boundingBox.width=i),this._parentRelativeDiv.style("overflow","hidden")}exit(t,e){super.exit(t,e)}radiusToSymbolSize(t){const e=Math.pow(t,2)*Math.PI;switch(this.symbolType()){case"star":return.45*e;case"triangle":return.65*e;case"cross":case"diamond":case"wye":return.75*e;case"circle":return e;case"square":return 1.3*e}}onClick(t,e){if("ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":const e=this._disabled.indexOf(t);e<0?this._disabled.push(t):this._disabled.splice(e,1),this._owner.refreshColumns(),this._owner.refreshData(),this._owner.render()}}onOver(t,e){if(o.instanceOfIHighlight(this._owner)&&"ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":this._disabled.indexOf(t)<0&&this._owner.highlightColumn(t)}}onOut(t,e){if(o.instanceOfIHighlight(this._owner)&&"ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":this._owner.highlightColumn()}}onDblClick(t,e){}onMouseOver(t,e){}_containerSize;resize(t){let e;if(this.fitToContent()){this._containerSize=t;const i=this.getBBox();t.width>i.width&&(i.width=t.width),t.height>i.height&&(i.height=t.height),e=super.resize.apply(this,[{...i}])}else e=super.resize.apply(this,arguments);return e}},P(g,"_Legend"),g);z(It,"Legend");let Mt=It;Mt.prototype._class+=" layout_Legend",Mt.prototype.publish("title","","string","Title"),Mt.prototype.publish("symbolType","circle","set","Shape of each legend item",["circle","cross","diamond","square","star","triangle","wye"]),Mt.prototype.publish("labelMaxWidth",null,"number","Max Label Width (pixels)",null,{optional:!0}),Mt.prototype.publish("orientation","vertical","set","Orientation of Legend rows",["vertical","horizontal"],{tags:["Private"]}),Mt.prototype.publish("dataFamily","ND","set","Type of data",["1D","2D","ND","map","graph","any"],{tags:["Private"]}),Mt.prototype.publish("rainbowFormat",",","string","Rainbow number formatting",null,{tags:["Private"],optional:!0,disable:z(t=>!t.isRainbow(),"disable")}),Mt.prototype.publish("rainbowBins",8,"number","Number of rainbow bins",null,{tags:["Private"],disable:z(t=>!t.isRainbow(),"disable")}),Mt.prototype.publish("showSeriesTotal",!1,"boolean","Show value next to series"),Mt.prototype.publish("showLegendTotal",!1,"boolean","Show a total of the series values under the legend",null),Mt.prototype.publish("itemPadding",8,"number","Padding between legend items (pixels)"),Mt.prototype.publish("shapeRadius",7,"number","Radius of legend shape (pixels)"),Mt.prototype.publish("fitToContent",!0,"boolean","If true, resize will simply reapply the bounding box dimensions"),Mt.prototype.publish("labelAlign","start","set","Horizontal alignment of legend item label (for horizontal orientation only)",["start","middle","end"],{optional:!0,disable:z(t=>"vertical"===t.orientation(),"disable")});const Ht=(_=class extends e.HTMLWidget{_widget;_relativeTarget;_fade;_modal;_modalHeader;_modalBody;_modalHeaderAnnotations;_modalHeaderCloseButton;_close;constructor(){super(),this._tag="div"}closeModal(){this.visible(!1)}getRelativeTarget(){let t;return this.relativeTargetId()&&(t=document.getElementById(this.relativeTargetId()),t)?t:!t&&(t=this.locateAncestor("layout_Grid"),t&&t.element)?t.element().node():document.body}setModalSize(){null!==this.fixedHeight()&&null!==this.fixedWidth()?this._modal.style("height",this.fixedHeight()).style("width",this.fixedWidth()).style("min-height",null).style("min-width",null).style("max-height",null).style("max-width",null):(this.minHeight()||this.minWidth())&&this._modal.style("min-height",this.minHeight()).style("min-width",this.minWidth()).style("max-height",this.maxHeight()).style("max-width",this.maxWidth());const t=this._modal.node().getBoundingClientRect(),e=this._modalHeader.node().getBoundingClientRect();return this._modalBody.style("height",t.height-e.height+"px").style("width",t.width),t}setFadePosition(t){this._fade.style("top",t.top+"px").style("left",t.left+"px").style("width",t.width+"px").style("height",t.height+"px")}setModalPosition(t){const e=this.setModalSize();if(null!==this.fixedTop()&&null!==this.fixedLeft())this._modal.style("top",`calc(${this.fixedTop()} + ${t.top}px)`).style("left",`calc(${this.fixedLeft()} + ${t.left}px)`);else if(null!==this.fixedHeight()&&null!==this.fixedWidth())this._modal.style("top",t.top+t.height/2-e.height/2+"px").style("left",t.left+t.width/2-e.width/2+"px");else if(this.minHeight()||this.minWidth()){const e=this._modal.node().getBoundingClientRect();this._modal.style("top",t.top+t.height/2-e.height/2+"px").style("left",t.left+t.width/2-e.width/2+"px")}}resize(t){return super.resize(),this._modal&&this.setModalSize(),this}resizeBodySync(t,e){const i=this._modalHeader.node().getBoundingClientRect();return this._modal.style("width",t+"px").style("height",e+i.height+"px").style("min-width",t+"px").style("min-height",e+i.height+"px"),this._modalHeader.style("width",t+"px"),this._modalBody.style("width",t+"px").style("height",e+"px"),this.minWidth(t+"px").minHeight(e+i.height+"px").resize({height:e+i.height,width:t})}enter(t,e){super.enter(t,e),this._fade=e.append("div").classed("layout_Modal-fade",!0).classed("layout_Modal-fadeClickable",this.enableClickFadeToClose()).classed("layout_Modal-fade-hidden",!this.showFade());const i=2*this.titleFontSize();this._modal=e.append("div").classed("layout_Modal-content",!0),this._modalHeader=this._modal.append("div").classed("layout_Modal-header",!0).style("color",this.titleFontColor()).style("font-size",this.titleFontSize()+"px").style("height",i+"px"),this._modalBody=this._modal.append("div").classed("layout_Modal-body",!0).style("height",`calc( 100% - ${i}px )`).style("overflow-x",this.overflowX()).style("overflow-y",this.overflowY()),this._modalHeader.append("div").classed("layout_Modal-title",!0).style("line-height",this.titleFontSize()+"px").style("top",this.titleFontSize()/2+"px").style("left",this.titleFontSize()/2+"px").text(this.formattedTitle()),this._modalHeaderAnnotations=this._modalHeader.append("div").classed("layout_Modal-annotations",!0),this._modalHeaderCloseButton=this._modalHeaderAnnotations.append("div").classed("layout_Modal-closeButton",!0).html('<i class="fa fa-close"></i>'),this._modalHeaderAnnotations.style("line-height",this.titleFontSize()+"px").style("right",this.titleFontSize()/2+"px").style("top",this.titleFontSize()/2+"px"),this._modalHeaderCloseButton.on("click",()=>{this.closeModal()}),this._fade.on("click",t=>{this.enableClickFadeToClose()&&this.closeModal()})}update(t,e){super.update(t,e),e.style("display",this.show()?null:"none"),this._fade.classed("layout_Modal-fade-hidden",!this.showFade()),this._relativeTarget=this.getRelativeTarget(),this.setModalSize();const i=this._relativeTarget.getBoundingClientRect();this.setFadePosition(i),this.setModalPosition(i),this.show()?(this._widget.target()||this._widget.target(this._modalBody.node()),this._widget.resize().render()):this._widget.target(null).render()}exit(t,e){this._widget&&this._widget.target(null),super.exit(t,e)}formattedTitle(){const t=this.title_exists()?this.title().trim():"";return t.length>0&&"("===t.slice(0,1)&&")"===t.slice(-1)?t.slice(1,-1):this.title()}},P(_,"_Modal"),_);z(Ht,"Modal");let Dt=Ht;Dt.prototype._class+=" layout_Modal",Dt.prototype.publish("title",null,"string","title"),Dt.prototype.publish("widget",null,"widget","widget"),Dt.prototype.publish("titleFontSize",18,"number","titleFontSize (in pixels)"),Dt.prototype.publish("titleFontColor","#ffffff","html-color","titleFontColor"),Dt.prototype.publish("relativeTargetId",null,"string","relativeTargetId"),Dt.prototype.publish("show",!0,"boolean","show"),Dt.prototype.publish("showFade",!0,"boolean","showFade"),Dt.prototype.publish("enableClickFadeToClose",!0,"boolean","enableClickFadeToClose"),Dt.prototype.publish("minWidth","400px","string","minWidth"),Dt.prototype.publish("minHeight","400px","string","minHeight"),Dt.prototype.publish("maxWidth","800px","string","maxWidth"),Dt.prototype.publish("maxHeight","800px","string","maxHeight"),Dt.prototype.publish("fixedWidth",null,"string","fixedWidth"),Dt.prototype.publish("fixedHeight",null,"string","fixedHeight"),Dt.prototype.publish("fixedTop",null,"string","fixedTop"),Dt.prototype.publish("fixedLeft",null,"string","fixedLeft"),Dt.prototype.publish("overflowX","hidden","string","overflowX"),Dt.prototype.publish("overflowY","scroll","string","overflowY");const Lt=(y=class extends Y{_legend=new Mt(this).enableOverflow(!0);_progressBar=new e.ProgressBar;_autoScale=!1;_resolutions={tiny:{width:100,height:100},small:{width:300,height:300}};_modal=new Dt;_highlight;_scale;_orig_size;_toggleInfo=(new e.ToggleButton).faChar("fa-info-circle").tooltip(".Description").selected(!1).on("enabled",()=>""!==this.description()).on("click",()=>{if(this._toggleInfo.selected()){this._modal.title(this.title()).widget((new e.Text).text(this.description())).show(!0).render();const t=this._modal._close;this._modal._close=()=>{this._toggleInfo.selected(!1).render(),this._modal._close=t}}}).on("mouseMove",()=>{}).on("mouseOut",()=>{});_toggleData=(new e.ToggleButton).faChar("fa-table").tooltip("Data").on("click",()=>{this.dataVisible(this._toggleData.selected()),this.render()});_buttonDownload=(new e.Button).faChar("fa-download").tooltip("Download").on("click",()=>{this.downloadCSV()});_buttonDownloadImage=(new e.Button).faChar("fa-image").tooltip("Download Image").on("click",()=>{this.downloadPNG()});_toggleLegend=(new e.ToggleButton).faChar("fa-list-ul").tooltip("Legend").selected(!1).on("click",()=>{const t=this._toggleLegend.selected();"bottom"===this.legendPosition()?this.showBottom(t):"right"===this.legendPosition()&&this.showRight(t),this.legendVisible(t),this.render()});_spacer=new e.Spacer;_titleBar=(new e.TitleBar).buttons([this._toggleData,this._buttonDownload,this._buttonDownloadImage,this._spacer,this._toggleLegend]);_carousel=new X;_table=new i.Table;_widget;_hideLegendToggleList=["dgrid_Table"];constructor(){super(),this._tag="div"}fields(t){return arguments.length?(super.fields(t),this._legend.fields(t),this.refreshFields(),this):super.fields()}refreshFields(){return this._widget.fields(this._legend.filteredFields()),this._table.fields(this._legend.filteredFields()),this}columns(t,e){return arguments.length?(super.columns(t,e),this._legend.columns(t,e),this.refreshColumns(),this):super.columns()}refreshColumns(){return this._widget.columns(this._legend.filteredColumns()),this._table.columns(this._legend.filteredColumns()),this}data(t){return arguments.length?(super.data(t),this._legend.data(t),this.refreshData(),this):super.data()}refreshData(){return this._widget.data(this._legend.filteredData()),this._table.data(this._legend.filteredData()),this}highlight(t){return arguments.length?(this._highlight=t,this):this._highlight}startProgress(){this._progressBar.start()}finishProgress(){this._progressBar.finish()}buttons(t){return arguments.length?(this._titleBar.buttons(t),this):this._titleBar.buttons()}downloadCSV(){const t=this.downloadTitle()?this.downloadTitle():this.title()?this.title():"data",i=this.downloadTimestampSuffix()?"_"+e.Utility.timestamp():"";return e.Utility.downloadString("CSV",this._widget.export("CSV"),t+i),this}downloadPNG(){const t=this.widget();return t instanceof e.SVGWidget&&(this.legendVisible()?t.downloadPNG(this.title(),void 0,this._legend):t.downloadPNG(this.title())),this}highlightColumn(t){if(t){const i=`series-${this.cssTag(t)}`;this._centerWA.element().selectAll(".series").each(function(){const t=e.select(this),o=t.classed(i);t.classed("highlight",o).classed("lowlight",!o)})}else this._centerWA.element().selectAll(".series").classed("highlight",!1).classed("lowlight",!1);return this}getResponsiveMode(){return this.enableAutoscaling()?this._autoScale?this.size().width<=this._resolutions.tiny.width||this.size().height<=this._resolutions.tiny.height?"tiny":this.size().width<=this._resolutions.small.width||this.size().height<=this._resolutions.small.height?"small":"regular":"regular":"none"}setOrigSize(){this._orig_size=JSON.parse(JSON.stringify(this.size()))}enter(t,e){super.enter(t,e),this._modal.target(this.target()).relativeTargetId(this.id()),this.top(this._titleBar),this.center(this._carousel),this._legend.targetWidget(this._widget).orientation("vertical").title("").visible(!1),this._progressBar.enter(t,e),this.setOrigSize()}preUpdateTiny(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none")}preUpdateSmall(t){const e=this._orig_size.width/this._resolutions.small.width,i=this._orig_size.height/this._resolutions.small.height;this._scale=Math.min(e,i);const o=this._scale===e;this.size({width:o?this._resolutions.small.width:this._orig_size.width*(1/this._scale),height:o?this._orig_size.height*(1/this._scale):this._resolutions.small.height}),t.select("div.title-icon").style("position","static"),t.selectAll("lhs").style("display","none"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden"),t.style("transform",`scale(${this._scale})`)}preUpdateRegular(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden"),t.select("div.title-icon").style("position","static"),t.style("transform","translate(0px,0px) scale(1)")}_prevdataVisible;_prevlegendVisible;_prevLegendPosition;_prevChartDataFamily;_prevChart;_prevButtons;update(t,e){super.update(t,e)}preUpdate(t,i){switch(super.preUpdate(t,i),this._prevLegendPosition!==this.legendPosition()&&(null!==this._legend.target()&&this._legend.target(null),void 0!==this._prevLegendPosition?this.swap(this._prevLegendPosition,this.legendPosition()):this[this.legendPosition()](this._legend),"right"===this.legendPosition()?(this.rightOverflowX("hidden"),this.rightOverflowY("auto"),this.bottomOverflowX("visible"),this.bottomOverflowY("visible")):(this.rightOverflowX("visible"),this.rightOverflowY("visible"),this.bottomOverflowX("auto"),this.bottomOverflowY("hidden")),this._prevLegendPosition=this.legendPosition()),this._prevdataVisible!==this.dataVisible()&&(this._prevdataVisible=this.dataVisible(),this._toggleData.selected(this._prevdataVisible),this._legend.visible(this._prevlegendVisible&&!this._prevdataVisible),this._carousel.active(this._prevdataVisible?1:0)),this._prevlegendVisible!==this.legendVisible()&&(this._prevlegendVisible=this.legendVisible(),this._toggleLegend.selected(this._prevlegendVisible),this._legend.visible(this._prevlegendVisible&&!this._prevdataVisible)),this._legend.orientation("bottom"===this.legendPosition()?"horizontal":"vertical"),this.showLeft(!this.left()),this.getResponsiveMode()){case"tiny":this.preUpdateTiny(i);break;case"small":this.preUpdateSmall(i);break;case"regular":this.preUpdateRegular(i)}const o="composite_MultiChart"===this._widget.classID()?this._widget.chart():this._widget;if(this._legend.dataFamily(o._dataFamily||"any"),this._prevChartDataFamily!==this._legend.dataFamily()&&(this._prevChartDataFamily=this._legend.dataFamily(),"any"===this._prevChartDataFamily))this._toggleLegend.selected(!1),this._legend.visible(!1);if(i.style("box-shadow",this.highlight()?`inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}`:"none"),-1!==this._hideLegendToggleList.indexOf(o.classID())?(this._spacer.visible(!1),this._toggleLegend.visible(!1)):(this._spacer.visible(!0),this._toggleLegend.visible(!0)),this._prevChart!==o){this._prevChart=o;const t=o?o._titleBar||o._iconBar:void 0;if(t&&t instanceof e.IconBar){this._prevButtons=this._prevButtons||[...this.buttons()];const i=[...t.buttons(),new e.Spacer,...this._prevButtons];t.buttons([]).render(),this.buttons(i)}else this._prevButtons&&this.buttons(this._prevButtons)}const s=[];this.dataButtonVisible()||s.push(this._toggleData),this.downloadButtonVisible()||s.push(this._buttonDownload),this.downloadImageButtonVisible()||s.push(this._buttonDownloadImage),this.legendButtonVisible()||s.push(this._toggleLegend),this._buttonDownloadImage.enabled(this.widget()instanceof e.SVGWidget),this._titleBar.hiddenButtons(s).visible(this.titleVisible()),this.topOverlay(this.titleOverlay()||!this.titleVisible())}postUpdate(t,e){switch(super.postUpdate(t,e),this.getResponsiveMode()){case"tiny":this.postUpdateTiny(e);break;case"small":this.postUpdateSmall(e);break;case"regular":this.postUpdateRegular(e)}}postUpdateTiny(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none"),t.selectAll("div.data-count").style("visibility","visible").style("font-size",this.titleIconFontSize()/3+"px").style("line-height",this.titleIconFontSize()/3+"px").style("left",this.titleIconFontSize()+"px").text(this.data().length),t.style("transform","translate(0px,0px) scale(1)");const e=t.selectAll("div.title-icon"),i=e.node(),o=t.node().parentElement.getBoundingClientRect();if(i){const i=e.node().getBoundingClientRect(),s=o.height/2;e.style("position","absolute").style("left",`calc(50% - ${i.width/2}px)`).style("top",s-i.height/2+"px"),t.selectAll("div.data-count").style("position","absolute").style("left",`calc(50% + ${i.width/2}px)`).style("top",s-i.height/2+"px")}}postUpdateSmall(t){t.selectAll("lhs").style("display","none"),t.selectAll("div.title-icon").style("position","static"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden");const e=t.node().getBoundingClientRect(),i=t.node().parentElement.getBoundingClientRect();t.style("transform",`translate(${i.x-e.x}px, ${i.y-e.y}px) scale(${this._scale})`)}postUpdateRegular(t){t.selectAll("div.title-icon").style("position","static"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden")}exit(t,e){this._progressBar.exit(t,e),this.right(null),this._legend.target(null),this.center(null),this._carousel.target(null),this.top(null),this._titleBar.target(null),this._modal.target(null),delete this._prevChart,delete this._prevButtons,delete this._prevChartDataFamily,delete this._prevPos,delete this._prevdataVisible,delete this._prevlegendVisible,super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}vertex_click(t,e,i,o){o&&o.vertex}vertex_dblclick(t,e,i,o){o&&o.vertex}edge_click(t,e,i,o){o&&o.edge}edge_dblclick(t,e,i,o){o&&o.edge}},P(y,"_ChartPanel"),y);z(Lt,"ChartPanel");let Ot=Lt;Ot.prototype._class+=" layout_ChartPanel",Ot.prototype.publishReset(),Ot.prototype.publishProxy("title","_titleBar"),Ot.prototype.publish("titleVisible",!0,"boolean"),Ot.prototype.publish("titleOverlay",!1,"boolean"),Ot.prototype.publishProxy("titleIcon","_titleBar"),Ot.prototype.publishProxy("titleIconFont","_titleBar"),Ot.prototype.publishProxy("titleFont","_titleBar"),Ot.prototype.publishProxy("titleIconFontSize","_titleBar"),Ot.prototype.publishProxy("titleFontSize","_titleBar"),Ot.prototype.publishProxy("description","_titleBar"),Ot.prototype.publishProxy("descriptionFont","_titleBar"),Ot.prototype.publishProxy("descriptionFontSize","_titleBar"),Ot.prototype.publish("dataVisible",!1,"boolean","Show data table"),Ot.prototype.publish("dataButtonVisible",!0,"boolean","Show data table button"),Ot.prototype.publish("downloadButtonVisible",!0,"boolean","Show data download button"),Ot.prototype.publish("downloadImageButtonVisible",!1,"boolean","Show image download button"),Ot.prototype.publish("downloadTitle","","string","File name when downloaded"),Ot.prototype.publish("downloadTimestampSuffix",!0,"boolean","Use timestamp as file name suffix"),Ot.prototype.publish("legendVisible",!1,"boolean","Show legend"),Ot.prototype.publish("legendButtonVisible",!0,"boolean","Show legend button"),Ot.prototype.publish("legendPosition","right","set","Position of legend",["right","bottom"]),Ot.prototype.publishProxy("legend_labelMaxWidth","_legend","labelMaxWidth"),Ot.prototype.publishProxy("legend_showSeriesTotal","_legend","showSeriesTotal"),Ot.prototype.publishProxy("legend_showLegendTotal","_legend","showLegendTotal"),Ot.prototype.publishProxy("legend_itemPadding","_legend","itemPadding"),Ot.prototype.publishProxy("legend_shapeRadius","_legend","shapeRadius"),Ot.prototype.publishProxy("legend_symbolType","_legend","symbolType"),Ot.prototype.publishProxy("legend_labelAlign","_legend","labelAlign"),Ot.prototype.publish("widget",null,"widget","Widget",void 0,{render:!1}),Ot.prototype.publish("enableAutoscaling",!1,"boolean"),Ot.prototype.publish("highlightSize",4,"number"),Ot.prototype.publish("highlightColor","#e67e22","html-color"),Ot.prototype.publishProxy("progress_halfLife","_progressBar","halfLife"),Ot.prototype.publishProxy("progress_decay","_progressBar","decay"),Ot.prototype.publishProxy("progress_size","_progressBar","size"),Ot.prototype.publishProxy("progress_color","_progressBar","color"),Ot.prototype.publishProxy("progress_blurBar","_progressBar","blurBar"),Ot.prototype.publishProxy("progress_blurSize","_progressBar","blurSize"),Ot.prototype.publishProxy("progress_blurColor","_progressBar","blurColor"),Ot.prototype.publishProxy("progress_blurOpacity","_progressBar","blurOpacity"),Ot.prototype.widget=function(t){if(!arguments.length)return this._widget;this._carousel.widgets([t,this._table]),this._widget=t,this._widget.fields(this._legend.filteredFields()).data(this._legend.filteredData());const e=this,i=this._widget;return i.click=function(){e.click.apply(e,arguments)},i.dblclick=function(){e.dblclick.apply(e,arguments)},i.vertex_click=function(){e.vertex_click.apply(e,arguments)},i.vertex_dblclick=function(){e.vertex_dblclick.apply(e,arguments)},i.edge_click=function(){e.edge_click.apply(e,arguments)},i.edge_dblclick=function(){e.edge_dblclick.apply(e,arguments)},this};const Ft=(f=class extends e.HTMLWidget{constructor(){super()}enter(t,i){super.enter(t,i),e.select(t.parentNode).style("height","100%").style("width","100%")}update(t,e){super.update(t,e);const i=this,o=[];this.updateFlexParent(e);const s=e.selectAll(".FlexGrid-list-item").data(this.widgets(),t=>t.id());s.enter().append("div").classed("FlexGrid-list-item",!0).each(function(t){t.target(this)}).merge(s).style("min-height",this.itemMinHeight()+"px").style("min-width",this.itemMinWidth()+"px").style("flex-basis",(t,e)=>{const i=this.widgetsFlexBasis()[e];return void 0!==i?i:this.flexBasis()}).style("flex-grow",(t,e)=>{const i=this.widgetsFlexGrow()[e];return void 0!==i?i:this.flexGrow()}).style("border-width",this.borderWidth()+"px").style("border-color",this.itemBorderColor()).each(function(){this.firstChild.style.display="none"}).each(function(){const t=this.getBoundingClientRect();o.push([t.width,t.height])}).each(function(t,e){this.firstChild.style.display="block",t.resize({width:o[e][0]-2*i.borderWidth(),height:o[e][1]-2*i.borderWidth()})}),s.exit().remove()}exit(t,e){super.exit(t,e)}updateFlexParent(t){t.style("height","100%").style("flex-direction","horizontal"===this.orientation()?"row":"column").style("flex-wrap",this.flexWrap()).style("align-items",this.alignItems()).style("align-content",this.alignContent()).style("overflow-x",()=>this.forceXScroll()||"horizontal"===this.orientation()&&"nowrap"===this.flexWrap()&&!this.disableScroll()?"scroll":"hidden").style("overflow-y",()=>this.forceYScroll()||"vertical"===this.orientation()&&"nowrap"===this.flexWrap()&&!this.disableScroll()?"scroll":"hidden")}},P(f,"_FlexGrid"),f);z(Ft,"FlexGrid");let Et=Ft;function Rt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}Et.prototype._class+=" layout_FlexGrid",Et.prototype.publish("itemBorderColor","transparent","html-color","Color of list item borders"),Et.prototype.publish("borderWidth",0,"number","Width of list item borders (pixels)"),Et.prototype.publish("orientation","horizontal","set","Controls the flex-direction of the list items",["horizontal","vertical"]),Et.prototype.publish("flexWrap","wrap","set","Controls the line wrap when overflow occurs",["nowrap","wrap","wrap-reverse"]),Et.prototype.publish("disableScroll",!1,"boolean","If false, scrollbar will show (when flexWrap is set to 'nowrap')",null,{disable:z(t=>"nowrap"!==t.flexWrap(),"disable")}),Et.prototype.publish("forceXScroll",!1,"boolean","If true, horzontal scrollbar will show"),Et.prototype.publish("forceYScroll",!1,"boolean","If true, vertical scrollbar will show"),Et.prototype.publish("itemMinHeight",64,"number","Minimum height of a list item (pixels)"),Et.prototype.publish("itemMinWidth",64,"number","Minimum width of a list item (pixels)"),Et.prototype.publish("alignItems","stretch","set","Controls normal alignment of items",["flex-start","center","flex-end","stretch"]),Et.prototype.publish("alignContent","stretch","set","Controls normal alignment of item rows",["flex-start","center","flex-end","stretch","space-between","space-around"]),Et.prototype.publish("flexGrow",1,"number","Default flex-grow style for all list items"),Et.prototype.publish("flexBasis","10%","string","Default flex-basis style for all list items"),Et.prototype.publish("widgetsFlexGrow",[],"array","Array of flex-grow values keyed on the widgets array"),Et.prototype.publish("widgetsFlexBasis",[],"array","Array of flex-basis values keyed on the widgets array"),Et.prototype.publish("widgets",[],"widgetArray","Array of widgets to be rendered as list items"),P(Rt,"getDefaultExportFromCjs"),z(Rt,"getDefaultExportFromCjs");var Gt,Nt={exports:{}};function Yt(){return Gt||(Gt=1,Nt.exports=function(){var t=z(function(t,e){for(var i in this._options=e,this.defaults)this._options.hasOwnProperty(i)||(this._options[i]=this.defaults[i]);this.items=t,this._adjustSizeOfItems(),this.generateGrid()},"GridList");t.cloneItems=function(t,e){var i,o;for(void 0===e&&(e=[]),i=0;i<t.length;i++)for(o in e[i]||(e[i]={}),t[i])e[i][o]=t[i][o];return e},t.prototype={defaults:{lanes:5,direction:"horizontal"},toString:z(function(){var t,e,i,o=this.grid.length,s="\n #|",l="\n --";for(e=0;e<o;e++)s+=" "+this._padNumber(e," "),l+="---";for(s+=l,e=0;e<this._options.lanes;e++)for(s+="\n"+this._padNumber(e," ")+"|",i=0;i<o;i++)s+=" ",s+=(t=this.grid[i][e])?this._padNumber(this.items.indexOf(t),"0"):"--";return s+="\n"},"toString"),generateGrid:z(function(){var t;for(this._resetGrid(),t=0;t<this.items.length;t++)this._markItemPositionToGrid(this.items[t])},"generateGrid"),resizeGrid:z(function(t){var e=0;this._options.lanes=t,this._adjustSizeOfItems(),this._sortItemsByPosition(),this._resetGrid();for(var i=0;i<this.items.length;i++){var o=this.items[i],s=this._getItemPosition(o);this._updateItemPosition(o,this.findPositionForItem(o,{x:e,y:0})),e=Math.max(e,s.x)}this._pullItemsToLeft()},"resizeGrid"),findPositionForItem:z(function(t,e,i){var o,s,l;for(o=e.x;o<this.grid.length;o++)if(void 0!==i){if(l=[o,i],this._itemFitsAtPosition(t,l))return l}else for(s=e.y;s<this._options.lanes;s++)if(l=[o,s],this._itemFitsAtPosition(t,l))return l;var r=this.grid.length,n=0;return void 0!==i&&this._itemFitsAtPosition(t,[r,i])&&(n=i),[r,n]},"findPositionForItem"),moveItemToPosition:z(function(t,e){var i=this._getItemPosition({x:e[0],y:e[1],w:t.w,h:t.h});this._updateItemPosition(t,[i.x,i.y]),this._resolveCollisions(t)},"moveItemToPosition"),resizeItem:z(function(t,e){var i=e.w||t.w,o=e.h||t.h;this._updateItemSize(t,i,o),this._resolveCollisions(t),this._pullItemsToLeft()},"resizeItem"),getChangedItems:z(function(t,e){for(var i=[],o=0;o<t.length;o++){var s=this._getItemByAttribute(e,t[o][e]);s.x===t[o].x&&s.y===t[o].y&&s.w===t[o].w&&s.h===t[o].h||i.push(s)}return i},"getChangedItems"),_sortItemsByPosition:z(function(){this.items.sort(function(t,e){var i=this._getItemPosition(t),o=this._getItemPosition(e);return i.x!=o.x?i.x-o.x:i.y!=o.y?i.y-o.y:0}.bind(this))},"_sortItemsByPosition"),_adjustSizeOfItems:z(function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];void 0===e.autoSize&&(e.autoSize=0===e.w||0===e.h),e.autoSize&&("horizontal"===this._options.direction?e.h=this._options.lanes:e.w=this._options.lanes)}},"_adjustSizeOfItems"),_resetGrid:z(function(){this.grid=[]},"_resetGrid"),_itemFitsAtPosition:z(function(t,e){var i,o,s=this._getItemPosition(t);if(e[0]<0||e[1]<0)return!1;if(e[1]+s.h>this._options.lanes)return!1;for(i=e[0];i<e[0]+s.w;i++){var l=this.grid[i];if(l)for(o=e[1];o<e[1]+s.h;o++)if(l[o]&&l[o]!==t)return!1}return!0},"_itemFitsAtPosition"),_updateItemPosition:z(function(t,e){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),this._setItemPosition(t,e),this._markItemPositionToGrid(t)},"_updateItemPosition"),_updateItemSize:z(function(t,e,i){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),t.w=e,t.h=i,this._markItemPositionToGrid(t)},"_updateItemSize"),_markItemPositionToGrid:z(function(t){var e,i,o=this._getItemPosition(t);for(this._ensureColumns(o.x+o.w),e=o.x;e<o.x+o.w;e++)for(i=o.y;i<o.y+o.h;i++)this.grid[e][i]=t},"_markItemPositionToGrid"),_deleteItemPositionFromGrid:z(function(t){var e,i,o=this._getItemPosition(t);for(e=o.x;e<o.x+o.w;e++)if(this.grid[e])for(i=o.y;i<o.y+o.h;i++)this.grid[e][i]==t&&(this.grid[e][i]=null)},"_deleteItemPositionFromGrid"),_ensureColumns:z(function(t){var i;for(i=0;i<t;i++)this.grid[i]||this.grid.push(new e(this._options.lanes))},"_ensureColumns"),_getItemsCollidingWithItem:z(function(t){for(var e=[],i=0;i<this.items.length;i++)t!=this.items[i]&&this._itemsAreColliding(t,this.items[i])&&e.push(i);return e},"_getItemsCollidingWithItem"),_itemsAreColliding:z(function(t,e){var i=this._getItemPosition(t),o=this._getItemPosition(e);return!(o.x>=i.x+i.w||o.x+o.w<=i.x||o.y>=i.y+i.h||o.y+o.h<=i.y)},"_itemsAreColliding"),_resolveCollisions:z(function(t){this._tryToResolveCollisionsLocally(t)||this._pullItemsToLeft(t),this._pullItemsToLeft()},"_resolveCollisions"),_tryToResolveCollisionsLocally:z(function(e){var i=this._getItemsCollidingWithItem(e);if(!i.length)return!0;var o,s,l,r,n=new t([],this._options);t.cloneItems(this.items,n.items),n.generateGrid();for(var a=0;a<i.length;a++){var h=n.items[i[a]],d=this._getItemPosition(h),c=this._getItemPosition(e);if(o=[c.x-d.w,d.y],s=[c.x+c.w,d.y],l=[d.x,c.y-d.h],r=[d.x,c.y+c.h],n._itemFitsAtPosition(h,o))n._updateItemPosition(h,o);else if(n._itemFitsAtPosition(h,l))n._updateItemPosition(h,l);else if(n._itemFitsAtPosition(h,r))n._updateItemPosition(h,r);else{if(!n._itemFitsAtPosition(h,s))return!1;n._updateItemPosition(h,s)}}return t.cloneItems(n.items,this.items),this.generateGrid(),!0},"_tryToResolveCollisionsLocally"),_pullItemsToLeft:z(function(t){if(this._sortItemsByPosition(),this._resetGrid(),t){var e=this._getItemPosition(t);this._updateItemPosition(t,[e.x,e.y])}for(var i=0;i<this.items.length;i++){var o=this.items[i],s=this._getItemPosition(o);if(!t||o!=t){var l=this._findLeftMostPositionForItem(o),r=this.findPositionForItem(o,{x:l,y:0},s.y);this._updateItemPosition(o,r)}}},"_pullItemsToLeft"),_findLeftMostPositionForItem:z(function(t){for(var e=0,i=this._getItemPosition(t),o=0;o<this.grid.length;o++)for(var s=i.y;s<i.y+i.h;s++){var l=this.grid[o][s];if(l){var r=this._getItemPosition(l);this.items.indexOf(l)<this.items.indexOf(t)&&(e=r.x+r.w)}}return e},"_findLeftMostPositionForItem"),_getItemByAttribute:z(function(t,e){for(var i=0;i<this.items.length;i++)if(this.items[i][t]===e)return this.items[i];return null},"_getItemByAttribute"),_padNumber:z(function(t,e){return t>=10?t:e+t},"_padNumber"),_getItemPosition:z(function(t){return"horizontal"===this._options.direction?t:{x:t.y,y:t.x,w:t.h,h:t.w}},"_getItemPosition"),_setItemPosition:z(function(t,e){"horizontal"===this._options.direction?(t.x=e[0],t.y=e[1]):(t.x=e[1],t.y=e[0])},"_setItemPosition")};var e=z(function(t){for(var e=0;e<t;e++)this.push(null)},"GridCol");return e.prototype=[],t}()),Nt.exports}P(Yt,"requireGridList"),z(Yt,"requireGridList");var Vt=Yt();const Xt=Rt(Vt),Ut=A({__proto__:null,default:Xt},[Vt]),jt=Ut&&Xt||Ut,qt=(b=class extends e.HTMLWidget{divItems;gridList;items;itemsMap;origItems;cellWidth;cellHeight;dragItem;dragItemPos;_d3Drag;_d3DragResize;_selectionBag;_scrollBarWidth;constructor(){super(),this._tag="div",this._selectionBag=new e.Utility.Selection(this),this.content([])}getDimensions(){const t={width:0,height:0};return this.content().forEach(function(e){t.width<e.gridCol()+e.gridColSpan()&&(t.width=e.gridCol()+e.gridColSpan()),t.height<e.gridRow()+e.gridRowSpan()&&(t.height=e.gridRow()+e.gridRowSpan())},this),t}clearContent(t){this.content(this.content().filter(function(e){if(!t)return e.target(null),!1;let i=e;for(;i;){if(t===i)return e.target(null),!1;i=i.widget?i.widget():null}return!0}))}setContent(t,e,i,o,s,l){if(s=s||1,l=l||1,o=o||"",this.content(this.content().filter(function(i){return i.gridRow()!==t||i.gridCol()!==e||(i.target(null),!1)})),i){const r=(new O).gridRow(t).gridCol(e).widget(i).title(o).gridRowSpan(s).gridColSpan(l);this.content().push(r)}return this}sortedContent(){return this.content().sort(function(t,e){return t.gridRow()===e.gridRow()?t.gridCol()-e.gridCol():t.gridRow()-e.gridRow()})}getCell(t,e){let i=null;return this.content().some(function(o){return t>=o.gridRow()&&t<o.gridRow()+o.gridRowSpan()&&e>=o.gridCol()&&e<o.gridCol()+o.gridColSpan()&&(i=o,!0)}),i}getWidgetCell(t){let e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i,!0)}),e}getContent(t){let e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i.widget(),!0)}),e}cellToGridItem(t){return{x:t.gridCol(),y:t.gridRow(),w:t.gridColSpan(),h:t.gridRowSpan(),id:t.id(),cell:t}}gridItemToCell(t){t.cell.gridCol(t.x).gridRow(t.y).gridColSpan(t.w).gridRowSpan(t.h)}resetItemsPos(){this.origItems.forEach(function(t){const e=this.itemsMap[t.id];e.x=t.x,e.y=t.y},this)}initGridList(){this.itemsMap={},this.items=this.content().map(function(t){const e=this.cellToGridItem(t);return this.itemsMap[e.id]=e,e},this),this.origItems=this.content().map(this.cellToGridItem),this.gridList=new jt(this.items,{direction:this.snapping(),lanes:"horizontal"===this.snapping()?this.snappingRows():this.snappingColumns()})}killGridList(){this.gridList=null,delete this.items,delete this.itemsMap}enter(t,i){super.enter(t,i),this._scrollBarWidth=e.Platform.getScrollbarWidth();const o=this;this._d3Drag=e.drag().subject(function(t){const e=o.cellToGridItem(t);return{x:e.x*o.cellWidth,y:e.y*o.cellHeight}}).on("start",function(t){if(!o.designMode())return;e.d3Event().sourceEvent.stopPropagation(),o.initGridList();const s=o.itemsMap[t.id()];o.dragItem=i.append("div").attr("class","dragging").style("transform",function(){return"translate("+s.x*o.cellWidth+"px, "+s.y*o.cellHeight+"px)"}).style("width",function(){return s.w*o.cellWidth-o.gutter()+"px"}).style("height",function(){return s.h*o.cellHeight-o.gutter()+"px"}),o.selectionBagClick(t)}).on("drag",function(t){if(!o.designMode())return;const i=e.d3Event();i.sourceEvent.stopPropagation();const s=o.itemsMap[t.id()];i.x<0&&(i.x=0),i.x+s.w*o.cellWidth>o.snappingColumns()*o.cellWidth&&(i.x=o.snappingColumns()*o.cellWidth-s.w*o.cellWidth),i.y<0&&(i.y=0),i.y+s.h*o.cellWidth>o.snappingRows()*o.cellWidth&&(i.y=o.snappingRows()*o.cellWidth-s.h*o.cellWidth);const l=[Math.max(0,Math.floor((i.x+o.cellWidth/2)/o.cellWidth)),Math.max(0,Math.floor((i.y+o.cellHeight/2)/o.cellHeight))];s.x===l[0]&&s.y===l[1]||("none"!==o.snapping()?(o.resetItemsPos(),o.gridList.moveItemToPosition(s,l)):(s.x=l[0],s.y=l[1]),t.gridCol()===s.x&&t.gridRow()===s.y||(o.items.forEach(o.gridItemToCell),o.updateGrid(!1,100))),o.dragItem.style("transform",function(){return"translate("+i.x+"px, "+i.y+"px)"}).style("width",function(){return s.w*o.cellWidth+"px"}).style("height",function(){return s.h*o.cellHeight+"px"})}).on("end",function(){o.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),o.dragItem.remove(),o.dragItem=null,o.killGridList())}),this._d3DragResize=e.drag().subject(function(t){const e=o.cellToGridItem(t);return{x:(e.x+e.w-1)*o.cellWidth,y:(e.y+e.h-1)*o.cellHeight}}).on("start",function(t){if(!o.designMode())return;e.d3Event().sourceEvent.stopPropagation(),o.initGridList();const s=o.itemsMap[t.id()];o.dragItem=i.append("div").attr("class","resizing").style("transform",function(){return"translate("+s.x*o.cellWidth+"px, "+s.y*o.cellHeight+"px)"}).style("width",function(){return s.w*o.cellWidth-o.gutter()+"px"}).style("height",function(){return s.h*o.cellHeight-o.gutter()+"px"}),o.dragItemPos={x:s.x,y:s.y}}).on("drag",function(t){if(!o.designMode())return;const i=e.d3Event();i.sourceEvent.stopPropagation();const s=o.itemsMap[t.id()],l=[Math.max(0,Math.round(i.x/o.cellWidth)),Math.max(0,Math.round(i.y/o.cellHeight))],r={w:Math.max(1,l[0]-s.x+1),h:Math.max(1,l[1]-s.y+1)};s.w===r.w&&s.h===r.h||("none"!==o.snapping()?(o.resetItemsPos(),o.gridList.resizeItem(s,r)):(s.w=r.w,s.h=r.h),t.gridColSpan()===s.w&&t.gridRowSpan()===s.h||(o.items.forEach(o.gridItemToCell),o.updateGrid(s.id,100))),o.dragItem.style("width",function(){return(1-s.x)*o.cellWidth+i.x-o.gutter()+"px"}).style("height",function(){return(1-s.y)*o.cellHeight+i.y-o.gutter()+"px"})}).on("end",function(){o.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),o.dragItem.remove(),o.dragItem=null,o.killGridList())})}updateGrid(t,e=0,i=!1){e=e||0;const o=this;this.divItems.classed("draggable",this.designMode()).transition().duration(e).style("left",function(t){return t.gridCol()*o.cellWidth+o.gutter()/2+"px"}).style("top",function(t){return t.gridRow()*o.cellHeight+o.gutter()/2+"px"}).style("width",function(t){return t.gridColSpan()*o.cellWidth-o.gutter()+"px"}).style("height",function(t){return t.gridRowSpan()*o.cellHeight-o.gutter()+"px"}).on("end",function(e){e.surfaceShadow_default(o.surfaceShadow()).surfacePadding_default(o.surfacePadding()).surfaceBorderWidth_default(o.surfaceBorderWidth()).surfaceBackgroundColor_default(o.surfaceBackgroundColor()),!0!==t&&t!==e.id()||e.resize().lazyRender()})}update(t,i){super.update(t,i),this._placeholderElement.style("overflow-x","width"===this.fitTo()?"hidden":null),this._placeholderElement.style("overflow-y","width"===this.fitTo()?"scroll":null);const o=this.getDimensions(),s=this.width()-("width"===this.fitTo()?this._scrollBarWidth:0);if(this.cellWidth=s/o.width,this.cellHeight="all"===this.fitTo()?this.height()/o.height:this.cellWidth,this.designMode()){const t=Math.min(this.width()/this.snappingColumns(),this.height()/this.snappingRows()),e=Math.floor(t);this.cellWidth=e,this.cellHeight=this.cellWidth}const l=this,r=i.selectAll("#"+this.id()+" > .ddCell").data(this.content(),function(t){return t.id()});this.divItems=r.enter().append("div").attr("class","ddCell").each(function(t){t.target(this),t.__grid_watch=t.monitor(function(e,i,o){!l._renderCount||"snapping"!==e&&0!==e.indexOf("grid")||i===o||l.gridList||(l.initGridList(),"none"!==l.snapping()&&l.gridList.resizeGrid("horizontal"===l.snapping()?l.snappingRows():l.snappingColumns()),l.items.forEach(l.gridItemToCell),l.updateGrid(t.id(),100),l.killGridList())});e.select(this).append("div").attr("class","resizeHandle").call(l._d3DragResize).append("div").attr("class","resizeHandleDisplay")}).merge(r),this.divItems.each(function(t){const i=e.select(this);l.designMode()?i.call(l._d3Drag):i.on("mousedown.drag",null).on("touchstart.drag",null)}),this.divItems.select(".resizeHandle").style("display",this.designMode()?null:"none"),this.updateGrid(!0),r.exit().each(function(t){t.target(null),t.__grid_watch&&t.__grid_watch.remove()}).remove();const n=i.selectAll("#"+this.id()+" > .laneBackground").data(this.designMode()?[""]:[]);n.enter().insert("div",":first-child").attr("class","laneBackground").style("left","1px").style("top","1px").on("click",function(){l.selectionBagClear()}).merge(n).style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px"),n.exit().each(function(){l.selectionBagClear()}).remove();const a=i.selectAll("#"+this.id()+" > .lane").data(this.designMode()?[""]:[]);a.enter().append("div").attr("class","lane").style("left","1px").style("top","1px"),a.style("display",this.showLanes()?null:"none").style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px").style("background-image","linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px)").style("background-size",this.cellWidth+"px "+this.cellHeight+"px"),a.exit().remove()}exit(t,e){this.content().forEach(t=>t.target(null)),super.exit(t,e)}_createSelectionObject(t){return{_id:t._id,element:z(()=>t._element,"element"),widget:t}}selection(t){return arguments.length?(this._selectionBag.set(t.map(function(t){return this._createSelectionObject(t)},this)),this):this._selectionBag.get().map(function(t){return t._id})}selectionBagClear(){this._selectionBag.isEmpty()||(this._selectionBag.clear(),this.postSelectionChange())}selectionBagClick(t){if(null!==t){const i=this._createSelectionObject(t);if(e.d3Event().sourceEvent.ctrlKey)this._selectionBag.isSelected(i)?(this._selectionBag.remove(i),this.postSelectionChange()):(this._selectionBag.append(i),this.postSelectionChange());else{const t=this._selectionBag.get();1===t.length&&t[0]._id===i._id?this.selectionBagClear():this._selectionBag.set([i]),this.postSelectionChange()}}}postSelectionChange(){}applyLayout(t){this.divItems.each((e,i)=>{if(t[i]){const[o,s,l,r]=t[i];e.gridCol(o).gridRow(s).gridColSpan(l).gridRowSpan(r)}}),this.updateGrid(!0)}vizActivation(t){}},P(b,"_Grid"),b);z(qt,"Grid");let $t=qt;$t.prototype._class+=" layout_Grid",$t.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),$t.prototype.publish("showLanes",!0,"boolean","Show snapping lanes when in design mode",null,{tags:["Basic"],disable:z(t=>!t.designMode(),"disable")}),$t.prototype.publish("fitTo","all","set","Sizing Strategy",["all","width"],{tags:["Basic"]}),$t.prototype.publish("snapping","vertical","set","Snapping Strategy",["vertical","horizontal","none"]),$t.prototype.publish("snappingColumns",12,"number","Snapping Columns"),$t.prototype.publish("snappingRows",16,"number","Snapping Rows"),$t.prototype.publish("gutter",6,"number","Gap Between Widgets",null,{tags:["Basic"]}),$t.prototype.publish("surfaceShadow",!0,"boolean","3D Shadow"),$t.prototype.publish("surfacePadding",null,"string","Cell Padding (px)",null,{tags:["Intermediate"]}),$t.prototype.publish("surfaceBorderWidth",1,"number","Width (px) of Cell Border",null,{tags:["Intermediate"]}),$t.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),$t.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Basic"],render:!1});const Jt=(P(w=class extends Et{constructor(){super(),this.orientation_default("horizontal"),this.flexWrap_default("nowrap")}},"_HorizontalList"),w);z(Jt,"HorizontalList"),Jt.prototype._class+=" layout_HorizontalList";const Kt=(m=class extends e.HTMLWidget{_contentContainer;_widgetPlacements;_widgetRatios;constructor(){super(),this._tag="div",this._widgetPlacements=[],this._widgetRatios=[]}addLayer(t,i="default",o=1,s=1){const l=this.widgets();return l.push(t||(new e.Text).text("No widget defined for layer.")),this.widgets(l),this._widgetPlacements.push(i),this._widgetRatios.push([o,s]),this}enter(t,e){super.enter(t,e),this._contentContainer=e.append("div").attr("class","container")}update(t,e){super.update(t,e);const i=this;e.style("padding",this.surfacePadding()+"px");const o=this._contentContainer.selectAll(".content.id"+this.id()).data(this.widgets(),function(t){return t.id()});o.enter().append("div").attr("class","content id"+this.id()).each(function(t,e){t.target(this)}).merge(o).each(function(t,e){const o={width:i.clientWidth(),height:i.clientHeight()},s=i.widgetSize(e,o),l=i.widgetPosition(e,o,s);this.style.top=l.y+"px",this.style.left=l.x+"px",t.resize(s).render()}),o.exit().each(function(t,e){t.target(null)}).remove(),o.order()}widgetSize(t,e){return this._widgetPlacements[t],{width:e.width*this._widgetRatios[t][0],height:e.height*this._widgetRatios[t][1]}}widgetPosition(t,e,i){switch(this._widgetPlacements[t]){default:return{x:0,y:0};case"top":return{x:e.width/2-i.width/2,y:0};case"bottom":return{x:e.width/2-i.width/2,y:e.height-i.height};case"left":return{x:0,y:e.height/2-i.height/2};case"right":return{x:e.width-i.width,y:e.height/2-i.height/2};case"center":return{x:e.width/2-i.width/2,y:e.height/2-i.height/2}}}},P(m,"_Layered"),m);z(Kt,"Layered");let Zt=Kt;Zt.prototype._class+=" layout_Layered",Zt.prototype.publish("surfacePadding",0,"number","Padding"),Zt.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});const Qt=(x=class extends e.HTMLWidget{_surfaceButtons;_originalPosition;constructor(){super(),this._tag="div",this._surfaceButtons=[]}updateState(t){t=t||!this.popupState(),this.popupState(t).render()}enter(t,e){super.enter(t,e),this.widget().target(t),this._originalPosition=this.position()}update(t,e){super.update(t,e),e.style("visibility",this.popupState()?null:"hidden").style("opacity",this.popupState()?null:0).style("width",this.shrinkWrap()?this.widget().width()+"px":this._size.width+"px").style("height",this.shrinkWrap()?this.widget().height()+"px":this._size.height+"px"),0===this.widget().size().height&&this.widget().resize(this.size())}postUpdate(t,e){let i,o;switch(this.centerPopup()){case"container":this._placeholderElement&&(i=parseInt(this._placeholderElement.style("width"))/2-this.widget().width()/2,o=parseInt(this._placeholderElement.style("height"))/2-this.widget().height()/2),this.position("absolute");break;case"window":i=window.innerWidth/2-this.widget().width()/2,o=window.innerHeight/2-this.widget().height()/2,this.position("fixed");break;default:i=0,o=0,this.position(this._originalPosition)}this.pos({x:i,y:o}),super.postUpdate(t,e),e.style("position",this.position()).style("left",this.left()+"px").style("right",this.right()+"px").style("top",this.top()+"px").style("bottom",this.bottom()+"px")}exit(t,e){this.widget()&&this.widget().target(null),super.exit(t,e)}click(t){}},P(x,"_Popup"),x);z(Qt,"Popup");let te=Qt;te.prototype._class+=" layout_Popup",te.prototype.publish("popupState",!1,"boolean","State of the popup, visible (true) or hidden (false)",null,{}),te.prototype.publish("shrinkWrap",!1,"boolean","The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)",null,{}),te.prototype.publish("centerPopup","none","set","Center the widget in its container element (target) or in the window",["none","container","window"],{}),te.prototype.publish("top",null,"number","Top position property of popup",null,{}),te.prototype.publish("bottom",null,"number","Bottom position property of popup",null,{}),te.prototype.publish("left",null,"number","Left position property of popup",null,{}),te.prototype.publish("right",null,"number","Right position property of popup",null,{}),te.prototype.publish("position","relative","set","Value of the 'position' property",["absolute","relative","fixed","static","initial","inherit"],{tags:["Private"]}),te.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]});const ee=(v=class extends e.HTMLWidget{_tabContainer;_contentContainer;constructor(){super(),this._tag="div"}clearTabs(){return this.labels([]),this.widgets([]),this}addTab(t,i,o,s){const l=t.size();0===l.width&&0===l.height&&t.size({width:"100%",height:"100%"});const r=this.labels(),n=this.widgets();o&&this.activeTabIdx(this.widgets().length),r.push(i);const a=(new D).widget(t||(new e.Text).text("No widget defined for tab"));return n.push(a),this.labels(r),this.widgets(n),s&&s(a),this}widgetSize(t){const e=this.clientWidth();let i=this.clientHeight();const o=this._tabContainer.node().getBoundingClientRect();return void 0!==o.height&&(i-=o.height),{width:e,height:i}}enter(t,e){super.enter(t,e),this._tabContainer=e.append("div"),this._contentContainer=e.append("div")}update(t,i){super.update(t,i);const o=this;i.style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null);const s=this._tabContainer.selectAll(".tab-button.id"+this.id()).data(this.showTabs()?this.labels():[],function(t){return t});s.enter().append("span").attr("class","tab-button id"+this.id()).style("cursor","pointer").on("click",function(t,e){o.click(o.widgets()[e].widget(),t,e),o.activeTabIdx(e).render()}).merge(s).classed("active",function(t,e){return o.activeTabIdx()===e}).text(function(t){return t}),s.exit().remove();const l=this._contentContainer.selectAll(".tab-content.id"+this.id()).data(this.widgets(),function(t){return t.id()});if(l.enter().append("div").attr("class","tab-content id"+this.id()).each(function(t,e){t.target(this)}).merge(l).classed("active",function(t,e){return o.activeTabIdx()===e}).style("display",function(t,e){return o.activeTabIdx()===e?"block":"none"}).each(function(t,i){if(t.visible(o.activeTabIdx()===i),o.activeTabIdx()===i){const i=o.widgetSize(e.select(this));t.surfaceBorderWidth(o.showTabs()?null:0).surfacePadding(o.showTabs()?null:0).resize(i)}}),l.exit().each(function(t,e){t.target(null)}).remove(),"bottom"===this.tabLocation())this._tabContainer.attr("class","on_bottom").style("top",this._contentContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute"),this._contentContainer.style("top",this.surfacePadding_exists()?this.surfacePadding()+"px":null).style("position","absolute");else this._tabContainer.attr("class","on_top").style("top",null).style("position","relative"),this._contentContainer.style("top",this._tabContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute")}click(t,e,i){}},P(v,"_Tabbed"),v);z(ee,"Tabbed");let ie=ee;ie.prototype._class+=" layout_Tabbed",ie.prototype.publish("showTabs",!0,"boolean","Show Tabs",null,{}),ie.prototype.publish("surfacePadding",4,"number","Padding"),ie.prototype.publish("activeTabIdx",0,"number","Index of active tab",null,{}),ie.prototype.publish("labels",[],"array","Array of tab labels sharing an index with ",null,{tags:["Private"]}),ie.prototype.publish("tabLocation","top","set","Position the tabs at the bottom of the widget",["top","bottom"],{tags:["Private"]}),ie.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});const oe=(C=class extends e.HTMLWidget{constructor(){super(),this._tag="div"}enter(t,e){super.enter(t,e)}update(t,i){super.update(t,i);const o=this;i.attr("title",o.title()).style("background-color",this.backgroundColor());const s=i.selectAll("div.toolbar-title").data(this.title()?[this.title()]:[]);s.enter().append("div").classed("toolbar-title",!0).append("span"),s.selectAll("div.toolbar-title > span").style("font-size",this.fontSize_exists()?this.fontSize()+"px":null).style("color",this.fontColor_exists()?this.fontColor():null).style("font-family",this.fontFamily_exists()?this.fontFamily():null).style("font-weight",this.fontBold_exists()?this.fontBold()?"bold":"normal":null).style("background-color",this.backgroundColor_exists()?this.backgroundColor():null).text(o.title()),s.exit().remove();const l=i.selectAll("div.toolbar-child").data(null!==this.widgets()?this.widgets():[],function(t){return t.id()});l.enter().insert("div","div.toolbar-title").each(function(t,i){const s=o.widgetClasses()[i]?o.widgetClasses()[i]+" toolbar-child":"toolbar-child";e.select(this).classed(s,!0),t.target(this)}),l.exit().each(function(t){t.target(null)}).remove(),l.order()}render(t){const e=this;return super.render(function(i){const o=e.element().node().getBoundingClientRect();let s=o.left+o.width;e.element().selectAll("div.toolbar-child").each(function(t,e){const i=this.getBoundingClientRect();s>i.left&&(s=i.left)}),e.element().select(".toolbar-title").style("width",s-o.left-4+"px"),t&&t(i)})}exit(t,e){this.widgets().forEach(function(t){t.target(null)}),super.exit(t,e)}},P(C,"_Toolbar"),C);z(oe,"Toolbar");let se=oe;se.prototype._class+=" layout_Toolbar",se.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),se.prototype.publish("fontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],optional:!0}),se.prototype.publish("fontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],optional:!0}),se.prototype.publish("fontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],optional:!0}),se.prototype.publish("fontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],optional:!0}),se.prototype.publish("backgroundColor",null,"html-color","Background Color",null,{tags:["Intermediate"],optional:!0}),se.prototype.publish("responsive",!0,"boolean","Adapts to pixel width",null,{tags:["Basic"]}),se.prototype.publish("widgets",[],"widgetArray","Child widgets of the toolbar",null,{tags:["Basic"]}),se.prototype.publish("widgetClasses",[],"array","Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)",null,{tags:["Basic"]});const le=(P(T=class extends Et{constructor(){super(),this.orientation_default("vertical"),this.flexWrap_default("nowrap")}},"_VerticalList"),T);function re(t){return new Promise(function(i,o){const s=e.Utility.parseClassID(t);require&&require([s.package],function(t){let e=null;t&&t[s.widgetID]&&(e=t[s.widgetID]),i(s.memberWidgetID?e.prototype?e.prototype[s.memberWidgetID]:e[s.memberWidgetID]:e)})})}function ne(t){return Promise.all(t.map(re))}z(le,"VerticalList"),le.prototype._class+=" layout_VerticalList",function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('.layout_AbsoluteSurface{pointer-events:none!important}.layout_AbsoluteSurface>.placeholder{position:relative;overflow:hidden;pointer-events:all}.layout_Accordion>ul{position:relative}.layout_Accordion.open>span{font-style:italic}.layout_Accordion.closed>ul{height:0px;overflow:hidden}.layout_Accordion.open>ul{display:block}.layout_Accordion>.collapsible-icon,.layout_Accordion>.collapsible-title{cursor:pointer;box-sizing:border-box}.layout_Accordion>.collapsible-title{display:block;width:100%}.layout_Accordion>.collapsible-title{font-size:13px;color:#fff;padding:4px 8px;height:26px;-webkit-box-shadow:inset 0px -1px 1px 0px rgba(0,0,0,.2);-moz-box-shadow:inset 0px -1px 1px 0px rgba(0,0,0,.2);box-shadow:inset 0 -1px 1px #0003}.layout_Accordion li{background-color:#fff}.layout_Accordion>ul,.layout_Accordion>.collapsible-title{background-color:#333}.layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion>.collapsible-title{background-color:#555}.layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#777}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#999}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#bbb}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#ccc}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title{background-color:#ddd}.layout_Accordion>ul,.layout_Accordion>span{padding-left:0}.layout_Accordion .layout_Accordion>ul,.layout_Accordion .layout_Accordion>span{padding-left:12px}.layout_Accordion>.collapsible-title:before{padding:4px 8px;position:absolute;left:0;top:0}.layout_Accordion>.collapsible-icon{position:absolute;top:0;right:0;width:24px;height:24px;color:#fff}.layout_Surface{box-sizing:border-box;margin:0;border:1px solid #e5e5e5;overflow:hidden;height:100%;width:100%}.layout_Surface.shadow2{box-shadow:0 2px 2px #00000024,0 3px 1px -2px #0003,0 1px 5px #0000001f}.layout_Surface>h3{margin:0;padding:2px;background-color:#e5e5e5}.layout_Surface .html-button-container{position:absolute;right:0;top:3px}.layout_Surface>div{padding:8px}.layout_Surface .html-button-container .surface-button{margin-right:5px}.layout_Surface .html-button-container .surface-button i{opacity:.8}.layout_Surface .html-button-container .surface-button:hover{opacity:1}.layout_Surface .html-button-container .surface-button:active{opacity:.5}div[draggable=true].hideDragCellContent.content-icon:before{content:"";font-family:FontAwesome;position:absolute;top:calc(50% - 74px);left:calc(50% - 56px);font-size:100px}div[draggable=true].hideDragCellContent.content-icon-Line:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Pie:before{top:calc(50% - 72px);left:calc(50% - 45px);content:""}div[draggable=true].hideDragCellContent.content-icon-Area:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Gauge:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Table:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Form:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Grid:before,div[draggable=true].hideDragCellContent.content-icon-Graph:before,div[draggable=true].hideDragCellContent.content-icon-Border:before,div[draggable=true].hideDragCellContent.content-icon-Tabbed:before,div[draggable=true].hideDragCellContent.content-icon-Accordion:before,div[draggable=true].hideDragCellContent.content-icon-MultiChart:before,div[draggable=true].hideDragCellContent.content-icon-MultiChartSurface:before{content:""}div[draggable=true].hideDragCellContent.content-icon-ChoroplethStates:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethStatesHeat:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethCounties:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethCountries:before,div[draggable=true].hideDragCellContent.content-icon-GMap:before,div[draggable=true].hideDragCellContent.content-icon-GMapHeat:before,div[draggable=true].hideDragCellContent.content-icon-GMapGraph:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Text:before,div[draggable=true].hideDragCellContent.content-icon-TextBox:before,div[draggable=true].hideDragCellContent.content-icon-FAChar:before{content:""}.layout_Cell .update-indicator{box-sizing:border-box;position:absolute;top:0;left:0;padding:0;z-index:1000;border-width:0px;border-style:solid;pointer-events:none}.layout_Border{width:100%;height:100%}.layout_Border>.border-content{width:100%;height:100%;position:relative}.layout_Border>.borderHandle{width:6px;height:6px;background-color:#444;opacity:.3;position:absolute;visibility:hidden}.layout_Border.design-mode>.borderHandle{visibility:visible}.layout_Border>.borderHandle:hover{background-color:#666}.layout_Border>.borderHandle.borderHandleDisabled{display:none}.layout_Border>.borderHandle_top,.layout_Border>.borderHandle_bottom{cursor:ns-resize}.layout_Border>.borderHandle_left,.layout_Border>.borderHandle_right{cursor:ew-resize}.layout_Border .cell{border-radius:5px;border:1px solid #e5e5e5;display:inline-block;overflow:hidden}.layout_Border .cell h2{margin:0;padding-top:4px;-webkit-margin:0px;text-align:center}.layout_Border .layout_BorderCell.over{border:2px dashed #000}.layout_Border .dragItem{z-index:-1;opacity:.33}.layout_Border .notDragItem{z-index:-1;opacity:1}.layout_Border div[draggable=true]{opacity:.75;cursor:default}.layout_Border div[draggable=true] .dragHandle{opacity:1}.layout_Border div[draggable=true] .dragHandle_n,.layout_Border div[draggable=true] .dragHandle_e,.layout_Border div[draggable=true] .dragHandle_s,.layout_Border div[draggable=true] .dragHandle_w{background-color:#aaa}.layout_Border div[draggable=true] .dragHandle_nw,.layout_Border div[draggable=true] .dragHandle_ne,.layout_Border div[draggable=true] .dragHandle_se,.layout_Border div[draggable=true] .dragHandle_sw{background-color:#333}.layout_Border div[draggable=true] .dragHandle_nw{cursor:nw-resize}.layout_Border div[draggable=true] .dragHandle_n{cursor:n-resize}.layout_Border div[draggable=true] .dragHandle_ne{cursor:ne-resize}.layout_Border div[draggable=true] .dragHandle_e{cursor:e-resize}.layout_Border div[draggable=true] .dragHandle_se{cursor:se-resize}.layout_Border div[draggable=true] .dragHandle_s{cursor:s-resize}.layout_Border div[draggable=true] .dragHandle_sw{cursor:sw-resize}.layout_Border div[draggable=true] .dragHandle_w{cursor:w-resize}.layout_Border div[draggable=false]>div>.dragHandle{display:none}.layout_Border .grid-drop-target{position:fixed;box-sizing:border-box;border:2px dashed #7f8c8d;border-radius:0;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,#6464641a 4px 8px)}.layout_Border .grid-drop-target.drop-target-over{border:2px dashed #179BD7;background:repeating-linear-gradient(-45deg,#0000,#0000 6px,#119bd71a 6px 12px)}.layout_Border2{display:flex;flex-direction:column}.layout_Border2>.body{margin:0;padding:0;display:flex;flex-flow:row}.layout_Border2>.body>.center{flex:1}.layout_Border2>.header{display:block}.layout_Border2>.footer{display:block}.layout_Carousel>div{position:relative;overflow:hidden}.layout_Carousel>div>.carouselItem{position:absolute}.layout_Modal-header{background-color:#3f51b5;overflow:hidden}.layout_Modal-body{background-color:#fff;overflow-y:scroll;overflow-x:hidden}.layout_Modal-title,.layout_Modal-annotations{position:absolute}.layout_Modal-closeButton{cursor:pointer}.layout_Modal-closeButton:hover{opacity:.7}.layout_Modal-closeButton:active{opacity:.5}.layout_Modal-fade{position:fixed;background-color:#000;opacity:.5;z-index:10000}.layout_Modal-content{position:fixed;background-color:#fff;z-index:10100}.layout_Modal-fade-hidden{display:none}.layout_Modal-fadeClickable{cursor:pointer}.layout_ChartPanel .series.highlight{stroke-width:2px;opacity:1}.layout_ChartPanel .series.lowlight{opacity:.3!important}.layout_FlexGrid{display:flex}.FlexGrid-list-item{overflow:hidden;border-style:solid;flex-grow:1}.layout_Grid>.ddCell{position:absolute}.layout_Grid>.laneBackground{position:absolute;border-style:solid;border-width:1px;background:#f5f5f5}.layout_Grid>.lane{position:absolute;border-style:none;opacity:.25;border-radius:0;pointer-events:none}.layout_Grid>.ddCell.draggable{border-style:solid;border-width:1px;background-color:#f8f8ff;border-radius:0;cursor:move}.layout_Grid>.ddCell.draggable>.resizeHandle{bottom:0;right:0;width:8px;height:8px;border-style:none;position:absolute;cursor:nwse-resize}.layout_Grid>.ddCell.draggable .resizeHandleDisplay{bottom:2px;right:2px;width:4px;height:4px;border-style:solid;border-left-width:0px;border-top-width:0px;border-right-width:2px;border-bottom-width:2px;border-color:#a9a9a9;background-color:none;position:absolute}.layout_Grid>.ddCell.draggable .resizeHandleDisplay:hover{border-color:orange}.layout_Grid>.dragging{border-style:solid;border-width:1px;border-color:gray;border-radius:0;position:absolute;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,#6464641a 4px 8px)}.layout_Grid>.resizing{border-style:solid;border-width:1px;border-color:gray;background-color:orange;border-radius:0;position:absolute;opacity:.3;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,orange 4px 8px)}.layout_Grid>.ddCell.draggable .common_Widget.selected{border-style:solid;border-width:1px;border-color:red;background-color:gray;border-radius:0;position:absolute;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,#6400001a 4px 8px)}.layout_Grid #drag-me:before{content:"#" attr(id);font-weight:700}.layout_Layered{pointer-events:none}.layout_Layered>.container>.content{position:absolute}.layout_Layered>.container>.content>div>.common_Widget,.layout_Layered>.container>.content>div>svg>.common_Widget{pointer-events:all}.layout_Tabbed .tab-button{position:relative;top:1px;display:inline-block;border-left:1px solid #ddd;border-top:1px solid #ddd;border-right:1px solid #ddd;background-color:transparent;margin-right:4px;padding:2px 2px 4px;background-color:#ccc}.layout_Tabbed .tab-button.active{background-color:#fff;z-index:999}.layout_Tabbed .on_bottom .tab-button{border-bottom:1px solid #ddd;border-top:none;top:-1px}.layout_Toolbar{height:100%;background-color:#ddd;white-space:nowrap;overflow:hidden}.layout_Toolbar .toolbar-title{display:inline-block;position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%);margin-left:4px;font-weight:700;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.layout_Toolbar .toolbar-child{position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%);float:right;margin-left:4px;margin-right:4px;line-height:16px}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}(),P(re,"requireWidget"),P(ne,"requireWidgets");const ae=Object.freeze(Object.defineProperty({__proto__:null,requireWidget:re,requireWidgets:ne},Symbol.toStringTag,{value:"Module"})),he=class _MultiChart extends e.HTMLWidget{_allCharts={};_chartTypeDefaults;_chartTypeProperties;_chartMonitor;_switchingTo;constructor(){super(),o.INDChart.call(this),o.IGraph.call(this),this._tag="div",this._allCharts={},this._allChartTypes.forEach(function(t){const e=JSON.parse(JSON.stringify(t));e.widget=null,this._allCharts[t.id]=e,this._allCharts[t.display]=e,this._allCharts[t.widgetClass]=e},this),this._chartTypeDefaults={},this._chartTypeProperties={}}fields(t){const e=super.fields.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().fields();this.chart().fields(t)}return e}columns(t,i){const o=e.HTMLWidget.prototype.columns.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().columns();this.chart().columns(t,i)}return o}data(t){const i=e.HTMLWidget.prototype.data.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().data();this.chart().data(t)}return i}hasOverlay(){return this.chart()&&this.chart().hasOverlay()}visible(t){return arguments.length?(this.chart()&&this.chart().visible(t),this):this.chart()&&this.chart().visible()}chartTypeDefaults(t){return arguments.length?(this._chartTypeDefaults=t,this):this._chartTypeDefaults}chartTypeProperties(t){return arguments.length?(this._chartTypeProperties=t,this):this._chartTypeProperties}getChartDataFamily(){return this._allCharts[this.chartType()].family}requireContent(t,i){const o=e.Utility.parseClassID(this._allCharts[t].widgetClass);switch(o.package){case"@hpcc-js/chart":import("@hpcc-js/chart").then(t=>{i(new t[o.widgetID])});break;case"@hpcc-js/dgrid":import("@hpcc-js/dgrid").then(t=>{i(new t[o.widgetID])});break;default:re(this._allCharts[t].widgetClass).then(function(t){i(new t)})}}switchChart(t){if(this._switchingTo===this.chartType())return void(t&&t(this));this._switchingTo&&console.warn("Attempting switch to: "+this.chartType()+", before previous switch is complete ("+this._switchingTo+")"),this._switchingTo=this.chartType();const e=this.chart(),i=this;this.requireContent(this.chartType(),function(o){if(o!==e){const t=i.size();o.fields(i.fields()).data(i.data()).size(t),i.chart(o),e&&e.size({width:1,height:1}).render()}delete i._switchingTo,t&&t(this)})}update(t,e){super.update(t,e);const i=e.selectAll(".multiChart").data(this.chart()?[this.chart()]:[],function(t){return t._id});i.enter().append("div").attr("class","multiChart").each(function(t){t.target(this)});const o=this.chart();if(o){for(const t in this._chartTypeDefaults)if(o[t+"_default"])try{o[t+"_default"](this._chartTypeDefaults[t])}catch(l){console.warn("Exception Setting Default: "+t)}else console.warn("Unknown Default: "+t);this._chartTypeDefaults={};for(const t in this._chartTypeProperties)if(o[t])try{o[t](this._chartTypeProperties[t])}catch(l){console.warn("Exception Setting Property: "+t)}else console.warn("Unknown Property: "+t);this._chartTypeProperties={}}const s=this;i.each(function(t){t.resize(s.size())}),i.exit().transition().each(function(t){t.target(null)}).remove()}exit(t,e){this._chartMonitor&&(this._chartMonitor.remove(),delete this._chartMonitor),this.chart()&&this.chart().target(null),super.exit(t,e)}render(t){if(this.chartType()&&(!this.chart()||this.chart().classID()!==this._allCharts[this.chartType()].widgetClass)){const t=this,i=arguments;return this.switchChart(function(){e.HTMLWidget.prototype.render.apply(t,i)}),this}return e.HTMLWidget.prototype.render.apply(this,arguments)}};P(he,"MultiChart");let de=he;de.prototype._class+=" composite_MultiChart",de.prototype.implements(o.INDChart.prototype),de.prototype.implements(o.IGraph.prototype),de.prototype._otherChartTypes=[{id:"FORM",display:"Form",widgetClass:"form_FieldForm"}].map(function(t){return t.family="other",t}),de.prototype._graphChartTypes=[{id:"GRAPH",display:"Graph",widgetClass:"graph_Graph"},{id:"ADJACENCY_GRAPH",display:"Graph",widgetClass:"graph_AdjacencyGraph"},{id:"GRAPHC",display:"GraphC",widgetClass:"graph_GraphC"}].map(function(t){return t.family="GRAPH",t}),de.prototype._1DChartTypes=[].map(function(t){return t.family="1D",t}),de.prototype._2DChartTypes=[{id:"SUMMARY",display:"Summary",widgetClass:"chart_Summary"},{id:"BUBBLE",display:"Bubble",widgetClass:"chart_Bubble"},{id:"PIE",display:"Pie",widgetClass:"chart_Pie"},{id:"WORD_CLOUD",display:"Word Cloud",widgetClass:"other_WordCloud"}].map(function(t){return t.family="2D",t}),de.prototype._NDChartTypes=[{id:"COLUMN",display:"Column",widgetClass:"chart_Column"},{id:"BAR",display:"Bar",widgetClass:"chart_Bar"},{id:"LINE",display:"Line",widgetClass:"chart_Line"},{id:"AREA",display:"Area",widgetClass:"chart_Area"},{id:"STEP",display:"Step",widgetClass:"chart_Step"},{id:"SCATTER",display:"Scatter",widgetClass:"chart_Scatter"},{id:"HEXBIN",display:"Hex Bin",widgetClass:"chart_HexBin"}].map(function(t){return t.family="ND",t}),de.prototype._mapChartTypes=[{id:"CHORO_USSTATES",display:"US State Choropleth",widgetClass:"map_ChoroplethStates"},{id:"CHORO_USCOUNTIES",display:"US County Choropleth",widgetClass:"map_ChoroplethCounties"},{id:"CHORO_COUNTRIES",display:"Country Choropleth",widgetClass:"map_ChoroplethCountries"},{id:"GMAP_CHORO_USCOUNTIES",display:"Google Map US County Choropleth",widgetClass:"map_GMapCounties"},{id:"GOOGLE_MAP",display:"Google Map",widgetClass:"map_GMapLayered"},{id:"OPENSTREET",display:"Open Street Map",widgetClass:"map_OpenStreet"}].map(function(t){return t.family="map",t}),de.prototype._anyChartTypes=[{id:"TABLE",display:"Table",widgetClass:"dgrid_Table"},{id:"TABLE_LEGACY",display:"Table (legacy)",widgetClass:"other_Table"},{id:"TABLE_NESTED",display:"Nested Table",widgetClass:"other_NestedTable"},{id:"TABLE_CALENDAR",display:"Table driven Calendar Heat Map",widgetClass:"other_CalendarHeatMap"},{id:"TABLE_BULLET",display:"Table driven bullet chart",widgetClass:"chart_Bullet"},{id:"TABLE_SELECT",display:"Table driven select",widgetClass:"other_Select"},{id:"TABLE_AUTOCOMPLETE",display:"Table driven auto complete",widgetClass:"other_AutoCompleteText"},{id:"TABLE_OPPORTUNITY",display:"Table driven opportunity widget",widgetClass:"graph_Opportunity"},{id:"TABLE_TREE",display:"Table driven tree",widgetClass:"tree_Dendrogram"},{id:"TABLE_TREEMAP",display:"Table driven Treemap",widgetClass:"tree_Treemap"},{id:"TABLE_SANKEY",display:"Table driven Sankey",widgetClass:"graph_Sankey"},{id:"TABLE_GMAP_PIN",display:"Table driven Google Map (pins)",widgetClass:"map_GMapPin"},{id:"TABLE_GMAP_PINLINE",display:"Table driven Google Map (pins/lines)",widgetClass:"map_GMapPinLine"},{id:"TABLE_XML_TREE",display:"Table driven XML Tree",widgetClass:"tree_Indented"}].map(function(t){return t.family="any",t}),de.prototype._allChartTypes=de.prototype._otherChartTypes.concat(de.prototype._graphChartTypes.concat(de.prototype._1DChartTypes.concat(de.prototype._2DChartTypes.concat(de.prototype._NDChartTypes.concat(de.prototype._mapChartTypes.concat(de.prototype._anyChartTypes)))))),de.prototype._allMap=e.map(de.prototype._allChartTypes,function(t){return t.family}),de.prototype._allFamilies=de.prototype._allMap.keys(),de.prototype._allChartTypesMap={},de.prototype._allChartTypesByClass={},de.prototype._allChartTypes.forEach(function(t){t.widgetPath=e.Utility.widgetPath(t.widgetClass),de.prototype._allChartTypesMap[t.id]=t,de.prototype._allChartTypesByClass[t.widgetClass]=t}),de.prototype.publishReset(),de.prototype.publish("hideRowOnLegendClick",!1,"boolean","Enable/Disable hiding row on legend clicks",null,{tags:["Basic"]}),de.prototype.publish("chartType","BUBBLE","set","Chart Type",de.prototype._allChartTypes.map(function(t){return t.id}),{tags:["Basic"]}),de.prototype.publish("chart",null,"widget","Chart",null,{tags:["Basic"]});const ce=de.prototype.chart;de.prototype.chart=function(t){const e=ce.apply(this,arguments);if(arguments.length){const e=this;this._allChartTypesByClass[t.classID()]?this.chartType(this._allChartTypesByClass[t.classID()].id):console.warn("Unknown Class ID: "+t.classID()),t.click=function(t,i,o){e.click.apply(e,arguments)},t.dblclick=function(t,i,o){e.dblclick.apply(e,arguments)},t.vertex_click=function(t,i,o,s){e.vertex_click.apply(e,arguments)},t.vertex_dblclick=function(t,i,o,s){e.vertex_dblclick.apply(e,arguments)},t.edge_click=function(t,i,o,s){e.edge_click.apply(e,arguments)},t.edge_dblclick=function(t,i,o,s){e.edge_dblclick.apply(e,arguments)},this._chartMonitor&&(this._chartMonitor.remove(),delete this._chartMonitor),this._chartMonitor=t.monitor(function(i,o,s){e.broadcast(i,o,s,t)})}return e};const pe=class _Summary extends e.HTMLWidget{constructor(){super()}enter(t,e){super.enter(t,e),e.append("p")}update(t,e){super.update(t,e),e.select("p").text(this.text())}};P(pe,"Summary"),pe.prototype.publish("text","","string");const ue=class _MultiChartPanel extends Ot{constructor(){super(),this.widget((new de).chartType("COLUMN"))}multiChart(){return this._widget}chartType(t){return arguments.length?(this._widget.chartType(t),this):this._widget.chartType()}chart(t){return arguments.length?(this._widget.chart(t),this):this._widget.chart()}chartTypeDefaults(t){return arguments.length?(this._widget.chartTypeDefaults(t),this):this._widget.chartTypeDefaults()}chartTypeProperties(t){return arguments.length?(this._widget.chartTypeProperties(t),this):this._widget.chartTypeProperties()}update(t,e){super.update(t,e),this._widget instanceof de&&this._legend.dataFamily(this._widget.getChartDataFamily()),super.update(t,e)}};P(ue,"MultiChartPanel");let ge=ue;ge.prototype._class+=" composite_MultiChartPanel";const _e=class _Dermatology extends E{_toolbar;_propEditor;_showProperties;_propsButton;_prevWidget;constructor(){super(),this._toolbar=(new se).title("Dermatology"),this._propEditor=(new l.PropertyEditor).show_settings(!0)}showProperties(t){if(!arguments.length)return this._showProperties;this._showProperties=t,this.rightPercentage(0).rightSize(this._showProperties?360:0).setContent("right",this._showProperties?this._propEditor:null);const e=this.widget();return e&&e.designMode&&e.designMode(this._showProperties),this}toggleProperties(){return this.showProperties(!this.showProperties())}enter(t,e){super.enter(t,e),this.topPercentage(0).topSize(0).setContent("top",this._toolbar),this.getCell("top").surfaceShadow(!0);const i=this;this._propsButton=(new s.OnOff).id(this.id()+"_props").value("Properties").on("click",function(){i.toggleProperties().render()}),this._toolbar.widgets([this._propsButton])}update(t,e){this.topPercentage(0).topSize(this.showToolbar()?32:0),super.update(t,e);const i=this.widget();e.style("background-color",i&&i.surfaceShadow?null:"white")}render(t){const e=this.widget();return e!==this._prevWidget&&(e&&e.surfaceShadow&&e.surfaceBackgroundColor_default("white"),this.setContent("center",e),this._propEditor.widget(e),this._prevWidget=e),super.render(t)}showToolbar;showToolbar_exists;widget;widget_exists};P(_e,"Dermatology");let ye=_e;ye.prototype._class+=" composite_Dermatology",ye.prototype.publish("showToolbar",!0,"boolean","Show Toolbar"),ye.prototype.publish("widget",null,"widget","Widget");const fe=class _MegaChart extends E{_chart=new de;_toolbar=new se;_valueTitle=new e.Text;_domainTitle=new e.Text;_legend=new l.Legend;_csvButton;_infoButton;_maximizeButton;_legendButton;_chartTypeSelect;_prevLegendPosition;_prevShowToolbar;_1DChartTypes;_2DChartTypes;_NDChartTypes;_anyChartTypes;_allChartTypes;_contentClasses;_dataCount;constructor(){super(),this._tag="div";const t=this;this._chart.click=function(){t.click.apply(t,arguments)},this._chart.dblclick=function(){t.dblclick.apply(t,arguments)},this._chart.vertex_click=function(){t.vertex_click.apply(t,arguments)},this._chart.vertex_dblclick=function(){t.vertex_dblclick.apply(t,arguments)},this._chart.edge_click=function(){t.edge_click.apply(t,arguments)},this._chart.edge_dblclick=function(){t.edge_dblclick.apply(t,arguments)}}toolbarWidgets(t){return arguments.length?(this._toolbar.widgets(t),this):this._toolbar.widgets()}chartTypeDefaults(t){return arguments.length?(this._chart.chartTypeDefaults(t),this):this._chart.chartTypeDefaults()}chartTypeProperties(t){return arguments.length?(this._chart.chartTypeProperties(t),this):this._chart.chartTypeProperties()}fields(t){return arguments.length?(this._chart.fields(t),this):this._chart.fields()}columns(t,e){return arguments.length?(this._chart.columns(t,e),this):this._chart.columns()}data(t){return arguments.length?(this._chart.data(t),this):this._chart.data()}downloadCSV(){return e.Utility.downloadString("CSV",this._chart.export("CSV")),this}enter(t,i){super.enter(t,i);const o=this;this.topShrinkWrap(!1).topPercentage(0).topSize(30),this._dataCount=(new l.Html).classed({"composite_MegaChart-dataCount":!0}).id(this.id()+"_dataCount").html('<span class="MegaChart-dataCount-label">Count:</span>&nbsp;<span class="MegaChart-dataCount-value">'+(this.data()?this.data().length:"0")+"</span>").overflowX("visible").overflowY("visible"),this._csvButton=(new s.Button).classed({"composite_MegaChart-CSV":!0}).id(this.id()+"_csv").value("CSV"),this._csvButton.click=function(t){o.downloadCSV()},this._infoButton=(new s.Button).classed({"composite_MegaChart-Info":!0}).id(this.id()+"_info").value(this.infoIcon()),this._maximizeButton=(new s.Button).classed({"composite_MegaChart-Maximize":!0}).id(this.id()+"_maximize").value(""),this._maximizeButton.click=function(t){const i=o.target();let s=i;const l=e.select(i).classed("__hpccisMaximized"),r=o.locateAncestor("layout_Grid");s=r?r.element().node():document.body;const n=e.select(o.target());if(l){const e=i.parentElement.getBoundingClientRect(),s=parseInt(getComputedStyle(i,null).getPropertyValue("padding-top").replace("px","")),l=parseInt(getComputedStyle(i,null).getPropertyValue("padding-left").replace("px","")),r=parseInt(getComputedStyle(i,null).getPropertyValue("padding-right").replace("px","")),a=parseInt(getComputedStyle(i,null).getPropertyValue("padding-bottom").replace("px",""));o.contentDiv.style("opacity",0).transition(100),n.transition().style("top",e.top+"px").style("left",e.left+"px").style("width",e.width-l-r+"px").style("height",e.height-s-a+"px").each("end",function(){n.style("position",i.__old_position),n.style("z-index",i.__old_zindex),n.style("background-color",i.__old_backgroundColor),n.style("box-shadow",i.__old_boxshadow),o.resize({width:e.width-l-r,height:e.height-s-a}).render(function(){o.contentDiv.transition().style("opacity",1)}),t.value("").render()})}else{i.__old_position=i.style.position,i.__old_zindex=i.style.zIndex,i.__old_boxshadow=i.style.boxShadow,i.__old_backgroundColor=o.element().style("background-color");const l=e.select(s).datum(),r=l.target(),a=l?r.getBoundingClientRect():s.getBoundingClientRect(),h=parseInt(getComputedStyle(r,null).getPropertyValue("padding-top").replace("px","")),d=parseInt(getComputedStyle(r,null).getPropertyValue("padding-left").replace("px","")),c=parseInt(getComputedStyle(r,null).getPropertyValue("padding-right").replace("px","")),p=parseInt(getComputedStyle(r,null).getPropertyValue("padding-bottom").replace("px",""));o.contentDiv.style("opacity",0).transition(100),n.style("position","fixed").style("z-index",999999).style("box-shadow","0 8px 8px 0 rgba(0,0,0,.14),0 12px 4px -8px rgba(0,0,0,.2),0 4px 20px 0 rgba(0,0,0,.12)").style("background-color",i.__old_backgroundColor).transition().style("top",a.top+h+"px").style("left",a.left+d+"px").style("width",a.width-d-c+"px").style("height",a.height-h-p+"px").each("end",function(){n.style("background-color",o.maximizedBackgroundColor()),o.resize({width:a.width-d-c,height:a.height-h-p}).render(function(){o.contentDiv.transition().style("opacity",1)}),t.value("").render()})}e.select(i).classed("__hpccisMaximized",!l)},this._legendButton=(new s.Input).classed({"composite_MegaChart-legend":!0}).id(this.id()+"_legend").type("checkbox").inlineLabel("Legend: "),this._legendButton.click=function(t){o.render()},this._chartTypeSelect=(new s.Select).classed({"composite_MegaChart-chartType":!0}).id(this.id()+"_chartType").selectOptions(this._allChartTypes.map(function(t){return[t.id,t.display]})).value(this.chartType()),this._chartTypeSelect.change=function(t){o.chartType(t.value()).render()},this.setContent("center",this._chart),this._legend.targetWidget(this._chart).orientation(-1!==["top","bottom"].indexOf(this.legendPosition())?"horizontal":"vertical").fixedSize(!0),this._prevLegendPosition=this.legendPosition(),this.valueAxisTitle()&&this.setContent("left",this._valueTitle.rotation(-90)).leftShrinkWrap(!0),this.domainAxisTitle()&&this.setContent("bottom",this._domainTitle).bottomShrinkWrap(!0),"none"!==this.legendPosition()&&this.setContent(this.legendPosition(),this._legend)[this.legendPosition()+"ShrinkWrap"](!0)}update(t,e){function i(t,e,i){if(i&&-1===t.indexOf(e))t.push(e);else if(!i){const i=t.indexOf(e);i>=0&&t.splice(i,1)}}P(i,"showHideButton"),this._chart&&"function"==typeof this._chart.hideRowOnLegendClick&&this._chart.hideRowOnLegendClick(this.hideRowOnLegendClick()),this._dataCount.html('<span class="MegaChart-dataCount-label">Count:</span>&nbsp;<span class="MegaChart-dataCount-value">'+(this.data()?this.data().length:"0")+"</span>"),this._chartTypeSelect.value(this.chartType());const o=this.toolbarWidgets();i(o,this._csvButton,this.showCSV()),i(o,this._maximizeButton,this.showMaximize()),i(o,this._legendButton,this.toolbarShowLegend()),i(o,this._chartTypeSelect,this.showChartSelect()),i(o,this._infoButton,this.showInfoButton()),i(o,this._dataCount,this.showCount()),this.toolbarWidgets(o),this._prevShowToolbar!==this.showToolbar()&&(this.setContent("top",this.showToolbar()?this._toolbar:null),this._prevShowToolbar=this.showToolbar()),this._toolbar.fontSize(this.titleFontSize()).fontColor(this.titleFontColor()).fontFamily(this.titleFontFamily()).fontBold(this.titleFontBold()).backgroundColor(this.titleBackgroundColor()),this._chart.data(this.data()),this._chart.chartType()!==this.chartType()&&this._chart.chartType(this.chartType());let s=this.legendPosition();this.toolbarShowLegend()&&!this._legendButton.checked()&&(s="none"),this._prevLegendPosition!==s&&("none"!==this._prevLegendPosition&&this.clearContent(this._prevLegendPosition),this._prevLegendPosition=s,"none"!==s&&(this._legend=(new l.Legend).targetWidget(this.getContent("center").fixedSize(!0)),this.setContent(s,this._legend),this._legend.orientation(-1!==["top","bottom"].indexOf(s)?"horizontal":"vertical"))),this._contentClasses=this.getContentClasses(),this.valueAxisTitle()&&"common_Text"!==this._contentClasses.left&&"left"!==s&&this.setContent("left",this._valueTitle.rotation(-90)),this.domainAxisTitle()&&"common_Text"!==this._contentClasses.bottom&&"bottom"!==s&&this.setContent("bottom",this._domainTitle).bottomShrinkWrap(!0),this._legend.dataFamily(this._chart.getChartDataFamily()),super.update(t,e)}exit(t,e){super.exit(t,e)}getContentClasses(){const t={},e=this.getContent("top"),i=this.getContent("right"),o=this.getContent("bottom"),s=this.getContent("left");return t.top=null!==e?e.classID():void 0,t.right=null!==i?i.classID():void 0,t.bottom=null!==o?o.classID():void 0,t.left=null!==s?s.classID():void 0,t}serializeState(){const t={title:this.title(),data:this.data()},e=this.chart();return e&&e.serializeState&&(t.chart=e.serializeState(),delete t.chart.data),t}deserializeState(t){if(t){this.title(t.title).data(t.data);const e=this.chart();e&&t.chart&&e.serializeState&&e.deserializeState(t.chart)}return this}click(t,e,i){}dblclick(t,e,i){}vertex_click(t,e,i,o){o&&o.vertex}vertex_dblclick(t,e,i,o){o&&o.vertex}edge_click(t,e,i,o){o&&o.edge}edge_dblclick(t,e,i,o){o&&o.edge}hideRowOnLegendClick;hideRowOnLegendClick_exists;showToolbar;showToolbar_exists;titleFontSize;titleFontSize_exists;titleFontColor;titleFontColor_exists;titleFontFamily;titleFontFamily_exists;titleFontBold;titleFontBold_exists;titleBackgroundColor;titleBackgroundColor_exists;maximizedBackgroundColor;maximizedBackgroundColor_exists;showChartSelect;showChartSelect_exists;showCSV;showCSV_exists;showCount;showCount_exists;showMaximize;showMaximize_exists;toolbarShowLegend;toolbarShowLegend_exists;showInfoButton;showInfoButton_exists;infoIcon;infoIcon_exists;legendPosition;legendPosition_exists;title;title_exists;domainAxisTitle;domainAxisTitle_exists;valueAxisTitle;valueAxisTitle_exists;chartType;chartType_exists;chart;chart_exists};P(fe,"MegaChart");let be=fe;function we(t,i){if(i=i&&"1.14.2-dev"!==i?i:"1.18.0",!t.__version)return t;const o=e.Utility.parseVersionString(t.__version),s=e.Utility.parseVersionString(i);if(1===o.major&&14===o.minor){console.info("Upgrading old persist from "+t.__version+" to "+i);let e=JSON.stringify(t);e=e.split('"'+t.__version).join('"'+i);const o=JSON.parse(e);return o.__properties&&o.__properties.content&&o.__properties.content.forEach(function(t){JSON.stringify(t).split("graph_Graph").length>1&&s.minor>=16&&(t.__properties.widget.__id=t.__properties.widget.__properties.widget.__id,t.__properties.widget.__class="composite_MegaChart",t.__properties.widget.__properties.showCSV=!1,t.__properties.widget.__properties.chartType="GRAPH",t.__properties.widget.__properties.chart=t.__properties.widget.__properties.widget,delete t.__properties.widget.__properties.chart.__id,delete t.__properties.widget.__properties.widget),void 0===t.__properties.fields&&(t.__properties.fields=[])}),o}return t}function me(t,e){const i=[];return l.Persist.widgetPropertyWalker(t,null,(t,o)=>{if(t[o.id+"_reset"](),void 0!==e.__properties[o.id])switch(o.type){case"widget":const s=o.id;i.push(ve(e.__properties[o.id]).then(e=>(e._owner=t,t[s](e),e)));break;case"widgetArray":case"propertyArray":const l=o.id,r=e.__properties[o.id];if(r.length){const e=[];for(const i of r)e.push(ve(i).then(e=>(e._owner=t,e)));i.push(Promise.all(e).then(e=>{t[l](e)}))}break;default:t[o.id](e.__properties[o.id])}}),Promise.all(i).then(i=>{if(e.__data)for(const o in e.__data)if(e.__data.HasOwnProperty(o))if("data"===o)t.data(e.__data[o]);else console.warn("Unexpected __data item: "+o),t[o](e.__data[o]);return e.__state&&(t.deserializeState?t.deserializeState(e.__state):e.__state.data&&t.data&&t.data(e.__state.data)),t})}function xe(t,e){"string"==typeof e&&(e=JSON.parse(e)),e.__id&&0!==e.__id.indexOf(t._idSeed)&&t._id!==e.__id&&console.warn("Deserialize: IDs do not match - "+t._id),me(t,e)}function ve(t){return"string"==typeof t&&(t=JSON.parse(t)),re((t=we(t,e.Platform.version())).__class).then(e=>{const i=new e;return t.__id&&0!==t.__id.indexOf(i._idSeed)&&0!==t.__id.indexOf("_pe")&&(i._id=t.__id),me(i,t)}).catch(function(t){console.error("Persist.create: ***exception***"),console.error(t)})}function Ce(t){ve(l.Persist.serializeToObject(t,void 0,!0,!0))}be.prototype._class+=" composite_MegaChart",be.prototype._1DChartTypes=de.prototype._1DChartTypes,be.prototype._2DChartTypes=de.prototype._2DChartTypes,be.prototype._NDChartTypes=de.prototype._NDChartTypes,be.prototype._anyChartTypes=de.prototype._anyChartTypes,be.prototype._allChartTypes=de.prototype._allChartTypes,be.prototype.publishReset(),be.prototype.publish("hideRowOnLegendClick",!1,"boolean","Enable/Disable hiding row on legend clicks",null,{tags:["Basic"]}),be.prototype.publish("showToolbar",!0,"boolean","Enable/Disable Toolbar widget",null,{tags:["Basic"]}),be.prototype.publishProxy("title","_toolbar","title"),be.prototype.publish("ddlParamsFormat","","string","DDL Param Format '{fname}, {lname}'",null,{tags:["Advanced"],optional:!0}),be.prototype.publish("titleFontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],optional:!0}),be.prototype.publish("titleFontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],optional:!0}),be.prototype.publish("titleFontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],optional:!0}),be.prototype.publish("titleFontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],optional:!0}),be.prototype.publish("titleBackgroundColor",null,"html-color","Background Color",null,{tags:["Intermediate"],optional:!0}),be.prototype.publish("maximizedBackgroundColor","#FFFFFF","html-color","Background Color while maximized",null,{tags:["Intermediate"],optional:!0}),be.prototype.publish("showChartSelect",!0,"boolean","Show/Hide the chartType dropdown in the toolbar",null,{tags:["Basic"]}),be.prototype.publish("showCSV",!0,"boolean","Show/Hide CSV button",null,{tags:["Basic"]}),be.prototype.publish("showCount",!1,"boolean","Show/Hide Data Count",null,{tags:["Basic"]}),be.prototype.publish("showMaximize",!1,"boolean","Show/Hide Maximize button",null,{tags:["Basic"]}),be.prototype.publish("toolbarShowLegend",!1,"boolean","Show/Hide Legend button",null,{tags:["Basic"]}),be.prototype.publish("showInfoButton",!1,"boolean","Show/Hide Info button in toolbar",null,{tags:["Basic"]}),be.prototype.publish("infoIcon","","string","Help Icon",null,{tags:["Basic"]}),be.prototype.publish("legendPosition","none","set","Position of the Legend widget",["none","top","right","bottom","left"],{tags:["Basic"]}),be.prototype.publishProxy("legendFormat","_legend","rainbowFormat"),be.prototype.publishProxy("legendBins","_legend","rainbowBins"),be.prototype.publishProxy("domainAxisTitle","_domainTitle","text"),be.prototype.publishProxy("valueAxisTitle","_valueTitle","text"),be.prototype.publishProxy("chartType","_chart","chartType"),be.prototype.publishProxy("chart","_chart","chart"),P(we,"retrofit_114_serialization"),P(me,"deserializeFromObject"),P(xe,"deserialize"),P(ve,"create"),P(Ce,"clone");const Te=Object.freeze(Object.defineProperty({__proto__:null,clone:Ce,create:ve,deserialize:xe,deserializeFromObject:me,retrofit_114_serialization:we},Symbol.toStringTag,{value:"Module"}));t.BUILD_VERSION="3.2.1",t.Dermatology=ye,t.MegaChart=be,t.MultiChart=de,t.MultiChartPanel=ge,t.PKG_NAME="@hpcc-js/composite",t.PKG_VERSION="3.1.1",t.Persist=Te,t.Utility=ae,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
7
2
  //# sourceMappingURL=index.umd.cjs.map
8
- (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".composite_ChartPanel>.body{margin:0;padding:0;display:flex;flex-flow:row}.composite_ChartPanel>.body>article{flex:3 1 60%;order:2}.composite_ChartPanel>.body>nav{flex:1 6 20%;order:1}.composite_ChartPanel>.body>aside{margin-left:4px;flex:1 6 20%;order:3}header,footer{display:block}.composite_Dermatology{background-color:#f8f8ff}.composite_Dermatology .common_Icon{background-color:red;opacity:.75}.composite_Dermatology .common_Icon .common_Shape{fill:#fff;stroke:#a9a9a9;cursor:pointer}.composite_Dermatology .common_Icon.show .common_Shape{fill:#d3d3d3}.composite_Dermatology .common_Icon .common_FAChar .common_Text{fill:#a9a9a9;cursor:pointer}.composite_Dermatology .other_PropertyEditor{font-family:sans-serif;font-size:11px}.composite_Dermatology .other_PropertyEditor input{font-family:sans-serif;font-size:11px;border:0px}.composite_Dermatology .other_PropertyEditor .property-label{height:unset}.composite_MegaChart-Info,.composite_MegaChart-Info *,.composite_MegaChart-Maximize,.composite_MegaChart-Maximize *{font-family:FontAwesome}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
3
+ !function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode(".composite_ChartPanel>.body{margin:0;padding:0;display:flex;flex-flow:row}.composite_ChartPanel>.body>article{flex:3 1 60%;order:2}.composite_ChartPanel>.body>nav{flex:1 6 20%;order:1}.composite_ChartPanel>.body>aside{margin-left:4px;flex:1 6 20%;order:3}header,footer{display:block}.composite_Dermatology{background-color:#f8f8ff}.composite_Dermatology .common_Icon{background-color:red;opacity:.75}.composite_Dermatology .common_Icon .common_Shape{fill:#fff;stroke:#a9a9a9;cursor:pointer}.composite_Dermatology .common_Icon.show .common_Shape{fill:#d3d3d3}.composite_Dermatology .common_Icon .common_FAChar .common_Text{fill:#a9a9a9;cursor:pointer}.composite_Dermatology .other_PropertyEditor{font-family:sans-serif;font-size:11px}.composite_Dermatology .other_PropertyEditor input{font-family:sans-serif;font-size:11px;border:0px}.composite_Dermatology .other_PropertyEditor .property-label{height:unset}.composite_MegaChart-Info,.composite_MegaChart-Info *,.composite_MegaChart-Maximize,.composite_MegaChart-Maximize *{font-family:FontAwesome}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();