@hpcc-js/layout 3.6.6 → 3.6.8
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.
- package/dist/index.js +56 -90
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +3 -3
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +8 -8
package/dist/index.umd.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/common"),require("@hpcc-js/dgrid2"),require("@hpcc-js/api")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/common`,`@hpcc-js/dgrid2`,`@hpcc-js/api`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/layout`]={},e[`@hpcc-js/common`],e[`@hpcc-js/dgrid2`],e[`@hpcc-js/api`]))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.create,a=Object.defineProperty,__name=(e,t)=>a(e,`name`,{value:t,configurable:!0}),o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__copyProps=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},__toESM=(e,t,n)=>(n=e==null?{}:i(c(e)),__copyProps(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)),u=`@hpcc-js/layout`,d=`3.6.6`,f=`3.29.1`,AbsoluteSurface=class extends t.HTMLWidget{constructor(){super(),this._tag=`div`}enter(e,t){super.enter(e,t)}update(e,t){super.update(e,t);let n=0,r=0,i=this.clientWidth(),a=this.clientHeight();switch(this.units()){case`pixels`:n=this.widgetX(),r=this.widgetY(),i=this.widgetWidth()===``?i-n:Number(this.widgetWidth()),a=this.widgetHeight()===``?a-r:Number(this.widgetHeight());break;case`percent`:n=this.widgetX()*i/100,r=this.widgetY()*a/100,i=this.widgetWidth()===``?i-n:Number(this.widgetWidth())*i/100,a=this.widgetHeight()===``?a-r:Number(this.widgetHeight())*a/100;break}t.style(`opacity`,this.opacity());let o=t.selectAll(`#`+this._id+` > .placeholder`).data(this.widget()?[this.widget()]:[],function(e){return e._id});o.enter().append(`div`).attr(`class`,`placeholder`).each(function(e){e.target(this)}).merge(o).style(`left`,n+`px`).style(`top`,r+`px`).style(`width`,i+`px`).style(`bottom`,a+`px`).each(function(e){e.resize({width:i,height:a})}),o.exit().each(function(e){e.target(null)}).remove()}exit(e,t){this.widget()&&this.widget().target(null),super.exit(e,t)}};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`);var Accordion=class extends t.HTMLWidget{_isClosed;titleSpan;iconDiv;ul;icon;constructor(){super(),this._tag=`div`,this._isClosed=!1}pushListItem(e,t=!1,n=!1){let r=this.content();return e._protected=n,t?r.unshift(e):r.push(e),this.content(r),this}clearListItems(){let e=[];for(let t in this.content())this.content()[t]._protected&&e.push(this.content()[t]);return this.content(e),this}collapseClick(e){e.classed(`closed`)?(this._isClosed=!1,e.classed(`open`,!0),e.classed(`closed`,!1)):(this._isClosed=!0,e.classed(`open`,!1),e.classed(`closed`,!0))}enter(e,n){super.enter(e,n);let r=this;this._isClosed=this.defaultCollapsed(),n.classed(this._isClosed?`closed`:`open`,!0),this.titleSpan=n.append(`span`).classed(`collapsible-title`,!0),this.iconDiv=n.append(`div`).classed(`collapsible-icon`,!0),this.ul=n.append(`ul`),this.icon=new t.FAChar().size({height:24,width:24}).target(this.iconDiv.node()),this.iconDiv.on(`click`,function(){r.collapseClick(n),r.render()}),this.titleSpan.on(`click`,function(){r.collapseClick(n),r.render()})}update(e,t){super.update(e,t);let n=this;this.titleSpan.text(n.title().length>0?n.title()+``:`Accordion [`+n._id+`]`);let r=this.ul.selectAll(`#`+n._id+` > ul > li`).data(this.content(),function(e){return e._id});r.enter().append(function(e){let t=document.createElement(`li`);if(e._target===null){let r=e.size();if(r.width===0||r.height===0){let t=n.size();e.size({width:t.width,height:t.width})}e.target(t)}else return e._target;return t}),r.exit().remove(),this.icon.text_colorFill(this.titleFontColor()).char(this._isClosed?this.closedIcon():this.openIcon()).render()}exit(e,t){super.exit(e,t)}};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`]});var Surface=class extends t.HTMLWidget{_surfaceButtons;constructor(){super(),this._tag=`div`,this._surfaceButtons=[]}widgetSize(e,t){let n=this.clientWidth(),r=this.clientHeight();return this.title()&&(r-=this.calcHeight(e)),r-=this.calcFrameHeight(t),n-=this.calcFrameWidth(t),{width:n,height:r}}enter(e,t){super.enter(e,t)}update(e,n){super.update(e,n);let r=this;n.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());let i=n.selectAll(`.surfaceTitle`).data(this.title()?[this.title()]:[]);i.enter().insert(`h3`,`div`).attr(`class`,`surfaceTitle`).merge(i).text(function(e){return e}).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),i.exit().remove();let a=n.select(`.surfaceTitle`).append(`div`).attr(`class`,`html-button-container`).selectAll(`.surface-button`).data(this.buttonAnnotations());a.enter().append(`button`).classed(`surface-button`,!0).each(function(e,n){let i=r._surfaceButtons[n]=(0,t.select)(this).attr(`class`,`surface-button`+(e.class?` `+e.class:``)).attr(`id`,e.id).style(`padding`,e.padding).style(`width`,e.width).style(`height`,e.height).style(`cursor`,`pointer`);e.font===`FontAwesome`?i.style(`background`,`transparent`).style(`border`,`none`).on(`click`,function(e){r.click(e)}).append(`i`).attr(`class`,`fa`).text(function(){return e.label}):i.text(function(){return e.label}).on(`click`,function(e){r.click(e)})}),a.exit().each(function(e,n){let i=(0,t.select)(this);delete r._surfaceButtons[n],i.remove()});let o=n.selectAll(`#`+this._id+` > .surfaceWidget`).data(this.widget()?[this.widget()]:[],function(e){return e._id});o.enter().append(`div`).attr(`class`,`surfaceWidget`).each(function(e){(0,t.select)(r.element().node().parentElement).classed(`content-icon content-icon-`+e.classID().split(`_`)[1],!0),e.target(this)}).merge(o).style(`padding`,this.surfacePadding_exists()?this.surfacePadding()+`px`:null).each(function(e){let i=r.widgetSize(n.select(`h3`),(0,t.select)(this));i.width<0&&(i.width=0),i.height<0&&(i.height=0),e.resize({width:i.width,height:i.height})}),o.exit().each(function(e){e.target(null)}).remove()}exit(e,t){this.widget()&&this.widget().target(null),super.exit(e,t)}click(e){}};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:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleFontSize`,null,`number`,`Title Font Size (px)`,null,{tags:[`Advanced`],disable:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleFontColor`,null,`html-color`,`Title Font Color`,null,{tags:[`Advanced`],disable:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleFontFamily`,null,`string`,`Title Font Family`,null,{tags:[`Advanced`],disable:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleFontBold`,!0,`boolean`,`Enable Bold Title Font`,null,{tags:[`Advanced`],disable:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleBackgroundColor`,null,`html-color`,`Title Background Color`,null,{tags:[`Advanced`],disable:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleAlignment`,`center`,`set`,`Title Alignment`,[`left`,`right`,`center`],{tags:[`Basic`],disable:e=>!e.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`]});var Cell=class extends Surface{_indicateTheseIds;constructor(){super(),this._indicateTheseIds=[]}indicateTheseIds(e){return arguments.length?(this._indicateTheseIds=e,this):this._indicateTheseIds}enter(e,t){super.enter(e,t);let n=this;t.classed(`layout_Surface`,!0).on(`mouseenter`,function(){n.onMouseEnter()}).on(`mouseleave`,function(){n.onMouseLeave()})}update(e,t){super.update(e,t)}onMouseEnter(){let e=this.indicateTheseIds(),n=this.indicatorOpacity(),r=this.indicatorBorderColor(),i=this.indicatorGlowColor();for(let a=0;a<e.length;a++){let o=(0,t.select)(`#`+e[a]),s=o.datum();o&&s&&o.append(`div`).attr(`class`,`update-indicator`).style(`width`,s.width()+`px`).style(`height`,s.height()+`px`).style(`opacity`,n).style(`border-color`,r).style(`-webkit-box-shadow`,`inset 0px 0px 30px 0px `+i).style(`-moz-box-shadow`,`inset 0px 0px 30px 0px `+i).style(`box-shadow`,`inset 0px 0px 30px 0px `+i)}}onMouseLeave(){let e=this.indicateTheseIds();for(let n=0;n<e.length;n++)(0,t.selectAll)(`#`+e[n]+` > 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`]});var Border=class extends t.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(e){if(this._watch===void 0&&(this._watch={}),this._watch[e.id()]&&(this._watch[e.id()].remove(),delete this._watch[e.id()]),e){let t=this;this._watch[e.id()]=e.monitor(function(e,n,r){r!==n&&t.lazyPostUpdate()})}}lazyPostUpdate=t.Utility.debounce(function(){this.postUpdate()},100);applyLayoutType(){let e=this.borderLayoutObject();this.content().forEach(function(t,n){t._fixedLeft=e[this.sectionTypes()[n]].left,t._fixedTop=e[this.sectionTypes()[n]].top,t._fixedWidth=e[this.sectionTypes()[n]].width,t._fixedHeight=e[this.sectionTypes()[n]].height,t._dragHandles=this.cellSpecificDragHandles(this.sectionTypes()[n])},this)}cellSpecificDragHandles(e){switch(e){case`top`:return[`s`];case`right`:return[`w`];case`bottom`:return[`n`];case`left`:return[`e`];case`center`:return[]}}borderLayoutObject(e){let t={},n=this,r,i,a,o,s,c,l,u,d=this.target().getBoundingClientRect(),f={};f.top=d.top,f.left=d.left,f.bottom=d.bottom,f.right=d.right,this.target()instanceof SVGElement?(f.width=parseFloat(this.target().getAttribute(`width`)),f.height=parseFloat(this.target().getAttribute(`height`))):(f.width=d.width,f.height=d.height),this.sectionTypes().indexOf(`top`)!==-1&&(r=this.topSize(),i=this.topPercentage(),this._shrinkWrapBoxes.top!==void 0&&(r=this._shrinkWrapBoxes.top.height+this.gutter(),i=0)),this.sectionTypes().indexOf(`bottom`)!==-1&&(a=this.bottomSize(),o=this.bottomPercentage(),this._shrinkWrapBoxes.bottom!==void 0&&(a=this._shrinkWrapBoxes.bottom.height+this.gutter(),o=0)),this.sectionTypes().indexOf(`left`)!==-1&&(s=this.leftSize(),c=this.leftPercentage(),this._shrinkWrapBoxes.left!==void 0&&(s=this._shrinkWrapBoxes.left.width+this.gutter(),c=0)),this.sectionTypes().indexOf(`right`)!==-1&&(l=this.rightSize(),u=this.rightPercentage(),this._shrinkWrapBoxes.right!==void 0&&(l=this._shrinkWrapBoxes.right.width+this.gutter(),u=0));let p=_sectionPlacementObject({width:{px:0,"%":100},height:{px:r,"%":i},top:{px:0,"%":0},left:{px:0,"%":0}}),m=_sectionPlacementObject({width:{px:0,"%":100},height:{px:a,"%":o},top:{px:0,"%":100},left:{px:0,"%":0}});m.top-=m.height;let h=_sectionPlacementObject({width:{px:s,"%":c},height:{px:-p.height-m.height,"%":100},top:{px:p.height,"%":0},left:{px:0,"%":0}}),g=_sectionPlacementObject({width:{px:l,"%":u},height:{px:-p.height-m.height,"%":100},top:{px:p.height,"%":0},left:{px:0,"%":100}});g.left-=g.width;let _=_sectionPlacementObject({width:{px:-g.width-h.width,"%":100},height:{px:-p.height-m.height,"%":100},top:{px:p.height,"%":0},left:{px:h.width,"%":0}});return t.top=p,t.bottom=m,t.right=g,t.left=h,t.center=_,t;function _sectionPlacementObject(e){return e.width.px=e.width.px===void 0?0:e.width.px,e.width[`%`]=e.width[`%`]===void 0?0:e.width[`%`],e.height.px=e.height.px===void 0?0:e.height.px,e.height[`%`]=e.height[`%`]===void 0?0:e.height[`%`],{width:e.width.px+e.width[`%`]/100*n.width(),height:e.height.px+e.height[`%`]/100*n.height(),top:e.top.px+e.top[`%`]/100*n.height()+n.gutter()/2,left:e.left.px+e.left[`%`]/100*n.width()+n.gutter()/2}}}clearContent(e){if(!e)this.content().forEach(function(e){return e.target(null),!1}),(0,t.select)(`#`+this.id()+` > div.borderHandle`).classed(`borderHandleDisabled`,!0),delete this._watch,this.content([]),this.sectionTypes([]);else{let n=this.sectionTypes().indexOf(e);n>=0&&(this._watch&&this.content()[n]&&delete this._watch[this.content()[n].id()],this.content()[n].target(null),(0,t.select)(`#`+this.id()+` > div.borderHandle_`+e).classed(`borderHandleDisabled`,!0),this.content().splice(n,1),this.sectionTypes().splice(n,1))}}hasContent(e,t,n){return this.sectionTypes().indexOf(e)>=0}setContent(e,t,n){if(this.clearContent(e),n=n===void 0?``:n,t){let r=new Cell().surfaceBorderWidth(0).widget(t).title(n);this.watchWidget(t),this.content().push(r),this.sectionTypes().push(e)}return this}getCell(e){let t=this.sectionTypes().indexOf(e);return t>=0?this.content()[t]:null}getContent(e){let t=this.sectionTypes().indexOf(e);return t>=0?this.content()[t].widget():null}setLayoutOffsets(){this._offsetX=this._element.node().getBoundingClientRect().left+this.gutter()/2,this._offsetY=this._element.node().getBoundingClientRect().top+this.gutter()/2}dragStart(e){let n=(0,t.d3Event)();n.sourceEvent.stopPropagation();let r=this;this._dragCell=e,this._dragCellStartSize=this[e+`Size`](),this[e+`ShrinkWrap`]()&&(this[e+`Percentage`](0),this[e+`ShrinkWrap`](!1));let i=(0,t.select)(`#`+r.id()+` > div.borderHandle_`+e);r._handleTop=parseFloat(i.style(`top`).split(`px`)[0]),r._handleLeft=parseFloat(i.style(`left`).split(`px`)[0]),this._dragPrevX=n.sourceEvent.clientX,this._dragPrevY=n.sourceEvent.clientY}dragTick(e){let n=this,r=(0,t.d3Event)(),i=this._dragPrevX-r.sourceEvent.clientX,a=this._dragPrevY-r.sourceEvent.clientY;switch(e){case`top`:case`bottom`:_moveHandles(e,a);break;case`right`:case`left`:_moveHandles(e,i);break}function _moveHandles(e,r){if(r===0)return;let i=(0,t.selectAll)(`#`+n.id()+` > div.borderHandle`),a=(0,t.select)(`#`+n.id()+` > div.borderHandle_`+e);a.classed(`borderHandle_top`)?(a.style(`top`,n._handleTop-r+`px`),n._cellSizes.topHeight=n._handleTop-r,n._cellSizes.leftHeight=n._cellSizes.height,n._cellSizes.leftHeight-=n._cellSizes.topHeight,n._cellSizes.leftHeight-=n._cellSizes.bottomHeight,n._cellSizes.rightHeight=n._cellSizes.leftHeight):a.classed(`borderHandle_right`)?(a.style(`left`,n._handleLeft-r+`px`),n._cellSizes.rightWidth=n._cellSizes.width-n._handleLeft+r):a.classed(`borderHandle_bottom`)?(a.style(`top`,n._handleTop-r+`px`),n._cellSizes.bottomHeight=n._cellSizes.height-n._handleTop+r,n._cellSizes.leftHeight=n._cellSizes.height,n._cellSizes.leftHeight-=n._cellSizes.bottomHeight,n._cellSizes.leftHeight-=n._cellSizes.topHeight,n._cellSizes.rightHeight=n._cellSizes.leftHeight):a.classed(`borderHandle_left`)&&(a.style(`left`,n._handleLeft-r+`px`),n._cellSizes.leftWidth=n._handleLeft-r),i.each(function(){let e=(0,t.select)(this);e.classed(`borderHandle_top`)?(e.style(`width`,n._cellSizes.width+`px`),e.style(`top`,n._cellSizes.topHeight-3+`px`)):e.classed(`borderHandle_right`)?(e.style(`left`,n._cellSizes.width-n._cellSizes.rightWidth+`px`),e.style(`top`,n._cellSizes.topHeight+3+`px`),e.style(`height`,n._cellSizes.rightHeight+`px`)):e.classed(`borderHandle_bottom`)?(e.style(`width`,n._cellSizes.width+`px`),e.style(`top`,n._cellSizes.height-n._cellSizes.bottomHeight-3+`px`)):e.classed(`borderHandle_left`)&&(e.style(`left`,n._cellSizes.leftWidth+`px`),e.style(`height`,n._cellSizes.leftHeight+`px`),e.style(`top`,n._cellSizes.topHeight+3+`px`))})}}dragEnd(e){if(e){let n=(0,t.d3Event)(),r=this._dragPrevX-n.sourceEvent.clientX,i=this._dragPrevY-n.sourceEvent.clientY;switch(e){case`top`:i!==0&&(this.topPercentage(0),this.topSize(this.topSize()===0?this.getContent(`top`).getBBox().height-i:this.topSize()-i));break;case`right`:r!==0&&(this.rightPercentage(0),this.rightSize(this.rightSize()===0?this.getContent(`right`).getBBox().width+r:this.rightSize()+r));break;case`bottom`:i!==0&&(this.bottomPercentage(0),this.bottomSize(this.bottomSize()===0?this.getContent(`bottom`).getBBox().height+i:this.bottomSize()+i));break;case`left`:r!==0&&(this.leftPercentage(0),this.leftSize(this.leftSize()===0?this.getContent(`left`).getBBox().width-r:this.leftSize()-r));break}this._dragPrevX=n.sourceEvent.clientX,this._dragPrevY=n.sourceEvent.clientY}this.render()}size(e){let n=t.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`),n}enter(e,n){super.enter(e,n);let r=this;n.style(`position`,`relative`),this.contentDiv=n.append(`div`).classed(`border-content`,!0),this._scrollBarWidth=t.Platform.getScrollbarWidth(),this._borderHandles=[`top`,`left`,`right`,`bottom`],n.selectAll(`div.borderHandle`).data(this._borderHandles).enter().append(`div`).classed(`borderHandle`,!0).each(function(e){(0,t.select)(this).classed(`borderHandle_`+e,!0).classed(`borderHandleDisabled`,r.getContent(e)===null)})}update(e,n){super.update(e,n),this._sectionTypeArr=this.sectionTypes();let r=this;n.classed(`design-mode`,this.designMode()),this.setLayoutOffsets();let i=this.contentDiv.selectAll(`.cell_`+this._id).data(this.content(),function(e){return e._id}),a=i.enter().append(`div`).classed(`cell_`+this._id,!0).style(`position`,`absolute`).each(function(e,n){(0,t.select)(this).classed(`border-cell border-cell-`+r._sectionTypeArr[n],!0),e.target(this),(0,t.select)(`#`+r.id()+` > div.borderHandle_`+r._sectionTypeArr[n]).classed(`borderHandleDisabled`,!1)}).merge(i);a.each(function(e,t){let n=r.sectionTypes()[t];r[n+`ShrinkWrap`]!==void 0&&r[n+`ShrinkWrap`]()?(e.render(),r._shrinkWrapBoxes[n]=e.widget().getBBox(!0)):delete r._shrinkWrapBoxes[n]});let o=(0,t.drag)().on(`start`,function(e,t){r.dragStart.call(r,e,t)}).on(`drag`,function(e,t){r.dragTick.call(r,e,t)}).on(`end`,function(e,t){r.dragEnd.call(r,e,t)});this.designMode()?n.selectAll(`#`+this.id()+` > div.borderHandle`).call(o):n.selectAll(`#`+this.id()+` > div.borderHandle`).on(`.drag`,null);let s=this.borderLayoutObject();this.content().forEach(function(e,t){e._fixedLeft=s[this.sectionTypes()[t]].left,e._fixedTop=s[this.sectionTypes()[t]].top,e._fixedWidth=s[this.sectionTypes()[t]].width,e._fixedHeight=s[this.sectionTypes()[t]].height,e._dragHandles=[]},this),a.style(`left`,function(e){return e._fixedLeft+`px`}).style(`top`,function(e){return e._fixedTop+`px`}).style(`width`,function(e){return e._fixedWidth-r.gutter()+`px`}).style(`height`,function(e){return e._fixedHeight-r.gutter()+`px`}).each(function(e){e._placeholderElement.attr(`draggable`,r.designMode()).selectAll(`.dragHandle`).attr(`draggable`,r.designMode()),e.surfacePadding(r.surfacePadding()).resize()}),i.exit().each(function(e){e.target(null)}).remove(),this.getCellSizes(),n.selectAll(`#`+this.id()+` > div.borderHandle`).each(function(){let e=(0,t.select)(this);e.classed(`borderHandle_top`)?(e.style(`width`,r._cellSizes.width+`px`),e.style(`top`,r._cellSizes.topHeight-3+`px`)):e.classed(`borderHandle_right`)?(e.style(`left`,r._cellSizes.width-r._cellSizes.rightWidth+`px`),e.style(`top`,r._cellSizes.topHeight+3+`px`),e.style(`height`,r._cellSizes.rightHeight+`px`)):e.classed(`borderHandle_bottom`)?(e.style(`width`,r._cellSizes.width+`px`),e.style(`top`,r._cellSizes.height-r._cellSizes.bottomHeight-3+`px`)):e.classed(`borderHandle_left`)&&(e.style(`left`,r._cellSizes.leftWidth+`px`),e.style(`height`,r._cellSizes.leftHeight+`px`),e.style(`top`,r._cellSizes.topHeight+3+`px`))})}getCellSizes(){let e=this;e._cellSizes={};let n=this.element().node().getBoundingClientRect();e._cellSizes.width=n.width,e._cellSizes.height=n.height,this.element().selectAll(`#`+this.id()+` > div > div.border-cell`).each(function(){let n=(0,t.select)(this);if(typeof n.node==`function`){let t=n.node().getBoundingClientRect();n.classed(`border-cell-top`)?e._cellSizes.topHeight=t.height:n.classed(`border-cell-left`)?(e._cellSizes.leftWidth=t.width,e._cellSizes.leftHeight=t.height):n.classed(`border-cell-right`)?(e._cellSizes.rightWidth=t.width,e._cellSizes.rightHeight=t.height):n.classed(`border-cell-bottom`)&&(e._cellSizes.bottomHeight=t.height)}}),[`height`,`width`,`topHeight`,`bottomHeight`,`leftHeight`,`rightHeight`,`leftWidth`,`rightWidth`].forEach(function(t){e._cellSizes[t]=e._cellSizes[t]===void 0?0:e._cellSizes[t]})}postUpdate(e,t){let n=this;this.content().forEach(function(e){if(e._element.node()!==null&&e.widget()){let t=e.widget().getBBox(!1,!0),r=e.widget().getBBox(!0,!0);(t.width!==r.width||t.height!==r.height)&&n.lazyRender()}})}exit(e,t){this.content().forEach(e=>e.target(null)),super.exit(e,t)}};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`]});var WidgetDiv=class{_div;_overlay=!1;_overflowX=`visible`;_overflowY=`visible`;_widget;constructor(e){this._div=e}overlay(e){return arguments.length?(this._overlay=e,this):this._overlay}overflowX(e){return arguments.length?(this._overflowX=e,this._div.style(`overflow-x`,e),this):this._overflowX}overflowY(e){return arguments.length?(this._overflowY=e,this._div.style(`overflow-y`,e),this):this._overflowY}element(){return this._div}node(){return this._div.node()}widget(e){return arguments.length?(this._widget!==e&&(this._widget&&this._widget.target(null),this._widget=e,this._widget&&this._widget.target(this._div.node())),this):this._widget}resize(e){return this._widget&&(this._div.style(`width`,`${e.width}px`).style(`height`,`${e.height}px`),this._widget.resize(e)),this}async render(e,n,r){let i=this.overflowX();!this.overlay()&&i===`visible`&&(i=null);let a=this.overflowY();return!this.overlay()&&a===`visible`&&(a=null),this._div.style(`height`,this.overlay()?`0px`:null).style(`overflow-x`,i).style(`overflow-y`,a),this._widget?this._widget.renderPromise().then(i=>{if(e&&this._widget.visible()){let e=this._widget.getBBox();return e.width+=8,n!==void 0&&e.height>n&&(e.width+=t.Platform.getScrollbarWidth()),r!==void 0&&e.width>r&&(e.height+=t.Platform.getScrollbarWidth()),this.overlay()?e.height=0:e.height+=4,e}return e?{x:0,y:0,width:0,height:0}:void 0}):Promise.resolve(e?{x:0,y:0,width:0,height:0}:void 0)}},Border2=class extends t.HTMLWidget{_bodyElement;_topWA;_leftWA;_centerWA;_rightWA;_bottomWA;_topPrevOverflow;_leftPrevOverflow;_rightPrevOverflow;_bottomPrevOverflow;constructor(){super(),this._tag=`div`}enter(e,t){super.enter(e,t);let n=t.append(`header`);this._bodyElement=t.append(`div`).attr(`class`,`body`);let r=this._bodyElement.append(`div`).attr(`class`,`center`),i=this._bodyElement.append(`div`).attr(`class`,`lhs`),a=this._bodyElement.append(`div`).attr(`class`,`rhs`),o=t.append(`div`).attr(`class`,`footer`);this._topWA=new WidgetDiv(n),this._centerWA=new WidgetDiv(r),this._leftWA=new WidgetDiv(i),this._rightWA=new WidgetDiv(a),this._bottomWA=new WidgetDiv(o)}update(e,t){super.update(e,t),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(e){e&&e.target(null)}exit(e,t){this.targetNull(this.center()),this.targetNull(this.bottom()),this.targetNull(this.right()),this.targetNull(this.left()),this.targetNull(this.top()),super.exit(e,t)}swap(e,t){let n=this[e](),r=this[t]();return this.targetNull(n),this.targetNull(r),this[`_${e}WA`].widget(null),this[`_${t}WA`].widget(null),this[e](r),this[t](n),this}render(e){return super.render(t=>{this._topWA?this._topWA.widget(this.top()).overlay(this.topOverlay()).render(!0).then(async t=>{let n=await this._bottomWA.widget(this.bottom()).render(!0,void 0,this.width()),r=this.height()-(t.height+n.height),i=await this._leftWA.widget(this.left()).render(!0,r),a=await this._rightWA.widget(this.right()).render(!0,r);this.bottomHeight_exists()&&(n.height=this.bottomHeight());let o=this.width()-(i.width+a.width),s=this.height()-(t.height+n.height),c=this.centerOverflowX(),l=this.centerOverflowY(),u=[`auto`,`scroll`].indexOf(c)!==-1,d=[`auto`,`scroll`].indexOf(l)!==-1;(u||d)&&this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:o,height:s}).render(),this._bodyElement.style(`height`,`${s}px`);let f=[this._topWA.overflowX(this.topOverflowX()).overflowY(this.topOverflowY()).resize({width:this.width(),height:t.height}).render(),this._leftWA.overflowX(this.leftOverflowX()).overflowY(this.leftOverflowY()).resize({width:i.width,height:s}).render(),this._rightWA.overflowX(this.rightOverflowX()).overflowY(this.rightOverflowY()).resize({width:a.width,height:s}).render(),this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:o,height:s}).render(),this._bottomWA.overflowX(this.bottomOverflowX()).overflowY(this.bottomOverflowY()).resize({width:this.width(),height:n.height}).render()];Promise.all(f).then(t=>{e&&e(this)})}):e&&e(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});var Carousel=class extends t.HTMLWidget{_prevActive=0;_root;activeWidget(){return this.widgets()[this.active()]}enter(e,t){super.enter(e,t),this._root=t.append(`div`).attr(`id`,`${this.id()}_root`)}update(e,n){super.update(e,n);let r=this.active(),i=this.width();this._root.style(`width`,`${i}px`).style(`height`,`${this.height()}px`);let a=this._root.selectAll(`#${this.id()}_root > .carouselItem`).data(this.widgets(),e=>e.id()),o=a.enter().append(`div`).attr(`class`,`carouselItem`).each(function(e){e.target(this)}).merge(a).style(`left`,(e,t)=>`${(t-this._prevActive)*i}px`).style(`width`,`${i}px`);this._prevActive!==r&&(o.style(`display`,(e,t)=>t===this._prevActive||t===r?null:`none`).transition().duration(this.transitionDuration()).style(`left`,(e,t)=>`${(t-r)*i}px`).on(`end`,function(e,n){(0,t.select)(this).style(`display`,()=>n===r?null:`none`)}),this._prevActive=r),a.exit().each(function(e){e.target(null)}).remove()}exit(e,t){this.widgets().forEach(e=>e.target(null)),super.exit(e,t)}render(e){return super.render(t=>{if(!this.visible()||this.isDOMHidden())e&&e(t);else{let n=this.activeWidget();n&&n.resize(this.size()).render(n=>{e&&e(t)})}})}};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 p=Math.PI,m=2*p,h=1e-6,g=m-h;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(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>h)if(!(Math.abs(u*s-c*l)>h)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,m=r-o,g=s*s+c*c,_=f*f+m*m,v=Math.sqrt(g),y=Math.sqrt(d),b=i*Math.tan((p-Math.acos((g+d-_)/(2*v*y)))/2),x=b/y,S=b/v;Math.abs(x-1)>h&&(this._+=`L`+(e+x*l)+`,`+(t+x*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*m)+`,`+(this._x1=e+S*s)+`,`+(this._y1=t+S*c)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>h||Math.abs(this._y1-l)>h)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%m+m),d>g?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>h&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=p)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}};function constant_default(e){return function constant(){return e}}__name(constant_default,`default`);var _=Math.PI;_/2;var v=2*_,y={draw:function(e,t){var n=Math.sqrt(t/_);e.moveTo(n,0),e.arc(0,0,n,0,v)}},b={draw:function(e,t){var n=Math.sqrt(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},x=Math.sqrt(1/3),S=x*2,C={draw:function(e,t){var n=Math.sqrt(t/S),r=n*x;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},w=.8908130915292852,T=Math.sin(_/10)/Math.sin(7*_/10),E=Math.sin(v/10)*T,D=-Math.cos(v/10)*T,O={draw:function(e,t){var n=Math.sqrt(t*w),r=E*n,i=D*n;e.moveTo(0,-n),e.lineTo(r,i);for(var a=1;a<5;++a){var o=v*a/5,s=Math.cos(o),c=Math.sin(o);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*i,c*r+s*i)}e.closePath()}},k={draw:function(e,t){var n=Math.sqrt(t),r=-n/2;e.rect(r,r,n,n)}},A=Math.sqrt(3),j={draw:function(e,t){var n=-Math.sqrt(t/(A*3));e.moveTo(0,n*2),e.lineTo(-A*n,-n),e.lineTo(A*n,-n),e.closePath()}},M=-.5,N=Math.sqrt(3)/2,P=1/Math.sqrt(12),F=(P/2+1)*3,I={draw:function(e,t){var n=Math.sqrt(t/F),r=n/2,i=n*P,a=r,o=n*P+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(M*r-N*i,N*r+M*i),e.lineTo(M*a-N*o,N*a+M*o),e.lineTo(M*s-N*c,N*s+M*c),e.lineTo(M*r+N*i,M*i-N*r),e.lineTo(M*a+N*o,M*o-N*a),e.lineTo(M*s+N*c,M*c-N*s),e.closePath()}};function symbol_default(){var e=constant_default(y),t=constant_default(64),n=null;function symbol(){var r;if(n||=r=path(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+``||null}return symbol.type=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default(t),symbol):e},symbol.size=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),symbol):t},symbol.context=function(e){return arguments.length?(n=e??null,symbol):n},symbol}__name(symbol_default,`default`);var L=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},R=function d3_identity(e){return e},z=function d3_reverse(e){for(var t=[],n=0,r=e.length;n<r;n++)t[n]=e[r-n-1];return t},B=function d3_textWrapping(e,n){e.each(function(){var e=(0,t.select)(this),r=e.text().split(/\s+/).reverse(),i,a=[],o=1.2;e.attr(`y`);for(var s=parseFloat(e.attr(`dy`))||0,c=e.text(null).append(`tspan`).attr(`x`,0).attr(`dy`,s+`em`);i=r.pop();)a.push(i),c.text(a.join(` `)),c.node().getComputedTextLength()>n&&a.length>1&&(a.pop(),c.text(a.join(` `)),a=[i],c=e.append(`tspan`).attr(`x`,0).attr(`dy`,o+s+`em`).text(i))})},V=function d3_mergeLabels(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments[1],n=arguments[2],r=arguments[3],i=arguments[4];if((t===void 0?`undefined`:L(t))===`object`){if(t.length===0)return e;for(var a=t.length;a<e.length;a++)t.push(e[a]);return t}else if(typeof t==`function`){for(var o=[],s=e.length,c=0;c<s;c++)o.push(t({i:c,genLength:s,generatedLabels:e,domain:n,range:r,labelDelimiter:i}));return o}return e},H=function d3_linearLegend(e,t,n){var r=[];if(t.length>1)r=t;else for(var i=e.domain(),a=(i[i.length-1]-i[0])/(t-1),o=0;o<t;o++)r.push(i[0]+o*a);var s=r.map(n);return{data:r,labels:s,feature:function feature(t){return e(t)}}},U=function d3_quantLegend(e,t,n){var r=e.range().map(function(r){var i=e.invertExtent(r);return t(i[0])+` `+n+` `+t(i[1])});return{data:e.range(),labels:r,feature:R}},W=function d3_ordinalLegend(e){return{data:e.domain(),labels:e.domain(),feature:function feature(t){return e(t)}}},G=function d3_cellOver(e,t,n){e.call(`cellover`,n,t)},K=function d3_cellOut(e,t,n){e.call(`cellout`,n,t)},q=function d3_cellClick(e,t,n){e.call(`cellclick`,n,t)},J={d3_drawShapes:function d3_drawShapes(e,t,n,r,i,a){e===`rect`?t.attr(`height`,n).attr(`width`,r):e===`circle`?t.attr(`r`,i):e===`line`?t.attr(`x1`,0).attr(`x2`,r).attr(`y1`,0).attr(`y2`,0):e===`path`&&t.attr(`d`,a)},d3_addText:function d3_addText(e,t,n,r,i){t.append(`text`).attr(`class`,r+`label`);var a=e.selectAll(`g.`+r+`cell text.`+r+`label`).data(n).text(R);return i&&e.selectAll(`g.`+r+`cell text.`+r+`label`).call(B,i),a},d3_calcType:function d3_calcType(e,t,n,r,i,a){var o=e.invertExtent?U(e,i,a):e.ticks?H(e,n,i):W(e),s=e.range&&e.range()||e.domain();return o.labels=V(o.labels,r,e.domain(),s,a),t&&(o.labels=z(o.labels),o.data=z(o.data)),o},d3_filterCells:function d3_filterCells(e,t){var n=e.data.map(function(t,n){return{data:t,label:e.labels[n]}}).filter(t),r=n.map(function(e){return e.data}),i=n.map(function(e){return e.label});return e.data=e.data.filter(function(e){return r.indexOf(e)!==-1}),e.labels=e.labels.filter(function(e){return i.indexOf(e)!==-1}),e},d3_placement:function d3_placement(e,t,n,r,i,a){t.attr(`transform`,n),r.attr(`transform`,i),e===`horizontal`&&r.style(`text-anchor`,a)},d3_addEvents:function d3_addEvents(e,t){e.on(`mouseover.legend`,function(e){G(t,e,this)}).on(`mouseout.legend`,function(e){K(t,e,this)}).on(`click.legend`,function(e){q(t,e,this)})},d3_title:function d3_title(e,t,n,r){if(t!==``){e.selectAll(`text.`+n+`legendTitle`).data([t]).enter().append(`text`).attr(`class`,n+`legendTitle`),e.selectAll(`text.`+n+`legendTitle`).text(t),r&&e.selectAll(`text.`+n+`legendTitle`).call(B,r);var i=e.select(`.`+n+`legendCells`),a=e.select(`.`+n+`legendTitle`).nodes().map(function(e){return e.getBBox().height})[0],o=-i.nodes().map(function(e){return e.getBBox().x})[0];i.attr(`transform`,`translate(`+o+`,`+a+`)`)}},d3_defaultLocale:{format:t.format,formatPrefix:t.formatPrefix},d3_defaultFormatSpecifier:`.01f`,d3_defaultDelimiter:`to`};function color(){var e=(0,t.scaleLinear)(),n=`rect`,r=15,i=15,a=10,o=2,s=[5],c=void 0,l=[],u=``,d=!1,f=``,p=J.d3_defaultLocale,m=J.d3_defaultFormatSpecifier,h=10,g=`middle`,_=J.d3_defaultDelimiter,v=void 0,y=`vertical`,b=!1,x=void 0,S=void 0,C=(0,t.dispatch)(`cellover`,`cellout`,`cellclick`);function legend(w){var T=J.d3_calcType(e,b,s,l,p.format(m),_);w.selectAll(`g`).data([e]).enter().append(`g`).attr(`class`,u+`legendCells`),c&&J.d3_filterCells(T,c);var E=w.select(`.`+u+`legendCells`).selectAll(`.`+u+`cell`).data(T.data),D=E.enter().append(`g`).attr(`class`,u+`cell`);D.append(n).attr(`class`,u+`swatch`);var O=w.selectAll(`g.`+u+`cell `+n+`.`+u+`swatch`).data(T.data);J.d3_addEvents(D,C),E.exit().transition().style(`opacity`,0).remove(),O.exit().transition().style(`opacity`,0).remove(),O=O.merge(O),J.d3_drawShapes(n,O,i,r,a,x);var k=J.d3_addText(w,D,T.labels,u,v);E=D.merge(E);var A=k.nodes().map(function(e){return e.getBBox()}),j=O.nodes().map(function(e){return e.getBBox()});d?O.attr(`class`,function(e){return u+`swatch `+T.feature(e)}):n==`line`?O.style(`stroke`,T.feature):O.style(`fill`,T.feature);var M=void 0,N=void 0,P=g==`start`?0:g==`middle`?.5:1;y===`vertical`?(function(){var e=A.map(function(e,t){return Math.max(e.height,j[t].height)});M=function cellTrans(n,r){return`translate(0, `+((0,t.sum)(e.slice(0,r))+r*o)+`)`},N=function textTrans(e,t){return`translate( `+(j[t].width+j[t].x+h)+`, `+(j[t].y+j[t].height/2+5)+`)`}})():y===`horizontal`&&(M=function cellTrans(e,t){return`translate(`+t*(j[t].width+o)+`,0)`},N=function textTrans(e,t){return`translate(`+(j[t].width*P+j[t].x)+`,
|
|
2
|
-
`+(j[t].height+j[t].y+h+8)+`)`}),J.d3_placement(y,E,M,k,N,g),J.d3_title(w,f,u,S),E.transition().style(`opacity`,1)}return legend.scale=function(t){return arguments.length?(e=t,legend):e},legend.cells=function(e){return arguments.length?((e.length>1||e>=2)&&(s=e),legend):s},legend.cellFilter=function(e){return arguments.length?(c=e,legend):c},legend.shape=function(e,t){return arguments.length?((e==`rect`||e==`circle`||e==`line`||e==`path`&&typeof t==`string`)&&(n=e,x=t),legend):n},legend.shapeWidth=function(e){return arguments.length?(r=+e,legend):r},legend.shapeHeight=function(e){return arguments.length?(i=+e,legend):i},legend.shapeRadius=function(e){return arguments.length?(a=+e,legend):a},legend.shapePadding=function(e){return arguments.length?(o=+e,legend):o},legend.labels=function(e){return arguments.length?(l=e,legend):l},legend.labelAlign=function(e){return arguments.length?((e==`start`||e==`end`||e==`middle`)&&(g=e),legend):g},legend.locale=function(e){return arguments.length?(p=(0,t.formatLocale)(e),legend):p},legend.labelFormat=function(e){return arguments.length?(m=(0,t.formatSpecifier)(e),legend):legend.locale().format(m)},legend.labelOffset=function(e){return arguments.length?(h=+e,legend):h},legend.labelDelimiter=function(e){return arguments.length?(_=e,legend):_},legend.labelWrap=function(e){return arguments.length?(v=e,legend):v},legend.useClass=function(e){return arguments.length?((e===!0||e===!1)&&(d=e),legend):d},legend.orient=function(e){return arguments.length?(e=e.toLowerCase(),(e==`horizontal`||e==`vertical`)&&(y=e),legend):y},legend.ascending=function(e){return arguments.length?(b=!!e,legend):b},legend.classPrefix=function(e){return arguments.length?(u=e,legend):u},legend.title=function(e){return arguments.length?(f=e,legend):f},legend.titleWidth=function(e){return arguments.length?(S=e,legend):S},legend.textWrap=function(e){return arguments.length?(textWrap=e,legend):textWrap},legend.on=function(){var e=C.on.apply(C,arguments);return e===C?legend:e},legend}var Legend=class extends t.SVGWidget{_owner;_targetWidget;_targetWidgetMonitor;_legendOrdinal;_disabled=[];_symbolTypeMap={circle:y,cross:b,diamond:C,square:k,star:O,triangle:j,wye:I};constructor(e){super(),this._owner=e,this._drawStartPos=`origin`;let t=this;this._legendOrdinal=color().shape(`path`,symbol_default().type(y).size(150)()).shapePadding(10).shapeRadius(10).on(`cellclick`,function(e){t.onClick(e,this)}).on(`cellover`,e=>{t.onOver(e,this)}).on(`cellout`,e=>{t.onOut(e,this)})}isDisabled(e){return e===void 0?!1:typeof e==`string`?e.indexOf(`__`)===0||this._disabled.indexOf(e)>=0:e instanceof t.Database.Field?e.id().indexOf(`__`)===0||this._disabled.indexOf(e.id())>=0:this._disabled.indexOf(e)>=0}filteredFields(){switch(this.dataFamily()){case`2D`:return this.fields();case`ND`:return this.fields().filter(e=>!this.isDisabled(e))}return this.fields()}filteredColumns(){switch(this.dataFamily()){case`2D`:return this.columns();case`ND`:return this.columns().filter(e=>!this.isDisabled(e))}return this.columns()}filteredData(){switch(this.dataFamily()){case`2D`:return this.data().filter(e=>!this.isDisabled(e[0]));case`ND`:let e={},t=!1;return this.columns().forEach((n,r)=>{let i=this.isDisabled(n);e[r]=i,i&&(t=!0)}),t?this.data().map(t=>t.filter((t,n)=>!e[n])):this.data()}return this.data()}isRainbow(){let e=this.getWidget();return e&&e._palette&&e._palette.type()===`rainbow`}targetWidget(e){if(!arguments.length)return this._targetWidget;if(this._targetWidget=e,this._targetWidgetMonitor&&(this._targetWidgetMonitor.remove(),delete this._targetWidgetMonitor),this._targetWidget){let e=this;this._targetWidgetMonitor=this._targetWidget.monitor(function(t,n,r,i){switch(t){case`chart`:case`columns`:case`data`:case`paletteID`:e.lazyRender();break}})}return this}getWidget(){if(this._targetWidget)switch(this._targetWidget.classID()){case`composite_MultiChart`:return this._targetWidget.chart()}return this._targetWidget}getPalette(){let e=this.getWidget();if(e&&e._palette)switch(e._palette.type()){case`ordinal`:return t.Palette.ordinal(e._palette.id());case`rainbow`:return t.Palette.rainbow(e._palette.id())}return t.Palette.ordinal(`default`)}getPaletteType(){return this.getPalette().type()}fillColorFunc(){let e=this.getWidget();if(e&&e.fillColor)return e._palette&&e.paletteID&&e._palette.name!==e.paletteID()&&(e._palette=e._palette.switch(e.paletteID())),(t,n,r)=>e.fillColor(t,n,r);let n=t.Palette.ordinal(e&&e.paletteID&&e.paletteID()||`default`);return(e,t,r)=>n(t)}fillColor(e,t,n){return this.fillColorFunc()(e,t,n)}_g;enter(e,t){super.enter(e,t),this._g=t.append(`g`).attr(`class`,`legendOrdinal`)}calcMetaData(){let e=[],n=0,r=0,i=this.columns().length;if(this._targetWidget){let a=this.columns();switch(this.getPaletteType()){case`ordinal`:let o=this.fillColorFunc(),s=0;switch(this.dataFamily()){case`2D`:e=this.data().map(function(e,t){s=this.data()[t].slice(1,i).reduce((e,t)=>e+t,0);let a=this.isDisabled(e[0]);a||(n+=s);let c=e[0]+(!a&&this.showSeriesTotal()?` (${s})`:``),l=this.textSize(c);return r<l.width&&(r=l.width),[o(e,e[0],!1),e[0],c]},this);break;case`ND`:e=this.columns().filter(e=>e.indexOf(`__`)!==0).filter(function(e,t){return t>0}).map(function(e,t){s=this.data().reduce((e,n)=>e+n[t+1],0);let i=this.isDisabled(a[t+1]),c=e+(!i&&this.showSeriesTotal()?` (${s})`:``);i||(n+=s);let l=this.textSize(c);return r<l.width&&(r=l.width),[o(void 0,e,!1),e,c]},this);break;default:e=this.columns().map(function(e){return[o(void 0,e,!1),e]},this);break}break;case`rainbow`:let c=this.getPalette(),l=(0,t.format)(this.rainbowFormat()),u=this.getWidget(),d=this.rainbowBins(),f=u._dataMinWeight,p=u._dataMaxWeight,m=(p-f)/(d-1);e.push([c(f,f,p),l(f)]);for(let t=1;t<d-1;++t){let n=m*t;Math.floor(n)>parseInt(e[0][1])&&(n=Math.floor(n)),e.push([c(n,f,p),l(n)])}e.push([c(p,f,p),l(p)]);break}}return{dataArr:e,total:n,maxLabelWidth:r}}update(e,n){super.update(e,n);let{dataArr:r,maxLabelWidth:i,total:a}=this.calcMetaData(),o=this.shapeRadius(),s=this.radiusToSymbolSize(o),c=this.itemPadding();this.orientation()===`horizontal`&&(c+=i-o*2);let l=(0,t.scaleOrdinal)().domain(r.map(e=>e[1])).range(r.map(e=>e[0]));this._legendOrdinal.shape(`path`,symbol_default().type(this._symbolTypeMap[this.symbolType()]).size(s)()).orient(this.orientation()).title(this.title()).labelWrap(this.labelMaxWidth()).labelAlign(this.labelAlign()).shapePadding(c).scale(l).labels(e=>r[e.i][2]),this._g.call(this._legendOrdinal),this.updateDisabled(n,r);let u=this._g.select(`.legendCells`).node().getBBox(),d=Math.abs(u.x),f=Math.abs(u.y)+1;if(this.orientation()===`horizontal`){if(this.labelAlign()===`start`?d+=1:this.labelAlign()===`end`&&--d,this.width()>u.width){let e=this.width()-u.width;d+=e/2}}else if(this.orientation()===`vertical`&&(d+=1,this._containerSize.height>u.height)){let e=this.height()-u.height;f+=e/2}this._g.attr(`transform`,`translate(${d}, ${f})`),this.pos({x:0,y:0}),this._legendOrdinal.labelOffset(this.itemPadding());let p=this._g.selectAll(`.legendTotal`).data(r.length&&this.showLegendTotal()?[a]:[]),m=`Total: ${a}`,h=-d,g=u.height+this.itemPadding()+1;this.enableOverflowScroll(!1),this.enableOverflow(!0),p.enter().append(`text`).classed(`legendTotal`,!0).merge(p).attr(`transform`,`translate(${h}, ${g})`).text(m),p.exit().remove()}updateDisabled(e,t){e.style(`cursor`,`pointer`).selectAll(`path.swatch`).filter((e,n)=>n<t.length).style(`stroke`,(e,n)=>t[n][0]).style(`fill`,(e,n)=>this._disabled.indexOf(e)<0?t[n][0]:`white`)}postUpdate(e,t){let n;this._boundingBox&&(n=this._boundingBox.width,this._boundingBox.width=this._size.width),super.postUpdate(e,t),n!==void 0&&(this._boundingBox.width=n),this._parentRelativeDiv.style(`overflow`,`hidden`)}exit(e,t){super.exit(e,t)}radiusToSymbolSize(e){let t=e**2*Math.PI;switch(this.symbolType()){case`star`:return t*.45;case`triangle`:return t*.65;case`cross`:case`diamond`:case`wye`:return t*.75;case`circle`:return t;case`square`:return t*1.3}}onClick(e,t){switch(this.getPaletteType()){case`ordinal`:switch(this.dataFamily()){case`2D`:case`ND`:let t=this._disabled.indexOf(e);t<0?this._disabled.push(e):this._disabled.splice(t,1),this._owner.refreshColumns(),this._owner.refreshData(),this._owner.render();break}break}}onOver(e,t){if((0,r.instanceOfIHighlight)(this._owner))switch(this.getPaletteType()){case`ordinal`:switch(this.dataFamily()){case`2D`:case`ND`:this._disabled.indexOf(e)<0&&this._owner.highlightColumn(e);break}break}}onOut(e,t){if((0,r.instanceOfIHighlight)(this._owner))switch(this.getPaletteType()){case`ordinal`:switch(this.dataFamily()){case`2D`:case`ND`:this._owner.highlightColumn();break}break}}onDblClick(e,t){}onMouseOver(e,t){}_containerSize;resize(e){let t;if(this.fitToContent()){this._containerSize=e;let n=this.getBBox();e.width>n.width&&(n.width=e.width),e.height>n.height&&(n.height=e.height),t=super.resize.apply(this,[{...n}])}else t=super.resize.apply(this,arguments);return t}};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:e=>!e.isRainbow()}),Legend.prototype.publish(`rainbowBins`,8,`number`,`Number of rainbow bins`,null,{tags:[`Private`],disable:e=>!e.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:e=>e.orientation()===`vertical`});var Modal=class extends t.HTMLWidget{_widget;_relativeTarget;_fade;_modal;_modalHeader;_modalBody;_modalHeaderAnnotations;_modalHeaderCloseButton;_close;constructor(){super(),this._tag=`div`}closeModal(){this.visible(!1)}getRelativeTarget(){let e;return this.relativeTargetId()&&(e=document.getElementById(this.relativeTargetId()),e)?e:!e&&(e=this.locateAncestor(`layout_Grid`),e&&e.element)?e.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());let e=this._modal.node().getBoundingClientRect(),t=this._modalHeader.node().getBoundingClientRect();return this._modalBody.style(`height`,e.height-t.height+`px`).style(`width`,e.width),e}setFadePosition(e){this._fade.style(`top`,e.top+`px`).style(`left`,e.left+`px`).style(`width`,e.width+`px`).style(`height`,e.height+`px`)}setModalPosition(e){let t=this.setModalSize();if(this.fixedTop()!==null&&this.fixedLeft()!==null)this._modal.style(`top`,`calc(${this.fixedTop()} + ${e.top}px)`).style(`left`,`calc(${this.fixedLeft()} + ${e.left}px)`);else if(this.fixedHeight()!==null&&this.fixedWidth()!==null)this._modal.style(`top`,e.top+e.height/2-t.height/2+`px`).style(`left`,e.left+e.width/2-t.width/2+`px`);else if(this.minHeight()||this.minWidth()){let t=this._modal.node().getBoundingClientRect();this._modal.style(`top`,e.top+e.height/2-t.height/2+`px`).style(`left`,e.left+e.width/2-t.width/2+`px`)}}resize(e){return super.resize(),this._modal&&this.setModalSize(),this}resizeBodySync(e,t){let n=this._modalHeader.node().getBoundingClientRect();return this._modal.style(`width`,e+`px`).style(`height`,t+n.height+`px`).style(`min-width`,e+`px`).style(`min-height`,t+n.height+`px`),this._modalHeader.style(`width`,e+`px`),this._modalBody.style(`width`,e+`px`).style(`height`,t+`px`),this.minWidth(e+`px`).minHeight(t+n.height+`px`).resize({height:t+n.height,width:e})}enter(e,t){super.enter(e,t),this._fade=t.append(`div`).classed(`layout_Modal-fade`,!0).classed(`layout_Modal-fadeClickable`,this.enableClickFadeToClose()).classed(`layout_Modal-fade-hidden`,!this.showFade());let n=this.titleFontSize()*2;this._modal=t.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`,n+`px`),this._modalBody=this._modal.append(`div`).classed(`layout_Modal-body`,!0).style(`height`,`calc( 100% - ${n}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`,e=>{this.enableClickFadeToClose()&&this.closeModal()})}update(e,t){super.update(e,t),t.style(`display`,this.show()?null:`none`),this._fade.classed(`layout_Modal-fade-hidden`,!this.showFade()),this._relativeTarget=this.getRelativeTarget(),this.setModalSize();let n=this._relativeTarget.getBoundingClientRect();this.setFadePosition(n),this.setModalPosition(n),this.show()?(this._widget.target()||this._widget.target(this._modalBody.node()),this._widget.resize().render()):this._widget.target(null).render()}exit(e,t){this._widget&&this._widget.target(null),super.exit(e,t)}formattedTitle(){let e=this.title_exists()?this.title().trim():``;return e.length>0&&e.slice(0,1)===`(`&&e.slice(-1)===`)`?e.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`);var ChartPanel=class extends Border2{_legend=new Legend(this).enableOverflow(!0);_progressBar=new t.ProgressBar;_autoScale=!1;_resolutions={tiny:{width:100,height:100},small:{width:300,height:300}};_modal=new Modal;_highlight;_scale;_orig_size;_toggleInfo=new t.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 t.Text().text(this.description())).show(!0).render();let e=this._modal._close;this._modal._close=()=>{this._toggleInfo.selected(!1).render(),this._modal._close=e}}}).on(`mouseMove`,()=>{}).on(`mouseOut`,()=>{});_toggleData=new t.ToggleButton().faChar(`fa-table`).tooltip(`Data`).on(`click`,()=>{this.dataVisible(this._toggleData.selected()),this.render()});_buttonDownload=new t.Button().faChar(`fa-download`).tooltip(`Download`).on(`click`,()=>{this.downloadCSV()});_buttonDownloadImage=new t.Button().faChar(`fa-image`).tooltip(`Download Image`).on(`click`,()=>{this.downloadPNG()});_toggleLegend=new t.ToggleButton().faChar(`fa-list-ul`).tooltip(`Legend`).selected(!1).on(`click`,()=>{let e=this._toggleLegend.selected();this.legendPosition()===`bottom`?this.showBottom(e):this.legendPosition()===`right`&&this.showRight(e),this.legendVisible(e),this.render()});_spacer=new t.Spacer;_titleBar=new t.TitleBar().buttons([this._toggleData,this._buttonDownload,this._buttonDownloadImage,this._spacer,this._toggleLegend]);_carousel=new Carousel;_table=new n.Table;_widget;_hideLegendToggleList=[`dgrid_Table`,`dgrid2_Table`];constructor(){super(),this._tag=`div`}fields(e){return arguments.length?(super.fields(e),this._legend.fields(e),this.refreshFields(),this):super.fields()}refreshFields(){return this._widget.fields(this._legend.filteredFields()),this._table.fields(this._legend.filteredFields()),this}columns(e,t){return arguments.length?(super.columns(e,t),this._legend.columns(e,t),this.refreshColumns(),this):super.columns()}refreshColumns(){return this._widget.columns(this._legend.filteredColumns()),this._table.columns(this._legend.filteredColumns()),this}data(e){return arguments.length?(super.data(e),this._legend.data(e),this.refreshData(),this):super.data()}refreshData(){return this._widget.data(this._legend.filteredData()),this._table.data(this._legend.filteredData()),this}highlight(e){return arguments.length?(this._highlight=e,this):this._highlight}startProgress(){this._progressBar.start()}finishProgress(){this._progressBar.finish()}buttons(e){return arguments.length?(this._titleBar.buttons(e),this):this._titleBar.buttons()}downloadCSV(){let e=this.downloadTitle()?this.downloadTitle():this.title()?this.title():`data`,n=this.downloadTimestampSuffix()?`_`+t.Utility.timestamp():``;return t.Utility.downloadString(`CSV`,this._widget.export(`CSV`),e+n),this}downloadPNG(){let e=this.widget();return e instanceof t.SVGWidget&&(this.legendVisible()?e.downloadPNG(this.title(),void 0,this._legend):e.downloadPNG(this.title())),this}highlightColumn(e){if(e){let n=`series-${this.cssTag(e)}`;this._centerWA.element().selectAll(`.series`).each(function(){let e=(0,t.select)(this),r=e.classed(n);e.classed(`highlight`,r).classed(`lowlight`,!r)})}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(e,t){super.enter(e,t),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(e,t),this.setOrigSize()}preUpdateTiny(e){e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,`none`)}preUpdateSmall(e){let t=this._orig_size.width/this._resolutions.small.width,n=this._orig_size.height/this._resolutions.small.height;this._scale=Math.min(t,n);let r=this._scale===t;this.size({width:r?this._resolutions.small.width:this._orig_size.width*(1/this._scale),height:r?this._orig_size.height*(1/this._scale):this._resolutions.small.height}),e.select(`div.title-icon`).style(`position`,`static`),e.selectAll(`lhs`).style(`display`,`none`),e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,``),e.selectAll(`div.data-count`).style(`visibility`,`hidden`),e.style(`transform`,`scale(${this._scale})`)}preUpdateRegular(e){e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,``),e.selectAll(`div.data-count`).style(`visibility`,`hidden`),e.select(`div.title-icon`).style(`position`,`static`),e.style(`transform`,`translate(0px,0px) scale(1)`)}_prevdataVisible;_prevlegendVisible;_prevLegendPosition;_prevChartDataFamily;_prevChart;_prevButtons;update(e,t){super.update(e,t)}preUpdate(e,n){switch(super.preUpdate(e,n),this._prevLegendPosition!==this.legendPosition()&&(this._legend.target()!==null&&this._legend.target(null),this._prevLegendPosition===void 0?this[this.legendPosition()](this._legend):this.swap(this._prevLegendPosition,this.legendPosition()),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)),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(n);break;case`small`:this.preUpdateSmall(n);break;case`regular`:this.preUpdateRegular(n);break}let r=this._widget.classID()===`composite_MultiChart`?this._widget.chart():this._widget;if(this._legend.dataFamily(r._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(n.style(`box-shadow`,this.highlight()?`inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}`:`none`),this._hideLegendToggleList.indexOf(r.classID())===-1?(this._spacer.visible(!0),this._toggleLegend.visible(!0)):(this._spacer.visible(!1),this._toggleLegend.visible(!1)),this._prevChart!==r){this._prevChart=r;let e=r?r._titleBar||r._iconBar:void 0;if(e&&e instanceof t.IconBar){this._prevButtons=this._prevButtons||[...this.buttons()];let n=[...e.buttons(),new t.Spacer,...this._prevButtons];e.buttons([]).render(),this.buttons(n)}else this._prevButtons&&this.buttons(this._prevButtons)}let i=[];this.dataButtonVisible()||i.push(this._toggleData),this.downloadButtonVisible()||i.push(this._buttonDownload),this.downloadImageButtonVisible()||i.push(this._buttonDownloadImage),this.legendButtonVisible()||i.push(this._toggleLegend),this._buttonDownloadImage.enabled(this.widget()instanceof t.SVGWidget),this._titleBar.hiddenButtons(i).visible(this.titleVisible()),this.topOverlay(this.titleOverlay()||!this.titleVisible())}postUpdate(e,t){switch(super.postUpdate(e,t),this.getResponsiveMode()){case`tiny`:this.postUpdateTiny(t);break;case`small`:this.postUpdateSmall(t);break;case`regular`:this.postUpdateRegular(t);break}}postUpdateTiny(e){e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,`none`),e.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),e.style(`transform`,`translate(0px,0px) scale(1)`);let t=e.selectAll(`div.title-icon`),n=t.node(),r=e.node().parentElement.getBoundingClientRect();if(n){let n=t.node().getBoundingClientRect(),i=r.height/2;t.style(`position`,`absolute`).style(`left`,`calc(50% - ${n.width/2}px)`).style(`top`,`${i-n.height/2}px`),e.selectAll(`div.data-count`).style(`position`,`absolute`).style(`left`,`calc(50% + ${n.width/2}px)`).style(`top`,`${i-n.height/2}px`)}}postUpdateSmall(e){e.selectAll(`lhs`).style(`display`,`none`),e.selectAll(`div.title-icon`).style(`position`,`static`),e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,``),e.selectAll(`div.data-count`).style(`visibility`,`hidden`);let t=e.node().getBoundingClientRect(),n=e.node().parentElement.getBoundingClientRect();e.style(`transform`,`translate(${n.x-t.x}px, ${n.y-t.y}px) scale(${this._scale})`)}postUpdateRegular(e){e.selectAll(`div.title-icon`).style(`position`,`static`),e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,``),e.selectAll(`div.data-count`).style(`visibility`,`hidden`)}exit(e,t){this._progressBar.exit(e,t),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(e,t)}click(e,t,n){}dblclick(e,t,n){}vertex_click(e,t,n,r){r&&r.vertex}vertex_dblclick(e,t,n,r){r&&r.vertex}edge_click(e,t,n,r){r&&r.edge}edge_dblclick(e,t,n,r){r&&r.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(e){if(!arguments.length)return this._widget;this._carousel.widgets([e,this._table]),this._widget=e,this._widget.fields(this._legend.filteredFields()).data(this._legend.filteredData());let t=this,n=this._widget;return n.click=function(){t.click.apply(t,arguments)},n.dblclick=function(){t.dblclick.apply(t,arguments)},n.vertex_click=function(){t.vertex_click.apply(t,arguments)},n.vertex_dblclick=function(){t.vertex_dblclick.apply(t,arguments)},n.edge_click=function(){t.edge_click.apply(t,arguments)},n.edge_dblclick=function(){t.edge_dblclick.apply(t,arguments)},this};var FlexGrid=class extends t.HTMLWidget{constructor(){super()}enter(e,n){super.enter(e,n),(0,t.select)(e.parentNode).style(`height`,`100%`).style(`width`,`100%`)}update(e,t){super.update(e,t);let n=this,r=[];this.updateFlexParent(t);let i=t.selectAll(`.FlexGrid-list-item`).data(this.widgets(),e=>e.id());i.enter().append(`div`).classed(`FlexGrid-list-item`,!0).each(function(e){e.target(this)}).merge(i).style(`min-height`,this.itemMinHeight()+`px`).style(`min-width`,this.itemMinWidth()+`px`).style(`flex-basis`,(e,t)=>{let n=this.widgetsFlexBasis()[t];return n===void 0?this.flexBasis():n}).style(`flex-grow`,(e,t)=>{let n=this.widgetsFlexGrow()[t];return n===void 0?this.flexGrow():n}).style(`border-width`,this.borderWidth()+`px`).style(`border-color`,this.itemBorderColor()).each(function(){this.firstChild.style.display=`none`}).each(function(){let e=this.getBoundingClientRect();r.push([e.width,e.height])}).each(function(e,t){this.firstChild.style.display=`block`,e.resize({width:r[t][0]-2*n.borderWidth(),height:r[t][1]-2*n.borderWidth()})}),i.exit().remove()}exit(e,t){super.exit(e,t)}updateFlexParent(e){e.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:e=>e.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 Y=__toESM(__commonJSMin(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=r():n.GridList=r()})(e,function(){var GridList=function(e,t){for(var n in this._options=t,this.defaults)this._options.hasOwnProperty(n)||(this._options[n]=this.defaults[n]);this.items=e,this._adjustSizeOfItems(),this.generateGrid()};GridList.cloneItems=function(e,t){var n,r;for(t===void 0&&(t=[]),n=0;n<e.length;n++)for(r in t[n]||(t[n]={}),e[n])t[n][r]=e[n][r];return t},GridList.prototype={defaults:{lanes:5,direction:`horizontal`},toString:function(){var e=this.grid.length,t=`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/common"),require("@hpcc-js/dgrid2"),require("@hpcc-js/api")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/common`,`@hpcc-js/dgrid2`,`@hpcc-js/api`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/layout`]={},e[`@hpcc-js/common`],e[`@hpcc-js/dgrid2`],e[`@hpcc-js/api`]))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.create,a=Object.defineProperty,__name=(e,t)=>a(e,`name`,{value:t,configurable:!0}),o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__copyProps=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},__toESM=(e,t,n)=>(n=e==null?{}:i(c(e)),__copyProps(t||!e||!e.__esModule||!l.call(e,`default`)?a(n,`default`,{value:e,enumerable:!0}):n,e)),u=`@hpcc-js/layout`,d=`3.6.8`,f=`3.32.0`,AbsoluteSurface=class extends t.HTMLWidget{constructor(){super(),this._tag=`div`}enter(e,t){super.enter(e,t)}update(e,t){super.update(e,t);let n=0,r=0,i=this.clientWidth(),a=this.clientHeight();switch(this.units()){case`pixels`:n=this.widgetX(),r=this.widgetY(),i=this.widgetWidth()===``?i-n:Number(this.widgetWidth()),a=this.widgetHeight()===``?a-r:Number(this.widgetHeight());break;case`percent`:n=this.widgetX()*i/100,r=this.widgetY()*a/100,i=this.widgetWidth()===``?i-n:Number(this.widgetWidth())*i/100,a=this.widgetHeight()===``?a-r:Number(this.widgetHeight())*a/100}t.style(`opacity`,this.opacity());let o=t.selectAll(`#`+this._id+` > .placeholder`).data(this.widget()?[this.widget()]:[],function(e){return e._id});o.enter().append(`div`).attr(`class`,`placeholder`).each(function(e){e.target(this)}).merge(o).style(`left`,n+`px`).style(`top`,r+`px`).style(`width`,i+`px`).style(`bottom`,a+`px`).each(function(e){e.resize({width:i,height:a})}),o.exit().each(function(e){e.target(null)}).remove()}exit(e,t){this.widget()&&this.widget().target(null),super.exit(e,t)}};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`);var Accordion=class extends t.HTMLWidget{_isClosed;titleSpan;iconDiv;ul;icon;constructor(){super(),this._tag=`div`,this._isClosed=!1}pushListItem(e,t=!1,n=!1){let r=this.content();return e._protected=n,t?r.unshift(e):r.push(e),this.content(r),this}clearListItems(){let e=[];for(let t in this.content())this.content()[t]._protected&&e.push(this.content()[t]);return this.content(e),this}collapseClick(e){e.classed(`closed`)?(this._isClosed=!1,e.classed(`open`,!0),e.classed(`closed`,!1)):(this._isClosed=!0,e.classed(`open`,!1),e.classed(`closed`,!0))}enter(e,n){super.enter(e,n);let r=this;this._isClosed=this.defaultCollapsed(),n.classed(this._isClosed?`closed`:`open`,!0),this.titleSpan=n.append(`span`).classed(`collapsible-title`,!0),this.iconDiv=n.append(`div`).classed(`collapsible-icon`,!0),this.ul=n.append(`ul`),this.icon=new t.FAChar().size({height:24,width:24}).target(this.iconDiv.node()),this.iconDiv.on(`click`,function(){r.collapseClick(n),r.render()}),this.titleSpan.on(`click`,function(){r.collapseClick(n),r.render()})}update(e,t){super.update(e,t);let n=this;this.titleSpan.text(n.title().length>0?n.title()+``:`Accordion [`+n._id+`]`);let r=this.ul.selectAll(`#`+n._id+` > ul > li`).data(this.content(),function(e){return e._id});r.enter().append(function(e){let t=document.createElement(`li`);if(e._target===null){let r=e.size();if(r.width===0||r.height===0){let t=n.size();e.size({width:t.width,height:t.width})}e.target(t)}else return e._target;return t}),r.exit().remove(),this.icon.text_colorFill(this.titleFontColor()).char(this._isClosed?this.closedIcon():this.openIcon()).render()}exit(e,t){super.exit(e,t)}};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`]});var Surface=class extends t.HTMLWidget{_surfaceButtons;constructor(){super(),this._tag=`div`,this._surfaceButtons=[]}widgetSize(e,t){let n=this.clientWidth(),r=this.clientHeight();return this.title()&&(r-=this.calcHeight(e)),r-=this.calcFrameHeight(t),n-=this.calcFrameWidth(t),{width:n,height:r}}enter(e,t){super.enter(e,t)}update(e,n){super.update(e,n);let r=this;n.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());let i=n.selectAll(`.surfaceTitle`).data(this.title()?[this.title()]:[]);i.enter().insert(`h3`,`div`).attr(`class`,`surfaceTitle`).merge(i).text(function(e){return e}).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),i.exit().remove();let a=n.select(`.surfaceTitle`).append(`div`).attr(`class`,`html-button-container`).selectAll(`.surface-button`).data(this.buttonAnnotations());a.enter().append(`button`).classed(`surface-button`,!0).each(function(e,n){let i=r._surfaceButtons[n]=(0,t.select)(this).attr(`class`,`surface-button`+(e.class?` `+e.class:``)).attr(`id`,e.id).style(`padding`,e.padding).style(`width`,e.width).style(`height`,e.height).style(`cursor`,`pointer`);e.font===`FontAwesome`?i.style(`background`,`transparent`).style(`border`,`none`).on(`click`,function(e){r.click(e)}).append(`i`).attr(`class`,`fa`).text(function(){return e.label}):i.text(function(){return e.label}).on(`click`,function(e){r.click(e)})}),a.exit().each(function(e,n){let i=(0,t.select)(this);delete r._surfaceButtons[n],i.remove()});let o=n.selectAll(`#`+this._id+` > .surfaceWidget`).data(this.widget()?[this.widget()]:[],function(e){return e._id});o.enter().append(`div`).attr(`class`,`surfaceWidget`).each(function(e){(0,t.select)(r.element().node().parentElement).classed(`content-icon content-icon-`+e.classID().split(`_`)[1],!0),e.target(this)}).merge(o).style(`padding`,this.surfacePadding_exists()?this.surfacePadding()+`px`:null).each(function(e){let i=r.widgetSize(n.select(`h3`),(0,t.select)(this));i.width<0&&(i.width=0),i.height<0&&(i.height=0),e.resize({width:i.width,height:i.height})}),o.exit().each(function(e){e.target(null)}).remove()}exit(e,t){this.widget()&&this.widget().target(null),super.exit(e,t)}click(e){}};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:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleFontSize`,null,`number`,`Title Font Size (px)`,null,{tags:[`Advanced`],disable:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleFontColor`,null,`html-color`,`Title Font Color`,null,{tags:[`Advanced`],disable:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleFontFamily`,null,`string`,`Title Font Family`,null,{tags:[`Advanced`],disable:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleFontBold`,!0,`boolean`,`Enable Bold Title Font`,null,{tags:[`Advanced`],disable:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleBackgroundColor`,null,`html-color`,`Title Background Color`,null,{tags:[`Advanced`],disable:e=>!e.title()}),Surface.prototype.publish(`surfaceTitleAlignment`,`center`,`set`,`Title Alignment`,[`left`,`right`,`center`],{tags:[`Basic`],disable:e=>!e.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`]});var Cell=class extends Surface{_indicateTheseIds;constructor(){super(),this._indicateTheseIds=[]}indicateTheseIds(e){return arguments.length?(this._indicateTheseIds=e,this):this._indicateTheseIds}enter(e,t){super.enter(e,t);let n=this;t.classed(`layout_Surface`,!0).on(`mouseenter`,function(){n.onMouseEnter()}).on(`mouseleave`,function(){n.onMouseLeave()})}update(e,t){super.update(e,t)}onMouseEnter(){let e=this.indicateTheseIds(),n=this.indicatorOpacity(),r=this.indicatorBorderColor(),i=this.indicatorGlowColor();for(let a=0;a<e.length;a++){let o=(0,t.select)(`#`+e[a]),s=o.datum();o&&s&&o.append(`div`).attr(`class`,`update-indicator`).style(`width`,s.width()+`px`).style(`height`,s.height()+`px`).style(`opacity`,n).style(`border-color`,r).style(`-webkit-box-shadow`,`inset 0px 0px 30px 0px `+i).style(`-moz-box-shadow`,`inset 0px 0px 30px 0px `+i).style(`box-shadow`,`inset 0px 0px 30px 0px `+i)}}onMouseLeave(){let e=this.indicateTheseIds();for(let n=0;n<e.length;n++)(0,t.selectAll)(`#`+e[n]+` > 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`]});var Border=class extends t.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(e){if(this._watch===void 0&&(this._watch={}),this._watch[e.id()]&&(this._watch[e.id()].remove(),delete this._watch[e.id()]),e){let t=this;this._watch[e.id()]=e.monitor(function(e,n,r){r!==n&&t.lazyPostUpdate()})}}lazyPostUpdate=t.Utility.debounce(function(){this.postUpdate()},100);applyLayoutType(){let e=this.borderLayoutObject();this.content().forEach(function(t,n){t._fixedLeft=e[this.sectionTypes()[n]].left,t._fixedTop=e[this.sectionTypes()[n]].top,t._fixedWidth=e[this.sectionTypes()[n]].width,t._fixedHeight=e[this.sectionTypes()[n]].height,t._dragHandles=this.cellSpecificDragHandles(this.sectionTypes()[n])},this)}cellSpecificDragHandles(e){switch(e){case`top`:return[`s`];case`right`:return[`w`];case`bottom`:return[`n`];case`left`:return[`e`];case`center`:return[]}}borderLayoutObject(e){let t={},n=this,r,i,a,o,s,c,l,u,d=this.target().getBoundingClientRect();d.top,d.left,d.bottom,d.right,this.target()instanceof SVGElement?(parseFloat(this.target().getAttribute(`width`)),parseFloat(this.target().getAttribute(`height`))):(d.width,d.height),this.sectionTypes().indexOf(`top`)!==-1&&(r=this.topSize(),i=this.topPercentage(),this._shrinkWrapBoxes.top!==void 0&&(r=this._shrinkWrapBoxes.top.height+this.gutter(),i=0)),this.sectionTypes().indexOf(`bottom`)!==-1&&(a=this.bottomSize(),o=this.bottomPercentage(),this._shrinkWrapBoxes.bottom!==void 0&&(a=this._shrinkWrapBoxes.bottom.height+this.gutter(),o=0)),this.sectionTypes().indexOf(`left`)!==-1&&(s=this.leftSize(),c=this.leftPercentage(),this._shrinkWrapBoxes.left!==void 0&&(s=this._shrinkWrapBoxes.left.width+this.gutter(),c=0)),this.sectionTypes().indexOf(`right`)!==-1&&(l=this.rightSize(),u=this.rightPercentage(),this._shrinkWrapBoxes.right!==void 0&&(l=this._shrinkWrapBoxes.right.width+this.gutter(),u=0));let f=_sectionPlacementObject({width:{px:0,"%":100},height:{px:r,"%":i},top:{px:0,"%":0},left:{px:0,"%":0}}),p=_sectionPlacementObject({width:{px:0,"%":100},height:{px:a,"%":o},top:{px:0,"%":100},left:{px:0,"%":0}});p.top-=p.height;let m=_sectionPlacementObject({width:{px:s,"%":c},height:{px:-f.height-p.height,"%":100},top:{px:f.height,"%":0},left:{px:0,"%":0}}),h=_sectionPlacementObject({width:{px:l,"%":u},height:{px:-f.height-p.height,"%":100},top:{px:f.height,"%":0},left:{px:0,"%":100}});h.left-=h.width;let g=_sectionPlacementObject({width:{px:-h.width-m.width,"%":100},height:{px:-f.height-p.height,"%":100},top:{px:f.height,"%":0},left:{px:m.width,"%":0}});return t.top=f,t.bottom=p,t.right=h,t.left=m,t.center=g,t;function _sectionPlacementObject(e){return e.width.px=e.width.px===void 0?0:e.width.px,e.width[`%`]=e.width[`%`]===void 0?0:e.width[`%`],e.height.px=e.height.px===void 0?0:e.height.px,e.height[`%`]=e.height[`%`]===void 0?0:e.height[`%`],{width:e.width.px+e.width[`%`]/100*n.width(),height:e.height.px+e.height[`%`]/100*n.height(),top:e.top.px+e.top[`%`]/100*n.height()+n.gutter()/2,left:e.left.px+e.left[`%`]/100*n.width()+n.gutter()/2}}}clearContent(e){if(!e)this.content().forEach(function(e){return e.target(null),!1}),(0,t.select)(`#`+this.id()+` > div.borderHandle`).classed(`borderHandleDisabled`,!0),delete this._watch,this.content([]),this.sectionTypes([]);else{let n=this.sectionTypes().indexOf(e);n>=0&&(this._watch&&this.content()[n]&&delete this._watch[this.content()[n].id()],this.content()[n].target(null),(0,t.select)(`#`+this.id()+` > div.borderHandle_`+e).classed(`borderHandleDisabled`,!0),this.content().splice(n,1),this.sectionTypes().splice(n,1))}}hasContent(e,t,n){return this.sectionTypes().indexOf(e)>=0}setContent(e,t,n){if(this.clearContent(e),n=n===void 0?``:n,t){let r=new Cell().surfaceBorderWidth(0).widget(t).title(n);this.watchWidget(t),this.content().push(r),this.sectionTypes().push(e)}return this}getCell(e){let t=this.sectionTypes().indexOf(e);return t>=0?this.content()[t]:null}getContent(e){let t=this.sectionTypes().indexOf(e);return t>=0?this.content()[t].widget():null}setLayoutOffsets(){this._offsetX=this._element.node().getBoundingClientRect().left+this.gutter()/2,this._offsetY=this._element.node().getBoundingClientRect().top+this.gutter()/2}dragStart(e){let n=(0,t.d3Event)();n.sourceEvent.stopPropagation();let r=this;this._dragCell=e,this._dragCellStartSize=this[e+`Size`](),this[e+`ShrinkWrap`]()&&(this[e+`Percentage`](0),this[e+`ShrinkWrap`](!1));let i=(0,t.select)(`#`+r.id()+` > div.borderHandle_`+e);r._handleTop=parseFloat(i.style(`top`).split(`px`)[0]),r._handleLeft=parseFloat(i.style(`left`).split(`px`)[0]),this._dragPrevX=n.sourceEvent.clientX,this._dragPrevY=n.sourceEvent.clientY}dragTick(e){let n=this,r=(0,t.d3Event)(),i=this._dragPrevX-r.sourceEvent.clientX,a=this._dragPrevY-r.sourceEvent.clientY;switch(e){case`top`:case`bottom`:_moveHandles(e,a);break;case`right`:case`left`:_moveHandles(e,i)}function _moveHandles(e,r){if(r===0)return;let i=(0,t.selectAll)(`#`+n.id()+` > div.borderHandle`),a=(0,t.select)(`#`+n.id()+` > div.borderHandle_`+e);a.classed(`borderHandle_top`)?(a.style(`top`,n._handleTop-r+`px`),n._cellSizes.topHeight=n._handleTop-r,n._cellSizes.leftHeight=n._cellSizes.height,n._cellSizes.leftHeight-=n._cellSizes.topHeight,n._cellSizes.leftHeight-=n._cellSizes.bottomHeight,n._cellSizes.rightHeight=n._cellSizes.leftHeight):a.classed(`borderHandle_right`)?(a.style(`left`,n._handleLeft-r+`px`),n._cellSizes.rightWidth=n._cellSizes.width-n._handleLeft+r):a.classed(`borderHandle_bottom`)?(a.style(`top`,n._handleTop-r+`px`),n._cellSizes.bottomHeight=n._cellSizes.height-n._handleTop+r,n._cellSizes.leftHeight=n._cellSizes.height,n._cellSizes.leftHeight-=n._cellSizes.bottomHeight,n._cellSizes.leftHeight-=n._cellSizes.topHeight,n._cellSizes.rightHeight=n._cellSizes.leftHeight):a.classed(`borderHandle_left`)&&(a.style(`left`,n._handleLeft-r+`px`),n._cellSizes.leftWidth=n._handleLeft-r),i.each(function(){let e=(0,t.select)(this);e.classed(`borderHandle_top`)?(e.style(`width`,n._cellSizes.width+`px`),e.style(`top`,n._cellSizes.topHeight-3+`px`)):e.classed(`borderHandle_right`)?(e.style(`left`,n._cellSizes.width-n._cellSizes.rightWidth+`px`),e.style(`top`,n._cellSizes.topHeight+3+`px`),e.style(`height`,n._cellSizes.rightHeight+`px`)):e.classed(`borderHandle_bottom`)?(e.style(`width`,n._cellSizes.width+`px`),e.style(`top`,n._cellSizes.height-n._cellSizes.bottomHeight-3+`px`)):e.classed(`borderHandle_left`)&&(e.style(`left`,n._cellSizes.leftWidth+`px`),e.style(`height`,n._cellSizes.leftHeight+`px`),e.style(`top`,n._cellSizes.topHeight+3+`px`))})}}dragEnd(e){if(e){let n=(0,t.d3Event)(),r=this._dragPrevX-n.sourceEvent.clientX,i=this._dragPrevY-n.sourceEvent.clientY;switch(e){case`top`:i!==0&&(this.topPercentage(0),this.topSize(this.topSize()===0?this.getContent(`top`).getBBox().height-i:this.topSize()-i));break;case`right`:r!==0&&(this.rightPercentage(0),this.rightSize(this.rightSize()===0?this.getContent(`right`).getBBox().width+r:this.rightSize()+r));break;case`bottom`:i!==0&&(this.bottomPercentage(0),this.bottomSize(this.bottomSize()===0?this.getContent(`bottom`).getBBox().height+i:this.bottomSize()+i));break;case`left`:r!==0&&(this.leftPercentage(0),this.leftSize(this.leftSize()===0?this.getContent(`left`).getBBox().width-r:this.leftSize()-r))}this._dragPrevX=n.sourceEvent.clientX,this._dragPrevY=n.sourceEvent.clientY}this.render()}size(e){let n=t.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`),n}enter(e,n){super.enter(e,n);let r=this;n.style(`position`,`relative`),this.contentDiv=n.append(`div`).classed(`border-content`,!0),this._scrollBarWidth=t.Platform.getScrollbarWidth(),this._borderHandles=[`top`,`left`,`right`,`bottom`],n.selectAll(`div.borderHandle`).data(this._borderHandles).enter().append(`div`).classed(`borderHandle`,!0).each(function(e){(0,t.select)(this).classed(`borderHandle_`+e,!0).classed(`borderHandleDisabled`,r.getContent(e)===null)})}update(e,n){super.update(e,n),this._sectionTypeArr=this.sectionTypes();let r=this;n.classed(`design-mode`,this.designMode()),this.setLayoutOffsets();let i=this.contentDiv.selectAll(`.cell_`+this._id).data(this.content(),function(e){return e._id}),a=i.enter().append(`div`).classed(`cell_`+this._id,!0).style(`position`,`absolute`).each(function(e,n){(0,t.select)(this).classed(`border-cell border-cell-`+r._sectionTypeArr[n],!0),e.target(this),(0,t.select)(`#`+r.id()+` > div.borderHandle_`+r._sectionTypeArr[n]).classed(`borderHandleDisabled`,!1)}).merge(i);a.each(function(e,t){let n=r.sectionTypes()[t];r[n+`ShrinkWrap`]!==void 0&&r[n+`ShrinkWrap`]()?(e.render(),r._shrinkWrapBoxes[n]=e.widget().getBBox(!0)):delete r._shrinkWrapBoxes[n]});let o=(0,t.drag)().on(`start`,function(e,t){r.dragStart.call(r,e,t)}).on(`drag`,function(e,t){r.dragTick.call(r,e,t)}).on(`end`,function(e,t){r.dragEnd.call(r,e,t)});this.designMode()?n.selectAll(`#`+this.id()+` > div.borderHandle`).call(o):n.selectAll(`#`+this.id()+` > div.borderHandle`).on(`.drag`,null);let s=this.borderLayoutObject();this.content().forEach(function(e,t){e._fixedLeft=s[this.sectionTypes()[t]].left,e._fixedTop=s[this.sectionTypes()[t]].top,e._fixedWidth=s[this.sectionTypes()[t]].width,e._fixedHeight=s[this.sectionTypes()[t]].height,e._dragHandles=[]},this),a.style(`left`,function(e){return e._fixedLeft+`px`}).style(`top`,function(e){return e._fixedTop+`px`}).style(`width`,function(e){return e._fixedWidth-r.gutter()+`px`}).style(`height`,function(e){return e._fixedHeight-r.gutter()+`px`}).each(function(e){e._placeholderElement.attr(`draggable`,r.designMode()).selectAll(`.dragHandle`).attr(`draggable`,r.designMode()),e.surfacePadding(r.surfacePadding()).resize()}),i.exit().each(function(e){e.target(null)}).remove(),this.getCellSizes(),n.selectAll(`#`+this.id()+` > div.borderHandle`).each(function(){let e=(0,t.select)(this);e.classed(`borderHandle_top`)?(e.style(`width`,r._cellSizes.width+`px`),e.style(`top`,r._cellSizes.topHeight-3+`px`)):e.classed(`borderHandle_right`)?(e.style(`left`,r._cellSizes.width-r._cellSizes.rightWidth+`px`),e.style(`top`,r._cellSizes.topHeight+3+`px`),e.style(`height`,r._cellSizes.rightHeight+`px`)):e.classed(`borderHandle_bottom`)?(e.style(`width`,r._cellSizes.width+`px`),e.style(`top`,r._cellSizes.height-r._cellSizes.bottomHeight-3+`px`)):e.classed(`borderHandle_left`)&&(e.style(`left`,r._cellSizes.leftWidth+`px`),e.style(`height`,r._cellSizes.leftHeight+`px`),e.style(`top`,r._cellSizes.topHeight+3+`px`))})}getCellSizes(){let e=this;e._cellSizes={};let n=this.element().node().getBoundingClientRect();e._cellSizes.width=n.width,e._cellSizes.height=n.height,this.element().selectAll(`#`+this.id()+` > div > div.border-cell`).each(function(){let n=(0,t.select)(this);if(typeof n.node==`function`){let t=n.node().getBoundingClientRect();n.classed(`border-cell-top`)?e._cellSizes.topHeight=t.height:n.classed(`border-cell-left`)?(e._cellSizes.leftWidth=t.width,e._cellSizes.leftHeight=t.height):n.classed(`border-cell-right`)?(e._cellSizes.rightWidth=t.width,e._cellSizes.rightHeight=t.height):n.classed(`border-cell-bottom`)&&(e._cellSizes.bottomHeight=t.height)}}),[`height`,`width`,`topHeight`,`bottomHeight`,`leftHeight`,`rightHeight`,`leftWidth`,`rightWidth`].forEach(function(t){e._cellSizes[t]=e._cellSizes[t]===void 0?0:e._cellSizes[t]})}postUpdate(e,t){let n=this;this.content().forEach(function(e){if(e._element.node()!==null&&e.widget()){let t=e.widget().getBBox(!1,!0),r=e.widget().getBBox(!0,!0);(t.width!==r.width||t.height!==r.height)&&n.lazyRender()}})}exit(e,t){this.content().forEach(e=>e.target(null)),super.exit(e,t)}};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`]});var WidgetDiv=class{_div;_overlay=!1;_overflowX=`visible`;_overflowY=`visible`;_widget;constructor(e){this._div=e}overlay(e){return arguments.length?(this._overlay=e,this):this._overlay}overflowX(e){return arguments.length?(this._overflowX=e,this._div.style(`overflow-x`,e),this):this._overflowX}overflowY(e){return arguments.length?(this._overflowY=e,this._div.style(`overflow-y`,e),this):this._overflowY}element(){return this._div}node(){return this._div.node()}widget(e){return arguments.length?(this._widget!==e&&(this._widget&&this._widget.target(null),this._widget=e,this._widget&&this._widget.target(this._div.node())),this):this._widget}resize(e){return this._widget&&(this._div.style(`width`,`${e.width}px`).style(`height`,`${e.height}px`),this._widget.resize(e)),this}async render(e,n,r){let i=this.overflowX();!this.overlay()&&i===`visible`&&(i=null);let a=this.overflowY();return!this.overlay()&&a===`visible`&&(a=null),this._div.style(`height`,this.overlay()?`0px`:null).style(`overflow-x`,i).style(`overflow-y`,a),this._widget?this._widget.renderPromise().then(i=>{if(e&&this._widget.visible()){let e=this._widget.getBBox();return e.width+=8,n!==void 0&&e.height>n&&(e.width+=t.Platform.getScrollbarWidth()),r!==void 0&&e.width>r&&(e.height+=t.Platform.getScrollbarWidth()),this.overlay()?e.height=0:e.height+=4,e}return e?{x:0,y:0,width:0,height:0}:void 0}):Promise.resolve(e?{x:0,y:0,width:0,height:0}:void 0)}},Border2=class extends t.HTMLWidget{_bodyElement;_topWA;_leftWA;_centerWA;_rightWA;_bottomWA;_topPrevOverflow;_leftPrevOverflow;_rightPrevOverflow;_bottomPrevOverflow;constructor(){super(),this._tag=`div`}enter(e,t){super.enter(e,t);let n=t.append(`header`);this._bodyElement=t.append(`div`).attr(`class`,`body`);let r=this._bodyElement.append(`div`).attr(`class`,`center`),i=this._bodyElement.append(`div`).attr(`class`,`lhs`),a=this._bodyElement.append(`div`).attr(`class`,`rhs`),o=t.append(`div`).attr(`class`,`footer`);this._topWA=new WidgetDiv(n),this._centerWA=new WidgetDiv(r),this._leftWA=new WidgetDiv(i),this._rightWA=new WidgetDiv(a),this._bottomWA=new WidgetDiv(o)}update(e,t){super.update(e,t),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(e){e&&e.target(null)}exit(e,t){this.targetNull(this.center()),this.targetNull(this.bottom()),this.targetNull(this.right()),this.targetNull(this.left()),this.targetNull(this.top()),super.exit(e,t)}swap(e,t){let n=this[e](),r=this[t]();return this.targetNull(n),this.targetNull(r),this[`_${e}WA`].widget(null),this[`_${t}WA`].widget(null),this[e](r),this[t](n),this}render(e){return super.render(t=>{this._topWA?this._topWA.widget(this.top()).overlay(this.topOverlay()).render(!0).then(async t=>{let n=await this._bottomWA.widget(this.bottom()).render(!0,void 0,this.width()),r=this.height()-(t.height+n.height),i=await this._leftWA.widget(this.left()).render(!0,r),a=await this._rightWA.widget(this.right()).render(!0,r);this.bottomHeight_exists()&&(n.height=this.bottomHeight());let o=this.width()-(i.width+a.width),s=this.height()-(t.height+n.height),c=this.centerOverflowX(),l=this.centerOverflowY(),u=[`auto`,`scroll`].indexOf(c)!==-1,d=[`auto`,`scroll`].indexOf(l)!==-1;(u||d)&&this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:o,height:s}).render(),this._bodyElement.style(`height`,`${s}px`);let f=[this._topWA.overflowX(this.topOverflowX()).overflowY(this.topOverflowY()).resize({width:this.width(),height:t.height}).render(),this._leftWA.overflowX(this.leftOverflowX()).overflowY(this.leftOverflowY()).resize({width:i.width,height:s}).render(),this._rightWA.overflowX(this.rightOverflowX()).overflowY(this.rightOverflowY()).resize({width:a.width,height:s}).render(),this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:o,height:s}).render(),this._bottomWA.overflowX(this.bottomOverflowX()).overflowY(this.bottomOverflowY()).resize({width:this.width(),height:n.height}).render()];Promise.all(f).then(t=>{e&&e(this)})}):e&&e(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});var Carousel=class extends t.HTMLWidget{_prevActive=0;_root;activeWidget(){return this.widgets()[this.active()]}enter(e,t){super.enter(e,t),this._root=t.append(`div`).attr(`id`,`${this.id()}_root`)}update(e,n){super.update(e,n);let r=this.active(),i=this.width();this._root.style(`width`,`${i}px`).style(`height`,`${this.height()}px`);let a=this._root.selectAll(`#${this.id()}_root > .carouselItem`).data(this.widgets(),e=>e.id()),o=a.enter().append(`div`).attr(`class`,`carouselItem`).each(function(e){e.target(this)}).merge(a).style(`left`,(e,t)=>`${(t-this._prevActive)*i}px`).style(`width`,`${i}px`);this._prevActive!==r&&(o.style(`display`,(e,t)=>t===this._prevActive||t===r?null:`none`).transition().duration(this.transitionDuration()).style(`left`,(e,t)=>`${(t-r)*i}px`).on(`end`,function(e,n){(0,t.select)(this).style(`display`,()=>n===r?null:`none`)}),this._prevActive=r),a.exit().each(function(e){e.target(null)}).remove()}exit(e,t){this.widgets().forEach(e=>e.target(null)),super.exit(e,t)}render(e){return super.render(t=>{if(!this.visible()||this.isDOMHidden())e&&e(t);else{let n=this.activeWidget();n&&n.resize(this.size()).render(n=>{e&&e(t)})}})}};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 p=Math.PI,m=2*p,h=1e-6,g=m-h;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(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>h){if(!(Math.abs(u*s-c*l)>h)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,m=r-o,g=s*s+c*c,_=f*f+m*m,v=Math.sqrt(g),y=Math.sqrt(d),b=i*Math.tan((p-Math.acos((g+d-_)/(2*v*y)))/2),x=b/y,S=b/v;Math.abs(x-1)>h&&(this._+=`L`+(e+x*l)+`,`+(t+x*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*m)+`,`+(this._x1=e+S*s)+`,`+(this._y1=t+S*c)}}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>h||Math.abs(this._y1-l)>h)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%m+m),d>g?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>h&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=p)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}};function constant_default(e){return function constant(){return e}}__name(constant_default,`default`);var _=Math.PI;_/2;var v=2*_,y={draw:function(e,t){var n=Math.sqrt(t/_);e.moveTo(n,0),e.arc(0,0,n,0,v)}},b={draw:function(e,t){var n=Math.sqrt(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},x=Math.sqrt(1/3),S=x*2,C={draw:function(e,t){var n=Math.sqrt(t/S),r=n*x;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},w=.8908130915292852,T=Math.sin(_/10)/Math.sin(7*_/10),E=Math.sin(v/10)*T,D=-Math.cos(v/10)*T,O={draw:function(e,t){var n=Math.sqrt(t*w),r=E*n,i=D*n;e.moveTo(0,-n),e.lineTo(r,i);for(var a=1;a<5;++a){var o=v*a/5,s=Math.cos(o),c=Math.sin(o);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*i,c*r+s*i)}e.closePath()}},k={draw:function(e,t){var n=Math.sqrt(t),r=-n/2;e.rect(r,r,n,n)}},A=Math.sqrt(3),j={draw:function(e,t){var n=-Math.sqrt(t/(A*3));e.moveTo(0,n*2),e.lineTo(-A*n,-n),e.lineTo(A*n,-n),e.closePath()}},M=-.5,N=Math.sqrt(3)/2,P=1/Math.sqrt(12),F=(P/2+1)*3,I={draw:function(e,t){var n=Math.sqrt(t/F),r=n/2,i=n*P,a=r,o=n*P+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(M*r-N*i,N*r+M*i),e.lineTo(M*a-N*o,N*a+M*o),e.lineTo(M*s-N*c,N*s+M*c),e.lineTo(M*r+N*i,M*i-N*r),e.lineTo(M*a+N*o,M*o-N*a),e.lineTo(M*s+N*c,M*c-N*s),e.closePath()}};function symbol_default(){var e=constant_default(y),t=constant_default(64),n=null;function symbol(){var r;if(n||=r=path(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+``||null}return symbol.type=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default(t),symbol):e},symbol.size=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),symbol):t},symbol.context=function(e){return arguments.length?(n=e??null,symbol):n},symbol}__name(symbol_default,`default`);var L=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},R=function d3_identity(e){return e},z=function d3_reverse(e){for(var t=[],n=0,r=e.length;n<r;n++)t[n]=e[r-n-1];return t},B=function d3_textWrapping(e,n){e.each(function(){var e=(0,t.select)(this),r=e.text().split(/\s+/).reverse(),i,a=[],o=1.2;e.attr(`y`);for(var s=parseFloat(e.attr(`dy`))||0,c=e.text(null).append(`tspan`).attr(`x`,0).attr(`dy`,s+`em`);i=r.pop();)a.push(i),c.text(a.join(` `)),c.node().getComputedTextLength()>n&&a.length>1&&(a.pop(),c.text(a.join(` `)),a=[i],c=e.append(`tspan`).attr(`x`,0).attr(`dy`,o+s+`em`).text(i))})},V=function d3_mergeLabels(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments[1],n=arguments[2],r=arguments[3],i=arguments[4];if((t===void 0?`undefined`:L(t))===`object`){if(t.length===0)return e;for(var a=t.length;a<e.length;a++)t.push(e[a]);return t}if(typeof t==`function`){for(var o=[],s=e.length,c=0;c<s;c++)o.push(t({i:c,genLength:s,generatedLabels:e,domain:n,range:r,labelDelimiter:i}));return o}return e},H=function d3_linearLegend(e,t,n){var r=[];if(t.length>1)r=t;else for(var i=e.domain(),a=(i[i.length-1]-i[0])/(t-1),o=0;o<t;o++)r.push(i[0]+o*a);var s=r.map(n);return{data:r,labels:s,feature:function feature(t){return e(t)}}},U=function d3_quantLegend(e,t,n){var r=e.range().map(function(r){var i=e.invertExtent(r);return t(i[0])+` `+n+` `+t(i[1])});return{data:e.range(),labels:r,feature:R}},W=function d3_ordinalLegend(e){return{data:e.domain(),labels:e.domain(),feature:function feature(t){return e(t)}}},G=function d3_cellOver(e,t,n){e.call(`cellover`,n,t)},K=function d3_cellOut(e,t,n){e.call(`cellout`,n,t)},q=function d3_cellClick(e,t,n){e.call(`cellclick`,n,t)},J={d3_drawShapes:function d3_drawShapes(e,t,n,r,i,a){e===`rect`?t.attr(`height`,n).attr(`width`,r):e===`circle`?t.attr(`r`,i):e===`line`?t.attr(`x1`,0).attr(`x2`,r).attr(`y1`,0).attr(`y2`,0):e===`path`&&t.attr(`d`,a)},d3_addText:function d3_addText(e,t,n,r,i){t.append(`text`).attr(`class`,r+`label`);var a=e.selectAll(`g.`+r+`cell text.`+r+`label`).data(n).text(R);return i&&e.selectAll(`g.`+r+`cell text.`+r+`label`).call(B,i),a},d3_calcType:function d3_calcType(e,t,n,r,i,a){var o=e.invertExtent?U(e,i,a):e.ticks?H(e,n,i):W(e),s=e.range&&e.range()||e.domain();return o.labels=V(o.labels,r,e.domain(),s,a),t&&(o.labels=z(o.labels),o.data=z(o.data)),o},d3_filterCells:function d3_filterCells(e,t){var n=e.data.map(function(t,n){return{data:t,label:e.labels[n]}}).filter(t),r=n.map(function(e){return e.data}),i=n.map(function(e){return e.label});return e.data=e.data.filter(function(e){return r.indexOf(e)!==-1}),e.labels=e.labels.filter(function(e){return i.indexOf(e)!==-1}),e},d3_placement:function d3_placement(e,t,n,r,i,a){t.attr(`transform`,n),r.attr(`transform`,i),e===`horizontal`&&r.style(`text-anchor`,a)},d3_addEvents:function d3_addEvents(e,t){e.on(`mouseover.legend`,function(e){G(t,e,this)}).on(`mouseout.legend`,function(e){K(t,e,this)}).on(`click.legend`,function(e){q(t,e,this)})},d3_title:function d3_title(e,t,n,r){if(t!==``){e.selectAll(`text.`+n+`legendTitle`).data([t]).enter().append(`text`).attr(`class`,n+`legendTitle`),e.selectAll(`text.`+n+`legendTitle`).text(t),r&&e.selectAll(`text.`+n+`legendTitle`).call(B,r);var i=e.select(`.`+n+`legendCells`),a=e.select(`.`+n+`legendTitle`).nodes().map(function(e){return e.getBBox().height})[0],o=-i.nodes().map(function(e){return e.getBBox().x})[0];i.attr(`transform`,`translate(`+o+`,`+a+`)`)}},d3_defaultLocale:{format:t.format,formatPrefix:t.formatPrefix},d3_defaultFormatSpecifier:`.01f`,d3_defaultDelimiter:`to`};function color(){var e=(0,t.scaleLinear)(),n=`rect`,r=15,i=15,a=10,o=2,s=[5],c=void 0,l=[],u=``,d=!1,f=``,p=J.d3_defaultLocale,m=J.d3_defaultFormatSpecifier,h=10,g=`middle`,_=J.d3_defaultDelimiter,v=void 0,y=`vertical`,b=!1,x=void 0,S=void 0,C=(0,t.dispatch)(`cellover`,`cellout`,`cellclick`);function legend(w){var T=J.d3_calcType(e,b,s,l,p.format(m),_);w.selectAll(`g`).data([e]).enter().append(`g`).attr(`class`,u+`legendCells`),c&&J.d3_filterCells(T,c);var E=w.select(`.`+u+`legendCells`).selectAll(`.`+u+`cell`).data(T.data),D=E.enter().append(`g`).attr(`class`,u+`cell`);D.append(n).attr(`class`,u+`swatch`);var O=w.selectAll(`g.`+u+`cell `+n+`.`+u+`swatch`).data(T.data);J.d3_addEvents(D,C),E.exit().transition().style(`opacity`,0).remove(),O.exit().transition().style(`opacity`,0).remove(),O=O.merge(O),J.d3_drawShapes(n,O,i,r,a,x);var k=J.d3_addText(w,D,T.labels,u,v);E=D.merge(E);var A=k.nodes().map(function(e){return e.getBBox()}),j=O.nodes().map(function(e){return e.getBBox()});d?O.attr(`class`,function(e){return u+`swatch `+T.feature(e)}):n==`line`?O.style(`stroke`,T.feature):O.style(`fill`,T.feature);var M=void 0,N=void 0,P=g==`start`?0:g==`middle`?.5:1;y===`vertical`?(function(){var e=A.map(function(e,t){return Math.max(e.height,j[t].height)});M=function cellTrans(n,r){return`translate(0, `+((0,t.sum)(e.slice(0,r))+r*o)+`)`},N=function textTrans(e,t){return`translate( `+(j[t].width+j[t].x+h)+`, `+(j[t].y+j[t].height/2+5)+`)`}})():y===`horizontal`&&(M=function cellTrans(e,t){return`translate(`+t*(j[t].width+o)+`,0)`},N=function textTrans(e,t){return`translate(`+(j[t].width*P+j[t].x)+`,
|
|
2
|
+
`+(j[t].height+j[t].y+h+8)+`)`}),J.d3_placement(y,E,M,k,N,g),J.d3_title(w,f,u,S),E.transition().style(`opacity`,1)}return legend.scale=function(t){return arguments.length?(e=t,legend):e},legend.cells=function(e){return arguments.length?((e.length>1||e>=2)&&(s=e),legend):s},legend.cellFilter=function(e){return arguments.length?(c=e,legend):c},legend.shape=function(e,t){return arguments.length?((e==`rect`||e==`circle`||e==`line`||e==`path`&&typeof t==`string`)&&(n=e,x=t),legend):n},legend.shapeWidth=function(e){return arguments.length?(r=+e,legend):r},legend.shapeHeight=function(e){return arguments.length?(i=+e,legend):i},legend.shapeRadius=function(e){return arguments.length?(a=+e,legend):a},legend.shapePadding=function(e){return arguments.length?(o=+e,legend):o},legend.labels=function(e){return arguments.length?(l=e,legend):l},legend.labelAlign=function(e){return arguments.length?((e==`start`||e==`end`||e==`middle`)&&(g=e),legend):g},legend.locale=function(e){return arguments.length?(p=(0,t.formatLocale)(e),legend):p},legend.labelFormat=function(e){return arguments.length?(m=(0,t.formatSpecifier)(e),legend):legend.locale().format(m)},legend.labelOffset=function(e){return arguments.length?(h=+e,legend):h},legend.labelDelimiter=function(e){return arguments.length?(_=e,legend):_},legend.labelWrap=function(e){return arguments.length?(v=e,legend):v},legend.useClass=function(e){return arguments.length?((e===!0||e===!1)&&(d=e),legend):d},legend.orient=function(e){return arguments.length?(e=e.toLowerCase(),(e==`horizontal`||e==`vertical`)&&(y=e),legend):y},legend.ascending=function(e){return arguments.length?(b=!!e,legend):b},legend.classPrefix=function(e){return arguments.length?(u=e,legend):u},legend.title=function(e){return arguments.length?(f=e,legend):f},legend.titleWidth=function(e){return arguments.length?(S=e,legend):S},legend.textWrap=function(e){return arguments.length?(textWrap=e,legend):textWrap},legend.on=function(){var e=C.on.apply(C,arguments);return e===C?legend:e},legend}var Legend=class extends t.SVGWidget{_owner;_targetWidget;_targetWidgetMonitor;_legendOrdinal;_disabled=[];_symbolTypeMap={circle:y,cross:b,diamond:C,square:k,star:O,triangle:j,wye:I};constructor(e){super(),this._owner=e,this._drawStartPos=`origin`;let t=this;this._legendOrdinal=color().shape(`path`,symbol_default().type(y).size(150)()).shapePadding(10).shapeRadius(10).on(`cellclick`,function(e){t.onClick(e,this)}).on(`cellover`,e=>{t.onOver(e,this)}).on(`cellout`,e=>{t.onOut(e,this)})}isDisabled(e){return e===void 0?!1:typeof e==`string`?e.indexOf(`__`)===0||this._disabled.indexOf(e)>=0:e instanceof t.Database.Field?e.id().indexOf(`__`)===0||this._disabled.indexOf(e.id())>=0:this._disabled.indexOf(e)>=0}filteredFields(){switch(this.dataFamily()){case`2D`:return this.fields();case`ND`:return this.fields().filter(e=>!this.isDisabled(e))}return this.fields()}filteredColumns(){switch(this.dataFamily()){case`2D`:return this.columns();case`ND`:return this.columns().filter(e=>!this.isDisabled(e))}return this.columns()}filteredData(){switch(this.dataFamily()){case`2D`:return this.data().filter(e=>!this.isDisabled(e[0]));case`ND`:let e={},t=!1;return this.columns().forEach((n,r)=>{let i=this.isDisabled(n);e[r]=i,i&&(t=!0)}),t?this.data().map(t=>t.filter((t,n)=>!e[n])):this.data()}return this.data()}isRainbow(){let e=this.getWidget();return e&&e._palette&&e._palette.type()===`rainbow`}targetWidget(e){if(!arguments.length)return this._targetWidget;if(this._targetWidget=e,this._targetWidgetMonitor&&(this._targetWidgetMonitor.remove(),delete this._targetWidgetMonitor),this._targetWidget){let e=this;this._targetWidgetMonitor=this._targetWidget.monitor(function(t,n,r,i){switch(t){case`chart`:case`columns`:case`data`:case`paletteID`:e.lazyRender()}})}return this}getWidget(){if(this._targetWidget)switch(this._targetWidget.classID()){case`composite_MultiChart`:return this._targetWidget.chart()}return this._targetWidget}getPalette(){let e=this.getWidget();if(e&&e._palette)switch(e._palette.type()){case`ordinal`:return t.Palette.ordinal(e._palette.id());case`rainbow`:return t.Palette.rainbow(e._palette.id())}return t.Palette.ordinal(`default`)}getPaletteType(){return this.getPalette().type()}fillColorFunc(){let e=this.getWidget();if(e&&e.fillColor)return e._palette&&e.paletteID&&e._palette.name!==e.paletteID()&&(e._palette=e._palette.switch(e.paletteID())),(t,n,r)=>e.fillColor(t,n,r);let n=t.Palette.ordinal(e&&e.paletteID&&e.paletteID()||`default`);return(e,t,r)=>n(t)}fillColor(e,t,n){return this.fillColorFunc()(e,t,n)}_g;enter(e,t){super.enter(e,t),this._g=t.append(`g`).attr(`class`,`legendOrdinal`)}calcMetaData(){let e=[],n=0,r=0,i=this.columns().length;if(this._targetWidget){let a=this.columns();switch(this.getPaletteType()){case`ordinal`:let o=this.fillColorFunc(),s=0;switch(this.dataFamily()){case`2D`:e=this.data().map(function(e,t){s=this.data()[t].slice(1,i).reduce((e,t)=>e+t,0);let a=this.isDisabled(e[0]);a||(n+=s);let c=e[0]+(!a&&this.showSeriesTotal()?` (${s})`:``),l=this.textSize(c);return r<l.width&&(r=l.width),[o(e,e[0],!1),e[0],c]},this);break;case`ND`:e=this.columns().filter(e=>e.indexOf(`__`)!==0).filter(function(e,t){return t>0}).map(function(e,t){s=this.data().reduce((e,n)=>e+n[t+1],0);let i=this.isDisabled(a[t+1]),c=e+(!i&&this.showSeriesTotal()?` (${s})`:``);i||(n+=s);let l=this.textSize(c);return r<l.width&&(r=l.width),[o(void 0,e,!1),e,c]},this);break;default:e=this.columns().map(function(e){return[o(void 0,e,!1),e]},this)}break;case`rainbow`:let c=this.getPalette(),l=(0,t.format)(this.rainbowFormat()),u=this.getWidget(),d=this.rainbowBins(),f=u._dataMinWeight,p=u._dataMaxWeight,m=(p-f)/(d-1);e.push([c(f,f,p),l(f)]);for(let t=1;t<d-1;++t){let n=m*t;Math.floor(n)>parseInt(e[0][1])&&(n=Math.floor(n)),e.push([c(n,f,p),l(n)])}e.push([c(p,f,p),l(p)])}}return{dataArr:e,total:n,maxLabelWidth:r}}update(e,n){super.update(e,n);let{dataArr:r,maxLabelWidth:i,total:a}=this.calcMetaData(),o=this.shapeRadius(),s=this.radiusToSymbolSize(o),c=this.itemPadding();this.orientation()===`horizontal`&&(c+=i-o*2);let l=(0,t.scaleOrdinal)().domain(r.map(e=>e[1])).range(r.map(e=>e[0]));this._legendOrdinal.shape(`path`,symbol_default().type(this._symbolTypeMap[this.symbolType()]).size(s)()).orient(this.orientation()).title(this.title()).labelWrap(this.labelMaxWidth()).labelAlign(this.labelAlign()).shapePadding(c).scale(l).labels(e=>r[e.i][2]),this._g.call(this._legendOrdinal),this.updateDisabled(n,r);let u=this._g.select(`.legendCells`).node().getBBox(),d=Math.abs(u.x),f=Math.abs(u.y)+1;if(this.orientation()===`horizontal`){if(this.labelAlign()===`start`?d+=1:this.labelAlign()===`end`&&--d,this.width()>u.width){let e=this.width()-u.width;d+=e/2}}else if(this.orientation()===`vertical`&&(d+=1,this._containerSize.height>u.height)){let e=this.height()-u.height;f+=e/2}this._g.attr(`transform`,`translate(${d}, ${f})`),this.pos({x:0,y:0}),this._legendOrdinal.labelOffset(this.itemPadding());let p=this._g.selectAll(`.legendTotal`).data(r.length&&this.showLegendTotal()?[a]:[]),m=`Total: ${a}`,h=-d,g=u.height+this.itemPadding()+1;this.enableOverflowScroll(!1),this.enableOverflow(!0),p.enter().append(`text`).classed(`legendTotal`,!0).merge(p).attr(`transform`,`translate(${h}, ${g})`).text(m),p.exit().remove()}updateDisabled(e,t){e.style(`cursor`,`pointer`).selectAll(`path.swatch`).filter((e,n)=>n<t.length).style(`stroke`,(e,n)=>t[n][0]).style(`fill`,(e,n)=>this._disabled.indexOf(e)<0?t[n][0]:`white`)}postUpdate(e,t){let n;this._boundingBox&&(n=this._boundingBox.width,this._boundingBox.width=this._size.width),super.postUpdate(e,t),n!==void 0&&(this._boundingBox.width=n),this._parentRelativeDiv.style(`overflow`,`hidden`)}exit(e,t){super.exit(e,t)}radiusToSymbolSize(e){let t=e**2*Math.PI;switch(this.symbolType()){case`star`:return t*.45;case`triangle`:return t*.65;case`cross`:case`diamond`:case`wye`:return t*.75;case`circle`:return t;case`square`:return t*1.3}}onClick(e,t){if(this.getPaletteType()===`ordinal`)switch(this.dataFamily()){case`2D`:case`ND`:let t=this._disabled.indexOf(e);t<0?this._disabled.push(e):this._disabled.splice(t,1),this._owner.refreshColumns(),this._owner.refreshData(),this._owner.render()}}onOver(e,t){if((0,r.instanceOfIHighlight)(this._owner))switch(this.getPaletteType()){case`ordinal`:switch(this.dataFamily()){case`2D`:case`ND`:this._disabled.indexOf(e)<0&&this._owner.highlightColumn(e)}}}onOut(e,t){if((0,r.instanceOfIHighlight)(this._owner))switch(this.getPaletteType()){case`ordinal`:switch(this.dataFamily()){case`2D`:case`ND`:this._owner.highlightColumn()}}}onDblClick(e,t){}onMouseOver(e,t){}_containerSize;resize(e){let t;if(this.fitToContent()){this._containerSize=e;let n=this.getBBox();e.width>n.width&&(n.width=e.width),e.height>n.height&&(n.height=e.height),t=super.resize.apply(this,[{...n}])}else t=super.resize.apply(this,arguments);return t}};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:e=>!e.isRainbow()}),Legend.prototype.publish(`rainbowBins`,8,`number`,`Number of rainbow bins`,null,{tags:[`Private`],disable:e=>!e.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:e=>e.orientation()===`vertical`});var Modal=class extends t.HTMLWidget{_widget;_relativeTarget;_fade;_modal;_modalHeader;_modalBody;_modalHeaderAnnotations;_modalHeaderCloseButton;_close;constructor(){super(),this._tag=`div`}closeModal(){this.visible(!1)}getRelativeTarget(){let e;return this.relativeTargetId()&&(e=document.getElementById(this.relativeTargetId()),e)?e:!e&&(e=this.locateAncestor(`layout_Grid`),e&&e.element)?e.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());let e=this._modal.node().getBoundingClientRect(),t=this._modalHeader.node().getBoundingClientRect();return this._modalBody.style(`height`,e.height-t.height+`px`).style(`width`,e.width),e}setFadePosition(e){this._fade.style(`top`,e.top+`px`).style(`left`,e.left+`px`).style(`width`,e.width+`px`).style(`height`,e.height+`px`)}setModalPosition(e){let t=this.setModalSize();if(this.fixedTop()!==null&&this.fixedLeft()!==null)this._modal.style(`top`,`calc(${this.fixedTop()} + ${e.top}px)`).style(`left`,`calc(${this.fixedLeft()} + ${e.left}px)`);else if(this.fixedHeight()!==null&&this.fixedWidth()!==null)this._modal.style(`top`,e.top+e.height/2-t.height/2+`px`).style(`left`,e.left+e.width/2-t.width/2+`px`);else if(this.minHeight()||this.minWidth()){let t=this._modal.node().getBoundingClientRect();this._modal.style(`top`,e.top+e.height/2-t.height/2+`px`).style(`left`,e.left+e.width/2-t.width/2+`px`)}}resize(e){return super.resize(),this._modal&&this.setModalSize(),this}resizeBodySync(e,t){let n=this._modalHeader.node().getBoundingClientRect();return this._modal.style(`width`,e+`px`).style(`height`,t+n.height+`px`).style(`min-width`,e+`px`).style(`min-height`,t+n.height+`px`),this._modalHeader.style(`width`,e+`px`),this._modalBody.style(`width`,e+`px`).style(`height`,t+`px`),this.minWidth(e+`px`).minHeight(t+n.height+`px`).resize({height:t+n.height,width:e})}enter(e,t){super.enter(e,t),this._fade=t.append(`div`).classed(`layout_Modal-fade`,!0).classed(`layout_Modal-fadeClickable`,this.enableClickFadeToClose()).classed(`layout_Modal-fade-hidden`,!this.showFade());let n=this.titleFontSize()*2;this._modal=t.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`,n+`px`),this._modalBody=this._modal.append(`div`).classed(`layout_Modal-body`,!0).style(`height`,`calc( 100% - ${n}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`,e=>{this.enableClickFadeToClose()&&this.closeModal()})}update(e,t){super.update(e,t),t.style(`display`,this.show()?null:`none`),this._fade.classed(`layout_Modal-fade-hidden`,!this.showFade()),this._relativeTarget=this.getRelativeTarget(),this.setModalSize();let n=this._relativeTarget.getBoundingClientRect();this.setFadePosition(n),this.setModalPosition(n),this.show()?(this._widget.target()||this._widget.target(this._modalBody.node()),this._widget.resize().render()):this._widget.target(null).render()}exit(e,t){this._widget&&this._widget.target(null),super.exit(e,t)}formattedTitle(){let e=this.title_exists()?this.title().trim():``;return e.length>0&&e.slice(0,1)===`(`&&e.slice(-1)===`)`?e.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`);var ChartPanel=class extends Border2{_legend=new Legend(this).enableOverflow(!0);_progressBar=new t.ProgressBar;_autoScale=!1;_resolutions={tiny:{width:100,height:100},small:{width:300,height:300}};_modal=new Modal;_highlight;_scale;_orig_size;_toggleInfo=new t.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 t.Text().text(this.description())).show(!0).render();let e=this._modal._close;this._modal._close=()=>{this._toggleInfo.selected(!1).render(),this._modal._close=e}}}).on(`mouseMove`,()=>{}).on(`mouseOut`,()=>{});_toggleData=new t.ToggleButton().faChar(`fa-table`).tooltip(`Data`).on(`click`,()=>{this.dataVisible(this._toggleData.selected()),this.render()});_buttonDownload=new t.Button().faChar(`fa-download`).tooltip(`Download`).on(`click`,()=>{this.downloadCSV()});_buttonDownloadImage=new t.Button().faChar(`fa-image`).tooltip(`Download Image`).on(`click`,()=>{this.downloadPNG()});_toggleLegend=new t.ToggleButton().faChar(`fa-list-ul`).tooltip(`Legend`).selected(!1).on(`click`,()=>{let e=this._toggleLegend.selected();this.legendPosition()===`bottom`?this.showBottom(e):this.legendPosition()===`right`&&this.showRight(e),this.legendVisible(e),this.render()});_spacer=new t.Spacer;_titleBar=new t.TitleBar().buttons([this._toggleData,this._buttonDownload,this._buttonDownloadImage,this._spacer,this._toggleLegend]);_carousel=new Carousel;_table=new n.Table;_widget;_hideLegendToggleList=[`dgrid_Table`,`dgrid2_Table`];constructor(){super(),this._tag=`div`}fields(e){return arguments.length?(super.fields(e),this._legend.fields(e),this.refreshFields(),this):super.fields()}refreshFields(){return this._widget.fields(this._legend.filteredFields()),this._table.fields(this._legend.filteredFields()),this}columns(e,t){return arguments.length?(super.columns(e,t),this._legend.columns(e,t),this.refreshColumns(),this):super.columns()}refreshColumns(){return this._widget.columns(this._legend.filteredColumns()),this._table.columns(this._legend.filteredColumns()),this}data(e){return arguments.length?(super.data(e),this._legend.data(e),this.refreshData(),this):super.data()}refreshData(){return this._widget.data(this._legend.filteredData()),this._table.data(this._legend.filteredData()),this}highlight(e){return arguments.length?(this._highlight=e,this):this._highlight}startProgress(){this._progressBar.start()}finishProgress(){this._progressBar.finish()}buttons(e){return arguments.length?(this._titleBar.buttons(e),this):this._titleBar.buttons()}downloadCSV(){let e=this.downloadTitle()?this.downloadTitle():this.title()?this.title():`data`,n=this.downloadTimestampSuffix()?`_`+t.Utility.timestamp():``;return t.Utility.downloadString(`CSV`,this._widget.export(`CSV`),e+n),this}downloadPNG(){let e=this.widget();return e instanceof t.SVGWidget&&(this.legendVisible()?e.downloadPNG(this.title(),void 0,this._legend):e.downloadPNG(this.title())),this}highlightColumn(e){if(e){let n=`series-${this.cssTag(e)}`;this._centerWA.element().selectAll(`.series`).each(function(){let e=(0,t.select)(this),r=e.classed(n);e.classed(`highlight`,r).classed(`lowlight`,!r)})}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(e,t){super.enter(e,t),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(e,t),this.setOrigSize()}preUpdateTiny(e){e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,`none`)}preUpdateSmall(e){let t=this._orig_size.width/this._resolutions.small.width,n=this._orig_size.height/this._resolutions.small.height;this._scale=Math.min(t,n);let r=this._scale===t;this.size({width:r?this._resolutions.small.width:this._orig_size.width*(1/this._scale),height:r?this._orig_size.height*(1/this._scale):this._resolutions.small.height}),e.select(`div.title-icon`).style(`position`,`static`),e.selectAll(`lhs`).style(`display`,`none`),e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,``),e.selectAll(`div.data-count`).style(`visibility`,`hidden`),e.style(`transform`,`scale(${this._scale})`)}preUpdateRegular(e){e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,``),e.selectAll(`div.data-count`).style(`visibility`,`hidden`),e.select(`div.title-icon`).style(`position`,`static`),e.style(`transform`,`translate(0px,0px) scale(1)`)}_prevdataVisible;_prevlegendVisible;_prevLegendPosition;_prevChartDataFamily;_prevChart;_prevButtons;update(e,t){super.update(e,t)}preUpdate(e,n){switch(super.preUpdate(e,n),this._prevLegendPosition!==this.legendPosition()&&(this._legend.target()!==null&&this._legend.target(null),this._prevLegendPosition===void 0?this[this.legendPosition()](this._legend):this.swap(this._prevLegendPosition,this.legendPosition()),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)),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(n);break;case`small`:this.preUpdateSmall(n);break;case`regular`:this.preUpdateRegular(n)}let r=this._widget.classID()===`composite_MultiChart`?this._widget.chart():this._widget;if(this._legend.dataFamily(r._dataFamily||`any`),this._prevChartDataFamily!==this._legend.dataFamily()&&(this._prevChartDataFamily=this._legend.dataFamily(),this._prevChartDataFamily===`any`)&&(this._toggleLegend.selected(!1),this._legend.visible(!1)),n.style(`box-shadow`,this.highlight()?`inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}`:`none`),this._hideLegendToggleList.indexOf(r.classID())===-1?(this._spacer.visible(!0),this._toggleLegend.visible(!0)):(this._spacer.visible(!1),this._toggleLegend.visible(!1)),this._prevChart!==r){this._prevChart=r;let e=r?r._titleBar||r._iconBar:void 0;if(e&&e instanceof t.IconBar){this._prevButtons=this._prevButtons||[...this.buttons()];let n=[...e.buttons(),new t.Spacer,...this._prevButtons];e.buttons([]).render(),this.buttons(n)}else this._prevButtons&&this.buttons(this._prevButtons)}let i=[];this.dataButtonVisible()||i.push(this._toggleData),this.downloadButtonVisible()||i.push(this._buttonDownload),this.downloadImageButtonVisible()||i.push(this._buttonDownloadImage),this.legendButtonVisible()||i.push(this._toggleLegend),this._buttonDownloadImage.enabled(this.widget()instanceof t.SVGWidget),this._titleBar.hiddenButtons(i).visible(this.titleVisible()),this.topOverlay(this.titleOverlay()||!this.titleVisible())}postUpdate(e,t){switch(super.postUpdate(e,t),this.getResponsiveMode()){case`tiny`:this.postUpdateTiny(t);break;case`small`:this.postUpdateSmall(t);break;case`regular`:this.postUpdateRegular(t)}}postUpdateTiny(e){e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,`none`),e.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),e.style(`transform`,`translate(0px,0px) scale(1)`);let t=e.selectAll(`div.title-icon`),n=t.node(),r=e.node().parentElement.getBoundingClientRect();if(n){let n=t.node().getBoundingClientRect(),i=r.height/2;t.style(`position`,`absolute`).style(`left`,`calc(50% - ${n.width/2}px)`).style(`top`,`${i-n.height/2}px`),e.selectAll(`div.data-count`).style(`position`,`absolute`).style(`left`,`calc(50% + ${n.width/2}px)`).style(`top`,`${i-n.height/2}px`)}}postUpdateSmall(e){e.selectAll(`lhs`).style(`display`,`none`),e.selectAll(`div.title-icon`).style(`position`,`static`),e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,``),e.selectAll(`div.data-count`).style(`visibility`,`hidden`);let t=e.node().getBoundingClientRect(),n=e.node().parentElement.getBoundingClientRect();e.style(`transform`,`translate(${n.x-t.x}px, ${n.y-t.y}px) scale(${this._scale})`)}postUpdateRegular(e){e.selectAll(`div.title-icon`).style(`position`,`static`),e.selectAll(`div.body,div.title-text,div.icon-bar`).style(`display`,``),e.selectAll(`div.data-count`).style(`visibility`,`hidden`)}exit(e,t){this._progressBar.exit(e,t),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(e,t)}click(e,t,n){}dblclick(e,t,n){}vertex_click(e,t,n,r){r&&r.vertex}vertex_dblclick(e,t,n,r){r&&r.vertex}edge_click(e,t,n,r){r&&r.edge}edge_dblclick(e,t,n,r){r&&r.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(e){if(!arguments.length)return this._widget;this._carousel.widgets([e,this._table]),this._widget=e,this._widget.fields(this._legend.filteredFields()).data(this._legend.filteredData());let t=this,n=this._widget;return n.click=function(){t.click.apply(t,arguments)},n.dblclick=function(){t.dblclick.apply(t,arguments)},n.vertex_click=function(){t.vertex_click.apply(t,arguments)},n.vertex_dblclick=function(){t.vertex_dblclick.apply(t,arguments)},n.edge_click=function(){t.edge_click.apply(t,arguments)},n.edge_dblclick=function(){t.edge_dblclick.apply(t,arguments)},this};var FlexGrid=class extends t.HTMLWidget{constructor(){super()}enter(e,n){super.enter(e,n),(0,t.select)(e.parentNode).style(`height`,`100%`).style(`width`,`100%`)}update(e,t){super.update(e,t);let n=this,r=[];this.updateFlexParent(t);let i=t.selectAll(`.FlexGrid-list-item`).data(this.widgets(),e=>e.id());i.enter().append(`div`).classed(`FlexGrid-list-item`,!0).each(function(e){e.target(this)}).merge(i).style(`min-height`,this.itemMinHeight()+`px`).style(`min-width`,this.itemMinWidth()+`px`).style(`flex-basis`,(e,t)=>{let n=this.widgetsFlexBasis()[t];return n===void 0?this.flexBasis():n}).style(`flex-grow`,(e,t)=>{let n=this.widgetsFlexGrow()[t];return n===void 0?this.flexGrow():n}).style(`border-width`,this.borderWidth()+`px`).style(`border-color`,this.itemBorderColor()).each(function(){this.firstChild.style.display=`none`}).each(function(){let e=this.getBoundingClientRect();r.push([e.width,e.height])}).each(function(e,t){this.firstChild.style.display=`block`,e.resize({width:r[t][0]-2*n.borderWidth(),height:r[t][1]-2*n.borderWidth()})}),i.exit().remove()}exit(e,t){super.exit(e,t)}updateFlexParent(e){e.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:e=>e.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 Y=__toESM(__commonJSMin(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=r():n.GridList=r()})(e,function(){var GridList=function(e,t){for(var n in this._options=t,this.defaults)this._options.hasOwnProperty(n)||(this._options[n]=this.defaults[n]);this.items=e,this._adjustSizeOfItems(),this.generateGrid()};GridList.cloneItems=function(e,t){var n,r;for(t===void 0&&(t=[]),n=0;n<e.length;n++)for(r in t[n]||(t[n]={}),e[n])t[n][r]=e[n][r];return t},GridList.prototype={defaults:{lanes:5,direction:`horizontal`},toString:function(){var e=this.grid.length,t=`
|
|
3
3
|
#|`,n=`
|
|
4
4
|
--`,r,i,a;for(i=0;i<e;i++)t+=` `+this._padNumber(i,` `),n+=`---`;for(t+=n,i=0;i<this._options.lanes;i++)for(t+=`
|
|
5
5
|
`+this._padNumber(i,` `)+`|`,a=0;a<e;a++)t+=` `,r=this.grid[a][i],t+=r?this._padNumber(this.items.indexOf(r),`0`):`--`;return t+=`
|
|
6
|
-
`,t},generateGrid:function(){var e;for(this._resetGrid(),e=0;e<this.items.length;e++)this._markItemPositionToGrid(this.items[e])},resizeGrid:function(e){var t=0;this._options.lanes=e,this._adjustSizeOfItems(),this._sortItemsByPosition(),this._resetGrid();for(var n=0;n<this.items.length;n++){var r=this.items[n],i=this._getItemPosition(r);this._updateItemPosition(r,this.findPositionForItem(r,{x:t,y:0})),t=Math.max(t,i.x)}this._pullItemsToLeft()},findPositionForItem:function(e,t,n){var r,i,a;for(r=t.x;r<this.grid.length;r++)if(n!==void 0){if(a=[r,n],this._itemFitsAtPosition(e,a))return a}else for(i=t.y;i<this._options.lanes;i++)if(a=[r,i],this._itemFitsAtPosition(e,a))return a;var o=this.grid.length,s=0;return n!==void 0&&this._itemFitsAtPosition(e,[o,n])&&(s=n),[o,s]},moveItemToPosition:function(e,t){var n=this._getItemPosition({x:t[0],y:t[1],w:e.w,h:e.h});this._updateItemPosition(e,[n.x,n.y]),this._resolveCollisions(e)},resizeItem:function(e,t){var n=t.w||e.w,r=t.h||e.h;this._updateItemSize(e,n,r),this._resolveCollisions(e),this._pullItemsToLeft()},getChangedItems:function(e,t){for(var n=[],r=0;r<e.length;r++){var i=this._getItemByAttribute(t,e[r][t]);(i.x!==e[r].x||i.y!==e[r].y||i.w!==e[r].w||i.h!==e[r].h)&&n.push(i)}return n},_sortItemsByPosition:function(){this.items.sort(function(e,t){var n=this._getItemPosition(e),r=this._getItemPosition(t);return n.x==r.x?n.y==r.y?0:n.y-r.y:n.x-r.x}.bind(this))},_adjustSizeOfItems:function(){for(var e=0;e<this.items.length;e++){var t=this.items[e];t.autoSize===void 0&&(t.autoSize=t.w===0||t.h===0),t.autoSize&&(this._options.direction===`horizontal`?t.h=this._options.lanes:t.w=this._options.lanes)}},_resetGrid:function(){this.grid=[]},_itemFitsAtPosition:function(e,t){var n=this._getItemPosition(e),r,i;if(t[0]<0||t[1]<0||t[1]+n.h>this._options.lanes)return!1;for(r=t[0];r<t[0]+n.w;r++){var a=this.grid[r];if(a){for(i=t[1];i<t[1]+n.h;i++)if(a[i]&&a[i]!==e)return!1}}return!0},_updateItemPosition:function(e,t){e.x!==null&&e.y!==null&&this._deleteItemPositionFromGrid(e),this._setItemPosition(e,t),this._markItemPositionToGrid(e)},_updateItemSize:function(e,t,n){e.x!==null&&e.y!==null&&this._deleteItemPositionFromGrid(e),e.w=t,e.h=n,this._markItemPositionToGrid(e)},_markItemPositionToGrid:function(e){var t=this._getItemPosition(e),n,r;for(this._ensureColumns(t.x+t.w),n=t.x;n<t.x+t.w;n++)for(r=t.y;r<t.y+t.h;r++)this.grid[n][r]=e},_deleteItemPositionFromGrid:function(e){var t=this._getItemPosition(e),n,r;for(n=t.x;n<t.x+t.w;n++)if(this.grid[n])for(r=t.y;r<t.y+t.h;r++)this.grid[n][r]==e&&(this.grid[n][r]=null)},_ensureColumns:function(e){var t;for(t=0;t<e;t++)this.grid[t]||this.grid.push(new GridCol(this._options.lanes))},_getItemsCollidingWithItem:function(e){for(var t=[],n=0;n<this.items.length;n++)e!=this.items[n]&&this._itemsAreColliding(e,this.items[n])&&t.push(n);return t},_itemsAreColliding:function(e,t){var n=this._getItemPosition(e),r=this._getItemPosition(t);return!(r.x>=n.x+n.w||r.x+r.w<=n.x||r.y>=n.y+n.h||r.y+r.h<=n.y)},_resolveCollisions:function(e){this._tryToResolveCollisionsLocally(e)||this._pullItemsToLeft(e),this._pullItemsToLeft()},_tryToResolveCollisionsLocally:function(e){var t=this._getItemsCollidingWithItem(e);if(!t.length)return!0;var n=new GridList([],this._options),r,i,a,o;GridList.cloneItems(this.items,n.items),n.generateGrid();for(var s=0;s<t.length;s++){var c=n.items[t[s]],l=this._getItemPosition(c),u=this._getItemPosition(e);if(r=[u.x-l.w,l.y],i=[u.x+u.w,l.y],a=[l.x,u.y-l.h],o=[l.x,u.y+u.h],n._itemFitsAtPosition(c,r))n._updateItemPosition(c,r);else if(n._itemFitsAtPosition(c,a))n._updateItemPosition(c,a);else if(n._itemFitsAtPosition(c,o))n._updateItemPosition(c,o);else if(n._itemFitsAtPosition(c,i))n._updateItemPosition(c,i);else return!1}return GridList.cloneItems(n.items,this.items),this.generateGrid(),!0},_pullItemsToLeft:function(e){if(this._sortItemsByPosition(),this._resetGrid(),e){var t=this._getItemPosition(e);this._updateItemPosition(e,[t.x,t.y])}for(var n=0;n<this.items.length;n++){var r=this.items[n],i=this._getItemPosition(r);if(!(e&&r==e)){var a=this._findLeftMostPositionForItem(r),o=this.findPositionForItem(r,{x:a,y:0},i.y);this._updateItemPosition(r,o)}}},_findLeftMostPositionForItem:function(e){for(var t=0,n=this._getItemPosition(e),r=0;r<this.grid.length;r++)for(var i=n.y;i<n.y+n.h;i++){var a=this.grid[r][i];if(a){var o=this._getItemPosition(a);this.items.indexOf(a)<this.items.indexOf(e)&&(t=o.x+o.w)}}return t},_getItemByAttribute:function(e,t){for(var n=0;n<this.items.length;n++)if(this.items[n][e]===t)return this.items[n];return null},_padNumber:function(e,t){return e>=10?e:t+e},_getItemPosition:function(e){return this._options.direction===`horizontal`?e:{x:e.y,y:e.x,w:e.h,h:e.w}},_setItemPosition:function(e,t){this._options.direction===`horizontal`?(e.x=t[0],e.y=t[1]):(e.x=t[1],e.y=t[0])}};var GridCol=function(e){for(var t=0;t<e;t++)this.push(null)};return GridCol.prototype=[],GridList})}))(),1),X=Y&&Y.default||Y,Grid=class extends t.HTMLWidget{divItems;gridList;items;itemsMap;origItems;cellWidth;cellHeight;dragItem;dragItemPos;_d3Drag;_d3DragResize;_selectionBag;_scrollBarWidth;constructor(){super(),this._tag=`div`,this._selectionBag=new t.Utility.Selection(this),this.content([])}getDimensions(){let e={width:0,height:0};return this.content().forEach(function(t){e.width<t.gridCol()+t.gridColSpan()&&(e.width=t.gridCol()+t.gridColSpan()),e.height<t.gridRow()+t.gridRowSpan()&&(e.height=t.gridRow()+t.gridRowSpan())},this),e}clearContent(e){this.content(this.content().filter(function(t){if(!e)return t.target(null),!1;let n=t;for(;n;){if(e===n)return t.target(null),!1;n=n.widget?n.widget():null}return!0}))}setContent(e,t,n,r,i,a){if(i||=1,a||=1,r||=``,this.content(this.content().filter(function(n){return n.gridRow()===e&&n.gridCol()===t?(n.target(null),!1):!0})),n){let o=new Cell().gridRow(e).gridCol(t).widget(n).title(r).gridRowSpan(i).gridColSpan(a);this.content().push(o)}return this}sortedContent(){return this.content().sort(function(e,t){return e.gridRow()===t.gridRow()?e.gridCol()-t.gridCol():e.gridRow()-t.gridRow()})}getCell(e,t){let n=null;return this.content().some(function(r){return e>=r.gridRow()&&e<r.gridRow()+r.gridRowSpan()&&t>=r.gridCol()&&t<r.gridCol()+r.gridColSpan()?(n=r,!0):!1}),n}getWidgetCell(e){let t=null;return this.content().some(function(n){return n.widget().id()===e?(t=n,!0):!1}),t}getContent(e){let t=null;return this.content().some(function(n){return n.widget().id()===e?(t=n.widget(),!0):!1}),t}cellToGridItem(e){return{x:e.gridCol(),y:e.gridRow(),w:e.gridColSpan(),h:e.gridRowSpan(),id:e.id(),cell:e}}gridItemToCell(e){e.cell.gridCol(e.x).gridRow(e.y).gridColSpan(e.w).gridRowSpan(e.h)}resetItemsPos(){this.origItems.forEach(function(e){let t=this.itemsMap[e.id];t.x=e.x,t.y=e.y},this)}initGridList(){this.itemsMap={},this.items=this.content().map(function(e){let t=this.cellToGridItem(e);return this.itemsMap[t.id]=t,t},this),this.origItems=this.content().map(this.cellToGridItem),this.gridList=new X(this.items,{direction:this.snapping(),lanes:this.snapping()===`horizontal`?this.snappingRows():this.snappingColumns()})}killGridList(){this.gridList=null,delete this.items,delete this.itemsMap}enter(e,n){super.enter(e,n),this._scrollBarWidth=t.Platform.getScrollbarWidth();let r=this;this._d3Drag=(0,t.drag)().subject(function(e){let t=r.cellToGridItem(e);return{x:t.x*r.cellWidth,y:t.y*r.cellHeight}}).on(`start`,function(e){if(!r.designMode())return;(0,t.d3Event)().sourceEvent.stopPropagation(),r.initGridList();let i=r.itemsMap[e.id()];r.dragItem=n.append(`div`).attr(`class`,`dragging`).style(`transform`,function(){return`translate(`+i.x*r.cellWidth+`px, `+i.y*r.cellHeight+`px)`}).style(`width`,function(){return i.w*r.cellWidth-r.gutter()+`px`}).style(`height`,function(){return i.h*r.cellHeight-r.gutter()+`px`}),r.selectionBagClick(e)}).on(`drag`,function(e){if(!r.designMode())return;let n=(0,t.d3Event)();n.sourceEvent.stopPropagation();let i=r.itemsMap[e.id()];n.x<0&&(n.x=0),n.x+i.w*r.cellWidth>r.snappingColumns()*r.cellWidth&&(n.x=r.snappingColumns()*r.cellWidth-i.w*r.cellWidth),n.y<0&&(n.y=0),n.y+i.h*r.cellWidth>r.snappingRows()*r.cellWidth&&(n.y=r.snappingRows()*r.cellWidth-i.h*r.cellWidth);let a=[Math.max(0,Math.floor((n.x+r.cellWidth/2)/r.cellWidth)),Math.max(0,Math.floor((n.y+r.cellHeight/2)/r.cellHeight))];(i.x!==a[0]||i.y!==a[1])&&(r.snapping()===`none`?(i.x=a[0],i.y=a[1]):(r.resetItemsPos(),r.gridList.moveItemToPosition(i,a)),(e.gridCol()!==i.x||e.gridRow()!==i.y)&&(r.items.forEach(r.gridItemToCell),r.updateGrid(!1,100))),r.dragItem.style(`transform`,function(){return`translate(`+n.x+`px, `+n.y+`px)`}).style(`width`,function(){return i.w*r.cellWidth+`px`}).style(`height`,function(){return i.h*r.cellHeight+`px`})}).on(`end`,function(){r.designMode()&&((0,t.d3Event)().sourceEvent.stopPropagation(),r.dragItem.remove(),r.dragItem=null,r.killGridList())}),this._d3DragResize=(0,t.drag)().subject(function(e){let t=r.cellToGridItem(e);return{x:(t.x+t.w-1)*r.cellWidth,y:(t.y+t.h-1)*r.cellHeight}}).on(`start`,function(e){if(!r.designMode())return;(0,t.d3Event)().sourceEvent.stopPropagation(),r.initGridList();let i=r.itemsMap[e.id()];r.dragItem=n.append(`div`).attr(`class`,`resizing`).style(`transform`,function(){return`translate(`+i.x*r.cellWidth+`px, `+i.y*r.cellHeight+`px)`}).style(`width`,function(){return i.w*r.cellWidth-r.gutter()+`px`}).style(`height`,function(){return i.h*r.cellHeight-r.gutter()+`px`}),r.dragItemPos={x:i.x,y:i.y}}).on(`drag`,function(e){if(!r.designMode())return;let n=(0,t.d3Event)();n.sourceEvent.stopPropagation();let i=r.itemsMap[e.id()],a=[Math.max(0,Math.round(n.x/r.cellWidth)),Math.max(0,Math.round(n.y/r.cellHeight))],o={w:Math.max(1,a[0]-i.x+1),h:Math.max(1,a[1]-i.y+1)};(i.w!==o.w||i.h!==o.h)&&(r.snapping()===`none`?(i.w=o.w,i.h=o.h):(r.resetItemsPos(),r.gridList.resizeItem(i,o)),(e.gridColSpan()!==i.w||e.gridRowSpan()!==i.h)&&(r.items.forEach(r.gridItemToCell),r.updateGrid(i.id,100))),r.dragItem.style(`width`,function(){return(-i.x+1)*r.cellWidth+n.x-r.gutter()+`px`}).style(`height`,function(){return(-i.y+1)*r.cellHeight+n.y-r.gutter()+`px`})}).on(`end`,function(){r.designMode()&&((0,t.d3Event)().sourceEvent.stopPropagation(),r.dragItem.remove(),r.dragItem=null,r.killGridList())})}updateGrid(e,t=0,n=!1){t||=0;let r=this;this.divItems.classed(`draggable`,this.designMode()).transition().duration(t).style(`left`,function(e){return e.gridCol()*r.cellWidth+r.gutter()/2+`px`}).style(`top`,function(e){return e.gridRow()*r.cellHeight+r.gutter()/2+`px`}).style(`width`,function(e){return e.gridColSpan()*r.cellWidth-r.gutter()+`px`}).style(`height`,function(e){return e.gridRowSpan()*r.cellHeight-r.gutter()+`px`}).on(`end`,function(t){t.surfaceShadow_default(r.surfaceShadow()).surfacePadding_default(r.surfacePadding()).surfaceBorderWidth_default(r.surfaceBorderWidth()).surfaceBackgroundColor_default(r.surfaceBackgroundColor()),(e===!0||e===t.id())&&t.resize().lazyRender()})}update(e,n){super.update(e,n),this._placeholderElement.style(`overflow-x`,this.fitTo()===`width`?`hidden`:null),this._placeholderElement.style(`overflow-y`,this.fitTo()===`width`?`scroll`:null);let r=this.getDimensions(),i=this.width()-(this.fitTo()===`width`?this._scrollBarWidth:0);if(this.cellWidth=i/r.width,this.cellHeight=this.fitTo()===`all`?this.height()/r.height:this.cellWidth,this.designMode()){let e=Math.min(this.width()/this.snappingColumns(),this.height()/this.snappingRows()),t=Math.floor(e);this.cellWidth=t,this.cellHeight=this.cellWidth}let a=this,o=n.selectAll(`#`+this.id()+` > .ddCell`).data(this.content(),function(e){return e.id()});this.divItems=o.enter().append(`div`).attr(`class`,`ddCell`).each(function(e){e.target(this),e.__grid_watch=e.monitor(function(t,n,r){a._renderCount&&(t===`snapping`||t.indexOf(`grid`)===0)&&n!==r&&(a.gridList||(a.initGridList(),a.snapping()!==`none`&&a.gridList.resizeGrid(a.snapping()===`horizontal`?a.snappingRows():a.snappingColumns()),a.items.forEach(a.gridItemToCell),a.updateGrid(e.id(),100),a.killGridList()))}),(0,t.select)(this).append(`div`).attr(`class`,`resizeHandle`).call(a._d3DragResize).append(`div`).attr(`class`,`resizeHandleDisplay`)}).merge(o),this.divItems.each(function(e){let n=(0,t.select)(this);a.designMode()?n.call(a._d3Drag):n.on(`mousedown.drag`,null).on(`touchstart.drag`,null)}),this.divItems.select(`.resizeHandle`).style(`display`,this.designMode()?null:`none`),this.updateGrid(!0),o.exit().each(function(e){e.target(null),e.__grid_watch&&e.__grid_watch.remove()}).remove();let s=n.selectAll(`#`+this.id()+` > .laneBackground`).data(this.designMode()?[``]:[]);s.enter().insert(`div`,`:first-child`).attr(`class`,`laneBackground`).style(`left`,`1px`).style(`top`,`1px`).on(`click`,function(){a.selectionBagClear()}).merge(s).style(`width`,this.snappingColumns()*this.cellWidth+`px`).style(`height`,this.snappingRows()*this.cellHeight+`px`),s.exit().each(function(){a.selectionBagClear()}).remove();let c=n.selectAll(`#`+this.id()+` > .lane`).data(this.designMode()?[``]:[]);c.enter().append(`div`).attr(`class`,`lane`).style(`left`,`1px`).style(`top`,`1px`),c.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`),c.exit().remove()}exit(e,t){this.content().forEach(e=>e.target(null)),super.exit(e,t)}_createSelectionObject(e){return{_id:e._id,element:()=>e._element,widget:e}}selection(e){return arguments.length?(this._selectionBag.set(e.map(function(e){return this._createSelectionObject(e)},this)),this):this._selectionBag.get().map(function(e){return e._id})}selectionBagClear(){this._selectionBag.isEmpty()||(this._selectionBag.clear(),this.postSelectionChange())}selectionBagClick(e){if(e!==null){let n=this._createSelectionObject(e);if((0,t.d3Event)().sourceEvent.ctrlKey)this._selectionBag.isSelected(n)?(this._selectionBag.remove(n),this.postSelectionChange()):(this._selectionBag.append(n),this.postSelectionChange());else{let e=this._selectionBag.get();e.length===1&&e[0]._id===n._id?this.selectionBagClear():this._selectionBag.set([n]),this.postSelectionChange()}}}postSelectionChange(){}applyLayout(e){this.divItems.each((t,n)=>{if(e[n]){let[r,i,a,o]=e[n];t.gridCol(r).gridRow(i).gridColSpan(a).gridRowSpan(o)}}),this.updateGrid(!0)}vizActivation(e){}};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:e=>!e.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});var HorizontalList=class extends FlexGrid{constructor(){super(),this.orientation_default(`horizontal`),this.flexWrap_default(`nowrap`)}};HorizontalList.prototype._class+=` layout_HorizontalList`;var Layered=class extends t.HTMLWidget{_contentContainer;_widgetPlacements;_widgetRatios;constructor(){super(),this._tag=`div`,this._widgetPlacements=[],this._widgetRatios=[]}addLayer(e,n=`default`,r=1,i=1){let a=this.widgets();return a.push(e||new t.Text().text(`No widget defined for layer.`)),this.widgets(a),this._widgetPlacements.push(n),this._widgetRatios.push([r,i]),this}enter(e,t){super.enter(e,t),this._contentContainer=t.append(`div`).attr(`class`,`container`)}update(e,t){super.update(e,t);let n=this;t.style(`padding`,this.surfacePadding()+`px`);let r=this._contentContainer.selectAll(`.content.id`+this.id()).data(this.widgets(),function(e){return e.id()});r.enter().append(`div`).attr(`class`,`content id`+this.id()).each(function(e,t){e.target(this)}).merge(r).each(function(e,t){let r={width:n.clientWidth(),height:n.clientHeight()},i=n.widgetSize(t,r),a=n.widgetPosition(t,r,i);this.style.top=a.y+`px`,this.style.left=a.x+`px`,e.resize(i).render()}),r.exit().each(function(e,t){e.target(null)}).remove(),r.order()}widgetSize(e,t){return this._widgetPlacements[e],{width:t.width*this._widgetRatios[e][0],height:t.height*this._widgetRatios[e][1]}}widgetPosition(e,t,n){switch(this._widgetPlacements[e]){default:return{x:0,y:0};case`top`:return{x:t.width/2-n.width/2,y:0};case`bottom`:return{x:t.width/2-n.width/2,y:t.height-n.height};case`left`:return{x:0,y:t.height/2-n.height/2};case`right`:return{x:t.width-n.width,y:t.height/2-n.height/2};case`center`:return{x:t.width/2-n.width/2,y:t.height/2-n.height/2}}}};Layered.prototype._class+=` layout_Layered`,Layered.prototype.publish(`surfacePadding`,0,`number`,`Padding`),Layered.prototype.publish(`widgets`,[],`widgetArray`,`widgets`,null,{tags:[`Private`]});var Popup=class extends t.HTMLWidget{_surfaceButtons;_originalPosition;constructor(){super(),this._tag=`div`,this._surfaceButtons=[]}updateState(e){e||=!this.popupState(),this.popupState(e).render()}enter(e,t){super.enter(e,t),this.widget().target(e),this._originalPosition=this.position()}update(e,t){super.update(e,t),t.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(e,t){let n,r;switch(this.centerPopup()){case`container`:this._placeholderElement&&(n=parseInt(this._placeholderElement.style(`width`))/2-this.widget().width()/2,r=parseInt(this._placeholderElement.style(`height`))/2-this.widget().height()/2),this.position(`absolute`);break;case`window`:n=window.innerWidth/2-this.widget().width()/2,r=window.innerHeight/2-this.widget().height()/2,this.position(`fixed`);break;default:n=0,r=0,this.position(this._originalPosition);break}this.pos({x:n,y:r}),super.postUpdate(e,t),t.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(e,t){this.widget()&&this.widget().target(null),super.exit(e,t)}click(e){}};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`]});var Tabbed=class extends t.HTMLWidget{_tabContainer;_contentContainer;constructor(){super(),this._tag=`div`}clearTabs(){return this.labels([]),this.widgets([]),this}addTab(e,n,r,i){let a=e.size();a.width===0&&a.height===0&&e.size({width:`100%`,height:`100%`});let o=this.labels(),s=this.widgets();r&&this.activeTabIdx(this.widgets().length),o.push(n);let c=new Surface().widget(e||new t.Text().text(`No widget defined for tab`));return s.push(c),this.labels(o),this.widgets(s),i&&i(c),this}widgetSize(e){let t=this.clientWidth(),n=this.clientHeight(),r=this._tabContainer.node().getBoundingClientRect();return r.height!==void 0&&(n-=r.height),{width:t,height:n}}enter(e,t){super.enter(e,t),this._tabContainer=t.append(`div`),this._contentContainer=t.append(`div`)}update(e,n){super.update(e,n);let r=this;n.style(`padding`,this.surfacePadding_exists()?this.surfacePadding()+`px`:null);let i=this._tabContainer.selectAll(`.tab-button.id`+this.id()).data(this.showTabs()?this.labels():[],function(e){return e});i.enter().append(`span`).attr(`class`,`tab-button id`+this.id()).style(`cursor`,`pointer`).on(`click`,function(e,t){r.click(r.widgets()[t].widget(),e,t),r.activeTabIdx(t).render()}).merge(i).classed(`active`,function(e,t){return r.activeTabIdx()===t}).text(function(e){return e}),i.exit().remove();let a=this._contentContainer.selectAll(`.tab-content.id`+this.id()).data(this.widgets(),function(e){return e.id()});switch(a.enter().append(`div`).attr(`class`,`tab-content id`+this.id()).each(function(e,t){e.target(this)}).merge(a).classed(`active`,function(e,t){return r.activeTabIdx()===t}).style(`display`,function(e,t){return r.activeTabIdx()===t?`block`:`none`}).each(function(e,n){if(e.visible(r.activeTabIdx()===n),r.activeTabIdx()===n){let n=r.widgetSize((0,t.select)(this));e.surfaceBorderWidth(r.showTabs()?null:0).surfacePadding(r.showTabs()?null:0).resize(n)}}),a.exit().each(function(e,t){e.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(e,t,n){}};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`]});var Toolbar=class extends t.HTMLWidget{constructor(){super(),this._tag=`div`}enter(e,t){super.enter(e,t)}update(e,n){super.update(e,n);let r=this;n.attr(`title`,r.title()).style(`background-color`,this.backgroundColor());let i=n.selectAll(`div.toolbar-title`).data(this.title()?[this.title()]:[]);i.enter().append(`div`).classed(`toolbar-title`,!0).append(`span`),i.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(r.title()),i.exit().remove();let a=n.selectAll(`div.toolbar-child`).data(this.widgets()===null?[]:this.widgets(),function(e){return e.id()});a.enter().insert(`div`,`div.toolbar-title`).each(function(e,n){let i=r.widgetClasses()[n]?r.widgetClasses()[n]+` toolbar-child`:`toolbar-child`;(0,t.select)(this).classed(i,!0),e.target(this)}),a.exit().each(function(e){e.target(null)}).remove(),a.order()}render(e){let t=this;return super.render(function(n){let r=t.element().node().getBoundingClientRect(),i=r.left+r.width;t.element().selectAll(`div.toolbar-child`).each(function(e,t){let n=this.getBoundingClientRect();i>n.left&&(i=n.left)}),t.element().select(`.toolbar-title`).style(`width`,i-r.left-4+`px`),e&&e(n)})}exit(e,t){this.widgets().forEach(function(e){e.target(null)}),super.exit(e,t)}};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`]});var VerticalList=class extends FlexGrid{constructor(){super(),this.orientation_default(`vertical`),this.flexWrap_default(`nowrap`)}};VerticalList.prototype._class+=` layout_VerticalList`,e.AbsoluteSurface=AbsoluteSurface,e.Accordion=Accordion,e.BUILD_VERSION=f,e.Border=Border,e.Border2=Border2,e.Carousel=Carousel,e.Cell=Cell,e.ChartPanel=ChartPanel,e.FlexGrid=FlexGrid,e.Grid=Grid,e.HorizontalList=HorizontalList,e.Layered=Layered,e.Legend=Legend,e.Modal=Modal,e.PKG_NAME=u,e.PKG_VERSION=d,e.Popup=Popup,e.Surface=Surface,e.Tabbed=Tabbed,e.Toolbar=Toolbar,e.VerticalList=VerticalList,e.WidgetDiv=WidgetDiv});
|
|
6
|
+
`,t},generateGrid:function(){var e;for(this._resetGrid(),e=0;e<this.items.length;e++)this._markItemPositionToGrid(this.items[e])},resizeGrid:function(e){var t=0;this._options.lanes=e,this._adjustSizeOfItems(),this._sortItemsByPosition(),this._resetGrid();for(var n=0;n<this.items.length;n++){var r=this.items[n],i=this._getItemPosition(r);this._updateItemPosition(r,this.findPositionForItem(r,{x:t,y:0})),t=Math.max(t,i.x)}this._pullItemsToLeft()},findPositionForItem:function(e,t,n){var r,i,a;for(r=t.x;r<this.grid.length;r++)if(n!==void 0){if(a=[r,n],this._itemFitsAtPosition(e,a))return a}else for(i=t.y;i<this._options.lanes;i++)if(a=[r,i],this._itemFitsAtPosition(e,a))return a;var o=this.grid.length,s=0;return n!==void 0&&this._itemFitsAtPosition(e,[o,n])&&(s=n),[o,s]},moveItemToPosition:function(e,t){var n=this._getItemPosition({x:t[0],y:t[1],w:e.w,h:e.h});this._updateItemPosition(e,[n.x,n.y]),this._resolveCollisions(e)},resizeItem:function(e,t){var n=t.w||e.w,r=t.h||e.h;this._updateItemSize(e,n,r),this._resolveCollisions(e),this._pullItemsToLeft()},getChangedItems:function(e,t){for(var n=[],r=0;r<e.length;r++){var i=this._getItemByAttribute(t,e[r][t]);(i.x!==e[r].x||i.y!==e[r].y||i.w!==e[r].w||i.h!==e[r].h)&&n.push(i)}return n},_sortItemsByPosition:function(){this.items.sort(function(e,t){var n=this._getItemPosition(e),r=this._getItemPosition(t);return n.x==r.x?n.y==r.y?0:n.y-r.y:n.x-r.x}.bind(this))},_adjustSizeOfItems:function(){for(var e=0;e<this.items.length;e++){var t=this.items[e];t.autoSize===void 0&&(t.autoSize=t.w===0||t.h===0),t.autoSize&&(this._options.direction===`horizontal`?t.h=this._options.lanes:t.w=this._options.lanes)}},_resetGrid:function(){this.grid=[]},_itemFitsAtPosition:function(e,t){var n=this._getItemPosition(e),r,i;if(t[0]<0||t[1]<0||t[1]+n.h>this._options.lanes)return!1;for(r=t[0];r<t[0]+n.w;r++){var a=this.grid[r];if(a){for(i=t[1];i<t[1]+n.h;i++)if(a[i]&&a[i]!==e)return!1}}return!0},_updateItemPosition:function(e,t){e.x!==null&&e.y!==null&&this._deleteItemPositionFromGrid(e),this._setItemPosition(e,t),this._markItemPositionToGrid(e)},_updateItemSize:function(e,t,n){e.x!==null&&e.y!==null&&this._deleteItemPositionFromGrid(e),e.w=t,e.h=n,this._markItemPositionToGrid(e)},_markItemPositionToGrid:function(e){var t=this._getItemPosition(e),n,r;for(this._ensureColumns(t.x+t.w),n=t.x;n<t.x+t.w;n++)for(r=t.y;r<t.y+t.h;r++)this.grid[n][r]=e},_deleteItemPositionFromGrid:function(e){var t=this._getItemPosition(e),n,r;for(n=t.x;n<t.x+t.w;n++)if(this.grid[n])for(r=t.y;r<t.y+t.h;r++)this.grid[n][r]==e&&(this.grid[n][r]=null)},_ensureColumns:function(e){var t;for(t=0;t<e;t++)this.grid[t]||this.grid.push(new GridCol(this._options.lanes))},_getItemsCollidingWithItem:function(e){for(var t=[],n=0;n<this.items.length;n++)e!=this.items[n]&&this._itemsAreColliding(e,this.items[n])&&t.push(n);return t},_itemsAreColliding:function(e,t){var n=this._getItemPosition(e),r=this._getItemPosition(t);return!(r.x>=n.x+n.w||r.x+r.w<=n.x||r.y>=n.y+n.h||r.y+r.h<=n.y)},_resolveCollisions:function(e){this._tryToResolveCollisionsLocally(e)||this._pullItemsToLeft(e),this._pullItemsToLeft()},_tryToResolveCollisionsLocally:function(e){var t=this._getItemsCollidingWithItem(e);if(!t.length)return!0;var n=new GridList([],this._options),r,i,a,o;GridList.cloneItems(this.items,n.items),n.generateGrid();for(var s=0;s<t.length;s++){var c=n.items[t[s]],l=this._getItemPosition(c),u=this._getItemPosition(e);if(r=[u.x-l.w,l.y],i=[u.x+u.w,l.y],a=[l.x,u.y-l.h],o=[l.x,u.y+u.h],n._itemFitsAtPosition(c,r))n._updateItemPosition(c,r);else if(n._itemFitsAtPosition(c,a))n._updateItemPosition(c,a);else if(n._itemFitsAtPosition(c,o))n._updateItemPosition(c,o);else if(n._itemFitsAtPosition(c,i))n._updateItemPosition(c,i);else return!1}return GridList.cloneItems(n.items,this.items),this.generateGrid(),!0},_pullItemsToLeft:function(e){if(this._sortItemsByPosition(),this._resetGrid(),e){var t=this._getItemPosition(e);this._updateItemPosition(e,[t.x,t.y])}for(var n=0;n<this.items.length;n++){var r=this.items[n],i=this._getItemPosition(r);if(!(e&&r==e)){var a=this._findLeftMostPositionForItem(r),o=this.findPositionForItem(r,{x:a,y:0},i.y);this._updateItemPosition(r,o)}}},_findLeftMostPositionForItem:function(e){for(var t=0,n=this._getItemPosition(e),r=0;r<this.grid.length;r++)for(var i=n.y;i<n.y+n.h;i++){var a=this.grid[r][i];if(a){var o=this._getItemPosition(a);this.items.indexOf(a)<this.items.indexOf(e)&&(t=o.x+o.w)}}return t},_getItemByAttribute:function(e,t){for(var n=0;n<this.items.length;n++)if(this.items[n][e]===t)return this.items[n];return null},_padNumber:function(e,t){return e>=10?e:t+e},_getItemPosition:function(e){return this._options.direction===`horizontal`?e:{x:e.y,y:e.x,w:e.h,h:e.w}},_setItemPosition:function(e,t){this._options.direction===`horizontal`?(e.x=t[0],e.y=t[1]):(e.x=t[1],e.y=t[0])}};var GridCol=function(e){for(var t=0;t<e;t++)this.push(null)};return GridCol.prototype=[],GridList})}))(),1),X=Y&&Y.default||Y,Grid=class extends t.HTMLWidget{divItems;gridList;items;itemsMap;origItems;cellWidth;cellHeight;dragItem;dragItemPos;_d3Drag;_d3DragResize;_selectionBag;_scrollBarWidth;constructor(){super(),this._tag=`div`,this._selectionBag=new t.Utility.Selection(this),this.content([])}getDimensions(){let e={width:0,height:0};return this.content().forEach(function(t){e.width<t.gridCol()+t.gridColSpan()&&(e.width=t.gridCol()+t.gridColSpan()),e.height<t.gridRow()+t.gridRowSpan()&&(e.height=t.gridRow()+t.gridRowSpan())},this),e}clearContent(e){this.content(this.content().filter(function(t){if(!e)return t.target(null),!1;let n=t;for(;n;){if(e===n)return t.target(null),!1;n=n.widget?n.widget():null}return!0}))}setContent(e,t,n,r,i,a){if(i||=1,a||=1,r||=``,this.content(this.content().filter(function(n){return n.gridRow()===e&&n.gridCol()===t?(n.target(null),!1):!0})),n){let o=new Cell().gridRow(e).gridCol(t).widget(n).title(r).gridRowSpan(i).gridColSpan(a);this.content().push(o)}return this}sortedContent(){return this.content().sort(function(e,t){return e.gridRow()===t.gridRow()?e.gridCol()-t.gridCol():e.gridRow()-t.gridRow()})}getCell(e,t){let n=null;return this.content().some(function(r){return e>=r.gridRow()&&e<r.gridRow()+r.gridRowSpan()&&t>=r.gridCol()&&t<r.gridCol()+r.gridColSpan()&&(n=r,!0)}),n}getWidgetCell(e){let t=null;return this.content().some(function(n){return n.widget().id()===e&&(t=n,!0)}),t}getContent(e){let t=null;return this.content().some(function(n){return n.widget().id()===e&&(t=n.widget(),!0)}),t}cellToGridItem(e){return{x:e.gridCol(),y:e.gridRow(),w:e.gridColSpan(),h:e.gridRowSpan(),id:e.id(),cell:e}}gridItemToCell(e){e.cell.gridCol(e.x).gridRow(e.y).gridColSpan(e.w).gridRowSpan(e.h)}resetItemsPos(){this.origItems.forEach(function(e){let t=this.itemsMap[e.id];t.x=e.x,t.y=e.y},this)}initGridList(){this.itemsMap={},this.items=this.content().map(function(e){let t=this.cellToGridItem(e);return this.itemsMap[t.id]=t,t},this),this.origItems=this.content().map(this.cellToGridItem),this.gridList=new X(this.items,{direction:this.snapping(),lanes:this.snapping()===`horizontal`?this.snappingRows():this.snappingColumns()})}killGridList(){this.gridList=null,delete this.items,delete this.itemsMap}enter(e,n){super.enter(e,n),this._scrollBarWidth=t.Platform.getScrollbarWidth();let r=this;this._d3Drag=(0,t.drag)().subject(function(e){let t=r.cellToGridItem(e);return{x:t.x*r.cellWidth,y:t.y*r.cellHeight}}).on(`start`,function(e){if(!r.designMode())return;(0,t.d3Event)().sourceEvent.stopPropagation(),r.initGridList();let i=r.itemsMap[e.id()];r.dragItem=n.append(`div`).attr(`class`,`dragging`).style(`transform`,function(){return`translate(`+i.x*r.cellWidth+`px, `+i.y*r.cellHeight+`px)`}).style(`width`,function(){return i.w*r.cellWidth-r.gutter()+`px`}).style(`height`,function(){return i.h*r.cellHeight-r.gutter()+`px`}),r.selectionBagClick(e)}).on(`drag`,function(e){if(!r.designMode())return;let n=(0,t.d3Event)();n.sourceEvent.stopPropagation();let i=r.itemsMap[e.id()];n.x<0&&(n.x=0),n.x+i.w*r.cellWidth>r.snappingColumns()*r.cellWidth&&(n.x=r.snappingColumns()*r.cellWidth-i.w*r.cellWidth),n.y<0&&(n.y=0),n.y+i.h*r.cellWidth>r.snappingRows()*r.cellWidth&&(n.y=r.snappingRows()*r.cellWidth-i.h*r.cellWidth);let a=[Math.max(0,Math.floor((n.x+r.cellWidth/2)/r.cellWidth)),Math.max(0,Math.floor((n.y+r.cellHeight/2)/r.cellHeight))];(i.x!==a[0]||i.y!==a[1])&&(r.snapping()===`none`?(i.x=a[0],i.y=a[1]):(r.resetItemsPos(),r.gridList.moveItemToPosition(i,a)),(e.gridCol()!==i.x||e.gridRow()!==i.y)&&(r.items.forEach(r.gridItemToCell),r.updateGrid(!1,100))),r.dragItem.style(`transform`,function(){return`translate(`+n.x+`px, `+n.y+`px)`}).style(`width`,function(){return i.w*r.cellWidth+`px`}).style(`height`,function(){return i.h*r.cellHeight+`px`})}).on(`end`,function(){r.designMode()&&((0,t.d3Event)().sourceEvent.stopPropagation(),r.dragItem.remove(),r.dragItem=null,r.killGridList())}),this._d3DragResize=(0,t.drag)().subject(function(e){let t=r.cellToGridItem(e);return{x:(t.x+t.w-1)*r.cellWidth,y:(t.y+t.h-1)*r.cellHeight}}).on(`start`,function(e){if(!r.designMode())return;(0,t.d3Event)().sourceEvent.stopPropagation(),r.initGridList();let i=r.itemsMap[e.id()];r.dragItem=n.append(`div`).attr(`class`,`resizing`).style(`transform`,function(){return`translate(`+i.x*r.cellWidth+`px, `+i.y*r.cellHeight+`px)`}).style(`width`,function(){return i.w*r.cellWidth-r.gutter()+`px`}).style(`height`,function(){return i.h*r.cellHeight-r.gutter()+`px`}),r.dragItemPos={x:i.x,y:i.y}}).on(`drag`,function(e){if(!r.designMode())return;let n=(0,t.d3Event)();n.sourceEvent.stopPropagation();let i=r.itemsMap[e.id()],a=[Math.max(0,Math.round(n.x/r.cellWidth)),Math.max(0,Math.round(n.y/r.cellHeight))],o={w:Math.max(1,a[0]-i.x+1),h:Math.max(1,a[1]-i.y+1)};(i.w!==o.w||i.h!==o.h)&&(r.snapping()===`none`?(i.w=o.w,i.h=o.h):(r.resetItemsPos(),r.gridList.resizeItem(i,o)),(e.gridColSpan()!==i.w||e.gridRowSpan()!==i.h)&&(r.items.forEach(r.gridItemToCell),r.updateGrid(i.id,100))),r.dragItem.style(`width`,function(){return(-i.x+1)*r.cellWidth+n.x-r.gutter()+`px`}).style(`height`,function(){return(-i.y+1)*r.cellHeight+n.y-r.gutter()+`px`})}).on(`end`,function(){r.designMode()&&((0,t.d3Event)().sourceEvent.stopPropagation(),r.dragItem.remove(),r.dragItem=null,r.killGridList())})}updateGrid(e,t=0,n=!1){t||=0;let r=this;this.divItems.classed(`draggable`,this.designMode()).transition().duration(t).style(`left`,function(e){return e.gridCol()*r.cellWidth+r.gutter()/2+`px`}).style(`top`,function(e){return e.gridRow()*r.cellHeight+r.gutter()/2+`px`}).style(`width`,function(e){return e.gridColSpan()*r.cellWidth-r.gutter()+`px`}).style(`height`,function(e){return e.gridRowSpan()*r.cellHeight-r.gutter()+`px`}).on(`end`,function(t){t.surfaceShadow_default(r.surfaceShadow()).surfacePadding_default(r.surfacePadding()).surfaceBorderWidth_default(r.surfaceBorderWidth()).surfaceBackgroundColor_default(r.surfaceBackgroundColor()),(e===!0||e===t.id())&&t.resize().lazyRender()})}update(e,n){super.update(e,n),this._placeholderElement.style(`overflow-x`,this.fitTo()===`width`?`hidden`:null),this._placeholderElement.style(`overflow-y`,this.fitTo()===`width`?`scroll`:null);let r=this.getDimensions(),i=this.width()-(this.fitTo()===`width`?this._scrollBarWidth:0);if(this.cellWidth=i/r.width,this.cellHeight=this.fitTo()===`all`?this.height()/r.height:this.cellWidth,this.designMode()){let e=Math.min(this.width()/this.snappingColumns(),this.height()/this.snappingRows()),t=Math.floor(e);this.cellWidth=t,this.cellHeight=this.cellWidth}let a=this,o=n.selectAll(`#`+this.id()+` > .ddCell`).data(this.content(),function(e){return e.id()});this.divItems=o.enter().append(`div`).attr(`class`,`ddCell`).each(function(e){e.target(this),e.__grid_watch=e.monitor(function(t,n,r){a._renderCount&&(t===`snapping`||t.indexOf(`grid`)===0)&&n!==r&&(a.gridList||(a.initGridList(),a.snapping()!==`none`&&a.gridList.resizeGrid(a.snapping()===`horizontal`?a.snappingRows():a.snappingColumns()),a.items.forEach(a.gridItemToCell),a.updateGrid(e.id(),100),a.killGridList()))}),(0,t.select)(this).append(`div`).attr(`class`,`resizeHandle`).call(a._d3DragResize).append(`div`).attr(`class`,`resizeHandleDisplay`)}).merge(o),this.divItems.each(function(e){let n=(0,t.select)(this);a.designMode()?n.call(a._d3Drag):n.on(`mousedown.drag`,null).on(`touchstart.drag`,null)}),this.divItems.select(`.resizeHandle`).style(`display`,this.designMode()?null:`none`),this.updateGrid(!0),o.exit().each(function(e){e.target(null),e.__grid_watch&&e.__grid_watch.remove()}).remove();let s=n.selectAll(`#`+this.id()+` > .laneBackground`).data(this.designMode()?[``]:[]);s.enter().insert(`div`,`:first-child`).attr(`class`,`laneBackground`).style(`left`,`1px`).style(`top`,`1px`).on(`click`,function(){a.selectionBagClear()}).merge(s).style(`width`,this.snappingColumns()*this.cellWidth+`px`).style(`height`,this.snappingRows()*this.cellHeight+`px`),s.exit().each(function(){a.selectionBagClear()}).remove();let c=n.selectAll(`#`+this.id()+` > .lane`).data(this.designMode()?[``]:[]);c.enter().append(`div`).attr(`class`,`lane`).style(`left`,`1px`).style(`top`,`1px`),c.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`),c.exit().remove()}exit(e,t){this.content().forEach(e=>e.target(null)),super.exit(e,t)}_createSelectionObject(e){return{_id:e._id,element:()=>e._element,widget:e}}selection(e){return arguments.length?(this._selectionBag.set(e.map(function(e){return this._createSelectionObject(e)},this)),this):this._selectionBag.get().map(function(e){return e._id})}selectionBagClear(){this._selectionBag.isEmpty()||(this._selectionBag.clear(),this.postSelectionChange())}selectionBagClick(e){if(e!==null){let n=this._createSelectionObject(e);if((0,t.d3Event)().sourceEvent.ctrlKey)this._selectionBag.isSelected(n)?(this._selectionBag.remove(n),this.postSelectionChange()):(this._selectionBag.append(n),this.postSelectionChange());else{let e=this._selectionBag.get();e.length===1&&e[0]._id===n._id?this.selectionBagClear():this._selectionBag.set([n]),this.postSelectionChange()}}}postSelectionChange(){}applyLayout(e){this.divItems.each((t,n)=>{if(e[n]){let[r,i,a,o]=e[n];t.gridCol(r).gridRow(i).gridColSpan(a).gridRowSpan(o)}}),this.updateGrid(!0)}vizActivation(e){}};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:e=>!e.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});var HorizontalList=class extends FlexGrid{constructor(){super(),this.orientation_default(`horizontal`),this.flexWrap_default(`nowrap`)}};HorizontalList.prototype._class+=` layout_HorizontalList`;var Layered=class extends t.HTMLWidget{_contentContainer;_widgetPlacements;_widgetRatios;constructor(){super(),this._tag=`div`,this._widgetPlacements=[],this._widgetRatios=[]}addLayer(e,n=`default`,r=1,i=1){let a=this.widgets();return a.push(e||new t.Text().text(`No widget defined for layer.`)),this.widgets(a),this._widgetPlacements.push(n),this._widgetRatios.push([r,i]),this}enter(e,t){super.enter(e,t),this._contentContainer=t.append(`div`).attr(`class`,`container`)}update(e,t){super.update(e,t);let n=this;t.style(`padding`,this.surfacePadding()+`px`);let r=this._contentContainer.selectAll(`.content.id`+this.id()).data(this.widgets(),function(e){return e.id()});r.enter().append(`div`).attr(`class`,`content id`+this.id()).each(function(e,t){e.target(this)}).merge(r).each(function(e,t){let r={width:n.clientWidth(),height:n.clientHeight()},i=n.widgetSize(t,r),a=n.widgetPosition(t,r,i);this.style.top=a.y+`px`,this.style.left=a.x+`px`,e.resize(i).render()}),r.exit().each(function(e,t){e.target(null)}).remove(),r.order()}widgetSize(e,t){return this._widgetPlacements[e],{width:t.width*this._widgetRatios[e][0],height:t.height*this._widgetRatios[e][1]}}widgetPosition(e,t,n){switch(this._widgetPlacements[e]){default:return{x:0,y:0};case`top`:return{x:t.width/2-n.width/2,y:0};case`bottom`:return{x:t.width/2-n.width/2,y:t.height-n.height};case`left`:return{x:0,y:t.height/2-n.height/2};case`right`:return{x:t.width-n.width,y:t.height/2-n.height/2};case`center`:return{x:t.width/2-n.width/2,y:t.height/2-n.height/2}}}};Layered.prototype._class+=` layout_Layered`,Layered.prototype.publish(`surfacePadding`,0,`number`,`Padding`),Layered.prototype.publish(`widgets`,[],`widgetArray`,`widgets`,null,{tags:[`Private`]});var Popup=class extends t.HTMLWidget{_surfaceButtons;_originalPosition;constructor(){super(),this._tag=`div`,this._surfaceButtons=[]}updateState(e){e||=!this.popupState(),this.popupState(e).render()}enter(e,t){super.enter(e,t),this.widget().target(e),this._originalPosition=this.position()}update(e,t){super.update(e,t),t.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(e,t){let n,r;switch(this.centerPopup()){case`container`:this._placeholderElement&&(n=parseInt(this._placeholderElement.style(`width`))/2-this.widget().width()/2,r=parseInt(this._placeholderElement.style(`height`))/2-this.widget().height()/2),this.position(`absolute`);break;case`window`:n=window.innerWidth/2-this.widget().width()/2,r=window.innerHeight/2-this.widget().height()/2,this.position(`fixed`);break;default:n=0,r=0,this.position(this._originalPosition)}this.pos({x:n,y:r}),super.postUpdate(e,t),t.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(e,t){this.widget()&&this.widget().target(null),super.exit(e,t)}click(e){}};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`]});var Tabbed=class extends t.HTMLWidget{_tabContainer;_contentContainer;constructor(){super(),this._tag=`div`}clearTabs(){return this.labels([]),this.widgets([]),this}addTab(e,n,r,i){let a=e.size();a.width===0&&a.height===0&&e.size({width:`100%`,height:`100%`});let o=this.labels(),s=this.widgets();r&&this.activeTabIdx(this.widgets().length),o.push(n);let c=new Surface().widget(e||new t.Text().text(`No widget defined for tab`));return s.push(c),this.labels(o),this.widgets(s),i&&i(c),this}widgetSize(e){let t=this.clientWidth(),n=this.clientHeight(),r=this._tabContainer.node().getBoundingClientRect();return r.height!==void 0&&(n-=r.height),{width:t,height:n}}enter(e,t){super.enter(e,t),this._tabContainer=t.append(`div`),this._contentContainer=t.append(`div`)}update(e,n){super.update(e,n);let r=this;n.style(`padding`,this.surfacePadding_exists()?this.surfacePadding()+`px`:null);let i=this._tabContainer.selectAll(`.tab-button.id`+this.id()).data(this.showTabs()?this.labels():[],function(e){return e});i.enter().append(`span`).attr(`class`,`tab-button id`+this.id()).style(`cursor`,`pointer`).on(`click`,function(e,t){r.click(r.widgets()[t].widget(),e,t),r.activeTabIdx(t).render()}).merge(i).classed(`active`,function(e,t){return r.activeTabIdx()===t}).text(function(e){return e}),i.exit().remove();let a=this._contentContainer.selectAll(`.tab-content.id`+this.id()).data(this.widgets(),function(e){return e.id()});switch(a.enter().append(`div`).attr(`class`,`tab-content id`+this.id()).each(function(e,t){e.target(this)}).merge(a).classed(`active`,function(e,t){return r.activeTabIdx()===t}).style(`display`,function(e,t){return r.activeTabIdx()===t?`block`:`none`}).each(function(e,n){if(e.visible(r.activeTabIdx()===n),r.activeTabIdx()===n){let n=r.widgetSize((0,t.select)(this));e.surfaceBorderWidth(r.showTabs()?null:0).surfacePadding(r.showTabs()?null:0).resize(n)}}),a.exit().each(function(e,t){e.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`)}}click(e,t,n){}};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`]});var Toolbar=class extends t.HTMLWidget{constructor(){super(),this._tag=`div`}enter(e,t){super.enter(e,t)}update(e,n){super.update(e,n);let r=this;n.attr(`title`,r.title()).style(`background-color`,this.backgroundColor());let i=n.selectAll(`div.toolbar-title`).data(this.title()?[this.title()]:[]);i.enter().append(`div`).classed(`toolbar-title`,!0).append(`span`),i.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(r.title()),i.exit().remove();let a=n.selectAll(`div.toolbar-child`).data(this.widgets()===null?[]:this.widgets(),function(e){return e.id()});a.enter().insert(`div`,`div.toolbar-title`).each(function(e,n){let i=r.widgetClasses()[n]?r.widgetClasses()[n]+` toolbar-child`:`toolbar-child`;(0,t.select)(this).classed(i,!0),e.target(this)}),a.exit().each(function(e){e.target(null)}).remove(),a.order()}render(e){let t=this;return super.render(function(n){let r=t.element().node().getBoundingClientRect(),i=r.left+r.width;t.element().selectAll(`div.toolbar-child`).each(function(e,t){let n=this.getBoundingClientRect();i>n.left&&(i=n.left)}),t.element().select(`.toolbar-title`).style(`width`,i-r.left-4+`px`),e&&e(n)})}exit(e,t){this.widgets().forEach(function(e){e.target(null)}),super.exit(e,t)}};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`]});var VerticalList=class extends FlexGrid{constructor(){super(),this.orientation_default(`vertical`),this.flexWrap_default(`nowrap`)}};VerticalList.prototype._class+=` layout_VerticalList`,e.AbsoluteSurface=AbsoluteSurface,e.Accordion=Accordion,e.BUILD_VERSION=f,e.Border=Border,e.Border2=Border2,e.Carousel=Carousel,e.Cell=Cell,e.ChartPanel=ChartPanel,e.FlexGrid=FlexGrid,e.Grid=Grid,e.HorizontalList=HorizontalList,e.Layered=Layered,e.Legend=Legend,e.Modal=Modal,e.PKG_NAME=u,e.PKG_VERSION=d,e.Popup=Popup,e.Surface=Surface,e.Tabbed=Tabbed,e.Toolbar=Toolbar,e.VerticalList=VerticalList,e.WidgetDiv=WidgetDiv});
|
|
7
7
|
//# sourceMappingURL=index.umd.cjs.map
|
|
8
8
|
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.layout_AbsoluteSurface{pointer-events:none!important}.layout_AbsoluteSurface>.placeholder{pointer-events:all;position:relative;overflow:hidden}.layout_Accordion>ul{position:relative}.layout_Accordion.open>span{font-style:italic}.layout_Accordion.closed>ul{height:0;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{color:#fff;width:100%;height:26px;padding:4px 8px;font-size:13px;display:block;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;top:0;left:0}.layout_Accordion>.collapsible-icon{color:#fff;width:24px;height:24px;position:absolute;top:0;right:0}.layout_Surface{box-sizing:border-box;border:1px solid #e5e5e5;width:100%;height:100%;margin:0;overflow:hidden}.layout_Surface.shadow2{box-shadow:0 2px 2px #00000024,0 3px 1px -2px #0003,0 1px 5px #0000001f}.layout_Surface>h3{background-color:#e5e5e5;margin:0;padding:2px}.layout_Surface .html-button-container{position:absolute;top:3px;right:0}.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;font-size:100px;position:absolute;top:calc(50% - 74px);left:calc(50% - 56px)}div[draggable=true].hideDragCellContent.content-icon-Line:before{content:""}div[draggable=true].hideDragCellContent.content-icon-Pie:before{content:"";top:calc(50% - 72px);left:calc(50% - 45px)}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,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;z-index:1000;pointer-events:none;border-style:solid;border-width:0;padding:0;position:absolute;top:0;left:0}.layout_Border{width:100%;height:100%}.layout_Border>.border-content{width:100%;height:100%;position:relative}.layout_Border>.borderHandle{opacity:.3;visibility:hidden;background-color:#444;width:6px;height:6px;position:absolute}.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:1px solid #e5e5e5;border-radius:5px;display:inline-block;overflow:hidden}.layout_Border .cell h2{-webkit-margin:0px;text-align:center;margin:0;padding-top:4px}.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{box-sizing:border-box;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,#6464641a 4px 8px);border:2px dashed #7f8c8d;border-radius:0;position:fixed}.layout_Border .grid-drop-target.drop-target-over{background:repeating-linear-gradient(-45deg,#0000,#0000 6px,#119bd71a 6px 12px);border:2px dashed #179bd7}.layout_Border2{flex-direction:column;display:flex}.layout_Border2>.body{flex-flow:row;margin:0;padding:0;display:flex}.layout_Border2>.body>.center{flex:1}.layout_Border2>.header,.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:hidden scroll}.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{opacity:.5;z-index:10000;background-color:#000;position:fixed}.layout_Modal-content{z-index:10100;background-color:#fff;position:fixed}.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{border-style:solid;flex-grow:1;overflow:hidden}.layout_Grid>.ddCell{position:absolute}.layout_Grid>.laneBackground{background:#f5f5f5;border-style:solid;border-width:1px;position:absolute}.layout_Grid>.lane{opacity:.25;pointer-events:none;border-style:none;border-radius:0;position:absolute}.layout_Grid>.ddCell.draggable{cursor:move;background-color:#f8f8ff;border-style:solid;border-width:1px;border-radius:0}.layout_Grid>.ddCell.draggable>.resizeHandle{cursor:nwse-resize;border-style:none;width:8px;height:8px;position:absolute;bottom:0;right:0}.layout_Grid>.ddCell.draggable .resizeHandleDisplay{background-color:none;border:2px solid #a9a9a9;border-width:0 2px 2px 0;width:4px;height:4px;position:absolute;bottom:2px;right:2px}.layout_Grid>.ddCell.draggable .resizeHandleDisplay:hover{border-color:orange}.layout_Grid>.dragging{background:repeating-linear-gradient(-45deg,#0000,#0000 4px,#6464641a 4px 8px);border:1px solid gray;border-radius:0;position:absolute}.layout_Grid>.resizing{opacity:.3;background:repeating-linear-gradient(-45deg,#0000,#0000 4px,orange 4px 8px);border:1px solid gray;border-radius:0;position:absolute}.layout_Grid>.ddCell.draggable .common_Widget.selected{background:repeating-linear-gradient(-45deg,#0000,#0000 4px,#6400001a 4px 8px);border:1px solid red;border-radius:0;position:absolute}.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{background-color:#ccc;border-top:1px solid #ddd;border-left:1px solid #ddd;border-right:1px solid #ddd;margin-right:4px;padding:2px 2px 4px;display:inline-block;position:relative;top:1px}.layout_Tabbed .tab-button.active{z-index:999;background-color:#fff}.layout_Tabbed .on_bottom .tab-button{border-top:none;border-bottom:1px solid #ddd;top:-1px}.layout_Toolbar{white-space:nowrap;background-color:#ddd;height:100%;overflow:hidden}.layout_Toolbar .toolbar-title{text-overflow:ellipsis;white-space:nowrap;margin-left:4px;font-weight:700;display:inline-block;position:relative;top:50%;overflow:hidden;transform:translateY(-50%)}.layout_Toolbar .toolbar-child{float:right;margin-left:4px;margin-right:4px;line-height:16px;position:relative;top:50%;transform:translateY(-50%)}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|