@hpcc-js/eclwatch 3.6.1 → 3.6.2
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 +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var t,e,i,n,o,a,s,r,l,h,c,u,p,d,f,y,_,x,m,g,b,v,w,S,k,A,C=Object.defineProperty,M=(t,e)=>C(t,"name",{value:e,configurable:!0});import{Editor as P}from"@hpcc-js/codemirror";import{Workunit as T,BaseScope as I,Result as E,WUStateID as F}from"@hpcc-js/comms";import{SplitPanel as D}from"@hpcc-js/phosphor";import{DirectoryTree as R}from"@hpcc-js/tree";import{xml2json as z,hashSum as O,Subgraph as j,Vertex as N,Edge as L,normalizeRadians as B,degreesToRadians as V}from"@hpcc-js/util";import{local as H,select as $,Icon as W,Button as q,ToggleButton as G,Spacer as U,Palette as X,hsl as Y,Widget as Q,format as Z,selection as J,map as K,Utility as tt,SVGWidget as et,scaleTime as it,timeParse as nt,timeFormat as ot,scaleLog as at,scalePow as st,scaleLinear as rt,scaleBand as lt,brush as ht,brushX as ct,brushY as ut,brushSelection as pt,d3Event as dt,min as ft,max as yt,scaleSqrt as _t,extent as xt,Text as mt,FAChar as gt,HTMLWidget as bt,drag as vt,event as wt,interpolateHcl as St,interpolate as kt,rgb as At,CanvasWidget as Ct,zoom as Mt,dispatch as Pt,descending as Tt,tickStep as It,range as Et,thresholdSturges as Ft}from"@hpcc-js/common";import{Table as Dt,RowFormatter as Rt,domConstruct as zt,Deferred as Ot,QueryResults as jt,Common as Nt}from"@hpcc-js/dgrid";import{Vertex as Lt,Subgraph as Bt,Edge as Vt,Graph as Ht}from"@hpcc-js/graph";import{Legend as $t,ChartPanel as Wt,Carousel as qt}from"@hpcc-js/layout";import{ReactTimelineSeries as Gt}from"@hpcc-js/timeline";const Ut="@hpcc-js/eclwatch",Xt="3.6.1",Yt="3.21.1",Qt=class _ECLArchiveViewer extends D{_prevHash;_contentStr;_directoryPane=new R;_fileEditorPane=(new P).text("");constructor(){super("horizontal"),this._directoryPane.rowClick=t=>{this._fileEditorPane.text(t).render()}}transformArchiveTreeData(t){const e={label:t.name,children:t._children.map(i).filter(t=>t)};return e.children&&e.children[0]&&"html"===e.children[0].label?{label:"root",children:[{label:"error",content:JSON.stringify(e,null,4)}]}:e;function i(t){const e={};if(e.label=t.name+(t.$&&t.$.key?` (${t.$.key})`:""),t._children&&t._children.length>0)e.children=t._children.map(t=>i(t)).filter(t=>t);else{if("string"!=typeof t.content||!t.content.trim())return!1;e.content=t.content}return e}}updateDirectoryPane(t){let e;if(t)try{e=JSON.parse(t)}catch(i){e=z(t)}if(e){const t=this.transformArchiveTreeData(e);this._directoryPane.data(t).render()}}enter(t,e){super.enter(t,e),this.addWidget(this._directoryPane).addWidget(this._fileEditorPane)}update(t,e){super.update(t,e);const i=O({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==i||void 0===this._contentStr?T.attach({baseUrl:this.baseUrl()},this.wuid()).fetchArchive().then(t=>{this._contentStr=t,this.updateDirectoryPane(this._contentStr),this._prevHash=i}):this.updateDirectoryPane(this._contentStr),this.relativeSizes([this.directoryWidthRatio(),1-this.directoryWidthRatio()])}};M(Qt,"ECLArchiveViewer");let Zt=Qt;Zt.prototype._class+=" eclwatch_ECLArchiveViewer",Zt.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),Zt.prototype.publish("wuid","","string","Workunit ID"),Zt.prototype.publish("directoryWidthRatio",.38,"number","Default directory panel width ratio relative to the full width"),Zt.prototype.publish("contentString",null,"string","XML/JSON archive content string"),Zt.prototype.publishProxy("directoryPaneColor","_directoryPane","backgroundColor"),Zt.prototype.publishProxy("directoryPaneHoverColor","_directoryPane","hoverBackgroundColor"),Zt.prototype.publishProxy("iconSize","_directoryPane"),Zt.prototype.publishProxy("fontColor","_directoryPane"),Zt.prototype.publishProxy("fontFamily","_directoryPane"),Zt.prototype.publishProxy("fontSize","_directoryPane"),Zt.prototype.publishProxy("folderIconOpen","_directoryPane"),Zt.prototype.publishProxy("folderIconClosed","_directoryPane"),Zt.prototype.publishProxy("textFileIcon","_directoryPane"),Zt.prototype.publishProxy("codeFileIcon","_directoryPane"),Zt.prototype.publishProxy("verticalScroll","_directoryPane");const Jt=class _LegendVertex extends Lt{constructor(){super()}enter(t,e){super.enter(t,e),this._icon.on("click",()=>{this.click(this.data())})}click(t){}};M(Jt,"LegendVertex");let Kt=Jt;const te=class _WUGraphLegend extends $t{icon=H();_disabled2={};disabled(t){if(!arguments.length){const t=[];for(const e in this._disabled2)this._disabled2[e]&&t.push(e);return t}return this._disabled2={},t.forEach(t=>this._disabled2[t]=!0),this}toggle(t){this._disabled2[t]=!this._disabled2[t]}update(t,e){super.update(t,e);const i=this,n=this._g.selectAll(".legendItem").data(this.data(),t=>t.kind);n.enter().append("g").attr("class","legendItem").each(function(t){i.icon.set(this,(new Kt).target(this).data(t.kind).textbox_shape_colorStroke("none").textbox_shape_colorFill("none").iconAnchor("left").faChar(t.faChar).text(`${t.label} (${t.count})`).tooltip(`${t.kind} - ${t.label}`).on("click",t=>{i.toggle(t),i.render(),i.click(t)}).on("mouseover",t=>{i.mouseover(t)}).on("mouseout",t=>{i.mouseout(t)}))}).merge(n).each(function(t,e){const n=i.icon.get(this).icon_shape_colorFill(i._disabled2[t.kind]?"gray":null).render().getBBox();$(this).attr("transform",`translate(${+n.width/2}, ${30*e})`)}),n.exit().each(function(t){i.icon.get(this).target(null).render()}).remove();const o=this.getBBox(!0,!0);this._g.attr("transform",`translate(16, ${this.height()/2-o.height/2})`)}click(t){}mouseover(t){}mouseout(t){}};M(te,"WUGraphLegend");let ee=te;function ie(t){switch(t){case"2":case"44":case"47":case"56":case"61":case"35":case"37":return"";case"3":return"";case"5":return"";case"6":return"";case"12":return"";case"15":case"17":case"59":return"";case"22":return"";case"23":return"";case"25":case"133":case"148":return"";case"26":case"19":return"";case"29":case"16":return"";case"36":return"";case"54":return"";case"82":case"88":case"99":case"105":case"71":return"";case"92":case"93":return"";case"7":return"";case"9":return"";case"21":case"168":return""}return""}ee.prototype._class+=" eclwatch_WUGraphLegend",M(ie,"faCharFactory");const ne=class _WUScopeController{graphDB;subgraphsMap={};rSubgraphsMap={};verticesMap={};rVerticesMap={};edgesMap={};rEdgesMap={};kindMap={};_disabled={};constructor(){}clear(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={}}set(t){this.graphDB=t,this.graphGui(this.graphDB),this.kindMap={},this.graphDB.walk(t=>{if(t instanceof j);else if(t instanceof N){const e=t._.attr("Kind").RawValue;this.kindMap[e]||(this.kindMap[e]=[]),this.kindMap[e].push(t)}})}disabled(t){if(!arguments.length){const t=[];for(const e in this._disabled)this._disabled[e]&&t.push(e);return t}return this._disabled={},t.forEach(t=>this._disabled[t]=!0),this}graphGui(t){const e={subgraphs:[],vertices:[],edges:[],hierarchy:[]};return t.walk(t=>{if(t instanceof j){const i=this.appendSubgraph(t,e.hierarchy,e.subgraphs);i.showMinMax(t.vertices.length>3||"normal"!==i.minState())}else t instanceof N?this.appendVertex(t,e.hierarchy,e.vertices):t instanceof L&&this.appendEdge(t,e.edges)}),e}format(t,e){let i="",n=t.indexOf("%"),o=-1;for(;n>=0;){if(i+=t.substring(o+1,n),o=t.indexOf("%",n+1),o<0){console.warn("Invalid Label Template");break}i+=t.substring(n+1,o)?e[t.substring(n+1,o)]||"":"%",n=t.indexOf("%",o+1)}return i+=t.substring(o+1,t.length),i.split("\\n").join("\n")}createSubgraph(t){let e=this.subgraphsMap[t._.Id];return e||(e=(new Bt).title(t._.Id).on("minClick",()=>{this.minClick(e)}),this.subgraphsMap[t._.Id]=e,this.rSubgraphsMap[e.id()]=t),e}createVertex(t){let e=this.verticesMap[t._.Id];if(!e){const i=t._.rawAttrs();if("dummy"===t._.ScopeType){const i=this.subgraphsMap[t.parent._.Id];e=(new W).shape_colorFill("darkred").shape_colorStroke("darkred").image_colorFill("white").faChar("").on("click",()=>{i.minState("normal"),this.minClick(i)})}else{e=(new Lt).icon_shape_colorFill("#1f77b4").icon_image_colorFill("white").faChar(ie(i.Kind)).text(i.Label);const n=[];t._.hasAttr("Definition")&&n.push({faChar:"",tooltip:"Definition",shape_colorFill:"lightgray",shape_colorStroke:"lightgray",image_colorFill:"black"}),t._.hasAttr("IsInternal")&&n.push({faChar:"",tooltip:"IsInternal",shape_colorFill:"red",shape_colorStroke:"red",image_colorFill:"white"}),e.annotationIcons(n)}this.verticesMap[t._.Id]=e,this.rVerticesMap[e.id()]=t}return e}isSpill(t){const e=t.source._.attr("Kind").RawValue,i=t.target._.attr("Kind").RawValue;return"2"===e||"71"===i}spansSubgraph(t){return t.source.parent._.Id!==t.target.parent._.Id}createEdge(t){let e=this.edgesMap[t._.Id];if(!e){const i=t._.rawAttrs(),n=this.verticesMap[t.source._.Id],o=this.verticesMap[t.target._.Id];if(n&&o){const a=this.isSpill(t),s=this.spansSubgraph(t),r=this.format("%Label%\n%NumRowsProcessed%",i);let l=null,h=100;i.IsDependency?(h=10,l="1,5"):i._childGraph?l="5,5":a?(h=25,l="5,5,10,5"):s&&(h=5,l="5,5"),e=(new Vt).sourceVertex(n).targetVertex(o).sourceMarker("circle").targetMarker("arrow").weight(h).strokeDasharray(l).text(r),this.edgesMap[t._.Id]=e,this.rEdgesMap[e.id()]=t}}return e}appendSubgraph(t,e,i){const n=this.createSubgraph(t);i.push(n);const o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:n}),n}appendVertex(t,e,i){const n=this.createVertex(t);i.push(n);const o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:n}),n}appendEdge(t,e){const i=this.createEdge(t);return i&&e.push(i),i}filterLegend(t){for(let e=t.vertices.length-1;e>=0;--e){const i=t.vertices[e],n=i._.attr("Kind").RawValue;this._disabled[n]&&i.remove(!1,(t,e)=>new I({ScopeName:i._.ScopeName+":in",Id:t.Id+"->"+e.Id,ScopeType:"dummy-edge",Properties:{Property:[i._.attr("Label")]},Notes:{Note:[]},SinkActivity:""}))}}filterPartial(t){for(const e of t.subgraphs){if("partial"===this.subgraphsMap[e._.Id].minState()){const t=e.vertices,i=[],n=[];for(const e of t)0===e.inEdges.length||e.inEdges.some(t=>t.source.parent!==t.target.parent)||0===e.outEdges.length||e.outEdges.some(t=>t.source.parent!==t.target.parent)?i.push(e):n.push(e);if(n.length>1){const t={ScopeName:e._.ScopeName,Id:e._.Id+":dummy",ScopeType:"dummy",Properties:{Property:[{Name:"Activities",RawValue:""+n.length,Formatted:""+n.length,Measure:"count",Creator:"",CreatorType:""}]},Notes:{Note:[]},SinkActivity:""},o=new I(t),a=e.createVertex(o);for(const s of n){for(const t of s.inEdges)if(i.indexOf(t.source)>=0){const i=new I({ScopeName:t.source._.ScopeName,Id:t.source._.Id+"->"+a._.Id,ScopeType:"dummy-in",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});e.createEdge(t.source,a,i)}for(const t of s.outEdges)if(i.indexOf(t.target)>=0){const i=new I({ScopeName:t.target._.ScopeName,Id:a._.Id+"->"+t.target._.Id,ScopeType:"dummy-out",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});e.createEdge(a,t.target,i)}}n.forEach(t=>t.remove(!0))}}}}filterEmptySubgraphs(t){for(;;){const e=t.subgraphs.filter(t=>0===t.subgraphs.length&&0===t.vertices.length);if(0===e.length)break;e.forEach(t=>t.remove(!0))}}removeObsoleteSubgraphs(t){for(const e of[...t.subgraphs])0===e.vertices.length&&e.remove(!1)}graphData(){const t=this.graphDB.clone();return this.filterLegend(t),this.filterPartial(t),this.filterEmptySubgraphs(t),this.removeObsoleteSubgraphs(t),this.graphGui(t)}calcLegend(){const t=[];for(const e in this.kindMap)t.push({kind:parseInt(e),faChar:ie(e),label:this.kindMap[e][0]._.attr("Label").RawValue.split("\n")[0],count:this.kindMap[e].length});return t}vertices(t){const e=[];for(const i of this.kindMap[t])e.push(this.verticesMap[i._.Id]);return e}formatRow(t,e,i){const n=t._.formattedAttrs();for(const o in n){const t=e.indexOf(o);-1===t?(e.push(o),i.push(n[o])):i[t]=n[o]}for(let o=0;o<100;++o)void 0===i[o]&&(i[o]="");return i}activityData(){const t=["Id","Kind","Label"],e=this.graphDB.vertices.map(e=>{const i=[parseInt(e._.Id.split("a")[1])];return this.formatRow(e,t,i)});return{columns:t,data:e}}edgeData(){const t=["Id","Label"],e=this.graphDB.edges.map(e=>{const i=[e._.Id];return this.formatRow(e,t,i)});return{columns:t,data:e}}subgraphData(){const t=["Id","Label"],e=this.graphDB.subgraphs.map(e=>{const i=[e._.Id];return this.formatRow(e,t,i)});return{columns:t,data:e}}calcGraphTooltip(t){let e,i;if(t instanceof Bt){const n=this.rSubgraphsMap[t.id()];e=n._,i=n.parent._}else if(t instanceof Lt||t instanceof W){const n=this.rVerticesMap[t.id()];e=n._,i=n.parent._}else if(t instanceof Vt){const n=this.rEdgesMap[t.id()];e=n._,i=n.parent._}return e?e.calcTooltip(i):""}subgraph(t){return this.subgraphsMap[t]}vertex(t){return this.verticesMap[t]}edge(t){return this.edgesMap[t]}minClick(t){}};M(ne,"WUScopeController");let oe=ne;const ae=class _WUGraph extends Wt{_partialAll=(new q).faChar("fa-window-restore").tooltip("Partial All").on("click",()=>{this.stateClick(this._partialAll)});_maxAll=(new q).faChar("fa-window-maximize").tooltip("Max All").on("click",()=>{this.stateClick(this._maxAll)});_toggleGraph=(new G).faChar("fa-chain").tooltip("Graph").selected(!0).on("click",()=>{this.viewClick(this._toggleGraph)});_toggleActivities=(new G).faChar("fa-table").tooltip("Activitiies").selected(!1).on("click",()=>{this.viewClick(this._toggleActivities)});_toggleEdges=(new G).faChar("fa-table").tooltip("Edges").selected(!1).on("click",()=>{this.viewClick(this._toggleEdges)});_toggleSubgraphs=(new G).faChar("fa-table").tooltip("Subgraphs").selected(!1).on("click",()=>{this.viewClick(this._toggleSubgraphs)});_graph=(new Ht).layout("Hierarchy").applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1);_activities=(new Dt).pagination(!1);_edges=(new Dt).pagination(!1);_subgraphs=(new Dt).pagination(!1);_legend=new ee(this).on("click",t=>{this.render()}).on("mouseover",t=>{const e={};for(const i of this._gc.vertices(t))e[i.id()]=!0;this._graph.highlightVerticies(e)}).on("mouseout",t=>{this._graph.highlightVerticies()});_view=(new qt).widgets([this._graph,this._activities,this._edges,this._subgraphs]);_gc=new oe;constructor(){super(),this.topOverlay(!1),this.widget(this._view);const t=[this._toggleGraph,this._toggleActivities,this._toggleEdges,this._toggleSubgraphs,new U,this._partialAll,this._maxAll,new U,...this._graph.iconBarButtons(),new U];this.buttons(t.concat(this.buttons())),this._gc.minClick=t=>{this.loadGraph(),this._graph.render(e=>{this._graph.selection([t]).centerOnItem(t)})},this._graph.tooltipHTML(t=>this._gc.calcGraphTooltip(t))}stateClick(t){switch(t){case this._partialAll:this._graph.data().subgraphs.forEach(t=>{t.minState("partial")});break;case this._maxAll:this._graph.data().subgraphs.forEach(t=>{t.minState("normal")})}this.render()}viewClick(t){switch(this._toggleGraph.selected(t===this._toggleGraph),this._toggleActivities.selected(t===this._toggleActivities),this._toggleEdges.selected(t===this._toggleEdges),this._toggleSubgraphs.selected(t===this._toggleSubgraphs),t){case this._toggleGraph:this._view.active(0);break;case this._toggleActivities:this._view.active(1);break;case this._toggleEdges:this._view.active(2);break;case this._toggleSubgraphs:this._view.active(3)}this.render(t=>{})}_prevHashSum;_prevScopeGraph;fetchScopeGraph(){const t=O({baseUrl:this.baseUrl(),wuid:this.wuid(),graphID:this.graphID(),subgraphID:this.subgraphID()});if(!this._prevScopeGraph||this._prevHashSum!==t){this.startProgress(),this._prevHashSum=t,this._gc.clear();return T.attach({baseUrl:this.baseUrl()},this.wuid()).fetchGraphs().then(t=>{for(const e of t)if(e.Name===this.graphID())return this.finishProgress(),e.fetchScopeGraph(this.subgraphID())}).then(t=>(this._prevScopeGraph=t,this._prevScopeGraph))}return Promise.resolve(this._prevScopeGraph)}enter(t,e){super.enter(t,e)}update(t,e){super.update(t,e)}exit(t,e){super.exit(t,e)}loadGraph(){this._gc.disabled(this._legend.disabled()),this._graph.data(this._gc.graphData(),!0);{const{columns:t,data:e}=this._gc.activityData();this._activities.columns(t).data(e)}{const{columns:t,data:e}=this._gc.edgeData();this._edges.columns(t).data(e)}{const{columns:t,data:e}=this._gc.subgraphData();this._subgraphs.columns(t).data(e)}}render(t){return this.wuid()&&this.graphID()?this.fetchScopeGraph().then(e=>{this._gc.set(e),this._legend.data(this._gc.calcLegend()),this.loadGraph(),super.render(t)}):super.render(t),this}selection(t){if(!arguments.length)return this._graph.selection();const e=this._gc.vertex(t)||this._gc.edge(t)||this._gc.subgraph(t);return e&&this._graph.selection([e]),this}};M(ae,"WUGraph");let se=ae;function re(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function le(t){switch(Object.prototype.toString.call(t)){case"[object Undefined]":case"[object Boolean]":case"[object Number]":return t;case"[object String]":return re(t);default:console.warn("Unknown cell type: "+Object.prototype.toString.call(t))}return t}se.prototype._class+=" eclwatch_WUGraph",se.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),se.prototype.publish("wuid","","string","Workunit ID"),se.prototype.publish("graphID","","string","Graph ID"),se.prototype.publish("subgraphID","","string","Subgraph ID"),M(re,"entitiesEncode"),M(le,"safeEncode");const he=class _Store{wuResult;schema;_columns;_cache={};rowFormatter;_filter={};onError;constructor(t,e,i,n={},o){this.wuResult=t,this.schema=e,this._columns=this.schema2Columns(this.schema.root),this.rowFormatter=new Rt(this._columns,i),this._filter=n,this.onError=o}columns(){return this._columns}schema2Columns(t,e=""){return t?t.children().filter(t=>-1===t.name.indexOf("__hidden",t.name.length-8)).map((t,i)=>{const n=t.name,o=t.attrs["hpcc:keyed"],a={field:e+n,leafID:n,idx:i,label:n+(o?" (i)":""),className:"resultGridCell",hidden:!1,sortable:!1,width:o?16:0,isSet:t.isSet},s=this.schema2Columns(t,e+n+"_");return s.length?(a.width+=10+s.reduce((t,e)=>t+e.width,0),a.children=s):(a.width+=9*t.charWidth(),a.formatter=(t,e)=>{switch(typeof t){case"string":return{html:t.replace(/\t/g," ").trim()};case"undefined":return""}return t}),a}):[]}isChildDataset(t){if("[object Object]"!==Object.prototype.toString.call(t))return!1;let e=0,i=null;for(const n in t)i||(i=Object.prototype.toString.call(t[n])),e++;return 1===e&&"[object Array]"===i}rowToTable(t,e,i){if(this.isChildDataset(t)){for(const n in t)this.rowToTable(t[n],e,i);return}const n=zt.create("table",{border:1,cellspacing:0,width:"100%"},i);switch(Object.prototype.toString.call(t)){case"[object Object]":let o=zt.create("tr",null,n);for(const e in t)zt.create("th",{innerHTML:le(e)},o);o=zt.create("tr",null,n);for(const n in t)switch(Object.prototype.toString.call(t[n])){case"[object Object]":case"[object Array]":this.rowToTable(t[n],e,i);break;default:zt.create("td",{innerHTML:le(t[n])},o)}break;case"[object Array]":for(let e=0;e<t.length;++e)switch(Object.prototype.toString.call(t[e])){case"[object Boolean]":case"[object Number]":case"[object String]":const i=zt.create("tr",null,n);zt.create("td",{innerHTML:le(t[e])},i);break;default:if(0===e){const i=zt.create("tr",null,n);for(const n in t[e])zt.create("th",{innerHTML:le(n)},i)}zt.create("tr",null,n);for(const n in t[e])if(t[e][n])if("[object Object]"===Object.prototype.toString.call(t[e][n])||"[object Array]"===Object.prototype.toString.call(t[e][n])){const o=zt.create("td",null,i);this.rowToTable(t[e][n],t[e],o)}else if(-1!==n.indexOf("__html",n.length-6))zt.create("td",{innerHTML:t[e][n]},i);else if(-1!==n.indexOf("__javascript",n.length-12))zt.create("td",null,i);else{const o=t[e][n];zt.create("td",{innerHTML:le(o)},i)}else zt.create("td",{innerHTML:""},i)}}}getIdentity(t){return t.__hpcc_id}_request(t,e){if(!this.wuResult)return Promise.resolve({totalLength:0,data:[]});const i=`${t}->${e}`;if(this._cache[i])return this._cache[i];const n=this.wuResult.fetchRows(t,e-t,!1,this._filter).then(e=>({totalLength:this.wuResult.Total,data:e.map((e,i)=>{const n=this.rowFormatter.format(e);return n.__hpcc_id=t+i,n.__hpcc_orig=e,n})})).catch(t=>(this.onError(t.Message||"An exception has occurred"),{totalLength:0,data:[]}));return this._cache[i]=n,n}fetchRange(t){const e=new Ot;return this._request(t.start,t.end).then(t=>e.resolve(t)),new jt(e.then(t=>t.data),{totalLength:e.then(t=>t.totalLength)})}};M(he,"Store");let ce=he;const ue=class _WUResult extends Nt{_result;_localStore;constructor(){super(),this.renderHtml(!1)}hashSum(t={}){return O({baseUrl:this.baseUrl(),wuid:this.wuid(),resultName:this.resultName(),sequence:this.sequence(),nodeGroup:this.nodeGroup(),logicalFile:this.logicalFile(),userID:this.user(),password:this.password(),bypassCache:this.bypassCache(),...t})}_prevResultHash;calcResult(){const t=this.hashSum();if(this._prevResultHash!==t){this._prevResultHash=t;const e={baseUrl:this.baseUrl(),userID:this.user(),password:this.password()};this.wuid()&&this.resultName()?this._result=E.attach(e,this.wuid(),this.resultName()):this.wuid()&&void 0!==this.sequence()?this._result=E.attach(e,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=E.attachLogicalFile(e,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=E.attachLogicalFile(e,"",this.logicalFile())),this._result&&this.bypassCache()&&this._result.bypassCache(this.bypassCache())}return this._result}fetch(t,e,i=new AbortController){const n=this.calcResult();return n?n.fetchRows(t,e,!1,{},i.signal):Promise.resolve([])}_prevStoreHash;_prevQueryHash;update(t,e){super.update(t,e);const i=this.hashSum({renderHtml:this.renderHtml(),filter:this.filter()});if(this._prevStoreHash!==i){this._prevStoreHash=i;const t=this.calcResult();t&&t.fetchXMLSchema().then(e=>{this._localStore=new ce(t,e,this.renderHtml(),this.filter(),t=>{this._dgrid&&(this._dgrid.noDataMessage=`<span class='dojoxGridNoData'>${t}</span>`,this._dgrid.refresh())}),this._dgrid?.set("columns",this._localStore.columns()),this._dgrid?.set("collection",this._localStore)})}}click(t,e,i){}};M(ue,"WUResult");let pe=ue;pe.prototype._class+=" eclwatch_WUResult",pe.prototype.publish("baseUrl","","string","URL to WsWorkunits"),pe.prototype.publish("user","","string","User ID"),pe.prototype.publish("password","","string","Password"),pe.prototype.publish("wuid","","string","Workunit ID"),pe.prototype.publish("resultName","","string","Result Name"),pe.prototype.publish("sequence",void 0,"number","Sequence Number"),pe.prototype.publish("nodeGroup","","string","NodeGroup"),pe.prototype.publish("logicalFile","","string","Logical File Name"),pe.prototype.publish("filter",{},"object","Filter"),pe.prototype.publish("bypassCache",!1,"boolean","Bypass cached results");var de=/* @__PURE__ */(t=>(t.CREATE="Created",t.COMPILE="Compiled",t.EXECUTE="Executed",t.COMPLETE="Completed",t))(de||{}),fe=/* @__PURE__ */(t=>(t.CREATE="Creating",t.COMPILE="Compiling",t.EXECUTE="Executing",t.COMPLETE="Completed",t))(fe||{});const ye=class _WUStatus extends Ht{_wu;_wuHandle;_create;_compile;_execute;_complete;constructor(){super(),this.zoomable(!1).zoomToFitLimit(1).layout("Hierarchy").hierarchyRankDirection("LR").showToolbar(!1).allowDragging(!1)}_prevHash;attachWorkunit(){const t=O({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==t&&(this._prevHash=t,this._wu=T.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch(t=>{this.lazyRender()}))}createVertex(t){return(new Lt).icon_diameter(32).icon_shape_colorFill("none").icon_shape_colorStroke("none").icon_image_colorFill("darkgray").iconAnchor("middle").textbox_shape_colorFill("none").textbox_shape_colorStroke("none").textbox_text_colorFill("darkgray").faChar(t)}updateVertex(t,e){t.icon_image_colorFill(e).textbox_text_colorFill(e)}updateVertexStatus(t,e=!1){const i=this._wu.isFailed()?"darkred":"darkgreen";switch(this._create.text("Created"),this._compile.text("Compiled"),this._execute.text("Executed"),this._complete.text("Completed"),t){case 0:this.updateVertex(this._create,"darkgray"),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 1:this._create.text("Creating"),this.updateVertex(this._create,e?"orange":i),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 2:this._compile.text("Compiling"),this.updateVertex(this._create,i),this.updateVertex(this._compile,e?"orange":i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,"darkgray");break;case 3:this._execute.text("Executing"),this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,e?"orange":i),this.updateVertex(this._complete,"darkgray");break;case 4:this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,i)}}createEdge(t,e){return(new Vt).sourceVertex(t).targetVertex(e).strokeColor("black").showArc(!1)}enter(t,e){super.enter(t,e),this._create=this.createVertex(""),this._compile=this.createVertex(""),this._execute=this.createVertex(""),this._complete=this.createVertex("");const i=this.createEdge(this._create,this._compile),n=this.createEdge(this._compile,this._execute),o=this.createEdge(this._execute,this._complete);this.data({vertices:[this._create,this._compile,this._execute,this._complete],edges:[i,n,o]})}update(t,e){switch(this.attachWorkunit(),this._wu.StateID){case F.Blocked:case F.Wait:case F.Scheduled:case F.UploadingFiled:this.updateVertexStatus(1);break;case F.Compiling:this.updateVertexStatus(2,!0);break;case F.Submitted:this.updateVertexStatus(1,!0);break;case F.Compiled:this.updateVertexStatus(2);break;case F.Aborting:case F.Running:this.updateVertexStatus(3,!0);break;case F.Aborted:case F.Archived:case F.Completed:this.updateVertexStatus(4);break;case F.Failed:this.updateVertexStatus(4,!1);break;case F.DebugPaused:case F.DebugRunning:case F.Paused:case F.Unknown:default:this.updateVertexStatus(0)}super.update(t,e),this.zoomToFit()}exit(t,e){this._wuHandle&&this._wuHandle.release(),super.exit(t,e)}};M(ye,"WUStatus");let _e=ye;_e.prototype._class+=" eclwatch_WUStatus",_e.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),_e.prototype.publish("wuid","","string","Workunit ID");var xe=Object.defineProperty,me=/* @__PURE__ */M((t,e)=>xe(t,"name",{value:e,configurable:!0}),"o");function ge(){}function be(){}function ve(){}function we(){}function Se(t){return"function"==typeof t.highlightColumn}function ke(){}function Ae(){}function Ce(){let t=h,e=c,i=u,n=C(document.body),o=w(),a=null,s=null,r=null;const l=/* @__PURE__ */me(function(t){if(a=S(t),!a)return;s=a.createSVGPoint();const e=n();e&&o&&e.appendChild(o)},"tip2");function h(){return"n"}function c(){return[0,0]}function u(){return" "}M(h,"h"),M(c,"y"),M(u,"d"),l.show=function(t,o,a){r=a[o];const s=Array.prototype.slice.call(arguments),h=i.apply(this,s);if(null===h)return l;const c=e.apply(this,s),u=k();let f,y=d.length;const _=n().getBoundingClientRect();for(u.html(h).style("opacity",1).style("pointer-events","all");y--;)u.classed(d[y],!1);let x=!1;const m={};let g=d[0];for(let e=0;e<d.length&&(x=w(d[e]),!x);e++);if(x)u.classed("notick",!1);else{u.classed("notick",!0);const t=v(m[g]),e=b(m[g]);w(g,t,e)}return l;function b(t){return t.left>t.right?t.left>0?-t.left:0:t.right>0?t.right:0}function v(t){return t.top>t.bottom?t.top>0?-t.top:0:t.bottom}function w(t,e,i){e=e||0,i=i||0,u.style("white-space","nowrap"),f=p.get(t).apply(this),u.classed(t,!0).style("top",f.top+c[0]-e+"px").style("left",f.left+c[1]-i+"px");const n=u.node().getBoundingClientRect(),o=n.top>_.top&&n.left>_.left&&n.bottom<_.bottom&&n.right<_.right;return m[t]={top:_.top-n.top,right:n.right-_.right,bottom:n.bottom-_.bottom,left:_.left-n.left},u.style("white-space","normal"),m[t].total_overflow=Object.keys(m[t]).filter(e=>m[t][e]>0).reduce((e,i)=>e+m[t][i],0),m[g].total_overflow>m[t].total_overflow&&(g=t),o||u.classed(t,!1),o}},l.hide=function(){return k().style("opacity",0).style("pointer-events","none"),l},l.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return k().attr(t);const i=Array.prototype.slice.call(arguments);return J.prototype.attr.apply(k(),i),l},l.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return k().style(t);const i=Array.prototype.slice.call(arguments);return J.prototype.style.apply(k(),i),l},l.direction=function(e){return arguments.length?(t=null==e?e:C(e),l):t},l.offset=function(t){return arguments.length?(e=null==t?t:C(t),l):e},l.html=function(t){return arguments.length?(i=null==t?t:C(t),l):i},l.rootElement=function(t){return arguments.length?(n=C(t),l):n},l.destroy=function(){return o&&(k().remove(),o=null),l},me(h,"d3TipDirection"),me(c,"d3TipOffset"),me(u,"d3TipHTML");const p=K({n:f,s:y,e:_,w:x,nw:m,ne:g,sw:b,se:v}),d=p.keys();function f(){const t=A(window);return{top:t.n.y-o.offsetHeight,left:t.n.x-o.offsetWidth/2}}function y(){const t=A(window);return{top:t.s.y+8,left:t.s.x-o.offsetWidth/2}}function _(){const t=A(window);return{top:t.e.y-o.offsetHeight/2,left:t.e.x+8}}function x(){const t=A(window);return{top:t.w.y-o.offsetHeight/2,left:t.w.x-o.offsetWidth-8}}function m(){const t=A(window);return{top:t.nw.y-o.offsetHeight,left:t.nw.x-o.offsetWidth}}function g(){const t=A(window);return{top:t.ne.y-o.offsetHeight,left:t.ne.x}}function b(){const t=A(window);return{top:t.sw.y,left:t.sw.x-o.offsetWidth}}function v(){const t=A(window);return{top:t.se.y,left:t.se.x}}function w(){const t=$(document.createElement("div"));return t.attr("class","d3-tip").style("position","absolute").style("top","0px").style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function S(t){const e=t.node();return e?"svg"===e.tagName.toLowerCase()?e:e.ownerSVGElement:null}function k(){return null==o&&(o=w(),n().appendChild(o)),$(o)}function A(t){let e=r||t;for(;null==e.getCTM&&null!=e.parentNode;)e=e.parentNode;const i={},n=e.getCTM(),o=e.getBBox(),a=o.width,l=o.height,h=o.x,c=o.y;return s.x=h,s.y=c,i.nw=s.matrixTransform(n),s.x+=a,i.ne=s.matrixTransform(n),s.y+=l,i.se=s.matrixTransform(n),s.x-=a,i.sw=s.matrixTransform(n),s.y-=l/2,i.w=s.matrixTransform(n),s.x+=a,i.e=s.matrixTransform(n),s.x-=a/2,s.y-=l/2,i.n=s.matrixTransform(n),s.y+=l,i.s=s.matrixTransform(n),i}function C(t){return"function"==typeof t?t:function(){return t}}return M(f,"g"),M(y,"v"),M(_,"x"),M(x,"w"),M(m,"C"),M(g,"_"),M(b,"k"),M(v,"F"),M(w,"E"),M(S,"T"),M(k,"V"),M(A,"S"),M(C,"I"),me(f,"directionNorth"),me(y,"directionSouth"),me(_,"directionEast"),me(x,"directionWest"),me(m,"directionNorthWest"),me(g,"directionNorthEast"),me(b,"directionSouthWest"),me(v,"directionSouthEast"),me(w,"initNode"),me(S,"getSVGNode"),me(k,"getNodeEl"),me(A,"getScreenBBox"),me(C,"functor"),l}function Me(){if(this.tooltip=Ce(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=Z(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=Z(this.tooltipValueFormat())),this.layerEnter){const t=this.layerEnter;this.layerEnter=function(e,i,n){this._parentOverlay||(this._parentOverlay=e._parentOverlay),this.tooltipEnter(i),t.apply(this,arguments)};const e=this.layerUpdate;this.layerUpdate=function(t){e.apply(this,arguments),this.tooltipUpdate()};const i=this.layerExit;this.layerExit=function(t){this.tooltipExit(),i.apply(this,arguments)}}else{const t=this.enter;this.enter=function(e,i){this.tooltipEnter(i),t.apply(this,arguments)};const e=this.update;this.update=function(t,i){e.apply(this,arguments),this.tooltipUpdate()};const i=this.exit;this.exit=function(t,e){this.tooltipExit(),i.apply(this,arguments)}}}M(ge,"f"),M(be,"h"),M(ve,"y"),M(we,"d"),M(Se,"b"),M(ke,"m"),M(Ae,"g"),M(Ce,"v"),M(Me,"x"),me(ge,"I1DChart"),ge.prototype._dataFamily="1D",ge.prototype._palette=X.rainbow("default"),ge.prototype.click=function(t,e,i){},ge.prototype.dblclick=function(t,e,i){},me(be,"I2DChart"),be.prototype._dataFamily="2D",be.prototype._palette=X.ordinal("default"),be.prototype.fillColor=function(t,e,i,n){return this._palette(t[0])},be.prototype.strokeColor=function(t,e,i,n){return Y(this.fillColor(t,e,i,n)).darker().toString()},be.prototype.textColor=function(t,e,i,n){return X.textColor(this.fillColor(t,e,i,n))},be.prototype.click=function(t,e,i){},be.prototype.dblclick=function(t,e,i){},me(ve,"I2DAggrChart"),ve.prototype._palette=X.rainbow("default"),ve.prototype.fillColor=function(t,e,i){return this._palette(t.length)},ve.prototype.strokeColor=function(t,e,i){return Y(this.fillColor(t,e,i)).darker().toString()},ve.prototype.textColor=function(t,e,i){return X.textColor(this.fillColor(t,e,i))},ve.prototype.click=function(t,e,i){},ve.prototype.dblclick=function(t,e,i){},me(we,"IGraph"),we.prototype._dataFamily="graph",we.prototype.vertex_click=function(t,e,i,n){n&&n.vertex},we.prototype.vertex_dblclick=function(t,e,i,n){n&&n.vertex},we.prototype.edge_click=function(t,e,i,n){n&&n.edge},we.prototype.edge_dblclick=function(t,e,i,n){n&&n.edge},me(Se,"instanceOfIHighlight"),me(ke,"IInput"),ke.prototype=Object.create(Q.prototype),ke.prototype.constructor=ke,ke.prototype.isValid=function(){return!(this.validate()&&!new RegExp(this.validate()).test(this.value()))},ke.prototype.hasValue=function(){if("function"==typeof this.type){switch(this.type()){case"radio":case"checkbox":if(this.value()&&"false"!==this.value())return!0;break;default:if(this.value())return!0}return!1}return""!==this.value()},ke.prototype.blur=function(t){},ke.prototype.keyup=function(t){},ke.prototype.focus=function(t){},ke.prototype.click=function(t){},ke.prototype.dblclick=function(t){},ke.prototype.change=function(t,e){},ke.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},ke.prototype.disable=function(t){this._inputElement.forEach(function(e,i){e.attr("disabled",t?"disabled":null)})},ke.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},ke.prototype.publish("name","","string","HTML name for the input"),ke.prototype.publish("label","","string","Descriptive label"),ke.prototype.publish("value","","string","Input Current Value"),ke.prototype.publish("validate",null,"string","Input Validation"),me(Ae,"INDChart"),Ae.prototype._dataFamily="ND",Ae.prototype._palette=X.ordinal("default"),Ae.prototype.fillColor=function(t,e,i,n){return this._palette(e)},Ae.prototype.strokeColor=function(t,e,i,n){return Y(this.fillColor(t,e,i,n)).darker().toString()},Ae.prototype.textColor=function(t,e,i,n){return X.textColor(this.fillColor(t,e,i,n))},Ae.prototype.click=function(t,e,i){},Ae.prototype.dblclick=function(t,e,i){},me(Ce,"tip"),me(Me,"ITooltip"),Me.prototype=Object.create(Q.prototype),Me.prototype.constructor=Me,Me.prototype.tooltipEnter=function(t){const e=this.parentOverlay();e.empty()||this.tooltip.rootElement(e.node().parentNode),t.call(this.tooltip)},Me.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){const t=document.querySelector(".d3-tip");return t.style.display="block",t.style.left=this.tooltipOffset()+event.clientX+"px",t.style.top=event.clientY+"px",[]}return"e"===this.tooltip.direction()()?[0,this.tooltipOffset()]:[-this.tooltipOffset(),0]});let t=this.tooltip.attr("class");t&&(t=t.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":""),t=t.split(" ").filter(function(t){return 0!==t.indexOf("ITooltip-tooltipStyle-")}).join(" "),t+=" ITooltip-tooltipStyle-"+this.tooltipStyle(),this.tooltip.attr("class",t))},Me.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},Me.prototype._tooltipHTML=function(t){return t},Me.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},Me.prototype.tooltipFormat=function(t={}){switch(t.label=void 0===t.label?"":t.label,this._labelFormatter?t.label=this._labelFormatter(t.label)||"":this.formatData&&this.parseData&&(t.label=this.formatData(this.parseData(t.label))),t.series=t.series||"",t.value instanceof Date?t.value=t.value||"":this._valueFormatter?t.value=this._valueFormatter(t.value)||"":this.formatValue&&this.parseValue&&(t.value=this.formatValue(this.parseValue(t.value))),this.tooltipStyle()){case"none":break;case"series-table":let e='<table class="ITooltip-series-table"><thead><tr><th colspan="2">'+t.label+"</th></tr></thead><tbody>";return t.arr.forEach(function(t){e+="<tr>",e+="<td>",e+='<div class="series-table-row-color" style="background-color:'+t.color+'"></div>',e+='<div class="series-table-row-label">'+t.label+"</div>",e+="</td>",e+='<td><div class="series-table-row-value">'+t.value+"</div></td>",e+="</tr>"}),e+="</tbody>",e+="</table>",e;default:return t.series?"<span style='color:"+this.tooltipSeriesColor()+"'>"+t.series+"</span> / <span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":""!==t.label?"<span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":"<span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>"}},Me.prototype.tooltipKeyValueFormat=function(t,e){let i="";for(const n in e)if(n!==t){const t=e&&e[n]?e[n]:"";i+=`<tr><td style="${this.tooltipLabelColor_exists()?"color:"+this.tooltipLabelColor():""}">${n}</td><td style="font-weight:normal">${t}</td></tr>`}return`<table>\n <thead>\n <tr><th colspan="2" style="font-weight:bold;font-size:16px">${e[t]}</th></tr>\n </thead>\n <tbody>\n ${i}\n </tbody>\n </table>`},Me.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{}),Me.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{}),Me.prototype.publish("tooltipLabelFormat",void 0,"string","Format of tooltip label(s) (the domain axis)",null,{}),Me.prototype.publish("tooltipValueFormat",void 0,"string","Number format of tooltip value(s)",null,{}),Me.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{}),Me.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text (the domain axis)",null,{}),Me.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{}),Me.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),Me.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});const Pe=Me.prototype.tooltipLabelFormat;Me.prototype.tooltipLabelFormat=function(t){const e=Pe.apply(this,arguments);return arguments.length&&(this._labelFormatter=Z(t)),e};const Te=Me.prototype.tooltipValueFormat;function Ie(){}M(Ie,"_"),Me.prototype.tooltipValueFormat=function(t){const e=Te.apply(this,arguments);return arguments.length&&(this._valueFormatter=Z(t)),e},me(Ie,"ITree"),Ie.prototype.constructor=Ie,Ie.prototype.click=function(t,e,i){},Ie.prototype.dblclick=function(t,e,i){},Ie.prototype._palette=X.ordinal("default"),function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('.d3-tip{line-height:1;font-weight:700;padding:12px;background:#000000a8;color:#fff;border-radius:2px;pointer-events:none!important;z-index:10}.d3-tip.hidden{visibility:hidden}.d3-tip:after{content:" ";box-sizing:border-box;display:inline-block;border:4px solid rgba(0,0,0,.66);position:absolute;pointer-events:none!important;width:8px;height:8px;margin:0}.d3-tip.n:after{top:100%;left:calc(50% - 4px);border-top-width:8px;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.e:after{top:calc(50% - 4px);left:-12px;border-top-color:transparent;border-right-width:8px;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.s{margin-top:8px}.d3-tip.s:after{top:-12px;left:calc(50% - 4px);border-top-color:transparent;border-right-color:transparent;border-bottom-width:8px;border-left-color:transparent}.d3-tip.w:after{top:calc(50% - 4px);left:100%;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-width:8px}.d3-tip.notick:after{border-color:transparent!important}.common_Widget .over{stroke:#000000a8;opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table th,.d3-tip .ITooltip-series-table td{padding:6px;text-align:left;border:1px solid #D1D1D1}.d3-tip .ITooltip-series-table .series-table-row-color{display:inline-block;height:10px;width:10px;margin-right:10px}.d3-tip .ITooltip-series-table .series-table-row-label{display:inline-block}.d3-tip .ITooltip-series-table th{background-color:#b3b3b3}.d3-tip .ITooltip-series-table td{background-color:#fff;color:#555;font-weight:400}.d3-tip .ITooltip-series-table td:first-child{border-right:0}table.ITooltip-series-table td:last-child{border-left:1px dotted #A3A3A3}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();var Ee=Object.defineProperty,Fe=/* @__PURE__ */M((t,e)=>Ee(t,"name",{value:e,configurable:!0}),"e"),De=/* @__PURE__ */M((t,e,i)=>{return a=i,(o=e+"")in(n=t)?Ee(n,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[o]=a;var n,o,a},"i"),Re=Math.PI,ze=2*Re,Oe=1e-6,je=ze-Oe;function Ne(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Le(){return new Ne}function Be(t){return Fe(function(){return t},"constant")}M(Ne,"et"),M(Le,"it"),M(Be,"nt"),Fe(Ne,"Path"),Fe(Le,"path"),Ne.prototype=Le.prototype={constructor:Ne,moveTo:/* @__PURE__ */Fe(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:/* @__PURE__ */Fe(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:/* @__PURE__ */Fe(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:/* @__PURE__ */Fe(function(t,e,i,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+n)},"quadraticCurveTo"),bezierCurveTo:/* @__PURE__ */Fe(function(t,e,i,n,o,a){this._+="C"+ +t+","+ +e+","+ +i+","+ +n+","+(this._x1=+o)+","+(this._y1=+a)},"bezierCurveTo"),arcTo:/* @__PURE__ */Fe(function(t,e,i,n,o){t=+t,e=+e,i=+i,n=+n,o=+o;var a=this._x1,s=this._y1,r=i-t,l=n-e,h=a-t,c=s-e,u=h*h+c*c;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(u>Oe)if(Math.abs(c*r-l*h)>Oe&&o){var p=i-a,d=n-s,f=r*r+l*l,y=p*p+d*d,_=Math.sqrt(f),x=Math.sqrt(u),m=o*Math.tan((Re-Math.acos((f+u-y)/(2*_*x)))/2),g=m/x,b=m/_;Math.abs(g-1)>Oe&&(this._+="L"+(t+g*h)+","+(e+g*c)),this._+="A"+o+","+o+",0,0,"+ +(c*p>h*d)+","+(this._x1=t+b*r)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},"arcTo"),arc:/* @__PURE__ */Fe(function(t,e,i,n,o,a){t=+t,e=+e,a=!!a;var s=(i=+i)*Math.cos(n),r=i*Math.sin(n),l=t+s,h=e+r,c=1^a,u=a?n-o:o-n;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>Oe||Math.abs(this._y1-h)>Oe)&&(this._+="L"+l+","+h),i&&(u<0&&(u=u%ze+ze),u>je?this._+="A"+i+","+i+",0,1,"+c+","+(t-s)+","+(e-r)+"A"+i+","+i+",0,1,"+c+","+(this._x1=l)+","+(this._y1=h):u>Oe&&(this._+="A"+i+","+i+",0,"+ +(u>=Re)+","+c+","+(this._x1=t+i*Math.cos(o))+","+(this._y1=e+i*Math.sin(o))))},"arc"),rect:/* @__PURE__ */Fe(function(t,e,i,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},"rect"),toString:/* @__PURE__ */Fe(function(){return this._},"toString")},Fe(Be,"constant$3");var Ve=Math.abs,He=Math.atan2,$e=Math.cos,We=Math.max,qe=Math.min,Ge=Math.sin,Ue=Math.sqrt,Xe=1e-12,Ye=Math.PI,Qe=Ye/2,Ze=2*Ye;function Je(t){return t>1?0:t<-1?Ye:Math.acos(t)}function Ke(t){return t>=1?Qe:t<=-1?-Qe:Math.asin(t)}function ti(t){return t.innerRadius}function ei(t){return t.outerRadius}function ii(t){return t.startAngle}function ni(t){return t.endAngle}function oi(t){return t&&t.padAngle}function ai(t,e,i,n,o,a,s,r){var l=i-t,h=n-e,c=s-o,u=r-a,p=u*l-c*h;if(!(p*p<Xe))return[t+(p=(c*(e-a)-u*(t-o))/p)*l,e+p*h]}function si(t,e,i,n,o,a,s){var r=t-i,l=e-n,h=(s?a:-a)/Ue(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-a,w=p*y-f*d,S=(g<0?-1:1)*Ue(We(0,v*v*b-w*w)),k=(w*g-m*S)/b,A=(-w*m-g*S)/b,C=(w*g+m*S)/b,M=(-w*m+g*S)/b,P=k-_,T=A-x,I=C-_,E=M-x;return P*P+T*T>I*I+E*E&&(k=C,A=M),{cx:k,cy:A,x01:-c,y01:-u,x11:k*(o/v-1),y11:A*(o/v-1)}}function ri(){var t=ti,e=ei,i=Be(0),n=null,o=ii,a=ni,s=oi,r=null;function l(){var l,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),p=o.apply(this,arguments)-Qe,d=a.apply(this,arguments)-Qe,f=Ve(d-p),y=d>p;if(r||(r=l=Le()),u<c&&(h=u,u=c,c=h),u>Xe)if(f>Ze-Xe)r.moveTo(u*$e(p),u*Ge(p)),r.arc(0,0,u,p,d,!y),c>Xe&&(r.moveTo(c*$e(d),c*Ge(d)),r.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,k=s.apply(this,arguments)/2,A=k>Xe&&(n?+n.apply(this,arguments):Ue(c*c+u*u)),C=qe(Ve(u-c)/2,+i.apply(this,arguments)),M=C,P=C;if(A>Xe){var T=Ke(A/c*Ge(k)),I=Ke(A/u*Ge(k));(w-=2*T)>Xe?(b+=T*=y?1:-1,v-=T):(w=0,b=v=(p+d)/2),(S-=2*I)>Xe?(m+=I*=y?1:-1,g-=I):(S=0,m=g=(p+d)/2)}var E=u*$e(m),F=u*Ge(m),D=c*$e(v),R=c*Ge(v);if(C>Xe){var z,O=u*$e(g),j=u*Ge(g),N=c*$e(b),L=c*Ge(b);if(f<Ye&&(z=ai(E,F,N,L,O,j,D,R))){var B=E-z[0],V=F-z[1],H=O-z[0],$=j-z[1],W=1/Ge(Je((B*H+V*$)/(Ue(B*B+V*V)*Ue(H*H+$*$)))/2),q=Ue(z[0]*z[0]+z[1]*z[1]);M=qe(C,(c-q)/(W-1)),P=qe(C,(u-q)/(W+1))}}S>Xe?P>Xe?(_=si(N,L,E,F,u,P,y),x=si(O,j,D,R,u,P,y),r.moveTo(_.cx+_.x01,_.cy+_.y01),P<C?r.arc(_.cx,_.cy,P,He(_.y01,_.x01),He(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,P,He(_.y01,_.x01),He(_.y11,_.x11),!y),r.arc(0,0,u,He(_.cy+_.y11,_.cx+_.x11),He(x.cy+x.y11,x.cx+x.x11),!y),r.arc(x.cx,x.cy,P,He(x.y11,x.x11),He(x.y01,x.x01),!y))):(r.moveTo(E,F),r.arc(0,0,u,m,g,!y)):r.moveTo(E,F),c>Xe&&w>Xe?M>Xe?(_=si(D,R,O,j,c,-M,y),x=si(E,F,N,L,c,-M,y),r.lineTo(_.cx+_.x01,_.cy+_.y01),M<C?r.arc(_.cx,_.cy,M,He(_.y01,_.x01),He(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,M,He(_.y01,_.x01),He(_.y11,_.x11),!y),r.arc(0,0,c,He(_.cy+_.y11,_.cx+_.x11),He(x.cy+x.y11,x.cx+x.x11),y),r.arc(x.cx,x.cy,M,He(x.y11,x.x11),He(x.y01,x.x01),!y))):r.arc(0,0,c,v,b,y):r.lineTo(D,R)}else r.moveTo(0,0);if(r.closePath(),l)return r=null,l+""||null}return M(l,"h"),Fe(l,"arc"),l.centroid=function(){var i=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Ye/2;return[$e(n)*i,Ge(n)*i]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Be(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Be(+t),l):e},l.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:Be(+t),l):i},l.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Be(+t),l):n},l.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:Be(+t),l):o},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Be(+t),l):a},l.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Be(+t),l):s},l.context=function(t){return arguments.length?(r=null==t?null:t,l):r},l}function li(t){this._context=t}function hi(t){return new li(t)}function ci(t){return t[0]}function ui(t){return t[1]}function pi(){var t=ci,e=ui,i=Be(!0),n=null,o=hi,a=null;function s(s){var r,l,h,c=s.length,u=!1;for(null==n&&(a=o(h=Le())),r=0;r<=c;++r)!(r<c&&i(l=s[r],r,s))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+t(l,r,s),+e(l,r,s));if(h)return a=null,h+""||null}return M(s,"r"),Fe(s,"line"),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Be(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Be(+t),s):e},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:Be(!!t),s):i},s.curve=function(t){return arguments.length?(o=t,null!=n&&(a=o(n)),s):o},s.context=function(t){return arguments.length?(null==t?n=a=null:a=o(n=t),s):n},s}function di(){var t=ci,e=null,i=Be(0),n=ui,o=Be(!0),a=null,s=hi,r=null;function l(l){var h,c,u,p,d,f=l.length,y=!1,_=new Array(f),x=new Array(f);for(null==a&&(r=s(d=Le())),h=0;h<=f;++h){if(!(h<f&&o(p=l[h],h,l))===y)if(y=!y)c=h,r.areaStart(),r.lineStart();else{for(r.lineEnd(),r.lineStart(),u=h-1;u>=c;--u)r.point(_[u],x[u]);r.lineEnd(),r.areaEnd()}y&&(_[h]=+t(p,h,l),x[h]=+i(p,h,l),r.point(e?+e(p,h,l):_[h],n?+n(p,h,l):x[h]))}if(d)return r=null,d+""||null}function h(){return pi().defined(o).curve(s).context(a)}return M(l,"h"),M(h,"c"),Fe(l,"area"),Fe(h,"arealine"),l.x=function(i){return arguments.length?(t="function"==typeof i?i:Be(+i),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Be(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:Be(+t),l):e},l.y=function(t){return arguments.length?(i="function"==typeof t?t:Be(+t),n=null,l):i},l.y0=function(t){return arguments.length?(i="function"==typeof t?t:Be(+t),l):i},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Be(+t),l):n},l.lineX0=l.lineY0=function(){return h().x(t).y(i)},l.lineY1=function(){return h().x(t).y(n)},l.lineX1=function(){return h().x(e).y(i)},l.defined=function(t){return arguments.length?(o="function"==typeof t?t:Be(!!t),l):o},l.curve=function(t){return arguments.length?(s=t,null!=a&&(r=s(a)),l):s},l.context=function(t){return arguments.length?(null==t?a=r=null:r=s(a=t),l):a},l}function fi(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function yi(t){return t}function _i(){var t=yi,e=fi,i=null,n=Be(0),o=Be(Ze),a=Be(0);function s(s){var r,l,h,c,u,p=s.length,d=0,f=new Array(p),y=new Array(p),_=+n.apply(this,arguments),x=Math.min(Ze,Math.max(-Ze,o.apply(this,arguments)-_)),m=Math.min(Math.abs(x)/p,a.apply(this,arguments)),g=m*(x<0?-1:1);for(r=0;r<p;++r)(u=y[f[r]=r]=+t(s[r],r,s))>0&&(d+=u);for(null!=e?f.sort(function(t,i){return e(y[t],y[i])}):null!=i&&f.sort(function(t,e){return i(s[t],s[e])}),r=0,h=d?(x-p*g)/d:0;r<p;++r,_=c)l=f[r],c=_+((u=y[l])>0?u*h:0)+g,y[l]={data:s[l],index:r,value:u,startAngle:_,endAngle:c,padAngle:m};return y}return M(s,"r"),Fe(s,"pie"),s.value=function(e){return arguments.length?(t="function"==typeof e?e:Be(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,i=null,s):e},s.sort=function(t){return arguments.length?(i=t,e=null,s):i},s.startAngle=function(t){return arguments.length?(n="function"==typeof t?t:Be(+t),s):n},s.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Be(+t),s):o},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Be(+t),s):a},s}function xi(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function mi(t){this._context=t}function gi(t){return new mi(t)}function bi(t,e){this._basis=new mi(t),this._beta=e}M(Je,"yt"),M(Ke,"_t"),M(ti,"xt"),M(ei,"mt"),M(ii,"gt"),M(ni,"bt"),M(oi,"vt"),M(ai,"wt"),M(si,"St"),M(ri,"At"),M(li,"kt"),M(hi,"Mt"),M(ci,"Pt"),M(ui,"Tt"),M(pi,"Ct"),M(di,"zt"),M(fi,"Ft"),M(yi,"It"),M(_i,"Et"),M(xi,"Rt"),M(mi,"Dt"),M(gi,"Ot"),M(bi,"jt"),Fe(Je,"acos"),Fe(Ke,"asin$1"),Fe(ti,"arcInnerRadius$1"),Fe(ei,"arcOuterRadius$1"),Fe(ii,"arcStartAngle$1"),Fe(ni,"arcEndAngle$1"),Fe(oi,"arcPadAngle$1"),Fe(ai,"intersect$1"),Fe(si,"cornerTangents$1"),Fe(ri,"d3Arc"),Fe(li,"Linear$1"),li.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},Fe(hi,"d3CurveLinear"),Fe(ci,"x$1"),Fe(ui,"y$1"),Fe(pi,"d3Line"),Fe(di,"d3Area"),Fe(fi,"descending"),Fe(yi,"identity$2"),Fe(_i,"d3Pie"),Fe(xi,"point$7"),Fe(mi,"Basis$1"),mi.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 3:xi(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:xi(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},Fe(gi,"d3CurveBasis"),Fe(bi,"Bundle$1"),bi.prototype={lineStart:/* @__PURE__ */Fe(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],a=e[0],s=t[i]-o,r=e[i]-a,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*s),this._beta*e[l]+(1-this._beta)*(a+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){this._x.push(+t),this._y.push(+e)},"point")};const vi=/* @__PURE__ */Fe(/* @__PURE__ */M(function t(e){function i(t){return 1===e?new mi(t):new bi(t,e)}return M(i,"n"),Fe(i,"bundle"),i.beta=function(e){return t(+e)},i},"t"),"custom")(.85);function wi(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function Si(t,e){this._context=t,this._k=(1-e)/6}M(wi,"Lt"),M(Si,"Bt"),Fe(wi,"point$6"),Fe(Si,"Cardinal$1"),Si.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:wi(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:wi(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const ki=/* @__PURE__ */Fe(/* @__PURE__ */M(function t(e){function i(t){return new Si(t,e)}return M(i,"n"),Fe(i,"cardinal"),i.tension=function(e){return t(+e)},i},"t"),"custom")(0);function Ai(t,e,i){var n=t._x1,o=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Xe){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Xe){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*h+t._x1*t._l23_2a-e*t._l12_2a)/c,s=(s*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,a,s,t._x2,t._y2)}function Ci(t,e){this._context=t,this._alpha=e}M(Ai,"Ht"),M(Ci,"Vt"),Fe(Ai,"point$5"),Fe(Ci,"CatmullRom$1"),Ci.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Ai(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const Mi=/* @__PURE__ */Fe(/* @__PURE__ */M(function t(e){function i(t){return e?new Ci(t,e):new Si(t,0)}return M(i,"n"),Fe(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"t"),"custom")(.5);function Pi(t){return t<0?-1:1}function Ti(t,e,i){var n=t._x1-t._x0,o=e-t._x1,a=(t._y1-t._y0)/(n||o<0&&-0),s=(i-t._y1)/(o||n<0&&-0),r=(a*o+s*n)/(n+o);return(Pi(a)+Pi(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(r))||0}function Ii(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Ei(t,e,i){var n=t._x0,o=t._y0,a=t._x1,s=t._y1,r=(a-n)/3;t._context.bezierCurveTo(n+r,o+r*e,a-r,s-r*i,a,s)}function Fi(t){this._context=t}function Di(t){return new Fi(t)}function Ri(t){this._context=t}function zi(t){var e,i,n=t.length-1,o=new Array(n),a=new Array(n),s=new Array(n);for(o[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,a[e]=4,s[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,a[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)i=o[e]/a[e-1],a[e]-=i,s[e]-=i*s[e-1];for(o[n-1]=s[n-1]/a[n-1],e=n-2;e>=0;--e)o[e]=(s[e]-o[e+1])/a[e];for(a[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-o[e+1];return[o,a]}function Oi(t){return new Ri(t)}function ji(t,e){this._context=t,this._t=e}function Ni(t){return new ji(t,.5)}function Li(t){return new ji(t,0)}function Bi(t){return new ji(t,1)}M(Pi,"Wt"),M(Ti,"Gt"),M(Ii,"Xt"),M(Ei,"Yt"),M(Fi,"Ut"),M(Di,"Qt"),M(Ri,"Zt"),M(zi,"Jt"),M(Oi,"Kt"),M(ji,"te"),M(Ni,"ee"),M(Li,"ie"),M(Bi,"ne"),Fe(Pi,"sign$1"),Fe(Ti,"slope3$1"),Fe(Ii,"slope2$1"),Fe(Ei,"point$4"),Fe(Fi,"MonotoneX$1"),Fi.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ei(this,this._t0,Ii(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Ei(this,Ii(this,i=Ti(this,t,e)),i);break;default:Ei(this,this._t0,i=Ti(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(Fi.prototype).point=function(t,e){Fi.prototype.point.call(this,e,t)},Fe(Di,"monotoneX"),Fe(Ri,"Natural"),Ri.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x=[],this._y=[]},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){var t=this._x,e=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===i)this._context.lineTo(t[1],e[1]);else for(var n=zi(t),o=zi(e),a=0,s=1;s<i;++a,++s)this._context.bezierCurveTo(n[0][a],o[0][a],n[1][a],o[1][a],t[s],e[s]);(this._line||0!==this._line&&1===i)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},Fe(zi,"controlPoints"),Fe(Oi,"d3CurveNatural"),Fe(ji,"Step$1"),ji.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x=this._y=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,e)}}this._x=t,this._y=e},"point")},Fe(Ni,"d3CurveStep"),Fe(Li,"stepBefore"),Fe(Bi,"stepAfter");var Vi=Array.prototype.slice;function Hi(t){return t}M(Hi,"ae"),Fe(Hi,"identity$1");var $i=1e-6;function Wi(t){return"translate("+(t+.5)+",0)"}function qi(t){return"translate(0,"+(t+.5)+")"}function Gi(t){return function(e){return+t(e)}}function Ui(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(i){return+t(i)+e}}function Xi(){return!this.__axis}function Yi(t,e){var i=[],n=null,o=null,a=6,s=6,r=3,l=1===t||4===t?-1:1,h=4===t||2===t?"x":"y",c=1===t||3===t?Wi:qi;function u(u){var p=null==n?e.ticks?e.ticks.apply(e,i):e.domain():n,d=null==o?e.tickFormat?e.tickFormat.apply(e,i):Hi:o,f=Math.max(a,0)+r,y=e.range(),_=+y[0]+.5,x=+y[y.length-1]+.5,m=(e.bandwidth?Ui:Gi)(e.copy()),g=u.selection?u.selection():u,b=g.selectAll(".domain").data([null]),v=g.selectAll(".tick").data(p,e).order(),w=v.exit(),S=v.enter().append("g").attr("class","tick"),k=v.select("line"),A=v.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),v=v.merge(S),k=k.merge(S.append("line").attr("stroke","currentColor").attr(h+"2",l*a)),A=A.merge(S.append("text").attr("fill","currentColor").attr(h,l*f).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),u!==g&&(b=b.transition(u),v=v.transition(u),k=k.transition(u),A=A.transition(u),w=w.transition(u).attr("opacity",$i).attr("transform",function(t){return isFinite(t=m(t))?c(t):this.getAttribute("transform")}),S.attr("opacity",$i).attr("transform",function(t){var e=this.parentNode.__axis;return c(e&&isFinite(e=e(t))?e:m(t))})),w.remove(),b.attr("d",4===t||2==t?s?"M"+l*s+","+_+"H0.5V"+x+"H"+l*s:"M0.5,"+_+"V"+x:s?"M"+_+","+l*s+"V0.5H"+x+"V"+l*s:"M"+_+",0.5H"+x),v.attr("opacity",1).attr("transform",function(t){return c(m(t))}),k.attr(h+"2",l*a),A.attr(h,l*f).text(d),g.filter(Xi).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),g.each(function(){this.__axis=m})}return M(u,"p"),Fe(u,"axis"),u.scale=function(t){return arguments.length?(e=t,u):e},u.ticks=function(){return i=Vi.call(arguments),u},u.tickArguments=function(t){return arguments.length?(i=null==t?[]:Vi.call(t),u):i.slice()},u.tickValues=function(t){return arguments.length?(n=null==t?null:Vi.call(t),u):n&&n.slice()},u.tickFormat=function(t){return arguments.length?(o=t,u):o},u.tickSize=function(t){return arguments.length?(a=s=+t,u):a},u.tickSizeInner=function(t){return arguments.length?(a=+t,u):a},u.tickSizeOuter=function(t){return arguments.length?(s=+t,u):s},u.tickPadding=function(t){return arguments.length?(r=+t,u):r},u}function Qi(t){return Yi(1,t)}function Zi(t){return Yi(2,t)}function Ji(t){return Yi(3,t)}function Ki(t){return Yi(4,t)}M(Wi,"re"),M(qi,"le"),M(Gi,"he"),M(Ui,"ce"),M(Xi,"ue"),M(Yi,"pe"),M(Qi,"de"),M(Zi,"fe"),M(Ji,"ye"),M(Ki,"_e"),Fe(Wi,"translateX"),Fe(qi,"translateY"),Fe(Gi,"number"),Fe(Ui,"center"),Fe(Xi,"entering"),Fe(Yi,"axis"),Fe(Qi,"axisTop"),Fe(Zi,"axisRight"),Fe(Ji,"axisBottom"),Fe(Ki,"axisLeft");const tn=(t=class extends et{_origType;_origTimePattern;parser;parserInvert;formatter;d3Scale;d3Axis;d3Guides;_guideElement;svg;svgAxis;svgGuides;_tickFormatFunc;constructor(t="origin"){super(),this._drawStartPos=t,this.updateScale()}lowValue(){return this.parse(this.low())}highValue(){return this.parse(this.high())}parse(t,e){if(t instanceof Array)return t.map(function(t){return this.parse(t)},this);if(null!=t){if(this.parser)return this.parser("number"==typeof t?t.toString():t);if(e&&"string"==typeof t)return+t}return t}parseInvert(t){return t instanceof Array?t.map(function(t){return this.parseInvert(t)},this):this.parserInvert&&t?this.parserInvert(t):t}format(t){return t instanceof Array?t.map(function(t){return this.format(t)},this):null!=t&&this.formatter?this.formatter(t):t}parseFormat(t){return this.format(this.parse(t))}tickFormatFunc(t){return arguments.length?(this._tickFormatFunc=t,this.updateScale(),this):this._tickFormatFunc}scalePos(t){let e=this.d3Scale(this.parse(t));return"ordinal"===this.type()&&(e+=this.bandwidth()/2),e}bandwidth(){return this.d3Scale.bandwidth?this.d3Scale.bandwidth():0}isHorizontal(){switch(this.orientation()){case"left":case"right":return!1}return!0}domain(t){return arguments.length?(this.d3Scale.domain(t),this):this.d3Scale.domain()}range(t){if(!arguments.length){if(this.d3Scale.rangeRoundBands)return this.d3Scale.rangeExtent();if(this.d3Scale.rangeRound)return this.d3Scale.range()}return this.d3Scale.rangeRoundBands?this.d3Scale.rangeRoundBands(t,.1):this.d3Scale.rangeRound&&this.d3Scale.range(t),this}invert(t){return this.d3Scale.invert(t)}guideTarget(t){return this._guideElement=$(t).attr("class",this._class),this}enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgAxis=this.svg.append("g").attr("class","axis"),this.svgGuides=(this._guideElement||e).append("g").attr("class","guide")}_prevOrientation;updateScale(){switch(this.type()){case"ordinal":if(this.d3Scale=lt().paddingInner(this.ordinalPaddingInner()).paddingOuter(this.ordinalPaddingOuter()),this.ordinals_exists()&&this.d3Scale.domain(this.ordinals()),this.parser=null,this.ordinalMappings_exists()){const t=this.ordinalMappings();this.formatter=e=>t[e]||e}else this.formatter=null;break;case"linear":this.d3Scale=rt(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?Z(this.tickFormat()):null;break;case"pow":this.d3Scale=st().exponent(this.powExponent()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?Z(this.tickFormat()):null;break;case"log":this.d3Scale=at().base(this.logBase()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?Z(this.tickFormat()):null;break;case"time":this.d3Scale=it(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=this.timePattern_exists()?nt(this.timePattern()):null,this.parserInvert=this.timePattern_exists()?ot(this.timePattern()):null,this._tickFormatFunc?this.formatter=this._tickFormatFunc:this.formatter=this.tickFormat_exists()?ot(this.tickFormat()):null}if(this._prevOrientation!==this.orientation()){switch(this.orientation()){case"left":this.d3Axis=Ki(this.d3Scale),this.d3Guides=Ki(this.d3Scale);break;case"top":this.d3Axis=Qi(this.d3Scale),this.d3Guides=Qi(this.d3Scale);break;case"right":this.d3Axis=Zi(this.d3Scale),this.d3Guides=Zi(this.d3Scale);break;default:this.d3Axis=Ji(this.d3Scale),this.d3Guides=Ji(this.d3Scale)}this._prevOrientation=this.orientation(),this.svgAxis&&this.svgAxis.html(""),this.svgGuides&&this.svgGuides.html("")}if(this.extend())if("ordinal"===this.type());else{let t,e,i,n,o,a;this.isHorizontal()?(t=this.width(),this.d3Scale.range([0,t]),e=t*this.extend()/100,i=this.d3Scale.invert(0),o=this.d3Scale.invert(-e),n=this.d3Scale.invert(t),a=this.d3Scale.invert(t+e)):(t=this.height(),this.d3Scale.range([t,0]),e=t*this.extend()/100,i=this.d3Scale.invert(t),o=this.d3Scale.invert(t+e),n=this.d3Scale.invert(0),a=this.d3Scale.invert(-e)),o===i&&(o=i-i*this.extend()/100),a===n&&(a=n+n*this.extend()/100),Math.sign(i)!==Math.sign(o)&&(o=0),Math.sign(n)!==Math.sign(a)&&(a=0),this.d3Scale.domain([o,a])}this.d3Axis.scale(this.d3Scale).tickFormat(this.formatter).ticks(this.tickCount()),this.d3Guides.scale(this.d3Scale).tickSize(this.tickLength_exists()?-this.tickLength():0).tickFormat("").ticks(this.tickCount());const t=this.ticks();return t.length&&(this.d3Axis.tickValues(t.map(t=>this.parse(t.value))).tickFormat((e,i)=>t[i].label),this.d3Guides.tickValues(t.map(t=>this.parse(t.value)))),this}adjustText(t,e){const i=this.isHorizontal(),n="left"===this.orientation(),o="bottom"===this.orientation(),a=this,s=t.selectAll(".tick > text").style("font-family",this.fontFamily()).style("font-size",this.fontSize_exists()?this.fontSize()+"px":null);if("linebreak"===this.overlapMode())"ordinal"===this.type()&&s.call(function(){return a.linebreak.apply(a,arguments)},this.bandwidth());else if("wrap"===this.overlapMode())"ordinal"===this.type()&&s.call(function(){return a.wrap.apply(a,arguments)},this.bandwidth());else switch(i?this.overlapMode():"none"){case"stagger":s.style("text-anchor","middle").attr("dy",function(t,i){return(o?1:-1)*((o?.71:0)+i%e)+"em"}).attr("dx",0).attr("visibility",null).attr("transform","rotate(0)");break;case"hide":s.style("text-anchor","middle").attr("dy",(o?.71:0)+"em").attr("dx",0).attr("visibility",function(t,i){return i%e?"hidden":null}).attr("transform","rotate(0)");break;case"rotate":const t=-this.labelRotation()||0;if(0!==t&&e>1){s.each(function(){const e=$(this),i=e.node().getBBox(),n=(o?1:-1)*Math.sin(Math.PI*(-Math.abs(t)/180));e.style("text-anchor",t>0?o?"start":"end":o?"end":"start").attr("dy",i.height/2*n+"px").attr("dx",t>0?o?"0.71em":"-0.71em":o?"-0.71em":"0.71em").attr("transform","rotate("+t+")").attr("visibility",null)});break}default:s.style("text-anchor",i?"middle":n?"end":"start").attr("dy",i?(o?.71:0)+"em":"0.32em").attr("dx",0).attr("visibility",null).attr("transform","rotate(0)")}}calcTickOverlapModulus(t){let e=1;switch(this.overlapMode()){case"rotate":case"stagger":case"hide":const i=[];t.selectAll(".tick > text").each(function(){const t=this.getBoundingClientRect();for(let n=i.length-1;n>=0&&!(i[n].right<t.left);--n)i.length+1-n>e&&(e=i.length+1-n);i.push(t)})}return e}calcOverflow(t,e){if(this.updateScale(),this.hidden())return{left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:1};const i=this.isHorizontal();this.range(i?[0,this.width()]:[this.height(),0]);const n=t.append("g").attr("class",this.classID()),o=n.append("g");o.attr("class",i?"x":"y").call(this.d3Axis),e&&t.selectAll(".tick > text").remove();const a={left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:this.calcTickOverlapModulus(o)};this.adjustText(o,a.tickOverlapModulus);const s=o.node().getBBox();switch(a.depth=i?s.height:s.width,this.shrinkToFit()){case"low":case"both":a.left=i?-s.x:0,a.bottom=i?0:-(this.height()-(s.height+s.y))}switch(this.shrinkToFit()){case"high":case"both":a.top=i?0:-s.y,a.right=i?-(this.width()-s.x-s.width):0}return n.remove(),a}wrap(t,e,i){i=i||/\s+/;const n=this;t.each(function(){const t=$(this),o=t.text().split(i).reverse();let a=[],s=0;const r=t.attr("x"),l=t.attr("y"),h=parseFloat(t.style("font-size"))||10,c=Math.floor(e/(1.1*h))-1,u=n.isHorizontal()?1:Math.ceil(o.length/c),p=parseFloat(t.attr("dy"));let d=t.text(null).append("tspan").attr("x",r).attr("y",l).attr("dy",p+"em"),f=0,y=o.pop();for(;y;)a.push(y),d.text(a.join(" ")),f++,d.node().getComputedTextLength()>e&&f>=u&&(a.pop(),d.text(a.join(" ")),a=[y],d=t.append("tspan").attr("x",r).attr("y",l).attr("dy",1.1*++s+p+"em").text(y),f=0),y=o.pop();n.isHorizontal()||t.selectAll("tspan").attr("y",-s/2+"em")})}linebreak(t,e){this.wrap(t,e,"\n")}update(t,e){super.update(t,e),this.svg.style("display",this.hidden()?"none":null);const i=this.calcOverflow(e),n=this.isHorizontal()?i.left:this.height()-i.top-i.bottom,o=this.isHorizontal()?this.width()-i.right-this.padding():0+this.padding();this.range(this.reverse()?[o,n]:[n,o]);const a=this;function s(t){t.attr("transform",function(){switch(a.orientation()){case"left":return"translate("+i.depth+", "+i.top+")";case"top":return"translate(0,"+i.depth+")";case"right":return"translate("+(a.width()-i.depth)+", "+i.top+")";case"bottom":return"translate(0,"+(a.height()-i.depth)+")"}return"translate(0,0)"})}M(s,"r"),Fe(s,"doPosition"),this.svg.style("visibility","none"===this.type()?"hidden":null).transition().call(s),this._guideElement&&this.svgGuides.transition().call(s),this.svgAxis.call(this.d3Axis),this.adjustText(this.svgAxis,i.tickOverlapModulus),this.pos().x;const r=this.width(),l=this.svgAxis.selectAll(".axisTitle").data(this.title()?[this.title()]:[]),h=l.enter().append("text").attr("class","axisTitle").merge(l).transition().attr("dx",null).style("text-anchor","end");switch(this.orientation()){case"left":h.attr("transform","rotate(-90)").attr("x",-2).attr("y",2).attr("dy",".71em");break;case"right":h.attr("transform","rotate(-90)").attr("x",-2).attr("y",4).attr("dx",null).attr("dy","-.71em");break;case"top":h.attr("transform","rotate(0)").attr("x",r-2).attr("y",2).attr("dx",null).attr("dy",".71em");break;case"bottom":h.attr("transform","rotate(0)").attr("x",r-2).attr("y",-2).attr("dy",null)}h.text(this.title_exists()?this.title():""),l.exit().remove(),this.svgGuides.call(this.d3Guides).selectAll(".tick").classed("guide-0",t=>0===t&&this.low()<0)}rerender(){this.svgAxis.call(this.d3Axis),this.svgGuides.call(this.d3Guides)}postUpdate(t,e){super.postUpdate(t,e),this._guideElement&&this._guideElement.attr("transform",this._element.attr("transform"))}},M(t,"_Axis"),t);Fe(tn,"Axis");let en=tn;en.prototype._class+=" chart_Axis",en.prototype.publish("type","linear","set","Type",["none","ordinal","linear","pow","log","time"]),en.prototype.publish("timePattern","%Y-%m-%d","string","Time Series Pattern",null,{disable:/* @__PURE__ */Fe(t=>"time"!==t.type(),"disable")}),en.prototype.publish("reverse",!1,"boolean","Reverse"),en.prototype.publish("title",null,"string","Title"),en.prototype.publish("orientation","bottom","set","Placement/orientation of the axis",["left","top","right","bottom"]),en.prototype.publish("powExponent",2,"number","Power exponent (disabled when type is not 'pow')",null,{disable:/* @__PURE__ */Fe(t=>"pow"!==t.type(),"disable")}),en.prototype.publish("logBase",10,"number","Logarithmic base (disabled when type is not 'log')",null,{disable:/* @__PURE__ */Fe(t=>"log"!==t.type(),"disable")}),en.prototype.publish("ordinals",[],"array","Array of ordinal values to display (disabled when type is not 'ordinal')",null,{disable:/* @__PURE__ */Fe(t=>"ordinal"!==t.type(),"disable")}),en.prototype.publish("fontSize",null,"number","Size of tick label font (pixels)",null,{optional:!0}),en.prototype.publish("fontFamily",null,"string","Font family of tick labels",null,{optional:!0}),en.prototype.publish("tickCount",null,"number","Number of ticks to display (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.type(),"disable")}),en.prototype.publish("tickFormat",null,"string","Format rules for tick text (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.type(),"disable")}),en.prototype.publish("tickLength",null,"number","Height (or width for left/right orientations) of the axis ticks (in pixels)",null,{optional:!0}),en.prototype.publish("ticks",[],"array","Custom tick labels",null,{optional:!0}),en.prototype.publish("low",null,"any","Minimum tick value (disabled when type is ordinal)",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.type(),"disable")}),en.prototype.publish("high",null,"any","Maximum tick value (disabled when type is ordinal)",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.type(),"disable")}),en.prototype.publish("overlapMode","none","set","Specifies the behavior when tick labels overlap",["none","stagger","hide","rotate","linebreak","wrap"]),en.prototype.publish("labelRotation",33,"number","Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"rotate"!==t.overlapMode(),"disable")}),en.prototype.publish("shrinkToFit","both","set","shrinkToFit",["none","low","high","both"]),en.prototype.publish("extend",5,"number","Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.type(),"disable")}),en.prototype.publish("hidden",!1,"boolean","Hides axis when 'true'"),en.prototype.publish("ordinalPaddingInner",.1,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)",null,{disable:/* @__PURE__ */Fe(t=>"ordinal"!==t.type(),"disable")}),en.prototype.publish("ordinalPaddingOuter",.1,"number","Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)",null,{disable:/* @__PURE__ */Fe(t=>"ordinal"!==t.type(),"disable")}),en.prototype.publish("ordinalMappings",null,"object","Alternative label mappings (icons)",null,{optional:!0}),en.prototype.publish("padding",0,"number","Padding space at top of axis (pixels)",null,{optional:!0}),en.prototype._origType=en.prototype.type,en.prototype.type=function(t){const e=en.prototype._origType.apply(this,arguments);return void 0!==t&&(this._type=t,this.updateScale()),e},en.prototype._origTimePattern=en.prototype.timePattern,en.prototype.timePattern=function(t){const e=en.prototype._origTimePattern.apply(this,arguments);return void 0!==t&&(this._timePattern=t,this.updateScale()),e};const nn=(M(e=class extends et{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),tt.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.domainAxis=(new en).classed({domain:!0}).orientation_default("bottom").type("ordinal").overlapMode_default("stagger").shrinkToFit_default("high").extend_default(0),this.valueAxis=(new en).classed({value:!0}).orientation_default("left").type("linear").shrinkToFit_default("high"),this.xyBrush=ht().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.xBrush=ct().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.yBrush=ut().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2())}_prevBrush;resetSelection(){return this._prevBrush=null,this}parseData(t){return this.domainAxis.parse(t)}parseValue(t){return this.valueAxis.parse(t,!0)}formatData(t){return this.domainAxis.format(t)}formatValue(t){return this.valueAxis.format(t)}parsedData(){return this.data().map(function(t){let e=0;return t.map(function(t,i){if(0===i)return this.parseData(t);if(i>=this.columns().length)return t;const n=this.yAxisStacked()?[e,e+this.parseValue(t)]:this.parseValue(t);return e+=this.parseValue(t),n},this)},this)}bandwidth(){return this.domainAxis.bandwidth()}svg;svgRegions;svgDomainGuide;svgValueGuide;svgData;svgDataClipRect;svgFocus;svgBrush;enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgRegions=e.append("g"),this.svgDomainGuide=this.svg.append("g"),this.svgValueGuide=this.svg.append("g"),this.svgData=this.svg.append("g"),this.svgDataClipRect=this.svg.append("clipPath").attr("id",this.id()+"_clippath").append("rect").attr("x",0).attr("y",0),this.svgData=this.svg.append("g").attr("clip-path","url(#"+this.id()+"_clippath)"),this._selection.widgetElement(this.svgData),this.svgFocus=e.append("g"),this.domainAxis.target(this.svg.node()).guideTarget(this.svgDomainGuide.node()),this.valueAxis.target(this.svg.node()).guideTarget(this.svgValueGuide.node()),this.svgBrush=e.append("g").attr("class","brush"),this.chartsEnter(this,this.svgData,250)}resizeBrushHandle(t,e,i){let n,o,a;return"e"===t.type||"w"===t.type?(n=+("e"===t.type),o=n?1:-1,a=i/3,"M"+.5*o+","+a+"A6,6 0 0 "+n+" "+6.5*o+","+(a+6)+"V"+(2*a-6)+"A6,6 0 0 "+n+" "+.5*o+","+2*a+"ZM"+2.5*o+","+(a+8)+"V"+(2*a-8)+"M"+4.5*o+","+(a+8)+"V"+(2*a-8)):(n=+("s"===t.type),a=n?1:-1,o=e/3,"M"+o+", "+.5*a+"A6,6 0 0 "+(n+1)%2+" "+(o+6)+","+6.5*a+"H"+(2*o-6)+"A6,6 0 0 "+(n+1)%2+" "+2*o+","+.5*a+"ZM"+(o+8)+","+2.5*a+"H"+(2*o-8)+"M"+(o+8)+","+4.5*a+"H"+(2*o-8))}_skipSelection=!1;skipSelection(t){return arguments.length?(this._skipSelection=t,this):this._skipSelection}brushMoved(){if(this._skipSelection)return;let t=[];const e=this,i=pt(this.svgBrush.node());i&&(t=this.data().filter(function(t){const n=e.dataPos(t[0]);if(e.use2dSelection()){const o=e.valuePos(t[1])+e.valueAxis.bandwidth()/2;return n>=i[0][0]&&n<=i[1][0]&&o>=i[0][1]&&o<=i[1][1]}return n>=i[0]&&n<=i[1]})),this.selection(t)}brushMoved2(){const t="horizontal"===this.orientation(),e=this.use2dSelection()?[]:t?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],i=this.svgBrush.selectAll(".handle--custom").data(e),n=dt()?.selection;null==n?i.attr("display","none"):t?i.attr("display",null).attr("transform",(t,e)=>"translate("+n[e]+",0)"):i.attr("display",null).attr("transform",(t,e)=>"translate(0, "+n[e]+")")}dataPos(t){return this.domainAxis.scalePos(t)}valuePos(t){return this.valueAxis.scalePos(t)}getAxisSize(t){return{width:this.xAxis?this.xAxis.width():t.xAxis.width(),height:this.yAxis?this.yAxis.height():t.yAxis.width()}}calcMargin(t,e,i){const n={top:!i&&this.selectionMode()?10:2,right:i&&(this.selectionMode()||this.xAxisFocus())?10:2,bottom:(this.xAxisFocus()?this.xAxisFocusHeight():0)+2,left:2},o=this.width()-n.left-n.right,a=this.height()-n.top-n.bottom;let s=0,r=30,l=0,h=30;for(let c=0;c<10;++c){this.xAxis.width(o-h).height(0);const t=this.xAxis.calcOverflow(e),i=t.depth;this.yAxis.width(0).height(a-r);const n=this.yAxis.calcOverflow(e),c=n.depth;if(s=t.right,l=n.top,i===r&&c===h)break;r=i,h=c}return this.xAxis.x(o/2+h/2+n.left).y(a+n.top).width(o-h),this.yAxis.x(n.left).y(a/2-r/2+n.top).height(a-r),n.left+=h,n.top+=l,n.right+=s,n.bottom+=r,n}updateRegions(t,e,i){const n=this,o=this.svgRegions.selectAll(".region").data(this.regions());o.enter().append("rect").attr("class","region"),i?o.attr("x",function(t){return n.dataPos(t.x0)}).attr("y",0).attr("width",function(t){return n.dataPos(t.x1)-n.dataPos(t.x0)}).attr("height",this.height()).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return Y(n._palette(t.colorID)).brighter()}):o.attr("x",0).attr("y",function(t){return n.dataPos(t.x0)}).attr("width",this.width()).attr("height",function(t){return n.dataPos(t.x0)-n.dataPos(t.x1)}).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return Y(n._palette(t.colorID)).brighter()}),o.exit().remove()}_prevXAxisType;update(t,e){this.selectionGlow(!this.tabNavigation()),super.update(t,e);const i=this,n="horizontal"===this.orientation();if(this.updateRegions(t,e,n),this.domainAxis.orientation(n?"bottom":"left").title(this.xAxisTitle_exists()?this.xAxisTitle():this.columns()[0]),this.valueAxis.orientation(n?"left":"bottom"),this.xAxis=n?this.domainAxis:this.valueAxis,this.yAxis=n?this.valueAxis:this.domainAxis,"ordinal"===this.xAxisType()){const t=this.columns().length,e={};this.domainAxis.ordinals(this.data().map(function(n){return e[n[0]]=i.xAxisOrdinalMapping(n,n[t]),n[0]})).ordinalMappings(e)}else{const t=this.xAxisDomainLow()?this.xAxisDomainLow():this.domainAxis.parseInvert(ft(this.parsedData(),function(t){return t[0]})),e=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert(yt(this.parsedData(),function(t){return t[0]}));void 0!==t&&void 0!==e&&this.domainAxis.low(t).high(e)}const o=this.yAxisDomainLow()?this.yAxisDomainLow():this.valueAxis.parseInvert(ft(this.parsedData(),function(t){return ft(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[0]:t})})),a=this.yAxisDomainHigh()?this.yAxisDomainHigh():this.valueAxis.parseInvert(yt(this.parsedData(),function(t){return yt(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[1]:t})}));this.valueAxis.low(o).high(a),this.margin=this.calcMargin(t,e,n);let s=this.width()-this.margin.left-this.margin.right;s<0&&(s=0);let r=this.height()-this.margin.top-this.margin.bottom;r<0&&(r=0);const l=n?s:r,h=n?r:s;if(this.domainAxis.tickLength(this.xAxisGuideLines()?h:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?l:0).render(),this.svgDataClipRect.attr("width",s).attr("height",r),this.svgData.transition().attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.updateBrush(s,r,l,n),this.updateFocusChart(t,e,this.margin,s,r,n),this.chartsUpdate(s,r,250),this.selectionMode())return this.brushMoved()}updateBrush(t,e,i,n){const o=this.use2dSelection()?this.xyBrush:n?this.xBrush:this.yBrush,a=pt(this.svgBrush.node());o.extent([[0,0],[t,e]]),this.svgBrush.attr("transform","translate("+this.margin.left+", "+this.margin.top+")").style("display",this.selectionMode()?null:"none").call(o);const s=this.use2dSelection()?[]:n?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],r=this.svgBrush.selectAll(".handle--custom").data(s);if(r.enter().append("path").attr("class","handle--custom").merge(r).attr("cursor",n?"ew-resize":"ns-resize").attr("d",i=>this.resizeBrushHandle(i,t,e)),this.selectionMode()){if(this._prevXAxisType!==this.xAxisType()&&(this._prevXAxisType=this.xAxisType(),this._prevBrush=null),this._prevBrush){if(a){if(this._prevBrush.orientation!==this.orientation()){const t=a[0];a[0]=this._prevBrush.maxCurrExtent-a[1],a[1]=this._prevBrush.maxCurrExtent-t}const t=i/this._prevBrush.maxCurrExtent;1!==t&&this.svgBrush.transition().on("start",function(){o.on("end",null)}).call(o.move,[a[0]*t,a[1]*t]).on("end",()=>{o.on("end",()=>this.brushMoved())})}}else this.svgBrush.call(o.move,[0,i]);this._prevBrush={orientation:this.orientation(),maxCurrExtent:i}}}updateFocusChart(t,e,i,n,o,a){const s=this,r=this.svgFocus.selectAll("#"+this.id()+"_focusChart").data(this.xAxisFocus()?[!0]:[]);r.enter().append("g").attr("id",this.id()+"_focusChart").attr("class","focus").each(function(){s.focusChart=(new s.constructor).target(this),s.focusChart.xBrush.on("brush.focus",function(){s.syncAxis(n),s.chartsUpdate(n,o,0)}),s.focusChart.layers(s.layers().map(t=>new t.constructor))}).merge(r).each(function(){s.copyPropsTo(s.focusChart,["layers"]);let t=0;for(const e of s.layers())e.copyPropsTo(s.focusChart.layers()[t]),t++;s.focusChart.xAxisFocus(!1).selectionMode(!0).skipSelection(!0).orientation("horizontal").xAxisGuideLines(!1).xAxisDomainLow(null).xAxisDomainHigh(null).yAxisGuideLines(!1).x(s.width()/2).y(s.height()-s.xAxisFocusHeight()/2).width(s.width()).height(s.xAxisFocusHeight()).columns(s.columns()).data(s.data()).render(),s.syncAxis(n)}),r.exit().each(function(){s.focusChart&&(s.focusChart.target(null),delete s.focusChart)}).remove()}syncAxis(t){const e=pt(this.focusChart.svgBrush.node());if(e){if("ordinal"!==this.focusChart.xAxisType())this.xAxis.domain([this.focusChart.xAxis.invert(e[0]),this.focusChart.xAxis.invert(e[1])]);else{const i=(e[1]-e[0])/t;this.xAxis.range([-e[0]/i,(t-e[0])/i])}this.xAxis.rerender()}}layerColumns(t){const e=t.columns(),i=super.columns().filter(t=>t!==e[0]);return i.length?[e[0],...i]:e}layerColumnIndices(t){const e=t.columns();return this.layerColumns(t).map(t=>e.indexOf(t))}layerColumnIndex(t,e){return t.columns().indexOf(e)}layerData(t){if(1===arguments.length){const e=this.layerColumnIndices(t);return t.data().map(t=>{const i=e.map(e=>t[e]);return i.__hpcc_origRow=t,i})}throw new Error("Setting data on XYAxisLayer is not supported.")}layerEnter(t,e,i=250){}layerUpdate(t,e,i=250){}layerExit(t,e,i=250){}chartsEnter(t,e,i=250){this.layerEnter(this,e,i);for(const n of this.layers())n.__xyAxisElement=e.append("g").attr("class",n.class()),n.target(n.__xyAxisElement.node()).layerEnter(this,e,i)}chartsUpdate(t,e,i){this.layerUpdate(this,this.svgData,i);for(const n of this.layers())n.resize({width:t,height:e}).layerUpdate(this,n.__xyAxisElement,i)}exit(t,e){this.valueAxis.target(null),this.domainAxis.target(null),super.exit(t,e)}selection(t){const e=this;this._selection.widgetElement().selectAll(".selected,.deselected").each(function(i){const n=t.indexOf(i.origRow)>=0;$(this).classed("selected",n).classed("deselected",!n).attr("filter",e._selection.svgGlowID()&&n?`url(#${e._selection.svgGlowID()})`:null)});const i=t.map(t=>this.rowToObj(t));setTimeout(()=>{this.click(i,"",!0)},0)}xAxisOrdinalMapping(t,e){return t[0]}click(t,e,i){}_selection},"_XYAxis"),e);Fe(nn,"XYAxis");let on=nn;on.prototype._class+=" chart_XYAxis",on.prototype.mixin(tt.SimpleSelectionMixin),on.prototype.publish("orientation","horizontal","set","Selects orientation for the axis",["horizontal","vertical"]),on.prototype.publish("pointSizeColumn",null,"string","pointSizeColumn",null,{optional:!0}),on.prototype.publish("minPointSize",6,"number","minPointSize"),on.prototype.publish("maxPointSize",26,"number","maxPointSize"),on.prototype.publish("use2dSelection",!1,"boolean","2D Range Selector"),on.prototype.publish("selectionMode",!1,"boolean","Range Selector"),on.prototype.publishProxy("xAxisTitle","domainAxis","title"),on.prototype.publishProxy("xAxisTickCount","domainAxis","tickCount"),on.prototype.publishProxy("xAxisTickFormat","domainAxis","tickFormat"),on.prototype.publishProxy("xAxisTicks","domainAxis","ticks"),on.prototype.publishProxy("xAxisType","domainAxis","type"),on.prototype.publishProxy("xAxisTypeTimePattern","domainAxis","timePattern"),on.prototype.publish("xAxisDomainLow",null,"string","X-Axis Low",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.xAxisType(),"disable")}),on.prototype.publish("xAxisDomainHigh",null,"string","X-Axis High",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.xAxisType(),"disable")}),on.prototype.publishProxy("xAxisFontSize","domainAxis","fontSize"),on.prototype.publishProxy("xAxisFontFamily","domainAxis","fontFamily"),on.prototype.publishProxy("xAxisOrdinalPaddingInner","domainAxis","ordinalPaddingInner"),on.prototype.publishProxy("xAxisOrdinalPaddingOuter","domainAxis","ordinalPaddingOuter"),on.prototype.publishProxy("xAxisOverlapMode","domainAxis","overlapMode"),on.prototype.publishProxy("xAxisLabelRotation","domainAxis","labelRotation"),on.prototype.publishProxy("xAxisDomainPadding","domainAxis","extend"),on.prototype.publish("xAxisGuideLines",!1,"boolean","Y-Axis Guide Lines"),on.prototype.publish("xAxisFocus",!1,"boolean","X-Axis Focus",null,{disable:/* @__PURE__ */Fe(t=>"horizontal"!==t.orientation(),"disable")}),on.prototype.publish("xAxisFocusHeight",80,"number","X-Axis Focus Height",null,{disable:/* @__PURE__ */Fe(t=>!t.xAxisFocus(),"disable")}),on.prototype.publishProxy("xAxisHidden","domainAxis","hidden"),on.prototype.publishProxy("yAxisFontSize","valueAxis","fontSize"),on.prototype.publishProxy("yAxisFontFamily","valueAxis","fontFamily"),on.prototype.publishProxy("yAxisTitle","valueAxis","title"),on.prototype.publishProxy("yAxisTickCount","valueAxis","tickCount"),on.prototype.publishProxy("yAxisTickFormat","valueAxis","tickFormat"),on.prototype.publishProxy("yAxisTicks","valueAxis","ticks"),on.prototype.publishProxy("yAxisType","valueAxis","type"),on.prototype.publishProxy("yAxisTypeTimePattern","valueAxis","timePattern"),on.prototype.publishProxy("yAxisTypePowExponent","valueAxis","powExponent"),on.prototype.publishProxy("yAxisTypeLogBase","valueAxis","logBase"),on.prototype.publish("yAxisStacked",!1,"boolean","Stacked Chart",null,{tags:["Basic"],disable:/* @__PURE__ */Fe(t=>"ordinal"!==t.xAxisType()||t._class.indexOf("chart_Column")<0,"disable")}),on.prototype.publish("yAxisDomainLow",null,"string","Y-Axis Low",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.yAxisType(),"disable")}),on.prototype.publish("yAxisDomainHigh",null,"string","Y-Axis High",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.yAxisType(),"disable")}),on.prototype.publishProxy("yAxisDomainPadding","valueAxis","extend"),on.prototype.publish("yAxisGuideLines",!0,"boolean","Y-Axis Guide Lines"),on.prototype.publishProxy("yAxisHidden","valueAxis","hidden"),on.prototype.publish("regions",[],"array","Regions"),on.prototype.publish("layers",[],"widgetArray","Layers",null,{render:!1}),on.prototype.publishProxy("xAxisPadding","domainAxis","padding"),on.prototype.publishProxy("yAxisPadding","valueAxis","padding"),on.prototype.publish("tabNavigation",!1,"boolean","Enable or disable tab navigation");const an=(i=class extends on{constructor(){super(),Ae.call(this),Me.call(this),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}curve(){switch(this.interpolate()){case"linear":return hi;case"step":return Ni;case"step-before":return Li;case"step-after":return Bi;case"basis":return gi;case"bundle":return vi;case"cardinal":return ki;case"catmullRom":return Mi;case"natural":return Oi;default:return Di}}getScale(){switch(this.pointSizeScale()){case"linear":return rt();case"pow":return st().exponent(2);case"log":return at();case"sqrt":return _t()}}pointColor(t,e,i,n){return this.interpolate()&&this.pointDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}lineColor(t,e,i,n){return this.interpolateFill()&&this.interpolateDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}areaColor(t,e,i,n){return this.fillColor(t,e,i,n)}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(t){return"series-table"===n.tooltipStyle()?n.tooltipFormat({label:t.label,arr:n.columns().slice(1).map(function(e,i){return{label:e,color:n._palette(e),value:n.data()[t.rowIdx][i+1]}})}):n.tooltipFormat({label:t.label,series:t.column,value:t.value})})}_prevPointShape;layerUpdate(t,e,i=250){super.layerUpdate(t,e);const n="horizontal"===t.orientation(),o=n?this.height():this.width(),a=this;function s(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}let r,l,h;M(s,"r"),this.tabNavigation()&&t.parentRelativeDiv?t.parentRelativeDiv.attr("tabindex","0").attr("role","group").attr("aria-label",`${this.columns()[0]||"Chart"} data`):t.parentRelativeDiv&&t.parentRelativeDiv.attr("tabindex",null).attr("role",null).attr("aria-label",null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._prevPointShape!==this.pointShape()&&(e.selectAll(".data").remove(),this._prevPointShape=this.pointShape()),Fe(s,"mapShape"),this.pointSizeColumn_exists()&&(r=this.columns().indexOf(this.pointSizeColumn()),l=xt(this.data(),t=>t[r]),h=this.getScale().domain(l));const c=this.layerColumns(t),u=this.layerData(t),p=this.flattenData(c,u).map(function(t){return t.shape=s(a.pointShape()),t.column=c[t.colIdx],t.row=u[t.rowIdx],t.origRow=u[t.rowIdx].__hpcc_origRow,l?(t.size=h(t.row[r])*(a.maxPointSize()-a.minPointSize())+a.minPointSize(),t.column!==a.pointSizeColumn()&&t):(t.size=a.pointSize(),t)}).filter(t=>t),d=e.selectAll(".area").data(c.filter(function(t,e){return a.interpolate()&&a.interpolateFill()&&e>0})),f=d.enter().append("path"),y=di().curve(this.curve());n?y.x(function(e){return a.xPos(t,e)}).y0(Math.min(o,this.yPos(t,{value:0}))).y1(function(e){return a.yPos(t,e)}):y.y(function(e){return a.yPos(t,e)}).x0(Math.max(0,this.xPos(t,{value:0}))).x1(function(e){return a.xPos(t,e)}),f.merge(d).attr("class",t=>"area series series-"+this.cssTag(t)).each(function(t,e){$(this).attr("d",y(p.filter(function(t){return t.colIdx===e+1}))).style("opacity",a.interpolateFillOpacity()).style("stroke","none").style("fill",a.areaColor([],t,void 0,[]))}),d.exit().remove();const _=e.selectAll(".line").data(c.filter(function(t,e){return a.interpolate()&&e>0})),x=_.enter().append("path"),m=pi().x(function(e){return a.xPos(t,e)}).y(function(e){return a.yPos(t,e)}).curve(this.curve());x.merge(_).attr("class",t=>"line series series-"+this.cssTag(t)).each(function(t,e){const i=$(this),n=p.filter(function(t){return t.colIdx===e+1});i.attr("d",m(n)).style("stroke",a.lineColor([],t,void 0,[])).style("fill","none")}),_.exit().remove();const g=e.selectAll(".point").data(p,function(t,e){return t.shape+"_"+e});g.enter().append("g").each(function(e){const i=$(this);i.append(e.shape).attr("class","pointShape"),i.append("text").attr("class","pointValue").style("display","none").attr("text-anchor",a.valueAnchor()).attr("alignment-baseline",a.valueBaseline()).attr("fill",function(t,e){return"middle"===a.valueBaseline()||"central"===a.valueBaseline()?a.textColor(t.row,t.column,t.value,t.origRow):null}),i.append("circle").attr("class","pointSelection").on("mouseout.tooltip",a.tooltip.hide).on("mousemove.tooltip",a.tooltip.show).call(t._selection.enter.bind(t._selection)).on("click",function(e,i){a.click(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))}).on("dblclick",function(e,i){a.dblclick(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))}).on("keydown",function(e,i){if(a.tabNavigation()){const e=dt();"Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),t._selection.click(this))}})}).merge(g).attr("class",t=>"point series series-"+this.cssTag(t.column)).each(function(e){$(this).select(".pointValue").attr("x",function(e){return a.xPos(t,e)}).attr("y",function(e){return a.yPos(t,e)}).style("display",a.showValue()?"block":"none").attr("text-anchor",a.valueAnchor()).attr("alignment-baseline",a.valueBaseline()).text(function(t){return t.value}),$(this).select(".pointSelection").attr("cx",function(e){return a.xPos(t,e)}).attr("cy",function(e){return a.yPos(t,e)}).attr("r",e.size).attr("tabindex",a.tabNavigation()?0:null).attr("role",a.tabNavigation()?"button":null).attr("aria-label",a.tabNavigation()?t=>`${t.column||"Value"}: ${t.value} @ ${t.label}`:null);const i=$(this).select(".pointShape");switch(e.shape){case"rect":i.attr("x",function(i){return a.xPos(t,i)-e.size/2}).attr("y",function(i){return a.yPos(t,i)-e.size/2}).attr("width",e.size).attr("height",e.size).style("fill",a.pointColor(e.row,e.column,e.value,e.origRow));break;case"circle":i.attr("cx",function(e){return a.xPos(t,e)}).attr("cy",function(e){return a.yPos(t,e)}).attr("r",.9*e.size).style("fill",a.pointColor(e.row,e.column,e.value,e.origRow));break;case"path":i.attr("d",function(i){return"M"+(a.xPos(t,i)-e.size/2)+" "+(a.yPos(t,i)-e.size/2)+" L"+(a.xPos(t,i)+e.size/2)+" "+(a.yPos(t,i)+e.size/2)+" M"+(a.xPos(t,i)-e.size/2)+" "+(a.yPos(t,i)+e.size/2)+" L"+(a.xPos(t,i)+e.size/2)+" "+(a.yPos(t,i)-e.size/2)}).style("stroke",a.pointColor(e.row,e.column,e.value,e.origRow))}}),g.exit().remove()}exit(t,e){super.exit(t,e)}},M(i,"_Scatter"),i);Fe(an,"Scatter"),De(an,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number",multi:!0}]);let sn=an;sn.prototype._class+=" chart_Scatter",sn.prototype.implements(Ae.prototype),sn.prototype.implements(Me.prototype),sn.prototype.publish("paletteID","default","set","Color palette for this widget",sn.prototype._palette.switch(),{tags:["Basic","Shared"]}),sn.prototype.publish("pointSizeScale","linear","set","pointSizeScale",["linear","pow","log","sqrt"]),sn.prototype.publish("pointShape","cross","set","Shape of the data points",["circle","rectangle","cross"]),sn.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),sn.prototype.publish("interpolate","","set","Interpolate Data",["","linear","step","step-before","step-after","basis","bundle","cardinal","catmullRom","natural","monotone"]),sn.prototype.publish("pointDarken",!0,"boolean","If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color",null,{disable:/* @__PURE__ */Fe(t=>!t.interpolate(),"disable")}),sn.prototype.publish("interpolateDarken",!0,"boolean","If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color",null,{disable:/* @__PURE__ */Fe(t=>!t.interpolateFill(),"disable")}),sn.prototype.publish("interpolateFill",!1,"boolean","If true, the area between the line and zero will be filled"),sn.prototype.publish("interpolateFillOpacity",.66,"number","Fill interpolation Opacity",null,{range:{min:0,step:.01,max:1}}),sn.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),sn.prototype.publish("showValue",!1,"boolean"),sn.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),sn.prototype.publish("valueBaseline","ideographic","set","alignment-baseline for shown value text",["auto","baseline","before-edge","text-before-edge","middle","central","after-edge","text-after-edge","ideographic","alphabetic","hanging","mathematical","inherit"]);const rn=(M(n=class extends sn{constructor(){super(),this.interpolate_default("linear").interpolateFill_default(!0)}},"_Area"),n);Fe(rn,"Area"),rn.prototype._class+=" chart_Area";const ln=(M(o=class extends on{_linearGap;textLocal=H();stackedTextLocal=H();isHorizontal;constructor(){super(),Ae.call(this),Me.call(this),this._selection.skipBringToTop(!0),this._linearGap=25}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(e){if("series-table"===n.tooltipStyle())return n.tooltipFormat({label:e.row[0],arr:n.columns().slice(1).map(function(t,i){return{label:t,color:n._palette(t),value:e.row[i+1]}})});{let i=e.row[e.idx];return i instanceof Array&&(i=i[1]-i[0]),n.tooltipFormat({label:e.row[0],series:n.layerColumns(t)[e.idx],value:i})}})}adjustedData(t){return this.layerData(t).map(e=>{let i=0;return e.map((e,n)=>{if(0===n)return e;if(n>=this.layerColumns(t).length)return e;const o=t.yAxisStacked()?[i,i+e]:e;return i+=e,o},this)},this)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n="horizontal"===t.orientation();this.isHorizontal=n;const o=this;this.tabNavigation()&&t.parentRelativeDiv?t.parentRelativeDiv.attr("tabindex","0").attr("role","group").attr("aria-label",`${this.columns()[0]||"Chart"} data`):t.parentRelativeDiv&&t.parentRelativeDiv.attr("tabindex",null).attr("role",null).attr("aria-label",null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const a=Z(o.showValueAsPercentFormat());let s=10,r=0;switch(t.xAxisType()){case"ordinal":s=t.bandwidth(),r=-s/2;break;case"linear":case"time":s=Math.max(Math.abs(t.dataPos(2)-t.dataPos(1))*(100-this._linearGap)/100,s),r=-s/2}this.tooltip.direction(n?"n":"e");const l=lt().domain(o.layerColumns(t).filter(function(t,e){return e>0})).rangeRound(n?[0,s]:[s,0]).paddingInner(Math.max(this.xAxisSeriesPaddingInner(),.05)).paddingOuter(0);let h=[];const c=[],u=this.columns().length,p=this.data();this.showValue()&&"series"===this.showValueAsPercent()&&p.forEach(t=>{t.filter((t,e)=>e>0&&e<u).forEach((t,e)=>{void 0===c[e+1]&&(c[e+1]=0),c[e+1]+=t})}),(this.showDomainTotal()||this.showValue()&&"domain"===this.showValueAsPercent())&&(h=p.map(t=>t.filter((t,e)=>e>0&&e<u).reduce((t,e)=>t+e,0)));const d=e.selectAll(".dataRow").data(this.adjustedData(t)),f=t.data(),y=this.getAxisSize(t);d.enter().append("g").attr("class","dataRow").merge(d).each(function(e,p){const d=$(this),_=d.selectAll(".dataCell").data(e.filter(function(e,i){return i<o.layerColumns(t).length}).map(function(i,n){return{column:o.layerColumns(t)[n],row:e,origRow:f[p],value:i,idx:n}}).filter(function(t){return null!==t.value&&t.idx>0}),t=>t.column),x=_.enter().append("g").attr("class","dataCell").on("mouseout.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.hide.apply(o,arguments)}).on("mousemove.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.show.apply(o,arguments)}).call(t._selection.enter.bind(t._selection)).on("click",function(e){o.click(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).on("dblclick",function(e){o.dblclick(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).on("keydown",function(e,i){if(o.tabNavigation()){const e=dt();"Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),t._selection.click(this))}}).style("opacity",0).each(function(t){const e=$(this);e.append("rect").attr("class","columnRect series series-"+o.cssTag(t.column)),e.append("text").attr("class","columnRectText").style("stroke","transparent")});x.transition().duration(i).style("opacity",1);const m=t.yAxisStacked()?s:l.bandwidth();x.merge(_).attr("tabindex",o.tabNavigation()?0:null).attr("role",o.tabNavigation()?"button":null).attr("aria-label",o.tabNavigation()?t=>`${t.origRow[0]} - ${t.column}: ${t.value instanceof Array?t.value[1]-t.value[0]:t.value}`:null).each(function(s){const d=$(this),f=t.dataPos(e[0])+(t.yAxisStacked()?0:l(s.column))+r,_=s.value instanceof Array?s.value[1]:s.value;let x=s.origRow[s.idx];if(o.showValue()){const t=o.dataMeta();switch(o.showValueAsPercent()){case"series":const e=void 0!==t.sum?t.sum:c[s.idx];x=a(x/e);break;case"domain":const i=void 0!==t.sum?t.sum:h[p];x=a(x/i);break;default:x=Z(o.showValueFormat())(x)}}const g=t.valuePos(_),b=t.valuePos(s.value instanceof Array?s.value[0]:0),v=Math.min(b,g),w=Math.abs(g-b),S=o.innerTextFontSize(),k=o.innerTextPadding_exists()?o.innerTextPadding():S/2.5,A=o.intersectRectRect({x:n?f:v,y:n?v:f,width:n?m:w,height:n?w:m},{x:0,y:0,width:y.width,height:y.height}),C=d.select("rect").transition().duration(i).style("fill",t=>o.fillColor(t.row,t.column,t.value,t.origRow));n?C.attr("x",f).attr("y",v).attr("width",m).attr("height",w):C.attr("y",f).attr("x",v).attr("height",m).attr("width",w);const M=d.select("text").transition().duration(i).style("font-size",S+"px").style("fill",t=>o.textColor(t.row,t.column,t.value,t.origRow));M.style("font-family",o.innerTextFontFamily_exists()?o.innerTextFontFamily():null);const P=o.innerTextPadding_exists()?o.innerTextPadding():8,T=S/2.7;if(n){const t=A.y+A.height-k;M.attr("x",f+m/2).attr("y",t+T).attr("transform",`rotate(-90, ${f+m/2}, ${t})`)}else M.attr("x",A.x+P).attr("y",f+m/2+T);M.attr("height",m).attr("width",w),o.showInnerText()&&M.text(t=>{const e=o.innerText(t.origRow,t.origRow[u],t.idx);if(e){const i=n?A.height:A.width,a=o.calcInnerText(i,e,x);return t.innerTextObj=a,a.text}return""});const I=d.selectAll(".dataText").data(o.showValue()?[`${_}`]:[]);I.enter().append("g").attr("class","dataText").each(function(t){o.textLocal.set(this,(new mt).target(this).colorStroke_default("transparent"))}).merge(I).each(function(){const t={x:0,y:0},e=o.valueFontFamily(),i=o.valueFontSize(),a=o.textSize(x,e,i),r=parseFloat(x)>=0;let l=o.valueAnchor()?o.valueAnchor():n?"middle":"start";const h=A.x,c=y.width-(A.x+A.width),u=A.y,p=y.height-(A.y+A.height);let d,_,g;if(s.innerTextObj){const{padding:e,valueTextWidth:o}=s.innerTextObj;_=!1,n?(l="middle",t.x=f+m/2,4===s.innerTextObj.category?(_=!0,t.y=v-e-i/2):t.y=v+e+i/2):(l="start",4===s.innerTextObj.category?(_=!0,t.x=w+v+e):t.x=w+v-o-e,t.y=f+m/2)}else n?(d=A.height<a.height,_=!o.valueCentered()||d,t.x=A.x+A.width/2,_?r?(g=u<a.height+P,g?d?t.y=A.y+A.height+a.height:(_=!1,t.y=A.y+A.height/2):t.y=A.y-a.height/2-P):(g=p<a.height,g?d?t.y=A.y-a.height/2-P:(_=!1,t.y=A.y+A.height/2):t.y=A.y+a.height+P):t.y=A.y+A.height/2):(d=A.width<a.width,_=!o.valueCentered()||d,t.y=A.y+A.height/2,_?r?(g=c<a.width+P,g?o.showInnerText()||!d?(_=!1,t.x=A.x+A.width/2):t.x=A.x-(a.width-P):t.x=A.x+A.width+a.width/2+P):(g=h<a.width,g?o.showInnerText()||!d?(_=!1,t.x=A.x+A.width/2):t.x=A.x+A.width+(a.width-P):t.x=A.x-(a.width-P)):t.x=A.x+A.width/2);const b=_?null:o.textColor(s.row,s.column,s.value,s.origRow),S=o.columns(),k=o.yAxisStacked()&&d||_&&o.yAxisStacked()&&S.indexOf(s.column)!==S.length-1;o.textLocal.get(this).pos(t).anchor(l).fontFamily(e).fontSize(i).text(`${x}`).colorFill(b).visible(o.showValue()&&!k).render()}),I.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),_.exit().transition().duration(i).style("opacity",0).remove();const g=t.yAxisStacked()?h[p]:Math.max(...e.filter((t,e)=>e>0&&e<u)),b=d.selectAll(".stackedTotalText").data(o.showDomainTotal()?[h[p]]:[]);b.enter().append("g").attr("class","stackedTotalText").each(function(t){o.stackedTextLocal.set(this,(new mt).target(this).colorStroke_default("transparent"))}).merge(b).each(function(i){const a={x:0,y:0},s=t.dataPos(e[0]),r=t.valuePos(g),l=o.valueFontFamily(),h=o.valueFontSize(),c=o.textSize(i,l,h),u=parseFloat(i)>=0;let p="middle";n?(a.x=s,a.y=u?r-c.height/2:r+c.height/2):(p="start",a.y=s,a.x=u?r+c.width/2:r-c.width/2),o.stackedTextLocal.get(this).pos(a).anchor(p).fontFamily(l).fontSize(h).text(i).render()}),b.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),d.exit().transition().duration(i).remove()}calcInnerText(t,e,i){const n=this.innerTextFontFamily_exists()?this.innerTextFontFamily():"Verdana",o=this.innerTextFontSize(),a=this.valueFontFamily_exists()?this.valueFontFamily():"Verdana",s=this.valueFontSize(),r=this.innerTextPadding_exists()?this.innerTextPadding():o/2.5,l=this.isHorizontal?s:this.textSize(i,a,s).width,h=e,c=3*r+this.textSize("...",n,o).width+l,u=1*r+l;let p=4;if(3*r+this.textSize(e,n,o).width+l<t)p=1;else if(c<t){const i=t-c;let a="";for(const t of e){if(this.textSize(a+t,n,o).width>i){e=a+"...";break}a+=t}p=2}else u<t?(e="",p=3):e="";return{text:e,isTruncated:h!==e,padding:r,category:p,valueTextWidth:l}}innerText(t,e,i){return t[0]}},"_Column"),o);Fe(ln,"Column"),De(ln,"__inputs",[{id:"label",type:"string"},{id:"values",type:"number",multi:!0}]);let hn=ln;hn.prototype._class+=" chart_Column",hn.prototype.implements(Ae.prototype),hn.prototype.implements(Me.prototype),hn.prototype.publish("valueFontFamily",null,"string","Font family of value text",null,{optional:!0}),hn.prototype.publish("valueFontSize",12,"number","Height of value text (pixels)"),hn.prototype.publish("innerTextFontFamily",null,"string","Font family of inner text",null,{optional:!0}),hn.prototype.publish("innerTextPadding",8,"number","Offset of inner text (pixels)",null,{optional:!0}),hn.prototype.publish("innerTextFontSize",12,"number","Height of inner text (pixels)"),hn.prototype.publish("paletteID","default","set","Color palette for this widget",()=>hn.prototype._palette.switch(),{tags:["Basic","Shared"]}),hn.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),hn.prototype.publish("showValue",!1,"boolean","Show Value in column"),hn.prototype.publish("showInnerText",!1,"boolean","Show Label in column"),hn.prototype.publish("showValueFormat",",","string","D3 Format for Value",null,{disable:/* @__PURE__ */Fe(t=>!t.showValue()||!!t.showValueAsPercent(),"disable")}),hn.prototype.publish("showValueAsPercent",null,"set","If showValue is true, optionally show value as a percentage by Series or Domain",[null,"series","domain"],{disable:/* @__PURE__ */Fe(t=>!t.showValue(),"disable"),optional:!0}),hn.prototype.publish("showValueAsPercentFormat",".0%","string","D3 Format for %",null,{disable:/* @__PURE__ */Fe(t=>!t.showValue()||!t.showValueAsPercent(),"disable")}),hn.prototype.publish("showDomainTotal",!1,"boolean","Show Total Value for Stacked Columns",null),hn.prototype.publish("valueCentered",!1,"boolean","Show Value in center of column"),hn.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),hn.prototype.publish("xAxisSeriesPaddingInner",0,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)"),hn.prototype.publish("tooltipInnerTextEllipsedOnly",!1,"boolean","Show tooltip only when inner text is truncated with an ellipsis");const cn=(M(a=class extends hn{constructor(){super(),this.orientation_default("vertical")}},"_Bar"),a);Fe(cn,"Bar");let un=cn;function pn(t){var e=0,i=t.children,n=i&&i.length;if(n)for(;--n>=0;)e+=i[n].value;else e=1;t.value=e}function dn(){return this.eachAfter(pn)}function fn(t){var e,i,n,o,a=this,s=[a];do{for(e=s.reverse(),s=[];a=e.pop();)if(t(a),i=a.children)for(n=0,o=i.length;n<o;++n)s.push(i[n])}while(s.length);return this}function yn(t){for(var e,i,n=this,o=[n];n=o.pop();)if(t(n),e=n.children)for(i=e.length-1;i>=0;--i)o.push(e[i]);return this}function _n(t){for(var e,i,n,o=this,a=[o],s=[];o=a.pop();)if(s.push(o),e=o.children)for(i=0,n=e.length;i<n;++i)a.push(e[i]);for(;o=s.pop();)t(o);return this}function xn(t){return this.eachAfter(function(e){for(var i=+t(e.data)||0,n=e.children,o=n&&n.length;--o>=0;)i+=n[o].value;e.value=i})}function mn(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function gn(t){for(var e=this,i=bn(e,t),n=[e];e!==i;)e=e.parent,n.push(e);for(var o=n.length;t!==i;)n.splice(o,0,t),t=t.parent;return n}function bn(t,e){if(t===e)return t;var i=t.ancestors(),n=e.ancestors(),o=null;for(t=i.pop(),e=n.pop();t===e;)o=t,t=i.pop(),e=n.pop();return o}function vn(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function wn(){var t=[];return this.each(function(e){t.push(e)}),t}function Sn(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function kn(){var t=this,e=[];return t.each(function(i){i!==t&&e.push({source:i.parent,target:i})}),e}function An(t,e){var i,n,o,a,s,r=new In(t),l=+t.value&&(r.value=t.value),h=[r];for(null==e&&(e=Mn);i=h.pop();)if(l&&(i.value=+i.data.value),(o=e(i.data))&&(s=o.length))for(i.children=new Array(s),a=s-1;a>=0;--a)h.push(n=i.children[a]=new In(o[a])),n.parent=i,n.depth=i.depth+1;return r.eachBefore(Tn)}function Cn(){return An(this).eachBefore(Pn)}function Mn(t){return t.children}function Pn(t){t.data=t.data.data}function Tn(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function In(t){this.data=t,this.depth=this.height=0,this.parent=null}M(pn,"Ce"),M(dn,"ze"),M(fn,"Fe"),M(yn,"Ie"),M(_n,"Ee"),M(xn,"Re"),M(mn,"De"),M(gn,"Oe"),M(bn,"je"),M(vn,"Ne"),M(wn,"Le"),M(Sn,"Be"),M(kn,"$e"),M(An,"He"),M(Cn,"Ve"),M(Mn,"qe"),M(Pn,"We"),M(Tn,"Ge"),M(In,"Xe"),un.prototype._class+=" chart_Bar",Fe(pn,"count"),Fe(dn,"node_count"),Fe(fn,"node_each"),Fe(yn,"node_eachBefore"),Fe(_n,"node_eachAfter"),Fe(xn,"node_sum"),Fe(mn,"node_sort"),Fe(gn,"node_path"),Fe(bn,"leastCommonAncestor"),Fe(vn,"node_ancestors"),Fe(wn,"node_descendants"),Fe(Sn,"node_leaves"),Fe(kn,"node_links"),Fe(An,"hierarchy"),Fe(Cn,"node_copy"),Fe(Mn,"defaultChildren"),Fe(Pn,"copyData"),Fe(Tn,"computeHeight"),Fe(In,"Node$1"),In.prototype=An.prototype={constructor:In,count:dn,each:fn,eachAfter:_n,eachBefore:yn,sum:xn,sort:mn,path:gn,ancestors:vn,descendants:wn,leaves:Sn,links:kn,copy:Cn};var En=Array.prototype.slice;function Fn(t){for(var e,i,n=t.length;n;)i=Math.random()*n--|0,e=t[n],t[n]=t[i],t[i]=e;return t}function Dn(t){for(var e,i,n=0,o=(t=Fn(En.call(t))).length,a=[];n<o;)e=t[n],i&&On(i,e)?++n:(i=Nn(a=Rn(a,e)),n=0);return i}function Rn(t,e){var i,n;if(jn(e,t))return[e];for(i=0;i<t.length;++i)if(zn(e,t[i])&&jn(Bn(t[i],e),t))return[t[i],e];for(i=0;i<t.length-1;++i)for(n=i+1;n<t.length;++n)if(zn(Bn(t[i],t[n]),e)&&zn(Bn(t[i],e),t[n])&&zn(Bn(t[n],e),t[i])&&jn(Vn(t[i],t[n],e),t))return[t[i],t[n],e];throw new Error}function zn(t,e){var i=t.r-e.r,n=e.x-t.x,o=e.y-t.y;return i<0||i*i<n*n+o*o}function On(t,e){var i=t.r-e.r+1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function jn(t,e){for(var i=0;i<e.length;++i)if(!On(t,e[i]))return!1;return!0}function Nn(t){switch(t.length){case 1:return Ln(t[0]);case 2:return Bn(t[0],t[1]);case 3:return Vn(t[0],t[1],t[2])}}function Ln(t){return{x:t.x,y:t.y,r:t.r}}function Bn(t,e){var i=t.x,n=t.y,o=t.r,a=e.x,s=e.y,r=e.r,l=a-i,h=s-n,c=r-o,u=Math.sqrt(l*l+h*h);return{x:(i+a+l/u*c)/2,y:(n+s+h/u*c)/2,r:(u+o+r)/2}}function Vn(t,e,i){var n=t.x,o=t.y,a=t.r,s=e.x,r=e.y,l=e.r,h=i.x,c=i.y,u=i.r,p=n-s,d=n-h,f=o-r,y=o-c,_=l-a,x=u-a,m=n*n+o*o-a*a,g=m-s*s-r*r+l*l,b=m-h*h-c*c+u*u,v=d*f-p*y,w=(f*b-y*g)/(2*v)-n,S=(y*_-f*x)/v,k=(d*g-p*b)/(2*v)-o,A=(p*x-d*_)/v,C=S*S+A*A-1,M=2*(a+w*S+k*A),P=w*w+k*k-a*a,T=-(C?(M+Math.sqrt(M*M-4*C*P))/(2*C):P/M);return{x:n+w+S*T,y:o+k+A*T,r:T}}function Hn(t,e,i){var n,o,a,s,r=t.x-e.x,l=t.y-e.y,h=r*r+l*l;h?(o=e.r+i.r,o*=o,s=t.r+i.r,o>(s*=s)?(n=(h+s-o)/(2*h),a=Math.sqrt(Math.max(0,s/h-n*n)),i.x=t.x-n*r-a*l,i.y=t.y-n*l+a*r):(n=(h+o-s)/(2*h),a=Math.sqrt(Math.max(0,o/h-n*n)),i.x=e.x+n*r-a*l,i.y=e.y+n*l+a*r)):(i.x=e.x+i.r,i.y=e.y)}function $n(t,e){var i=t.r+e.r-1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function Wn(t){var e=t._,i=t.next._,n=e.r+i.r,o=(e.x*i.r+i.x*e.r)/n,a=(e.y*i.r+i.y*e.r)/n;return o*o+a*a}function qn(t){this._=t,this.next=null,this.previous=null}function Gn(t){if(!(o=t.length))return 0;var e,i,n,o,a,s,r,l,h,c,u;if((e=t[0]).x=0,e.y=0,!(o>1))return e.r;if(i=t[1],e.x=-i.r,i.x=e.r,i.y=0,!(o>2))return e.r+i.r;Hn(i,e,n=t[2]),e=new qn(e),i=new qn(i),n=new qn(n),e.next=n.previous=i,i.next=e.previous=n,n.next=i.previous=e;t:for(r=3;r<o;++r){Hn(e._,i._,n=t[r]),n=new qn(n),l=i.next,h=e.previous,c=i._.r,u=e._.r;do{if(c<=u){if($n(l._,n._)){i=l,e.next=i,i.previous=e,--r;continue t}c+=l._.r,l=l.next}else{if($n(h._,n._)){(e=h).next=i,i.previous=e,--r;continue t}u+=h._.r,h=h.previous}}while(l!==h.next);for(n.previous=e,n.next=i,e.next=i.previous=i=n,a=Wn(e);(n=n.next)!==i;)(s=Wn(n))<a&&(e=n,a=s);i=e.next}for(e=[i._],n=i;(n=n.next)!==i;)e.push(n._);for(n=Dn(e),r=0;r<o;++r)(e=t[r]).x-=n.x,e.y-=n.y;return n.r}function Un(t){return null==t?null:Xn(t)}function Xn(t){if("function"!=typeof t)throw new Error;return t}function Yn(){return 0}function Qn(t){return function(){return t}}function Zn(t){return Math.sqrt(t.value)}function Jn(){var t=null,e=1,i=1,n=Yn;function o(o){return o.x=e/2,o.y=i/2,t?o.eachBefore(Kn(t)).eachAfter(to(n,.5)).eachBefore(eo(1)):o.eachBefore(Kn(Zn)).eachAfter(to(Yn,1)).eachAfter(to(n,o.r/Math.min(e,i))).eachBefore(eo(Math.min(e,i)/(2*o.r))),o}return M(o,"a"),Fe(o,"pack"),o.radius=function(e){return arguments.length?(t=Un(e),o):t},o.size=function(t){return arguments.length?(e=+t[0],i=+t[1],o):[e,i]},o.padding=function(t){return arguments.length?(n="function"==typeof t?t:Qn(+t),o):n},o}function Kn(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function to(t,e){return function(i){if(n=i.children){var n,o,a,s=n.length,r=t(i)*e||0;if(r)for(o=0;o<s;++o)n[o].r+=r;if(a=Gn(n),r)for(o=0;o<s;++o)n[o].r-=r;i.r=a+r}}}function eo(t){return function(e){var i=e.parent;e.r*=t,i&&(e.x=i.x+t*e.x,e.y=i.y+t*e.y)}}M(Fn,"Ue"),M(Dn,"Qe"),M(Rn,"Ze"),M(zn,"Je"),M(On,"Ke"),M(jn,"ti"),M(Nn,"ei"),M(Ln,"ii"),M(Bn,"ni"),M(Vn,"oi"),M(Hn,"ai"),M($n,"si"),M(Wn,"ri"),M(qn,"li"),M(Gn,"hi"),M(Un,"ci"),M(Xn,"ui"),M(Yn,"pi"),M(Qn,"di"),M(Zn,"fi"),M(Jn,"yi"),M(Kn,"_i"),M(to,"xi"),M(eo,"mi"),Fe(Fn,"shuffle"),Fe(Dn,"enclose"),Fe(Rn,"extendBasis"),Fe(zn,"enclosesNot"),Fe(On,"enclosesWeak"),Fe(jn,"enclosesWeakAll"),Fe(Nn,"encloseBasis"),Fe(Ln,"encloseBasis1"),Fe(Bn,"encloseBasis2"),Fe(Vn,"encloseBasis3"),Fe(Hn,"place"),Fe($n,"intersects"),Fe(Wn,"score"),Fe(qn,"Node"),Fe(Gn,"packEnclose"),Fe(Un,"optional"),Fe(Xn,"required"),Fe(Yn,"constantZero"),Fe(Qn,"constant$2"),Fe(Zn,"defaultRadius"),Fe(Jn,"d3Pack"),Fe(Kn,"radiusLeaf"),Fe(to,"packChildren"),Fe(eo,"translateChild");const io=(M(s=class extends et{labelWidgets;d3Pack;constructor(){super(),be.call(this),Me.call(this),tt.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.labelWidgets={},this.d3Pack=Jn().size([this.width(),this.height()]).padding(1.5)}size(t){const e=super.size.apply(this,arguments);return arguments.length&&this.d3Pack.size([this.width(),this.height()]),e}enter(t,e){super.enter(t,e),this._selection.widgetElement(e);const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t[0]),value:t[1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){super.update(t,e);const i=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const n=An({children:this.cloneData()}).sum(function(t){return t[1]}).sort(function(t,e){return e[1]<t[1]?-1:e[1]>t[1]?1:0});this.d3Pack(n);const o=e.selectAll(".node").data(n.children||[],t=>t.data[0]);o.enter().append("g").attr("class",(t,e)=>"node series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).each(function(t){const e=$(this),n=t.x,o=t.y;e.append("circle").attr("transform","translate("+n+","+o+")").attr("r",0).on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show),t.__viz_faChar?i.labelWidgets[t.data[0]]=(new gt).char(t.__viz_faChar).target(this).render():i.labelWidgets[t.data[0]]=(new mt).text(t.data[0]).target(this).render()}).merge(o).transition().attr("opacity",1).each(function(t){const e=$(this),n={x:t.x,y:t.y};e.select("circle").transition().attr("transform","translate("+n.x+","+n.y+")").style("fill",i.fillColor(t.data,i.columns()[1],t.data[1])).attr("r",t.r).select("title").text(t.data[0]+" ("+t.data[1]+")"),t.__viz_faChar?i.labelWidgets[t.data[0]].pos(n).render():i.labelWidgets[t.data[0]].pos(n).colorFill_default(i.textColor(t.data,i.columns()[1],t.data[1])).width(2*t.r).text(t.data[0]).render()}),o.exit().transition().style("opacity",0).remove()}exit(t,e){super.exit(t,e)}},"_Bubble"),s);Fe(io,"Bubble"),De(io,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let no=io;no.prototype._class+=" chart_Bubble",no.prototype.implements(be.prototype),no.prototype.implements(Me.prototype),no.prototype.mixin(tt.SimpleSelectionMixin),no.prototype.publish("paletteID","default","set","Color palette for this widget",no.prototype._palette.switch(),{tags:["Basic","Shared"]}),no.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});const oo=(M(r=class extends sn{constructor(){super()}enter(t,e){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(t,e)}},"_BubbleXY"),r);Fe(oo,"BubbleXY"),oo.prototype._class+=" chart_BubbleXY";var ao,so,ro=0,lo=0,ho=0,co=0,uo=0,po=0,fo="object"==typeof performance&&performance.now?performance:Date,yo="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function _o(){return uo||(yo(xo),uo=fo.now()+po)}function xo(){uo=0}function mo(){this._call=this._time=this._next=null}function go(){_o(),++ro;for(var t,e=ao;e;)(t=uo-e._time)>=0&&e._call.call(null,t),e=e._next;--ro}function bo(){uo=(co=fo.now())+po,ro=lo=0;try{go()}finally{ro=0,wo(),uo=0}}function vo(){var t=fo.now(),e=t-co;e>1e3&&(po-=e,co=t)}function wo(){for(var t,e,i=ao,n=1/0;i;)i._call?(n>i._time&&(n=i._time),t=i,i=i._next):(e=i._next,i._next=null,i=t?t._next=e:ao=e);so=t,So(n)}function So(t){ro||(lo&&(lo=clearTimeout(lo)),t-uo>24?(t<1/0&&(lo=setTimeout(bo,t-fo.now()-po)),ho&&(ho=clearInterval(ho))):(ho||(co=fo.now(),ho=setInterval(vo,1e3)),ro=1,yo(bo)))}function ko(){var t="left",e=!1,i=!1,n=Ao,o=Co,a=Mo,s=380,r=30,l=Ki();function h(t){t.each(function(t,h){var c,u,p=n.call(this,t,h).slice().sort(Tt),d=o.call(this,t,h).slice().sort(Tt),f=a.call(this,t,h).slice().sort(Tt),y=$(this),_=y.select("g.wrap");_.empty()&&(_=y.append("g").attr("class","wrap")),i?(c=r,u=s,_.attr("transform","rotate(90)translate(0,"+-s+")")):(c=s,u=r,_.attr("transform",null));var x=rt().domain([0,Math.max(p[0],d[0],f[0])]).range(e?[c,0]:[0,c]),m=this.__chart__||rt().domain([0,1/0]).range(x.range());this.__chart__=x;var g=Po(m),b=Po(x),v=_.selectAll("rect.range").data(p);v.enter().append("rect").attr("class",function(t,e){return"range s"+e}).attr("width",g).attr("height",u).attr("x",e?m:0).merge(v).transition(v).attr("x",e?x:0).attr("width",b).attr("height",u);var w=_.selectAll("rect.measure").data(f);w.enter().append("rect").attr("class",function(t,e){return"measure s"+e}).attr("width",g).attr("height",u/3).attr("x",e?m:0).attr("y",u/3).merge(w).transition(w).attr("width",b).attr("height",u/3).attr("x",e?x:0).attr("y",u/3);var S=_.selectAll("line.marker").data(d);S.enter().append("line").attr("class","marker").attr("x1",m).attr("x2",m).attr("y1",u/6).attr("y2",5*u/6).merge(S).transition(S).attr("x1",x).attr("x2",x).attr("y1",u/6).attr("y2",5*u/6);var k=y.selectAll("g.axis").data([0]);k.enter().append("g").attr("class","axis"),k.attr("transform",i?null:"translate(0,"+u+")").call(l.scale(x))}),go()}return M(h,"u"),Fe(h,"bulvar"),h.orient=function(n){return arguments.length?(e="right"==(t=n+"")||"bottom"===t,l.orient((i="top"===t||"bottom"===t)?"left":"bottom"),h):t},h.ranges=function(t){return arguments.length?(n=t,h):n},h.markers=function(t){return arguments.length?(o=t,h):o},h.measures=function(t){return arguments.length?(a=t,h):a},h.width=function(t){return arguments.length?(s=+t,h):s},h.height=function(t){return arguments.length?(r=+t,h):r},h.tickFormat=function(t){return arguments.length?(l.tickFormat(t),h):l.tickFormat()},h}function Ao(t){return t.ranges}function Co(t){return t.markers}function Mo(t){return t.measures}function Po(t){var e=t(0);return function(i){return Math.abs(t(i)-e)}}M(_o,"Ei"),M(xo,"Ri"),M(mo,"Di"),M(go,"Oi"),M(bo,"ji"),M(vo,"Ni"),M(wo,"Li"),M(So,"Bi"),M(ko,"$i"),M(Ao,"Hi"),M(Co,"Vi"),M(Mo,"qi"),M(Po,"Wi"),Fe(_o,"now"),Fe(xo,"clearNow"),Fe(mo,"Timer"),mo.prototype={constructor:mo,restart:/* @__PURE__ */Fe(function(t,e,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?_o():+i)+(null==e?0:+e),this._next||so===this||(so?so._next=this:ao=this,so=this),this._call=t,this._time=i,So()},"restart"),stop:/* @__PURE__ */Fe(function(){this._call&&(this._call=null,this._time=1/0,So())},"stop")},Fe(go,"timerFlush"),Fe(bo,"wake"),Fe(vo,"poke"),Fe(wo,"nap"),Fe(So,"sleep"),Fe(ko,"d3Bullet"),Fe(Ao,"bulvarRanges"),Fe(Co,"bulvarMarkers"),Fe(Mo,"bulvarMeasures"),Fe(Po,"bulvarWidth");const To=(M(l=class extends bt{_hiddenColumns={};constructor(){super(),tt.SimpleSelectionMixin.call(this,!0)}bulletData(){const t=this;this._hiddenColumns={};const e=this.columns();return this.data().map(function(t){return{title:i(t,this.titleColumn()),subtitle:i(t,this.subtitleColumn()),ranges:i(t,this.rangesColumn(),"range"),measures:i(t,this.measuresColumn(),"measure"),markers:i(t,this.markersColumn(),"marker"),origRow:t}},this);function i(i,n,o){const a=e.indexOf(n);return a>=0?i[a]instanceof Array?i[a]:[i[a]]:(o&&(t._hiddenColumns[o]=!0),[0])}}enter(t,e){super.enter(t,e),$(t.parentNode).style("overflow","auto"),this._selection.widgetElement(e)}update(t,e){super.update(t,e);const i=this;e.selectAll(".axis").style("display","none"),e.selectAll(".range,.measure,.marker").style("display",null);const n=this.width()-2-2,o=e.selectAll("svg").data(this.bulletData()),a=o.enter().append("svg").attr("class","bullet").call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).each(function(){const t=$(this).append("g").attr("class",(t,e)=>"bulletBar series series-"+i.cssTag(i.titleColumn())).append("g").attr("class","bulletTitle");t.append("text").attr("class","title"),t.append("text").attr("class","subtitle").attr("dy","1em")}).merge(o),s=a.select(".bulletTitle").style("text-anchor","end").attr("transform","translate(-6,12)");s.select(".title").text(function(t){return t.title}),s.select(".subtitle").text(function(t){return t.subtitle});let r=0;s.each(function(){const t=this.getBBox();t.width>r&&(r=t.width)});const l=ko().width(n-r-6).height(24);a.attr("width",n).attr("height",40).style("margin-left","2px"),a.select(".bulletBar").attr("transform","translate("+(r+6)+",8)").call(l),o.exit().remove(),Object.keys(this._hiddenColumns).length>0&&e.selectAll(`.${Object.keys(this._hiddenColumns).join(",.")}`).style("display","none")}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}_selection},"_Bullet"),l);Fe(To,"Bullet");let Io=To;Io.prototype._class+=" chart_Bullet",Io.prototype.publish("titleColumn",null,"set","Title Column",function(){return this.columns()},{optional:!0}),Io.prototype.publish("subtitleColumn",null,"set","Subtitle Column",function(){return this.columns()},{optional:!0}),Io.prototype.publish("rangesColumn",null,"set","Ranges Column",function(){return this.columns()},{optional:!0}),Io.prototype.publish("measuresColumn",null,"set","Measures Column",function(){return this.columns()},{optional:!0}),Io.prototype.publish("markersColumn",null,"set","Markers Column",function(){return this.columns()},{optional:!0});var Eo=Array.prototype.slice;function Fo(t,e){return t-e}function Do(t){for(var e=0,i=t.length,n=t[i-1][1]*t[0][0]-t[i-1][0]*t[0][1];++e<i;)n+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return n}function Ro(t){return function(){return t}}function zo(t,e){for(var i,n=-1,o=e.length;++n<o;)if(i=Oo(t,e[n]))return i;return 0}function Oo(t,e){for(var i=e[0],n=e[1],o=-1,a=0,s=t.length,r=s-1;a<s;r=a++){var l=t[a],h=l[0],c=l[1],u=t[r],p=u[0],d=u[1];if(jo(l,u,e))return 0;c>n!=d>n&&i<(p-h)*(n-c)/(d-c)+h&&(o=-o)}return o}function jo(t,e,i){var n;return No(t,e,i)&&Lo(t[n=+(t[0]===e[0])],i[n],e[n])}function No(t,e,i){return(e[0]-t[0])*(i[1]-t[1])===(i[0]-t[0])*(e[1]-t[1])}function Lo(t,e,i){return t<=e&&e<=i||i<=e&&e<=t}function Bo(){}M(Fo,"Ui"),M(Do,"Qi"),M(Ro,"Zi"),M(zo,"Ji"),M(Oo,"Ki"),M(jo,"tn"),M(No,"en"),M(Lo,"nn"),M(Bo,"on"),Fe(Fo,"ascending"),Fe(Do,"area"),Fe(Ro,"constant$1"),Fe(zo,"contains"),Fe(Oo,"ringContains"),Fe(jo,"segmentContains"),Fe(No,"collinear"),Fe(Lo,"within"),Fe(Bo,"noop$2");var Vo=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Ho(){var t=1,e=1,i=Ft,n=l;function o(t){var e=i(t);if(Array.isArray(e))e=e.slice().sort(Fo);else{var n=xt(t),o=n[0],s=n[1];e=It(o,s,e),e=Et(Math.floor(o/e)*e,Math.floor(s/e)*e,e)}return e.map(function(e){return a(t,e)})}function a(t,e){var i=[],o=[];return s(t,e,function(a){n(a,t,e),Do(a)>0?i.push([a]):o.push(a)}),o.forEach(function(t){for(var e,n=0,o=i.length;n<o;++n)if(-1!==zo((e=i[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:e,coordinates:i}}function s(i,n,o){var a,s,l,h,c,u,p=new Array,d=new Array;for(a=s=-1,h=i[0]>=n,Vo[h<<1].forEach(f);++a<t-1;)l=h,h=i[a+1]>=n,Vo[l|h<<1].forEach(f);for(Vo[0|h].forEach(f);++s<e-1;){for(a=-1,h=i[s*t+t]>=n,c=i[s*t]>=n,Vo[h<<1|c<<2].forEach(f);++a<t-1;)l=h,h=i[s*t+t+a+1]>=n,u=c,c=i[s*t+a+1]>=n,Vo[l|h<<1|c<<2|u<<3].forEach(f);Vo[h|c<<3].forEach(f)}for(a=-1,c=i[s*t]>=n,Vo[c<<2].forEach(f);++a<t-1;)u=c,c=i[s*t+a+1]>=n,Vo[c<<2|u<<3].forEach(f);function f(t){var e,i,n=[t[0][0]+a,t[0][1]+s],l=[t[1][0]+a,t[1][1]+s],h=r(n),c=r(l);(e=d[h])?(i=p[c])?(delete d[e.end],delete p[i.start],e===i?(e.ring.push(l),o(e.ring)):p[e.start]=d[i.end]={start:e.start,end:i.end,ring:e.ring.concat(i.ring)}):(delete d[e.end],e.ring.push(l),d[e.end=c]=e):(e=p[c])?(i=d[h])?(delete p[e.start],delete d[i.end],e===i?(e.ring.push(l),o(e.ring)):p[i.start]=d[e.end]={start:i.start,end:e.end,ring:i.ring.concat(e.ring)}):(delete p[e.start],e.ring.unshift(n),p[e.start=h]=e):p[h]=d[c]={start:h,end:c,ring:[n,l]}}M(f,"y"),Vo[c<<3].forEach(f),Fe(f,"stitch")}function r(e){return 2*e[0]+e[1]*(t+1)*4}function l(i,n,o){i.forEach(function(i){var a,s=i[0],r=i[1],l=0|s,h=0|r,c=n[h*t+l];s>0&&s<t&&l===s&&(a=n[h*t+l-1],i[0]=s+(o-a)/(c-a)-.5),r>0&&r<e&&h===r&&(a=n[(h-1)*t+l],i[1]=r+(o-a)/(c-a)-.5)})}return M(o,"a"),M(a,"s"),M(s,"r"),M(r,"l"),M(l,"h"),Fe(o,"contours"),Fe(a,"contour"),Fe(s,"isorings"),Fe(r,"index"),Fe(l,"smoothLinear"),o.contour=a,o.size=function(i){if(!arguments.length)return[t,e];var n=Math.ceil(i[0]),a=Math.ceil(i[1]);if(!(n>0&&a>0))throw new Error("invalid size");return t=n,e=a,o},o.thresholds=function(t){return arguments.length?(i="function"==typeof t?t:Array.isArray(t)?Ro(Eo.call(t)):Ro(t),o):i},o.smooth=function(t){return arguments.length?(n=t?l:Bo,o):n===l},o}function $o(t,e,i){for(var n=t.width,o=t.height,a=1+(i<<1),s=0;s<o;++s)for(var r=0,l=0;r<n+i;++r)r<n&&(l+=t.data[r+s*n]),r>=i&&(r>=a&&(l-=t.data[r-a+s*n]),e.data[r-i+s*n]=l/Math.min(r+1,n-1+a-r,a))}function Wo(t,e,i){for(var n=t.width,o=t.height,a=1+(i<<1),s=0;s<n;++s)for(var r=0,l=0;r<o+i;++r)r<o&&(l+=t.data[s+r*n]),r>=i&&(r>=a&&(l-=t.data[s+(r-a)*n]),e.data[s+(r-i)*n]=l/Math.min(r+1,o-1+a-r,a))}function qo(t){return t[0]}function Go(t){return t[1]}function Uo(){return 1}function Xo(){var t=qo,e=Go,i=Uo,n=960,o=500,a=20,s=2,r=3*a,l=n+2*r>>s,h=o+2*r>>s,c=Ro(20);function u(n){var o=new Float32Array(l*h),u=new Float32Array(l*h);n.forEach(function(n,a,c){var u=+t(n,a,c)+r>>s,p=+e(n,a,c)+r>>s,d=+i(n,a,c);u>=0&&u<l&&p>=0&&p<h&&(o[u+p*l]+=d)}),$o({width:l,height:h,data:o},{data:u},a>>s),Wo({width:l,height:h,data:u},{data:o},a>>s),$o({width:l,height:h,data:o},{data:u},a>>s),Wo({width:l,height:h,data:u},{data:o},a>>s),$o({width:l,height:h,data:o},{data:u},a>>s),Wo({width:l,height:h,data:u},{data:o},a>>s);var d=c(o);if(!Array.isArray(d)){var f=yt(o);d=It(0,f,d),(d=Et(0,Math.floor(f/d)*d,d)).shift()}return Ho().thresholds(d).size([l,h])(o).map(p)}function p(t){return t.value*=Math.pow(2,-2*s),t.coordinates.forEach(d),t}function d(t){t.forEach(f)}function f(t){t.forEach(y)}function y(t){t[0]=t[0]*Math.pow(2,s)-r,t[1]=t[1]*Math.pow(2,s)-r}function _(){return l=n+2*(r=3*a)>>s,h=o+2*r>>s,u}return M(u,"p"),M(p,"d"),M(d,"f"),M(f,"y"),M(y,"_"),M(_,"x"),Fe(u,"density"),Fe(p,"transform"),Fe(d,"transformPolygon"),Fe(f,"transformRing"),Fe(y,"transformPoint"),Fe(_,"resize"),u.x=function(e){return arguments.length?(t="function"==typeof e?e:Ro(+e),u):t},u.y=function(t){return arguments.length?(e="function"==typeof t?t:Ro(+t),u):e},u.weight=function(t){return arguments.length?(i="function"==typeof t?t:Ro(+t),u):i},u.size=function(t){if(!arguments.length)return[n,o];var e=Math.ceil(t[0]),i=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return n=e,o=i,_()},u.cellSize=function(t){if(!arguments.length)return 1<<s;if(!((t=+t)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(t)/Math.LN2),_()},u.thresholds=function(t){return arguments.length?(c="function"==typeof t?t:Array.isArray(t)?Ro(Eo.call(t)):Ro(t),u):c},u.bandwidth=function(t){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return a=Math.round((Math.sqrt(4*t*t+1)-1)/2),_()},u}function Yo(){return new Qo}function Qo(){this.reset()}M(Ho,"sn"),M($o,"rn"),M(Wo,"ln"),M(qo,"hn"),M(Go,"cn"),M(Uo,"un"),M(Xo,"pn"),M(Yo,"dn"),M(Qo,"fn"),Fe(Ho,"contours"),Fe($o,"blurX"),Fe(Wo,"blurY"),Fe(qo,"defaultX"),Fe(Go,"defaultY"),Fe(Uo,"defaultWeight"),Fe(Xo,"d3ContourDensity"),Fe(Yo,"adder"),Fe(Qo,"Adder"),Qo.prototype={constructor:Qo,reset:/* @__PURE__ */Fe(function(){this.s=this.t=0},"reset"),add:/* @__PURE__ */Fe(function(t){Jo(Zo,t,this.t),Jo(this,Zo.s,this.s),this.s?this.t+=Zo.t:this.s=Zo.t},"add"),valueOf:/* @__PURE__ */Fe(function(){return this.s},"valueOf")};var Zo=new Qo;function Jo(t,e,i){var n=t.s=e+i,o=n-e,a=n-o;t.t=e-a+(i-o)}M(Jo,"_n"),Fe(Jo,"add");var Ko=2*Math.PI,ta=Math.abs,ea=Math.sqrt;function ia(){}function na(t,e){t&&aa.hasOwnProperty(t.type)&&aa[t.type](t,e)}M(ia,"bn"),M(na,"vn"),Fe(ia,"noop$1"),Fe(na,"streamGeometry");var oa={Feature:/* @__PURE__ */Fe(function(t,e){na(t.geometry,e)},"Feature"),FeatureCollection:/* @__PURE__ */Fe(function(t,e){for(var i=t.features,n=-1,o=i.length;++n<o;)na(i[n].geometry,e)},"FeatureCollection")},aa={Sphere:/* @__PURE__ */Fe(function(t,e){e.sphere()},"Sphere"),Point:/* @__PURE__ */Fe(function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},"Point"),MultiPoint:/* @__PURE__ */Fe(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)t=i[n],e.point(t[0],t[1],t[2])},"MultiPoint"),LineString:/* @__PURE__ */Fe(function(t,e){sa(t.coordinates,e,0)},"LineString"),MultiLineString:/* @__PURE__ */Fe(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)sa(i[n],e,0)},"MultiLineString"),Polygon:/* @__PURE__ */Fe(function(t,e){ra(t.coordinates,e)},"Polygon"),MultiPolygon:/* @__PURE__ */Fe(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)ra(i[n],e)},"MultiPolygon"),GeometryCollection:/* @__PURE__ */Fe(function(t,e){for(var i=t.geometries,n=-1,o=i.length;++n<o;)na(i[n],e)},"GeometryCollection")};function sa(t,e,i){var n,o=-1,a=t.length-i;for(e.lineStart();++o<a;)n=t[o],e.point(n[0],n[1],n[2]);e.lineEnd()}function ra(t,e){var i=-1,n=t.length;for(e.polygonStart();++i<n;)sa(t[i],e,1);e.polygonEnd()}function la(t,e){t&&oa.hasOwnProperty(t.type)?oa[t.type](t,e):na(t,e)}function ha(t){return t}M(sa,"An"),M(ra,"kn"),M(la,"Mn"),M(ha,"Pn"),Fe(sa,"streamLine"),Fe(ra,"streamPolygon"),Fe(la,"geoStream"),Fe(ha,"identity");var ca,ua,pa,da,fa=Yo(),ya=Yo(),_a={point:ia,lineStart:ia,lineEnd:ia,polygonStart:/* @__PURE__ */Fe(function(){_a.lineStart=xa,_a.lineEnd=ba},"polygonStart"),polygonEnd:/* @__PURE__ */Fe(function(){_a.lineStart=_a.lineEnd=_a.point=ia,fa.add(ta(ya)),ya.reset()},"polygonEnd"),result:/* @__PURE__ */Fe(function(){var t=fa/2;return fa.reset(),t},"result")};function xa(){_a.point=ma}function ma(t,e){_a.point=ga,ca=pa=t,ua=da=e}function ga(t,e){ya.add(da*t-pa*e),pa=t,da=e}function ba(){ga(ca,ua)}M(xa,"Dn"),M(ma,"On"),M(ga,"jn"),M(ba,"Nn"),Fe(xa,"areaRingStart"),Fe(ma,"areaPointFirst"),Fe(ga,"areaPoint"),Fe(ba,"areaRingEnd");var va=1/0,wa=va,Sa=-va,ka=Sa,Aa={point:Ca,lineStart:ia,lineEnd:ia,polygonStart:ia,polygonEnd:ia,result:/* @__PURE__ */Fe(function(){var t=[[va,wa],[Sa,ka]];return Sa=ka=-(wa=va=1/0),t},"result")};function Ca(t,e){t<va&&(va=t),t>Sa&&(Sa=t),e<wa&&(wa=e),e>ka&&(ka=e)}M(Ca,"qn"),Fe(Ca,"boundsPoint");var Ma,Pa,Ta,Ia,Ea=0,Fa=0,Da=0,Ra=0,za=0,Oa=0,ja=0,Na=0,La=0,Ba={point:Va,lineStart:Ha,lineEnd:qa,polygonStart:/* @__PURE__ */Fe(function(){Ba.lineStart=Ga,Ba.lineEnd=Ua},"polygonStart"),polygonEnd:/* @__PURE__ */Fe(function(){Ba.point=Va,Ba.lineStart=Ha,Ba.lineEnd=qa},"polygonEnd"),result:/* @__PURE__ */Fe(function(){var t=La?[ja/La,Na/La]:Oa?[Ra/Oa,za/Oa]:Da?[Ea/Da,Fa/Da]:[NaN,NaN];return Ea=Fa=Da=Ra=za=Oa=ja=Na=La=0,t},"result")};function Va(t,e){Ea+=t,Fa+=e,++Da}function Ha(){Ba.point=$a}function $a(t,e){Ba.point=Wa,Va(Ta=t,Ia=e)}function Wa(t,e){var i=t-Ta,n=e-Ia,o=ea(i*i+n*n);Ra+=o*(Ta+t)/2,za+=o*(Ia+e)/2,Oa+=o,Va(Ta=t,Ia=e)}function qa(){Ba.point=Va}function Ga(){Ba.point=Xa}function Ua(){Ya(Ma,Pa)}function Xa(t,e){Ba.point=Ya,Va(Ma=Ta=t,Pa=Ia=e)}function Ya(t,e){var i=t-Ta,n=e-Ia,o=ea(i*i+n*n);Ra+=o*(Ta+t)/2,za+=o*(Ia+e)/2,Oa+=o,ja+=(o=Ia*t-Ta*e)*(Ta+t),Na+=o*(Ia+e),La+=3*o,Va(Ta=t,Ia=e)}function Qa(t){this._context=t}M(Va,"ao"),M(Ha,"so"),M($a,"ro"),M(Wa,"lo"),M(qa,"ho"),M(Ga,"co"),M(Ua,"uo"),M(Xa,"po"),M(Ya,"fo"),M(Qa,"yo"),Fe(Va,"centroidPoint"),Fe(Ha,"centroidLineStart"),Fe($a,"centroidPointFirstLine"),Fe(Wa,"centroidPointLine"),Fe(qa,"centroidLineEnd"),Fe(Ga,"centroidRingStart"),Fe(Ua,"centroidRingEnd"),Fe(Xa,"centroidPointFirstRing"),Fe(Ya,"centroidPointRing"),Fe(Qa,"PathContext"),Qa.prototype={_radius:4.5,pointRadius:/* @__PURE__ */Fe(function(t){return this._radius=t,this},"pointRadius"),polygonStart:/* @__PURE__ */Fe(function(){this._line=0},"polygonStart"),polygonEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"polygonEnd"),lineStart:/* @__PURE__ */Fe(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){0===this._line&&this._context.closePath(),this._point=NaN},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Ko)}},"point"),result:ia};var Za,Ja,Ka,ts,es,is=Yo(),ns={point:ia,lineStart:/* @__PURE__ */Fe(function(){ns.point=os},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){Za&&as(Ja,Ka),ns.point=ia},"lineEnd"),polygonStart:/* @__PURE__ */Fe(function(){Za=!0},"polygonStart"),polygonEnd:/* @__PURE__ */Fe(function(){Za=null},"polygonEnd"),result:/* @__PURE__ */Fe(function(){var t=+is;return is.reset(),t},"result")};function os(t,e){ns.point=as,Ja=ts=t,Ka=es=e}function as(t,e){ts-=t,es-=e,is.add(ea(ts*ts+es*es)),ts=t,es=e}function ss(){this._string=[]}function rs(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ls(t,e){var i,n,o=4.5;function a(t){return t&&("function"==typeof o&&n.pointRadius(+o.apply(this,arguments)),la(t,i(n))),n.result()}return M(a,"s"),Fe(a,"path"),a.area=function(t){return la(t,i(_a)),_a.result()},a.measure=function(t){return la(t,i(ns)),ns.result()},a.bounds=function(t){return la(t,i(Aa)),Aa.result()},a.centroid=function(t){return la(t,i(Ba)),Ba.result()},a.projection=function(e){return arguments.length?(i=null==e?(t=null,ha):(t=e).stream,a):t},a.context=function(t){return arguments.length?(n=null==t?(e=null,new ss):new Qa(e=t),"function"!=typeof o&&n.pointRadius(o),a):e},a.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(n.pointRadius(+t),+t),a):o},a.projection(t).context(e)}M(os,"So"),M(as,"Ao"),M(ss,"ko"),M(rs,"Mo"),M(ls,"Po"),Fe(os,"lengthPointFirst"),Fe(as,"lengthPoint"),Fe(ss,"PathString"),ss.prototype={_radius:4.5,_circle:rs(4.5),pointRadius:/* @__PURE__ */Fe(function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},"pointRadius"),polygonStart:/* @__PURE__ */Fe(function(){this._line=0},"polygonStart"),polygonEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"polygonEnd"),lineStart:/* @__PURE__ */Fe(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){0===this._line&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=rs(this._radius)),this._string.push("M",t,",",e,this._circle)}},"point"),result:/* @__PURE__ */Fe(function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null},"result")},Fe(rs,"circle"),Fe(ls,"geoPath");const hs=(M(h=class extends on{_dataMinWeight;_dataMaxWeight;constructor(){super(),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerEnter(t,e,i=250){super.layerEnter(t,e,i)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i),this._palette=this._palette.switch(this.paletteID());const n=this.flattenData(this.layerColumns(t),this.layerData(t)),o=Xo().x(e=>this.xPos(t,e)).y(e=>this.yPos(t,e)).size([this.width(),this.height()]).bandwidth(this.contourBandwidth())(n),a=o.map(t=>t.value),s=Math.min.apply(this,a),r=Math.max.apply(this,a);this._dataMinWeight=s,this._dataMaxWeight=r;const l=e.selectAll("path").data(o);l.enter().append("path").merge(l).attr("d",ls()).attr("fill",t=>this.showContourFill()?this._palette(t.value,s,r):"none").attr("stroke",this.contourStrokeColor()).attr("stroke-linejoin","round").attr("stroke-width",this.contourStrokeWidth()),l.exit().remove()}exit(t,e){super.exit(t,e)}},"_Contour"),h);Fe(hs,"Contour"),De(hs,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let cs=hs;cs.prototype._class+=" chart_Contour",cs.prototype.implements(ge.prototype),cs.prototype.publish("paletteID","YlGnBu","string","Color palette for this widget"),cs.prototype.publish("useClonedPalette",!0,"boolean","Enable or disable using a cloned palette"),cs.prototype.publish("showContourFill",!0,"boolean","Show/hide the contour background colors"),cs.prototype.publish("showContour",!0,"boolean","Show/hide the contour border lines"),cs.prototype.publish("contourBandwidth",40,"number","Controls the sensitivity of the contour grouping algorithm"),cs.prototype.publish("contourStrokeColor","#2C3A47","html-color","Color of the contour border lines"),cs.prototype.publish("contourStrokeWidth",1,"number","Width of the contour border lines");const us=(M(c=class extends un{constructor(){super(),this.orientation_default("vertical").xAxisType_default("ordinal").yAxisType_default("time")}},"_Gantt"),c);Fe(us,"Gantt");let ps=us;function ds(t){return Fe(function(){return t},"constant")}M(ds,"Io"),ps.prototype._class+=" chart_Gantt",Fe(ds,"constant");var fs=1e-12,ys=Math.PI,_s=ys/2,xs=2*ys;function ms(t){return t.innerRadius}function gs(t){return t.outerRadius}function bs(t){return t.startAngle}function vs(t){return t.endAngle}function ws(t){return t&&t.padAngle}function Ss(t){return t>=1?_s:t<=-1?-_s:Math.asin(t)}function ks(t,e,i,n,o,a,s,r){var l=i-t,h=n-e,c=s-o,u=r-a,p=(c*(e-a)-u*(t-o))/(u*l-c*h);return[t+p*l,e+p*h]}function As(t,e,i,n,o,a,s){var r=t-i,l=e-n,h=(s?a:-a)/Math.sqrt(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-a,w=p*y-f*d,S=(g<0?-1:1)*Math.sqrt(Math.max(0,v*v*b-w*w)),k=(w*g-m*S)/b,A=(-w*m-g*S)/b,C=(w*g+m*S)/b,M=(-w*m+g*S)/b,P=k-_,T=A-x,I=C-_,E=M-x;return P*P+T*T>I*I+E*E&&(k=C,A=M),{cx:k,cy:A,x01:-c,y01:-u,x11:k*(o/v-1),y11:A*(o/v-1)}}function Cs(){var t=ms,e=gs,i=ds(0),n=null,o=bs,a=vs,s=ws,r=null;function l(){var l,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),p=o.apply(this,arguments)-_s,d=a.apply(this,arguments)-_s,f=Math.abs(d-p),y=d>p;if(r||(r=l=Le()),u<c&&(h=u,u=c,c=h),u>fs)if(f>xs-fs)r.moveTo(u*Math.cos(p),u*Math.sin(p)),r.arc(0,0,u,p,d,!y),c>fs&&(r.moveTo(c*Math.cos(d),c*Math.sin(d)),r.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,k=s.apply(this,arguments)/2,A=k>fs&&(n?+n.apply(this,arguments):Math.sqrt(c*c+u*u)),C=Math.min(Math.abs(u-c)/2,+i.apply(this,arguments)),M=C,P=C;if(A>fs){var T=Ss(A/c*Math.sin(k)),I=Ss(A/u*Math.sin(k));(w-=2*T)>fs?(b+=T*=y?1:-1,v-=T):(w=0,b=v=(p+d)/2),(S-=2*I)>fs?(m+=I*=y?1:-1,g-=I):(S=0,m=g=(p+d)/2)}var E=u*Math.cos(m),F=u*Math.sin(m),D=c*Math.cos(v),R=c*Math.sin(v);if(C>fs){var z=u*Math.cos(g),O=u*Math.sin(g),j=c*Math.cos(b),N=c*Math.sin(b);if(f<ys){var L=w>fs?ks(E,F,j,N,z,O,D,R):[D,R],B=E-L[0],V=F-L[1],H=z-L[0],$=O-L[1],W=1/Math.sin(Math.acos((B*H+V*$)/(Math.sqrt(B*B+V*V)*Math.sqrt(H*H+$*$)))/2),q=Math.sqrt(L[0]*L[0]+L[1]*L[1]);M=Math.min(C,(c-q)/(W-1)),P=Math.min(C,(u-q)/(W+1))}}S>fs?P>fs?(_=As(j,N,E,F,u,P,y),x=As(z,O,D,R,u,P,y),r.moveTo(_.cx+_.x01,_.cy+_.y01),P<C?r.arc(_.cx,_.cy,P,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,P,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),r.arc(0,0,u,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),!y),r.arc(x.cx,x.cy,P,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):(r.moveTo(E,F),r.arc(0,0,u,m,g,!y)):r.moveTo(E,F),c>fs&&w>fs?M>fs?(_=As(D,R,z,O,c,-M,y),x=As(E,F,j,N,c,-M,y),r.lineTo(_.cx+_.x01,_.cy+_.y01),M<C?r.arc(_.cx,_.cy,M,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,M,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),r.arc(0,0,c,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),y),r.arc(x.cx,x.cy,M,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):r.arc(0,0,c,v,b,y):r.lineTo(D,R)}else r.moveTo(0,0);if(r.closePath(),l)return r=null,l+""||null}return M(l,"h"),Fe(l,"arc"),l.centroid=function(){var i=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-ys/2;return[Math.cos(n)*i,Math.sin(n)*i]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ds(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ds(+t),l):e},l.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:ds(+t),l):i},l.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:ds(+t),l):n},l.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:ds(+t),l):o},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:ds(+t),l):a},l.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:ds(+t),l):s},l.context=function(t){return arguments.length?(r=null==t?null:t,l):r},l}function Ms(t){this._context=t}function Ps(t){return new Ms(t)}function Ts(t){return t[0]}function Is(t){return t[1]}function Es(){var t=Ts,e=Is,i=ds(!0),n=null,o=Ps,a=null;function s(s){var r,l,h,c=s.length,u=!1;for(null==n&&(a=o(h=Le())),r=0;r<=c;++r)!(r<c&&i(l=s[r],r,s))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+t(l,r,s),+e(l,r,s));if(h)return a=null,h+""||null}return M(s,"r"),Fe(s,"line"),s.x=function(e){return arguments.length?(t="function"==typeof e?e:ds(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:ds(+t),s):e},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:ds(!!t),s):i},s.curve=function(t){return arguments.length?(o=t,null!=n&&(a=o(n)),s):o},s.context=function(t){return arguments.length?(null==t?n=a=null:a=o(n=t),s):n},s}function Fs(){}function Ds(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function Rs(t){this._context=t}function zs(t,e){this._basis=new Rs(t),this._beta=e}function Os(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function js(t,e){this._context=t,this._k=(1-e)/6}function Ns(t,e){this._context=t,this._k=(1-e)/6}function Ls(t,e){this._context=t,this._k=(1-e)/6}function Bs(t,e,i){var n=t._x1,o=t._y1,a=t._x2,s=t._y2;if(t._l01_a>fs){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>fs){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*h+t._x1*t._l23_2a-e*t._l12_2a)/c,s=(s*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,a,s,t._x2,t._y2)}function Vs(t,e){this._context=t,this._alpha=e}M(ms,"jo"),M(gs,"No"),M(bs,"Lo"),M(vs,"Bo"),M(ws,"$o"),M(Ss,"Ho"),M(ks,"Vo"),M(As,"qo"),M(Cs,"Wo"),M(Ms,"Go"),M(Ps,"Xo"),M(Ts,"Yo"),M(Is,"Uo"),M(Es,"Qo"),M(Fs,"Zo"),M(Ds,"Jo"),M(Rs,"Ko"),M(zs,"ta"),M(Os,"ea"),M(js,"ia"),M(Ns,"na"),M(Ls,"oa"),M(Bs,"aa"),M(Vs,"sa"),Fe(ms,"arcInnerRadius"),Fe(gs,"arcOuterRadius"),Fe(bs,"arcStartAngle"),Fe(vs,"arcEndAngle"),Fe(ws,"arcPadAngle"),Fe(Ss,"asin"),Fe(ks,"intersect"),Fe(As,"cornerTangents"),Fe(Cs,"arc"),Fe(Ms,"Linear"),Ms.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},Fe(Ps,"curveLinear"),Fe(Ts,"x"),Fe(Is,"y"),Fe(Es,"line"),Fe(Fs,"noop"),Fe(Ds,"point$3"),Fe(Rs,"Basis"),Rs.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 3:Ds(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ds(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},Fe(zs,"Bundle"),zs.prototype={lineStart:/* @__PURE__ */Fe(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],a=e[0],s=t[i]-o,r=e[i]-a,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*s),this._beta*e[l]+(1-this._beta)*(a+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},Fe(Os,"point$2"),Fe(js,"Cardinal"),js.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Os(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Os(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},Fe(Ns,"CardinalClosed"),Ns.prototype={areaStart:Fs,areaEnd:Fs,lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Os(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},Fe(Ls,"CardinalOpen"),Ls.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Os(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},Fe(Bs,"point$1"),Fe(Vs,"CatmullRom"),Vs.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Bs(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const Hs=/* @__PURE__ */Fe(/* @__PURE__ */M(function t(e){function i(t){return e?new Vs(t,e):new js(t,0)}return M(i,"n"),Fe(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"t"),"custom")(.5);function $s(t,e){this._context=t,this._alpha=e}function Ws(t,e){this._context=t,this._alpha=e}function qs(t){return t<0?-1:1}function Gs(t,e,i){var n=t._x1-t._x0,o=e-t._x1,a=(t._y1-t._y0)/(n||o<0&&-0),s=(i-t._y1)/(o||n<0&&-0),r=(a*o+s*n)/(n+o);return(qs(a)+qs(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(r))||0}function Us(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Xs(t,e,i){var n=t._x0,o=t._y0,a=t._x1,s=t._y1,r=(a-n)/3;t._context.bezierCurveTo(n+r,o+r*e,a-r,s-r*i,a,s)}function Ys(t){this._context=t}M($s,"la"),M(Ws,"ha"),M(qs,"ca"),M(Gs,"ua"),M(Us,"pa"),M(Xs,"da"),M(Ys,"fa"),Fe($s,"CatmullRomClosed"),$s.prototype={areaStart:Fs,areaEnd:Fs,lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Bs(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},Fe(Ws,"CatmullRomOpen"),Ws.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Bs(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},Fe(qs,"sign"),Fe(Gs,"slope3"),Fe(Us,"slope2"),Fe(Xs,"point"),Fe(Ys,"MonotoneX"),Ys.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Xs(this,this._t0,Us(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Xs(this,Us(this,i=Gs(this,t,e)),i);break;default:Xs(this,this._t0,i=Gs(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(Ys.prototype).point=function(t,e){Ys.prototype.point.call(this,e,t)};var Qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zs=/* @__PURE__ */Fe(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},"classCallCheck"),Js=/* @__PURE__ */function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return M(t,"t"),Fe(t,"defineProperties"),function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Ks=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},tr=/* @__PURE__ */Fe(/* @__PURE__ */M(function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var s=o.get;return void 0!==s?s.call(n):void 0},"t"),"get"),er=/* @__PURE__ */Fe(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},"inherits"),ir=/* @__PURE__ */Fe(function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},"possibleConstructorReturn"),nr=/* @__PURE__ */Fe(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)},"toConsumableArray"),or=function(){function t(e){var i=e.x,n=void 0===i?0:i,o=e.y,a=void 0===o?0:o,s=e.nx,r=e.ny,l=e.dy,h=void 0===l?0:l,c=e.dx,u=void 0===c?0:c,p=e.color,d=void 0===p?"grey":p,f=e.data,y=e.type,_=e.subject,x=e.connector,m=e.note,g=e.disable,b=e.id,v=e.className;Zs(this,t),this._dx=void 0!==s?s-n:u,this._dy=void 0!==r?r-a:h,this._x=n,this._y=a,this._color=d,this.id=b,this._className=v||"",this._type=y||"",this.data=f,this.note=m||{},this.connector=x||{},this.subject=_||{},this.disable=g||[]}return M(t,"t"),Fe(t,"Annotation"),Js(t,[{key:"updatePosition",value:/* @__PURE__ */Fe(function(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&0!==this.type.subject.selectAll(":not(.handle)").nodes().length&&this.type.redrawSubject())},"updatePosition")},{key:"clearComponents",value:/* @__PURE__ */Fe(function(){this.type.clearComponents&&this.type.clearComponents()},"clearComponents")},{key:"updateOffset",value:/* @__PURE__ */Fe(function(){this.type.setOffset&&(this.type.setOffset(),0!==this.type.connector.selectAll(":not(.handle)").nodes().length&&this.type.redrawConnector(),this.type.redrawNote())},"updateOffset")},{key:"className",get:/* @__PURE__ */Fe(function(){return this._className},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._className=t,this.type.setClassName&&this.type.setClassName()},"set$$1")},{key:"type",get:/* @__PURE__ */Fe(function(){return this._type},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._type=t,this.clearComponents()},"set$$1")},{key:"x",get:/* @__PURE__ */Fe(function(){return this._x},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._x=t,this.updatePosition()},"set$$1")},{key:"y",get:/* @__PURE__ */Fe(function(){return this._y},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._y=t,this.updatePosition()},"set$$1")},{key:"color",get:/* @__PURE__ */Fe(function(){return this._color},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._color=t,this.updatePosition()},"set$$1")},{key:"dx",get:/* @__PURE__ */Fe(function(){return this._dx},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._dx=t,this.updateOffset()},"set$$1")},{key:"dy",get:/* @__PURE__ */Fe(function(){return this._dy},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._dy=t,this.updateOffset()},"set$$1")},{key:"nx",set:/* @__PURE__ */Fe(function(t){this._dx=t-this._x,this.updateOffset()},"set$$1")},{key:"ny",set:/* @__PURE__ */Fe(function(t){this._dy=t-this._y,this.updateOffset()},"set$$1")},{key:"offset",get:/* @__PURE__ */Fe(function(){return{x:this._dx,y:this._dy}},"get$$1"),set:/* @__PURE__ */Fe(function(t){var e=t.x,i=t.y;this._dx=e,this._dy=i,this.updateOffset()},"set$$1")},{key:"position",get:/* @__PURE__ */Fe(function(){return{x:this._x,y:this._y}},"get$$1"),set:/* @__PURE__ */Fe(function(t){var e=t.x,i=t.y;this._x=e,this._y=i,this.updatePosition()},"set$$1")},{key:"translation",get:/* @__PURE__ */Fe(function(){return{x:this._x+this._dx,y:this._y+this._dy}},"get$$1")},{key:"json",get:/* @__PURE__ */Fe(function(){var t={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t},"get$$1")}]),t}(),ar=function(){function t(e){var i=e.annotations,n=e.accessors,o=e.accessorsInverse;Zs(this,t),this.accessors=n,this.accessorsInverse=o,this.annotations=i}return M(t,"t"),Fe(t,"AnnotationCollection"),Js(t,[{key:"clearTypes",value:/* @__PURE__ */Fe(function(t){this.annotations.forEach(function(e){e.type=void 0,e.subject=t&&t.subject||e.subject,e.connector=t&&t.connector||e.connector,e.note=t&&t.note||e.note})},"clearTypes")},{key:"setPositionWithAccessors",value:/* @__PURE__ */Fe(function(){var t=this;this.annotations.forEach(function(e){e.type.setPositionWithAccessors(t.accessors)})},"setPositionWithAccessors")},{key:"editMode",value:/* @__PURE__ */Fe(function(t){this.annotations.forEach(function(e){e.type&&(e.type.editMode=t,e.type.updateEditMode())})},"editMode")},{key:"updateDisable",value:/* @__PURE__ */Fe(function(t){this.annotations.forEach(function(e){e.disable=t,e.type&&t.forEach(function(t){e.type[t]&&(e.type[t].remove&&e.type[t].remove(),e.type[t]=void 0)})})},"updateDisable")},{key:"updateTextWrap",value:/* @__PURE__ */Fe(function(t){this.annotations.forEach(function(e){e.type&&e.type.updateTextWrap&&e.type.updateTextWrap(t)})},"updateTextWrap")},{key:"updateText",value:/* @__PURE__ */Fe(function(){this.annotations.forEach(function(t){t.type&&t.type.drawText&&t.type.drawText()})},"updateText")},{key:"updateNotePadding",value:/* @__PURE__ */Fe(function(t){this.annotations.forEach(function(e){e.type&&(e.type.notePadding=t)})},"updateNotePadding")},{key:"json",get:/* @__PURE__ */Fe(function(){var t=this;return this.annotations.map(function(e){var i=e.json;return t.accessorsInverse&&e.data&&(i.data={},Object.keys(t.accessorsInverse).forEach(function(n){i.data[n]=t.accessorsInverse[n]({x:e.x,y:e.y})})),i})},"get$$1")},{key:"noteNodes",get:/* @__PURE__ */Fe(function(){return this.annotations.map(function(t){return Ks({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})})},"get$$1")}]),t}(),sr=/* @__PURE__ */Fe(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy;return{move:{x:i,y:void 0===n?0:n}}},"pointHandle"),rr=/* @__PURE__ */Fe(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy,o=void 0===n?0:n,a=t.r1,s=t.r2,r=t.padding,l={move:{x:i,y:o}};return void 0!==a&&(l.r1={x:i+a/Math.sqrt(2),y:o+a/Math.sqrt(2)}),void 0!==s&&(l.r2={x:i+s/Math.sqrt(2),y:o+s/Math.sqrt(2)}),void 0!==r&&(l.padding={x:i+a+r,y:o}),l},"circleHandles"),lr=/* @__PURE__ */Fe(function(t){var e=t.group,i=t.handles,n=t.r,o=void 0===n?10:n,a=e.selectAll("circle.handle").data(i);a.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(vt().container($("g.annotations").node()).on("start",function(t){return t.start&&t.start(t)}).on("drag",function(t){return t.drag&&t.drag(t)}).on("end",function(t){return t.end&&t.end(t)})),e.selectAll("circle.handle").attr("cx",function(t){return t.x}).attr("cy",function(t){return t.y}).attr("r",function(t){return t.r||o}).attr("class",function(t){return"handle "+(t.className||"")}),a.exit().remove()},"addHandles"),hr=/* @__PURE__ */Fe(function(t,e){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},"leftRightDynamic"),cr=/* @__PURE__ */Fe(function(t,e){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},"topBottomDynamic"),ur=["topBottom","top","bottom"],pr=["leftRight","left","right"],dr=/* @__PURE__ */Fe(function(t){var e=t.padding,i=void 0===e?0:e,n=t.bbox,o=void 0===n?{x:0,width:0,height:0}:n,a=t.align,s=t.orientation,r=t.offset,l=void 0===r?{x:0,y:0}:r,h=-o.x,c=0;return-1!==ur.indexOf(s)?(a=cr(a,l.x),l.y<0&&"topBottom"===s||"top"===s?c-=o.height+i:c+=i,"middle"===a?h-=o.width/2:"right"===a&&(h-=o.width)):-1!==pr.indexOf(s)&&(a=hr(a,l.y),l.x<0&&"leftRight"===s||"left"===s?h-=o.width+i:h+=i,"middle"===a?c-=o.height/2:"top"===a&&(c-=o.height)),{x:h,y:c}},"noteAlignment"),fr=/* @__PURE__ */Fe(function(t){var e=t.data,i=t.curve,n=void 0===i?Ps:i,o=t.canvasContext,a=t.className,s=t.classID,r=Es().curve(n),l={type:"path",className:a,classID:s,data:e};return o?(r.context(o),l.pathMethods=r):l.attrs={d:r(e)},l},"lineBuilder"),yr=/* @__PURE__ */Fe(function(t){var e=t.data,i=t.canvasContext,n={type:"path",className:t.className,classID:t.classID,data:e},o=Cs().innerRadius(e.innerRadius||0).outerRadius(e.outerRadius||e.radius||2).startAngle(e.startAngle||0).endAngle(e.endAngle||2*Math.PI);return i?(o.context(i),n.pathMethods=lineGen):n.attrs={d:o()},n},"arcBuilder"),_r=/* @__PURE__ */Fe(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,a=void 0===o?0:o,s=t.bbox,r=t.offset;"top"===(e=hr(e,r.y))?a-=s.height:"middle"===e&&(a-=s.height/2);var l=[[n,a],[n,a+s.height]];return{components:[fr({data:l,className:"note-line"})]}},"noteVertical"),xr=/* @__PURE__ */Fe(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,a=void 0===o?0:o,s=t.offset,r=t.bbox;"right"===(e=cr(e,s.x))?n-=r.width:"middle"===e&&(n-=r.width/2);var l=[[n,a],[n+r.width,a]];return{components:[fr({data:l,className:"note-line"})]}},"noteHorizontal"),mr=/* @__PURE__ */Fe(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,a=n.x-o.x,s=a+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("circle"===i&&(h.outerRadius||h.radius)){var c=Math.sqrt((a-s)*(a-s)+(r-l)*(r-l)),u=Math.asin(-l/c),p=h.outerRadius||h.radius+(h.radiusPadding||0);a=Math.abs(Math.cos(u)*p)*(s<0?-1:1),r=Math.abs(Math.sin(u)*p)*(l<0?-1:1)}if("rect"===i){var d=h.width,f=h.height;(d>0&&n.dx>0||d<0&&n.dx<0)&&(a=Math.abs(d)>Math.abs(n.dx)?d/2:d),(f>0&&n.dy>0||f<0&&n.dy<0)&&(r=Math.abs(f)>Math.abs(n.dy)?f/2:f),a===d/2&&r===f/2&&(a=s,r=l)}return[[a,r],[s,l]]},"lineSetup"),gr=/* @__PURE__ */Fe(function(t){var e=mr(t);return{components:[fr({data:e,className:"connector"})]}},"connectorLine"),br=/* @__PURE__ */Fe(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,a=n.x-o.x,s=a+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("rect"===i){var c=h.width,u=h.height;(c>0&&n.dx>0||c<0&&n.dx<0)&&(a=Math.abs(c)>Math.abs(n.dx)?c/2:c),(u>0&&n.dy>0||u<0&&n.dy<0)&&(r=Math.abs(u)>Math.abs(n.dy)?u/2:u),a===c/2&&r===u/2&&(a=s,r=l)}var p=[[a,r],[s,l]],d=l-r,f=s-a,y=s,_=l,x=l<r&&s>a||s<a&&l>r?-1:1;if(Math.abs(f)<Math.abs(d)?(y=s,_=r+f*x):(_=l,y=a+d*x),"circle"===i&&(h.outerRadius||h.radius)){var m=(h.outerRadius||h.radius)+(h.radiusPadding||0),g=m/Math.sqrt(2);if(Math.abs(f)>g&&Math.abs(d)>g)p=[[a=g*(s<0?-1:1),r=g*(l<0?-1:1)],[y,_],[s,l]];else if(Math.abs(f)>Math.abs(d)){var b=Math.asin(-l/m);p=[[a=Math.abs(Math.cos(b)*m)*(s<0?-1:1),l],[s,l]]}else{var v=Math.acos(s/m);p=[[s,r=Math.abs(Math.sin(v)*m)*(l<0?-1:1)],[s,l]]}}else p=[[a,r],[y,_],[s,l]];return{components:[fr({data:p,className:"connector"})]}},"connectorElbow"),vr=/* @__PURE__ */Fe(function(t){var e=t.type,i=t.connectorData,n=t.subjectType;i||(i={}),i.points&&"number"!=typeof i.points||(i.points=wr(e.annotation.offset,i.points)),i.curve||(i.curve=Hs);var o=[];if(e.editMode){var a=i.points.map(function(t,e){return Ks({},sr({cx:t[0],cy:t[1]}),{index:e})}),s=/* @__PURE__ */Fe(function(t){i.points[t][0]+=wt.dx,i.points[t][1]+=wt.dy,e.redrawConnector()},"updatePoint");o=e.mapHandles(a.map(function(t){return Ks({},t.move,{drag:s.bind(e,t.index)})}))}var r=mr({type:e,subjectType:n});return r=[r[0]].concat(nr(i.points),[r[1]]),{components:[fr({data:r,curve:i.curve,className:"connector"})],handles:o}},"connectorCurve"),wr=/* @__PURE__ */Fe(function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=t.x/(e+1),n=t.y/(e+1),o=[],a=1;a<=e;a++)o.push([i*a+a%2*20,n*a-a%2*20]);return o},"createPoints"),Sr=/* @__PURE__ */Fe(function(t){var e=t.annotation,i=t.start,n=t.end,o=t.scale,a=void 0===o?1:o,s=e.position;i=i?[-n[0]+i[0],-n[1]+i[1]]:[e.dx,e.dy],n||(n=[e.x-s.x,e.y-s.y]);var r=n[0],l=n[1],h=i[0],c=i[1],u=10*a,p=16/180*Math.PI,d=Math.atan(c/h);h<0&&(d+=Math.PI);var f=[[r,l],[Math.cos(d+p)*u+r,Math.sin(d+p)*u+l],[Math.cos(d-p)*u+r,Math.sin(d-p)*u+l],[r,l]];return{components:[fr({data:f,className:"connector-end connector-arrow",classID:"connector-end"})]}},"connectorArrow"),kr=/* @__PURE__ */Fe(function(t){var e=t.line,i=t.scale,n=void 0===i?1:i,o=yr({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(n)}});return o.attrs.transform="translate("+e.data[0][0]+", "+e.data[0][1]+")",{components:[o]}},"connectorDot"),Ar=/* @__PURE__ */Fe(function(t){var e=t.subjectData,i=t.type;e.radius||e.outerRadius||(e.radius=20);var n=[],o=yr({data:e,className:"subject"});if(i.editMode){var a=rr({r1:o.data.outerRadius||o.data.radius,r2:o.data.innerRadius,padding:e.radiusPadding}),s=/* @__PURE__ */Fe(function(t){var n=e[t]+wt.dx*Math.sqrt(2);e[t]=n,i.redrawSubject(),i.redrawConnector()},"updateRadius"),r=[Ks({},a.r1,{drag:s.bind(i,void 0!==e.outerRadius?"outerRadius":"radius")})];e.innerRadius&&r.push(Ks({},a.r2,{drag:s.bind(i,"innerRadius")})),n=i.mapHandles(r)}return o.attrs["fill-opacity"]=0,{components:[o],handles:n}},"subjectCircle"),Cr=/* @__PURE__ */Fe(function(t){var e=t.subjectData,i=t.type;e.width||(e.width=100),e.height||(e.height=100);var n=[],o=e.width,a=e.height,s=fr({data:[[0,0],[o,0],[o,a],[0,a],[0,0]],className:"subject"});if(i.editMode){var r=/* @__PURE__ */Fe(function(){e.width=wt.x,i.redrawSubject(),i.redrawConnector()},"updateWidth"),l=/* @__PURE__ */Fe(function(){e.height=wt.y,i.redrawSubject(),i.redrawConnector()},"updateHeight"),h=[{x:o,y:a/2,drag:r.bind(i)},{x:o/2,y:a,drag:l.bind(i)}];n=i.mapHandles(h)}return s.attrs["fill-opacity"]=.1,{components:[s],handles:n}},"subjectRect"),Mr=/* @__PURE__ */Fe(function(t){var e=t.subjectData,i=t.type.annotation.position,n=(void 0!==e.x1?e.x1:i.x)-i.x,o=(void 0!==e.x2?e.x2:i.x)-i.x,a=(void 0!==e.y1?e.y1:i.y)-i.y,s=(void 0!==e.y2?e.y2:i.y)-i.y;return{components:[fr({data:[[n,a],[o,s]],className:"subject"})]}},"subjectThreshold"),Pr=/* @__PURE__ */Fe(function(t){var e=t.subjectData,i=void 0===e?{}:e,n=t.type,o=void 0===n?{}:n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=o.typeSettings&&o.typeSettings.subject;i.radius||(s&&s.radius?i.radius=s.radius:i.radius=14),i.x||s&&s.x&&(i.x=s.x),i.y||s&&s.y&&(i.y=s.y);var r=[],l=[],h=i.radius,c=.7*h,u=0,p=0,d=Math.sqrt(2)*h,f={xleftcorner:-h,xrightcorner:h,ytopcorner:-h,ybottomcorner:h,xleft:-d,xright:d,ytop:-d,ybottom:d};i.x&&!i.y?u=f["x"+i.x]:i.y&&!i.x?p=f["y"+i.y]:i.x&&i.y&&(u=f["x"+i.x+"corner"],p=f["y"+i.y+"corner"]);var y="translate("+u+", "+p+")",_=yr({className:"subject",data:{radius:h}});_.attrs.transform=y,_.attrs.fill=a.color,_.attrs["stroke-linecap"]="round",_.attrs["stroke-width"]="3px";var x=yr({className:"subject-ring",data:{outerRadius:h,innerRadius:c}});x.attrs.transform=y,x.attrs["stroke-width"]="3px",x.attrs.fill="white";var m=void 0;if(u&&p||!u&&!p)m=fr({className:"subject-pointer",data:[[0,0],[u||0,0],[0,p||0],[0,0]]});else if(u||p){var g=/* @__PURE__ */Fe(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*h/Math.sqrt(2)},"notCornerPointerXY");m=fr({className:"subject-pointer",data:[[0,0],[g(u),g(p)],[g(u,-1),g(p,-1)],[0,0]]})}if(m&&(m.attrs.fill=a.color,m.attrs["stroke-linecap"]="round",m.attrs["stroke-width"]="3px",l.push(m)),o.editMode){var b={x:2*u,y:2*p,drag:/* @__PURE__ */Fe(function(){i.x=wt.x<2*-h?"left":wt.x>2*h?"right":void 0,i.y=wt.y<2*-h?"top":wt.y>2*h?"bottom":void 0,o.redrawSubject()},"dragBadge").bind(o)};b.x||b.y||(b.y=-h),r=o.mapHandles([b])}var v=void 0;return i.text&&(v={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:i.text,"text-anchor":"middle",dy:".25em",x:u,y:p}}),l.push(_),l.push(x),l.push(v),{components:l,handles:r}},"subjectBadge"),Tr=function(){function t(e){var i=e.a,n=e.annotation,o=e.editMode,a=e.dispatcher,s=e.notePadding,r=e.accessors;if(Zs(this,t),this.a=i,this.note=-1===n.disable.indexOf("note")&&i.select("g.annotation-note"),this.noteContent=this.note&&i.select("g.annotation-note-content"),this.connector=-1===n.disable.indexOf("connector")&&i.select("g.annotation-connector"),this.subject=-1===n.disable.indexOf("subject")&&i.select("g.annotation-subject"),this.dispatcher=a,a){var l=zr.bind(null,a,n);l({component:this.note,name:"note"}),l({component:this.connector,name:"connector"}),l({component:this.subject,name:"subject"})}this.annotation=n,this.editMode=n.editMode||o,this.notePadding=void 0!==s?s:3,this.offsetCornerX=0,this.offsetCornerY=0,r&&n.data&&this.init(r)}return M(t,"t"),Fe(t,"Type"),Js(t,[{key:"init",value:/* @__PURE__ */Fe(function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)},"init")},{key:"mapY",value:/* @__PURE__ */Fe(function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))},"mapY")},{key:"mapX",value:/* @__PURE__ */Fe(function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))},"mapX")},{key:"updateEditMode",value:/* @__PURE__ */Fe(function(){this.a.selectAll("circle.handle").remove()},"updateEditMode")},{key:"drawOnSVG",value:/* @__PURE__ */Fe(function(t,e){var i=this;Array.isArray(e)||(e=[e]),e.filter(function(t){return t}).forEach(function(e){var n=e.type,o=e.className,a=e.attrs,s=e.handles,r=e.classID;if("handle"===n)lr({group:t,r:a&&a.r,handles:s});else{Rr(t,[i.annotation],n,o,r);for(var l=t.select(n+"."+(r||o)),h=Object.keys(a),c=[],u=l.node().attributes,p=u.length-1;p>=0;p--){var d=u[p].name;-1===h.indexOf(d)&&"class"!==d&&c.push(d)}h.forEach(function(t){"text"===t?l.text(a[t]):l.attr(t,a[t])}),c.forEach(function(t){return l.attr(t,null)})}})},"drawOnSVG")},{key:"getNoteBBox",value:/* @__PURE__ */Fe(function(){return jr(this.note,".annotation-note-content text")},"getNoteBBox")},{key:"getNoteBBoxOffset",value:/* @__PURE__ */Fe(function(){var t=jr(this.note,".annotation-note-content"),e=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(e[1])+this.annotation.dx,t.offsetCornerY=parseFloat(e[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t},"getNoteBBoxOffset")},{key:"drawSubject",value:/* @__PURE__ */Fe(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.subject,n=e.type,o={type:this,subjectData:i},a={};"circle"===n?a=Ar(o):"rect"===n?a=Cr(o):"threshold"===n?a=Mr(o):"badge"===n&&(a=Pr(o,this.annotation));var s=a,r=s.components,l=void 0===r?[]:r,h=s.handles,c=void 0===h?[]:h;return l.forEach(function(e){e&&e.attrs&&!e.attrs.stroke&&(e.attrs.stroke=t.annotation.color)}),this.editMode&&(c=c.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),l.push({type:"handle",handles:c})),l},"drawSubject")},{key:"drawConnector",value:/* @__PURE__ */Fe(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.connector,n=i.type||e.type,o={type:this,connectorData:i};o.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var a="curve"===n?vr(o):"elbow"===n?br(o):gr(o),s=a.components,r=void 0===s?[]:s,l=a.handles,h=void 0===l?[]:l,c=r[0];c&&(c.attrs.stroke=this.annotation.color,c.attrs.fill="none");var u=i.end||e.end,p={};if("arrow"===u){var d=c.data[1],f=c.data[0];Math.sqrt(Math.pow(d[0]-f[0],2)+Math.pow(d[1]-f[1],2))<5&&c.data[2]&&(d=c.data[2]),p=Sr({annotation:this.annotation,start:d,end:f,scale:i.endScale})}else"dot"===u?p=kr({line:c,scale:i.endScale}):u&&"none"!==u||this.connector&&this.connector.select(".connector-end").remove();return p.components&&(p.components.forEach(function(e){e.attrs.fill=t.annotation.color,e.attrs.stroke=t.annotation.color}),r=r.concat(p.components)),this.editMode&&0!==h.length&&r.push({type:"handle",handles:h}),r},"drawConnector")},{key:"drawNote",value:/* @__PURE__ */Fe(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.note,n=i.align||e.align||"dynamic",o={bbox:e.bbox,align:n,offset:this.annotation.offset},a=i.lineType||e.lineType,s={};"vertical"===a?s=_r(o):"horizontal"===a&&(s=xr(o));var r=s,l=r.components,h=void 0===l?[]:l,c=r.handles,u=void 0===c?[]:c;if(h.forEach(function(e){e.attrs.stroke=t.annotation.color}),this.editMode){u=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),h.push({type:"handle",handles:u});var p=this.dragNote.bind(this),d=this.dragstarted.bind(this),f=this.dragended.bind(this);this.note.call(vt().container($("g.annotations").node()).on("start",function(t){return d(t)}).on("drag",function(t){return p(t)}).on("end",function(t){return f(t)}))}else this.note.on("mousedown.drag",null);return h},"drawNote")},{key:"drawNoteContent",value:/* @__PURE__ */Fe(function(t){var e=this.annotation.note,i=void 0!==e.padding?e.padding:this.notePadding,n=e.orientation||t.orientation||"topBottom",o=e.lineType||t.lineType,a=e.align||t.align||"dynamic";"vertical"===o?n="leftRight":"horizontal"===o&&(n="topBottom");var s={padding:i,bbox:t.bbox,offset:this.annotation.offset,orientation:n,align:a},r=dr(s),l=r.x,h=r.y;return this.offsetCornerX=l+this.annotation.dx,this.offsetCornerY=h+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+l+", "+h+")"),[]},"drawNoteContent")},{key:"drawOnScreen",value:/* @__PURE__ */Fe(function(t,e){return this.drawOnSVG(t,e)},"drawOnScreen")},{key:"redrawSubject",value:/* @__PURE__ */Fe(function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())},"redrawSubject")},{key:"redrawConnector",value:/* @__PURE__ */Fe(function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())},"redrawConnector")},{key:"redrawNote",value:/* @__PURE__ */Fe(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))},"redrawNote")},{key:"setPosition",value:/* @__PURE__ */Fe(function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")},"setPosition")},{key:"clearComponents",value:/* @__PURE__ */Fe(function(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()},"clearComponents")},{key:"setOffset",value:/* @__PURE__ */Fe(function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}},"setOffset")},{key:"setPositionWithAccessors",value:/* @__PURE__ */Fe(function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()},"setPositionWithAccessors")},{key:"setClassName",value:/* @__PURE__ */Fe(function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))},"setClassName")},{key:"draw",value:/* @__PURE__ */Fe(function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()},"draw")},{key:"dragstarted",value:/* @__PURE__ */Fe(function(){wt.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")},"dragstarted")},{key:"dragended",value:/* @__PURE__ */Fe(function(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")},"dragended")},{key:"dragSubject",value:/* @__PURE__ */Fe(function(){var t=this.annotation.position;t.x+=wt.dx,t.y+=wt.dy,this.annotation.position=t},"dragSubject")},{key:"dragNote",value:/* @__PURE__ */Fe(function(){var t=this.annotation.offset;t.x+=wt.dx,t.y+=wt.dy,this.annotation.offset=t},"dragNote")},{key:"mapHandles",value:/* @__PURE__ */Fe(function(t){var e=this;return t.map(function(t){return Ks({},t,{start:e.dragstarted.bind(e),end:e.dragended.bind(e)})})},"mapHandles")}]),t}(),Ir=/* @__PURE__ */Fe(function(t,e,i){return function(t){function n(t){Zs(this,n);var i=ir(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));return i.typeSettings=e,e.disable&&e.disable.forEach(function(t){i[t]&&i[t].remove(),i[t]=void 0,"note"===t&&(i.noteContent=void 0)}),i}return M(n,"o"),er(n,t),Fe(n,"customType"),Js(n,[{key:"className",value:/* @__PURE__ */Fe(function(){return""+(e.className||tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this)&&tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this).call(this)||"")},"className")},{key:"drawSubject",value:/* @__PURE__ */Fe(function(t){return this.typeSettings.subject=Ks({},e.subject,this.typeSettings.subject),tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawSubject",this).call(this,Ks({},t,this.typeSettings.subject))},"drawSubject")},{key:"drawConnector",value:/* @__PURE__ */Fe(function(t){return this.typeSettings.connector=Ks({},e.connector,this.typeSettings.connector),tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawConnector",this).call(this,Ks({},t,e.connector,this.typeSettings.connector))},"drawConnector")},{key:"drawNote",value:/* @__PURE__ */Fe(function(t){return this.typeSettings.note=Ks({},e.note,this.typeSettings.note),tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNote",this).call(this,Ks({},t,e.note,this.typeSettings.note))},"drawNote")},{key:"drawNoteContent",value:/* @__PURE__ */Fe(function(t){return tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNoteContent",this).call(this,Ks({},t,e.note,this.typeSettings.note))},"drawNoteContent")}],[{key:"init",value:/* @__PURE__ */Fe(function(t,e){return tr(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,t,e),i&&(t=i(t,e)),t},"init")}]),n}(t)},"customType"),Er=function(){function t(e){Zs(this,t);var i=ir(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.textWrap=e.textWrap||120,i.drawText(),i}return M(t,"t"),er(t,Tr),Fe(t,"d3NoteText"),Js(t,[{key:"updateTextWrap",value:/* @__PURE__ */Fe(function(t){this.textWrap=t,this.drawText()},"updateTextWrap")},{key:"drawText",value:/* @__PURE__ */Fe(function(){if(this.note){Rr(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");Rr(t,[this.annotation],"rect","annotation-note-bg"),Rr(t,[this.annotation],"text","annotation-note-label"),Rr(t,[this.annotation],"text","annotation-note-title");var e={height:0},i=this.a.select("text.annotation-note-label"),n=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,o=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,a=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,s={top:0,bottom:0,left:0,right:0};if("number"==typeof a?s={top:a,bottom:a,left:a,right:a}:a&&"object"===(void 0===a?"undefined":Qs(a))&&(s=Ks(s,a)),this.annotation.note.title){var r=this.a.select("text.annotation-note-title");r.text(this.annotation.note.title),r.attr("fill",this.annotation.color),r.attr("font-weight","bold"),r.call(Or,n,o),e=r.node().getBBox()}i.text(this.annotation.note.label).attr("dx","0"),i.call(Or,n,o),i.attr("y",1.1*e.height||0),i.attr("fill",this.annotation.color);var l=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",l.width+s.left+s.right).attr("height",l.height+s.top+s.bottom).attr("x",l.x-s.left).attr("y",-s.top).attr("fill","white").attr("fill-opacity",0)}},"drawText")}]),t}();Ir(Er,{className:"label",note:{align:"middle"}});var Fr=Ir(Er,{className:"callout",note:{lineType:"horizontal"}}),Dr=Ir(Fr,{className:"callout elbow",connector:{type:"elbow"}});Ir(Fr,{className:"callout curve",connector:{type:"curve"}}),Ir(Tr,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),Ir(Er,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),Ir(Er,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),Ir(function(){function t(){return Zs(this,t),ir(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return M(t,"t"),er(t,Fr),Fe(t,"ThresholdMap"),Js(t,[{key:"mapY",value:/* @__PURE__ */Fe(function(e){tr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapY",this).call(this,e);var i=this.annotation;(i.subject.x1||i.subject.x2)&&i.data&&e.y&&(i.y=e.y(i.data)),!i.subject.x1&&!i.subject.x2||i.x||(i.x=i.subject.x1||i.subject.x2)},"mapY")},{key:"mapX",value:/* @__PURE__ */Fe(function(e){tr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapX",this).call(this,e);var i=this.annotation;(i.subject.y1||i.subject.y2)&&i.data&&e.x&&(i.x=e.x(i.data)),!i.subject.y1&&!i.subject.y2||i.y||(i.y=i.subject.y1||i.subject.y2)},"mapX")}]),t}(),{className:"callout xythreshold",subject:{type:"threshold"}});var Rr=/* @__PURE__ */Fe(function(t,e,i,n,o){var a=t.selectAll(i+"."+(o||n)).data(e);return a.enter().append(i).merge(a).attr("class",n),a.exit().remove(),t},"newWithClass"),zr=/* @__PURE__ */Fe(function(t,e,i){var n=i.component,o=i.name;n&&n.on("mouseover.annotations",function(){t.call(o+"over",n,e)}).on("mouseout.annotations",function(){return t.call(o+"out",n,e)}).on("click.annotations",function(){return t.call(o+"click",n,e)})},"addHandlers"),Or=/* @__PURE__ */Fe(function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each(function(){for(var t=$(this),o=t.text().split(i||/[ \t\r\n]+/).reverse().filter(function(t){return""!==t}),a=void 0,s=[],r=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");a=o.pop();)s.push(a),r.text(s.join(" ")),r.node().getComputedTextLength()>e&&s.length>1&&(s.pop(),r.text(s.join(" ")),s=[a],r=t.append("tspan").attr("x",0).attr("dy",n+"em").text(a))})},"wrap"),jr=/* @__PURE__ */Fe(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(e).nodes().reduce(function(t,e){var i=e.getBBox();t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),t.width=Math.max(t.width,i.width);var n=e&&e.attributes&&e.attributes.y;return t.height=Math.max(t.height,(n&&parseFloat(n.value)||0)+i.height),t},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}},"bboxWithoutHandles");function Nr(){var t=[],e=void 0,i=void 0,n=[],o={},a={},s=!1,r=void 0,l=Fr,h=void 0,c=void 0,u=Pt("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),p=void 0,d=/* @__PURE__ */Fe(function(i){p=i,s||i.selectAll("circle.handle").remove();var d=t.map(function(t){return t.type||(t.type=l),t.disable||(t.disable=n),new or(t)});e=e||new ar({annotations:d,accessors:o,accessorsInverse:a,ids:r}),i.selectAll("g").data([e]).enter().append("g").attr("class","annotations");var f=i.select("g.annotations");Rr(f,e.annotations,"g","annotation"),f.selectAll("g.annotation").each(function(t){var e=$(this);e.attr("class","annotation"),Rr(e,[t],"g","annotation-connector"),Rr(e,[t],"g","annotation-subject"),Rr(e,[t],"g","annotation-note"),Rr(e.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:e,annotation:t,textWrap:h,notePadding:c,editMode:s,dispatcher:u,accessors:o}),t.type.draw(),t.type.drawText&&t.type.drawText()})},"annotation");return d.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",e.json),window.copy(JSON.stringify(e.json.map(function(t){return delete t.type,t}))),d},d.update=function(){return t&&e&&(t=e.annotations.map(function(t){return t.type.draw(),t})),d},d.updateText=function(){return e&&(e.updateText(h),t=e.annotations),d},d.updatedAccessors=function(){return e.setPositionWithAccessors(),t=e.annotations,d},d.disable=function(i){return arguments.length?(n=i,e&&(e.updateDisable(n),t=e.annotations),d):n},d.textWrap=function(i){return arguments.length?(h=i,e&&(e.updateTextWrap(h),t=e.annotations),d):h},d.notePadding=function(i){return arguments.length?(c=i,e&&(e.updateNotePadding(c),t=e.annotations),d):c},d.type=function(i,n){return arguments.length?(l=i,e&&(e.annotations.map(function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=l,t.subject=n&&n.subject||t.subject,t.connector=n&&n.connector||t.connector,t.note=n&&n.note||t.note}),t=e.annotations),d):l},d.annotations=function(i){return arguments.length?(t=i,e&&e.annotations&&(t.some(function(t){return!t.type||"[object Object]"!==t.type.toString()})?(e=null,d(p)):e.annotations=t),d):e&&e.annotations||t},d.context=function(t){return arguments.length?(i=t,d):i},d.accessors=function(t){return arguments.length?(o=t,d):o},d.accessorsInverse=function(t){return arguments.length?(a=t,d):a},d.ids=function(t){return arguments.length?(r=t,d):r},d.editMode=function(i){return arguments.length?(s=i,p&&p.selectAll("g.annotation").classed("editable",s),e&&(e.editMode(s),t=e.annotations),d):s},d.collection=function(t){return arguments.length?(e=t,d):e},d.on=function(){var t=u.on.apply(u,arguments);return t===u?d:t},d}function Lr(t){return.65*(t-.5)*2*Math.PI}function Br(t,e){return{x:Math.cos(t-Math.PI/2)*e,y:Math.sin(t-Math.PI/2)*e}}function Vr(t,e,i=!1){const n=Br(t,e),o=180*t/Math.PI+(!0===i?180:0);return`translate(${n.x}, ${n.y}) rotate(${o})`}function Hr(t,e,i=!1){return function(n){const o=kt(n.angle,t);return n.angle=t,function(t){return Vr(o(t),e,i)}}}function $r(t,e,i){return function(n){const o=kt(n.startAngle,t),a=kt(n.endAngle,e);return function(t){return n.startAngle=o(t),n.endAngle=a(t),i(n)}}}M(Nr,"ns"),M(Lr,"os"),M(Br,"as"),M(Vr,"ss"),M(Hr,"rs"),M($r,"ls"),Fe(Nr,"annotation"),Fe(Lr,"value2Angle"),Fe(Br,"pointOnArc"),Fe(Vr,"indicatorTranslate"),Fe(Hr,"indicatorTween"),Fe($r,"arcTween");const Wr=(u=class extends et{_d3Arc=ri().innerRadius(85).outerRadius(100);_colorScale=rt().interpolate(St);_usageArc;_meanArc;_freeArc;_indInner;_indOuter;_centerTextG;_centerText;_bottomText;_tooltipG;_mainTooltip;constructor(){super()}tip(t){if(null===t||""===t.label)this._tooltipG.transition().style("opacity",0).on("interrupt end",()=>{this._tooltipG.selectAll("g").remove()});else{this._tooltipG.interrupt().style("opacity",1),t.w=this._centerText.datum().w+10;let e="horizontal",i=0,n=5,o=5;t.y>=5&&t.y<=25?(i=t.x<0?-t.w/2:t.w/2,n=12.5,o=void 0,e="vertical"):t.y>25&&(n=25,o=0);const a=Nr().type(Dr).annotations([{data:t,dx:-t.x+i,dy:-t.y+n,color:"black",note:{label:t.label,lineType:e,padding:o,align:"middle"}}]).accessors({x:/* @__PURE__ */Fe(t=>t.x,"x"),y:/* @__PURE__ */Fe(t=>t.y,"y")});this._tooltipG.call(a)}}calcSize(t,e,i){const n=t.node().getBBox(),o=e/n.width,a=i/n.height,s=o<a?o:a;return{width:n.width,height:n.height,scale:s}}updateText(t,e,i,n,o){t.datum({x:e,y:i,w:n,h:o}).attr("transform",null);const a=this.calcSize(t,n,o),s=e+n/2-a.width/2*a.scale,r=i+o/2-a.height/2*a.scale;t.attr("transform",`translate(${s}, ${r}) scale(${a.scale})`)}calcWidth(){return Math.min(this.width(),this.height(),this.maxDiameter())}enter(t,e){super.enter(t,e),e.on("click",t=>{this.click(t)}),this._usageArc=e.append("path").datum({startAngle:Lr(0),endAngle:Lr(0)}).style("fill","green").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._freeArc=e.append("path").datum({startAngle:Lr(0),endAngle:Lr(1)}).style("fill","lightGrey"),this._meanArc=e.append("path").datum({startAngle:Lr(0),endAngle:Lr(0)}).style("fill","black").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.tickValueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._mainTooltip=e.append("title");const i=this;function n(){return e.append("path").datum({angle:Lr(0)}).style("fill","black").style("stroke","black").attr("d","M 0 0 l -3 -3 l 6 0 z").on("mousemove",t=>{const[e,n]=i._d3Arc.centroid(i._meanArc.datum());i.tip({x:e,y:n,label:i.tickValueDescription()})}).on("mouseout",t=>{i.tip(null)})}M(n,"o"),Fe(n,"appendIndicator"),this._indInner=n(),this._indOuter=n(),this._centerText=e.append("text").attr("dy",".66em").style("fill","green").on("mousemove",t=>{this.tip({x:0,y:0,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._bottomText=e.append("text").attr("dy",".66em").on("mousemove",t=>{this.tip({x:0,y:t.y,label:this.titleDescription()})}).on("mouseout",t=>{this.tip(null)}),this._tooltipG=e.append("g").attr("class","annotation-tip")}update(t,e){super.update(t,e),this._colorScale.domain(this.colorDomain()).range(this.colorRange()),e.attr("title",this.tooltip()).style("cursor",this.click!==u.prototype.click?"pointer":null);const i=this.calcWidth()/3,n=this.calcWidth()/2-5;this._d3Arc.innerRadius(i).outerRadius(n);const o=this.value(),a=this.tickValue();this._usageArc.style("fill",this._colorScale(o)).transition().duration(750).attrTween("d",$r(Lr(0),Lr(o),this._d3Arc)),this._freeArc.style("fill",this.emptyColor()).transition().duration(750).attrTween("d",$r(Lr(o),Lr(1),this._d3Arc)),this._meanArc.style("fill",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("d",$r(Lr(a-.001),Lr(a+.001),this._d3Arc)),this._indInner.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",Hr(Lr(a),i,!0)),this._indOuter.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",Hr(Lr(a),n)),this._centerText.style("fill",this._colorScale(o)).text(Z(".0%")(o)),this._bottomText.style("fill",this.click!==u.prototype.click?this.titleClickColor():this.titleColor()).style("text-decoration",this.click!==u.prototype.click?"underline":null).text(this.title());const s=Br(Lr(1),i-8);this.updateText(this._centerText,-s.x,-s.y,2*s.x,2*s.y);const r=Br(Lr(1),n);r.y+=5;const l=this.calcWidth()-20,h=this.calcWidth()/2-r.y-5;this.updateText(this._bottomText,-l/2,r.y,l,h),this._mainTooltip.text(this.tooltip())}click(t){}},M(u,"_Gauge"),u);Fe(Wr,"Gauge");let qr=Wr;qr.prototype._class+=" chart_Gauge",qr.prototype.publish("title","","string","Title"),qr.prototype.publish("titleDescription","","string","Title Description"),qr.prototype.publish("titleColor","black","html-color","Color of the title text"),qr.prototype.publish("titleClickColor","blue","html-color","Color of the title text when clickable"),qr.prototype.publish("maxDiameter",128,"number","Max Diameter"),qr.prototype.publish("value",0,"number","Value"),qr.prototype.publish("valueDescription","","string","Value Description"),qr.prototype.publish("showTick",!1,"boolean","Show Tick"),qr.prototype.publish("tickValue",0,"number","Tick Value"),qr.prototype.publish("tickValueDescription","","string","Tick Value Description"),qr.prototype.publish("tooltip","","string","Tooltip"),qr.prototype.publish("colorRange",["green","green","green","green","green","green","green","green","orange","red","red"],"array","Array of colors for the filled gauge portion. The fill color will be relative to the gauge value."),qr.prototype.publish("colorDomain",[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],"array","This array augments the mapping of the value to the fill colorRange."),qr.prototype.publish("emptyColor","lightgrey","html-color","Color of the empty portion of the gauge"),qr.prototype.publish("tickColor","black","html-color","Color of the tick");const Gr=/* @__PURE__ */Fe((t,e)=>t[1]-e[1]>0?1:-1,"sortAscending"),Ur=/* @__PURE__ */Fe((t,e)=>t[1]-e[1]>0?-1:1,"sortDescending"),Xr=(p=class extends et{_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),be.call(this),Me.call(this),tt.SimpleSelectionMixin.call(this),this.d3Pie=_i(),this.d3Arc=ri(),this.d3LabelArc=ri(),this.tooltipTick_default(!1).tooltipOffset_default(0)}intersection(t,e){return this.intersectCircle(this.calcOuterRadius(),t,e)}calcInnerRadius(){return this.innerRadius_exists()?this.calcOuterRadius()*this.innerRadius()/100:0}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t},!1)),"Verdana",12).width,e=this._size.width-(this.showLabels()?2*t:0)-20,i=this._size.height-36-(this.showLabels()?this._smallValueLabelHeight:0),n=Math.min(e,i)/2-2;return e/2-2<this.minOuterRadius()?this._labelWidthLimit=t-(this.minOuterRadius()-(e/2-2)):this._labelWidthLimit=t,n<this.minOuterRadius()?this.minOuterRadius():n}calcSmallValueLabelHeight(){const t=this.data().reduce((t,e)=>t+e[1],0);let e=0;return this.data().forEach(i=>{i[1]/t<.1&&e++}),this.labelHeight()*e}calcTotalValue(){return this.data().reduce((t,e)=>t+e[1],0)}calcPadAngleRadians(){const t=this.slicePadding();return t>0?Math.min(t,.05):0}getLabelText(t,e){let i,n=t.data[0];if(void 0!==this._labelWidthLimit&&e){const t=this.textSize(n,"Verdana",this.labelHeight()).width;this._labelWidthLimit<t&&(i=n.length*(this._labelWidthLimit/t)-3,n=i<n.length?n.slice(0,i)+"...":n)}if(this.showSeriesValue()&&(n+=` : ${this._seriesValueFormatter(t.data[1])}`),this.showSeriesPercentage()){let e=this._totalValue;const i=this.dataMeta();void 0!==i.sum&&(e=i.sum);const o=t.data[1]/e*100;n+=` : ${this._seriesPercentageFormatter(o)}%`}return n}selection(t){if(!arguments.length)try{return this._selection.selection2()[0]?.data}catch(i){return}const e=JSON.stringify(t);this._selection.selection2(t=>e===JSON.stringify(t.data))}selectByLabel(t){const e=this.data().filter(e=>e[0]===t)[0];e&&this.selection(e)}_slices;_labels;enter(t,e){super.enter(t,e),this._selection.widgetElement(e).skipBringToTop(!0),this._slices=e.append("g"),this._labels=e.append("g");const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t.data[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t.data[0]),value:t.data[n+1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){this.selectionGlow(!this.tabNavigation()),super.update(t,e);const i=this;this.updateD3Pie(),this._palette=this._palette.switch(this.paletteID()),this._seriesValueFormatter=Z(this.seriesValueFormat()),this._seriesPercentageFormatter=Z(this.seriesPercentageFormat()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._smallValueLabelHeight=this.calcSmallValueLabelHeight(),this._totalValue=this.calcTotalValue();const n=this.calcOuterRadius(),o=Math.max(this.calcInnerRadius(),Math.min(n/30,6)),a=n+12;this.d3Arc.innerRadius(o).padRadius(n).outerRadius(n).padAngle(this.calcPadAngleRadians()),this._quadIdxArr=[[],[],[],[]];const s=[...this.data()];switch(this.sortDataByValue()){case"ascending":s.sort(Gr);break;case"descending":s.sort(Ur)}const r=this._slices.selectAll(".arc").data(this.d3Pie(s),t=>t.data[0]);this._labelPositions=[],r.enter().append("g").attr("class",(t,e)=>"arc series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("keydown",function(t,e){const n=dt();!i.tabNavigation()||"Space"!==n.code&&"Enter"!==n.key||(n.preventDefault(),i._selection.click(this))}).each(function(t,e){$(this).append("path").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).on("mouseover",p(0,0)).on("mouseout",p(-5,150))}).merge(r).transition().attr("opacity",1).attr("tabindex",i.tabNavigation()?"0":null).attr("role",i.tabNavigation()?"button":null).attr("aria-label",i.tabNavigation()?t=>`${t.data[0]}: ${t.data[1]}`:null).each(function(t,e){const o=i.getQuadrant(u(t));i._quadIdxArr[o].push(e),t.outerRadius=n-5,$(this).select("path").transition().attr("d",i.d3Arc).style("fill",i.fillColor(t.data,i.columns()[1],t.data[1]))}),r.exit().transition().style("opacity",0).remove(),this.d3LabelArc.innerRadius(a).outerRadius(a);const l=this._labels.selectAll("text").data(this.showLabels()?this.d3Pie(s):[],t=>t.data[0]),h=l.enter().append("text").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).attr("dy",".5em").on("click",function(t){i._slices.selectAll("g").filter(function(e){t.data===e.data&&(i._selection.click(this),i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this)))})}).on("dblclick",function(t){i._slices.selectAll("g").filter(function(e){t.data===e.data&&i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))})}).merge(l).text(t=>this.getLabelText(t,!0)).each(function(t,e){const n=i.d3LabelArc.centroid(t),o=u(t);n[0]=a*(i.isLeftSide(o)?1:-1),i._labelPositions.push({top:n[1],bottom:n[1]+i.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),h.transition().style("font-size",this.labelHeight()+"px").attr("transform",(t,e)=>{const n=i.d3LabelArc.centroid(t);return n[0]=a*(i.isLeftSide(u(t))?1:-1),n[1]=i._labelPositions[e].top,"translate("+n+")"}).style("text-anchor",t=>this.isLeftSide(u(t))?"start":"end")),l.exit().remove();const c=this._labels.selectAll("polyline").data(this.showLabels()?this.d3Pie(s):[],t=>this.getLabelText(t,!0));function u(t){return t.startAngle+(t.endAngle-t.startAngle)/2}function p(t,e){return function(){$(this).transition().delay(e).attrTween("d",function(e){const o=kt(e.outerRadius,n+t);return function(t){return e.outerRadius=o(t),i.d3Arc(e)}})}}M(u,"d"),M(p,"y"),c.enter().append("polyline").merge(c).transition().attr("points",function(t,e){const n=i.d3LabelArc.centroid(t),o=i.d3Arc.centroid(t),s=[...n];return n[0]=a*(i.isLeftSide(u(t))?1:-1),n[1]=i._labelPositions[e].top,[o,s,n]}),c.exit().remove(),this.showLabels()&&this.centerOnLabels(),Fe(u,"midAngle"),Fe(p,"arcTween")}isLeftSide(t){return(t=B(t))>2*Math.PI?t:t<Math.PI&&t>0}getQuadrant(t){let e=0;const i=B(t);return e=i<=1*Math.PI&&i>=.5*Math.PI?3:e,e=i<=.5*Math.PI&&i>=0*Math.PI?2:e,e=i<=0*Math.PI&&i>=-.5*Math.PI?1:e,e}centerOnLabels(){const t=this.pos().y,e=2*t,i=this.calcOuterRadius(),n=Math.min(this._minLabelTop,-i),o=Math.max(this._maxLabelBottom,i),a=e-(o-n),s=Math.abs(this._minLabelTop);let r=0;o>t?(r=t-o+this.labelHeight()/2,r-=a/2):n<0&&s>t&&(r=s-t+this.labelHeight()/2,r+=a/2);const l=this.pos();this.pos({y:l.y+r,x:l.x})}adjustForOverlap(){const t=this.labelHeight();this._quadIdxArr.forEach((e,i)=>{let n;this._quadIdxArr[i].sort((t,e)=>1===i||2===i?this._labelPositions[t].top>this._labelPositions[e].top?-1:1:0===i||3===i?this._labelPositions[t].top>this._labelPositions[e].top?1:-1:void 0),this._quadIdxArr[i].forEach((e,o)=>{if(o>0)if(1===i||2===i){if(n<this._labelPositions[e].bottom){const t=this._labelPositions[e].bottom-n;this._labelPositions[e].top-=t,this._labelPositions[e].bottom-=t}}else if((0===i||3===i)&&n+t>this._labelPositions[e].top){const i=Math.abs(this._labelPositions[e].top)-Math.abs(n+t);this._labelPositions[e].top-=i,this._labelPositions[e].bottom-=i}n=this._labelPositions[e].top})}),this._minLabelTop=0,this._maxLabelBottom=0,this._quadIdxArr.forEach((t,e)=>{this._quadIdxArr[e].forEach((t,e)=>{this._minLabelTop>this._labelPositions[t].top&&(this._minLabelTop=this._labelPositions[t].top),this._maxLabelBottom<this._labelPositions[t].bottom&&(this._maxLabelBottom=this._labelPositions[t].bottom)})})}exit(t,e){super.exit(t,e)}updateD3Pie(){const t=B(V(this.startAngle()));switch(this.sortDataByValue()){case"ascending":this.d3Pie.sort(Gr);break;case"descending":this.d3Pie.sort(Ur);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(this.calcPadAngleRadians()).startAngle(t).endAngle(2*Math.PI+t).value(function(t){return t[1]})}},M(p,"_Pie"),p);Fe(Xr,"Pie"),De(Xr,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let Yr=Xr;Yr.prototype._class+=" chart_Pie",Yr.prototype.implements(be.prototype),Yr.prototype.implements(Me.prototype),Yr.prototype.mixin(tt.SimpleSelectionMixin),Yr.prototype.publish("showLabels",!0,"boolean","If true, wedge labels will display"),Yr.prototype.publish("showSeriesValue",!1,"boolean","Append data series value next to label",null,{disable:/* @__PURE__ */Fe(t=>!t.showLabels(),"disable")}),Yr.prototype.publish("seriesValueFormat",",.0f","string","Number format used for formatting series values",null,{disable:/* @__PURE__ */Fe(t=>!t.showSeriesValue(),"disable")}),Yr.prototype.publish("showSeriesPercentage",!1,"boolean","Append data series percentage next to label",null,{disable:/* @__PURE__ */Fe(t=>!t.showLabels(),"disable")}),Yr.prototype.publish("seriesPercentageFormat",",.0f","string","Number format used for formatting series percentages",null,{disable:/* @__PURE__ */Fe(t=>!t.showSeriesPercentage(),"disable")}),Yr.prototype.publish("paletteID","default","set","Color palette for this widget",Yr.prototype._palette.switch(),{tags:["Basic","Shared"]}),Yr.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Yr.prototype.publish("innerRadius",0,"number","Sets inner pie hole radius as a percentage of the radius of the pie chart",null,{tags:["Basic"],range:{min:0,step:1,max:100}}),Yr.prototype.publish("minOuterRadius",20,"number","Minimum outer radius (pixels)"),Yr.prototype.publish("startAngle",0,"number","Starting angle of the first (and largest) wedge (degrees)"),Yr.prototype.publish("labelHeight",12,"number","Font size of labels (pixels)",null,{disable:/* @__PURE__ */Fe(t=>!t.showLabels(),"disable")}),Yr.prototype.publish("slicePadding",.01,"number","Padding between pie slices (converted to pixels)",null,{tags:["Basic"],range:{min:0,step:.01,max:.2}}),Yr.prototype.publish("sortDataByValue","descending","set","Sort data by value",["none","ascending","descending"]),Yr.prototype.publish("tabNavigation",!1,"boolean","Enable or disable tab navigation");const Qr=(M(d=class extends Yr{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i=this._pos.x,n=this._pos.y;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),n+=this._size.height/4,this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(-Math.PI/2).endAngle(Math.PI/2)}},"_HalfPie"),d);Fe(Qr,"HalfPie"),Qr.prototype._class+=" chart_HalfPie";const Zr=(M(f=class extends on{_domForeignObject;_domCanvas;_heat;constructor(){super(),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}radius(t){return this.radiusX(t),this.radiusY(t),this}layerEnter(t,e,i=250){super.layerEnter(t,e,i),this._domForeignObject=this.svg.insert("foreignObject","#"+this.id()+"_clippath"),this._domCanvas=this._domForeignObject.append("xhtml:body").style("margin","0px").style("padding","0px").style("background-color","transparent").append("canvas"),this._heat=Kr(this._domCanvas.node())}layerUpdate(t,e,i=250){super.layerUpdate(t,e),this._palette=this._palette.switch(this.paletteID());let n=this.width()-this.margin.left-this.margin.right;n<0&&(n=0);let o=this.height()-this.margin.top-this.margin.bottom;o<0&&(o=0),this._domForeignObject.attr("x",this.margin.left).attr("y",this.margin.top).attr("width",n).attr("height",o),this._domCanvas.attr("width",n).attr("height",o);const a="horizontal"===t.orientation()?this.data().map(e=>[t.dataPos(e[0]),t.valuePos(e[1]),e[2]]):this.data().map(e=>[t.valuePos(e[1]),t.dataPos(e[0]),e[2]]),s=this.maxWeight_exists()?this.maxWeight():yt(a,t=>t[2]);if("default"!==this.paletteID()){const t={},e=8,i=this.reversePalette();for(let n=0;n<e;++n)t[n/e]=this._palette((i?e-n:n)/e,0,1);this._heat.gradient(t)}else this._heat.gradient(this._heat.defaultGradient);this._heat.resize();const r=this.radiusAsPercent()?this.radiusX()*n/100:this.radiusX(),l=this.radiusAsPercent()?this.radiusY()*o/100:this.radiusY();this._heat.clear().radius(r,l,this.blur()).max(s).data(a).draw(this.minOpacity())}},"_Heat"),f);Fe(Zr,"Heat");let Jr=Zr;function Kr(t){if(!(this instanceof Kr))return new Kr(t);this._canvas=t="string"==typeof t?document.getElementById(t):t,this._ctx=t.getContext("2d"),this._width=t.width,this._height=t.height,this._max=1,this._data=[]}M(Kr,"gs"),Jr.prototype._class+=" chart_Heat",Jr.prototype._palette=X.rainbow("default"),Jr.prototype.publish("paletteID","default","set","Color palette for this widget",Jr.prototype._palette.switch(),{tags:["Basic"]}),Jr.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Jr.prototype.publish("reversePalette",!1,"boolean","Reverse Palette Colors",null,{disable:/* @__PURE__ */Fe(t=>"default"===t.paletteID(),"disable")}),Jr.prototype.publish("radiusX",25,"number","Point X radius (25 by default)"),Jr.prototype.publish("radiusY",25,"number","Point Y radius (25 by default)"),Jr.prototype.publish("radiusAsPercent",!1,"boolean","Calculate RadiusX + RadiusY as % of size"),Jr.prototype.publish("blur",15,"number","Point blur radius (15 by default)"),Jr.prototype.publish("maxWeight",void 0,"number","Clamp max weight to value (optional), omitting uses max data point",void 0,{optional:!0}),Jr.prototype.publish("minOpacity",.05,"number","Minimum point opacity (0.05 by default)"),Fe(Kr,"simpleheat"),Kr.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:/* @__PURE__ */Fe(function(t){return this._data=t,this},"data"),max:/* @__PURE__ */Fe(function(t){return this._max=t,this},"max"),add:/* @__PURE__ */Fe(function(t){return this._data.push(t),this},"add"),clear:/* @__PURE__ */Fe(function(){return this._data=[],this},"clear"),radius:/* @__PURE__ */Fe(function(t,e,i){i=void 0===i?15:i;const n=this._ellipse=this._createCanvas(),o=n.getContext("2d"),a=this._r=t+i,s=this._r=e+i;return n.width=2*a,n.height=2*s,o.shadowOffsetX=o.shadowOffsetY=2*a,o.shadowOffsetY=o.shadowOffsetY=2*s,o.shadowBlur=i,o.shadowColor="black",o.beginPath(),o.ellipse(-a,-s,t,e,0,0,2*Math.PI,!0),o.closePath(),o.fill(),this},"radius"),resize:/* @__PURE__ */Fe(function(){this._width=this._canvas.width,this._height=this._canvas.height},"resize"),gradient:/* @__PURE__ */Fe(function(t){const e=this._createCanvas(),i=e.getContext("2d"),n=i.createLinearGradient(0,0,0,256);e.width=1,e.height=256;for(const o in t)n.addColorStop(+o,t[o]);return i.fillStyle=n,i.fillRect(0,0,1,256),this._grad=i.getImageData(0,0,1,256).data,this},"gradient"),draw:/* @__PURE__ */Fe(function(t){this._ellipse||this.radius(this.defaultRadius,this.defaultRadius),this._grad||this.gradient(this.defaultGradient);const e=this._ctx;e.clearRect(0,0,this._width,this._height);for(let n,o=0,a=this._data.length;o<a;o++)n=this._data[o],n[2]<0?n[2]=0:n[2]>this._max&&(n[2]=this._max),e.globalAlpha=Math.max(n[2]/this._max,void 0===t?.05:t),e.drawImage(this._ellipse,n[0]-this._r,n[1]-this._r);const i=e.getImageData(0,0,this._width,this._height);return this._colorize(i.data,this._grad),e.putImageData(i,0,0),this},"draw"),_colorize:/* @__PURE__ */Fe(function(t,e){for(let i,n=0,o=t.length;n<o;n+=4)i=4*t[n+3],i&&(t[n]=e[i],t[n+1]=e[i+1],t[n+2]=e[i+2])},"_colorize"),_createCanvas:/* @__PURE__ */Fe(function(){return"undefined"!=typeof document?document.createElement("canvas"):new this._canvas.constructor},"_createCanvas")};var tl=Math.PI/3,el=[0,tl,2*tl,3*tl,4*tl,5*tl];function il(t){return t[0]}function nl(t){return t[1]}function ol(){var t,e,i,n=0,o=0,a=1,s=1,r=il,l=nl;function h(t){var n,o={},a=[],s=t.length;for(n=0;n<s;++n)if(!isNaN(c=+r.call(null,h=t[n],n,t))&&!isNaN(u=+l.call(null,h,n,t))){var h,c,u,p=Math.round(u/=i),d=Math.round(c=c/e-(1&p)/2),f=u-p;if(3*Math.abs(f)>1){var y=c-d,_=d+(c<d?-1:1)/2,x=p+(u<p?-1:1),m=c-_,g=u-x;y*y+f*f>m*m+g*g&&(d=_+(1&p?1:-1)/2,p=x)}var b=d+"-"+p,v=o[b];v?v.push(h):(a.push(v=o[b]=[h]),v.x=(d+(1&p)/2)*e,v.y=p*i)}return a}function c(t){var e=0,i=0;return el.map(function(n){var o=Math.sin(n)*t,a=-Math.cos(n)*t,s=o-e,r=a-i;return e=o,i=a,[s,r]})}return M(h,"c"),M(c,"u"),Fe(h,"hexbin"),Fe(c,"hexagon"),h.hexagon=function(e){return"m"+c(null==e?t:+e).join("l")+"z"},h.centers=function(){for(var r=[],l=Math.round(o/i),h=Math.round(n/e),c=l*i;c<s+t;c+=i,++l)for(var u=h*e+(1&l)*e/2;u<a+e/2;u+=e)r.push([u,c]);return r},h.mesh=function(){var e=c(t).slice(0,4).join("l");return h.centers().map(function(t){return"M"+t+"m"+e}).join("")},h.x=function(t){return arguments.length?(r=t,h):r},h.y=function(t){return arguments.length?(l=t,h):l},h.radius=function(n){return arguments.length?(e=2*(t=+n)*Math.sin(tl),i=1.5*t,h):t},h.size=function(t){return arguments.length?(n=o=0,a=+t[0],s=+t[1],h):[a-n,s-o]},h.extent=function(t){return arguments.length?(n=+t[0][0],o=+t[0][1],a=+t[1][0],s=+t[1][1],h):[[n,o],[a,s]]},h.radius(1)}M(il,"ws"),M(nl,"Ss"),M(ol,"As"),Fe(il,"pointX"),Fe(nl,"pointY"),Fe(ol,"d3HexBin");const al=(M(y=class extends on{_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),ve.call(this),this.tooltipValueFormat_default(",.0f"),Me.call(this),this.tooltipHTML(t=>{const e=xt(t,t=>t.label),i=xt(t,t=>t.value);return this.tooltipFormat({series:e[0]===e[1]?e[0]:`${e[0]} -> ${e[1]}`,label:i[0]===i[1]?i[0]:`${i[0]} -> ${i[1]}`,value:t.length})}),this._hexbin=ol().x(t=>t.x).y(t=>t.y),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._hexbin.extent([0,0],[this.width(),this.height()]).radius(this.binSize());const o=this.flattenData().map(e=>({x:n.xPos(t,e),y:n.yPos(t,e),label:t.parseData(e.label),value:t.parseValue(e.value),origRow:e})),a=this._hexbin(o),s=ft(a,function(t){return t.length}),r=yt(a,function(t){return t.length});this._dataMinWeight=s,this._dataMaxWeight=r;const l=e.selectAll(".hexagon").data(a,function(t){return t.i+"_"+t.j});l.enter().append("path").attr("class","hexagon").call(t._selection.enter.bind(t._selection)).on("click",function(e){const i=n.data();n.click(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("dblclick",function(e){const i=n.data();n.dblclick(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).merge(l).transition().duration(i).attr("d",this._hexbin.hexagon()).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(1)"}).style("fill",function(t){return n._palette(t.length,s,r)}),l.exit().transition().duration(i).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).remove()}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}},"_HexBin"),y);Fe(al,"HexBin"),De(al,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let sl=al;sl.prototype._class+=" chart_HexBin",sl.prototype.implements(ve.prototype),sl.prototype.implements(Me.prototype),sl.prototype.publish("paletteID","Blues","set","Color palette for this widget",sl.prototype._palette.switch(),{tags:["Basic","Shared"]}),sl.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),sl.prototype.publish("binSize",20,"number","Bin radius",null,{range:{min:1,max:300,step:1}});const rl=(M(_=class extends sn{constructor(){super(),this.interpolate_default("linear")}},"_Line"),_);Fe(rl,"Line"),rl.prototype._class+=" chart_Line";const ll=(M(x=class extends Yr{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i="left"===this.orientation()?0:this._size.width,n=this._size.height;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle("left"===this.orientation()?0:-Math.PI/2).endAngle("left"===this.orientation()?Math.PI/2:0)}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t})),"Verdana",12).width;return Math.min(this._size.width-t-10,this._size.height-36)-2}},"_QuarterPie"),x);Fe(ll,"QuarterPie");let hl=ll;hl.prototype._class+=" chart_QuarterPie",hl.prototype.publish("orientation","left","set","Determines the placement and start/end angle.",["left","right"]);const cl=(M(m=class extends et{_g;_leftLine;_rightLine;_midLine;_midOuterRect;_midInnerRect1;_midInnerRect2;_q0text;_q1text;_q2text;_q3text;_q4text;_q0val;_q1val;_q2val;_q3val;_q4val;constructor(){super()}enter(t,e){super.enter(t,e),this._g=e.append("g"),this._leftLine=this._g.append("rect"),this._rightLine=this._g.append("rect"),this._midLine=this._g.append("rect"),this._midOuterRect=this._g.append("rect"),this._midInnerRect1=this._g.append("rect"),this._midInnerRect2=this._g.append("rect"),this._q0text=this._g.append("text"),this._q1text=this._g.append("text"),this._q2text=this._g.append("text"),this._q3text=this._g.append("text"),this._q4text=this._g.append("text"),this._q0val=this._g.append("text"),this._q1val=this._g.append("text"),this._q2val=this._g.append("text"),this._q3val=this._g.append("text"),this._q4val=this._g.append("text")}update(t,e){super.update(t,e);const i=("horizontal"===this.orientation()?this.width():this.height())-this.lineWidth(),n="horizontal"===this.orientation()?this.height():this.width(),o=rt().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),i-this.edgePadding()]),a=this.candleWidth_exists()?this.candleWidth():n,s=this.lineWidth(),r=this.lineColor(),l=this.roundedCorners(),h=this.edgePadding();let c=o(this.data()[1]),u=o(this.data()[2]),p=o(this.data()[3]);const d=-a/2,f=a/2,y=this.upperTextRotation(),_=this.lowerTextRotation(),x=this.textPadding(),m=this.labelFontSize(),g=this.valueFontSize(),b=Math.max(m,g),v=i-h;if(b>0){for(;c-h<b;)c+=b;for(;u-c<b;)u+=b;for(;p-u<b;)p+=b;for(;v-p<b;)p-=b;for(;p-u<b;)u-=b;for(;u-c<b;)c-=b}let w=-i/2-this.lineWidth()/2,S=0,k=0,A=1,C="start",M="end";"vertical"===this.orientation()&&(w=0,S=i/2+this.lineWidth()/2,k=-90,C="end",M="start",A=-1),this._g.style("shape-rendering","crispEdges").attr("transform",`translate(${w},${S})rotate(${k})scale(1)`),this._leftLine.attr("fill",r).attr("height",a).attr("width",s).attr("x",h).attr("y",d).attr("rx",l).attr("ry",l),this._rightLine.attr("class","right-line").attr("fill",r).attr("height",a).attr("width",s).attr("x",v).attr("y",d).attr("rx",l).attr("ry",l),this._midLine.attr("fill",r).attr("height",s).attr("width",v-h).attr("x",h).attr("y",-s/2),this._midOuterRect.attr("fill",r).attr("height",a).attr("width",p-c).attr("x",c).attr("y",d).attr("rx",l).attr("ry",l),this._midInnerRect1.attr("fill",this.innerRectColor()).attr("height",a-2*s).attr("width",u-(c+2*s)).attr("x",c+s).attr("y",s-a/2).attr("rx",.618*l).attr("ry",.618*l),this._midInnerRect2.attr("fill",this.innerRectColor()).attr("height",a-2*s).attr("width",p-u-s).attr("x",u).attr("y",s-a/2).attr("rx",.618*l).attr("ry",.618*l),this._q0text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${h}, ${d-x})rotate(${y})scale(${A})`).attr("font-size",m).attr("text-anchor",C).attr("alignment-baseline","hanging").text(this.columns()[0]),this._q1text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${d-x})rotate(${y})scale(${A})`).attr("font-size",m).attr("text-anchor",C).attr("alignment-baseline","middle").text(this.columns()[1]),this._q2text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${d-x})rotate(${y})scale(${A})`).attr("font-size",m).attr("text-anchor",C).attr("alignment-baseline","middle").text(this.columns()[2]),this._q3text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${d-x})rotate(${y})scale(${A})`).attr("font-size",m).attr("text-anchor",C).attr("alignment-baseline","middle").text(this.columns()[3]),this._q4text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${v+s}, ${d-x})rotate(${y})scale(${A})`).attr("font-size",m).attr("text-anchor",C).attr("alignment-baseline","baseline").text(this.columns()[4]),this._q0val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${h}, ${f+x})rotate(${_})scale(${A})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","hanging").text(this.data()[0]),this._q1val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${f+x})rotate(${_})scale(${A})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.data()[1]),this._q2val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${f+x})rotate(${_})scale(${A})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.data()[2]),this._q3val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${f+x})rotate(${_})scale(${A})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.data()[3]),this._q4val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${v+s}, ${f+x})rotate(${_})scale(${A})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","baseline").text(this.data()[4])}},"_QuartileCandlestick"),m);Fe(cl,"QuartileCandlestick");let ul=cl;ul.prototype._class+=" chart_QuartileCandlestick",ul.prototype.publish("textColor","black","html-color","Color of label and value text"),ul.prototype.publish("showLabels",!0,"boolean","If true, labels will be shown"),ul.prototype.publish("showValues",!0,"boolean","If true, values will be shown"),ul.prototype.publish("orientation","horizontal","set","Determines layout",["horizontal","vertical"]),ul.prototype.publish("valueFontSize",12,"number","Font size of value text (pixels)"),ul.prototype.publish("labelFontSize",12,"number","Font size of label text (pixels)"),ul.prototype.publish("roundedCorners",8,"number","Radius of rounded rect corners (pixels)"),ul.prototype.publish("lineWidth",4,"number","Width of lines (pixels)"),ul.prototype.publish("candleWidth",null,"number","Height of outer rect (pixels)",null,{optional:!0}),ul.prototype.publish("textPadding",8,"number","Padding between outer rect and text (pixels)"),ul.prototype.publish("edgePadding",30,"number","Padding between outer rect and left/right sides (pixels)"),ul.prototype.publish("lineColor","#333","html-color","Color of outer rect and lines"),ul.prototype.publish("innerRectColor","white","html-color","Color of the inner rects"),ul.prototype.publish("upperTextRotation",-60,"number","Rotation of label text (degrees)"),ul.prototype.publish("lowerTextRotation",-60,"number","Rotation of value text (degrees)");const pl=(M(g=class extends et{constructor(){super(),Ae.call(this),Me.call(this),tt.SimpleSelectionMixin.call(this)}mapShape(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}setPointAttributes(t,e,i){const n=this;switch(this.mapShape(this.pointShape())){case"rect":t.attr("width",n.pointSize()).attr("height",n.pointSize()).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"circle":t.attr("r",n.pointSize()/2).attr("cx",e).attr("cy",i).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"path":const o=n.pointSize()/2;t.attr("d",function(t){return"M"+(e-o)+" "+(i-o)+" L"+(e+o)+" "+(i+o)+" M"+(e-o)+" "+(i+o)+" L"+(e+o)+" "+(i-o)}).style("stroke",t=>this.strokeColor(t.data,t.column,t.value))}}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t.label,series:t.column,value:t.value}))}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID());const i=this,n=this.height()/2,o=this.width()/2,a=this.columns(),s=this.data(),r=this.flattenData(a,s).map((t,e)=>(t.shape=this.mapShape(this.pointShape()),t.column=a[t.colIdx],t.row=s[e],t)),l=[],h=this.degrees2radians(360/this.data().length),c=this.fontSize();let u=0;r.filter(t=>1===t.colIdx).forEach(t=>{const e=super.textSize(t.label,`${this.fontFamily()}`,this.fontSize());u<e.width&&(u=e.width)});const p=Math.min(n-c,o-u),d=e.selectAll(".label").data(r.filter(t=>1===t.colIdx)),f=Math.max.apply(i,r.map(t=>t.value));d.enter().append("text").attr("class","label").attr("text-anchor","middle").merge(d).attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).each(function(t,e){const n=i.polar2cartesian(p,e*h-Math.PI/2);l.push(n.map(t=>t*i.labelPaddingRatio()));let o="middle";const a=Math.round(n[0]);o=a>0?"start":o,o=a<0?"end":o,$(this).attr("text-anchor",o).attr("x",n[0]).attr("y",n[1])}).text(t=>t.label),d.exit().remove();const y=e.selectAll(".domain").data(r.filter(t=>1===t.colIdx));y.enter().append("line").classed("domain",!0).style("stroke","#000").style("stroke-opacity","0.75").style("stroke-width","1px").merge(y).attr("x1",0).attr("y1",0).attr("x2",(t,e)=>l[e][0]).attr("y2",(t,e)=>l[e][1]),y.exit().remove();const _=e.selectAll(".value_guide").data(this.valueGuideRatios());_.enter().append("polygon").classed("value_guide",!0).style("stroke","grey").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(_).each(function(t,e){const i=[];l.forEach((e,n)=>{i.push([e[0]*t,e[1]*t])}),$(this).attr("points",i.join(" ")).attr("stroke","rgb(0, 0, 0)").attr("stroke-opacity",.75).attr("stroke-width",.3).attr("fill-opacity",0)}),_.exit().remove();const x=e.selectAll(".value_guide_text").data(this.valueGuideRatios());x.enter().append("text").attr("class","value_guide_text").attr("text-anchor","start").attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).merge(x).attr("x",2).attr("y",t=>l[0][1]*t).text((t,e)=>Math.round(t*f)),_.exit().remove();const m=e.selectAll(".area").data(a.filter((t,e)=>e>0));m.enter().append("polygon").attr("class","area").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(m).style("stroke",t=>this.strokeColor([],t,0)).style("fill",t=>this.fillColor([],t,0)).style("fill-opacity",this.fillOpacity()).attr("points",(t,e)=>l.map((t,i)=>{const n=s[i][e+1],o=0===n?0:n/f;return t[0]*o+","+t[1]*o}).join(" ")),m.exit().remove();const g=e.selectAll(".point").data(r);g.enter().append("g").attr("class","point").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).on("click",function(t,e){const n=i.data()[t.rowIdx],o=i.rowToObj(n),a=i._selection.selected(this);i.click(o,i.columns()[t.colIdx],a)}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(i.data()[t.rowIdx]),t.column,i._selection.selected(this))}).each(function(t){const e=$(this);e.append("circle").attr("class","pointSelection").attr("r",i.pointSize()).call(i._selection.enter.bind(i._selection)),e.append(i.mapShape(i.pointShape())).attr("class","pointShape")}).merge(g).each(function(t){const e=$(this),n=0===t.value?0:t.value/f,o=l[t.rowIdx][0]*n,a=l[t.rowIdx][1]*n;e.select(".pointSelection").attr("cx",o).attr("cy",a);const s=e.select(".pointShape").style("stroke",i.strokeColor(t.row,t.column,t.value)).style("fill",i.fillColor(t.row,t.column,t.value));i.setPointAttributes(s,o,a)}),g.exit().remove()}polar2cartesian(t,e){return[t*Math.cos(e),t*Math.sin(e)]}cartesian2polar(t,e){return[Math.atan2(e,t),Math.sqrt(t*t+e*e)]}degrees2radians(t){return t/57.295779513}radians2degrees(t){return 57.295779513*t}point_in_polygon(t,e){const i=t[0],n=t[1];let o=!1;for(let a=0,s=e.length-1;a<e.length;s=a++){const t=e[a][0],r=e[a][1],l=e[s][0],h=e[s][1];r>n!=h>n&&i<(l-t)*(n-r)/(h-r)+t&&(o=!o)}return o}},"_Radar"),g);Fe(pl,"Radar");let dl=pl;dl.prototype._class+=" chart_Radar",dl.prototype.implements(Ae.prototype),dl.prototype.implements(Me.prototype),dl.prototype.mixin(tt.SimpleSelectionMixin),dl.prototype.publish("paletteID","default","set","Color palette for this widget",dl.prototype._palette.switch()),dl.prototype.publish("pointShape","cross","set","pointShape",["circle","rectangle","cross"]),dl.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),dl.prototype.publish("valueGuideRatios",[.2,.4,.6,.8,1],"array","Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines"),dl.prototype.publish("fillOpacity",.66,"number","Opacity of the data polygon(s)"),dl.prototype.publish("fontFamily","","string","fontFamily"),dl.prototype.publish("fontSize",16,"number","fontSize"),dl.prototype.publish("labelPaddingRatio",.9,"number","labelPaddingRatio");const fl=(M(b=class extends et{_domainScale=lt();_valueScale=rt();_d3Arc=ri().startAngle(0).endAngle(t=>this._valueScale(t[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),Ae.call(this),Me.call(this),tt.SimpleSelectionMixin.call(this)}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t[0],value:t[1]})),this._radialAxis=e.append("g").attr("class","r axis"),this._axialAxis=e.append("g").attr("class","a axis"),this._arcs=e.append("g").attr("class","data")}update(t,e){super.update(t,e);const i=this,n=Math.max(this.valueDomainHigh_exists()?this.valueDomainHigh():0,...this.data().map(t=>t[1]));this._valueScale.domain([0,n]).range([0,this.radians(this.valueMaxAngle())]);const o=this._valueScale.ticks(this.tickCount()),a=this.textSize(o.map(t=>""+t),"Verdana",12).width,s=Math.min(this.width()-2*(10+a),this.height()-44)/2,r=this.data().map(t=>t[0]);this._domainScale.domain(r).range([0,s]).padding(this.domainPadding());const l=this._domainScale.step()*this._domainScale.padding(),h=this._radialAxis.selectAll("circle").data(r);h.enter().append("circle").attr("fill","transparent").merge(h).attr("r",t=>this._domainScale(t)+this._domainScale.step()-l/2),h.exit().remove();const c=this._radialAxis.selectAll(".arc-text").data(r);c.enter().append("text").attr("class","arc-text").attr("x",-4).attr("alignment-baseline","middle").attr("text-anchor","end").merge(c).attr("y",t=>-this._domainScale(t)-this._domainScale.bandwidth()/2).text(t=>t),c.exit().remove();const u=this._axialAxis.selectAll("line").data(o);u.enter().append("line").merge(u).attr("x2",t=>s*Math.cos(this._valueScale(t)-this.radians(90))).attr("y2",t=>s*Math.sin(this._valueScale(t)-this.radians(90))),u.exit().remove();const p=this._axialAxis.selectAll("text").data(o);p.enter().append("text").style("dominant-baseline","central").merge(p).attr("x",t=>(s+10)*Math.cos(this._valueScale(t)-this.radians(90))).attr("y",t=>(s+10)*Math.sin(this._valueScale(t)-this.radians(90))).style("text-anchor",t=>{const e=this.degrees(this._valueScale(t));return e>=0&&e<=20||e>=160&&e<=200||e>=340&&e<=360?"middle":e>=180&&e<=360?"end":null}).text(t=>t),p.exit().remove();const d=this.columns().length>1?this.columns()[1]:"";this._d3Arc.innerRadius(t=>this._domainScale(t[0])).outerRadius(t=>this._domainScale(t[0])+this._domainScale.bandwidth());const f=this._arcs.selectAll("path").data(this.data(),t=>t[0]);f.enter().append("path").attr("class","arc").call(this._selection.enter.bind(this._selection)).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("click",function(t,e){i.click(i.rowToObj(t),d,i._selection.selected(this))}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(t),d,i._selection.selected(this))}).merge(f).style("fill",(t,e)=>this.fillColor(t,t[0],t[1])).transition().delay((t,e)=>e*this.transitionDelay()).duration(this.transitionDuration()).attrTween("d",(t,e)=>{const i=kt(t._current||0,t[1]);return t._current=t[1],n=>this._d3Arc([t[0],i(n)],e)}),f.exit().remove()}degrees(t){return 180*t/Math.PI}radians(t){return t*Math.PI/180}},"_RadialBar"),b);Fe(fl,"RadialBar"),De(fl,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number"}]);let yl=fl;yl.prototype._class+=" chart_RadialBar",yl.prototype.implements(Ae.prototype),yl.prototype.implements(Me.prototype),yl.prototype.mixin(tt.SimpleSelectionMixin),yl.prototype.publish("paletteID","default","set","Color palette for this widget",yl.prototype._palette.switch()),yl.prototype.publish("tickCount",10,"number","Number of ticks to display"),yl.prototype.publish("domainPadding",.25,"number","Padding between chart edge and container edge (0..1)"),yl.prototype.publish("valueMaxAngle",270,"number","Maximum angular length of a bar (degrees)"),yl.prototype.publish("valueDomainHigh",null,"number","Value domain high",void 0,{optional:!0}),yl.prototype.publish("transitionDelay",100,"number","Delay between the start of each row animation (ms)"),yl.prototype.publish("transitionDuration",750,"number","Duration of a row's animation (ms)");const _l=X.rainbow("Blues"),xl=X.ordinal("Quartile",[_l(100,0,100),_l(50,0,100),_l(50,0,100),_l(75,0,100)]);function ml(t){const e=Z(t);return function(t){const i=(Math.round(100*t)/100).toString();return i.length<=4?i:e(t)}}M(ml,"Ls"),xl("Std. Dev."),xl("MinMax"),xl("25%"),xl("50%"),Fe(ml,"myFormatter");const gl=(M(v=class extends bt{_selectElement;_tickFormatter;_bellCurve=(new sn).columns(["","Std. Dev."]).paletteID("Quartile").interpolate_default("basis").pointSize(0).xAxisType("linear").xAxisOverlapMode("none").xAxisTickFormat(",").yAxisHidden(!0).yAxisDomainLow(0).yAxisDomainHigh(110).yAxisGuideLines(!1);_candle=(new ul).columns(["Min","25%","50%","75%","Max"]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(_l(90,0,100)).innerRectColor(_l(10,0,100));constructor(){super(),this.columns(["Min","25%","50%","75%","Max","Mean","Std. Dev."])}stdDev(t){return this.mean()+t*this.standardDeviation()}formatStdDev(t){return this._tickFormatter(this.stdDev(t))}quartile(t){return this.quartiles()[t]}formatQ(t){return this._tickFormatter(this.quartile(t))}domain(t){switch(t){case"25_75":return[this.quartile(1),this.quartile(3)];case"normal":return[this.stdDev(-4),this.stdDev(4)];default:return[this.quartile(0),this.quartile(4)]}}min(){return this.quartile(0)}max(){return this.quartile(4)}data(t){if(!arguments.length)return[[...this.quartiles(),this.mean(),this.standardDeviation()]];const e=t[0];return this.quartiles([e[0],e[1],e[2],e[3],e[4]]),this.mean(e[5]),this.standardDeviation(e[6]),this}enter(t,e){super.enter(t,e),this._bellCurve.target(e.append("div").node()),this._candle.target(e.append("div").node()),this._selectElement=e.append("div").style("position","absolute").style("top","0px").style("right","0px").append("select").on("change",()=>{this.view(this._selectElement.node().value),this.lazyRender()}),this._selectElement.append("option").attr("value","min_max").text("Min / Max"),this._selectElement.append("option").attr("value","25_75").text("25% / 75%"),this._selectElement.append("option").attr("value","normal").text("Normal")}bellTicks(t){let e;switch(t){case"25_75":e=[{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)}];break;case"normal":e=[{label:this.formatStdDev(-4),value:this.stdDev(-4)},{label:"-3σ",value:this.stdDev(-3)},{label:"-2σ",value:this.stdDev(-2)},{label:"-1σ",value:this.stdDev(-1)},{label:this.formatStdDev(0),value:this.stdDev(0)},{label:"+1σ",value:this.stdDev(1)},{label:"+2σ",value:this.stdDev(2)},{label:"+3σ",value:this.stdDev(3)},{label:this.formatStdDev(4),value:this.stdDev(4)}];break;default:e=[{label:this.formatQ(0),value:this.quartile(0)},{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)},{label:this.formatQ(4),value:this.quartile(4)}]}const[i,n]=this.domain(this._selectElement.node().value);return e.filter(t=>t.value>=i&&t.value<=n).map(t=>({label:t.label,value:t.value.toString()}))}updateScatter(){const t=this._selectElement.node().value,[e,i]=this.domain(t),n=(i-e)*(this.domainPadding()/100);this._bellCurve.xAxisDomainLow(e-n).xAxisDomainHigh(i+n).xAxisTicks(this.bellTicks(t)).data([[this.stdDev(-4),0],[this.stdDev(-3),.3],[this.stdDev(-2),5],[this.stdDev(-1),68],[this.stdDev(0),100],[this.stdDev(1),68],[this.stdDev(2),5],[this.stdDev(3),.3],[this.stdDev(4),0]]).resize({width:this.width(),height:this.height()-this.candleHeight()}).render()}updateCandle(){const t=this._bellCurve.dataPos(this.quartile(0)),e=this._bellCurve.dataPos(this.quartile(4))-t;this._candle.resize({width:this.width(),height:this.candleHeight()}).pos({x:t+e/2+2,y:this.candleHeight()/2}).width(e).candleWidth(this.candleHeight()).data(this.quartiles()).render()}update(t,e){super.update(t,e),this._tickFormatter=ml(this.tickFormat()),this._selectElement.node().value=this.view(),this.updateScatter(),this.updateCandle()}exit(t,e){this._bellCurve.target(null),this._candle.target(null),this._selectElement.remove(),super.exit(t,e)}},"_StatChart"),v);Fe(gl,"StatChart");let bl=gl;bl.prototype._class+=" chart_StatChart",bl.prototype.publish("view","min_max","set","View",["min_max","25_75","normal"]),bl.prototype.publish("tickFormat",".2e","string","X-Axis Tick Format"),bl.prototype.publish("candleHeight",20,"number","Height of candle widget (pixels)"),bl.prototype.publish("domainPadding",10,"number","Domain value padding"),bl.prototype.publish("mean",.5,"number","Mean"),bl.prototype.publish("standardDeviation",.125,"number","Standard Deviation (σ)"),bl.prototype.publish("quartiles",[0,.25,.5,.75,1],"object","Quartiles (Min, 25%, 50%, 75%, Max)");const vl=(M(w=class extends sn{constructor(){super(),this.interpolate_default("step")}},"_Step"),w);Fe(vl,"Step"),vl.prototype._class+=" chart_Step";const wl="text",Sl="html",kl=(M(S=class extends bt{_playIntervalIdx=0;_mainDiv;_headerDiv;_textDiv;constructor(){super(),this._tag="div",this._drawStartPos="center",this.playInterval(this.playInterval())}lookupFieldIdx(t,e){let i=e;if(!(this[t+"_exists"]()&&(i=this.columns().indexOf(this[t]()),i<0)))return i}lookupFieldText(t,e){return this[t+"_exists"]()?this[t]():void 0!==e&&this.columns()[e]||""}currentRow(){return this.data()[this._playIntervalIdx]}summaryData(){let t;this.hideLabel()||(t=this.lookupFieldIdx("labelColumn",0));const e=this.lookupFieldIdx("iconColumn"),i=this.lookupFieldIdx("valueColumn",1);let n,o;this.hideMore()||(n=this.lookupFieldIdx("moreIconColumn"),o=this.lookupFieldIdx("moreTextColumn"));const a=this.lookupFieldIdx("colorFillColumn"),s=this.lookupFieldIdx("colorStrokeColumn");return this.formattedData().map(function(r){return{icon:void 0===e?this.icon():r[e],label:void 0===t?"":r[t],value:r[i],moreIcon:void 0===n?this.hideMore()?"":this.moreIcon():r[n],moreText:void 0===o?this.hideMore()?"":this.moreText():r[o],fill:void 0===a?this.colorFill():r[a],stroke:void 0===s?this.colorStroke():r[s]}},this)}enter(t,e){super.enter(t,e),this._mainDiv=e.append("div");const i=this;this._headerDiv=this._mainDiv.append("h2").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}),this._textDiv=this._mainDiv.append("div").attr("class","text").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)})}update(t,e){super.update(t,e),this.data().length;const i=this.summaryData();this._playIntervalIdx>=i.length&&(this._playIntervalIdx=0);const n=this._playIntervalIdx<i.length?i[this._playIntervalIdx]:["",""];e.style("width",this.fixedSize()?this.minWidth_exists()?this.minWidth()+"px":null:"100%").style("height",this.fixedSize()?this.minHeight_exists()?this.minHeight()+"px":null:"100%"),this._mainDiv.attr("class","content bgIcon "+n.icon).transition().style("background-color",n.fill).style("color",n.stroke).style("min-width",this.minWidth_exists()?this.minWidth()+"px":null).style("min-height",this.minHeight_exists()?this.minHeight()+"px":null).style("font-size",this.iconFontSize()+"px"),this._headerDiv.transition().style("color",n.stroke).style("font-size",this.headerFontSize()+"px")[this.valueHTML()?Sl:wl](n.value),this._textDiv.style("font-size",this.textFontSize()+"px")[this.labelHTML()?Sl:wl](n.label);const o=this,a=this._mainDiv.selectAll(".more").data([n]),s=a.enter().append("div").attr("class","more").on("click",function(t){o.click(o.rowToObj(o.currentRow()),o.lookupFieldText("moreTextColumn")||"more",!0)}).each(function(){const t=$(this);t.append("i"),t.append("span")}).merge(a).style("display",this.hideMoreWrapper()?"none":null).style("font-size",this.moreFontSize()+"px").style("height",this.moreWrapperHeight_exists()?this.moreWrapperHeight()+"px":null).transition().style("background-color",At(n.fill).darker(.75).toString());s.select("i").attr("class",function(t){return"fa "+t.moreIcon}),this.moreTextHTML()?s.select("span").each(function(t){this.innerHTML=t.moreText}):s.select("span").text(t=>t.moreText),a.exit().remove()}exit(t,e){super.exit(t,e)}},"_Summary"),S);Fe(kl,"Summary");let Al=kl;Al.prototype._class+=" chart_Summary",Al.prototype.implements(be.prototype),Al.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),Al.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:/* @__PURE__ */Fe(t=>t.iconColumn(),"disable")}),Al.prototype.publish("headerFontSize",null,"number","headerFontSize"),Al.prototype.publish("textFontSize",null,"number","textFontSize"),Al.prototype.publish("moreFontSize",null,"number","moreFontSize"),Al.prototype.publish("iconFontSize",null,"number","iconFontSize"),Al.prototype.publish("hideLabel",!1,"boolean","Hide label column"),Al.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */Fe(t=>t.hideLabel(),"disable")}),Al.prototype.publish("labelHTML",!1,"boolean","Allow HTML",null,{disable:/* @__PURE__ */Fe(t=>t.hideLabel(),"disable")}),Al.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Al.prototype.publish("valueHTML",!1,"boolean","Allow HTML"),Al.prototype.publish("hideMore",!1,"boolean","Hide More Information"),Al.prototype.publish("hideMoreWrapper",!1,"boolean","Hide More Information Wrapper"),Al.prototype.publish("moreWrapperHeight",null,"number","Height of the 'more' text wrapper (pixels)"),Al.prototype.publish("moreIconColumn",null,"set","Select More Icon Column",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */Fe(t=>t.hideMore(),"disable")}),Al.prototype.publish("moreIcon","fa-info-circle","string","FA Char icon class",null,{disable:/* @__PURE__ */Fe(t=>t.hideMore()||t.moreIconColumn(),"disable")}),Al.prototype.publish("moreTextColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */Fe(t=>t.hideMore(),"disable")}),Al.prototype.publish("moreText","More Info","string","More text",null,{disable:/* @__PURE__ */Fe(t=>t.hideMore()||t.moreTextColumn(),"disable")}),Al.prototype.publish("moreTextHTML",!1,"boolean","Allow HTML",null,{disable:/* @__PURE__ */Fe(t=>t.hideMore(),"disable")}),Al.prototype.publish("colorFillColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),Al.prototype.publish("colorFill","#3498db","html-color","Fill Color",null,{disable:/* @__PURE__ */Fe(t=>t.colorFillColumn(),"disable")}),Al.prototype.publish("colorStrokeColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),Al.prototype.publish("colorStroke","#ffffff","html-color","Fill Color",null,{disable:/* @__PURE__ */Fe(t=>t.colorStrokeColumn(),"disable")}),Al.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),Al.prototype.publish("minWidth",225,"number","Minimum Width"),Al.prototype.publish("minHeight",150,"number","Minimum Height"),Al.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0});const Cl=Al.prototype.playInterval;Al.prototype.playInterval=function(t){const e=Cl.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const Ml=(k=class extends Ct{_playIntervalIdx=0;constructor(){super(),be.call(this),this.playInterval(this.playInterval())}currentRow(){return this.data()[this._playIntervalIdx]}enter(t,e){super.enter.apply(this,arguments);const{width:i,height:n}=this.size();t.height=n,t.width=i}update(t,e){super.update.apply(this,arguments);const i=this;this._playIntervalIdx>=this.data().length&&(this._playIntervalIdx=0);const n=this.size(),o=Math.min(n.width,n.height),a=this.fontSizeRatio(),s=this.columns().indexOf(this.labelColumn()),r=this.columns().indexOf(this.valueColumn()),l=this.columns().indexOf(this.colorFillColumn()),h=this.columns().indexOf(this.colorStrokeColumn()),c=this.columns().indexOf(this.iconColumn()),u=-1!==c?this.currentRow()[c]:this.icon(),p=-1!==s?this.currentRow()[s]:"",d=-1!==r?this.currentRow()[r]:"",f=-1!==l?this.currentRow()[l]:this.colorFill(),y=-1!==h?this.currentRow()[h]:this.colorStroke();let _=n.height*(a-this.paddingSizeRatio());const x=n.height*(1-a-this.paddingSizeRatio()),m=n.height*(this.iconSizeRatio()-this.paddingSizeRatio()),g=o*this.paddingSizeRatio(),b=t.getContext("2d");b.clearRect(0,0,n.width,n.height);const v=i.fontFamily();function w(t,e,i,o){b.textBaseline="top",b.font=`${i}px ${v}`,b.fillStyle=y;let a=b.measureText(t);a.width>n.width-2*g&&(i*=(n.width-2*g)/a.width,b.font=`${i}px ${v}`,a=b.measureText(t));const s=k(a.width,o);return b.fillText(t,s,e),i}function S(t,e,o){if(void 0===t)return;b.textBaseline=i.iconBaseline(),b.font=`${e}px FontAwesome`,b.fillStyle=y;let a=b.measureText(t);if(a.width>n.width-2*g){const i=(n.width-2*g)/a.width;b.font=e*i+"px FontAwesome",a=b.measureText(t)}const s=k(a.width,o),r=A(i.iconBaseline());b.fillText(t,s,r)}function k(t,e){switch(e){case"start":return g;case"middle":return n.width/2-t/2;case"end":return n.width-t-g}}function A(t){switch(t){case"top":return g;case"middle":return n.height/2;case"bottom":return n.height-g}}M(w,"A"),M(S,"k"),M(k,"M"),M(A,"P"),b.fillStyle=f,b.fillRect(0,0,n.width,n.height),b.globalAlpha=this.iconOpacity(),S(tt.faChar(u),m,i.iconAnchor()),b.globalAlpha=this.valueOpacity(),_=w(d,g,_,i.valueAnchor()),b.globalAlpha=this.labelOpacity(),w(p,_+g,x,i.labelAnchor()),Fe(w,"drawText"),Fe(S,"drawIcon"),Fe(k,"getTextOffsetX"),Fe(A,"getTextOffsetY")}},M(k,"_SummaryC"),k);Fe(Ml,"SummaryC");let Pl=Ml;Pl.prototype._class+=" chart_SummaryC",Pl.prototype.implements(be.prototype),Pl.prototype.publish("iconBaseline","bottom","string","Text baseline for the icon",["top","middle","bottom"]),Pl.prototype.publish("iconAnchor","end","set","Anchors the icon either at the start, middle, or end of the summary",["start","middle","end"]),Pl.prototype.publish("valueAnchor","start","set","Anchors the value either at the start, middle, or end of the summary",["start","middle","end"]),Pl.prototype.publish("labelAnchor","start","set","Anchors the label either at the start, middle, or end of the summary",["start","middle","end"]),Pl.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),Pl.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:/* @__PURE__ */Fe(t=>t.iconColumn(),"disable")}),Pl.prototype.publish("fontFamily","Arial","string","Font Family"),Pl.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Pl.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Pl.prototype.publish("colorFillColumn",null,"set","Column for background color",function(){return this.columns()},{optional:!0}),Pl.prototype.publish("colorFill","#0097e6","html-color","Background Color",null,{disable:/* @__PURE__ */Fe(t=>t.colorFillColumn(),"disable")}),Pl.prototype.publish("colorStrokeColumn",null,"set","Column for font color",function(){return this.columns()},{optional:!0}),Pl.prototype.publish("colorStroke","#2f3640","html-color","Font Color",null,{disable:/* @__PURE__ */Fe(t=>t.colorStrokeColumn(),"disable")}),Pl.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),Pl.prototype.publish("minWidth",225,"number","Minimum Width"),Pl.prototype.publish("minHeight",150,"number","Minimum Height"),Pl.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0}),Pl.prototype.publish("fontSizeRatio",.618,"number","Ratio between widget height and value font size"),Pl.prototype.publish("valueOpacity",1,"number","Opacity of value text (0..1)"),Pl.prototype.publish("labelOpacity",.9,"number","Opacity of label text (0..1)"),Pl.prototype.publish("iconOpacity",.3,"number","Opacity of icon text (0..1)"),Pl.prototype.publish("paddingSizeRatio",.1,"number","Ratio of the smallest dimension for edge padding (0..1)"),Pl.prototype.publish("iconSizeRatio",.9,"number","Ratio of the height for icon size (0..1)");const Tl=Pl.prototype.playInterval;Pl.prototype.playInterval=function(t){const e=Tl.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const Il=Math.PI/180,El=2048;function Fl(){const t=Pt("word","end"),e={};let i=[256,256],n=Dl,o=Rl,a=Ol,s=zl,r=zl,l=jl,h=Nl,c=[],u=$l,p=1/0,d=null,f=Math.random,y=Gl;function _(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=El/e;const i=t.getContext("2d");return i.fillStyle=i.strokeStyle="red",i.textAlign="center",{context:i,ratio:e}}function x(t,e,n){const o=e.x,a=e.y,s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),r=u(i),l=f()<.5?1:-1;let h,c,p,d=-l;for(;(h=r(d+=l))&&(c=~~h[0],p=~~h[1],!(Math.min(Math.abs(c),Math.abs(p))>=s));)if(e.x=o+c,e.y=a+p,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>i[0]||e.y+e.y1>i[1])&&(!n||!Bl(e,t,i[0]))&&(!n||Hl(e,n))){const n=e.sprite,o=e.width>>5,a=i[0]>>5,s=e.x-(o<<4),r=127&s,l=32-r,h=e.y1-e.y0;let c,u=(e.y+e.y0)*a+(s>>5);for(let e=0;e<h;e++){c=0;for(let i=0;i<=o;i++)t[u+i]|=c<<l|(i<o?(c=n[e*o+i])>>>r:0);u+=a}return delete e.sprite,!0}return!1}return M(_,"x"),M(x,"m"),e.canvas=function(t){return arguments.length?(y=Ul(t),e):y},e.start=function(){const u=_(y()),m=ql((i[0]>>5)*i[1]);let g=null;const b=c.length;let v=-1;const w=[],S=c.map(function(t,e){return t.text=n.call(this,t,e),t.font=o.call(this,t,e),t.style=s.call(this,t,e),t.weight=r.call(this,t,e),t.rotate=l.call(this,t,e),t.size=~~a.call(this,t,e),t.padding=h.call(this,t,e),t}).sort(function(t,e){return e.size-t.size});return d&&clearInterval(d),d=setInterval(k,0),k(),e;function k(){const n=Date.now();for(;Date.now()-n<p&&++v<b&&d;){const n=S[v];n.x=i[0]*(f()+.5)>>1,n.y=i[1]*(f()+.5)>>1,Ll(u,n,S,v),n.hasText&&x(m,n,g)&&(w.push(n),t.call("word",e,n),g?Vl(g,n):g=[{x:n.x+n.x0,y:n.y+n.y0},{x:n.x+n.x1,y:n.y+n.y1}],n.x-=i[0]>>1,n.y-=i[1]>>1)}v>=b&&(e.stop(),t.call("end",e,w,g))}},e.stop=function(){return d&&(clearInterval(d),d=null),e},Fe(_,"getContext"),Fe(x,"place"),e.timeInterval=function(t){return arguments.length?(p=null==t?1/0:t,e):p},e.words=function(t){return arguments.length?(c=t,e):c},e.size=function(t){return arguments.length?(i=[+t[0],+t[1]],e):i},e.font=function(t){return arguments.length?(o=Ul(t),e):o},e.fontStyle=function(t){return arguments.length?(s=Ul(t),e):s},e.fontWeight=function(t){return arguments.length?(r=Ul(t),e):r},e.rotate=function(t){return arguments.length?(l=Ul(t),e):l},e.text=function(t){return arguments.length?(n=Ul(t),e):n},e.spiral=function(t){return arguments.length?(u=Xl[t]||t,e):u},e.fontSize=function(t){return arguments.length?(a=Ul(t),e):a},e.padding=function(t){return arguments.length?(h=Ul(t),e):h},e.random=function(t){return arguments.length?(f=t,e):f},e.on=function(){const i=t.on.apply(t,arguments);return i===t?e:i},e}function Dl(t){return t.text}function Rl(){return"serif"}function zl(){return"normal"}function Ol(t){return Math.sqrt(t.value)}function jl(){return 30*(~~(6*Math.random())-3)}function Nl(){return 1}function Ll(t,e,i,n){if(e.sprite)return;const o=t.context,a=t.ratio;o.clearRect(0,0,2048/a,El/a);let s=0,r=0,l=0;const h=i.length;for(--n;++n<h;){e=i[n],o.save(),o.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;let t=o.measureText(e.text+"m").width*a,h=e.size<<1;if(e.rotate){const i=Math.sin(e.rotate*Il),n=Math.cos(e.rotate*Il),o=t*n,a=t*i,s=h*n,r=h*i;t=Math.max(Math.abs(o+r),Math.abs(o-r))+31>>5<<5,h=~~Math.max(Math.abs(a+s),Math.abs(a-s))}else t=t+31>>5<<5;if(h>l&&(l=h),s+t>=2048&&(s=0,r+=l,l=0),r+h>=El)break;o.translate((s+(t>>1))/a,(r+(h>>1))/a),e.rotate&&o.rotate(e.rotate*Il),o.fillText(e.text,0,0),e.padding&&(o.lineWidth=2*e.padding,o.strokeText(e.text,0,0)),o.restore(),e.width=t,e.height=h,e.xoff=s,e.yoff=r,e.x1=t>>1,e.y1=h>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,s+=t}const c=o.getImageData(0,0,2048/a,El/a).data,u=[];for(;--n>=0;){if(!(e=i[n]).hasText)continue;const t=e.width,o=t>>5;let a=e.y1-e.y0;for(let e=0;e<a*o;e++)u[e]=0;if(s=e.xoff,null==s)return;r=e.yoff;let l=0,h=-1;for(let i=0;i<a;i++){for(let e=0;e<t;e++){const t=o*i+(e>>5),n=c[2048*(r+i)+(s+e)<<2]?1<<31-e%32:0;u[t]|=n,l|=n}l?h=i:(e.y0++,a--,i--,r++)}e.y1=e.y0+h,e.sprite=u.slice(0,(e.y1-e.y0)*o)}}function Bl(t,e,i){i>>=5;const n=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,r=32-s,l=t.y1-t.y0;let h,c=(t.y+t.y0)*i+(a>>5);for(let u=0;u<l;u++){h=0;for(let t=0;t<=o;t++)if((h<<r|(t<o?(h=n[u*o+t])>>>s:0))&e[c+t])return!0;c+=i}return!1}function Vl(t,e){const i=t[0],n=t[1];e.x+e.x0<i.x&&(i.x=e.x+e.x0),e.y+e.y0<i.y&&(i.y=e.y+e.y0),e.x+e.x1>n.x&&(n.x=e.x+e.x1),e.y+e.y1>n.y&&(n.y=e.y+e.y1)}function Hl(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function $l(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function Wl(t){const e=4*t[0]/t[1];let i=0,n=0;return function(t){const o=t<0?-1:1;switch(Math.sqrt(1+4*o*t)-o&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}function ql(t){const e=[];let i=-1;for(;++i<t;)e[i]=0;return e}function Gl(){return document.createElement("canvas")}function Ul(t){return"function"==typeof t?t:function(){return t}}M(Fl,"tr"),M(Dl,"er"),M(Rl,"ir"),M(zl,"nr"),M(Ol,"or"),M(jl,"ar"),M(Nl,"sr"),M(Ll,"rr"),M(Bl,"lr"),M(Vl,"hr"),M(Hl,"cr"),M($l,"ur"),M(Wl,"pr"),M(ql,"dr"),M(Gl,"fr"),M(Ul,"yr"),Fe(Fl,"d3Cloud"),Fe(Dl,"cloudText"),Fe(Rl,"cloudFont"),Fe(zl,"cloudFontNormal"),Fe(Ol,"cloudFontSize"),Fe(jl,"cloudRotate"),Fe(Nl,"cloudPadding"),Fe(Ll,"cloudSprite"),Fe(Bl,"cloudCollide"),Fe(Vl,"cloudBounds"),Fe(Hl,"collideRects"),Fe($l,"archimedeanSpiral"),Fe(Wl,"rectangularSpiral"),Fe(ql,"zeroArray"),Fe(Gl,"cloudCanvas"),Fe(Ul,"functor");const Xl={archimedean:$l,rectangular:Wl},Yl=(A=class extends et{_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),be.call(this),Me.call(this),tt.SimpleSelectionMixin.call(this),this._prevOffsetX=this.offsetX(),this._prevOffsetY=this.offsetY(),this._prevZoom=this.zoom()}calcData(){return this.data().map(t=>({__viz_label:t[0],__viz_weight:t[1],__viz_row:t}))}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this._root=e.append("g"),this._canvas=document.createElement("canvas");const i=this;this._d3Zoom=Mt().scaleExtent([.1,10]),this._d3Zoom.on("zoom",function(t){const e=dt();e&&e.transform&&i.zoomed(i._d3Zoom,[e.transform.x,e.transform.y],e.transform.k)}),e.call(this._d3Zoom),this.tooltipHTML(function(t){const e=i.columns(),n=e&&e.length?e[0]:"Word";return i.tooltipFormat({label:t.__viz_label,series:n,value:t.__viz_weight})})}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._d3Cloud=Fl().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());const i=this.calcData(),n=this,o=xt(i,function(t){return t.__viz_weight});let a;switch(this.scaleMode()){case"log":a=at;break;case"sqrt":a=_t;break;case"pow":a=st;break;default:a=rt}const s=a().domain(o).range([this.fontSizeFrom(),this.fontSizeTo()]),r=rt().domain([0,n.angleCount()-1]).range([n.angleFrom(),n.angleTo()]);function l(t,e){const i=n._root.selectAll("text").data(t,function(t){return t.__viz_label?t.__viz_label.toLowerCase():""});i.enter().append("text").attr("text-anchor","middle").call(n._selection.enter.bind(n._selection)).text(function(t){return t.__viz_label}).on("click",function(t){n.click(n.rowToObj(t.__viz_row),n.columns()[1],n._selection.selected(this))}).on("dblclick",function(t){n.dblclick(n.rowToObj(t.__viz_row),n.columns()[1],n._selection.selected(this))}).on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).style("opacity",1e-6).merge(i).style("font-size",function(t){return s(t.__viz_weight)+"px"}).style("font-family",n.fontFamily()).transition().duration(1e3).attr("transform",function(t){return"translate("+[t.x,t.y]+")rotate("+t.rotate+")"}).style("fill",function(t){return n._palette(t.__viz_label?t.__viz_label.toLowerCase():"")}).style("opacity",1),i.exit().transition().duration(1e3).style("opacity",1e-4).remove()}M(l,"h"),this._d3Cloud.stop().size([this.width(),this.height()]).words(i).font(this.fontFamily()).padding(this.padding()).spiral(this.spiral()).text(function(t){return t.__viz_label.trim()}).fontSize(function(t){return s(t.__viz_weight)}).rotate((t,e)=>r(e%n.angleCount())).on("word",t=>{}).on("end",l).start(),Fe(l,"draw")}zoomed(t,e,i){if(e[0]!==this._prevOffsetX||e[1]!==this._prevOffsetY||i!==this._prevZoom){switch(this._root.attr("transform",e),t){case this:break;case this._d3Zoom:this.offsetX(e[0]),this.offsetY(e[1]),this.zoom(i)}this._prevOffsetX=e[0],this._prevOffsetY=e[1],this._prevZoom=i}}},M(A,"_WordCloud"),A);Fe(Yl,"WordCloud"),De(Yl,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let Ql=Yl;function Zl(){const t=ot(".%L"),e=ot(":%S"),i=ot("%H:%M"),n=ot("%H:00"),o=ot("%b %d"),a=ot("%b"),s=ot("%Y");return r=>0!==r.getMilliseconds()?t(r):0!==r.getSeconds()?e(r):0!==r.getMinutes()?i(r):0!==r.getHours()?n(r):1!==r.getDate()?o(r):0!==r.getMonth()?a(r):s(r)}M(Zl,"gr"),Ql.prototype._class+=" chart_WordCloud",Ql.prototype.implements(be.prototype),Ql.prototype.implements(Me.prototype),Ql.prototype.mixin(tt.SimpleSelectionMixin),Ql.prototype.publish("paletteID","default","set","Color palette for this widget",Ql.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ql.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ql.prototype.publish("fontFamily","Impact","string","Font Name",null,{tags:["Basic"]}),Ql.prototype.publish("fontSizeFrom",6,"number","Minimum font size (pixels)",null,{tags:["Basic"]}),Ql.prototype.publish("fontSizeTo",48,"number","Maximum font size (pixels)",null,{tags:["Basic"]}),Ql.prototype.publish("angleFrom",-60,"number","Minimum angle (degrees)",null,{tags:["Basic"]}),Ql.prototype.publish("angleTo",60,"number","Maximum angle (degrees)",null,{tags:["Basic"]}),Ql.prototype.publish("angleCount",5,"number","Number of different angles",null,{tags:["Basic"]}),Ql.prototype.publish("padding",0,"number","Padding between words (pixels)",null,{tags:["Intermediate"]}),Ql.prototype.publish("scaleMode","linear","set","Text scaling mode",["linear","log","sqrt","pow"],{tags:["Intermediate"]}),Ql.prototype.publish("spiral","archimedean","set","Text scaling mode",["archimedean","rectangular"],{tags:["Intermediate"]}),Ql.prototype.publish("offsetX",0,"number","X offset",null,{tags:["Advanced"]}),Ql.prototype.publish("offsetY",0,"number","Y offset",null,{tags:["Advanced"]}),Ql.prototype.publish("zoom",1,"number","Zoom",null,{tags:["Advanced"]}),Fe(Zl,"multiScale24Hours"),function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".chart_Axis{fill:#000;font:10px sans-serif}.chart_Axis .axis .tick>text{font:10px sans-serif}.chart_Axis .axis path.domain,.chart_Axis .axis .tick line{fill:none;stroke:#000}.chart_Axis .guide path.domain{fill:none;stroke:none}.chart_Axis .guide .tick line{fill:none;stroke:#d3d3d3;opacity:.7}.chart_Axis .guide .tick.guide-0 line{stroke:#000;stroke-width:1;stroke-dasharray:3 5}.chart_Axis line,.chart_Axis path{shape-rendering:crispEdges}.chart_XYAxis .axis{fill:#000;font:10px sans-serif}.chart_XYAxis .tick>text{font:10px sans-serif}.chart_XYAxis .focus .chart_Axis.value .tick{visibility:hidden}.chart_XYAxis .axis path,.chart_XYAxis .axis line{fill:none;stroke:#000;shape-rendering:crispEdges}.chart_XYAxis .region{opacity:.33}.chart_XYAxis .brush rect.background{z-index:-999}.chart_XYAxis .brush .selection{stroke:#4682b4;stroke-opacity:1;stroke-width:1px;fill:#4682b4;fill-opacity:.125;shape-rendering:crispEdges}.chart_XYAxis .brush path.handle--custom{fill:#eee;stroke:#666}.chart_Scatter .pointShape,.chart_Scatter .line,.chart_Scatter .area{pointer-events:none}.chart_Scatter .point .pointSelection{fill:none;stroke:transparent;stroke-width:2px;pointer-events:all;transition:all .2s ease}.chart_Scatter .point .pointSelection.selected{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection:hover{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Scatter .point .pointSelection:focus{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection.selected:focus{stroke:#6f42c1!important}.chart_Scatter .point .pointSelection:focus-visible{outline:none}.chart_Scatter .point .pointSelection:active{outline:none!important}.chart_Column .columnRect{fill:#4682b4;cursor:pointer}.chart_Column .data.axis path{display:none}.chart_Column .columnRect{stroke:transparent;border-width:2px}.chart_Column .dataCell.selected .columnRect{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Column .dataCell:hover .columnRect{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Column .dataCell:focus .columnRect{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Column .dataCell.selected:focus .columnRect{stroke:#6f42c1!important}.chart_Column .dataCell:focus-visible{outline:none}.chart_Column .dataCell:active{outline:none!important}.chart_Bubble circle{cursor:pointer}.chart_Bubble .selected circle{stroke:red;stroke-width:1.5px}.chart_Bubble .common_FAChar{fill:#fff;pointer-events:none}.chart_Bubble .common_Text{pointer-events:none}.chart_Bullet .domain{opacity:0}.chart_Bullet .bullet{border:solid 1px;border-color:transparent;font:10px sans-serif}.chart_Bullet .bullet.selected{border-color:red}.chart_Bullet .bullet.over{border-color:orange}.chart_Bullet .bullet.selected.over{border-color:red}.chart_Bullet .bullet .marker{stroke:#000;stroke-width:2px}.chart_Bullet .bullet .tick line{stroke:#666;stroke-width:.5px}.chart_Bullet .bullet .range.s0{fill:#eee}.chart_Bullet .bullet .range.s1{fill:#ddd}.chart_Bullet .bullet .range.s2{fill:#ccc}.chart_Bullet .bullet .measure.s0{fill:#b0c4de}.chart_Bullet .bullet .measure.s1{fill:#4682b4}.chart_Bullet .bullet .title{font-size:14px;font-weight:700}.chart_Bullet .bullet .subtitle{fill:#999}.chart_Pie path{cursor:pointer}.chart_Pie>g>text{cursor:pointer}.chart_Pie .arc path{stroke:transparent;stroke-width:2px}.chart_Pie .arc.selected path{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Pie polyline{opacity:.3;stroke:#000;stroke-width:2px;fill:none}.chart_Pie .arc:hover path{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Pie .arc:focus path{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Pie .arc.selected:focus path{stroke:#6f42c1!important}.chart_Pie .arc:focus-visible{outline:none}.chart_Pie .arc:active{outline:none!important}.chart_HexBin .hexagon{fill:none;stroke:#000;stroke-width:.5px}.chart_HexBin .hexagon.selected{stroke:red}.chart_Line .dataLine{fill:none;stroke:#4682b4;stroke-width:1.5px}.chart_Radar .pointShape,.chart_Radar .area{pointer-events:none}.chart_Radar .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Radar .point .pointSelection.selected{fill:none;stroke:red}.chart_RadialBar path.arc{opacity:.9;transition:opacity .5s}.chart_RadialBar path.arc.selected{stroke:red}.chart_RadialBar path.arc:hover{opacity:.7}.chart_RadialBar .axis line,.chart_RadialBar .axis circle{stroke:#ccc;stroke-width:1px}.chart_RadialBar .axis circle{fill:none}.chart_RadialBar .r.axis text{text-anchor:end}.chart_Summary{width:225px;height:150px;font-size:14px}.chart_Summary .content h2{font-weight:700;font-size:3em;margin-left:10px;margin-top:10px;margin-bottom:10px}.chart_Summary .bgIcon:before{position:absolute;font-family:FontAwesome;font-size:5.5em;opacity:.4;top:.5em;right:15px}.chart_Summary .bgIcon{position:relative}.chart_Summary .content{float:left;width:100%;height:100%;background-color:#efd752}.chart_Summary .content div{margin-top:-1.1em;font-size:1.1em;opacity:.8}.chart_Summary .content .text{padding-left:10px}.chart_Summary .content .more{position:absolute;bottom:0;width:100%;height:3em;line-height:3em}.chart_Summary .content .more i{padding-left:10px;padding-right:.5em}.other_Wordcloud text{cursor:pointer}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();const Jl=["label","start","end","icon","color","series"],Kl=class _WUTimeline extends Gt{_palette=X.ordinal("default");constructor(){super(),this.columns(Jl).titleColumn("label").iconColumn("icon").colorColumn("color").seriesColumn("series").timePattern("%Y-%m-%dT%H:%M:%S.%LZ").tickFormatFunc(Zl()).tooltipTimeFormat("%H:%M:%S.%L").tooltipHTML(t=>t[Jl.length].calcTooltip())}_prevHashSum;clear(){return delete this._prevHashSum,this}fetchScopes(){const t=O({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});if(this._prevHashSum!==t){this._prevHashSum=t;T.attach({baseUrl:this.baseUrl()},this.wuid()).fetchDetails(this.request()).then(t=>t.filter(t=>t.Id&&t.attr("WhenStarted").RawValue).map(t=>{const e=+t.attr("WhenStarted").RawValue/1e3,i=+t.attr("TimeElapsed").RawValue/1e6;return[t.Id,new Date(e).toISOString(),i?new Date(e+i).toISOString():void 0,null,this._palette(t.ScopeType),t.ScopeName.split("::").join(":").split(":").slice(0,1),t]})).then(t=>{this.data(t).render()})}}enter(t,e){super.enter(t,e)}update(t,e){this.fetchScopes(),super.update(t,e)}exit(t,e){super.exit(t,e)}};M(Kl,"WUTimeline");let th=Kl;th.prototype._class+=" eclwatch_WUTimeline",th.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),th.prototype.publish("wuid","","string","Workunit ID"),th.prototype.publish("request",{ScopeFilter:{MaxDepth:3,ScopeTypes:["graph","subgraph"]},NestedFilter:{Depth:0,ScopeTypes:[]},PropertiesToReturn:{AllProperties:!1,AllStatistics:!0,AllHints:!1,Properties:["WhenStarted","TimeElapsed"]},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},"object","WUDetails Request");export{Yt as BUILD_VERSION,Zt as ECLArchiveViewer,Ut as PKG_NAME,Xt as PKG_VERSION,de as STATUS,fe as STATUS_ACTIVE,se as WUGraph,pe as WUResult,oe as WUScopeController,_e as WUStatus,th as WUTimeline};
|
|
1
|
+
var t,e,i,n,o,a,s,r,l,h,c,u,p,d,f,y,_,x,m,g,b,v,w,S,k,A,C=Object.defineProperty,M=(t,e)=>C(t,"name",{value:e,configurable:!0});import{Editor as P}from"@hpcc-js/codemirror";import{Workunit as T,BaseScope as I,Result as E,WUStateID as F}from"@hpcc-js/comms";import{SplitPanel as D}from"@hpcc-js/phosphor";import{DirectoryTree as R}from"@hpcc-js/tree";import{xml2json as z,hashSum as O,Subgraph as j,Vertex as N,Edge as L,normalizeRadians as B,degreesToRadians as V}from"@hpcc-js/util";import{local as H,select as $,Icon as W,Button as q,ToggleButton as G,Spacer as U,Palette as X,hsl as Y,Widget as Q,format as Z,selection as J,map as K,Utility as tt,SVGWidget as et,scaleTime as it,timeParse as nt,timeFormat as ot,scaleLog as at,scalePow as st,scaleLinear as rt,scaleBand as lt,brush as ht,brushX as ct,brushY as ut,brushSelection as pt,d3Event as dt,min as ft,max as yt,scaleSqrt as _t,extent as xt,Text as mt,FAChar as gt,HTMLWidget as bt,drag as vt,event as wt,interpolateHcl as St,interpolate as kt,rgb as At,CanvasWidget as Ct,zoom as Mt,dispatch as Pt,descending as Tt,tickStep as It,range as Et,thresholdSturges as Ft}from"@hpcc-js/common";import{Table as Dt,RowFormatter as Rt,domConstruct as zt,Deferred as Ot,QueryResults as jt,Common as Nt}from"@hpcc-js/dgrid";import{Vertex as Lt,Subgraph as Bt,Edge as Vt,Graph as Ht}from"@hpcc-js/graph";import{Legend as $t,ChartPanel as Wt,Carousel as qt}from"@hpcc-js/layout";import{ReactTimelineSeries as Gt}from"@hpcc-js/timeline";const Ut="@hpcc-js/eclwatch",Xt="3.6.2",Yt="3.21.2",Qt=class _ECLArchiveViewer extends D{_prevHash;_contentStr;_directoryPane=new R;_fileEditorPane=(new P).text("");constructor(){super("horizontal"),this._directoryPane.rowClick=t=>{this._fileEditorPane.text(t).render()}}transformArchiveTreeData(t){const e={label:t.name,children:t._children.map(i).filter(t=>t)};return e.children&&e.children[0]&&"html"===e.children[0].label?{label:"root",children:[{label:"error",content:JSON.stringify(e,null,4)}]}:e;function i(t){const e={};if(e.label=t.name+(t.$&&t.$.key?` (${t.$.key})`:""),t._children&&t._children.length>0)e.children=t._children.map(t=>i(t)).filter(t=>t);else{if("string"!=typeof t.content||!t.content.trim())return!1;e.content=t.content}return e}}updateDirectoryPane(t){let e;if(t)try{e=JSON.parse(t)}catch(i){e=z(t)}if(e){const t=this.transformArchiveTreeData(e);this._directoryPane.data(t).render()}}enter(t,e){super.enter(t,e),this.addWidget(this._directoryPane).addWidget(this._fileEditorPane)}update(t,e){super.update(t,e);const i=O({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==i||void 0===this._contentStr?T.attach({baseUrl:this.baseUrl()},this.wuid()).fetchArchive().then(t=>{this._contentStr=t,this.updateDirectoryPane(this._contentStr),this._prevHash=i}):this.updateDirectoryPane(this._contentStr),this.relativeSizes([this.directoryWidthRatio(),1-this.directoryWidthRatio()])}};M(Qt,"ECLArchiveViewer");let Zt=Qt;Zt.prototype._class+=" eclwatch_ECLArchiveViewer",Zt.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),Zt.prototype.publish("wuid","","string","Workunit ID"),Zt.prototype.publish("directoryWidthRatio",.38,"number","Default directory panel width ratio relative to the full width"),Zt.prototype.publish("contentString",null,"string","XML/JSON archive content string"),Zt.prototype.publishProxy("directoryPaneColor","_directoryPane","backgroundColor"),Zt.prototype.publishProxy("directoryPaneHoverColor","_directoryPane","hoverBackgroundColor"),Zt.prototype.publishProxy("iconSize","_directoryPane"),Zt.prototype.publishProxy("fontColor","_directoryPane"),Zt.prototype.publishProxy("fontFamily","_directoryPane"),Zt.prototype.publishProxy("fontSize","_directoryPane"),Zt.prototype.publishProxy("folderIconOpen","_directoryPane"),Zt.prototype.publishProxy("folderIconClosed","_directoryPane"),Zt.prototype.publishProxy("textFileIcon","_directoryPane"),Zt.prototype.publishProxy("codeFileIcon","_directoryPane"),Zt.prototype.publishProxy("verticalScroll","_directoryPane");const Jt=class _LegendVertex extends Lt{constructor(){super()}enter(t,e){super.enter(t,e),this._icon.on("click",()=>{this.click(this.data())})}click(t){}};M(Jt,"LegendVertex");let Kt=Jt;const te=class _WUGraphLegend extends $t{icon=H();_disabled2={};disabled(t){if(!arguments.length){const t=[];for(const e in this._disabled2)this._disabled2[e]&&t.push(e);return t}return this._disabled2={},t.forEach(t=>this._disabled2[t]=!0),this}toggle(t){this._disabled2[t]=!this._disabled2[t]}update(t,e){super.update(t,e);const i=this,n=this._g.selectAll(".legendItem").data(this.data(),t=>t.kind);n.enter().append("g").attr("class","legendItem").each(function(t){i.icon.set(this,(new Kt).target(this).data(t.kind).textbox_shape_colorStroke("none").textbox_shape_colorFill("none").iconAnchor("left").faChar(t.faChar).text(`${t.label} (${t.count})`).tooltip(`${t.kind} - ${t.label}`).on("click",t=>{i.toggle(t),i.render(),i.click(t)}).on("mouseover",t=>{i.mouseover(t)}).on("mouseout",t=>{i.mouseout(t)}))}).merge(n).each(function(t,e){const n=i.icon.get(this).icon_shape_colorFill(i._disabled2[t.kind]?"gray":null).render().getBBox();$(this).attr("transform",`translate(${+n.width/2}, ${30*e})`)}),n.exit().each(function(t){i.icon.get(this).target(null).render()}).remove();const o=this.getBBox(!0,!0);this._g.attr("transform",`translate(16, ${this.height()/2-o.height/2})`)}click(t){}mouseover(t){}mouseout(t){}};M(te,"WUGraphLegend");let ee=te;function ie(t){switch(t){case"2":case"44":case"47":case"56":case"61":case"35":case"37":return"";case"3":return"";case"5":return"";case"6":return"";case"12":return"";case"15":case"17":case"59":return"";case"22":return"";case"23":return"";case"25":case"133":case"148":return"";case"26":case"19":return"";case"29":case"16":return"";case"36":return"";case"54":return"";case"82":case"88":case"99":case"105":case"71":return"";case"92":case"93":return"";case"7":return"";case"9":return"";case"21":case"168":return""}return""}ee.prototype._class+=" eclwatch_WUGraphLegend",M(ie,"faCharFactory");const ne=class _WUScopeController{graphDB;subgraphsMap={};rSubgraphsMap={};verticesMap={};rVerticesMap={};edgesMap={};rEdgesMap={};kindMap={};_disabled={};constructor(){}clear(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={}}set(t){this.graphDB=t,this.graphGui(this.graphDB),this.kindMap={},this.graphDB.walk(t=>{if(t instanceof j);else if(t instanceof N){const e=t._.attr("Kind").RawValue;this.kindMap[e]||(this.kindMap[e]=[]),this.kindMap[e].push(t)}})}disabled(t){if(!arguments.length){const t=[];for(const e in this._disabled)this._disabled[e]&&t.push(e);return t}return this._disabled={},t.forEach(t=>this._disabled[t]=!0),this}graphGui(t){const e={subgraphs:[],vertices:[],edges:[],hierarchy:[]};return t.walk(t=>{if(t instanceof j){const i=this.appendSubgraph(t,e.hierarchy,e.subgraphs);i.showMinMax(t.vertices.length>3||"normal"!==i.minState())}else t instanceof N?this.appendVertex(t,e.hierarchy,e.vertices):t instanceof L&&this.appendEdge(t,e.edges)}),e}format(t,e){let i="",n=t.indexOf("%"),o=-1;for(;n>=0;){if(i+=t.substring(o+1,n),o=t.indexOf("%",n+1),o<0){console.warn("Invalid Label Template");break}i+=t.substring(n+1,o)?e[t.substring(n+1,o)]||"":"%",n=t.indexOf("%",o+1)}return i+=t.substring(o+1,t.length),i.split("\\n").join("\n")}createSubgraph(t){let e=this.subgraphsMap[t._.Id];return e||(e=(new Bt).title(t._.Id).on("minClick",()=>{this.minClick(e)}),this.subgraphsMap[t._.Id]=e,this.rSubgraphsMap[e.id()]=t),e}createVertex(t){let e=this.verticesMap[t._.Id];if(!e){const i=t._.rawAttrs();if("dummy"===t._.ScopeType){const i=this.subgraphsMap[t.parent._.Id];e=(new W).shape_colorFill("darkred").shape_colorStroke("darkred").image_colorFill("white").faChar("").on("click",()=>{i.minState("normal"),this.minClick(i)})}else{e=(new Lt).icon_shape_colorFill("#1f77b4").icon_image_colorFill("white").faChar(ie(i.Kind)).text(i.Label);const n=[];t._.hasAttr("Definition")&&n.push({faChar:"",tooltip:"Definition",shape_colorFill:"lightgray",shape_colorStroke:"lightgray",image_colorFill:"black"}),t._.hasAttr("IsInternal")&&n.push({faChar:"",tooltip:"IsInternal",shape_colorFill:"red",shape_colorStroke:"red",image_colorFill:"white"}),e.annotationIcons(n)}this.verticesMap[t._.Id]=e,this.rVerticesMap[e.id()]=t}return e}isSpill(t){const e=t.source._.attr("Kind").RawValue,i=t.target._.attr("Kind").RawValue;return"2"===e||"71"===i}spansSubgraph(t){return t.source.parent._.Id!==t.target.parent._.Id}createEdge(t){let e=this.edgesMap[t._.Id];if(!e){const i=t._.rawAttrs(),n=this.verticesMap[t.source._.Id],o=this.verticesMap[t.target._.Id];if(n&&o){const a=this.isSpill(t),s=this.spansSubgraph(t),r=this.format("%Label%\n%NumRowsProcessed%",i);let l=null,h=100;i.IsDependency?(h=10,l="1,5"):i._childGraph?l="5,5":a?(h=25,l="5,5,10,5"):s&&(h=5,l="5,5"),e=(new Vt).sourceVertex(n).targetVertex(o).sourceMarker("circle").targetMarker("arrow").weight(h).strokeDasharray(l).text(r),this.edgesMap[t._.Id]=e,this.rEdgesMap[e.id()]=t}}return e}appendSubgraph(t,e,i){const n=this.createSubgraph(t);i.push(n);const o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:n}),n}appendVertex(t,e,i){const n=this.createVertex(t);i.push(n);const o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:n}),n}appendEdge(t,e){const i=this.createEdge(t);return i&&e.push(i),i}filterLegend(t){for(let e=t.vertices.length-1;e>=0;--e){const i=t.vertices[e],n=i._.attr("Kind").RawValue;this._disabled[n]&&i.remove(!1,(t,e)=>new I({ScopeName:i._.ScopeName+":in",Id:t.Id+"->"+e.Id,ScopeType:"dummy-edge",Properties:{Property:[i._.attr("Label")]},Notes:{Note:[]},SinkActivity:""}))}}filterPartial(t){for(const e of t.subgraphs){if("partial"===this.subgraphsMap[e._.Id].minState()){const t=e.vertices,i=[],n=[];for(const e of t)0===e.inEdges.length||e.inEdges.some(t=>t.source.parent!==t.target.parent)||0===e.outEdges.length||e.outEdges.some(t=>t.source.parent!==t.target.parent)?i.push(e):n.push(e);if(n.length>1){const t={ScopeName:e._.ScopeName,Id:e._.Id+":dummy",ScopeType:"dummy",Properties:{Property:[{Name:"Activities",RawValue:""+n.length,Formatted:""+n.length,Measure:"count",Creator:"",CreatorType:""}]},Notes:{Note:[]},SinkActivity:""},o=new I(t),a=e.createVertex(o);for(const s of n){for(const t of s.inEdges)if(i.indexOf(t.source)>=0){const i=new I({ScopeName:t.source._.ScopeName,Id:t.source._.Id+"->"+a._.Id,ScopeType:"dummy-in",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});e.createEdge(t.source,a,i)}for(const t of s.outEdges)if(i.indexOf(t.target)>=0){const i=new I({ScopeName:t.target._.ScopeName,Id:a._.Id+"->"+t.target._.Id,ScopeType:"dummy-out",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});e.createEdge(a,t.target,i)}}n.forEach(t=>t.remove(!0))}}}}filterEmptySubgraphs(t){for(;;){const e=t.subgraphs.filter(t=>0===t.subgraphs.length&&0===t.vertices.length);if(0===e.length)break;e.forEach(t=>t.remove(!0))}}removeObsoleteSubgraphs(t){for(const e of[...t.subgraphs])0===e.vertices.length&&e.remove(!1)}graphData(){const t=this.graphDB.clone();return this.filterLegend(t),this.filterPartial(t),this.filterEmptySubgraphs(t),this.removeObsoleteSubgraphs(t),this.graphGui(t)}calcLegend(){const t=[];for(const e in this.kindMap)t.push({kind:parseInt(e),faChar:ie(e),label:this.kindMap[e][0]._.attr("Label").RawValue.split("\n")[0],count:this.kindMap[e].length});return t}vertices(t){const e=[];for(const i of this.kindMap[t])e.push(this.verticesMap[i._.Id]);return e}formatRow(t,e,i){const n=t._.formattedAttrs();for(const o in n){const t=e.indexOf(o);-1===t?(e.push(o),i.push(n[o])):i[t]=n[o]}for(let o=0;o<100;++o)void 0===i[o]&&(i[o]="");return i}activityData(){const t=["Id","Kind","Label"],e=this.graphDB.vertices.map(e=>{const i=[parseInt(e._.Id.split("a")[1])];return this.formatRow(e,t,i)});return{columns:t,data:e}}edgeData(){const t=["Id","Label"],e=this.graphDB.edges.map(e=>{const i=[e._.Id];return this.formatRow(e,t,i)});return{columns:t,data:e}}subgraphData(){const t=["Id","Label"],e=this.graphDB.subgraphs.map(e=>{const i=[e._.Id];return this.formatRow(e,t,i)});return{columns:t,data:e}}calcGraphTooltip(t){let e,i;if(t instanceof Bt){const n=this.rSubgraphsMap[t.id()];e=n._,i=n.parent._}else if(t instanceof Lt||t instanceof W){const n=this.rVerticesMap[t.id()];e=n._,i=n.parent._}else if(t instanceof Vt){const n=this.rEdgesMap[t.id()];e=n._,i=n.parent._}return e?e.calcTooltip(i):""}subgraph(t){return this.subgraphsMap[t]}vertex(t){return this.verticesMap[t]}edge(t){return this.edgesMap[t]}minClick(t){}};M(ne,"WUScopeController");let oe=ne;const ae=class _WUGraph extends Wt{_partialAll=(new q).faChar("fa-window-restore").tooltip("Partial All").on("click",()=>{this.stateClick(this._partialAll)});_maxAll=(new q).faChar("fa-window-maximize").tooltip("Max All").on("click",()=>{this.stateClick(this._maxAll)});_toggleGraph=(new G).faChar("fa-chain").tooltip("Graph").selected(!0).on("click",()=>{this.viewClick(this._toggleGraph)});_toggleActivities=(new G).faChar("fa-table").tooltip("Activitiies").selected(!1).on("click",()=>{this.viewClick(this._toggleActivities)});_toggleEdges=(new G).faChar("fa-table").tooltip("Edges").selected(!1).on("click",()=>{this.viewClick(this._toggleEdges)});_toggleSubgraphs=(new G).faChar("fa-table").tooltip("Subgraphs").selected(!1).on("click",()=>{this.viewClick(this._toggleSubgraphs)});_graph=(new Ht).layout("Hierarchy").applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1);_activities=(new Dt).pagination(!1);_edges=(new Dt).pagination(!1);_subgraphs=(new Dt).pagination(!1);_legend=new ee(this).on("click",t=>{this.render()}).on("mouseover",t=>{const e={};for(const i of this._gc.vertices(t))e[i.id()]=!0;this._graph.highlightVerticies(e)}).on("mouseout",t=>{this._graph.highlightVerticies()});_view=(new qt).widgets([this._graph,this._activities,this._edges,this._subgraphs]);_gc=new oe;constructor(){super(),this.topOverlay(!1),this.widget(this._view);const t=[this._toggleGraph,this._toggleActivities,this._toggleEdges,this._toggleSubgraphs,new U,this._partialAll,this._maxAll,new U,...this._graph.iconBarButtons(),new U];this.buttons(t.concat(this.buttons())),this._gc.minClick=t=>{this.loadGraph(),this._graph.render(e=>{this._graph.selection([t]).centerOnItem(t)})},this._graph.tooltipHTML(t=>this._gc.calcGraphTooltip(t))}stateClick(t){switch(t){case this._partialAll:this._graph.data().subgraphs.forEach(t=>{t.minState("partial")});break;case this._maxAll:this._graph.data().subgraphs.forEach(t=>{t.minState("normal")})}this.render()}viewClick(t){switch(this._toggleGraph.selected(t===this._toggleGraph),this._toggleActivities.selected(t===this._toggleActivities),this._toggleEdges.selected(t===this._toggleEdges),this._toggleSubgraphs.selected(t===this._toggleSubgraphs),t){case this._toggleGraph:this._view.active(0);break;case this._toggleActivities:this._view.active(1);break;case this._toggleEdges:this._view.active(2);break;case this._toggleSubgraphs:this._view.active(3)}this.render(t=>{})}_prevHashSum;_prevScopeGraph;fetchScopeGraph(){const t=O({baseUrl:this.baseUrl(),wuid:this.wuid(),graphID:this.graphID(),subgraphID:this.subgraphID()});if(!this._prevScopeGraph||this._prevHashSum!==t){this.startProgress(),this._prevHashSum=t,this._gc.clear();return T.attach({baseUrl:this.baseUrl()},this.wuid()).fetchGraphs().then(t=>{for(const e of t)if(e.Name===this.graphID())return this.finishProgress(),e.fetchScopeGraph(this.subgraphID())}).then(t=>(this._prevScopeGraph=t,this._prevScopeGraph))}return Promise.resolve(this._prevScopeGraph)}enter(t,e){super.enter(t,e)}update(t,e){super.update(t,e)}exit(t,e){super.exit(t,e)}loadGraph(){this._gc.disabled(this._legend.disabled()),this._graph.data(this._gc.graphData(),!0);{const{columns:t,data:e}=this._gc.activityData();this._activities.columns(t).data(e)}{const{columns:t,data:e}=this._gc.edgeData();this._edges.columns(t).data(e)}{const{columns:t,data:e}=this._gc.subgraphData();this._subgraphs.columns(t).data(e)}}render(t){return this.wuid()&&this.graphID()?this.fetchScopeGraph().then(e=>{this._gc.set(e),this._legend.data(this._gc.calcLegend()),this.loadGraph(),super.render(t)}):super.render(t),this}selection(t){if(!arguments.length)return this._graph.selection();const e=this._gc.vertex(t)||this._gc.edge(t)||this._gc.subgraph(t);return e&&this._graph.selection([e]),this}};M(ae,"WUGraph");let se=ae;function re(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function le(t){switch(Object.prototype.toString.call(t)){case"[object Undefined]":case"[object Boolean]":case"[object Number]":return t;case"[object String]":return re(t);default:console.warn("Unknown cell type: "+Object.prototype.toString.call(t))}return t}se.prototype._class+=" eclwatch_WUGraph",se.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),se.prototype.publish("wuid","","string","Workunit ID"),se.prototype.publish("graphID","","string","Graph ID"),se.prototype.publish("subgraphID","","string","Subgraph ID"),M(re,"entitiesEncode"),M(le,"safeEncode");const he=class _Store{wuResult;schema;_columns;_cache={};rowFormatter;_filter={};onError;constructor(t,e,i,n={},o){this.wuResult=t,this.schema=e,this._columns=this.schema2Columns(this.schema.root),this.rowFormatter=new Rt(this._columns,i),this._filter=n,this.onError=o}columns(){return this._columns}schema2Columns(t,e=""){return t?t.children().filter(t=>-1===t.name.indexOf("__hidden",t.name.length-8)).map((t,i)=>{const n=t.name,o=t.attrs["hpcc:keyed"],a={field:e+n,leafID:n,idx:i,label:n+(o?" (i)":""),className:"resultGridCell",hidden:!1,sortable:!1,width:o?16:0,isSet:t.isSet},s=this.schema2Columns(t,e+n+"_");return s.length?(a.width+=10+s.reduce((t,e)=>t+e.width,0),a.children=s):(a.width+=9*t.charWidth(),a.formatter=(t,e)=>{switch(typeof t){case"string":return{html:t.replace(/\t/g," ").trim()};case"undefined":return""}return t}),a}):[]}isChildDataset(t){if("[object Object]"!==Object.prototype.toString.call(t))return!1;let e=0,i=null;for(const n in t)i||(i=Object.prototype.toString.call(t[n])),e++;return 1===e&&"[object Array]"===i}rowToTable(t,e,i){if(this.isChildDataset(t)){for(const n in t)this.rowToTable(t[n],e,i);return}const n=zt.create("table",{border:1,cellspacing:0,width:"100%"},i);switch(Object.prototype.toString.call(t)){case"[object Object]":let o=zt.create("tr",null,n);for(const e in t)zt.create("th",{innerHTML:le(e)},o);o=zt.create("tr",null,n);for(const n in t)switch(Object.prototype.toString.call(t[n])){case"[object Object]":case"[object Array]":this.rowToTable(t[n],e,i);break;default:zt.create("td",{innerHTML:le(t[n])},o)}break;case"[object Array]":for(let e=0;e<t.length;++e)switch(Object.prototype.toString.call(t[e])){case"[object Boolean]":case"[object Number]":case"[object String]":const i=zt.create("tr",null,n);zt.create("td",{innerHTML:le(t[e])},i);break;default:if(0===e){const i=zt.create("tr",null,n);for(const n in t[e])zt.create("th",{innerHTML:le(n)},i)}zt.create("tr",null,n);for(const n in t[e])if(t[e][n])if("[object Object]"===Object.prototype.toString.call(t[e][n])||"[object Array]"===Object.prototype.toString.call(t[e][n])){const o=zt.create("td",null,i);this.rowToTable(t[e][n],t[e],o)}else if(-1!==n.indexOf("__html",n.length-6))zt.create("td",{innerHTML:t[e][n]},i);else if(-1!==n.indexOf("__javascript",n.length-12))zt.create("td",null,i);else{const o=t[e][n];zt.create("td",{innerHTML:le(o)},i)}else zt.create("td",{innerHTML:""},i)}}}getIdentity(t){return t.__hpcc_id}_request(t,e){if(!this.wuResult)return Promise.resolve({totalLength:0,data:[]});const i=`${t}->${e}`;if(this._cache[i])return this._cache[i];const n=this.wuResult.fetchRows(t,e-t,!1,this._filter).then(e=>({totalLength:this.wuResult.Total,data:e.map((e,i)=>{const n=this.rowFormatter.format(e);return n.__hpcc_id=t+i,n.__hpcc_orig=e,n})})).catch(t=>(this.onError(t.Message||"An exception has occurred"),{totalLength:0,data:[]}));return this._cache[i]=n,n}fetchRange(t){const e=new Ot;return this._request(t.start,t.end).then(t=>e.resolve(t)),new jt(e.then(t=>t.data),{totalLength:e.then(t=>t.totalLength)})}};M(he,"Store");let ce=he;const ue=class _WUResult extends Nt{_result;_localStore;constructor(){super(),this.renderHtml(!1)}hashSum(t={}){return O({baseUrl:this.baseUrl(),wuid:this.wuid(),resultName:this.resultName(),sequence:this.sequence(),nodeGroup:this.nodeGroup(),logicalFile:this.logicalFile(),userID:this.user(),password:this.password(),bypassCache:this.bypassCache(),...t})}_prevResultHash;calcResult(){const t=this.hashSum();if(this._prevResultHash!==t){this._prevResultHash=t;const e={baseUrl:this.baseUrl(),userID:this.user(),password:this.password()};this.wuid()&&this.resultName()?this._result=E.attach(e,this.wuid(),this.resultName()):this.wuid()&&void 0!==this.sequence()?this._result=E.attach(e,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=E.attachLogicalFile(e,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=E.attachLogicalFile(e,"",this.logicalFile())),this._result&&this.bypassCache()&&this._result.bypassCache(this.bypassCache())}return this._result}fetch(t,e,i=new AbortController){const n=this.calcResult();return n?n.fetchRows(t,e,!1,{},i.signal):Promise.resolve([])}_prevStoreHash;_prevQueryHash;update(t,e){super.update(t,e);const i=this.hashSum({renderHtml:this.renderHtml(),filter:this.filter()});if(this._prevStoreHash!==i){this._prevStoreHash=i;const t=this.calcResult();t&&t.fetchXMLSchema().then(e=>{this._localStore=new ce(t,e,this.renderHtml(),this.filter(),t=>{this._dgrid&&(this._dgrid.noDataMessage=`<span class='dojoxGridNoData'>${t}</span>`,this._dgrid.refresh())}),this._dgrid?.set("columns",this._localStore.columns()),this._dgrid?.set("collection",this._localStore)})}}click(t,e,i){}};M(ue,"WUResult");let pe=ue;pe.prototype._class+=" eclwatch_WUResult",pe.prototype.publish("baseUrl","","string","URL to WsWorkunits"),pe.prototype.publish("user","","string","User ID"),pe.prototype.publish("password","","string","Password"),pe.prototype.publish("wuid","","string","Workunit ID"),pe.prototype.publish("resultName","","string","Result Name"),pe.prototype.publish("sequence",void 0,"number","Sequence Number"),pe.prototype.publish("nodeGroup","","string","NodeGroup"),pe.prototype.publish("logicalFile","","string","Logical File Name"),pe.prototype.publish("filter",{},"object","Filter"),pe.prototype.publish("bypassCache",!1,"boolean","Bypass cached results");var de=/* @__PURE__ */(t=>(t.CREATE="Created",t.COMPILE="Compiled",t.EXECUTE="Executed",t.COMPLETE="Completed",t))(de||{}),fe=/* @__PURE__ */(t=>(t.CREATE="Creating",t.COMPILE="Compiling",t.EXECUTE="Executing",t.COMPLETE="Completed",t))(fe||{});const ye=class _WUStatus extends Ht{_wu;_wuHandle;_create;_compile;_execute;_complete;constructor(){super(),this.zoomable(!1).zoomToFitLimit(1).layout("Hierarchy").hierarchyRankDirection("LR").showToolbar(!1).allowDragging(!1)}_prevHash;attachWorkunit(){const t=O({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==t&&(this._prevHash=t,this._wu=T.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch(t=>{this.lazyRender()}))}createVertex(t){return(new Lt).icon_diameter(32).icon_shape_colorFill("none").icon_shape_colorStroke("none").icon_image_colorFill("darkgray").iconAnchor("middle").textbox_shape_colorFill("none").textbox_shape_colorStroke("none").textbox_text_colorFill("darkgray").faChar(t)}updateVertex(t,e){t.icon_image_colorFill(e).textbox_text_colorFill(e)}updateVertexStatus(t,e=!1){const i=this._wu.isFailed()?"darkred":"darkgreen";switch(this._create.text("Created"),this._compile.text("Compiled"),this._execute.text("Executed"),this._complete.text("Completed"),t){case 0:this.updateVertex(this._create,"darkgray"),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 1:this._create.text("Creating"),this.updateVertex(this._create,e?"orange":i),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 2:this._compile.text("Compiling"),this.updateVertex(this._create,i),this.updateVertex(this._compile,e?"orange":i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,"darkgray");break;case 3:this._execute.text("Executing"),this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,e?"orange":i),this.updateVertex(this._complete,"darkgray");break;case 4:this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,i)}}createEdge(t,e){return(new Vt).sourceVertex(t).targetVertex(e).strokeColor("black").showArc(!1)}enter(t,e){super.enter(t,e),this._create=this.createVertex(""),this._compile=this.createVertex(""),this._execute=this.createVertex(""),this._complete=this.createVertex("");const i=this.createEdge(this._create,this._compile),n=this.createEdge(this._compile,this._execute),o=this.createEdge(this._execute,this._complete);this.data({vertices:[this._create,this._compile,this._execute,this._complete],edges:[i,n,o]})}update(t,e){switch(this.attachWorkunit(),this._wu.StateID){case F.Blocked:case F.Wait:case F.Scheduled:case F.UploadingFiled:this.updateVertexStatus(1);break;case F.Compiling:this.updateVertexStatus(2,!0);break;case F.Submitted:this.updateVertexStatus(1,!0);break;case F.Compiled:this.updateVertexStatus(2);break;case F.Aborting:case F.Running:this.updateVertexStatus(3,!0);break;case F.Aborted:case F.Archived:case F.Completed:this.updateVertexStatus(4);break;case F.Failed:this.updateVertexStatus(4,!1);break;case F.DebugPaused:case F.DebugRunning:case F.Paused:case F.Unknown:default:this.updateVertexStatus(0)}super.update(t,e),this.zoomToFit()}exit(t,e){this._wuHandle&&this._wuHandle.release(),super.exit(t,e)}};M(ye,"WUStatus");let _e=ye;_e.prototype._class+=" eclwatch_WUStatus",_e.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),_e.prototype.publish("wuid","","string","Workunit ID");var xe=Object.defineProperty,me=/* @__PURE__ */M((t,e)=>xe(t,"name",{value:e,configurable:!0}),"o");function ge(){}function be(){}function ve(){}function we(){}function Se(t){return"function"==typeof t.highlightColumn}function ke(){}function Ae(){}function Ce(){let t=h,e=c,i=u,n=C(document.body),o=w(),a=null,s=null,r=null;const l=/* @__PURE__ */me(function(t){if(a=S(t),!a)return;s=a.createSVGPoint();const e=n();e&&o&&e.appendChild(o)},"tip2");function h(){return"n"}function c(){return[0,0]}function u(){return" "}M(h,"h"),M(c,"y"),M(u,"d"),l.show=function(t,o,a){r=a[o];const s=Array.prototype.slice.call(arguments),h=i.apply(this,s);if(null===h)return l;const c=e.apply(this,s),u=k();let f,y=d.length;const _=n().getBoundingClientRect();for(u.html(h).style("opacity",1).style("pointer-events","all");y--;)u.classed(d[y],!1);let x=!1;const m={};let g=d[0];for(let e=0;e<d.length&&(x=w(d[e]),!x);e++);if(x)u.classed("notick",!1);else{u.classed("notick",!0);const t=v(m[g]),e=b(m[g]);w(g,t,e)}return l;function b(t){return t.left>t.right?t.left>0?-t.left:0:t.right>0?t.right:0}function v(t){return t.top>t.bottom?t.top>0?-t.top:0:t.bottom}function w(t,e,i){e=e||0,i=i||0,u.style("white-space","nowrap"),f=p.get(t).apply(this),u.classed(t,!0).style("top",f.top+c[0]-e+"px").style("left",f.left+c[1]-i+"px");const n=u.node().getBoundingClientRect(),o=n.top>_.top&&n.left>_.left&&n.bottom<_.bottom&&n.right<_.right;return m[t]={top:_.top-n.top,right:n.right-_.right,bottom:n.bottom-_.bottom,left:_.left-n.left},u.style("white-space","normal"),m[t].total_overflow=Object.keys(m[t]).filter(e=>m[t][e]>0).reduce((e,i)=>e+m[t][i],0),m[g].total_overflow>m[t].total_overflow&&(g=t),o||u.classed(t,!1),o}},l.hide=function(){return k().style("opacity",0).style("pointer-events","none"),l},l.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return k().attr(t);const i=Array.prototype.slice.call(arguments);return J.prototype.attr.apply(k(),i),l},l.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return k().style(t);const i=Array.prototype.slice.call(arguments);return J.prototype.style.apply(k(),i),l},l.direction=function(e){return arguments.length?(t=null==e?e:C(e),l):t},l.offset=function(t){return arguments.length?(e=null==t?t:C(t),l):e},l.html=function(t){return arguments.length?(i=null==t?t:C(t),l):i},l.rootElement=function(t){return arguments.length?(n=C(t),l):n},l.destroy=function(){return o&&(k().remove(),o=null),l},me(h,"d3TipDirection"),me(c,"d3TipOffset"),me(u,"d3TipHTML");const p=K({n:f,s:y,e:_,w:x,nw:m,ne:g,sw:b,se:v}),d=p.keys();function f(){const t=A(window);return{top:t.n.y-o.offsetHeight,left:t.n.x-o.offsetWidth/2}}function y(){const t=A(window);return{top:t.s.y+8,left:t.s.x-o.offsetWidth/2}}function _(){const t=A(window);return{top:t.e.y-o.offsetHeight/2,left:t.e.x+8}}function x(){const t=A(window);return{top:t.w.y-o.offsetHeight/2,left:t.w.x-o.offsetWidth-8}}function m(){const t=A(window);return{top:t.nw.y-o.offsetHeight,left:t.nw.x-o.offsetWidth}}function g(){const t=A(window);return{top:t.ne.y-o.offsetHeight,left:t.ne.x}}function b(){const t=A(window);return{top:t.sw.y,left:t.sw.x-o.offsetWidth}}function v(){const t=A(window);return{top:t.se.y,left:t.se.x}}function w(){const t=$(document.createElement("div"));return t.attr("class","d3-tip").style("position","absolute").style("top","0px").style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function S(t){const e=t.node();return e?"svg"===e.tagName.toLowerCase()?e:e.ownerSVGElement:null}function k(){return null==o&&(o=w(),n().appendChild(o)),$(o)}function A(t){let e=r||t;for(;null==e.getCTM&&null!=e.parentNode;)e=e.parentNode;const i={},n=e.getCTM(),o=e.getBBox(),a=o.width,l=o.height,h=o.x,c=o.y;return s.x=h,s.y=c,i.nw=s.matrixTransform(n),s.x+=a,i.ne=s.matrixTransform(n),s.y+=l,i.se=s.matrixTransform(n),s.x-=a,i.sw=s.matrixTransform(n),s.y-=l/2,i.w=s.matrixTransform(n),s.x+=a,i.e=s.matrixTransform(n),s.x-=a/2,s.y-=l/2,i.n=s.matrixTransform(n),s.y+=l,i.s=s.matrixTransform(n),i}function C(t){return"function"==typeof t?t:function(){return t}}return M(f,"g"),M(y,"v"),M(_,"x"),M(x,"w"),M(m,"C"),M(g,"_"),M(b,"k"),M(v,"F"),M(w,"E"),M(S,"T"),M(k,"V"),M(A,"S"),M(C,"I"),me(f,"directionNorth"),me(y,"directionSouth"),me(_,"directionEast"),me(x,"directionWest"),me(m,"directionNorthWest"),me(g,"directionNorthEast"),me(b,"directionSouthWest"),me(v,"directionSouthEast"),me(w,"initNode"),me(S,"getSVGNode"),me(k,"getNodeEl"),me(A,"getScreenBBox"),me(C,"functor"),l}function Me(){if(this.tooltip=Ce(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=Z(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=Z(this.tooltipValueFormat())),this.layerEnter){const t=this.layerEnter;this.layerEnter=function(e,i,n){this._parentOverlay||(this._parentOverlay=e._parentOverlay),this.tooltipEnter(i),t.apply(this,arguments)};const e=this.layerUpdate;this.layerUpdate=function(t){e.apply(this,arguments),this.tooltipUpdate()};const i=this.layerExit;this.layerExit=function(t){this.tooltipExit(),i.apply(this,arguments)}}else{const t=this.enter;this.enter=function(e,i){this.tooltipEnter(i),t.apply(this,arguments)};const e=this.update;this.update=function(t,i){e.apply(this,arguments),this.tooltipUpdate()};const i=this.exit;this.exit=function(t,e){this.tooltipExit(),i.apply(this,arguments)}}}M(ge,"f"),M(be,"h"),M(ve,"y"),M(we,"d"),M(Se,"b"),M(ke,"m"),M(Ae,"g"),M(Ce,"v"),M(Me,"x"),me(ge,"I1DChart"),ge.prototype._dataFamily="1D",ge.prototype._palette=X.rainbow("default"),ge.prototype.click=function(t,e,i){},ge.prototype.dblclick=function(t,e,i){},me(be,"I2DChart"),be.prototype._dataFamily="2D",be.prototype._palette=X.ordinal("default"),be.prototype.fillColor=function(t,e,i,n){return this._palette(t[0])},be.prototype.strokeColor=function(t,e,i,n){return Y(this.fillColor(t,e,i,n)).darker().toString()},be.prototype.textColor=function(t,e,i,n){return X.textColor(this.fillColor(t,e,i,n))},be.prototype.click=function(t,e,i){},be.prototype.dblclick=function(t,e,i){},me(ve,"I2DAggrChart"),ve.prototype._palette=X.rainbow("default"),ve.prototype.fillColor=function(t,e,i){return this._palette(t.length)},ve.prototype.strokeColor=function(t,e,i){return Y(this.fillColor(t,e,i)).darker().toString()},ve.prototype.textColor=function(t,e,i){return X.textColor(this.fillColor(t,e,i))},ve.prototype.click=function(t,e,i){},ve.prototype.dblclick=function(t,e,i){},me(we,"IGraph"),we.prototype._dataFamily="graph",we.prototype.vertex_click=function(t,e,i,n){n&&n.vertex},we.prototype.vertex_dblclick=function(t,e,i,n){n&&n.vertex},we.prototype.edge_click=function(t,e,i,n){n&&n.edge},we.prototype.edge_dblclick=function(t,e,i,n){n&&n.edge},me(Se,"instanceOfIHighlight"),me(ke,"IInput"),ke.prototype=Object.create(Q.prototype),ke.prototype.constructor=ke,ke.prototype.isValid=function(){return!(this.validate()&&!new RegExp(this.validate()).test(this.value()))},ke.prototype.hasValue=function(){if("function"==typeof this.type){switch(this.type()){case"radio":case"checkbox":if(this.value()&&"false"!==this.value())return!0;break;default:if(this.value())return!0}return!1}return""!==this.value()},ke.prototype.blur=function(t){},ke.prototype.keyup=function(t){},ke.prototype.focus=function(t){},ke.prototype.click=function(t){},ke.prototype.dblclick=function(t){},ke.prototype.change=function(t,e){},ke.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},ke.prototype.disable=function(t){this._inputElement.forEach(function(e,i){e.attr("disabled",t?"disabled":null)})},ke.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},ke.prototype.publish("name","","string","HTML name for the input"),ke.prototype.publish("label","","string","Descriptive label"),ke.prototype.publish("value","","string","Input Current Value"),ke.prototype.publish("validate",null,"string","Input Validation"),me(Ae,"INDChart"),Ae.prototype._dataFamily="ND",Ae.prototype._palette=X.ordinal("default"),Ae.prototype.fillColor=function(t,e,i,n){return this._palette(e)},Ae.prototype.strokeColor=function(t,e,i,n){return Y(this.fillColor(t,e,i,n)).darker().toString()},Ae.prototype.textColor=function(t,e,i,n){return X.textColor(this.fillColor(t,e,i,n))},Ae.prototype.click=function(t,e,i){},Ae.prototype.dblclick=function(t,e,i){},me(Ce,"tip"),me(Me,"ITooltip"),Me.prototype=Object.create(Q.prototype),Me.prototype.constructor=Me,Me.prototype.tooltipEnter=function(t){const e=this.parentOverlay();e.empty()||this.tooltip.rootElement(e.node().parentNode),t.call(this.tooltip)},Me.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){const t=document.querySelector(".d3-tip");return t.style.display="block",t.style.left=this.tooltipOffset()+event.clientX+"px",t.style.top=event.clientY+"px",[]}return"e"===this.tooltip.direction()()?[0,this.tooltipOffset()]:[-this.tooltipOffset(),0]});let t=this.tooltip.attr("class");t&&(t=t.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":""),t=t.split(" ").filter(function(t){return 0!==t.indexOf("ITooltip-tooltipStyle-")}).join(" "),t+=" ITooltip-tooltipStyle-"+this.tooltipStyle(),this.tooltip.attr("class",t))},Me.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},Me.prototype._tooltipHTML=function(t){return t},Me.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},Me.prototype.tooltipFormat=function(t={}){switch(t.label=void 0===t.label?"":t.label,this._labelFormatter?t.label=this._labelFormatter(t.label)||"":this.formatData&&this.parseData&&(t.label=this.formatData(this.parseData(t.label))),t.series=t.series||"",t.value instanceof Date?t.value=t.value||"":this._valueFormatter?t.value=this._valueFormatter(t.value)||"":this.formatValue&&this.parseValue&&(t.value=this.formatValue(this.parseValue(t.value))),this.tooltipStyle()){case"none":break;case"series-table":let e='<table class="ITooltip-series-table"><thead><tr><th colspan="2">'+t.label+"</th></tr></thead><tbody>";return t.arr.forEach(function(t){e+="<tr>",e+="<td>",e+='<div class="series-table-row-color" style="background-color:'+t.color+'"></div>',e+='<div class="series-table-row-label">'+t.label+"</div>",e+="</td>",e+='<td><div class="series-table-row-value">'+t.value+"</div></td>",e+="</tr>"}),e+="</tbody>",e+="</table>",e;default:return t.series?"<span style='color:"+this.tooltipSeriesColor()+"'>"+t.series+"</span> / <span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":""!==t.label?"<span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":"<span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>"}},Me.prototype.tooltipKeyValueFormat=function(t,e){let i="";for(const n in e)if(n!==t){const t=e&&e[n]?e[n]:"";i+=`<tr><td style="${this.tooltipLabelColor_exists()?"color:"+this.tooltipLabelColor():""}">${n}</td><td style="font-weight:normal">${t}</td></tr>`}return`<table>\n <thead>\n <tr><th colspan="2" style="font-weight:bold;font-size:16px">${e[t]}</th></tr>\n </thead>\n <tbody>\n ${i}\n </tbody>\n </table>`},Me.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{}),Me.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{}),Me.prototype.publish("tooltipLabelFormat",void 0,"string","Format of tooltip label(s) (the domain axis)",null,{}),Me.prototype.publish("tooltipValueFormat",void 0,"string","Number format of tooltip value(s)",null,{}),Me.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{}),Me.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text (the domain axis)",null,{}),Me.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{}),Me.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),Me.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});const Pe=Me.prototype.tooltipLabelFormat;Me.prototype.tooltipLabelFormat=function(t){const e=Pe.apply(this,arguments);return arguments.length&&(this._labelFormatter=Z(t)),e};const Te=Me.prototype.tooltipValueFormat;function Ie(){}M(Ie,"_"),Me.prototype.tooltipValueFormat=function(t){const e=Te.apply(this,arguments);return arguments.length&&(this._valueFormatter=Z(t)),e},me(Ie,"ITree"),Ie.prototype.constructor=Ie,Ie.prototype.click=function(t,e,i){},Ie.prototype.dblclick=function(t,e,i){},Ie.prototype._palette=X.ordinal("default"),function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('.d3-tip{line-height:1;font-weight:700;padding:12px;background:#000000a8;color:#fff;border-radius:2px;pointer-events:none!important;z-index:10}.d3-tip.hidden{visibility:hidden}.d3-tip:after{content:" ";box-sizing:border-box;display:inline-block;border:4px solid rgba(0,0,0,.66);position:absolute;pointer-events:none!important;width:8px;height:8px;margin:0}.d3-tip.n:after{top:100%;left:calc(50% - 4px);border-top-width:8px;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.e:after{top:calc(50% - 4px);left:-12px;border-top-color:transparent;border-right-width:8px;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.s{margin-top:8px}.d3-tip.s:after{top:-12px;left:calc(50% - 4px);border-top-color:transparent;border-right-color:transparent;border-bottom-width:8px;border-left-color:transparent}.d3-tip.w:after{top:calc(50% - 4px);left:100%;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-width:8px}.d3-tip.notick:after{border-color:transparent!important}.common_Widget .over{stroke:#000000a8;opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table th,.d3-tip .ITooltip-series-table td{padding:6px;text-align:left;border:1px solid #D1D1D1}.d3-tip .ITooltip-series-table .series-table-row-color{display:inline-block;height:10px;width:10px;margin-right:10px}.d3-tip .ITooltip-series-table .series-table-row-label{display:inline-block}.d3-tip .ITooltip-series-table th{background-color:#b3b3b3}.d3-tip .ITooltip-series-table td{background-color:#fff;color:#555;font-weight:400}.d3-tip .ITooltip-series-table td:first-child{border-right:0}table.ITooltip-series-table td:last-child{border-left:1px dotted #A3A3A3}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();var Ee=Object.defineProperty,Fe=/* @__PURE__ */M((t,e)=>Ee(t,"name",{value:e,configurable:!0}),"e"),De=/* @__PURE__ */M((t,e,i)=>{return a=i,(o=e+"")in(n=t)?Ee(n,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[o]=a;var n,o,a},"i"),Re=Math.PI,ze=2*Re,Oe=1e-6,je=ze-Oe;function Ne(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Le(){return new Ne}function Be(t){return Fe(function(){return t},"constant")}M(Ne,"et"),M(Le,"it"),M(Be,"nt"),Fe(Ne,"Path"),Fe(Le,"path"),Ne.prototype=Le.prototype={constructor:Ne,moveTo:/* @__PURE__ */Fe(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:/* @__PURE__ */Fe(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:/* @__PURE__ */Fe(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:/* @__PURE__ */Fe(function(t,e,i,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+n)},"quadraticCurveTo"),bezierCurveTo:/* @__PURE__ */Fe(function(t,e,i,n,o,a){this._+="C"+ +t+","+ +e+","+ +i+","+ +n+","+(this._x1=+o)+","+(this._y1=+a)},"bezierCurveTo"),arcTo:/* @__PURE__ */Fe(function(t,e,i,n,o){t=+t,e=+e,i=+i,n=+n,o=+o;var a=this._x1,s=this._y1,r=i-t,l=n-e,h=a-t,c=s-e,u=h*h+c*c;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(u>Oe)if(Math.abs(c*r-l*h)>Oe&&o){var p=i-a,d=n-s,f=r*r+l*l,y=p*p+d*d,_=Math.sqrt(f),x=Math.sqrt(u),m=o*Math.tan((Re-Math.acos((f+u-y)/(2*_*x)))/2),g=m/x,b=m/_;Math.abs(g-1)>Oe&&(this._+="L"+(t+g*h)+","+(e+g*c)),this._+="A"+o+","+o+",0,0,"+ +(c*p>h*d)+","+(this._x1=t+b*r)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},"arcTo"),arc:/* @__PURE__ */Fe(function(t,e,i,n,o,a){t=+t,e=+e,a=!!a;var s=(i=+i)*Math.cos(n),r=i*Math.sin(n),l=t+s,h=e+r,c=1^a,u=a?n-o:o-n;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>Oe||Math.abs(this._y1-h)>Oe)&&(this._+="L"+l+","+h),i&&(u<0&&(u=u%ze+ze),u>je?this._+="A"+i+","+i+",0,1,"+c+","+(t-s)+","+(e-r)+"A"+i+","+i+",0,1,"+c+","+(this._x1=l)+","+(this._y1=h):u>Oe&&(this._+="A"+i+","+i+",0,"+ +(u>=Re)+","+c+","+(this._x1=t+i*Math.cos(o))+","+(this._y1=e+i*Math.sin(o))))},"arc"),rect:/* @__PURE__ */Fe(function(t,e,i,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},"rect"),toString:/* @__PURE__ */Fe(function(){return this._},"toString")},Fe(Be,"constant$3");var Ve=Math.abs,He=Math.atan2,$e=Math.cos,We=Math.max,qe=Math.min,Ge=Math.sin,Ue=Math.sqrt,Xe=1e-12,Ye=Math.PI,Qe=Ye/2,Ze=2*Ye;function Je(t){return t>1?0:t<-1?Ye:Math.acos(t)}function Ke(t){return t>=1?Qe:t<=-1?-Qe:Math.asin(t)}function ti(t){return t.innerRadius}function ei(t){return t.outerRadius}function ii(t){return t.startAngle}function ni(t){return t.endAngle}function oi(t){return t&&t.padAngle}function ai(t,e,i,n,o,a,s,r){var l=i-t,h=n-e,c=s-o,u=r-a,p=u*l-c*h;if(!(p*p<Xe))return[t+(p=(c*(e-a)-u*(t-o))/p)*l,e+p*h]}function si(t,e,i,n,o,a,s){var r=t-i,l=e-n,h=(s?a:-a)/Ue(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-a,w=p*y-f*d,S=(g<0?-1:1)*Ue(We(0,v*v*b-w*w)),k=(w*g-m*S)/b,A=(-w*m-g*S)/b,C=(w*g+m*S)/b,M=(-w*m+g*S)/b,P=k-_,T=A-x,I=C-_,E=M-x;return P*P+T*T>I*I+E*E&&(k=C,A=M),{cx:k,cy:A,x01:-c,y01:-u,x11:k*(o/v-1),y11:A*(o/v-1)}}function ri(){var t=ti,e=ei,i=Be(0),n=null,o=ii,a=ni,s=oi,r=null;function l(){var l,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),p=o.apply(this,arguments)-Qe,d=a.apply(this,arguments)-Qe,f=Ve(d-p),y=d>p;if(r||(r=l=Le()),u<c&&(h=u,u=c,c=h),u>Xe)if(f>Ze-Xe)r.moveTo(u*$e(p),u*Ge(p)),r.arc(0,0,u,p,d,!y),c>Xe&&(r.moveTo(c*$e(d),c*Ge(d)),r.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,k=s.apply(this,arguments)/2,A=k>Xe&&(n?+n.apply(this,arguments):Ue(c*c+u*u)),C=qe(Ve(u-c)/2,+i.apply(this,arguments)),M=C,P=C;if(A>Xe){var T=Ke(A/c*Ge(k)),I=Ke(A/u*Ge(k));(w-=2*T)>Xe?(b+=T*=y?1:-1,v-=T):(w=0,b=v=(p+d)/2),(S-=2*I)>Xe?(m+=I*=y?1:-1,g-=I):(S=0,m=g=(p+d)/2)}var E=u*$e(m),F=u*Ge(m),D=c*$e(v),R=c*Ge(v);if(C>Xe){var z,O=u*$e(g),j=u*Ge(g),N=c*$e(b),L=c*Ge(b);if(f<Ye&&(z=ai(E,F,N,L,O,j,D,R))){var B=E-z[0],V=F-z[1],H=O-z[0],$=j-z[1],W=1/Ge(Je((B*H+V*$)/(Ue(B*B+V*V)*Ue(H*H+$*$)))/2),q=Ue(z[0]*z[0]+z[1]*z[1]);M=qe(C,(c-q)/(W-1)),P=qe(C,(u-q)/(W+1))}}S>Xe?P>Xe?(_=si(N,L,E,F,u,P,y),x=si(O,j,D,R,u,P,y),r.moveTo(_.cx+_.x01,_.cy+_.y01),P<C?r.arc(_.cx,_.cy,P,He(_.y01,_.x01),He(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,P,He(_.y01,_.x01),He(_.y11,_.x11),!y),r.arc(0,0,u,He(_.cy+_.y11,_.cx+_.x11),He(x.cy+x.y11,x.cx+x.x11),!y),r.arc(x.cx,x.cy,P,He(x.y11,x.x11),He(x.y01,x.x01),!y))):(r.moveTo(E,F),r.arc(0,0,u,m,g,!y)):r.moveTo(E,F),c>Xe&&w>Xe?M>Xe?(_=si(D,R,O,j,c,-M,y),x=si(E,F,N,L,c,-M,y),r.lineTo(_.cx+_.x01,_.cy+_.y01),M<C?r.arc(_.cx,_.cy,M,He(_.y01,_.x01),He(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,M,He(_.y01,_.x01),He(_.y11,_.x11),!y),r.arc(0,0,c,He(_.cy+_.y11,_.cx+_.x11),He(x.cy+x.y11,x.cx+x.x11),y),r.arc(x.cx,x.cy,M,He(x.y11,x.x11),He(x.y01,x.x01),!y))):r.arc(0,0,c,v,b,y):r.lineTo(D,R)}else r.moveTo(0,0);if(r.closePath(),l)return r=null,l+""||null}return M(l,"h"),Fe(l,"arc"),l.centroid=function(){var i=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Ye/2;return[$e(n)*i,Ge(n)*i]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Be(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Be(+t),l):e},l.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:Be(+t),l):i},l.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Be(+t),l):n},l.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:Be(+t),l):o},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Be(+t),l):a},l.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Be(+t),l):s},l.context=function(t){return arguments.length?(r=null==t?null:t,l):r},l}function li(t){this._context=t}function hi(t){return new li(t)}function ci(t){return t[0]}function ui(t){return t[1]}function pi(){var t=ci,e=ui,i=Be(!0),n=null,o=hi,a=null;function s(s){var r,l,h,c=s.length,u=!1;for(null==n&&(a=o(h=Le())),r=0;r<=c;++r)!(r<c&&i(l=s[r],r,s))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+t(l,r,s),+e(l,r,s));if(h)return a=null,h+""||null}return M(s,"r"),Fe(s,"line"),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Be(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Be(+t),s):e},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:Be(!!t),s):i},s.curve=function(t){return arguments.length?(o=t,null!=n&&(a=o(n)),s):o},s.context=function(t){return arguments.length?(null==t?n=a=null:a=o(n=t),s):n},s}function di(){var t=ci,e=null,i=Be(0),n=ui,o=Be(!0),a=null,s=hi,r=null;function l(l){var h,c,u,p,d,f=l.length,y=!1,_=new Array(f),x=new Array(f);for(null==a&&(r=s(d=Le())),h=0;h<=f;++h){if(!(h<f&&o(p=l[h],h,l))===y)if(y=!y)c=h,r.areaStart(),r.lineStart();else{for(r.lineEnd(),r.lineStart(),u=h-1;u>=c;--u)r.point(_[u],x[u]);r.lineEnd(),r.areaEnd()}y&&(_[h]=+t(p,h,l),x[h]=+i(p,h,l),r.point(e?+e(p,h,l):_[h],n?+n(p,h,l):x[h]))}if(d)return r=null,d+""||null}function h(){return pi().defined(o).curve(s).context(a)}return M(l,"h"),M(h,"c"),Fe(l,"area"),Fe(h,"arealine"),l.x=function(i){return arguments.length?(t="function"==typeof i?i:Be(+i),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Be(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:Be(+t),l):e},l.y=function(t){return arguments.length?(i="function"==typeof t?t:Be(+t),n=null,l):i},l.y0=function(t){return arguments.length?(i="function"==typeof t?t:Be(+t),l):i},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Be(+t),l):n},l.lineX0=l.lineY0=function(){return h().x(t).y(i)},l.lineY1=function(){return h().x(t).y(n)},l.lineX1=function(){return h().x(e).y(i)},l.defined=function(t){return arguments.length?(o="function"==typeof t?t:Be(!!t),l):o},l.curve=function(t){return arguments.length?(s=t,null!=a&&(r=s(a)),l):s},l.context=function(t){return arguments.length?(null==t?a=r=null:r=s(a=t),l):a},l}function fi(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function yi(t){return t}function _i(){var t=yi,e=fi,i=null,n=Be(0),o=Be(Ze),a=Be(0);function s(s){var r,l,h,c,u,p=s.length,d=0,f=new Array(p),y=new Array(p),_=+n.apply(this,arguments),x=Math.min(Ze,Math.max(-Ze,o.apply(this,arguments)-_)),m=Math.min(Math.abs(x)/p,a.apply(this,arguments)),g=m*(x<0?-1:1);for(r=0;r<p;++r)(u=y[f[r]=r]=+t(s[r],r,s))>0&&(d+=u);for(null!=e?f.sort(function(t,i){return e(y[t],y[i])}):null!=i&&f.sort(function(t,e){return i(s[t],s[e])}),r=0,h=d?(x-p*g)/d:0;r<p;++r,_=c)l=f[r],c=_+((u=y[l])>0?u*h:0)+g,y[l]={data:s[l],index:r,value:u,startAngle:_,endAngle:c,padAngle:m};return y}return M(s,"r"),Fe(s,"pie"),s.value=function(e){return arguments.length?(t="function"==typeof e?e:Be(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,i=null,s):e},s.sort=function(t){return arguments.length?(i=t,e=null,s):i},s.startAngle=function(t){return arguments.length?(n="function"==typeof t?t:Be(+t),s):n},s.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Be(+t),s):o},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Be(+t),s):a},s}function xi(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function mi(t){this._context=t}function gi(t){return new mi(t)}function bi(t,e){this._basis=new mi(t),this._beta=e}M(Je,"yt"),M(Ke,"_t"),M(ti,"xt"),M(ei,"mt"),M(ii,"gt"),M(ni,"bt"),M(oi,"vt"),M(ai,"wt"),M(si,"St"),M(ri,"At"),M(li,"kt"),M(hi,"Mt"),M(ci,"Pt"),M(ui,"Tt"),M(pi,"Ct"),M(di,"zt"),M(fi,"Ft"),M(yi,"It"),M(_i,"Et"),M(xi,"Rt"),M(mi,"Dt"),M(gi,"Ot"),M(bi,"jt"),Fe(Je,"acos"),Fe(Ke,"asin$1"),Fe(ti,"arcInnerRadius$1"),Fe(ei,"arcOuterRadius$1"),Fe(ii,"arcStartAngle$1"),Fe(ni,"arcEndAngle$1"),Fe(oi,"arcPadAngle$1"),Fe(ai,"intersect$1"),Fe(si,"cornerTangents$1"),Fe(ri,"d3Arc"),Fe(li,"Linear$1"),li.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},Fe(hi,"d3CurveLinear"),Fe(ci,"x$1"),Fe(ui,"y$1"),Fe(pi,"d3Line"),Fe(di,"d3Area"),Fe(fi,"descending"),Fe(yi,"identity$2"),Fe(_i,"d3Pie"),Fe(xi,"point$7"),Fe(mi,"Basis$1"),mi.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 3:xi(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:xi(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},Fe(gi,"d3CurveBasis"),Fe(bi,"Bundle$1"),bi.prototype={lineStart:/* @__PURE__ */Fe(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],a=e[0],s=t[i]-o,r=e[i]-a,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*s),this._beta*e[l]+(1-this._beta)*(a+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){this._x.push(+t),this._y.push(+e)},"point")};const vi=/* @__PURE__ */Fe(/* @__PURE__ */M(function t(e){function i(t){return 1===e?new mi(t):new bi(t,e)}return M(i,"n"),Fe(i,"bundle"),i.beta=function(e){return t(+e)},i},"t"),"custom")(.85);function wi(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function Si(t,e){this._context=t,this._k=(1-e)/6}M(wi,"Lt"),M(Si,"Bt"),Fe(wi,"point$6"),Fe(Si,"Cardinal$1"),Si.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:wi(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:wi(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const ki=/* @__PURE__ */Fe(/* @__PURE__ */M(function t(e){function i(t){return new Si(t,e)}return M(i,"n"),Fe(i,"cardinal"),i.tension=function(e){return t(+e)},i},"t"),"custom")(0);function Ai(t,e,i){var n=t._x1,o=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Xe){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Xe){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*h+t._x1*t._l23_2a-e*t._l12_2a)/c,s=(s*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,a,s,t._x2,t._y2)}function Ci(t,e){this._context=t,this._alpha=e}M(Ai,"Ht"),M(Ci,"Vt"),Fe(Ai,"point$5"),Fe(Ci,"CatmullRom$1"),Ci.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Ai(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const Mi=/* @__PURE__ */Fe(/* @__PURE__ */M(function t(e){function i(t){return e?new Ci(t,e):new Si(t,0)}return M(i,"n"),Fe(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"t"),"custom")(.5);function Pi(t){return t<0?-1:1}function Ti(t,e,i){var n=t._x1-t._x0,o=e-t._x1,a=(t._y1-t._y0)/(n||o<0&&-0),s=(i-t._y1)/(o||n<0&&-0),r=(a*o+s*n)/(n+o);return(Pi(a)+Pi(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(r))||0}function Ii(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Ei(t,e,i){var n=t._x0,o=t._y0,a=t._x1,s=t._y1,r=(a-n)/3;t._context.bezierCurveTo(n+r,o+r*e,a-r,s-r*i,a,s)}function Fi(t){this._context=t}function Di(t){return new Fi(t)}function Ri(t){this._context=t}function zi(t){var e,i,n=t.length-1,o=new Array(n),a=new Array(n),s=new Array(n);for(o[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,a[e]=4,s[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,a[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)i=o[e]/a[e-1],a[e]-=i,s[e]-=i*s[e-1];for(o[n-1]=s[n-1]/a[n-1],e=n-2;e>=0;--e)o[e]=(s[e]-o[e+1])/a[e];for(a[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-o[e+1];return[o,a]}function Oi(t){return new Ri(t)}function ji(t,e){this._context=t,this._t=e}function Ni(t){return new ji(t,.5)}function Li(t){return new ji(t,0)}function Bi(t){return new ji(t,1)}M(Pi,"Wt"),M(Ti,"Gt"),M(Ii,"Xt"),M(Ei,"Yt"),M(Fi,"Ut"),M(Di,"Qt"),M(Ri,"Zt"),M(zi,"Jt"),M(Oi,"Kt"),M(ji,"te"),M(Ni,"ee"),M(Li,"ie"),M(Bi,"ne"),Fe(Pi,"sign$1"),Fe(Ti,"slope3$1"),Fe(Ii,"slope2$1"),Fe(Ei,"point$4"),Fe(Fi,"MonotoneX$1"),Fi.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ei(this,this._t0,Ii(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Ei(this,Ii(this,i=Ti(this,t,e)),i);break;default:Ei(this,this._t0,i=Ti(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(Fi.prototype).point=function(t,e){Fi.prototype.point.call(this,e,t)},Fe(Di,"monotoneX"),Fe(Ri,"Natural"),Ri.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x=[],this._y=[]},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){var t=this._x,e=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===i)this._context.lineTo(t[1],e[1]);else for(var n=zi(t),o=zi(e),a=0,s=1;s<i;++a,++s)this._context.bezierCurveTo(n[0][a],o[0][a],n[1][a],o[1][a],t[s],e[s]);(this._line||0!==this._line&&1===i)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},Fe(zi,"controlPoints"),Fe(Oi,"d3CurveNatural"),Fe(ji,"Step$1"),ji.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x=this._y=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,e)}}this._x=t,this._y=e},"point")},Fe(Ni,"d3CurveStep"),Fe(Li,"stepBefore"),Fe(Bi,"stepAfter");var Vi=Array.prototype.slice;function Hi(t){return t}M(Hi,"ae"),Fe(Hi,"identity$1");var $i=1e-6;function Wi(t){return"translate("+(t+.5)+",0)"}function qi(t){return"translate(0,"+(t+.5)+")"}function Gi(t){return function(e){return+t(e)}}function Ui(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(i){return+t(i)+e}}function Xi(){return!this.__axis}function Yi(t,e){var i=[],n=null,o=null,a=6,s=6,r=3,l=1===t||4===t?-1:1,h=4===t||2===t?"x":"y",c=1===t||3===t?Wi:qi;function u(u){var p=null==n?e.ticks?e.ticks.apply(e,i):e.domain():n,d=null==o?e.tickFormat?e.tickFormat.apply(e,i):Hi:o,f=Math.max(a,0)+r,y=e.range(),_=+y[0]+.5,x=+y[y.length-1]+.5,m=(e.bandwidth?Ui:Gi)(e.copy()),g=u.selection?u.selection():u,b=g.selectAll(".domain").data([null]),v=g.selectAll(".tick").data(p,e).order(),w=v.exit(),S=v.enter().append("g").attr("class","tick"),k=v.select("line"),A=v.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),v=v.merge(S),k=k.merge(S.append("line").attr("stroke","currentColor").attr(h+"2",l*a)),A=A.merge(S.append("text").attr("fill","currentColor").attr(h,l*f).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),u!==g&&(b=b.transition(u),v=v.transition(u),k=k.transition(u),A=A.transition(u),w=w.transition(u).attr("opacity",$i).attr("transform",function(t){return isFinite(t=m(t))?c(t):this.getAttribute("transform")}),S.attr("opacity",$i).attr("transform",function(t){var e=this.parentNode.__axis;return c(e&&isFinite(e=e(t))?e:m(t))})),w.remove(),b.attr("d",4===t||2==t?s?"M"+l*s+","+_+"H0.5V"+x+"H"+l*s:"M0.5,"+_+"V"+x:s?"M"+_+","+l*s+"V0.5H"+x+"V"+l*s:"M"+_+",0.5H"+x),v.attr("opacity",1).attr("transform",function(t){return c(m(t))}),k.attr(h+"2",l*a),A.attr(h,l*f).text(d),g.filter(Xi).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),g.each(function(){this.__axis=m})}return M(u,"p"),Fe(u,"axis"),u.scale=function(t){return arguments.length?(e=t,u):e},u.ticks=function(){return i=Vi.call(arguments),u},u.tickArguments=function(t){return arguments.length?(i=null==t?[]:Vi.call(t),u):i.slice()},u.tickValues=function(t){return arguments.length?(n=null==t?null:Vi.call(t),u):n&&n.slice()},u.tickFormat=function(t){return arguments.length?(o=t,u):o},u.tickSize=function(t){return arguments.length?(a=s=+t,u):a},u.tickSizeInner=function(t){return arguments.length?(a=+t,u):a},u.tickSizeOuter=function(t){return arguments.length?(s=+t,u):s},u.tickPadding=function(t){return arguments.length?(r=+t,u):r},u}function Qi(t){return Yi(1,t)}function Zi(t){return Yi(2,t)}function Ji(t){return Yi(3,t)}function Ki(t){return Yi(4,t)}M(Wi,"re"),M(qi,"le"),M(Gi,"he"),M(Ui,"ce"),M(Xi,"ue"),M(Yi,"pe"),M(Qi,"de"),M(Zi,"fe"),M(Ji,"ye"),M(Ki,"_e"),Fe(Wi,"translateX"),Fe(qi,"translateY"),Fe(Gi,"number"),Fe(Ui,"center"),Fe(Xi,"entering"),Fe(Yi,"axis"),Fe(Qi,"axisTop"),Fe(Zi,"axisRight"),Fe(Ji,"axisBottom"),Fe(Ki,"axisLeft");const tn=(t=class extends et{_origType;_origTimePattern;parser;parserInvert;formatter;d3Scale;d3Axis;d3Guides;_guideElement;svg;svgAxis;svgGuides;_tickFormatFunc;constructor(t="origin"){super(),this._drawStartPos=t,this.updateScale()}lowValue(){return this.parse(this.low())}highValue(){return this.parse(this.high())}parse(t,e){if(t instanceof Array)return t.map(function(t){return this.parse(t)},this);if(null!=t){if(this.parser)return this.parser("number"==typeof t?t.toString():t);if(e&&"string"==typeof t)return+t}return t}parseInvert(t){return t instanceof Array?t.map(function(t){return this.parseInvert(t)},this):this.parserInvert&&t?this.parserInvert(t):t}format(t){return t instanceof Array?t.map(function(t){return this.format(t)},this):null!=t&&this.formatter?this.formatter(t):t}parseFormat(t){return this.format(this.parse(t))}tickFormatFunc(t){return arguments.length?(this._tickFormatFunc=t,this.updateScale(),this):this._tickFormatFunc}scalePos(t){let e=this.d3Scale(this.parse(t));return"ordinal"===this.type()&&(e+=this.bandwidth()/2),e}bandwidth(){return this.d3Scale.bandwidth?this.d3Scale.bandwidth():0}isHorizontal(){switch(this.orientation()){case"left":case"right":return!1}return!0}domain(t){return arguments.length?(this.d3Scale.domain(t),this):this.d3Scale.domain()}range(t){if(!arguments.length){if(this.d3Scale.rangeRoundBands)return this.d3Scale.rangeExtent();if(this.d3Scale.rangeRound)return this.d3Scale.range()}return this.d3Scale.rangeRoundBands?this.d3Scale.rangeRoundBands(t,.1):this.d3Scale.rangeRound&&this.d3Scale.range(t),this}invert(t){return this.d3Scale.invert(t)}guideTarget(t){return this._guideElement=$(t).attr("class",this._class),this}enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgAxis=this.svg.append("g").attr("class","axis"),this.svgGuides=(this._guideElement||e).append("g").attr("class","guide")}_prevOrientation;updateScale(){switch(this.type()){case"ordinal":if(this.d3Scale=lt().paddingInner(this.ordinalPaddingInner()).paddingOuter(this.ordinalPaddingOuter()),this.ordinals_exists()&&this.d3Scale.domain(this.ordinals()),this.parser=null,this.ordinalMappings_exists()){const t=this.ordinalMappings();this.formatter=e=>t[e]||e}else this.formatter=null;break;case"linear":this.d3Scale=rt(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?Z(this.tickFormat()):null;break;case"pow":this.d3Scale=st().exponent(this.powExponent()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?Z(this.tickFormat()):null;break;case"log":this.d3Scale=at().base(this.logBase()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?Z(this.tickFormat()):null;break;case"time":this.d3Scale=it(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=this.timePattern_exists()?nt(this.timePattern()):null,this.parserInvert=this.timePattern_exists()?ot(this.timePattern()):null,this._tickFormatFunc?this.formatter=this._tickFormatFunc:this.formatter=this.tickFormat_exists()?ot(this.tickFormat()):null}if(this._prevOrientation!==this.orientation()){switch(this.orientation()){case"left":this.d3Axis=Ki(this.d3Scale),this.d3Guides=Ki(this.d3Scale);break;case"top":this.d3Axis=Qi(this.d3Scale),this.d3Guides=Qi(this.d3Scale);break;case"right":this.d3Axis=Zi(this.d3Scale),this.d3Guides=Zi(this.d3Scale);break;default:this.d3Axis=Ji(this.d3Scale),this.d3Guides=Ji(this.d3Scale)}this._prevOrientation=this.orientation(),this.svgAxis&&this.svgAxis.html(""),this.svgGuides&&this.svgGuides.html("")}if(this.extend())if("ordinal"===this.type());else{let t,e,i,n,o,a;this.isHorizontal()?(t=this.width(),this.d3Scale.range([0,t]),e=t*this.extend()/100,i=this.d3Scale.invert(0),o=this.d3Scale.invert(-e),n=this.d3Scale.invert(t),a=this.d3Scale.invert(t+e)):(t=this.height(),this.d3Scale.range([t,0]),e=t*this.extend()/100,i=this.d3Scale.invert(t),o=this.d3Scale.invert(t+e),n=this.d3Scale.invert(0),a=this.d3Scale.invert(-e)),o===i&&(o=i-i*this.extend()/100),a===n&&(a=n+n*this.extend()/100),Math.sign(i)!==Math.sign(o)&&(o=0),Math.sign(n)!==Math.sign(a)&&(a=0),this.d3Scale.domain([o,a])}this.d3Axis.scale(this.d3Scale).tickFormat(this.formatter).ticks(this.tickCount()),this.d3Guides.scale(this.d3Scale).tickSize(this.tickLength_exists()?-this.tickLength():0).tickFormat("").ticks(this.tickCount());const t=this.ticks();return t.length&&(this.d3Axis.tickValues(t.map(t=>this.parse(t.value))).tickFormat((e,i)=>t[i].label),this.d3Guides.tickValues(t.map(t=>this.parse(t.value)))),this}adjustText(t,e){const i=this.isHorizontal(),n="left"===this.orientation(),o="bottom"===this.orientation(),a=this,s=t.selectAll(".tick > text").style("font-family",this.fontFamily()).style("font-size",this.fontSize_exists()?this.fontSize()+"px":null);if("linebreak"===this.overlapMode())"ordinal"===this.type()&&s.call(function(){return a.linebreak.apply(a,arguments)},this.bandwidth());else if("wrap"===this.overlapMode())"ordinal"===this.type()&&s.call(function(){return a.wrap.apply(a,arguments)},this.bandwidth());else switch(i?this.overlapMode():"none"){case"stagger":s.style("text-anchor","middle").attr("dy",function(t,i){return(o?1:-1)*((o?.71:0)+i%e)+"em"}).attr("dx",0).attr("visibility",null).attr("transform","rotate(0)");break;case"hide":s.style("text-anchor","middle").attr("dy",(o?.71:0)+"em").attr("dx",0).attr("visibility",function(t,i){return i%e?"hidden":null}).attr("transform","rotate(0)");break;case"rotate":const t=-this.labelRotation()||0;if(0!==t&&e>1){s.each(function(){const e=$(this),i=e.node().getBBox(),n=(o?1:-1)*Math.sin(Math.PI*(-Math.abs(t)/180));e.style("text-anchor",t>0?o?"start":"end":o?"end":"start").attr("dy",i.height/2*n+"px").attr("dx",t>0?o?"0.71em":"-0.71em":o?"-0.71em":"0.71em").attr("transform","rotate("+t+")").attr("visibility",null)});break}default:s.style("text-anchor",i?"middle":n?"end":"start").attr("dy",i?(o?.71:0)+"em":"0.32em").attr("dx",0).attr("visibility",null).attr("transform","rotate(0)")}}calcTickOverlapModulus(t){let e=1;switch(this.overlapMode()){case"rotate":case"stagger":case"hide":const i=[];t.selectAll(".tick > text").each(function(){const t=this.getBoundingClientRect();for(let n=i.length-1;n>=0&&!(i[n].right<t.left);--n)i.length+1-n>e&&(e=i.length+1-n);i.push(t)})}return e}calcOverflow(t,e){if(this.updateScale(),this.hidden())return{left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:1};const i=this.isHorizontal();this.range(i?[0,this.width()]:[this.height(),0]);const n=t.append("g").attr("class",this.classID()),o=n.append("g");o.attr("class",i?"x":"y").call(this.d3Axis),e&&t.selectAll(".tick > text").remove();const a={left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:this.calcTickOverlapModulus(o)};this.adjustText(o,a.tickOverlapModulus);const s=o.node().getBBox();switch(a.depth=i?s.height:s.width,this.shrinkToFit()){case"low":case"both":a.left=i?-s.x:0,a.bottom=i?0:-(this.height()-(s.height+s.y))}switch(this.shrinkToFit()){case"high":case"both":a.top=i?0:-s.y,a.right=i?-(this.width()-s.x-s.width):0}return n.remove(),a}wrap(t,e,i){i=i||/\s+/;const n=this;t.each(function(){const t=$(this),o=t.text().split(i).reverse();let a=[],s=0;const r=t.attr("x"),l=t.attr("y"),h=parseFloat(t.style("font-size"))||10,c=Math.floor(e/(1.1*h))-1,u=n.isHorizontal()?1:Math.ceil(o.length/c),p=parseFloat(t.attr("dy"));let d=t.text(null).append("tspan").attr("x",r).attr("y",l).attr("dy",p+"em"),f=0,y=o.pop();for(;y;)a.push(y),d.text(a.join(" ")),f++,d.node().getComputedTextLength()>e&&f>=u&&(a.pop(),d.text(a.join(" ")),a=[y],d=t.append("tspan").attr("x",r).attr("y",l).attr("dy",1.1*++s+p+"em").text(y),f=0),y=o.pop();n.isHorizontal()||t.selectAll("tspan").attr("y",-s/2+"em")})}linebreak(t,e){this.wrap(t,e,"\n")}update(t,e){super.update(t,e),this.svg.style("display",this.hidden()?"none":null);const i=this.calcOverflow(e),n=this.isHorizontal()?i.left:this.height()-i.top-i.bottom,o=this.isHorizontal()?this.width()-i.right-this.padding():0+this.padding();this.range(this.reverse()?[o,n]:[n,o]);const a=this;function s(t){t.attr("transform",function(){switch(a.orientation()){case"left":return"translate("+i.depth+", "+i.top+")";case"top":return"translate(0,"+i.depth+")";case"right":return"translate("+(a.width()-i.depth)+", "+i.top+")";case"bottom":return"translate(0,"+(a.height()-i.depth)+")"}return"translate(0,0)"})}M(s,"r"),Fe(s,"doPosition"),this.svg.style("visibility","none"===this.type()?"hidden":null).transition().call(s),this._guideElement&&this.svgGuides.transition().call(s),this.svgAxis.call(this.d3Axis),this.adjustText(this.svgAxis,i.tickOverlapModulus),this.pos().x;const r=this.width(),l=this.svgAxis.selectAll(".axisTitle").data(this.title()?[this.title()]:[]),h=l.enter().append("text").attr("class","axisTitle").merge(l).transition().attr("dx",null).style("text-anchor","end");switch(this.orientation()){case"left":h.attr("transform","rotate(-90)").attr("x",-2).attr("y",2).attr("dy",".71em");break;case"right":h.attr("transform","rotate(-90)").attr("x",-2).attr("y",4).attr("dx",null).attr("dy","-.71em");break;case"top":h.attr("transform","rotate(0)").attr("x",r-2).attr("y",2).attr("dx",null).attr("dy",".71em");break;case"bottom":h.attr("transform","rotate(0)").attr("x",r-2).attr("y",-2).attr("dy",null)}h.text(this.title_exists()?this.title():""),l.exit().remove(),this.svgGuides.call(this.d3Guides).selectAll(".tick").classed("guide-0",t=>0===t&&this.low()<0)}rerender(){this.svgAxis.call(this.d3Axis),this.svgGuides.call(this.d3Guides)}postUpdate(t,e){super.postUpdate(t,e),this._guideElement&&this._guideElement.attr("transform",this._element.attr("transform"))}},M(t,"_Axis"),t);Fe(tn,"Axis");let en=tn;en.prototype._class+=" chart_Axis",en.prototype.publish("type","linear","set","Type",["none","ordinal","linear","pow","log","time"]),en.prototype.publish("timePattern","%Y-%m-%d","string","Time Series Pattern",null,{disable:/* @__PURE__ */Fe(t=>"time"!==t.type(),"disable")}),en.prototype.publish("reverse",!1,"boolean","Reverse"),en.prototype.publish("title",null,"string","Title"),en.prototype.publish("orientation","bottom","set","Placement/orientation of the axis",["left","top","right","bottom"]),en.prototype.publish("powExponent",2,"number","Power exponent (disabled when type is not 'pow')",null,{disable:/* @__PURE__ */Fe(t=>"pow"!==t.type(),"disable")}),en.prototype.publish("logBase",10,"number","Logarithmic base (disabled when type is not 'log')",null,{disable:/* @__PURE__ */Fe(t=>"log"!==t.type(),"disable")}),en.prototype.publish("ordinals",[],"array","Array of ordinal values to display (disabled when type is not 'ordinal')",null,{disable:/* @__PURE__ */Fe(t=>"ordinal"!==t.type(),"disable")}),en.prototype.publish("fontSize",null,"number","Size of tick label font (pixels)",null,{optional:!0}),en.prototype.publish("fontFamily",null,"string","Font family of tick labels",null,{optional:!0}),en.prototype.publish("tickCount",null,"number","Number of ticks to display (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.type(),"disable")}),en.prototype.publish("tickFormat",null,"string","Format rules for tick text (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.type(),"disable")}),en.prototype.publish("tickLength",null,"number","Height (or width for left/right orientations) of the axis ticks (in pixels)",null,{optional:!0}),en.prototype.publish("ticks",[],"array","Custom tick labels",null,{optional:!0}),en.prototype.publish("low",null,"any","Minimum tick value (disabled when type is ordinal)",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.type(),"disable")}),en.prototype.publish("high",null,"any","Maximum tick value (disabled when type is ordinal)",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.type(),"disable")}),en.prototype.publish("overlapMode","none","set","Specifies the behavior when tick labels overlap",["none","stagger","hide","rotate","linebreak","wrap"]),en.prototype.publish("labelRotation",33,"number","Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"rotate"!==t.overlapMode(),"disable")}),en.prototype.publish("shrinkToFit","both","set","shrinkToFit",["none","low","high","both"]),en.prototype.publish("extend",5,"number","Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.type(),"disable")}),en.prototype.publish("hidden",!1,"boolean","Hides axis when 'true'"),en.prototype.publish("ordinalPaddingInner",.1,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)",null,{disable:/* @__PURE__ */Fe(t=>"ordinal"!==t.type(),"disable")}),en.prototype.publish("ordinalPaddingOuter",.1,"number","Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)",null,{disable:/* @__PURE__ */Fe(t=>"ordinal"!==t.type(),"disable")}),en.prototype.publish("ordinalMappings",null,"object","Alternative label mappings (icons)",null,{optional:!0}),en.prototype.publish("padding",0,"number","Padding space at top of axis (pixels)",null,{optional:!0}),en.prototype._origType=en.prototype.type,en.prototype.type=function(t){const e=en.prototype._origType.apply(this,arguments);return void 0!==t&&(this._type=t,this.updateScale()),e},en.prototype._origTimePattern=en.prototype.timePattern,en.prototype.timePattern=function(t){const e=en.prototype._origTimePattern.apply(this,arguments);return void 0!==t&&(this._timePattern=t,this.updateScale()),e};const nn=(M(e=class extends et{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),tt.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.domainAxis=(new en).classed({domain:!0}).orientation_default("bottom").type("ordinal").overlapMode_default("stagger").shrinkToFit_default("high").extend_default(0),this.valueAxis=(new en).classed({value:!0}).orientation_default("left").type("linear").shrinkToFit_default("high"),this.xyBrush=ht().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.xBrush=ct().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.yBrush=ut().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2())}_prevBrush;resetSelection(){return this._prevBrush=null,this}parseData(t){return this.domainAxis.parse(t)}parseValue(t){return this.valueAxis.parse(t,!0)}formatData(t){return this.domainAxis.format(t)}formatValue(t){return this.valueAxis.format(t)}parsedData(){return this.data().map(function(t){let e=0;return t.map(function(t,i){if(0===i)return this.parseData(t);if(i>=this.columns().length)return t;const n=this.yAxisStacked()?[e,e+this.parseValue(t)]:this.parseValue(t);return e+=this.parseValue(t),n},this)},this)}bandwidth(){return this.domainAxis.bandwidth()}svg;svgRegions;svgDomainGuide;svgValueGuide;svgData;svgDataClipRect;svgFocus;svgBrush;enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgRegions=e.append("g"),this.svgDomainGuide=this.svg.append("g"),this.svgValueGuide=this.svg.append("g"),this.svgData=this.svg.append("g"),this.svgDataClipRect=this.svg.append("clipPath").attr("id",this.id()+"_clippath").append("rect").attr("x",0).attr("y",0),this.svgData=this.svg.append("g").attr("clip-path","url(#"+this.id()+"_clippath)"),this._selection.widgetElement(this.svgData),this.svgFocus=e.append("g"),this.domainAxis.target(this.svg.node()).guideTarget(this.svgDomainGuide.node()),this.valueAxis.target(this.svg.node()).guideTarget(this.svgValueGuide.node()),this.svgBrush=e.append("g").attr("class","brush"),this.chartsEnter(this,this.svgData,250)}resizeBrushHandle(t,e,i){let n,o,a;return"e"===t.type||"w"===t.type?(n=+("e"===t.type),o=n?1:-1,a=i/3,"M"+.5*o+","+a+"A6,6 0 0 "+n+" "+6.5*o+","+(a+6)+"V"+(2*a-6)+"A6,6 0 0 "+n+" "+.5*o+","+2*a+"ZM"+2.5*o+","+(a+8)+"V"+(2*a-8)+"M"+4.5*o+","+(a+8)+"V"+(2*a-8)):(n=+("s"===t.type),a=n?1:-1,o=e/3,"M"+o+", "+.5*a+"A6,6 0 0 "+(n+1)%2+" "+(o+6)+","+6.5*a+"H"+(2*o-6)+"A6,6 0 0 "+(n+1)%2+" "+2*o+","+.5*a+"ZM"+(o+8)+","+2.5*a+"H"+(2*o-8)+"M"+(o+8)+","+4.5*a+"H"+(2*o-8))}_skipSelection=!1;skipSelection(t){return arguments.length?(this._skipSelection=t,this):this._skipSelection}brushMoved(){if(this._skipSelection)return;let t=[];const e=this,i=pt(this.svgBrush.node());i&&(t=this.data().filter(function(t){const n=e.dataPos(t[0]);if(e.use2dSelection()){const o=e.valuePos(t[1])+e.valueAxis.bandwidth()/2;return n>=i[0][0]&&n<=i[1][0]&&o>=i[0][1]&&o<=i[1][1]}return n>=i[0]&&n<=i[1]})),this.selection(t)}brushMoved2(){const t="horizontal"===this.orientation(),e=this.use2dSelection()?[]:t?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],i=this.svgBrush.selectAll(".handle--custom").data(e),n=dt()?.selection;null==n?i.attr("display","none"):t?i.attr("display",null).attr("transform",(t,e)=>"translate("+n[e]+",0)"):i.attr("display",null).attr("transform",(t,e)=>"translate(0, "+n[e]+")")}dataPos(t){return this.domainAxis.scalePos(t)}valuePos(t){return this.valueAxis.scalePos(t)}getAxisSize(t){return{width:this.xAxis?this.xAxis.width():t.xAxis.width(),height:this.yAxis?this.yAxis.height():t.yAxis.width()}}calcMargin(t,e,i){const n={top:!i&&this.selectionMode()?10:2,right:i&&(this.selectionMode()||this.xAxisFocus())?10:2,bottom:(this.xAxisFocus()?this.xAxisFocusHeight():0)+2,left:2},o=this.width()-n.left-n.right,a=this.height()-n.top-n.bottom;let s=0,r=30,l=0,h=30;for(let c=0;c<10;++c){this.xAxis.width(o-h).height(0);const t=this.xAxis.calcOverflow(e),i=t.depth;this.yAxis.width(0).height(a-r);const n=this.yAxis.calcOverflow(e),c=n.depth;if(s=t.right,l=n.top,i===r&&c===h)break;r=i,h=c}return this.xAxis.x(o/2+h/2+n.left).y(a+n.top).width(o-h),this.yAxis.x(n.left).y(a/2-r/2+n.top).height(a-r),n.left+=h,n.top+=l,n.right+=s,n.bottom+=r,n}updateRegions(t,e,i){const n=this,o=this.svgRegions.selectAll(".region").data(this.regions());o.enter().append("rect").attr("class","region"),i?o.attr("x",function(t){return n.dataPos(t.x0)}).attr("y",0).attr("width",function(t){return n.dataPos(t.x1)-n.dataPos(t.x0)}).attr("height",this.height()).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return Y(n._palette(t.colorID)).brighter()}):o.attr("x",0).attr("y",function(t){return n.dataPos(t.x0)}).attr("width",this.width()).attr("height",function(t){return n.dataPos(t.x0)-n.dataPos(t.x1)}).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return Y(n._palette(t.colorID)).brighter()}),o.exit().remove()}_prevXAxisType;update(t,e){this.selectionGlow(!this.tabNavigation()),super.update(t,e);const i=this,n="horizontal"===this.orientation();if(this.updateRegions(t,e,n),this.domainAxis.orientation(n?"bottom":"left").title(this.xAxisTitle_exists()?this.xAxisTitle():this.columns()[0]),this.valueAxis.orientation(n?"left":"bottom"),this.xAxis=n?this.domainAxis:this.valueAxis,this.yAxis=n?this.valueAxis:this.domainAxis,"ordinal"===this.xAxisType()){const t=this.columns().length,e={};this.domainAxis.ordinals(this.data().map(function(n){return e[n[0]]=i.xAxisOrdinalMapping(n,n[t]),n[0]})).ordinalMappings(e)}else{const t=this.xAxisDomainLow()?this.xAxisDomainLow():this.domainAxis.parseInvert(ft(this.parsedData(),function(t){return t[0]})),e=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert(yt(this.parsedData(),function(t){return t[0]}));void 0!==t&&void 0!==e&&this.domainAxis.low(t).high(e)}const o=this.yAxisDomainLow()?this.yAxisDomainLow():this.valueAxis.parseInvert(ft(this.parsedData(),function(t){return ft(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[0]:t})})),a=this.yAxisDomainHigh()?this.yAxisDomainHigh():this.valueAxis.parseInvert(yt(this.parsedData(),function(t){return yt(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[1]:t})}));this.valueAxis.low(o).high(a),this.margin=this.calcMargin(t,e,n);let s=this.width()-this.margin.left-this.margin.right;s<0&&(s=0);let r=this.height()-this.margin.top-this.margin.bottom;r<0&&(r=0);const l=n?s:r,h=n?r:s;if(this.domainAxis.tickLength(this.xAxisGuideLines()?h:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?l:0).render(),this.svgDataClipRect.attr("width",s).attr("height",r),this.svgData.transition().attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.updateBrush(s,r,l,n),this.updateFocusChart(t,e,this.margin,s,r,n),this.chartsUpdate(s,r,250),this.selectionMode())return this.brushMoved()}updateBrush(t,e,i,n){const o=this.use2dSelection()?this.xyBrush:n?this.xBrush:this.yBrush,a=pt(this.svgBrush.node());o.extent([[0,0],[t,e]]),this.svgBrush.attr("transform","translate("+this.margin.left+", "+this.margin.top+")").style("display",this.selectionMode()?null:"none").call(o);const s=this.use2dSelection()?[]:n?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],r=this.svgBrush.selectAll(".handle--custom").data(s);if(r.enter().append("path").attr("class","handle--custom").merge(r).attr("cursor",n?"ew-resize":"ns-resize").attr("d",i=>this.resizeBrushHandle(i,t,e)),this.selectionMode()){if(this._prevXAxisType!==this.xAxisType()&&(this._prevXAxisType=this.xAxisType(),this._prevBrush=null),this._prevBrush){if(a){if(this._prevBrush.orientation!==this.orientation()){const t=a[0];a[0]=this._prevBrush.maxCurrExtent-a[1],a[1]=this._prevBrush.maxCurrExtent-t}const t=i/this._prevBrush.maxCurrExtent;1!==t&&this.svgBrush.transition().on("start",function(){o.on("end",null)}).call(o.move,[a[0]*t,a[1]*t]).on("end",()=>{o.on("end",()=>this.brushMoved())})}}else this.svgBrush.call(o.move,[0,i]);this._prevBrush={orientation:this.orientation(),maxCurrExtent:i}}}updateFocusChart(t,e,i,n,o,a){const s=this,r=this.svgFocus.selectAll("#"+this.id()+"_focusChart").data(this.xAxisFocus()?[!0]:[]);r.enter().append("g").attr("id",this.id()+"_focusChart").attr("class","focus").each(function(){s.focusChart=(new s.constructor).target(this),s.focusChart.xBrush.on("brush.focus",function(){s.syncAxis(n),s.chartsUpdate(n,o,0)}),s.focusChart.layers(s.layers().map(t=>new t.constructor))}).merge(r).each(function(){s.copyPropsTo(s.focusChart,["layers"]);let t=0;for(const e of s.layers())e.copyPropsTo(s.focusChart.layers()[t]),t++;s.focusChart.xAxisFocus(!1).selectionMode(!0).skipSelection(!0).orientation("horizontal").xAxisGuideLines(!1).xAxisDomainLow(null).xAxisDomainHigh(null).yAxisGuideLines(!1).x(s.width()/2).y(s.height()-s.xAxisFocusHeight()/2).width(s.width()).height(s.xAxisFocusHeight()).columns(s.columns()).data(s.data()).render(),s.syncAxis(n)}),r.exit().each(function(){s.focusChart&&(s.focusChart.target(null),delete s.focusChart)}).remove()}syncAxis(t){const e=pt(this.focusChart.svgBrush.node());if(e){if("ordinal"!==this.focusChart.xAxisType())this.xAxis.domain([this.focusChart.xAxis.invert(e[0]),this.focusChart.xAxis.invert(e[1])]);else{const i=(e[1]-e[0])/t;this.xAxis.range([-e[0]/i,(t-e[0])/i])}this.xAxis.rerender()}}layerColumns(t){const e=t.columns(),i=super.columns().filter(t=>t!==e[0]);return i.length?[e[0],...i]:e}layerColumnIndices(t){const e=t.columns();return this.layerColumns(t).map(t=>e.indexOf(t))}layerColumnIndex(t,e){return t.columns().indexOf(e)}layerData(t){if(1===arguments.length){const e=this.layerColumnIndices(t);return t.data().map(t=>{const i=e.map(e=>t[e]);return i.__hpcc_origRow=t,i})}throw new Error("Setting data on XYAxisLayer is not supported.")}layerEnter(t,e,i=250){}layerUpdate(t,e,i=250){}layerExit(t,e,i=250){}chartsEnter(t,e,i=250){this.layerEnter(this,e,i);for(const n of this.layers())n.__xyAxisElement=e.append("g").attr("class",n.class()),n.target(n.__xyAxisElement.node()).layerEnter(this,e,i)}chartsUpdate(t,e,i){this.layerUpdate(this,this.svgData,i);for(const n of this.layers())n.resize({width:t,height:e}).layerUpdate(this,n.__xyAxisElement,i)}exit(t,e){this.valueAxis.target(null),this.domainAxis.target(null),super.exit(t,e)}selection(t){const e=this;this._selection.widgetElement().selectAll(".selected,.deselected").each(function(i){const n=t.indexOf(i.origRow)>=0;$(this).classed("selected",n).classed("deselected",!n).attr("filter",e._selection.svgGlowID()&&n?`url(#${e._selection.svgGlowID()})`:null)});const i=t.map(t=>this.rowToObj(t));setTimeout(()=>{this.click(i,"",!0)},0)}xAxisOrdinalMapping(t,e){return t[0]}click(t,e,i){}_selection},"_XYAxis"),e);Fe(nn,"XYAxis");let on=nn;on.prototype._class+=" chart_XYAxis",on.prototype.mixin(tt.SimpleSelectionMixin),on.prototype.publish("orientation","horizontal","set","Selects orientation for the axis",["horizontal","vertical"]),on.prototype.publish("pointSizeColumn",null,"string","pointSizeColumn",null,{optional:!0}),on.prototype.publish("minPointSize",6,"number","minPointSize"),on.prototype.publish("maxPointSize",26,"number","maxPointSize"),on.prototype.publish("use2dSelection",!1,"boolean","2D Range Selector"),on.prototype.publish("selectionMode",!1,"boolean","Range Selector"),on.prototype.publishProxy("xAxisTitle","domainAxis","title"),on.prototype.publishProxy("xAxisTickCount","domainAxis","tickCount"),on.prototype.publishProxy("xAxisTickFormat","domainAxis","tickFormat"),on.prototype.publishProxy("xAxisTicks","domainAxis","ticks"),on.prototype.publishProxy("xAxisType","domainAxis","type"),on.prototype.publishProxy("xAxisTypeTimePattern","domainAxis","timePattern"),on.prototype.publish("xAxisDomainLow",null,"string","X-Axis Low",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.xAxisType(),"disable")}),on.prototype.publish("xAxisDomainHigh",null,"string","X-Axis High",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.xAxisType(),"disable")}),on.prototype.publishProxy("xAxisFontSize","domainAxis","fontSize"),on.prototype.publishProxy("xAxisFontFamily","domainAxis","fontFamily"),on.prototype.publishProxy("xAxisOrdinalPaddingInner","domainAxis","ordinalPaddingInner"),on.prototype.publishProxy("xAxisOrdinalPaddingOuter","domainAxis","ordinalPaddingOuter"),on.prototype.publishProxy("xAxisOverlapMode","domainAxis","overlapMode"),on.prototype.publishProxy("xAxisLabelRotation","domainAxis","labelRotation"),on.prototype.publishProxy("xAxisDomainPadding","domainAxis","extend"),on.prototype.publish("xAxisGuideLines",!1,"boolean","Y-Axis Guide Lines"),on.prototype.publish("xAxisFocus",!1,"boolean","X-Axis Focus",null,{disable:/* @__PURE__ */Fe(t=>"horizontal"!==t.orientation(),"disable")}),on.prototype.publish("xAxisFocusHeight",80,"number","X-Axis Focus Height",null,{disable:/* @__PURE__ */Fe(t=>!t.xAxisFocus(),"disable")}),on.prototype.publishProxy("xAxisHidden","domainAxis","hidden"),on.prototype.publishProxy("yAxisFontSize","valueAxis","fontSize"),on.prototype.publishProxy("yAxisFontFamily","valueAxis","fontFamily"),on.prototype.publishProxy("yAxisTitle","valueAxis","title"),on.prototype.publishProxy("yAxisTickCount","valueAxis","tickCount"),on.prototype.publishProxy("yAxisTickFormat","valueAxis","tickFormat"),on.prototype.publishProxy("yAxisTicks","valueAxis","ticks"),on.prototype.publishProxy("yAxisType","valueAxis","type"),on.prototype.publishProxy("yAxisTypeTimePattern","valueAxis","timePattern"),on.prototype.publishProxy("yAxisTypePowExponent","valueAxis","powExponent"),on.prototype.publishProxy("yAxisTypeLogBase","valueAxis","logBase"),on.prototype.publish("yAxisStacked",!1,"boolean","Stacked Chart",null,{tags:["Basic"],disable:/* @__PURE__ */Fe(t=>"ordinal"!==t.xAxisType()||t._class.indexOf("chart_Column")<0,"disable")}),on.prototype.publish("yAxisDomainLow",null,"string","Y-Axis Low",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.yAxisType(),"disable")}),on.prototype.publish("yAxisDomainHigh",null,"string","Y-Axis High",null,{optional:!0,disable:/* @__PURE__ */Fe(t=>"ordinal"===t.yAxisType(),"disable")}),on.prototype.publishProxy("yAxisDomainPadding","valueAxis","extend"),on.prototype.publish("yAxisGuideLines",!0,"boolean","Y-Axis Guide Lines"),on.prototype.publishProxy("yAxisHidden","valueAxis","hidden"),on.prototype.publish("regions",[],"array","Regions"),on.prototype.publish("layers",[],"widgetArray","Layers",null,{render:!1}),on.prototype.publishProxy("xAxisPadding","domainAxis","padding"),on.prototype.publishProxy("yAxisPadding","valueAxis","padding"),on.prototype.publish("tabNavigation",!1,"boolean","Enable or disable tab navigation");const an=(i=class extends on{constructor(){super(),Ae.call(this),Me.call(this),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}curve(){switch(this.interpolate()){case"linear":return hi;case"step":return Ni;case"step-before":return Li;case"step-after":return Bi;case"basis":return gi;case"bundle":return vi;case"cardinal":return ki;case"catmullRom":return Mi;case"natural":return Oi;default:return Di}}getScale(){switch(this.pointSizeScale()){case"linear":return rt();case"pow":return st().exponent(2);case"log":return at();case"sqrt":return _t()}}pointColor(t,e,i,n){return this.interpolate()&&this.pointDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}lineColor(t,e,i,n){return this.interpolateFill()&&this.interpolateDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}areaColor(t,e,i,n){return this.fillColor(t,e,i,n)}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(t){return"series-table"===n.tooltipStyle()?n.tooltipFormat({label:t.label,arr:n.columns().slice(1).map(function(e,i){return{label:e,color:n._palette(e),value:n.data()[t.rowIdx][i+1]}})}):n.tooltipFormat({label:t.label,series:t.column,value:t.value})})}_prevPointShape;layerUpdate(t,e,i=250){super.layerUpdate(t,e);const n="horizontal"===t.orientation(),o=n?this.height():this.width(),a=this;function s(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}let r,l,h;M(s,"r"),this.tabNavigation()&&t.parentRelativeDiv?t.parentRelativeDiv.attr("tabindex","0").attr("role","group").attr("aria-label",`${this.columns()[0]||"Chart"} data`):t.parentRelativeDiv&&t.parentRelativeDiv.attr("tabindex",null).attr("role",null).attr("aria-label",null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._prevPointShape!==this.pointShape()&&(e.selectAll(".data").remove(),this._prevPointShape=this.pointShape()),Fe(s,"mapShape"),this.pointSizeColumn_exists()&&(r=this.columns().indexOf(this.pointSizeColumn()),l=xt(this.data(),t=>t[r]),h=this.getScale().domain(l));const c=this.layerColumns(t),u=this.layerData(t),p=this.flattenData(c,u).map(function(t){return t.shape=s(a.pointShape()),t.column=c[t.colIdx],t.row=u[t.rowIdx],t.origRow=u[t.rowIdx].__hpcc_origRow,l?(t.size=h(t.row[r])*(a.maxPointSize()-a.minPointSize())+a.minPointSize(),t.column!==a.pointSizeColumn()&&t):(t.size=a.pointSize(),t)}).filter(t=>t),d=e.selectAll(".area").data(c.filter(function(t,e){return a.interpolate()&&a.interpolateFill()&&e>0})),f=d.enter().append("path"),y=di().curve(this.curve());n?y.x(function(e){return a.xPos(t,e)}).y0(Math.min(o,this.yPos(t,{value:0}))).y1(function(e){return a.yPos(t,e)}):y.y(function(e){return a.yPos(t,e)}).x0(Math.max(0,this.xPos(t,{value:0}))).x1(function(e){return a.xPos(t,e)}),f.merge(d).attr("class",t=>"area series series-"+this.cssTag(t)).each(function(t,e){$(this).attr("d",y(p.filter(function(t){return t.colIdx===e+1}))).style("opacity",a.interpolateFillOpacity()).style("stroke","none").style("fill",a.areaColor([],t,void 0,[]))}),d.exit().remove();const _=e.selectAll(".line").data(c.filter(function(t,e){return a.interpolate()&&e>0})),x=_.enter().append("path"),m=pi().x(function(e){return a.xPos(t,e)}).y(function(e){return a.yPos(t,e)}).curve(this.curve());x.merge(_).attr("class",t=>"line series series-"+this.cssTag(t)).each(function(t,e){const i=$(this),n=p.filter(function(t){return t.colIdx===e+1});i.attr("d",m(n)).style("stroke",a.lineColor([],t,void 0,[])).style("fill","none")}),_.exit().remove();const g=e.selectAll(".point").data(p,function(t,e){return t.shape+"_"+e});g.enter().append("g").each(function(e){const i=$(this);i.append(e.shape).attr("class","pointShape"),i.append("text").attr("class","pointValue").style("display","none").attr("text-anchor",a.valueAnchor()).attr("alignment-baseline",a.valueBaseline()).attr("fill",function(t,e){return"middle"===a.valueBaseline()||"central"===a.valueBaseline()?a.textColor(t.row,t.column,t.value,t.origRow):null}),i.append("circle").attr("class","pointSelection").on("mouseout.tooltip",a.tooltip.hide).on("mousemove.tooltip",a.tooltip.show).call(t._selection.enter.bind(t._selection)).on("click",function(e,i){a.click(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))}).on("dblclick",function(e,i){a.dblclick(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))}).on("keydown",function(e,i){if(a.tabNavigation()){const e=dt();"Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),t._selection.click(this))}})}).merge(g).attr("class",t=>"point series series-"+this.cssTag(t.column)).each(function(e){$(this).select(".pointValue").attr("x",function(e){return a.xPos(t,e)}).attr("y",function(e){return a.yPos(t,e)}).style("display",a.showValue()?"block":"none").attr("text-anchor",a.valueAnchor()).attr("alignment-baseline",a.valueBaseline()).text(function(t){return t.value}),$(this).select(".pointSelection").attr("cx",function(e){return a.xPos(t,e)}).attr("cy",function(e){return a.yPos(t,e)}).attr("r",e.size).attr("tabindex",a.tabNavigation()?0:null).attr("role",a.tabNavigation()?"button":null).attr("aria-label",a.tabNavigation()?t=>`${t.column||"Value"}: ${t.value} @ ${t.label}`:null);const i=$(this).select(".pointShape");switch(e.shape){case"rect":i.attr("x",function(i){return a.xPos(t,i)-e.size/2}).attr("y",function(i){return a.yPos(t,i)-e.size/2}).attr("width",e.size).attr("height",e.size).style("fill",a.pointColor(e.row,e.column,e.value,e.origRow));break;case"circle":i.attr("cx",function(e){return a.xPos(t,e)}).attr("cy",function(e){return a.yPos(t,e)}).attr("r",.9*e.size).style("fill",a.pointColor(e.row,e.column,e.value,e.origRow));break;case"path":i.attr("d",function(i){return"M"+(a.xPos(t,i)-e.size/2)+" "+(a.yPos(t,i)-e.size/2)+" L"+(a.xPos(t,i)+e.size/2)+" "+(a.yPos(t,i)+e.size/2)+" M"+(a.xPos(t,i)-e.size/2)+" "+(a.yPos(t,i)+e.size/2)+" L"+(a.xPos(t,i)+e.size/2)+" "+(a.yPos(t,i)-e.size/2)}).style("stroke",a.pointColor(e.row,e.column,e.value,e.origRow))}}),g.exit().remove()}exit(t,e){super.exit(t,e)}},M(i,"_Scatter"),i);Fe(an,"Scatter"),De(an,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number",multi:!0}]);let sn=an;sn.prototype._class+=" chart_Scatter",sn.prototype.implements(Ae.prototype),sn.prototype.implements(Me.prototype),sn.prototype.publish("paletteID","default","set","Color palette for this widget",sn.prototype._palette.switch(),{tags:["Basic","Shared"]}),sn.prototype.publish("pointSizeScale","linear","set","pointSizeScale",["linear","pow","log","sqrt"]),sn.prototype.publish("pointShape","cross","set","Shape of the data points",["circle","rectangle","cross"]),sn.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),sn.prototype.publish("interpolate","","set","Interpolate Data",["","linear","step","step-before","step-after","basis","bundle","cardinal","catmullRom","natural","monotone"]),sn.prototype.publish("pointDarken",!0,"boolean","If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color",null,{disable:/* @__PURE__ */Fe(t=>!t.interpolate(),"disable")}),sn.prototype.publish("interpolateDarken",!0,"boolean","If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color",null,{disable:/* @__PURE__ */Fe(t=>!t.interpolateFill(),"disable")}),sn.prototype.publish("interpolateFill",!1,"boolean","If true, the area between the line and zero will be filled"),sn.prototype.publish("interpolateFillOpacity",.66,"number","Fill interpolation Opacity",null,{range:{min:0,step:.01,max:1}}),sn.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),sn.prototype.publish("showValue",!1,"boolean"),sn.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),sn.prototype.publish("valueBaseline","ideographic","set","alignment-baseline for shown value text",["auto","baseline","before-edge","text-before-edge","middle","central","after-edge","text-after-edge","ideographic","alphabetic","hanging","mathematical","inherit"]);const rn=(M(n=class extends sn{constructor(){super(),this.interpolate_default("linear").interpolateFill_default(!0)}},"_Area"),n);Fe(rn,"Area"),rn.prototype._class+=" chart_Area";const ln=(M(o=class extends on{_linearGap;textLocal=H();stackedTextLocal=H();isHorizontal;constructor(){super(),Ae.call(this),Me.call(this),this._selection.skipBringToTop(!0),this._linearGap=25}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(e){if("series-table"===n.tooltipStyle())return n.tooltipFormat({label:e.row[0],arr:n.columns().slice(1).map(function(t,i){return{label:t,color:n._palette(t),value:e.row[i+1]}})});{let i=e.row[e.idx];return i instanceof Array&&(i=i[1]-i[0]),n.tooltipFormat({label:e.row[0],series:n.layerColumns(t)[e.idx],value:i})}})}adjustedData(t){return this.layerData(t).map(e=>{let i=0;return e.map((e,n)=>{if(0===n)return e;if(n>=this.layerColumns(t).length)return e;const o=t.yAxisStacked()?[i,i+e]:e;return i+=e,o},this)},this)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n="horizontal"===t.orientation();this.isHorizontal=n;const o=this;this.tabNavigation()&&t.parentRelativeDiv?t.parentRelativeDiv.attr("tabindex","0").attr("role","group").attr("aria-label",`${this.columns()[0]||"Chart"} data`):t.parentRelativeDiv&&t.parentRelativeDiv.attr("tabindex",null).attr("role",null).attr("aria-label",null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const a=Z(o.showValueAsPercentFormat());let s=10,r=0;switch(t.xAxisType()){case"ordinal":s=t.bandwidth(),r=-s/2;break;case"linear":case"time":s=Math.max(Math.abs(t.dataPos(2)-t.dataPos(1))*(100-this._linearGap)/100,s),r=-s/2}this.tooltip.direction(n?"n":"e");const l=lt().domain(o.layerColumns(t).filter(function(t,e){return e>0})).rangeRound(n?[0,s]:[s,0]).paddingInner(Math.max(this.xAxisSeriesPaddingInner(),.05)).paddingOuter(0);let h=[];const c=[],u=this.columns().length,p=this.data();this.showValue()&&"series"===this.showValueAsPercent()&&p.forEach(t=>{t.filter((t,e)=>e>0&&e<u).forEach((t,e)=>{void 0===c[e+1]&&(c[e+1]=0),c[e+1]+=t})}),(this.showDomainTotal()||this.showValue()&&"domain"===this.showValueAsPercent())&&(h=p.map(t=>t.filter((t,e)=>e>0&&e<u).reduce((t,e)=>t+e,0)));const d=e.selectAll(".dataRow").data(this.adjustedData(t)),f=t.data(),y=this.getAxisSize(t);d.enter().append("g").attr("class","dataRow").merge(d).each(function(e,p){const d=$(this),_=d.selectAll(".dataCell").data(e.filter(function(e,i){return i<o.layerColumns(t).length}).map(function(i,n){return{column:o.layerColumns(t)[n],row:e,origRow:f[p],value:i,idx:n}}).filter(function(t){return null!==t.value&&t.idx>0}),t=>t.column),x=_.enter().append("g").attr("class","dataCell").on("mouseout.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.hide.apply(o,arguments)}).on("mousemove.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.show.apply(o,arguments)}).call(t._selection.enter.bind(t._selection)).on("click",function(e){o.click(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).on("dblclick",function(e){o.dblclick(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).on("keydown",function(e,i){if(o.tabNavigation()){const e=dt();"Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),t._selection.click(this))}}).style("opacity",0).each(function(t){const e=$(this);e.append("rect").attr("class","columnRect series series-"+o.cssTag(t.column)),e.append("text").attr("class","columnRectText").style("stroke","transparent")});x.transition().duration(i).style("opacity",1);const m=t.yAxisStacked()?s:l.bandwidth();x.merge(_).attr("tabindex",o.tabNavigation()?0:null).attr("role",o.tabNavigation()?"button":null).attr("aria-label",o.tabNavigation()?t=>`${t.origRow[0]} - ${t.column}: ${t.value instanceof Array?t.value[1]-t.value[0]:t.value}`:null).each(function(s){const d=$(this),f=t.dataPos(e[0])+(t.yAxisStacked()?0:l(s.column))+r,_=s.value instanceof Array?s.value[1]:s.value;let x=s.origRow[s.idx];if(o.showValue()){const t=o.dataMeta();switch(o.showValueAsPercent()){case"series":const e=void 0!==t.sum?t.sum:c[s.idx];x=a(x/e);break;case"domain":const i=void 0!==t.sum?t.sum:h[p];x=a(x/i);break;default:x=Z(o.showValueFormat())(x)}}const g=t.valuePos(_),b=t.valuePos(s.value instanceof Array?s.value[0]:0),v=Math.min(b,g),w=Math.abs(g-b),S=o.innerTextFontSize(),k=o.innerTextPadding_exists()?o.innerTextPadding():S/2.5,A=o.intersectRectRect({x:n?f:v,y:n?v:f,width:n?m:w,height:n?w:m},{x:0,y:0,width:y.width,height:y.height}),C=d.select("rect").transition().duration(i).style("fill",t=>o.fillColor(t.row,t.column,t.value,t.origRow));n?C.attr("x",f).attr("y",v).attr("width",m).attr("height",w):C.attr("y",f).attr("x",v).attr("height",m).attr("width",w);const M=d.select("text").transition().duration(i).style("font-size",S+"px").style("fill",t=>o.textColor(t.row,t.column,t.value,t.origRow));M.style("font-family",o.innerTextFontFamily_exists()?o.innerTextFontFamily():null);const P=o.innerTextPadding_exists()?o.innerTextPadding():8,T=S/2.7;if(n){const t=A.y+A.height-k;M.attr("x",f+m/2).attr("y",t+T).attr("transform",`rotate(-90, ${f+m/2}, ${t})`)}else M.attr("x",A.x+P).attr("y",f+m/2+T);M.attr("height",m).attr("width",w),o.showInnerText()&&M.text(t=>{const e=o.innerText(t.origRow,t.origRow[u],t.idx);if(e){const i=n?A.height:A.width,a=o.calcInnerText(i,e,x);return t.innerTextObj=a,a.text}return""});const I=d.selectAll(".dataText").data(o.showValue()?[`${_}`]:[]);I.enter().append("g").attr("class","dataText").each(function(t){o.textLocal.set(this,(new mt).target(this).colorStroke_default("transparent"))}).merge(I).each(function(){const t={x:0,y:0},e=o.valueFontFamily(),i=o.valueFontSize(),a=o.textSize(x,e,i),r=parseFloat(x)>=0;let l=o.valueAnchor()?o.valueAnchor():n?"middle":"start";const h=A.x,c=y.width-(A.x+A.width),u=A.y,p=y.height-(A.y+A.height);let d,_,g;if(s.innerTextObj){const{padding:e,valueTextWidth:o}=s.innerTextObj;_=!1,n?(l="middle",t.x=f+m/2,4===s.innerTextObj.category?(_=!0,t.y=v-e-i/2):t.y=v+e+i/2):(l="start",4===s.innerTextObj.category?(_=!0,t.x=w+v+e):t.x=w+v-o-e,t.y=f+m/2)}else n?(d=A.height<a.height,_=!o.valueCentered()||d,t.x=A.x+A.width/2,_?r?(g=u<a.height+P,g?d?t.y=A.y+A.height+a.height:(_=!1,t.y=A.y+A.height/2):t.y=A.y-a.height/2-P):(g=p<a.height,g?d?t.y=A.y-a.height/2-P:(_=!1,t.y=A.y+A.height/2):t.y=A.y+a.height+P):t.y=A.y+A.height/2):(d=A.width<a.width,_=!o.valueCentered()||d,t.y=A.y+A.height/2,_?r?(g=c<a.width+P,g?o.showInnerText()||!d?(_=!1,t.x=A.x+A.width/2):t.x=A.x-(a.width-P):t.x=A.x+A.width+a.width/2+P):(g=h<a.width,g?o.showInnerText()||!d?(_=!1,t.x=A.x+A.width/2):t.x=A.x+A.width+(a.width-P):t.x=A.x-(a.width-P)):t.x=A.x+A.width/2);const b=_?null:o.textColor(s.row,s.column,s.value,s.origRow),S=o.columns(),k=o.yAxisStacked()&&d||_&&o.yAxisStacked()&&S.indexOf(s.column)!==S.length-1;o.textLocal.get(this).pos(t).anchor(l).fontFamily(e).fontSize(i).text(`${x}`).colorFill(b).visible(o.showValue()&&!k).render()}),I.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),_.exit().transition().duration(i).style("opacity",0).remove();const g=t.yAxisStacked()?h[p]:Math.max(...e.filter((t,e)=>e>0&&e<u)),b=d.selectAll(".stackedTotalText").data(o.showDomainTotal()?[h[p]]:[]);b.enter().append("g").attr("class","stackedTotalText").each(function(t){o.stackedTextLocal.set(this,(new mt).target(this).colorStroke_default("transparent"))}).merge(b).each(function(i){const a={x:0,y:0},s=t.dataPos(e[0]),r=t.valuePos(g),l=o.valueFontFamily(),h=o.valueFontSize(),c=o.textSize(i,l,h),u=parseFloat(i)>=0;let p="middle";n?(a.x=s,a.y=u?r-c.height/2:r+c.height/2):(p="start",a.y=s,a.x=u?r+c.width/2:r-c.width/2),o.stackedTextLocal.get(this).pos(a).anchor(p).fontFamily(l).fontSize(h).text(i).render()}),b.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),d.exit().transition().duration(i).remove()}calcInnerText(t,e,i){const n=this.innerTextFontFamily_exists()?this.innerTextFontFamily():"Verdana",o=this.innerTextFontSize(),a=this.valueFontFamily_exists()?this.valueFontFamily():"Verdana",s=this.valueFontSize(),r=this.innerTextPadding_exists()?this.innerTextPadding():o/2.5,l=this.isHorizontal?s:this.textSize(i,a,s).width,h=e,c=3*r+this.textSize("...",n,o).width+l,u=1*r+l;let p=4;if(3*r+this.textSize(e,n,o).width+l<t)p=1;else if(c<t){const i=t-c;let a="";for(const t of e){if(this.textSize(a+t,n,o).width>i){e=a+"...";break}a+=t}p=2}else u<t?(e="",p=3):e="";return{text:e,isTruncated:h!==e,padding:r,category:p,valueTextWidth:l}}innerText(t,e,i){return t[0]}},"_Column"),o);Fe(ln,"Column"),De(ln,"__inputs",[{id:"label",type:"string"},{id:"values",type:"number",multi:!0}]);let hn=ln;hn.prototype._class+=" chart_Column",hn.prototype.implements(Ae.prototype),hn.prototype.implements(Me.prototype),hn.prototype.publish("valueFontFamily",null,"string","Font family of value text",null,{optional:!0}),hn.prototype.publish("valueFontSize",12,"number","Height of value text (pixels)"),hn.prototype.publish("innerTextFontFamily",null,"string","Font family of inner text",null,{optional:!0}),hn.prototype.publish("innerTextPadding",8,"number","Offset of inner text (pixels)",null,{optional:!0}),hn.prototype.publish("innerTextFontSize",12,"number","Height of inner text (pixels)"),hn.prototype.publish("paletteID","default","set","Color palette for this widget",()=>hn.prototype._palette.switch(),{tags:["Basic","Shared"]}),hn.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),hn.prototype.publish("showValue",!1,"boolean","Show Value in column"),hn.prototype.publish("showInnerText",!1,"boolean","Show Label in column"),hn.prototype.publish("showValueFormat",",","string","D3 Format for Value",null,{disable:/* @__PURE__ */Fe(t=>!t.showValue()||!!t.showValueAsPercent(),"disable")}),hn.prototype.publish("showValueAsPercent",null,"set","If showValue is true, optionally show value as a percentage by Series or Domain",[null,"series","domain"],{disable:/* @__PURE__ */Fe(t=>!t.showValue(),"disable"),optional:!0}),hn.prototype.publish("showValueAsPercentFormat",".0%","string","D3 Format for %",null,{disable:/* @__PURE__ */Fe(t=>!t.showValue()||!t.showValueAsPercent(),"disable")}),hn.prototype.publish("showDomainTotal",!1,"boolean","Show Total Value for Stacked Columns",null),hn.prototype.publish("valueCentered",!1,"boolean","Show Value in center of column"),hn.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),hn.prototype.publish("xAxisSeriesPaddingInner",0,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)"),hn.prototype.publish("tooltipInnerTextEllipsedOnly",!1,"boolean","Show tooltip only when inner text is truncated with an ellipsis");const cn=(M(a=class extends hn{constructor(){super(),this.orientation_default("vertical")}},"_Bar"),a);Fe(cn,"Bar");let un=cn;function pn(t){var e=0,i=t.children,n=i&&i.length;if(n)for(;--n>=0;)e+=i[n].value;else e=1;t.value=e}function dn(){return this.eachAfter(pn)}function fn(t){var e,i,n,o,a=this,s=[a];do{for(e=s.reverse(),s=[];a=e.pop();)if(t(a),i=a.children)for(n=0,o=i.length;n<o;++n)s.push(i[n])}while(s.length);return this}function yn(t){for(var e,i,n=this,o=[n];n=o.pop();)if(t(n),e=n.children)for(i=e.length-1;i>=0;--i)o.push(e[i]);return this}function _n(t){for(var e,i,n,o=this,a=[o],s=[];o=a.pop();)if(s.push(o),e=o.children)for(i=0,n=e.length;i<n;++i)a.push(e[i]);for(;o=s.pop();)t(o);return this}function xn(t){return this.eachAfter(function(e){for(var i=+t(e.data)||0,n=e.children,o=n&&n.length;--o>=0;)i+=n[o].value;e.value=i})}function mn(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function gn(t){for(var e=this,i=bn(e,t),n=[e];e!==i;)e=e.parent,n.push(e);for(var o=n.length;t!==i;)n.splice(o,0,t),t=t.parent;return n}function bn(t,e){if(t===e)return t;var i=t.ancestors(),n=e.ancestors(),o=null;for(t=i.pop(),e=n.pop();t===e;)o=t,t=i.pop(),e=n.pop();return o}function vn(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function wn(){var t=[];return this.each(function(e){t.push(e)}),t}function Sn(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function kn(){var t=this,e=[];return t.each(function(i){i!==t&&e.push({source:i.parent,target:i})}),e}function An(t,e){var i,n,o,a,s,r=new In(t),l=+t.value&&(r.value=t.value),h=[r];for(null==e&&(e=Mn);i=h.pop();)if(l&&(i.value=+i.data.value),(o=e(i.data))&&(s=o.length))for(i.children=new Array(s),a=s-1;a>=0;--a)h.push(n=i.children[a]=new In(o[a])),n.parent=i,n.depth=i.depth+1;return r.eachBefore(Tn)}function Cn(){return An(this).eachBefore(Pn)}function Mn(t){return t.children}function Pn(t){t.data=t.data.data}function Tn(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function In(t){this.data=t,this.depth=this.height=0,this.parent=null}M(pn,"Ce"),M(dn,"ze"),M(fn,"Fe"),M(yn,"Ie"),M(_n,"Ee"),M(xn,"Re"),M(mn,"De"),M(gn,"Oe"),M(bn,"je"),M(vn,"Ne"),M(wn,"Le"),M(Sn,"Be"),M(kn,"$e"),M(An,"He"),M(Cn,"Ve"),M(Mn,"qe"),M(Pn,"We"),M(Tn,"Ge"),M(In,"Xe"),un.prototype._class+=" chart_Bar",Fe(pn,"count"),Fe(dn,"node_count"),Fe(fn,"node_each"),Fe(yn,"node_eachBefore"),Fe(_n,"node_eachAfter"),Fe(xn,"node_sum"),Fe(mn,"node_sort"),Fe(gn,"node_path"),Fe(bn,"leastCommonAncestor"),Fe(vn,"node_ancestors"),Fe(wn,"node_descendants"),Fe(Sn,"node_leaves"),Fe(kn,"node_links"),Fe(An,"hierarchy"),Fe(Cn,"node_copy"),Fe(Mn,"defaultChildren"),Fe(Pn,"copyData"),Fe(Tn,"computeHeight"),Fe(In,"Node$1"),In.prototype=An.prototype={constructor:In,count:dn,each:fn,eachAfter:_n,eachBefore:yn,sum:xn,sort:mn,path:gn,ancestors:vn,descendants:wn,leaves:Sn,links:kn,copy:Cn};var En=Array.prototype.slice;function Fn(t){for(var e,i,n=t.length;n;)i=Math.random()*n--|0,e=t[n],t[n]=t[i],t[i]=e;return t}function Dn(t){for(var e,i,n=0,o=(t=Fn(En.call(t))).length,a=[];n<o;)e=t[n],i&&On(i,e)?++n:(i=Nn(a=Rn(a,e)),n=0);return i}function Rn(t,e){var i,n;if(jn(e,t))return[e];for(i=0;i<t.length;++i)if(zn(e,t[i])&&jn(Bn(t[i],e),t))return[t[i],e];for(i=0;i<t.length-1;++i)for(n=i+1;n<t.length;++n)if(zn(Bn(t[i],t[n]),e)&&zn(Bn(t[i],e),t[n])&&zn(Bn(t[n],e),t[i])&&jn(Vn(t[i],t[n],e),t))return[t[i],t[n],e];throw new Error}function zn(t,e){var i=t.r-e.r,n=e.x-t.x,o=e.y-t.y;return i<0||i*i<n*n+o*o}function On(t,e){var i=t.r-e.r+1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function jn(t,e){for(var i=0;i<e.length;++i)if(!On(t,e[i]))return!1;return!0}function Nn(t){switch(t.length){case 1:return Ln(t[0]);case 2:return Bn(t[0],t[1]);case 3:return Vn(t[0],t[1],t[2])}}function Ln(t){return{x:t.x,y:t.y,r:t.r}}function Bn(t,e){var i=t.x,n=t.y,o=t.r,a=e.x,s=e.y,r=e.r,l=a-i,h=s-n,c=r-o,u=Math.sqrt(l*l+h*h);return{x:(i+a+l/u*c)/2,y:(n+s+h/u*c)/2,r:(u+o+r)/2}}function Vn(t,e,i){var n=t.x,o=t.y,a=t.r,s=e.x,r=e.y,l=e.r,h=i.x,c=i.y,u=i.r,p=n-s,d=n-h,f=o-r,y=o-c,_=l-a,x=u-a,m=n*n+o*o-a*a,g=m-s*s-r*r+l*l,b=m-h*h-c*c+u*u,v=d*f-p*y,w=(f*b-y*g)/(2*v)-n,S=(y*_-f*x)/v,k=(d*g-p*b)/(2*v)-o,A=(p*x-d*_)/v,C=S*S+A*A-1,M=2*(a+w*S+k*A),P=w*w+k*k-a*a,T=-(C?(M+Math.sqrt(M*M-4*C*P))/(2*C):P/M);return{x:n+w+S*T,y:o+k+A*T,r:T}}function Hn(t,e,i){var n,o,a,s,r=t.x-e.x,l=t.y-e.y,h=r*r+l*l;h?(o=e.r+i.r,o*=o,s=t.r+i.r,o>(s*=s)?(n=(h+s-o)/(2*h),a=Math.sqrt(Math.max(0,s/h-n*n)),i.x=t.x-n*r-a*l,i.y=t.y-n*l+a*r):(n=(h+o-s)/(2*h),a=Math.sqrt(Math.max(0,o/h-n*n)),i.x=e.x+n*r-a*l,i.y=e.y+n*l+a*r)):(i.x=e.x+i.r,i.y=e.y)}function $n(t,e){var i=t.r+e.r-1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function Wn(t){var e=t._,i=t.next._,n=e.r+i.r,o=(e.x*i.r+i.x*e.r)/n,a=(e.y*i.r+i.y*e.r)/n;return o*o+a*a}function qn(t){this._=t,this.next=null,this.previous=null}function Gn(t){if(!(o=t.length))return 0;var e,i,n,o,a,s,r,l,h,c,u;if((e=t[0]).x=0,e.y=0,!(o>1))return e.r;if(i=t[1],e.x=-i.r,i.x=e.r,i.y=0,!(o>2))return e.r+i.r;Hn(i,e,n=t[2]),e=new qn(e),i=new qn(i),n=new qn(n),e.next=n.previous=i,i.next=e.previous=n,n.next=i.previous=e;t:for(r=3;r<o;++r){Hn(e._,i._,n=t[r]),n=new qn(n),l=i.next,h=e.previous,c=i._.r,u=e._.r;do{if(c<=u){if($n(l._,n._)){i=l,e.next=i,i.previous=e,--r;continue t}c+=l._.r,l=l.next}else{if($n(h._,n._)){(e=h).next=i,i.previous=e,--r;continue t}u+=h._.r,h=h.previous}}while(l!==h.next);for(n.previous=e,n.next=i,e.next=i.previous=i=n,a=Wn(e);(n=n.next)!==i;)(s=Wn(n))<a&&(e=n,a=s);i=e.next}for(e=[i._],n=i;(n=n.next)!==i;)e.push(n._);for(n=Dn(e),r=0;r<o;++r)(e=t[r]).x-=n.x,e.y-=n.y;return n.r}function Un(t){return null==t?null:Xn(t)}function Xn(t){if("function"!=typeof t)throw new Error;return t}function Yn(){return 0}function Qn(t){return function(){return t}}function Zn(t){return Math.sqrt(t.value)}function Jn(){var t=null,e=1,i=1,n=Yn;function o(o){return o.x=e/2,o.y=i/2,t?o.eachBefore(Kn(t)).eachAfter(to(n,.5)).eachBefore(eo(1)):o.eachBefore(Kn(Zn)).eachAfter(to(Yn,1)).eachAfter(to(n,o.r/Math.min(e,i))).eachBefore(eo(Math.min(e,i)/(2*o.r))),o}return M(o,"a"),Fe(o,"pack"),o.radius=function(e){return arguments.length?(t=Un(e),o):t},o.size=function(t){return arguments.length?(e=+t[0],i=+t[1],o):[e,i]},o.padding=function(t){return arguments.length?(n="function"==typeof t?t:Qn(+t),o):n},o}function Kn(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function to(t,e){return function(i){if(n=i.children){var n,o,a,s=n.length,r=t(i)*e||0;if(r)for(o=0;o<s;++o)n[o].r+=r;if(a=Gn(n),r)for(o=0;o<s;++o)n[o].r-=r;i.r=a+r}}}function eo(t){return function(e){var i=e.parent;e.r*=t,i&&(e.x=i.x+t*e.x,e.y=i.y+t*e.y)}}M(Fn,"Ue"),M(Dn,"Qe"),M(Rn,"Ze"),M(zn,"Je"),M(On,"Ke"),M(jn,"ti"),M(Nn,"ei"),M(Ln,"ii"),M(Bn,"ni"),M(Vn,"oi"),M(Hn,"ai"),M($n,"si"),M(Wn,"ri"),M(qn,"li"),M(Gn,"hi"),M(Un,"ci"),M(Xn,"ui"),M(Yn,"pi"),M(Qn,"di"),M(Zn,"fi"),M(Jn,"yi"),M(Kn,"_i"),M(to,"xi"),M(eo,"mi"),Fe(Fn,"shuffle"),Fe(Dn,"enclose"),Fe(Rn,"extendBasis"),Fe(zn,"enclosesNot"),Fe(On,"enclosesWeak"),Fe(jn,"enclosesWeakAll"),Fe(Nn,"encloseBasis"),Fe(Ln,"encloseBasis1"),Fe(Bn,"encloseBasis2"),Fe(Vn,"encloseBasis3"),Fe(Hn,"place"),Fe($n,"intersects"),Fe(Wn,"score"),Fe(qn,"Node"),Fe(Gn,"packEnclose"),Fe(Un,"optional"),Fe(Xn,"required"),Fe(Yn,"constantZero"),Fe(Qn,"constant$2"),Fe(Zn,"defaultRadius"),Fe(Jn,"d3Pack"),Fe(Kn,"radiusLeaf"),Fe(to,"packChildren"),Fe(eo,"translateChild");const io=(M(s=class extends et{labelWidgets;d3Pack;constructor(){super(),be.call(this),Me.call(this),tt.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.labelWidgets={},this.d3Pack=Jn().size([this.width(),this.height()]).padding(1.5)}size(t){const e=super.size.apply(this,arguments);return arguments.length&&this.d3Pack.size([this.width(),this.height()]),e}enter(t,e){super.enter(t,e),this._selection.widgetElement(e);const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t[0]),value:t[1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){super.update(t,e);const i=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const n=An({children:this.cloneData()}).sum(function(t){return t[1]}).sort(function(t,e){return e[1]<t[1]?-1:e[1]>t[1]?1:0});this.d3Pack(n);const o=e.selectAll(".node").data(n.children||[],t=>t.data[0]);o.enter().append("g").attr("class",(t,e)=>"node series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).each(function(t){const e=$(this),n=t.x,o=t.y;e.append("circle").attr("transform","translate("+n+","+o+")").attr("r",0).on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show),t.__viz_faChar?i.labelWidgets[t.data[0]]=(new gt).char(t.__viz_faChar).target(this).render():i.labelWidgets[t.data[0]]=(new mt).text(t.data[0]).target(this).render()}).merge(o).transition().attr("opacity",1).each(function(t){const e=$(this),n={x:t.x,y:t.y};e.select("circle").transition().attr("transform","translate("+n.x+","+n.y+")").style("fill",i.fillColor(t.data,i.columns()[1],t.data[1])).attr("r",t.r).select("title").text(t.data[0]+" ("+t.data[1]+")"),t.__viz_faChar?i.labelWidgets[t.data[0]].pos(n).render():i.labelWidgets[t.data[0]].pos(n).colorFill_default(i.textColor(t.data,i.columns()[1],t.data[1])).width(2*t.r).text(t.data[0]).render()}),o.exit().transition().style("opacity",0).remove()}exit(t,e){super.exit(t,e)}},"_Bubble"),s);Fe(io,"Bubble"),De(io,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let no=io;no.prototype._class+=" chart_Bubble",no.prototype.implements(be.prototype),no.prototype.implements(Me.prototype),no.prototype.mixin(tt.SimpleSelectionMixin),no.prototype.publish("paletteID","default","set","Color palette for this widget",no.prototype._palette.switch(),{tags:["Basic","Shared"]}),no.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});const oo=(M(r=class extends sn{constructor(){super()}enter(t,e){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(t,e)}},"_BubbleXY"),r);Fe(oo,"BubbleXY"),oo.prototype._class+=" chart_BubbleXY";var ao,so,ro=0,lo=0,ho=0,co=0,uo=0,po=0,fo="object"==typeof performance&&performance.now?performance:Date,yo="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function _o(){return uo||(yo(xo),uo=fo.now()+po)}function xo(){uo=0}function mo(){this._call=this._time=this._next=null}function go(){_o(),++ro;for(var t,e=ao;e;)(t=uo-e._time)>=0&&e._call.call(null,t),e=e._next;--ro}function bo(){uo=(co=fo.now())+po,ro=lo=0;try{go()}finally{ro=0,wo(),uo=0}}function vo(){var t=fo.now(),e=t-co;e>1e3&&(po-=e,co=t)}function wo(){for(var t,e,i=ao,n=1/0;i;)i._call?(n>i._time&&(n=i._time),t=i,i=i._next):(e=i._next,i._next=null,i=t?t._next=e:ao=e);so=t,So(n)}function So(t){ro||(lo&&(lo=clearTimeout(lo)),t-uo>24?(t<1/0&&(lo=setTimeout(bo,t-fo.now()-po)),ho&&(ho=clearInterval(ho))):(ho||(co=fo.now(),ho=setInterval(vo,1e3)),ro=1,yo(bo)))}function ko(){var t="left",e=!1,i=!1,n=Ao,o=Co,a=Mo,s=380,r=30,l=Ki();function h(t){t.each(function(t,h){var c,u,p=n.call(this,t,h).slice().sort(Tt),d=o.call(this,t,h).slice().sort(Tt),f=a.call(this,t,h).slice().sort(Tt),y=$(this),_=y.select("g.wrap");_.empty()&&(_=y.append("g").attr("class","wrap")),i?(c=r,u=s,_.attr("transform","rotate(90)translate(0,"+-s+")")):(c=s,u=r,_.attr("transform",null));var x=rt().domain([0,Math.max(p[0],d[0],f[0])]).range(e?[c,0]:[0,c]),m=this.__chart__||rt().domain([0,1/0]).range(x.range());this.__chart__=x;var g=Po(m),b=Po(x),v=_.selectAll("rect.range").data(p);v.enter().append("rect").attr("class",function(t,e){return"range s"+e}).attr("width",g).attr("height",u).attr("x",e?m:0).merge(v).transition(v).attr("x",e?x:0).attr("width",b).attr("height",u);var w=_.selectAll("rect.measure").data(f);w.enter().append("rect").attr("class",function(t,e){return"measure s"+e}).attr("width",g).attr("height",u/3).attr("x",e?m:0).attr("y",u/3).merge(w).transition(w).attr("width",b).attr("height",u/3).attr("x",e?x:0).attr("y",u/3);var S=_.selectAll("line.marker").data(d);S.enter().append("line").attr("class","marker").attr("x1",m).attr("x2",m).attr("y1",u/6).attr("y2",5*u/6).merge(S).transition(S).attr("x1",x).attr("x2",x).attr("y1",u/6).attr("y2",5*u/6);var k=y.selectAll("g.axis").data([0]);k.enter().append("g").attr("class","axis"),k.attr("transform",i?null:"translate(0,"+u+")").call(l.scale(x))}),go()}return M(h,"u"),Fe(h,"bulvar"),h.orient=function(n){return arguments.length?(e="right"==(t=n+"")||"bottom"===t,l.orient((i="top"===t||"bottom"===t)?"left":"bottom"),h):t},h.ranges=function(t){return arguments.length?(n=t,h):n},h.markers=function(t){return arguments.length?(o=t,h):o},h.measures=function(t){return arguments.length?(a=t,h):a},h.width=function(t){return arguments.length?(s=+t,h):s},h.height=function(t){return arguments.length?(r=+t,h):r},h.tickFormat=function(t){return arguments.length?(l.tickFormat(t),h):l.tickFormat()},h}function Ao(t){return t.ranges}function Co(t){return t.markers}function Mo(t){return t.measures}function Po(t){var e=t(0);return function(i){return Math.abs(t(i)-e)}}M(_o,"Ei"),M(xo,"Ri"),M(mo,"Di"),M(go,"Oi"),M(bo,"ji"),M(vo,"Ni"),M(wo,"Li"),M(So,"Bi"),M(ko,"$i"),M(Ao,"Hi"),M(Co,"Vi"),M(Mo,"qi"),M(Po,"Wi"),Fe(_o,"now"),Fe(xo,"clearNow"),Fe(mo,"Timer"),mo.prototype={constructor:mo,restart:/* @__PURE__ */Fe(function(t,e,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?_o():+i)+(null==e?0:+e),this._next||so===this||(so?so._next=this:ao=this,so=this),this._call=t,this._time=i,So()},"restart"),stop:/* @__PURE__ */Fe(function(){this._call&&(this._call=null,this._time=1/0,So())},"stop")},Fe(go,"timerFlush"),Fe(bo,"wake"),Fe(vo,"poke"),Fe(wo,"nap"),Fe(So,"sleep"),Fe(ko,"d3Bullet"),Fe(Ao,"bulvarRanges"),Fe(Co,"bulvarMarkers"),Fe(Mo,"bulvarMeasures"),Fe(Po,"bulvarWidth");const To=(M(l=class extends bt{_hiddenColumns={};constructor(){super(),tt.SimpleSelectionMixin.call(this,!0)}bulletData(){const t=this;this._hiddenColumns={};const e=this.columns();return this.data().map(function(t){return{title:i(t,this.titleColumn()),subtitle:i(t,this.subtitleColumn()),ranges:i(t,this.rangesColumn(),"range"),measures:i(t,this.measuresColumn(),"measure"),markers:i(t,this.markersColumn(),"marker"),origRow:t}},this);function i(i,n,o){const a=e.indexOf(n);return a>=0?i[a]instanceof Array?i[a]:[i[a]]:(o&&(t._hiddenColumns[o]=!0),[0])}}enter(t,e){super.enter(t,e),$(t.parentNode).style("overflow","auto"),this._selection.widgetElement(e)}update(t,e){super.update(t,e);const i=this;e.selectAll(".axis").style("display","none"),e.selectAll(".range,.measure,.marker").style("display",null);const n=this.width()-2-2,o=e.selectAll("svg").data(this.bulletData()),a=o.enter().append("svg").attr("class","bullet").call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).each(function(){const t=$(this).append("g").attr("class",(t,e)=>"bulletBar series series-"+i.cssTag(i.titleColumn())).append("g").attr("class","bulletTitle");t.append("text").attr("class","title"),t.append("text").attr("class","subtitle").attr("dy","1em")}).merge(o),s=a.select(".bulletTitle").style("text-anchor","end").attr("transform","translate(-6,12)");s.select(".title").text(function(t){return t.title}),s.select(".subtitle").text(function(t){return t.subtitle});let r=0;s.each(function(){const t=this.getBBox();t.width>r&&(r=t.width)});const l=ko().width(n-r-6).height(24);a.attr("width",n).attr("height",40).style("margin-left","2px"),a.select(".bulletBar").attr("transform","translate("+(r+6)+",8)").call(l),o.exit().remove(),Object.keys(this._hiddenColumns).length>0&&e.selectAll(`.${Object.keys(this._hiddenColumns).join(",.")}`).style("display","none")}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}_selection},"_Bullet"),l);Fe(To,"Bullet");let Io=To;Io.prototype._class+=" chart_Bullet",Io.prototype.publish("titleColumn",null,"set","Title Column",function(){return this.columns()},{optional:!0}),Io.prototype.publish("subtitleColumn",null,"set","Subtitle Column",function(){return this.columns()},{optional:!0}),Io.prototype.publish("rangesColumn",null,"set","Ranges Column",function(){return this.columns()},{optional:!0}),Io.prototype.publish("measuresColumn",null,"set","Measures Column",function(){return this.columns()},{optional:!0}),Io.prototype.publish("markersColumn",null,"set","Markers Column",function(){return this.columns()},{optional:!0});var Eo=Array.prototype.slice;function Fo(t,e){return t-e}function Do(t){for(var e=0,i=t.length,n=t[i-1][1]*t[0][0]-t[i-1][0]*t[0][1];++e<i;)n+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return n}function Ro(t){return function(){return t}}function zo(t,e){for(var i,n=-1,o=e.length;++n<o;)if(i=Oo(t,e[n]))return i;return 0}function Oo(t,e){for(var i=e[0],n=e[1],o=-1,a=0,s=t.length,r=s-1;a<s;r=a++){var l=t[a],h=l[0],c=l[1],u=t[r],p=u[0],d=u[1];if(jo(l,u,e))return 0;c>n!=d>n&&i<(p-h)*(n-c)/(d-c)+h&&(o=-o)}return o}function jo(t,e,i){var n;return No(t,e,i)&&Lo(t[n=+(t[0]===e[0])],i[n],e[n])}function No(t,e,i){return(e[0]-t[0])*(i[1]-t[1])===(i[0]-t[0])*(e[1]-t[1])}function Lo(t,e,i){return t<=e&&e<=i||i<=e&&e<=t}function Bo(){}M(Fo,"Ui"),M(Do,"Qi"),M(Ro,"Zi"),M(zo,"Ji"),M(Oo,"Ki"),M(jo,"tn"),M(No,"en"),M(Lo,"nn"),M(Bo,"on"),Fe(Fo,"ascending"),Fe(Do,"area"),Fe(Ro,"constant$1"),Fe(zo,"contains"),Fe(Oo,"ringContains"),Fe(jo,"segmentContains"),Fe(No,"collinear"),Fe(Lo,"within"),Fe(Bo,"noop$2");var Vo=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Ho(){var t=1,e=1,i=Ft,n=l;function o(t){var e=i(t);if(Array.isArray(e))e=e.slice().sort(Fo);else{var n=xt(t),o=n[0],s=n[1];e=It(o,s,e),e=Et(Math.floor(o/e)*e,Math.floor(s/e)*e,e)}return e.map(function(e){return a(t,e)})}function a(t,e){var i=[],o=[];return s(t,e,function(a){n(a,t,e),Do(a)>0?i.push([a]):o.push(a)}),o.forEach(function(t){for(var e,n=0,o=i.length;n<o;++n)if(-1!==zo((e=i[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:e,coordinates:i}}function s(i,n,o){var a,s,l,h,c,u,p=new Array,d=new Array;for(a=s=-1,h=i[0]>=n,Vo[h<<1].forEach(f);++a<t-1;)l=h,h=i[a+1]>=n,Vo[l|h<<1].forEach(f);for(Vo[0|h].forEach(f);++s<e-1;){for(a=-1,h=i[s*t+t]>=n,c=i[s*t]>=n,Vo[h<<1|c<<2].forEach(f);++a<t-1;)l=h,h=i[s*t+t+a+1]>=n,u=c,c=i[s*t+a+1]>=n,Vo[l|h<<1|c<<2|u<<3].forEach(f);Vo[h|c<<3].forEach(f)}for(a=-1,c=i[s*t]>=n,Vo[c<<2].forEach(f);++a<t-1;)u=c,c=i[s*t+a+1]>=n,Vo[c<<2|u<<3].forEach(f);function f(t){var e,i,n=[t[0][0]+a,t[0][1]+s],l=[t[1][0]+a,t[1][1]+s],h=r(n),c=r(l);(e=d[h])?(i=p[c])?(delete d[e.end],delete p[i.start],e===i?(e.ring.push(l),o(e.ring)):p[e.start]=d[i.end]={start:e.start,end:i.end,ring:e.ring.concat(i.ring)}):(delete d[e.end],e.ring.push(l),d[e.end=c]=e):(e=p[c])?(i=d[h])?(delete p[e.start],delete d[i.end],e===i?(e.ring.push(l),o(e.ring)):p[i.start]=d[e.end]={start:i.start,end:e.end,ring:i.ring.concat(e.ring)}):(delete p[e.start],e.ring.unshift(n),p[e.start=h]=e):p[h]=d[c]={start:h,end:c,ring:[n,l]}}M(f,"y"),Vo[c<<3].forEach(f),Fe(f,"stitch")}function r(e){return 2*e[0]+e[1]*(t+1)*4}function l(i,n,o){i.forEach(function(i){var a,s=i[0],r=i[1],l=0|s,h=0|r,c=n[h*t+l];s>0&&s<t&&l===s&&(a=n[h*t+l-1],i[0]=s+(o-a)/(c-a)-.5),r>0&&r<e&&h===r&&(a=n[(h-1)*t+l],i[1]=r+(o-a)/(c-a)-.5)})}return M(o,"a"),M(a,"s"),M(s,"r"),M(r,"l"),M(l,"h"),Fe(o,"contours"),Fe(a,"contour"),Fe(s,"isorings"),Fe(r,"index"),Fe(l,"smoothLinear"),o.contour=a,o.size=function(i){if(!arguments.length)return[t,e];var n=Math.ceil(i[0]),a=Math.ceil(i[1]);if(!(n>0&&a>0))throw new Error("invalid size");return t=n,e=a,o},o.thresholds=function(t){return arguments.length?(i="function"==typeof t?t:Array.isArray(t)?Ro(Eo.call(t)):Ro(t),o):i},o.smooth=function(t){return arguments.length?(n=t?l:Bo,o):n===l},o}function $o(t,e,i){for(var n=t.width,o=t.height,a=1+(i<<1),s=0;s<o;++s)for(var r=0,l=0;r<n+i;++r)r<n&&(l+=t.data[r+s*n]),r>=i&&(r>=a&&(l-=t.data[r-a+s*n]),e.data[r-i+s*n]=l/Math.min(r+1,n-1+a-r,a))}function Wo(t,e,i){for(var n=t.width,o=t.height,a=1+(i<<1),s=0;s<n;++s)for(var r=0,l=0;r<o+i;++r)r<o&&(l+=t.data[s+r*n]),r>=i&&(r>=a&&(l-=t.data[s+(r-a)*n]),e.data[s+(r-i)*n]=l/Math.min(r+1,o-1+a-r,a))}function qo(t){return t[0]}function Go(t){return t[1]}function Uo(){return 1}function Xo(){var t=qo,e=Go,i=Uo,n=960,o=500,a=20,s=2,r=3*a,l=n+2*r>>s,h=o+2*r>>s,c=Ro(20);function u(n){var o=new Float32Array(l*h),u=new Float32Array(l*h);n.forEach(function(n,a,c){var u=+t(n,a,c)+r>>s,p=+e(n,a,c)+r>>s,d=+i(n,a,c);u>=0&&u<l&&p>=0&&p<h&&(o[u+p*l]+=d)}),$o({width:l,height:h,data:o},{data:u},a>>s),Wo({width:l,height:h,data:u},{data:o},a>>s),$o({width:l,height:h,data:o},{data:u},a>>s),Wo({width:l,height:h,data:u},{data:o},a>>s),$o({width:l,height:h,data:o},{data:u},a>>s),Wo({width:l,height:h,data:u},{data:o},a>>s);var d=c(o);if(!Array.isArray(d)){var f=yt(o);d=It(0,f,d),(d=Et(0,Math.floor(f/d)*d,d)).shift()}return Ho().thresholds(d).size([l,h])(o).map(p)}function p(t){return t.value*=Math.pow(2,-2*s),t.coordinates.forEach(d),t}function d(t){t.forEach(f)}function f(t){t.forEach(y)}function y(t){t[0]=t[0]*Math.pow(2,s)-r,t[1]=t[1]*Math.pow(2,s)-r}function _(){return l=n+2*(r=3*a)>>s,h=o+2*r>>s,u}return M(u,"p"),M(p,"d"),M(d,"f"),M(f,"y"),M(y,"_"),M(_,"x"),Fe(u,"density"),Fe(p,"transform"),Fe(d,"transformPolygon"),Fe(f,"transformRing"),Fe(y,"transformPoint"),Fe(_,"resize"),u.x=function(e){return arguments.length?(t="function"==typeof e?e:Ro(+e),u):t},u.y=function(t){return arguments.length?(e="function"==typeof t?t:Ro(+t),u):e},u.weight=function(t){return arguments.length?(i="function"==typeof t?t:Ro(+t),u):i},u.size=function(t){if(!arguments.length)return[n,o];var e=Math.ceil(t[0]),i=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return n=e,o=i,_()},u.cellSize=function(t){if(!arguments.length)return 1<<s;if(!((t=+t)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(t)/Math.LN2),_()},u.thresholds=function(t){return arguments.length?(c="function"==typeof t?t:Array.isArray(t)?Ro(Eo.call(t)):Ro(t),u):c},u.bandwidth=function(t){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return a=Math.round((Math.sqrt(4*t*t+1)-1)/2),_()},u}function Yo(){return new Qo}function Qo(){this.reset()}M(Ho,"sn"),M($o,"rn"),M(Wo,"ln"),M(qo,"hn"),M(Go,"cn"),M(Uo,"un"),M(Xo,"pn"),M(Yo,"dn"),M(Qo,"fn"),Fe(Ho,"contours"),Fe($o,"blurX"),Fe(Wo,"blurY"),Fe(qo,"defaultX"),Fe(Go,"defaultY"),Fe(Uo,"defaultWeight"),Fe(Xo,"d3ContourDensity"),Fe(Yo,"adder"),Fe(Qo,"Adder"),Qo.prototype={constructor:Qo,reset:/* @__PURE__ */Fe(function(){this.s=this.t=0},"reset"),add:/* @__PURE__ */Fe(function(t){Jo(Zo,t,this.t),Jo(this,Zo.s,this.s),this.s?this.t+=Zo.t:this.s=Zo.t},"add"),valueOf:/* @__PURE__ */Fe(function(){return this.s},"valueOf")};var Zo=new Qo;function Jo(t,e,i){var n=t.s=e+i,o=n-e,a=n-o;t.t=e-a+(i-o)}M(Jo,"_n"),Fe(Jo,"add");var Ko=2*Math.PI,ta=Math.abs,ea=Math.sqrt;function ia(){}function na(t,e){t&&aa.hasOwnProperty(t.type)&&aa[t.type](t,e)}M(ia,"bn"),M(na,"vn"),Fe(ia,"noop$1"),Fe(na,"streamGeometry");var oa={Feature:/* @__PURE__ */Fe(function(t,e){na(t.geometry,e)},"Feature"),FeatureCollection:/* @__PURE__ */Fe(function(t,e){for(var i=t.features,n=-1,o=i.length;++n<o;)na(i[n].geometry,e)},"FeatureCollection")},aa={Sphere:/* @__PURE__ */Fe(function(t,e){e.sphere()},"Sphere"),Point:/* @__PURE__ */Fe(function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},"Point"),MultiPoint:/* @__PURE__ */Fe(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)t=i[n],e.point(t[0],t[1],t[2])},"MultiPoint"),LineString:/* @__PURE__ */Fe(function(t,e){sa(t.coordinates,e,0)},"LineString"),MultiLineString:/* @__PURE__ */Fe(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)sa(i[n],e,0)},"MultiLineString"),Polygon:/* @__PURE__ */Fe(function(t,e){ra(t.coordinates,e)},"Polygon"),MultiPolygon:/* @__PURE__ */Fe(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)ra(i[n],e)},"MultiPolygon"),GeometryCollection:/* @__PURE__ */Fe(function(t,e){for(var i=t.geometries,n=-1,o=i.length;++n<o;)na(i[n],e)},"GeometryCollection")};function sa(t,e,i){var n,o=-1,a=t.length-i;for(e.lineStart();++o<a;)n=t[o],e.point(n[0],n[1],n[2]);e.lineEnd()}function ra(t,e){var i=-1,n=t.length;for(e.polygonStart();++i<n;)sa(t[i],e,1);e.polygonEnd()}function la(t,e){t&&oa.hasOwnProperty(t.type)?oa[t.type](t,e):na(t,e)}function ha(t){return t}M(sa,"An"),M(ra,"kn"),M(la,"Mn"),M(ha,"Pn"),Fe(sa,"streamLine"),Fe(ra,"streamPolygon"),Fe(la,"geoStream"),Fe(ha,"identity");var ca,ua,pa,da,fa=Yo(),ya=Yo(),_a={point:ia,lineStart:ia,lineEnd:ia,polygonStart:/* @__PURE__ */Fe(function(){_a.lineStart=xa,_a.lineEnd=ba},"polygonStart"),polygonEnd:/* @__PURE__ */Fe(function(){_a.lineStart=_a.lineEnd=_a.point=ia,fa.add(ta(ya)),ya.reset()},"polygonEnd"),result:/* @__PURE__ */Fe(function(){var t=fa/2;return fa.reset(),t},"result")};function xa(){_a.point=ma}function ma(t,e){_a.point=ga,ca=pa=t,ua=da=e}function ga(t,e){ya.add(da*t-pa*e),pa=t,da=e}function ba(){ga(ca,ua)}M(xa,"Dn"),M(ma,"On"),M(ga,"jn"),M(ba,"Nn"),Fe(xa,"areaRingStart"),Fe(ma,"areaPointFirst"),Fe(ga,"areaPoint"),Fe(ba,"areaRingEnd");var va=1/0,wa=va,Sa=-va,ka=Sa,Aa={point:Ca,lineStart:ia,lineEnd:ia,polygonStart:ia,polygonEnd:ia,result:/* @__PURE__ */Fe(function(){var t=[[va,wa],[Sa,ka]];return Sa=ka=-(wa=va=1/0),t},"result")};function Ca(t,e){t<va&&(va=t),t>Sa&&(Sa=t),e<wa&&(wa=e),e>ka&&(ka=e)}M(Ca,"qn"),Fe(Ca,"boundsPoint");var Ma,Pa,Ta,Ia,Ea=0,Fa=0,Da=0,Ra=0,za=0,Oa=0,ja=0,Na=0,La=0,Ba={point:Va,lineStart:Ha,lineEnd:qa,polygonStart:/* @__PURE__ */Fe(function(){Ba.lineStart=Ga,Ba.lineEnd=Ua},"polygonStart"),polygonEnd:/* @__PURE__ */Fe(function(){Ba.point=Va,Ba.lineStart=Ha,Ba.lineEnd=qa},"polygonEnd"),result:/* @__PURE__ */Fe(function(){var t=La?[ja/La,Na/La]:Oa?[Ra/Oa,za/Oa]:Da?[Ea/Da,Fa/Da]:[NaN,NaN];return Ea=Fa=Da=Ra=za=Oa=ja=Na=La=0,t},"result")};function Va(t,e){Ea+=t,Fa+=e,++Da}function Ha(){Ba.point=$a}function $a(t,e){Ba.point=Wa,Va(Ta=t,Ia=e)}function Wa(t,e){var i=t-Ta,n=e-Ia,o=ea(i*i+n*n);Ra+=o*(Ta+t)/2,za+=o*(Ia+e)/2,Oa+=o,Va(Ta=t,Ia=e)}function qa(){Ba.point=Va}function Ga(){Ba.point=Xa}function Ua(){Ya(Ma,Pa)}function Xa(t,e){Ba.point=Ya,Va(Ma=Ta=t,Pa=Ia=e)}function Ya(t,e){var i=t-Ta,n=e-Ia,o=ea(i*i+n*n);Ra+=o*(Ta+t)/2,za+=o*(Ia+e)/2,Oa+=o,ja+=(o=Ia*t-Ta*e)*(Ta+t),Na+=o*(Ia+e),La+=3*o,Va(Ta=t,Ia=e)}function Qa(t){this._context=t}M(Va,"ao"),M(Ha,"so"),M($a,"ro"),M(Wa,"lo"),M(qa,"ho"),M(Ga,"co"),M(Ua,"uo"),M(Xa,"po"),M(Ya,"fo"),M(Qa,"yo"),Fe(Va,"centroidPoint"),Fe(Ha,"centroidLineStart"),Fe($a,"centroidPointFirstLine"),Fe(Wa,"centroidPointLine"),Fe(qa,"centroidLineEnd"),Fe(Ga,"centroidRingStart"),Fe(Ua,"centroidRingEnd"),Fe(Xa,"centroidPointFirstRing"),Fe(Ya,"centroidPointRing"),Fe(Qa,"PathContext"),Qa.prototype={_radius:4.5,pointRadius:/* @__PURE__ */Fe(function(t){return this._radius=t,this},"pointRadius"),polygonStart:/* @__PURE__ */Fe(function(){this._line=0},"polygonStart"),polygonEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"polygonEnd"),lineStart:/* @__PURE__ */Fe(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){0===this._line&&this._context.closePath(),this._point=NaN},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Ko)}},"point"),result:ia};var Za,Ja,Ka,ts,es,is=Yo(),ns={point:ia,lineStart:/* @__PURE__ */Fe(function(){ns.point=os},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){Za&&as(Ja,Ka),ns.point=ia},"lineEnd"),polygonStart:/* @__PURE__ */Fe(function(){Za=!0},"polygonStart"),polygonEnd:/* @__PURE__ */Fe(function(){Za=null},"polygonEnd"),result:/* @__PURE__ */Fe(function(){var t=+is;return is.reset(),t},"result")};function os(t,e){ns.point=as,Ja=ts=t,Ka=es=e}function as(t,e){ts-=t,es-=e,is.add(ea(ts*ts+es*es)),ts=t,es=e}function ss(){this._string=[]}function rs(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ls(t,e){var i,n,o=4.5;function a(t){return t&&("function"==typeof o&&n.pointRadius(+o.apply(this,arguments)),la(t,i(n))),n.result()}return M(a,"s"),Fe(a,"path"),a.area=function(t){return la(t,i(_a)),_a.result()},a.measure=function(t){return la(t,i(ns)),ns.result()},a.bounds=function(t){return la(t,i(Aa)),Aa.result()},a.centroid=function(t){return la(t,i(Ba)),Ba.result()},a.projection=function(e){return arguments.length?(i=null==e?(t=null,ha):(t=e).stream,a):t},a.context=function(t){return arguments.length?(n=null==t?(e=null,new ss):new Qa(e=t),"function"!=typeof o&&n.pointRadius(o),a):e},a.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(n.pointRadius(+t),+t),a):o},a.projection(t).context(e)}M(os,"So"),M(as,"Ao"),M(ss,"ko"),M(rs,"Mo"),M(ls,"Po"),Fe(os,"lengthPointFirst"),Fe(as,"lengthPoint"),Fe(ss,"PathString"),ss.prototype={_radius:4.5,_circle:rs(4.5),pointRadius:/* @__PURE__ */Fe(function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},"pointRadius"),polygonStart:/* @__PURE__ */Fe(function(){this._line=0},"polygonStart"),polygonEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"polygonEnd"),lineStart:/* @__PURE__ */Fe(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){0===this._line&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=rs(this._radius)),this._string.push("M",t,",",e,this._circle)}},"point"),result:/* @__PURE__ */Fe(function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null},"result")},Fe(rs,"circle"),Fe(ls,"geoPath");const hs=(M(h=class extends on{_dataMinWeight;_dataMaxWeight;constructor(){super(),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerEnter(t,e,i=250){super.layerEnter(t,e,i)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i),this._palette=this._palette.switch(this.paletteID());const n=this.flattenData(this.layerColumns(t),this.layerData(t)),o=Xo().x(e=>this.xPos(t,e)).y(e=>this.yPos(t,e)).size([this.width(),this.height()]).bandwidth(this.contourBandwidth())(n),a=o.map(t=>t.value),s=Math.min.apply(this,a),r=Math.max.apply(this,a);this._dataMinWeight=s,this._dataMaxWeight=r;const l=e.selectAll("path").data(o);l.enter().append("path").merge(l).attr("d",ls()).attr("fill",t=>this.showContourFill()?this._palette(t.value,s,r):"none").attr("stroke",this.contourStrokeColor()).attr("stroke-linejoin","round").attr("stroke-width",this.contourStrokeWidth()),l.exit().remove()}exit(t,e){super.exit(t,e)}},"_Contour"),h);Fe(hs,"Contour"),De(hs,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let cs=hs;cs.prototype._class+=" chart_Contour",cs.prototype.implements(ge.prototype),cs.prototype.publish("paletteID","YlGnBu","string","Color palette for this widget"),cs.prototype.publish("useClonedPalette",!0,"boolean","Enable or disable using a cloned palette"),cs.prototype.publish("showContourFill",!0,"boolean","Show/hide the contour background colors"),cs.prototype.publish("showContour",!0,"boolean","Show/hide the contour border lines"),cs.prototype.publish("contourBandwidth",40,"number","Controls the sensitivity of the contour grouping algorithm"),cs.prototype.publish("contourStrokeColor","#2C3A47","html-color","Color of the contour border lines"),cs.prototype.publish("contourStrokeWidth",1,"number","Width of the contour border lines");const us=(M(c=class extends un{constructor(){super(),this.orientation_default("vertical").xAxisType_default("ordinal").yAxisType_default("time")}},"_Gantt"),c);Fe(us,"Gantt");let ps=us;function ds(t){return Fe(function(){return t},"constant")}M(ds,"Io"),ps.prototype._class+=" chart_Gantt",Fe(ds,"constant");var fs=1e-12,ys=Math.PI,_s=ys/2,xs=2*ys;function ms(t){return t.innerRadius}function gs(t){return t.outerRadius}function bs(t){return t.startAngle}function vs(t){return t.endAngle}function ws(t){return t&&t.padAngle}function Ss(t){return t>=1?_s:t<=-1?-_s:Math.asin(t)}function ks(t,e,i,n,o,a,s,r){var l=i-t,h=n-e,c=s-o,u=r-a,p=(c*(e-a)-u*(t-o))/(u*l-c*h);return[t+p*l,e+p*h]}function As(t,e,i,n,o,a,s){var r=t-i,l=e-n,h=(s?a:-a)/Math.sqrt(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-a,w=p*y-f*d,S=(g<0?-1:1)*Math.sqrt(Math.max(0,v*v*b-w*w)),k=(w*g-m*S)/b,A=(-w*m-g*S)/b,C=(w*g+m*S)/b,M=(-w*m+g*S)/b,P=k-_,T=A-x,I=C-_,E=M-x;return P*P+T*T>I*I+E*E&&(k=C,A=M),{cx:k,cy:A,x01:-c,y01:-u,x11:k*(o/v-1),y11:A*(o/v-1)}}function Cs(){var t=ms,e=gs,i=ds(0),n=null,o=bs,a=vs,s=ws,r=null;function l(){var l,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),p=o.apply(this,arguments)-_s,d=a.apply(this,arguments)-_s,f=Math.abs(d-p),y=d>p;if(r||(r=l=Le()),u<c&&(h=u,u=c,c=h),u>fs)if(f>xs-fs)r.moveTo(u*Math.cos(p),u*Math.sin(p)),r.arc(0,0,u,p,d,!y),c>fs&&(r.moveTo(c*Math.cos(d),c*Math.sin(d)),r.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,k=s.apply(this,arguments)/2,A=k>fs&&(n?+n.apply(this,arguments):Math.sqrt(c*c+u*u)),C=Math.min(Math.abs(u-c)/2,+i.apply(this,arguments)),M=C,P=C;if(A>fs){var T=Ss(A/c*Math.sin(k)),I=Ss(A/u*Math.sin(k));(w-=2*T)>fs?(b+=T*=y?1:-1,v-=T):(w=0,b=v=(p+d)/2),(S-=2*I)>fs?(m+=I*=y?1:-1,g-=I):(S=0,m=g=(p+d)/2)}var E=u*Math.cos(m),F=u*Math.sin(m),D=c*Math.cos(v),R=c*Math.sin(v);if(C>fs){var z=u*Math.cos(g),O=u*Math.sin(g),j=c*Math.cos(b),N=c*Math.sin(b);if(f<ys){var L=w>fs?ks(E,F,j,N,z,O,D,R):[D,R],B=E-L[0],V=F-L[1],H=z-L[0],$=O-L[1],W=1/Math.sin(Math.acos((B*H+V*$)/(Math.sqrt(B*B+V*V)*Math.sqrt(H*H+$*$)))/2),q=Math.sqrt(L[0]*L[0]+L[1]*L[1]);M=Math.min(C,(c-q)/(W-1)),P=Math.min(C,(u-q)/(W+1))}}S>fs?P>fs?(_=As(j,N,E,F,u,P,y),x=As(z,O,D,R,u,P,y),r.moveTo(_.cx+_.x01,_.cy+_.y01),P<C?r.arc(_.cx,_.cy,P,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,P,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),r.arc(0,0,u,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),!y),r.arc(x.cx,x.cy,P,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):(r.moveTo(E,F),r.arc(0,0,u,m,g,!y)):r.moveTo(E,F),c>fs&&w>fs?M>fs?(_=As(D,R,z,O,c,-M,y),x=As(E,F,j,N,c,-M,y),r.lineTo(_.cx+_.x01,_.cy+_.y01),M<C?r.arc(_.cx,_.cy,M,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,M,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),r.arc(0,0,c,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),y),r.arc(x.cx,x.cy,M,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):r.arc(0,0,c,v,b,y):r.lineTo(D,R)}else r.moveTo(0,0);if(r.closePath(),l)return r=null,l+""||null}return M(l,"h"),Fe(l,"arc"),l.centroid=function(){var i=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-ys/2;return[Math.cos(n)*i,Math.sin(n)*i]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ds(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ds(+t),l):e},l.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:ds(+t),l):i},l.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:ds(+t),l):n},l.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:ds(+t),l):o},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:ds(+t),l):a},l.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:ds(+t),l):s},l.context=function(t){return arguments.length?(r=null==t?null:t,l):r},l}function Ms(t){this._context=t}function Ps(t){return new Ms(t)}function Ts(t){return t[0]}function Is(t){return t[1]}function Es(){var t=Ts,e=Is,i=ds(!0),n=null,o=Ps,a=null;function s(s){var r,l,h,c=s.length,u=!1;for(null==n&&(a=o(h=Le())),r=0;r<=c;++r)!(r<c&&i(l=s[r],r,s))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+t(l,r,s),+e(l,r,s));if(h)return a=null,h+""||null}return M(s,"r"),Fe(s,"line"),s.x=function(e){return arguments.length?(t="function"==typeof e?e:ds(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:ds(+t),s):e},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:ds(!!t),s):i},s.curve=function(t){return arguments.length?(o=t,null!=n&&(a=o(n)),s):o},s.context=function(t){return arguments.length?(null==t?n=a=null:a=o(n=t),s):n},s}function Fs(){}function Ds(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function Rs(t){this._context=t}function zs(t,e){this._basis=new Rs(t),this._beta=e}function Os(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function js(t,e){this._context=t,this._k=(1-e)/6}function Ns(t,e){this._context=t,this._k=(1-e)/6}function Ls(t,e){this._context=t,this._k=(1-e)/6}function Bs(t,e,i){var n=t._x1,o=t._y1,a=t._x2,s=t._y2;if(t._l01_a>fs){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>fs){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*h+t._x1*t._l23_2a-e*t._l12_2a)/c,s=(s*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,a,s,t._x2,t._y2)}function Vs(t,e){this._context=t,this._alpha=e}M(ms,"jo"),M(gs,"No"),M(bs,"Lo"),M(vs,"Bo"),M(ws,"$o"),M(Ss,"Ho"),M(ks,"Vo"),M(As,"qo"),M(Cs,"Wo"),M(Ms,"Go"),M(Ps,"Xo"),M(Ts,"Yo"),M(Is,"Uo"),M(Es,"Qo"),M(Fs,"Zo"),M(Ds,"Jo"),M(Rs,"Ko"),M(zs,"ta"),M(Os,"ea"),M(js,"ia"),M(Ns,"na"),M(Ls,"oa"),M(Bs,"aa"),M(Vs,"sa"),Fe(ms,"arcInnerRadius"),Fe(gs,"arcOuterRadius"),Fe(bs,"arcStartAngle"),Fe(vs,"arcEndAngle"),Fe(ws,"arcPadAngle"),Fe(Ss,"asin"),Fe(ks,"intersect"),Fe(As,"cornerTangents"),Fe(Cs,"arc"),Fe(Ms,"Linear"),Ms.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},Fe(Ps,"curveLinear"),Fe(Ts,"x"),Fe(Is,"y"),Fe(Es,"line"),Fe(Fs,"noop"),Fe(Ds,"point$3"),Fe(Rs,"Basis"),Rs.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 3:Ds(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ds(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},Fe(zs,"Bundle"),zs.prototype={lineStart:/* @__PURE__ */Fe(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],a=e[0],s=t[i]-o,r=e[i]-a,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*s),this._beta*e[l]+(1-this._beta)*(a+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},Fe(Os,"point$2"),Fe(js,"Cardinal"),js.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Os(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Os(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},Fe(Ns,"CardinalClosed"),Ns.prototype={areaStart:Fs,areaEnd:Fs,lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Os(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},Fe(Ls,"CardinalOpen"),Ls.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Os(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},Fe(Bs,"point$1"),Fe(Vs,"CatmullRom"),Vs.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Bs(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const Hs=/* @__PURE__ */Fe(/* @__PURE__ */M(function t(e){function i(t){return e?new Vs(t,e):new js(t,0)}return M(i,"n"),Fe(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"t"),"custom")(.5);function $s(t,e){this._context=t,this._alpha=e}function Ws(t,e){this._context=t,this._alpha=e}function qs(t){return t<0?-1:1}function Gs(t,e,i){var n=t._x1-t._x0,o=e-t._x1,a=(t._y1-t._y0)/(n||o<0&&-0),s=(i-t._y1)/(o||n<0&&-0),r=(a*o+s*n)/(n+o);return(qs(a)+qs(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(r))||0}function Us(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Xs(t,e,i){var n=t._x0,o=t._y0,a=t._x1,s=t._y1,r=(a-n)/3;t._context.bezierCurveTo(n+r,o+r*e,a-r,s-r*i,a,s)}function Ys(t){this._context=t}M($s,"la"),M(Ws,"ha"),M(qs,"ca"),M(Gs,"ua"),M(Us,"pa"),M(Xs,"da"),M(Ys,"fa"),Fe($s,"CatmullRomClosed"),$s.prototype={areaStart:Fs,areaEnd:Fs,lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Bs(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},Fe(Ws,"CatmullRomOpen"),Ws.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Bs(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},Fe(qs,"sign"),Fe(Gs,"slope3"),Fe(Us,"slope2"),Fe(Xs,"point"),Fe(Ys,"MonotoneX"),Ys.prototype={areaStart:/* @__PURE__ */Fe(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */Fe(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */Fe(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */Fe(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Xs(this,this._t0,Us(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */Fe(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Xs(this,Us(this,i=Gs(this,t,e)),i);break;default:Xs(this,this._t0,i=Gs(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(Ys.prototype).point=function(t,e){Ys.prototype.point.call(this,e,t)};var Qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zs=/* @__PURE__ */Fe(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},"classCallCheck"),Js=/* @__PURE__ */function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return M(t,"t"),Fe(t,"defineProperties"),function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Ks=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},tr=/* @__PURE__ */Fe(/* @__PURE__ */M(function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var s=o.get;return void 0!==s?s.call(n):void 0},"t"),"get"),er=/* @__PURE__ */Fe(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},"inherits"),ir=/* @__PURE__ */Fe(function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},"possibleConstructorReturn"),nr=/* @__PURE__ */Fe(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)},"toConsumableArray"),or=function(){function t(e){var i=e.x,n=void 0===i?0:i,o=e.y,a=void 0===o?0:o,s=e.nx,r=e.ny,l=e.dy,h=void 0===l?0:l,c=e.dx,u=void 0===c?0:c,p=e.color,d=void 0===p?"grey":p,f=e.data,y=e.type,_=e.subject,x=e.connector,m=e.note,g=e.disable,b=e.id,v=e.className;Zs(this,t),this._dx=void 0!==s?s-n:u,this._dy=void 0!==r?r-a:h,this._x=n,this._y=a,this._color=d,this.id=b,this._className=v||"",this._type=y||"",this.data=f,this.note=m||{},this.connector=x||{},this.subject=_||{},this.disable=g||[]}return M(t,"t"),Fe(t,"Annotation"),Js(t,[{key:"updatePosition",value:/* @__PURE__ */Fe(function(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&0!==this.type.subject.selectAll(":not(.handle)").nodes().length&&this.type.redrawSubject())},"updatePosition")},{key:"clearComponents",value:/* @__PURE__ */Fe(function(){this.type.clearComponents&&this.type.clearComponents()},"clearComponents")},{key:"updateOffset",value:/* @__PURE__ */Fe(function(){this.type.setOffset&&(this.type.setOffset(),0!==this.type.connector.selectAll(":not(.handle)").nodes().length&&this.type.redrawConnector(),this.type.redrawNote())},"updateOffset")},{key:"className",get:/* @__PURE__ */Fe(function(){return this._className},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._className=t,this.type.setClassName&&this.type.setClassName()},"set$$1")},{key:"type",get:/* @__PURE__ */Fe(function(){return this._type},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._type=t,this.clearComponents()},"set$$1")},{key:"x",get:/* @__PURE__ */Fe(function(){return this._x},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._x=t,this.updatePosition()},"set$$1")},{key:"y",get:/* @__PURE__ */Fe(function(){return this._y},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._y=t,this.updatePosition()},"set$$1")},{key:"color",get:/* @__PURE__ */Fe(function(){return this._color},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._color=t,this.updatePosition()},"set$$1")},{key:"dx",get:/* @__PURE__ */Fe(function(){return this._dx},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._dx=t,this.updateOffset()},"set$$1")},{key:"dy",get:/* @__PURE__ */Fe(function(){return this._dy},"get$$1"),set:/* @__PURE__ */Fe(function(t){this._dy=t,this.updateOffset()},"set$$1")},{key:"nx",set:/* @__PURE__ */Fe(function(t){this._dx=t-this._x,this.updateOffset()},"set$$1")},{key:"ny",set:/* @__PURE__ */Fe(function(t){this._dy=t-this._y,this.updateOffset()},"set$$1")},{key:"offset",get:/* @__PURE__ */Fe(function(){return{x:this._dx,y:this._dy}},"get$$1"),set:/* @__PURE__ */Fe(function(t){var e=t.x,i=t.y;this._dx=e,this._dy=i,this.updateOffset()},"set$$1")},{key:"position",get:/* @__PURE__ */Fe(function(){return{x:this._x,y:this._y}},"get$$1"),set:/* @__PURE__ */Fe(function(t){var e=t.x,i=t.y;this._x=e,this._y=i,this.updatePosition()},"set$$1")},{key:"translation",get:/* @__PURE__ */Fe(function(){return{x:this._x+this._dx,y:this._y+this._dy}},"get$$1")},{key:"json",get:/* @__PURE__ */Fe(function(){var t={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t},"get$$1")}]),t}(),ar=function(){function t(e){var i=e.annotations,n=e.accessors,o=e.accessorsInverse;Zs(this,t),this.accessors=n,this.accessorsInverse=o,this.annotations=i}return M(t,"t"),Fe(t,"AnnotationCollection"),Js(t,[{key:"clearTypes",value:/* @__PURE__ */Fe(function(t){this.annotations.forEach(function(e){e.type=void 0,e.subject=t&&t.subject||e.subject,e.connector=t&&t.connector||e.connector,e.note=t&&t.note||e.note})},"clearTypes")},{key:"setPositionWithAccessors",value:/* @__PURE__ */Fe(function(){var t=this;this.annotations.forEach(function(e){e.type.setPositionWithAccessors(t.accessors)})},"setPositionWithAccessors")},{key:"editMode",value:/* @__PURE__ */Fe(function(t){this.annotations.forEach(function(e){e.type&&(e.type.editMode=t,e.type.updateEditMode())})},"editMode")},{key:"updateDisable",value:/* @__PURE__ */Fe(function(t){this.annotations.forEach(function(e){e.disable=t,e.type&&t.forEach(function(t){e.type[t]&&(e.type[t].remove&&e.type[t].remove(),e.type[t]=void 0)})})},"updateDisable")},{key:"updateTextWrap",value:/* @__PURE__ */Fe(function(t){this.annotations.forEach(function(e){e.type&&e.type.updateTextWrap&&e.type.updateTextWrap(t)})},"updateTextWrap")},{key:"updateText",value:/* @__PURE__ */Fe(function(){this.annotations.forEach(function(t){t.type&&t.type.drawText&&t.type.drawText()})},"updateText")},{key:"updateNotePadding",value:/* @__PURE__ */Fe(function(t){this.annotations.forEach(function(e){e.type&&(e.type.notePadding=t)})},"updateNotePadding")},{key:"json",get:/* @__PURE__ */Fe(function(){var t=this;return this.annotations.map(function(e){var i=e.json;return t.accessorsInverse&&e.data&&(i.data={},Object.keys(t.accessorsInverse).forEach(function(n){i.data[n]=t.accessorsInverse[n]({x:e.x,y:e.y})})),i})},"get$$1")},{key:"noteNodes",get:/* @__PURE__ */Fe(function(){return this.annotations.map(function(t){return Ks({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})})},"get$$1")}]),t}(),sr=/* @__PURE__ */Fe(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy;return{move:{x:i,y:void 0===n?0:n}}},"pointHandle"),rr=/* @__PURE__ */Fe(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy,o=void 0===n?0:n,a=t.r1,s=t.r2,r=t.padding,l={move:{x:i,y:o}};return void 0!==a&&(l.r1={x:i+a/Math.sqrt(2),y:o+a/Math.sqrt(2)}),void 0!==s&&(l.r2={x:i+s/Math.sqrt(2),y:o+s/Math.sqrt(2)}),void 0!==r&&(l.padding={x:i+a+r,y:o}),l},"circleHandles"),lr=/* @__PURE__ */Fe(function(t){var e=t.group,i=t.handles,n=t.r,o=void 0===n?10:n,a=e.selectAll("circle.handle").data(i);a.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(vt().container($("g.annotations").node()).on("start",function(t){return t.start&&t.start(t)}).on("drag",function(t){return t.drag&&t.drag(t)}).on("end",function(t){return t.end&&t.end(t)})),e.selectAll("circle.handle").attr("cx",function(t){return t.x}).attr("cy",function(t){return t.y}).attr("r",function(t){return t.r||o}).attr("class",function(t){return"handle "+(t.className||"")}),a.exit().remove()},"addHandles"),hr=/* @__PURE__ */Fe(function(t,e){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},"leftRightDynamic"),cr=/* @__PURE__ */Fe(function(t,e){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},"topBottomDynamic"),ur=["topBottom","top","bottom"],pr=["leftRight","left","right"],dr=/* @__PURE__ */Fe(function(t){var e=t.padding,i=void 0===e?0:e,n=t.bbox,o=void 0===n?{x:0,width:0,height:0}:n,a=t.align,s=t.orientation,r=t.offset,l=void 0===r?{x:0,y:0}:r,h=-o.x,c=0;return-1!==ur.indexOf(s)?(a=cr(a,l.x),l.y<0&&"topBottom"===s||"top"===s?c-=o.height+i:c+=i,"middle"===a?h-=o.width/2:"right"===a&&(h-=o.width)):-1!==pr.indexOf(s)&&(a=hr(a,l.y),l.x<0&&"leftRight"===s||"left"===s?h-=o.width+i:h+=i,"middle"===a?c-=o.height/2:"top"===a&&(c-=o.height)),{x:h,y:c}},"noteAlignment"),fr=/* @__PURE__ */Fe(function(t){var e=t.data,i=t.curve,n=void 0===i?Ps:i,o=t.canvasContext,a=t.className,s=t.classID,r=Es().curve(n),l={type:"path",className:a,classID:s,data:e};return o?(r.context(o),l.pathMethods=r):l.attrs={d:r(e)},l},"lineBuilder"),yr=/* @__PURE__ */Fe(function(t){var e=t.data,i=t.canvasContext,n={type:"path",className:t.className,classID:t.classID,data:e},o=Cs().innerRadius(e.innerRadius||0).outerRadius(e.outerRadius||e.radius||2).startAngle(e.startAngle||0).endAngle(e.endAngle||2*Math.PI);return i?(o.context(i),n.pathMethods=lineGen):n.attrs={d:o()},n},"arcBuilder"),_r=/* @__PURE__ */Fe(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,a=void 0===o?0:o,s=t.bbox,r=t.offset;"top"===(e=hr(e,r.y))?a-=s.height:"middle"===e&&(a-=s.height/2);var l=[[n,a],[n,a+s.height]];return{components:[fr({data:l,className:"note-line"})]}},"noteVertical"),xr=/* @__PURE__ */Fe(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,a=void 0===o?0:o,s=t.offset,r=t.bbox;"right"===(e=cr(e,s.x))?n-=r.width:"middle"===e&&(n-=r.width/2);var l=[[n,a],[n+r.width,a]];return{components:[fr({data:l,className:"note-line"})]}},"noteHorizontal"),mr=/* @__PURE__ */Fe(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,a=n.x-o.x,s=a+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("circle"===i&&(h.outerRadius||h.radius)){var c=Math.sqrt((a-s)*(a-s)+(r-l)*(r-l)),u=Math.asin(-l/c),p=h.outerRadius||h.radius+(h.radiusPadding||0);a=Math.abs(Math.cos(u)*p)*(s<0?-1:1),r=Math.abs(Math.sin(u)*p)*(l<0?-1:1)}if("rect"===i){var d=h.width,f=h.height;(d>0&&n.dx>0||d<0&&n.dx<0)&&(a=Math.abs(d)>Math.abs(n.dx)?d/2:d),(f>0&&n.dy>0||f<0&&n.dy<0)&&(r=Math.abs(f)>Math.abs(n.dy)?f/2:f),a===d/2&&r===f/2&&(a=s,r=l)}return[[a,r],[s,l]]},"lineSetup"),gr=/* @__PURE__ */Fe(function(t){var e=mr(t);return{components:[fr({data:e,className:"connector"})]}},"connectorLine"),br=/* @__PURE__ */Fe(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,a=n.x-o.x,s=a+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("rect"===i){var c=h.width,u=h.height;(c>0&&n.dx>0||c<0&&n.dx<0)&&(a=Math.abs(c)>Math.abs(n.dx)?c/2:c),(u>0&&n.dy>0||u<0&&n.dy<0)&&(r=Math.abs(u)>Math.abs(n.dy)?u/2:u),a===c/2&&r===u/2&&(a=s,r=l)}var p=[[a,r],[s,l]],d=l-r,f=s-a,y=s,_=l,x=l<r&&s>a||s<a&&l>r?-1:1;if(Math.abs(f)<Math.abs(d)?(y=s,_=r+f*x):(_=l,y=a+d*x),"circle"===i&&(h.outerRadius||h.radius)){var m=(h.outerRadius||h.radius)+(h.radiusPadding||0),g=m/Math.sqrt(2);if(Math.abs(f)>g&&Math.abs(d)>g)p=[[a=g*(s<0?-1:1),r=g*(l<0?-1:1)],[y,_],[s,l]];else if(Math.abs(f)>Math.abs(d)){var b=Math.asin(-l/m);p=[[a=Math.abs(Math.cos(b)*m)*(s<0?-1:1),l],[s,l]]}else{var v=Math.acos(s/m);p=[[s,r=Math.abs(Math.sin(v)*m)*(l<0?-1:1)],[s,l]]}}else p=[[a,r],[y,_],[s,l]];return{components:[fr({data:p,className:"connector"})]}},"connectorElbow"),vr=/* @__PURE__ */Fe(function(t){var e=t.type,i=t.connectorData,n=t.subjectType;i||(i={}),i.points&&"number"!=typeof i.points||(i.points=wr(e.annotation.offset,i.points)),i.curve||(i.curve=Hs);var o=[];if(e.editMode){var a=i.points.map(function(t,e){return Ks({},sr({cx:t[0],cy:t[1]}),{index:e})}),s=/* @__PURE__ */Fe(function(t){i.points[t][0]+=wt.dx,i.points[t][1]+=wt.dy,e.redrawConnector()},"updatePoint");o=e.mapHandles(a.map(function(t){return Ks({},t.move,{drag:s.bind(e,t.index)})}))}var r=mr({type:e,subjectType:n});return r=[r[0]].concat(nr(i.points),[r[1]]),{components:[fr({data:r,curve:i.curve,className:"connector"})],handles:o}},"connectorCurve"),wr=/* @__PURE__ */Fe(function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=t.x/(e+1),n=t.y/(e+1),o=[],a=1;a<=e;a++)o.push([i*a+a%2*20,n*a-a%2*20]);return o},"createPoints"),Sr=/* @__PURE__ */Fe(function(t){var e=t.annotation,i=t.start,n=t.end,o=t.scale,a=void 0===o?1:o,s=e.position;i=i?[-n[0]+i[0],-n[1]+i[1]]:[e.dx,e.dy],n||(n=[e.x-s.x,e.y-s.y]);var r=n[0],l=n[1],h=i[0],c=i[1],u=10*a,p=16/180*Math.PI,d=Math.atan(c/h);h<0&&(d+=Math.PI);var f=[[r,l],[Math.cos(d+p)*u+r,Math.sin(d+p)*u+l],[Math.cos(d-p)*u+r,Math.sin(d-p)*u+l],[r,l]];return{components:[fr({data:f,className:"connector-end connector-arrow",classID:"connector-end"})]}},"connectorArrow"),kr=/* @__PURE__ */Fe(function(t){var e=t.line,i=t.scale,n=void 0===i?1:i,o=yr({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(n)}});return o.attrs.transform="translate("+e.data[0][0]+", "+e.data[0][1]+")",{components:[o]}},"connectorDot"),Ar=/* @__PURE__ */Fe(function(t){var e=t.subjectData,i=t.type;e.radius||e.outerRadius||(e.radius=20);var n=[],o=yr({data:e,className:"subject"});if(i.editMode){var a=rr({r1:o.data.outerRadius||o.data.radius,r2:o.data.innerRadius,padding:e.radiusPadding}),s=/* @__PURE__ */Fe(function(t){var n=e[t]+wt.dx*Math.sqrt(2);e[t]=n,i.redrawSubject(),i.redrawConnector()},"updateRadius"),r=[Ks({},a.r1,{drag:s.bind(i,void 0!==e.outerRadius?"outerRadius":"radius")})];e.innerRadius&&r.push(Ks({},a.r2,{drag:s.bind(i,"innerRadius")})),n=i.mapHandles(r)}return o.attrs["fill-opacity"]=0,{components:[o],handles:n}},"subjectCircle"),Cr=/* @__PURE__ */Fe(function(t){var e=t.subjectData,i=t.type;e.width||(e.width=100),e.height||(e.height=100);var n=[],o=e.width,a=e.height,s=fr({data:[[0,0],[o,0],[o,a],[0,a],[0,0]],className:"subject"});if(i.editMode){var r=/* @__PURE__ */Fe(function(){e.width=wt.x,i.redrawSubject(),i.redrawConnector()},"updateWidth"),l=/* @__PURE__ */Fe(function(){e.height=wt.y,i.redrawSubject(),i.redrawConnector()},"updateHeight"),h=[{x:o,y:a/2,drag:r.bind(i)},{x:o/2,y:a,drag:l.bind(i)}];n=i.mapHandles(h)}return s.attrs["fill-opacity"]=.1,{components:[s],handles:n}},"subjectRect"),Mr=/* @__PURE__ */Fe(function(t){var e=t.subjectData,i=t.type.annotation.position,n=(void 0!==e.x1?e.x1:i.x)-i.x,o=(void 0!==e.x2?e.x2:i.x)-i.x,a=(void 0!==e.y1?e.y1:i.y)-i.y,s=(void 0!==e.y2?e.y2:i.y)-i.y;return{components:[fr({data:[[n,a],[o,s]],className:"subject"})]}},"subjectThreshold"),Pr=/* @__PURE__ */Fe(function(t){var e=t.subjectData,i=void 0===e?{}:e,n=t.type,o=void 0===n?{}:n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=o.typeSettings&&o.typeSettings.subject;i.radius||(s&&s.radius?i.radius=s.radius:i.radius=14),i.x||s&&s.x&&(i.x=s.x),i.y||s&&s.y&&(i.y=s.y);var r=[],l=[],h=i.radius,c=.7*h,u=0,p=0,d=Math.sqrt(2)*h,f={xleftcorner:-h,xrightcorner:h,ytopcorner:-h,ybottomcorner:h,xleft:-d,xright:d,ytop:-d,ybottom:d};i.x&&!i.y?u=f["x"+i.x]:i.y&&!i.x?p=f["y"+i.y]:i.x&&i.y&&(u=f["x"+i.x+"corner"],p=f["y"+i.y+"corner"]);var y="translate("+u+", "+p+")",_=yr({className:"subject",data:{radius:h}});_.attrs.transform=y,_.attrs.fill=a.color,_.attrs["stroke-linecap"]="round",_.attrs["stroke-width"]="3px";var x=yr({className:"subject-ring",data:{outerRadius:h,innerRadius:c}});x.attrs.transform=y,x.attrs["stroke-width"]="3px",x.attrs.fill="white";var m=void 0;if(u&&p||!u&&!p)m=fr({className:"subject-pointer",data:[[0,0],[u||0,0],[0,p||0],[0,0]]});else if(u||p){var g=/* @__PURE__ */Fe(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*h/Math.sqrt(2)},"notCornerPointerXY");m=fr({className:"subject-pointer",data:[[0,0],[g(u),g(p)],[g(u,-1),g(p,-1)],[0,0]]})}if(m&&(m.attrs.fill=a.color,m.attrs["stroke-linecap"]="round",m.attrs["stroke-width"]="3px",l.push(m)),o.editMode){var b={x:2*u,y:2*p,drag:/* @__PURE__ */Fe(function(){i.x=wt.x<2*-h?"left":wt.x>2*h?"right":void 0,i.y=wt.y<2*-h?"top":wt.y>2*h?"bottom":void 0,o.redrawSubject()},"dragBadge").bind(o)};b.x||b.y||(b.y=-h),r=o.mapHandles([b])}var v=void 0;return i.text&&(v={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:i.text,"text-anchor":"middle",dy:".25em",x:u,y:p}}),l.push(_),l.push(x),l.push(v),{components:l,handles:r}},"subjectBadge"),Tr=function(){function t(e){var i=e.a,n=e.annotation,o=e.editMode,a=e.dispatcher,s=e.notePadding,r=e.accessors;if(Zs(this,t),this.a=i,this.note=-1===n.disable.indexOf("note")&&i.select("g.annotation-note"),this.noteContent=this.note&&i.select("g.annotation-note-content"),this.connector=-1===n.disable.indexOf("connector")&&i.select("g.annotation-connector"),this.subject=-1===n.disable.indexOf("subject")&&i.select("g.annotation-subject"),this.dispatcher=a,a){var l=zr.bind(null,a,n);l({component:this.note,name:"note"}),l({component:this.connector,name:"connector"}),l({component:this.subject,name:"subject"})}this.annotation=n,this.editMode=n.editMode||o,this.notePadding=void 0!==s?s:3,this.offsetCornerX=0,this.offsetCornerY=0,r&&n.data&&this.init(r)}return M(t,"t"),Fe(t,"Type"),Js(t,[{key:"init",value:/* @__PURE__ */Fe(function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)},"init")},{key:"mapY",value:/* @__PURE__ */Fe(function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))},"mapY")},{key:"mapX",value:/* @__PURE__ */Fe(function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))},"mapX")},{key:"updateEditMode",value:/* @__PURE__ */Fe(function(){this.a.selectAll("circle.handle").remove()},"updateEditMode")},{key:"drawOnSVG",value:/* @__PURE__ */Fe(function(t,e){var i=this;Array.isArray(e)||(e=[e]),e.filter(function(t){return t}).forEach(function(e){var n=e.type,o=e.className,a=e.attrs,s=e.handles,r=e.classID;if("handle"===n)lr({group:t,r:a&&a.r,handles:s});else{Rr(t,[i.annotation],n,o,r);for(var l=t.select(n+"."+(r||o)),h=Object.keys(a),c=[],u=l.node().attributes,p=u.length-1;p>=0;p--){var d=u[p].name;-1===h.indexOf(d)&&"class"!==d&&c.push(d)}h.forEach(function(t){"text"===t?l.text(a[t]):l.attr(t,a[t])}),c.forEach(function(t){return l.attr(t,null)})}})},"drawOnSVG")},{key:"getNoteBBox",value:/* @__PURE__ */Fe(function(){return jr(this.note,".annotation-note-content text")},"getNoteBBox")},{key:"getNoteBBoxOffset",value:/* @__PURE__ */Fe(function(){var t=jr(this.note,".annotation-note-content"),e=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(e[1])+this.annotation.dx,t.offsetCornerY=parseFloat(e[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t},"getNoteBBoxOffset")},{key:"drawSubject",value:/* @__PURE__ */Fe(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.subject,n=e.type,o={type:this,subjectData:i},a={};"circle"===n?a=Ar(o):"rect"===n?a=Cr(o):"threshold"===n?a=Mr(o):"badge"===n&&(a=Pr(o,this.annotation));var s=a,r=s.components,l=void 0===r?[]:r,h=s.handles,c=void 0===h?[]:h;return l.forEach(function(e){e&&e.attrs&&!e.attrs.stroke&&(e.attrs.stroke=t.annotation.color)}),this.editMode&&(c=c.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),l.push({type:"handle",handles:c})),l},"drawSubject")},{key:"drawConnector",value:/* @__PURE__ */Fe(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.connector,n=i.type||e.type,o={type:this,connectorData:i};o.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var a="curve"===n?vr(o):"elbow"===n?br(o):gr(o),s=a.components,r=void 0===s?[]:s,l=a.handles,h=void 0===l?[]:l,c=r[0];c&&(c.attrs.stroke=this.annotation.color,c.attrs.fill="none");var u=i.end||e.end,p={};if("arrow"===u){var d=c.data[1],f=c.data[0];Math.sqrt(Math.pow(d[0]-f[0],2)+Math.pow(d[1]-f[1],2))<5&&c.data[2]&&(d=c.data[2]),p=Sr({annotation:this.annotation,start:d,end:f,scale:i.endScale})}else"dot"===u?p=kr({line:c,scale:i.endScale}):u&&"none"!==u||this.connector&&this.connector.select(".connector-end").remove();return p.components&&(p.components.forEach(function(e){e.attrs.fill=t.annotation.color,e.attrs.stroke=t.annotation.color}),r=r.concat(p.components)),this.editMode&&0!==h.length&&r.push({type:"handle",handles:h}),r},"drawConnector")},{key:"drawNote",value:/* @__PURE__ */Fe(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.note,n=i.align||e.align||"dynamic",o={bbox:e.bbox,align:n,offset:this.annotation.offset},a=i.lineType||e.lineType,s={};"vertical"===a?s=_r(o):"horizontal"===a&&(s=xr(o));var r=s,l=r.components,h=void 0===l?[]:l,c=r.handles,u=void 0===c?[]:c;if(h.forEach(function(e){e.attrs.stroke=t.annotation.color}),this.editMode){u=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),h.push({type:"handle",handles:u});var p=this.dragNote.bind(this),d=this.dragstarted.bind(this),f=this.dragended.bind(this);this.note.call(vt().container($("g.annotations").node()).on("start",function(t){return d(t)}).on("drag",function(t){return p(t)}).on("end",function(t){return f(t)}))}else this.note.on("mousedown.drag",null);return h},"drawNote")},{key:"drawNoteContent",value:/* @__PURE__ */Fe(function(t){var e=this.annotation.note,i=void 0!==e.padding?e.padding:this.notePadding,n=e.orientation||t.orientation||"topBottom",o=e.lineType||t.lineType,a=e.align||t.align||"dynamic";"vertical"===o?n="leftRight":"horizontal"===o&&(n="topBottom");var s={padding:i,bbox:t.bbox,offset:this.annotation.offset,orientation:n,align:a},r=dr(s),l=r.x,h=r.y;return this.offsetCornerX=l+this.annotation.dx,this.offsetCornerY=h+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+l+", "+h+")"),[]},"drawNoteContent")},{key:"drawOnScreen",value:/* @__PURE__ */Fe(function(t,e){return this.drawOnSVG(t,e)},"drawOnScreen")},{key:"redrawSubject",value:/* @__PURE__ */Fe(function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())},"redrawSubject")},{key:"redrawConnector",value:/* @__PURE__ */Fe(function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())},"redrawConnector")},{key:"redrawNote",value:/* @__PURE__ */Fe(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))},"redrawNote")},{key:"setPosition",value:/* @__PURE__ */Fe(function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")},"setPosition")},{key:"clearComponents",value:/* @__PURE__ */Fe(function(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()},"clearComponents")},{key:"setOffset",value:/* @__PURE__ */Fe(function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}},"setOffset")},{key:"setPositionWithAccessors",value:/* @__PURE__ */Fe(function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()},"setPositionWithAccessors")},{key:"setClassName",value:/* @__PURE__ */Fe(function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))},"setClassName")},{key:"draw",value:/* @__PURE__ */Fe(function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()},"draw")},{key:"dragstarted",value:/* @__PURE__ */Fe(function(){wt.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")},"dragstarted")},{key:"dragended",value:/* @__PURE__ */Fe(function(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")},"dragended")},{key:"dragSubject",value:/* @__PURE__ */Fe(function(){var t=this.annotation.position;t.x+=wt.dx,t.y+=wt.dy,this.annotation.position=t},"dragSubject")},{key:"dragNote",value:/* @__PURE__ */Fe(function(){var t=this.annotation.offset;t.x+=wt.dx,t.y+=wt.dy,this.annotation.offset=t},"dragNote")},{key:"mapHandles",value:/* @__PURE__ */Fe(function(t){var e=this;return t.map(function(t){return Ks({},t,{start:e.dragstarted.bind(e),end:e.dragended.bind(e)})})},"mapHandles")}]),t}(),Ir=/* @__PURE__ */Fe(function(t,e,i){return function(t){function n(t){Zs(this,n);var i=ir(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));return i.typeSettings=e,e.disable&&e.disable.forEach(function(t){i[t]&&i[t].remove(),i[t]=void 0,"note"===t&&(i.noteContent=void 0)}),i}return M(n,"o"),er(n,t),Fe(n,"customType"),Js(n,[{key:"className",value:/* @__PURE__ */Fe(function(){return""+(e.className||tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this)&&tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this).call(this)||"")},"className")},{key:"drawSubject",value:/* @__PURE__ */Fe(function(t){return this.typeSettings.subject=Ks({},e.subject,this.typeSettings.subject),tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawSubject",this).call(this,Ks({},t,this.typeSettings.subject))},"drawSubject")},{key:"drawConnector",value:/* @__PURE__ */Fe(function(t){return this.typeSettings.connector=Ks({},e.connector,this.typeSettings.connector),tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawConnector",this).call(this,Ks({},t,e.connector,this.typeSettings.connector))},"drawConnector")},{key:"drawNote",value:/* @__PURE__ */Fe(function(t){return this.typeSettings.note=Ks({},e.note,this.typeSettings.note),tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNote",this).call(this,Ks({},t,e.note,this.typeSettings.note))},"drawNote")},{key:"drawNoteContent",value:/* @__PURE__ */Fe(function(t){return tr(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNoteContent",this).call(this,Ks({},t,e.note,this.typeSettings.note))},"drawNoteContent")}],[{key:"init",value:/* @__PURE__ */Fe(function(t,e){return tr(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,t,e),i&&(t=i(t,e)),t},"init")}]),n}(t)},"customType"),Er=function(){function t(e){Zs(this,t);var i=ir(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.textWrap=e.textWrap||120,i.drawText(),i}return M(t,"t"),er(t,Tr),Fe(t,"d3NoteText"),Js(t,[{key:"updateTextWrap",value:/* @__PURE__ */Fe(function(t){this.textWrap=t,this.drawText()},"updateTextWrap")},{key:"drawText",value:/* @__PURE__ */Fe(function(){if(this.note){Rr(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");Rr(t,[this.annotation],"rect","annotation-note-bg"),Rr(t,[this.annotation],"text","annotation-note-label"),Rr(t,[this.annotation],"text","annotation-note-title");var e={height:0},i=this.a.select("text.annotation-note-label"),n=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,o=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,a=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,s={top:0,bottom:0,left:0,right:0};if("number"==typeof a?s={top:a,bottom:a,left:a,right:a}:a&&"object"===(void 0===a?"undefined":Qs(a))&&(s=Ks(s,a)),this.annotation.note.title){var r=this.a.select("text.annotation-note-title");r.text(this.annotation.note.title),r.attr("fill",this.annotation.color),r.attr("font-weight","bold"),r.call(Or,n,o),e=r.node().getBBox()}i.text(this.annotation.note.label).attr("dx","0"),i.call(Or,n,o),i.attr("y",1.1*e.height||0),i.attr("fill",this.annotation.color);var l=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",l.width+s.left+s.right).attr("height",l.height+s.top+s.bottom).attr("x",l.x-s.left).attr("y",-s.top).attr("fill","white").attr("fill-opacity",0)}},"drawText")}]),t}();Ir(Er,{className:"label",note:{align:"middle"}});var Fr=Ir(Er,{className:"callout",note:{lineType:"horizontal"}}),Dr=Ir(Fr,{className:"callout elbow",connector:{type:"elbow"}});Ir(Fr,{className:"callout curve",connector:{type:"curve"}}),Ir(Tr,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),Ir(Er,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),Ir(Er,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),Ir(function(){function t(){return Zs(this,t),ir(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return M(t,"t"),er(t,Fr),Fe(t,"ThresholdMap"),Js(t,[{key:"mapY",value:/* @__PURE__ */Fe(function(e){tr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapY",this).call(this,e);var i=this.annotation;(i.subject.x1||i.subject.x2)&&i.data&&e.y&&(i.y=e.y(i.data)),!i.subject.x1&&!i.subject.x2||i.x||(i.x=i.subject.x1||i.subject.x2)},"mapY")},{key:"mapX",value:/* @__PURE__ */Fe(function(e){tr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapX",this).call(this,e);var i=this.annotation;(i.subject.y1||i.subject.y2)&&i.data&&e.x&&(i.x=e.x(i.data)),!i.subject.y1&&!i.subject.y2||i.y||(i.y=i.subject.y1||i.subject.y2)},"mapX")}]),t}(),{className:"callout xythreshold",subject:{type:"threshold"}});var Rr=/* @__PURE__ */Fe(function(t,e,i,n,o){var a=t.selectAll(i+"."+(o||n)).data(e);return a.enter().append(i).merge(a).attr("class",n),a.exit().remove(),t},"newWithClass"),zr=/* @__PURE__ */Fe(function(t,e,i){var n=i.component,o=i.name;n&&n.on("mouseover.annotations",function(){t.call(o+"over",n,e)}).on("mouseout.annotations",function(){return t.call(o+"out",n,e)}).on("click.annotations",function(){return t.call(o+"click",n,e)})},"addHandlers"),Or=/* @__PURE__ */Fe(function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each(function(){for(var t=$(this),o=t.text().split(i||/[ \t\r\n]+/).reverse().filter(function(t){return""!==t}),a=void 0,s=[],r=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");a=o.pop();)s.push(a),r.text(s.join(" ")),r.node().getComputedTextLength()>e&&s.length>1&&(s.pop(),r.text(s.join(" ")),s=[a],r=t.append("tspan").attr("x",0).attr("dy",n+"em").text(a))})},"wrap"),jr=/* @__PURE__ */Fe(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(e).nodes().reduce(function(t,e){var i=e.getBBox();t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),t.width=Math.max(t.width,i.width);var n=e&&e.attributes&&e.attributes.y;return t.height=Math.max(t.height,(n&&parseFloat(n.value)||0)+i.height),t},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}},"bboxWithoutHandles");function Nr(){var t=[],e=void 0,i=void 0,n=[],o={},a={},s=!1,r=void 0,l=Fr,h=void 0,c=void 0,u=Pt("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),p=void 0,d=/* @__PURE__ */Fe(function(i){p=i,s||i.selectAll("circle.handle").remove();var d=t.map(function(t){return t.type||(t.type=l),t.disable||(t.disable=n),new or(t)});e=e||new ar({annotations:d,accessors:o,accessorsInverse:a,ids:r}),i.selectAll("g").data([e]).enter().append("g").attr("class","annotations");var f=i.select("g.annotations");Rr(f,e.annotations,"g","annotation"),f.selectAll("g.annotation").each(function(t){var e=$(this);e.attr("class","annotation"),Rr(e,[t],"g","annotation-connector"),Rr(e,[t],"g","annotation-subject"),Rr(e,[t],"g","annotation-note"),Rr(e.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:e,annotation:t,textWrap:h,notePadding:c,editMode:s,dispatcher:u,accessors:o}),t.type.draw(),t.type.drawText&&t.type.drawText()})},"annotation");return d.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",e.json),window.copy(JSON.stringify(e.json.map(function(t){return delete t.type,t}))),d},d.update=function(){return t&&e&&(t=e.annotations.map(function(t){return t.type.draw(),t})),d},d.updateText=function(){return e&&(e.updateText(h),t=e.annotations),d},d.updatedAccessors=function(){return e.setPositionWithAccessors(),t=e.annotations,d},d.disable=function(i){return arguments.length?(n=i,e&&(e.updateDisable(n),t=e.annotations),d):n},d.textWrap=function(i){return arguments.length?(h=i,e&&(e.updateTextWrap(h),t=e.annotations),d):h},d.notePadding=function(i){return arguments.length?(c=i,e&&(e.updateNotePadding(c),t=e.annotations),d):c},d.type=function(i,n){return arguments.length?(l=i,e&&(e.annotations.map(function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=l,t.subject=n&&n.subject||t.subject,t.connector=n&&n.connector||t.connector,t.note=n&&n.note||t.note}),t=e.annotations),d):l},d.annotations=function(i){return arguments.length?(t=i,e&&e.annotations&&(t.some(function(t){return!t.type||"[object Object]"!==t.type.toString()})?(e=null,d(p)):e.annotations=t),d):e&&e.annotations||t},d.context=function(t){return arguments.length?(i=t,d):i},d.accessors=function(t){return arguments.length?(o=t,d):o},d.accessorsInverse=function(t){return arguments.length?(a=t,d):a},d.ids=function(t){return arguments.length?(r=t,d):r},d.editMode=function(i){return arguments.length?(s=i,p&&p.selectAll("g.annotation").classed("editable",s),e&&(e.editMode(s),t=e.annotations),d):s},d.collection=function(t){return arguments.length?(e=t,d):e},d.on=function(){var t=u.on.apply(u,arguments);return t===u?d:t},d}function Lr(t){return.65*(t-.5)*2*Math.PI}function Br(t,e){return{x:Math.cos(t-Math.PI/2)*e,y:Math.sin(t-Math.PI/2)*e}}function Vr(t,e,i=!1){const n=Br(t,e),o=180*t/Math.PI+(!0===i?180:0);return`translate(${n.x}, ${n.y}) rotate(${o})`}function Hr(t,e,i=!1){return function(n){const o=kt(n.angle,t);return n.angle=t,function(t){return Vr(o(t),e,i)}}}function $r(t,e,i){return function(n){const o=kt(n.startAngle,t),a=kt(n.endAngle,e);return function(t){return n.startAngle=o(t),n.endAngle=a(t),i(n)}}}M(Nr,"ns"),M(Lr,"os"),M(Br,"as"),M(Vr,"ss"),M(Hr,"rs"),M($r,"ls"),Fe(Nr,"annotation"),Fe(Lr,"value2Angle"),Fe(Br,"pointOnArc"),Fe(Vr,"indicatorTranslate"),Fe(Hr,"indicatorTween"),Fe($r,"arcTween");const Wr=(u=class extends et{_d3Arc=ri().innerRadius(85).outerRadius(100);_colorScale=rt().interpolate(St);_usageArc;_meanArc;_freeArc;_indInner;_indOuter;_centerTextG;_centerText;_bottomText;_tooltipG;_mainTooltip;constructor(){super()}tip(t){if(null===t||""===t.label)this._tooltipG.transition().style("opacity",0).on("interrupt end",()=>{this._tooltipG.selectAll("g").remove()});else{this._tooltipG.interrupt().style("opacity",1),t.w=this._centerText.datum().w+10;let e="horizontal",i=0,n=5,o=5;t.y>=5&&t.y<=25?(i=t.x<0?-t.w/2:t.w/2,n=12.5,o=void 0,e="vertical"):t.y>25&&(n=25,o=0);const a=Nr().type(Dr).annotations([{data:t,dx:-t.x+i,dy:-t.y+n,color:"black",note:{label:t.label,lineType:e,padding:o,align:"middle"}}]).accessors({x:/* @__PURE__ */Fe(t=>t.x,"x"),y:/* @__PURE__ */Fe(t=>t.y,"y")});this._tooltipG.call(a)}}calcSize(t,e,i){const n=t.node().getBBox(),o=e/n.width,a=i/n.height,s=o<a?o:a;return{width:n.width,height:n.height,scale:s}}updateText(t,e,i,n,o){t.datum({x:e,y:i,w:n,h:o}).attr("transform",null);const a=this.calcSize(t,n,o),s=e+n/2-a.width/2*a.scale,r=i+o/2-a.height/2*a.scale;t.attr("transform",`translate(${s}, ${r}) scale(${a.scale})`)}calcWidth(){return Math.min(this.width(),this.height(),this.maxDiameter())}enter(t,e){super.enter(t,e),e.on("click",t=>{this.click(t)}),this._usageArc=e.append("path").datum({startAngle:Lr(0),endAngle:Lr(0)}).style("fill","green").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._freeArc=e.append("path").datum({startAngle:Lr(0),endAngle:Lr(1)}).style("fill","lightGrey"),this._meanArc=e.append("path").datum({startAngle:Lr(0),endAngle:Lr(0)}).style("fill","black").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.tickValueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._mainTooltip=e.append("title");const i=this;function n(){return e.append("path").datum({angle:Lr(0)}).style("fill","black").style("stroke","black").attr("d","M 0 0 l -3 -3 l 6 0 z").on("mousemove",t=>{const[e,n]=i._d3Arc.centroid(i._meanArc.datum());i.tip({x:e,y:n,label:i.tickValueDescription()})}).on("mouseout",t=>{i.tip(null)})}M(n,"o"),Fe(n,"appendIndicator"),this._indInner=n(),this._indOuter=n(),this._centerText=e.append("text").attr("dy",".66em").style("fill","green").on("mousemove",t=>{this.tip({x:0,y:0,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._bottomText=e.append("text").attr("dy",".66em").on("mousemove",t=>{this.tip({x:0,y:t.y,label:this.titleDescription()})}).on("mouseout",t=>{this.tip(null)}),this._tooltipG=e.append("g").attr("class","annotation-tip")}update(t,e){super.update(t,e),this._colorScale.domain(this.colorDomain()).range(this.colorRange()),e.attr("title",this.tooltip()).style("cursor",this.click!==u.prototype.click?"pointer":null);const i=this.calcWidth()/3,n=this.calcWidth()/2-5;this._d3Arc.innerRadius(i).outerRadius(n);const o=this.value(),a=this.tickValue();this._usageArc.style("fill",this._colorScale(o)).transition().duration(750).attrTween("d",$r(Lr(0),Lr(o),this._d3Arc)),this._freeArc.style("fill",this.emptyColor()).transition().duration(750).attrTween("d",$r(Lr(o),Lr(1),this._d3Arc)),this._meanArc.style("fill",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("d",$r(Lr(a-.001),Lr(a+.001),this._d3Arc)),this._indInner.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",Hr(Lr(a),i,!0)),this._indOuter.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",Hr(Lr(a),n)),this._centerText.style("fill",this._colorScale(o)).text(Z(".0%")(o)),this._bottomText.style("fill",this.click!==u.prototype.click?this.titleClickColor():this.titleColor()).style("text-decoration",this.click!==u.prototype.click?"underline":null).text(this.title());const s=Br(Lr(1),i-8);this.updateText(this._centerText,-s.x,-s.y,2*s.x,2*s.y);const r=Br(Lr(1),n);r.y+=5;const l=this.calcWidth()-20,h=this.calcWidth()/2-r.y-5;this.updateText(this._bottomText,-l/2,r.y,l,h),this._mainTooltip.text(this.tooltip())}click(t){}},M(u,"_Gauge"),u);Fe(Wr,"Gauge");let qr=Wr;qr.prototype._class+=" chart_Gauge",qr.prototype.publish("title","","string","Title"),qr.prototype.publish("titleDescription","","string","Title Description"),qr.prototype.publish("titleColor","black","html-color","Color of the title text"),qr.prototype.publish("titleClickColor","blue","html-color","Color of the title text when clickable"),qr.prototype.publish("maxDiameter",128,"number","Max Diameter"),qr.prototype.publish("value",0,"number","Value"),qr.prototype.publish("valueDescription","","string","Value Description"),qr.prototype.publish("showTick",!1,"boolean","Show Tick"),qr.prototype.publish("tickValue",0,"number","Tick Value"),qr.prototype.publish("tickValueDescription","","string","Tick Value Description"),qr.prototype.publish("tooltip","","string","Tooltip"),qr.prototype.publish("colorRange",["green","green","green","green","green","green","green","green","orange","red","red"],"array","Array of colors for the filled gauge portion. The fill color will be relative to the gauge value."),qr.prototype.publish("colorDomain",[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],"array","This array augments the mapping of the value to the fill colorRange."),qr.prototype.publish("emptyColor","lightgrey","html-color","Color of the empty portion of the gauge"),qr.prototype.publish("tickColor","black","html-color","Color of the tick");const Gr=/* @__PURE__ */Fe((t,e)=>t[1]-e[1]>0?1:-1,"sortAscending"),Ur=/* @__PURE__ */Fe((t,e)=>t[1]-e[1]>0?-1:1,"sortDescending"),Xr=(p=class extends et{_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),be.call(this),Me.call(this),tt.SimpleSelectionMixin.call(this),this.d3Pie=_i(),this.d3Arc=ri(),this.d3LabelArc=ri(),this.tooltipTick_default(!1).tooltipOffset_default(0)}intersection(t,e){return this.intersectCircle(this.calcOuterRadius(),t,e)}calcInnerRadius(){return this.innerRadius_exists()?this.calcOuterRadius()*this.innerRadius()/100:0}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t},!1)),"Verdana",12).width,e=this._size.width-(this.showLabels()?2*t:0)-20,i=this._size.height-36-(this.showLabels()?this._smallValueLabelHeight:0),n=Math.min(e,i)/2-2;return e/2-2<this.minOuterRadius()?this._labelWidthLimit=t-(this.minOuterRadius()-(e/2-2)):this._labelWidthLimit=t,n<this.minOuterRadius()?this.minOuterRadius():n}calcSmallValueLabelHeight(){const t=this.data().reduce((t,e)=>t+e[1],0);let e=0;return this.data().forEach(i=>{i[1]/t<.1&&e++}),this.labelHeight()*e}calcTotalValue(){return this.data().reduce((t,e)=>t+e[1],0)}calcPadAngleRadians(){const t=this.slicePadding();return t>0?Math.min(t,.05):0}getLabelText(t,e){let i,n=t.data[0];if(void 0!==this._labelWidthLimit&&e){const t=this.textSize(n,"Verdana",this.labelHeight()).width;this._labelWidthLimit<t&&(i=n.length*(this._labelWidthLimit/t)-3,n=i<n.length?n.slice(0,i)+"...":n)}if(this.showSeriesValue()&&(n+=` : ${this._seriesValueFormatter(t.data[1])}`),this.showSeriesPercentage()){let e=this._totalValue;const i=this.dataMeta();void 0!==i.sum&&(e=i.sum);const o=t.data[1]/e*100;n+=` : ${this._seriesPercentageFormatter(o)}%`}return n}selection(t){if(!arguments.length)try{return this._selection.selection2()[0]?.data}catch(i){return}const e=JSON.stringify(t);this._selection.selection2(t=>e===JSON.stringify(t.data))}selectByLabel(t){const e=this.data().filter(e=>e[0]===t)[0];e&&this.selection(e)}_slices;_labels;enter(t,e){super.enter(t,e),this._selection.widgetElement(e).skipBringToTop(!0),this._slices=e.append("g"),this._labels=e.append("g");const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t.data[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t.data[0]),value:t.data[n+1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){this.selectionGlow(!this.tabNavigation()),super.update(t,e);const i=this;this.updateD3Pie(),this._palette=this._palette.switch(this.paletteID()),this._seriesValueFormatter=Z(this.seriesValueFormat()),this._seriesPercentageFormatter=Z(this.seriesPercentageFormat()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._smallValueLabelHeight=this.calcSmallValueLabelHeight(),this._totalValue=this.calcTotalValue();const n=this.calcOuterRadius(),o=Math.max(this.calcInnerRadius(),Math.min(n/30,6)),a=n+12;this.d3Arc.innerRadius(o).padRadius(n).outerRadius(n).padAngle(this.calcPadAngleRadians()),this._quadIdxArr=[[],[],[],[]];const s=[...this.data()];switch(this.sortDataByValue()){case"ascending":s.sort(Gr);break;case"descending":s.sort(Ur)}const r=this._slices.selectAll(".arc").data(this.d3Pie(s),t=>t.data[0]);this._labelPositions=[],r.enter().append("g").attr("class",(t,e)=>"arc series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("keydown",function(t,e){const n=dt();!i.tabNavigation()||"Space"!==n.code&&"Enter"!==n.key||(n.preventDefault(),i._selection.click(this))}).each(function(t,e){$(this).append("path").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).on("mouseover",p(0,0)).on("mouseout",p(-5,150))}).merge(r).transition().attr("opacity",1).attr("tabindex",i.tabNavigation()?"0":null).attr("role",i.tabNavigation()?"button":null).attr("aria-label",i.tabNavigation()?t=>`${t.data[0]}: ${t.data[1]}`:null).each(function(t,e){const o=i.getQuadrant(u(t));i._quadIdxArr[o].push(e),t.outerRadius=n-5,$(this).select("path").transition().attr("d",i.d3Arc).style("fill",i.fillColor(t.data,i.columns()[1],t.data[1]))}),r.exit().transition().style("opacity",0).remove(),this.d3LabelArc.innerRadius(a).outerRadius(a);const l=this._labels.selectAll("text").data(this.showLabels()?this.d3Pie(s):[],t=>t.data[0]),h=l.enter().append("text").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).attr("dy",".5em").on("click",function(t){i._slices.selectAll("g").filter(function(e){t.data===e.data&&(i._selection.click(this),i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this)))})}).on("dblclick",function(t){i._slices.selectAll("g").filter(function(e){t.data===e.data&&i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))})}).merge(l).text(t=>this.getLabelText(t,!0)).each(function(t,e){const n=i.d3LabelArc.centroid(t),o=u(t);n[0]=a*(i.isLeftSide(o)?1:-1),i._labelPositions.push({top:n[1],bottom:n[1]+i.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),h.transition().style("font-size",this.labelHeight()+"px").attr("transform",(t,e)=>{const n=i.d3LabelArc.centroid(t);return n[0]=a*(i.isLeftSide(u(t))?1:-1),n[1]=i._labelPositions[e].top,"translate("+n+")"}).style("text-anchor",t=>this.isLeftSide(u(t))?"start":"end")),l.exit().remove();const c=this._labels.selectAll("polyline").data(this.showLabels()?this.d3Pie(s):[],t=>this.getLabelText(t,!0));function u(t){return t.startAngle+(t.endAngle-t.startAngle)/2}function p(t,e){return function(){$(this).transition().delay(e).attrTween("d",function(e){const o=kt(e.outerRadius,n+t);return function(t){return e.outerRadius=o(t),i.d3Arc(e)}})}}M(u,"d"),M(p,"y"),c.enter().append("polyline").merge(c).transition().attr("points",function(t,e){const n=i.d3LabelArc.centroid(t),o=i.d3Arc.centroid(t),s=[...n];return n[0]=a*(i.isLeftSide(u(t))?1:-1),n[1]=i._labelPositions[e].top,[o,s,n]}),c.exit().remove(),this.showLabels()&&this.centerOnLabels(),Fe(u,"midAngle"),Fe(p,"arcTween")}isLeftSide(t){return(t=B(t))>2*Math.PI?t:t<Math.PI&&t>0}getQuadrant(t){let e=0;const i=B(t);return e=i<=1*Math.PI&&i>=.5*Math.PI?3:e,e=i<=.5*Math.PI&&i>=0*Math.PI?2:e,e=i<=0*Math.PI&&i>=-.5*Math.PI?1:e,e}centerOnLabels(){const t=this.pos().y,e=2*t,i=this.calcOuterRadius(),n=Math.min(this._minLabelTop,-i),o=Math.max(this._maxLabelBottom,i),a=e-(o-n),s=Math.abs(this._minLabelTop);let r=0;o>t?(r=t-o+this.labelHeight()/2,r-=a/2):n<0&&s>t&&(r=s-t+this.labelHeight()/2,r+=a/2);const l=this.pos();this.pos({y:l.y+r,x:l.x})}adjustForOverlap(){const t=this.labelHeight();this._quadIdxArr.forEach((e,i)=>{let n;this._quadIdxArr[i].sort((t,e)=>1===i||2===i?this._labelPositions[t].top>this._labelPositions[e].top?-1:1:0===i||3===i?this._labelPositions[t].top>this._labelPositions[e].top?1:-1:void 0),this._quadIdxArr[i].forEach((e,o)=>{if(o>0)if(1===i||2===i){if(n<this._labelPositions[e].bottom){const t=this._labelPositions[e].bottom-n;this._labelPositions[e].top-=t,this._labelPositions[e].bottom-=t}}else if((0===i||3===i)&&n+t>this._labelPositions[e].top){const i=Math.abs(this._labelPositions[e].top)-Math.abs(n+t);this._labelPositions[e].top-=i,this._labelPositions[e].bottom-=i}n=this._labelPositions[e].top})}),this._minLabelTop=0,this._maxLabelBottom=0,this._quadIdxArr.forEach((t,e)=>{this._quadIdxArr[e].forEach((t,e)=>{this._minLabelTop>this._labelPositions[t].top&&(this._minLabelTop=this._labelPositions[t].top),this._maxLabelBottom<this._labelPositions[t].bottom&&(this._maxLabelBottom=this._labelPositions[t].bottom)})})}exit(t,e){super.exit(t,e)}updateD3Pie(){const t=B(V(this.startAngle()));switch(this.sortDataByValue()){case"ascending":this.d3Pie.sort(Gr);break;case"descending":this.d3Pie.sort(Ur);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(this.calcPadAngleRadians()).startAngle(t).endAngle(2*Math.PI+t).value(function(t){return t[1]})}},M(p,"_Pie"),p);Fe(Xr,"Pie"),De(Xr,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let Yr=Xr;Yr.prototype._class+=" chart_Pie",Yr.prototype.implements(be.prototype),Yr.prototype.implements(Me.prototype),Yr.prototype.mixin(tt.SimpleSelectionMixin),Yr.prototype.publish("showLabels",!0,"boolean","If true, wedge labels will display"),Yr.prototype.publish("showSeriesValue",!1,"boolean","Append data series value next to label",null,{disable:/* @__PURE__ */Fe(t=>!t.showLabels(),"disable")}),Yr.prototype.publish("seriesValueFormat",",.0f","string","Number format used for formatting series values",null,{disable:/* @__PURE__ */Fe(t=>!t.showSeriesValue(),"disable")}),Yr.prototype.publish("showSeriesPercentage",!1,"boolean","Append data series percentage next to label",null,{disable:/* @__PURE__ */Fe(t=>!t.showLabels(),"disable")}),Yr.prototype.publish("seriesPercentageFormat",",.0f","string","Number format used for formatting series percentages",null,{disable:/* @__PURE__ */Fe(t=>!t.showSeriesPercentage(),"disable")}),Yr.prototype.publish("paletteID","default","set","Color palette for this widget",Yr.prototype._palette.switch(),{tags:["Basic","Shared"]}),Yr.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Yr.prototype.publish("innerRadius",0,"number","Sets inner pie hole radius as a percentage of the radius of the pie chart",null,{tags:["Basic"],range:{min:0,step:1,max:100}}),Yr.prototype.publish("minOuterRadius",20,"number","Minimum outer radius (pixels)"),Yr.prototype.publish("startAngle",0,"number","Starting angle of the first (and largest) wedge (degrees)"),Yr.prototype.publish("labelHeight",12,"number","Font size of labels (pixels)",null,{disable:/* @__PURE__ */Fe(t=>!t.showLabels(),"disable")}),Yr.prototype.publish("slicePadding",.01,"number","Padding between pie slices (converted to pixels)",null,{tags:["Basic"],range:{min:0,step:.01,max:.2}}),Yr.prototype.publish("sortDataByValue","descending","set","Sort data by value",["none","ascending","descending"]),Yr.prototype.publish("tabNavigation",!1,"boolean","Enable or disable tab navigation");const Qr=(M(d=class extends Yr{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i=this._pos.x,n=this._pos.y;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),n+=this._size.height/4,this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(-Math.PI/2).endAngle(Math.PI/2)}},"_HalfPie"),d);Fe(Qr,"HalfPie"),Qr.prototype._class+=" chart_HalfPie";const Zr=(M(f=class extends on{_domForeignObject;_domCanvas;_heat;constructor(){super(),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}radius(t){return this.radiusX(t),this.radiusY(t),this}layerEnter(t,e,i=250){super.layerEnter(t,e,i),this._domForeignObject=this.svg.insert("foreignObject","#"+this.id()+"_clippath"),this._domCanvas=this._domForeignObject.append("xhtml:body").style("margin","0px").style("padding","0px").style("background-color","transparent").append("canvas"),this._heat=Kr(this._domCanvas.node())}layerUpdate(t,e,i=250){super.layerUpdate(t,e),this._palette=this._palette.switch(this.paletteID());let n=this.width()-this.margin.left-this.margin.right;n<0&&(n=0);let o=this.height()-this.margin.top-this.margin.bottom;o<0&&(o=0),this._domForeignObject.attr("x",this.margin.left).attr("y",this.margin.top).attr("width",n).attr("height",o),this._domCanvas.attr("width",n).attr("height",o);const a="horizontal"===t.orientation()?this.data().map(e=>[t.dataPos(e[0]),t.valuePos(e[1]),e[2]]):this.data().map(e=>[t.valuePos(e[1]),t.dataPos(e[0]),e[2]]),s=this.maxWeight_exists()?this.maxWeight():yt(a,t=>t[2]);if("default"!==this.paletteID()){const t={},e=8,i=this.reversePalette();for(let n=0;n<e;++n)t[n/e]=this._palette((i?e-n:n)/e,0,1);this._heat.gradient(t)}else this._heat.gradient(this._heat.defaultGradient);this._heat.resize();const r=this.radiusAsPercent()?this.radiusX()*n/100:this.radiusX(),l=this.radiusAsPercent()?this.radiusY()*o/100:this.radiusY();this._heat.clear().radius(r,l,this.blur()).max(s).data(a).draw(this.minOpacity())}},"_Heat"),f);Fe(Zr,"Heat");let Jr=Zr;function Kr(t){if(!(this instanceof Kr))return new Kr(t);this._canvas=t="string"==typeof t?document.getElementById(t):t,this._ctx=t.getContext("2d"),this._width=t.width,this._height=t.height,this._max=1,this._data=[]}M(Kr,"gs"),Jr.prototype._class+=" chart_Heat",Jr.prototype._palette=X.rainbow("default"),Jr.prototype.publish("paletteID","default","set","Color palette for this widget",Jr.prototype._palette.switch(),{tags:["Basic"]}),Jr.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Jr.prototype.publish("reversePalette",!1,"boolean","Reverse Palette Colors",null,{disable:/* @__PURE__ */Fe(t=>"default"===t.paletteID(),"disable")}),Jr.prototype.publish("radiusX",25,"number","Point X radius (25 by default)"),Jr.prototype.publish("radiusY",25,"number","Point Y radius (25 by default)"),Jr.prototype.publish("radiusAsPercent",!1,"boolean","Calculate RadiusX + RadiusY as % of size"),Jr.prototype.publish("blur",15,"number","Point blur radius (15 by default)"),Jr.prototype.publish("maxWeight",void 0,"number","Clamp max weight to value (optional), omitting uses max data point",void 0,{optional:!0}),Jr.prototype.publish("minOpacity",.05,"number","Minimum point opacity (0.05 by default)"),Fe(Kr,"simpleheat"),Kr.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:/* @__PURE__ */Fe(function(t){return this._data=t,this},"data"),max:/* @__PURE__ */Fe(function(t){return this._max=t,this},"max"),add:/* @__PURE__ */Fe(function(t){return this._data.push(t),this},"add"),clear:/* @__PURE__ */Fe(function(){return this._data=[],this},"clear"),radius:/* @__PURE__ */Fe(function(t,e,i){i=void 0===i?15:i;const n=this._ellipse=this._createCanvas(),o=n.getContext("2d"),a=this._r=t+i,s=this._r=e+i;return n.width=2*a,n.height=2*s,o.shadowOffsetX=o.shadowOffsetY=2*a,o.shadowOffsetY=o.shadowOffsetY=2*s,o.shadowBlur=i,o.shadowColor="black",o.beginPath(),o.ellipse(-a,-s,t,e,0,0,2*Math.PI,!0),o.closePath(),o.fill(),this},"radius"),resize:/* @__PURE__ */Fe(function(){this._width=this._canvas.width,this._height=this._canvas.height},"resize"),gradient:/* @__PURE__ */Fe(function(t){const e=this._createCanvas(),i=e.getContext("2d"),n=i.createLinearGradient(0,0,0,256);e.width=1,e.height=256;for(const o in t)n.addColorStop(+o,t[o]);return i.fillStyle=n,i.fillRect(0,0,1,256),this._grad=i.getImageData(0,0,1,256).data,this},"gradient"),draw:/* @__PURE__ */Fe(function(t){this._ellipse||this.radius(this.defaultRadius,this.defaultRadius),this._grad||this.gradient(this.defaultGradient);const e=this._ctx;e.clearRect(0,0,this._width,this._height);for(let n,o=0,a=this._data.length;o<a;o++)n=this._data[o],n[2]<0?n[2]=0:n[2]>this._max&&(n[2]=this._max),e.globalAlpha=Math.max(n[2]/this._max,void 0===t?.05:t),e.drawImage(this._ellipse,n[0]-this._r,n[1]-this._r);const i=e.getImageData(0,0,this._width,this._height);return this._colorize(i.data,this._grad),e.putImageData(i,0,0),this},"draw"),_colorize:/* @__PURE__ */Fe(function(t,e){for(let i,n=0,o=t.length;n<o;n+=4)i=4*t[n+3],i&&(t[n]=e[i],t[n+1]=e[i+1],t[n+2]=e[i+2])},"_colorize"),_createCanvas:/* @__PURE__ */Fe(function(){return"undefined"!=typeof document?document.createElement("canvas"):new this._canvas.constructor},"_createCanvas")};var tl=Math.PI/3,el=[0,tl,2*tl,3*tl,4*tl,5*tl];function il(t){return t[0]}function nl(t){return t[1]}function ol(){var t,e,i,n=0,o=0,a=1,s=1,r=il,l=nl;function h(t){var n,o={},a=[],s=t.length;for(n=0;n<s;++n)if(!isNaN(c=+r.call(null,h=t[n],n,t))&&!isNaN(u=+l.call(null,h,n,t))){var h,c,u,p=Math.round(u/=i),d=Math.round(c=c/e-(1&p)/2),f=u-p;if(3*Math.abs(f)>1){var y=c-d,_=d+(c<d?-1:1)/2,x=p+(u<p?-1:1),m=c-_,g=u-x;y*y+f*f>m*m+g*g&&(d=_+(1&p?1:-1)/2,p=x)}var b=d+"-"+p,v=o[b];v?v.push(h):(a.push(v=o[b]=[h]),v.x=(d+(1&p)/2)*e,v.y=p*i)}return a}function c(t){var e=0,i=0;return el.map(function(n){var o=Math.sin(n)*t,a=-Math.cos(n)*t,s=o-e,r=a-i;return e=o,i=a,[s,r]})}return M(h,"c"),M(c,"u"),Fe(h,"hexbin"),Fe(c,"hexagon"),h.hexagon=function(e){return"m"+c(null==e?t:+e).join("l")+"z"},h.centers=function(){for(var r=[],l=Math.round(o/i),h=Math.round(n/e),c=l*i;c<s+t;c+=i,++l)for(var u=h*e+(1&l)*e/2;u<a+e/2;u+=e)r.push([u,c]);return r},h.mesh=function(){var e=c(t).slice(0,4).join("l");return h.centers().map(function(t){return"M"+t+"m"+e}).join("")},h.x=function(t){return arguments.length?(r=t,h):r},h.y=function(t){return arguments.length?(l=t,h):l},h.radius=function(n){return arguments.length?(e=2*(t=+n)*Math.sin(tl),i=1.5*t,h):t},h.size=function(t){return arguments.length?(n=o=0,a=+t[0],s=+t[1],h):[a-n,s-o]},h.extent=function(t){return arguments.length?(n=+t[0][0],o=+t[0][1],a=+t[1][0],s=+t[1][1],h):[[n,o],[a,s]]},h.radius(1)}M(il,"ws"),M(nl,"Ss"),M(ol,"As"),Fe(il,"pointX"),Fe(nl,"pointY"),Fe(ol,"d3HexBin");const al=(M(y=class extends on{_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),ve.call(this),this.tooltipValueFormat_default(",.0f"),Me.call(this),this.tooltipHTML(t=>{const e=xt(t,t=>t.label),i=xt(t,t=>t.value);return this.tooltipFormat({series:e[0]===e[1]?e[0]:`${e[0]} -> ${e[1]}`,label:i[0]===i[1]?i[0]:`${i[0]} -> ${i[1]}`,value:t.length})}),this._hexbin=ol().x(t=>t.x).y(t=>t.y),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._hexbin.extent([0,0],[this.width(),this.height()]).radius(this.binSize());const o=this.flattenData().map(e=>({x:n.xPos(t,e),y:n.yPos(t,e),label:t.parseData(e.label),value:t.parseValue(e.value),origRow:e})),a=this._hexbin(o),s=ft(a,function(t){return t.length}),r=yt(a,function(t){return t.length});this._dataMinWeight=s,this._dataMaxWeight=r;const l=e.selectAll(".hexagon").data(a,function(t){return t.i+"_"+t.j});l.enter().append("path").attr("class","hexagon").call(t._selection.enter.bind(t._selection)).on("click",function(e){const i=n.data();n.click(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("dblclick",function(e){const i=n.data();n.dblclick(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).merge(l).transition().duration(i).attr("d",this._hexbin.hexagon()).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(1)"}).style("fill",function(t){return n._palette(t.length,s,r)}),l.exit().transition().duration(i).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).remove()}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}},"_HexBin"),y);Fe(al,"HexBin"),De(al,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let sl=al;sl.prototype._class+=" chart_HexBin",sl.prototype.implements(ve.prototype),sl.prototype.implements(Me.prototype),sl.prototype.publish("paletteID","Blues","set","Color palette for this widget",sl.prototype._palette.switch(),{tags:["Basic","Shared"]}),sl.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),sl.prototype.publish("binSize",20,"number","Bin radius",null,{range:{min:1,max:300,step:1}});const rl=(M(_=class extends sn{constructor(){super(),this.interpolate_default("linear")}},"_Line"),_);Fe(rl,"Line"),rl.prototype._class+=" chart_Line";const ll=(M(x=class extends Yr{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i="left"===this.orientation()?0:this._size.width,n=this._size.height;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle("left"===this.orientation()?0:-Math.PI/2).endAngle("left"===this.orientation()?Math.PI/2:0)}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t})),"Verdana",12).width;return Math.min(this._size.width-t-10,this._size.height-36)-2}},"_QuarterPie"),x);Fe(ll,"QuarterPie");let hl=ll;hl.prototype._class+=" chart_QuarterPie",hl.prototype.publish("orientation","left","set","Determines the placement and start/end angle.",["left","right"]);const cl=(M(m=class extends et{_g;_leftLine;_rightLine;_midLine;_midOuterRect;_midInnerRect1;_midInnerRect2;_q0text;_q1text;_q2text;_q3text;_q4text;_q0val;_q1val;_q2val;_q3val;_q4val;constructor(){super()}enter(t,e){super.enter(t,e),this._g=e.append("g"),this._leftLine=this._g.append("rect"),this._rightLine=this._g.append("rect"),this._midLine=this._g.append("rect"),this._midOuterRect=this._g.append("rect"),this._midInnerRect1=this._g.append("rect"),this._midInnerRect2=this._g.append("rect"),this._q0text=this._g.append("text"),this._q1text=this._g.append("text"),this._q2text=this._g.append("text"),this._q3text=this._g.append("text"),this._q4text=this._g.append("text"),this._q0val=this._g.append("text"),this._q1val=this._g.append("text"),this._q2val=this._g.append("text"),this._q3val=this._g.append("text"),this._q4val=this._g.append("text")}update(t,e){super.update(t,e);const i=("horizontal"===this.orientation()?this.width():this.height())-this.lineWidth(),n="horizontal"===this.orientation()?this.height():this.width(),o=rt().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),i-this.edgePadding()]),a=this.candleWidth_exists()?this.candleWidth():n,s=this.lineWidth(),r=this.lineColor(),l=this.roundedCorners(),h=this.edgePadding();let c=o(this.data()[1]),u=o(this.data()[2]),p=o(this.data()[3]);const d=-a/2,f=a/2,y=this.upperTextRotation(),_=this.lowerTextRotation(),x=this.textPadding(),m=this.labelFontSize(),g=this.valueFontSize(),b=Math.max(m,g),v=i-h;if(b>0){for(;c-h<b;)c+=b;for(;u-c<b;)u+=b;for(;p-u<b;)p+=b;for(;v-p<b;)p-=b;for(;p-u<b;)u-=b;for(;u-c<b;)c-=b}let w=-i/2-this.lineWidth()/2,S=0,k=0,A=1,C="start",M="end";"vertical"===this.orientation()&&(w=0,S=i/2+this.lineWidth()/2,k=-90,C="end",M="start",A=-1),this._g.style("shape-rendering","crispEdges").attr("transform",`translate(${w},${S})rotate(${k})scale(1)`),this._leftLine.attr("fill",r).attr("height",a).attr("width",s).attr("x",h).attr("y",d).attr("rx",l).attr("ry",l),this._rightLine.attr("class","right-line").attr("fill",r).attr("height",a).attr("width",s).attr("x",v).attr("y",d).attr("rx",l).attr("ry",l),this._midLine.attr("fill",r).attr("height",s).attr("width",v-h).attr("x",h).attr("y",-s/2),this._midOuterRect.attr("fill",r).attr("height",a).attr("width",p-c).attr("x",c).attr("y",d).attr("rx",l).attr("ry",l),this._midInnerRect1.attr("fill",this.innerRectColor()).attr("height",a-2*s).attr("width",u-(c+2*s)).attr("x",c+s).attr("y",s-a/2).attr("rx",.618*l).attr("ry",.618*l),this._midInnerRect2.attr("fill",this.innerRectColor()).attr("height",a-2*s).attr("width",p-u-s).attr("x",u).attr("y",s-a/2).attr("rx",.618*l).attr("ry",.618*l),this._q0text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${h}, ${d-x})rotate(${y})scale(${A})`).attr("font-size",m).attr("text-anchor",C).attr("alignment-baseline","hanging").text(this.columns()[0]),this._q1text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${d-x})rotate(${y})scale(${A})`).attr("font-size",m).attr("text-anchor",C).attr("alignment-baseline","middle").text(this.columns()[1]),this._q2text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${d-x})rotate(${y})scale(${A})`).attr("font-size",m).attr("text-anchor",C).attr("alignment-baseline","middle").text(this.columns()[2]),this._q3text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${d-x})rotate(${y})scale(${A})`).attr("font-size",m).attr("text-anchor",C).attr("alignment-baseline","middle").text(this.columns()[3]),this._q4text.attr("height",a).attr("width",p-c).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${v+s}, ${d-x})rotate(${y})scale(${A})`).attr("font-size",m).attr("text-anchor",C).attr("alignment-baseline","baseline").text(this.columns()[4]),this._q0val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${h}, ${f+x})rotate(${_})scale(${A})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","hanging").text(this.data()[0]),this._q1val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${f+x})rotate(${_})scale(${A})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.data()[1]),this._q2val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${f+x})rotate(${_})scale(${A})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.data()[2]),this._q3val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${f+x})rotate(${_})scale(${A})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.data()[3]),this._q4val.attr("height",a).attr("width",p-c).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${v+s}, ${f+x})rotate(${_})scale(${A})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","baseline").text(this.data()[4])}},"_QuartileCandlestick"),m);Fe(cl,"QuartileCandlestick");let ul=cl;ul.prototype._class+=" chart_QuartileCandlestick",ul.prototype.publish("textColor","black","html-color","Color of label and value text"),ul.prototype.publish("showLabels",!0,"boolean","If true, labels will be shown"),ul.prototype.publish("showValues",!0,"boolean","If true, values will be shown"),ul.prototype.publish("orientation","horizontal","set","Determines layout",["horizontal","vertical"]),ul.prototype.publish("valueFontSize",12,"number","Font size of value text (pixels)"),ul.prototype.publish("labelFontSize",12,"number","Font size of label text (pixels)"),ul.prototype.publish("roundedCorners",8,"number","Radius of rounded rect corners (pixels)"),ul.prototype.publish("lineWidth",4,"number","Width of lines (pixels)"),ul.prototype.publish("candleWidth",null,"number","Height of outer rect (pixels)",null,{optional:!0}),ul.prototype.publish("textPadding",8,"number","Padding between outer rect and text (pixels)"),ul.prototype.publish("edgePadding",30,"number","Padding between outer rect and left/right sides (pixels)"),ul.prototype.publish("lineColor","#333","html-color","Color of outer rect and lines"),ul.prototype.publish("innerRectColor","white","html-color","Color of the inner rects"),ul.prototype.publish("upperTextRotation",-60,"number","Rotation of label text (degrees)"),ul.prototype.publish("lowerTextRotation",-60,"number","Rotation of value text (degrees)");const pl=(M(g=class extends et{constructor(){super(),Ae.call(this),Me.call(this),tt.SimpleSelectionMixin.call(this)}mapShape(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}setPointAttributes(t,e,i){const n=this;switch(this.mapShape(this.pointShape())){case"rect":t.attr("width",n.pointSize()).attr("height",n.pointSize()).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"circle":t.attr("r",n.pointSize()/2).attr("cx",e).attr("cy",i).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"path":const o=n.pointSize()/2;t.attr("d",function(t){return"M"+(e-o)+" "+(i-o)+" L"+(e+o)+" "+(i+o)+" M"+(e-o)+" "+(i+o)+" L"+(e+o)+" "+(i-o)}).style("stroke",t=>this.strokeColor(t.data,t.column,t.value))}}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t.label,series:t.column,value:t.value}))}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID());const i=this,n=this.height()/2,o=this.width()/2,a=this.columns(),s=this.data(),r=this.flattenData(a,s).map((t,e)=>(t.shape=this.mapShape(this.pointShape()),t.column=a[t.colIdx],t.row=s[e],t)),l=[],h=this.degrees2radians(360/this.data().length),c=this.fontSize();let u=0;r.filter(t=>1===t.colIdx).forEach(t=>{const e=super.textSize(t.label,`${this.fontFamily()}`,this.fontSize());u<e.width&&(u=e.width)});const p=Math.min(n-c,o-u),d=e.selectAll(".label").data(r.filter(t=>1===t.colIdx)),f=Math.max.apply(i,r.map(t=>t.value));d.enter().append("text").attr("class","label").attr("text-anchor","middle").merge(d).attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).each(function(t,e){const n=i.polar2cartesian(p,e*h-Math.PI/2);l.push(n.map(t=>t*i.labelPaddingRatio()));let o="middle";const a=Math.round(n[0]);o=a>0?"start":o,o=a<0?"end":o,$(this).attr("text-anchor",o).attr("x",n[0]).attr("y",n[1])}).text(t=>t.label),d.exit().remove();const y=e.selectAll(".domain").data(r.filter(t=>1===t.colIdx));y.enter().append("line").classed("domain",!0).style("stroke","#000").style("stroke-opacity","0.75").style("stroke-width","1px").merge(y).attr("x1",0).attr("y1",0).attr("x2",(t,e)=>l[e][0]).attr("y2",(t,e)=>l[e][1]),y.exit().remove();const _=e.selectAll(".value_guide").data(this.valueGuideRatios());_.enter().append("polygon").classed("value_guide",!0).style("stroke","grey").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(_).each(function(t,e){const i=[];l.forEach((e,n)=>{i.push([e[0]*t,e[1]*t])}),$(this).attr("points",i.join(" ")).attr("stroke","rgb(0, 0, 0)").attr("stroke-opacity",.75).attr("stroke-width",.3).attr("fill-opacity",0)}),_.exit().remove();const x=e.selectAll(".value_guide_text").data(this.valueGuideRatios());x.enter().append("text").attr("class","value_guide_text").attr("text-anchor","start").attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).merge(x).attr("x",2).attr("y",t=>l[0][1]*t).text((t,e)=>Math.round(t*f)),_.exit().remove();const m=e.selectAll(".area").data(a.filter((t,e)=>e>0));m.enter().append("polygon").attr("class","area").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(m).style("stroke",t=>this.strokeColor([],t,0)).style("fill",t=>this.fillColor([],t,0)).style("fill-opacity",this.fillOpacity()).attr("points",(t,e)=>l.map((t,i)=>{const n=s[i][e+1],o=0===n?0:n/f;return t[0]*o+","+t[1]*o}).join(" ")),m.exit().remove();const g=e.selectAll(".point").data(r);g.enter().append("g").attr("class","point").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).on("click",function(t,e){const n=i.data()[t.rowIdx],o=i.rowToObj(n),a=i._selection.selected(this);i.click(o,i.columns()[t.colIdx],a)}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(i.data()[t.rowIdx]),t.column,i._selection.selected(this))}).each(function(t){const e=$(this);e.append("circle").attr("class","pointSelection").attr("r",i.pointSize()).call(i._selection.enter.bind(i._selection)),e.append(i.mapShape(i.pointShape())).attr("class","pointShape")}).merge(g).each(function(t){const e=$(this),n=0===t.value?0:t.value/f,o=l[t.rowIdx][0]*n,a=l[t.rowIdx][1]*n;e.select(".pointSelection").attr("cx",o).attr("cy",a);const s=e.select(".pointShape").style("stroke",i.strokeColor(t.row,t.column,t.value)).style("fill",i.fillColor(t.row,t.column,t.value));i.setPointAttributes(s,o,a)}),g.exit().remove()}polar2cartesian(t,e){return[t*Math.cos(e),t*Math.sin(e)]}cartesian2polar(t,e){return[Math.atan2(e,t),Math.sqrt(t*t+e*e)]}degrees2radians(t){return t/57.295779513}radians2degrees(t){return 57.295779513*t}point_in_polygon(t,e){const i=t[0],n=t[1];let o=!1;for(let a=0,s=e.length-1;a<e.length;s=a++){const t=e[a][0],r=e[a][1],l=e[s][0],h=e[s][1];r>n!=h>n&&i<(l-t)*(n-r)/(h-r)+t&&(o=!o)}return o}},"_Radar"),g);Fe(pl,"Radar");let dl=pl;dl.prototype._class+=" chart_Radar",dl.prototype.implements(Ae.prototype),dl.prototype.implements(Me.prototype),dl.prototype.mixin(tt.SimpleSelectionMixin),dl.prototype.publish("paletteID","default","set","Color palette for this widget",dl.prototype._palette.switch()),dl.prototype.publish("pointShape","cross","set","pointShape",["circle","rectangle","cross"]),dl.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),dl.prototype.publish("valueGuideRatios",[.2,.4,.6,.8,1],"array","Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines"),dl.prototype.publish("fillOpacity",.66,"number","Opacity of the data polygon(s)"),dl.prototype.publish("fontFamily","","string","fontFamily"),dl.prototype.publish("fontSize",16,"number","fontSize"),dl.prototype.publish("labelPaddingRatio",.9,"number","labelPaddingRatio");const fl=(M(b=class extends et{_domainScale=lt();_valueScale=rt();_d3Arc=ri().startAngle(0).endAngle(t=>this._valueScale(t[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),Ae.call(this),Me.call(this),tt.SimpleSelectionMixin.call(this)}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t[0],value:t[1]})),this._radialAxis=e.append("g").attr("class","r axis"),this._axialAxis=e.append("g").attr("class","a axis"),this._arcs=e.append("g").attr("class","data")}update(t,e){super.update(t,e);const i=this,n=Math.max(this.valueDomainHigh_exists()?this.valueDomainHigh():0,...this.data().map(t=>t[1]));this._valueScale.domain([0,n]).range([0,this.radians(this.valueMaxAngle())]);const o=this._valueScale.ticks(this.tickCount()),a=this.textSize(o.map(t=>""+t),"Verdana",12).width,s=Math.min(this.width()-2*(10+a),this.height()-44)/2,r=this.data().map(t=>t[0]);this._domainScale.domain(r).range([0,s]).padding(this.domainPadding());const l=this._domainScale.step()*this._domainScale.padding(),h=this._radialAxis.selectAll("circle").data(r);h.enter().append("circle").attr("fill","transparent").merge(h).attr("r",t=>this._domainScale(t)+this._domainScale.step()-l/2),h.exit().remove();const c=this._radialAxis.selectAll(".arc-text").data(r);c.enter().append("text").attr("class","arc-text").attr("x",-4).attr("alignment-baseline","middle").attr("text-anchor","end").merge(c).attr("y",t=>-this._domainScale(t)-this._domainScale.bandwidth()/2).text(t=>t),c.exit().remove();const u=this._axialAxis.selectAll("line").data(o);u.enter().append("line").merge(u).attr("x2",t=>s*Math.cos(this._valueScale(t)-this.radians(90))).attr("y2",t=>s*Math.sin(this._valueScale(t)-this.radians(90))),u.exit().remove();const p=this._axialAxis.selectAll("text").data(o);p.enter().append("text").style("dominant-baseline","central").merge(p).attr("x",t=>(s+10)*Math.cos(this._valueScale(t)-this.radians(90))).attr("y",t=>(s+10)*Math.sin(this._valueScale(t)-this.radians(90))).style("text-anchor",t=>{const e=this.degrees(this._valueScale(t));return e>=0&&e<=20||e>=160&&e<=200||e>=340&&e<=360?"middle":e>=180&&e<=360?"end":null}).text(t=>t),p.exit().remove();const d=this.columns().length>1?this.columns()[1]:"";this._d3Arc.innerRadius(t=>this._domainScale(t[0])).outerRadius(t=>this._domainScale(t[0])+this._domainScale.bandwidth());const f=this._arcs.selectAll("path").data(this.data(),t=>t[0]);f.enter().append("path").attr("class","arc").call(this._selection.enter.bind(this._selection)).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("click",function(t,e){i.click(i.rowToObj(t),d,i._selection.selected(this))}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(t),d,i._selection.selected(this))}).merge(f).style("fill",(t,e)=>this.fillColor(t,t[0],t[1])).transition().delay((t,e)=>e*this.transitionDelay()).duration(this.transitionDuration()).attrTween("d",(t,e)=>{const i=kt(t._current||0,t[1]);return t._current=t[1],n=>this._d3Arc([t[0],i(n)],e)}),f.exit().remove()}degrees(t){return 180*t/Math.PI}radians(t){return t*Math.PI/180}},"_RadialBar"),b);Fe(fl,"RadialBar"),De(fl,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number"}]);let yl=fl;yl.prototype._class+=" chart_RadialBar",yl.prototype.implements(Ae.prototype),yl.prototype.implements(Me.prototype),yl.prototype.mixin(tt.SimpleSelectionMixin),yl.prototype.publish("paletteID","default","set","Color palette for this widget",yl.prototype._palette.switch()),yl.prototype.publish("tickCount",10,"number","Number of ticks to display"),yl.prototype.publish("domainPadding",.25,"number","Padding between chart edge and container edge (0..1)"),yl.prototype.publish("valueMaxAngle",270,"number","Maximum angular length of a bar (degrees)"),yl.prototype.publish("valueDomainHigh",null,"number","Value domain high",void 0,{optional:!0}),yl.prototype.publish("transitionDelay",100,"number","Delay between the start of each row animation (ms)"),yl.prototype.publish("transitionDuration",750,"number","Duration of a row's animation (ms)");const _l=X.rainbow("Blues"),xl=X.ordinal("Quartile",[_l(100,0,100),_l(50,0,100),_l(50,0,100),_l(75,0,100)]);function ml(t){const e=Z(t);return function(t){const i=(Math.round(100*t)/100).toString();return i.length<=4?i:e(t)}}M(ml,"Ls"),xl("Std. Dev."),xl("MinMax"),xl("25%"),xl("50%"),Fe(ml,"myFormatter");const gl=(M(v=class extends bt{_selectElement;_tickFormatter;_bellCurve=(new sn).columns(["","Std. Dev."]).paletteID("Quartile").interpolate_default("basis").pointSize(0).xAxisType("linear").xAxisOverlapMode("none").xAxisTickFormat(",").yAxisHidden(!0).yAxisDomainLow(0).yAxisDomainHigh(110).yAxisGuideLines(!1);_candle=(new ul).columns(["Min","25%","50%","75%","Max"]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(_l(90,0,100)).innerRectColor(_l(10,0,100));constructor(){super(),this.columns(["Min","25%","50%","75%","Max","Mean","Std. Dev."])}stdDev(t){return this.mean()+t*this.standardDeviation()}formatStdDev(t){return this._tickFormatter(this.stdDev(t))}quartile(t){return this.quartiles()[t]}formatQ(t){return this._tickFormatter(this.quartile(t))}domain(t){switch(t){case"25_75":return[this.quartile(1),this.quartile(3)];case"normal":return[this.stdDev(-4),this.stdDev(4)];default:return[this.quartile(0),this.quartile(4)]}}min(){return this.quartile(0)}max(){return this.quartile(4)}data(t){if(!arguments.length)return[[...this.quartiles(),this.mean(),this.standardDeviation()]];const e=t[0];return this.quartiles([e[0],e[1],e[2],e[3],e[4]]),this.mean(e[5]),this.standardDeviation(e[6]),this}enter(t,e){super.enter(t,e),this._bellCurve.target(e.append("div").node()),this._candle.target(e.append("div").node()),this._selectElement=e.append("div").style("position","absolute").style("top","0px").style("right","0px").append("select").on("change",()=>{this.view(this._selectElement.node().value),this.lazyRender()}),this._selectElement.append("option").attr("value","min_max").text("Min / Max"),this._selectElement.append("option").attr("value","25_75").text("25% / 75%"),this._selectElement.append("option").attr("value","normal").text("Normal")}bellTicks(t){let e;switch(t){case"25_75":e=[{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)}];break;case"normal":e=[{label:this.formatStdDev(-4),value:this.stdDev(-4)},{label:"-3σ",value:this.stdDev(-3)},{label:"-2σ",value:this.stdDev(-2)},{label:"-1σ",value:this.stdDev(-1)},{label:this.formatStdDev(0),value:this.stdDev(0)},{label:"+1σ",value:this.stdDev(1)},{label:"+2σ",value:this.stdDev(2)},{label:"+3σ",value:this.stdDev(3)},{label:this.formatStdDev(4),value:this.stdDev(4)}];break;default:e=[{label:this.formatQ(0),value:this.quartile(0)},{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)},{label:this.formatQ(4),value:this.quartile(4)}]}const[i,n]=this.domain(this._selectElement.node().value);return e.filter(t=>t.value>=i&&t.value<=n).map(t=>({label:t.label,value:t.value.toString()}))}updateScatter(){const t=this._selectElement.node().value,[e,i]=this.domain(t),n=(i-e)*(this.domainPadding()/100);this._bellCurve.xAxisDomainLow(e-n).xAxisDomainHigh(i+n).xAxisTicks(this.bellTicks(t)).data([[this.stdDev(-4),0],[this.stdDev(-3),.3],[this.stdDev(-2),5],[this.stdDev(-1),68],[this.stdDev(0),100],[this.stdDev(1),68],[this.stdDev(2),5],[this.stdDev(3),.3],[this.stdDev(4),0]]).resize({width:this.width(),height:this.height()-this.candleHeight()}).render()}updateCandle(){const t=this._bellCurve.dataPos(this.quartile(0)),e=this._bellCurve.dataPos(this.quartile(4))-t;this._candle.resize({width:this.width(),height:this.candleHeight()}).pos({x:t+e/2+2,y:this.candleHeight()/2}).width(e).candleWidth(this.candleHeight()).data(this.quartiles()).render()}update(t,e){super.update(t,e),this._tickFormatter=ml(this.tickFormat()),this._selectElement.node().value=this.view(),this.updateScatter(),this.updateCandle()}exit(t,e){this._bellCurve.target(null),this._candle.target(null),this._selectElement.remove(),super.exit(t,e)}},"_StatChart"),v);Fe(gl,"StatChart");let bl=gl;bl.prototype._class+=" chart_StatChart",bl.prototype.publish("view","min_max","set","View",["min_max","25_75","normal"]),bl.prototype.publish("tickFormat",".2e","string","X-Axis Tick Format"),bl.prototype.publish("candleHeight",20,"number","Height of candle widget (pixels)"),bl.prototype.publish("domainPadding",10,"number","Domain value padding"),bl.prototype.publish("mean",.5,"number","Mean"),bl.prototype.publish("standardDeviation",.125,"number","Standard Deviation (σ)"),bl.prototype.publish("quartiles",[0,.25,.5,.75,1],"object","Quartiles (Min, 25%, 50%, 75%, Max)");const vl=(M(w=class extends sn{constructor(){super(),this.interpolate_default("step")}},"_Step"),w);Fe(vl,"Step"),vl.prototype._class+=" chart_Step";const wl="text",Sl="html",kl=(M(S=class extends bt{_playIntervalIdx=0;_mainDiv;_headerDiv;_textDiv;constructor(){super(),this._tag="div",this._drawStartPos="center",this.playInterval(this.playInterval())}lookupFieldIdx(t,e){let i=e;if(!(this[t+"_exists"]()&&(i=this.columns().indexOf(this[t]()),i<0)))return i}lookupFieldText(t,e){return this[t+"_exists"]()?this[t]():void 0!==e&&this.columns()[e]||""}currentRow(){return this.data()[this._playIntervalIdx]}summaryData(){let t;this.hideLabel()||(t=this.lookupFieldIdx("labelColumn",0));const e=this.lookupFieldIdx("iconColumn"),i=this.lookupFieldIdx("valueColumn",1);let n,o;this.hideMore()||(n=this.lookupFieldIdx("moreIconColumn"),o=this.lookupFieldIdx("moreTextColumn"));const a=this.lookupFieldIdx("colorFillColumn"),s=this.lookupFieldIdx("colorStrokeColumn");return this.formattedData().map(function(r){return{icon:void 0===e?this.icon():r[e],label:void 0===t?"":r[t],value:r[i],moreIcon:void 0===n?this.hideMore()?"":this.moreIcon():r[n],moreText:void 0===o?this.hideMore()?"":this.moreText():r[o],fill:void 0===a?this.colorFill():r[a],stroke:void 0===s?this.colorStroke():r[s]}},this)}enter(t,e){super.enter(t,e),this._mainDiv=e.append("div");const i=this;this._headerDiv=this._mainDiv.append("h2").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}),this._textDiv=this._mainDiv.append("div").attr("class","text").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)})}update(t,e){super.update(t,e),this.data().length;const i=this.summaryData();this._playIntervalIdx>=i.length&&(this._playIntervalIdx=0);const n=this._playIntervalIdx<i.length?i[this._playIntervalIdx]:["",""];e.style("width",this.fixedSize()?this.minWidth_exists()?this.minWidth()+"px":null:"100%").style("height",this.fixedSize()?this.minHeight_exists()?this.minHeight()+"px":null:"100%"),this._mainDiv.attr("class","content bgIcon "+n.icon).transition().style("background-color",n.fill).style("color",n.stroke).style("min-width",this.minWidth_exists()?this.minWidth()+"px":null).style("min-height",this.minHeight_exists()?this.minHeight()+"px":null).style("font-size",this.iconFontSize()+"px"),this._headerDiv.transition().style("color",n.stroke).style("font-size",this.headerFontSize()+"px")[this.valueHTML()?Sl:wl](n.value),this._textDiv.style("font-size",this.textFontSize()+"px")[this.labelHTML()?Sl:wl](n.label);const o=this,a=this._mainDiv.selectAll(".more").data([n]),s=a.enter().append("div").attr("class","more").on("click",function(t){o.click(o.rowToObj(o.currentRow()),o.lookupFieldText("moreTextColumn")||"more",!0)}).each(function(){const t=$(this);t.append("i"),t.append("span")}).merge(a).style("display",this.hideMoreWrapper()?"none":null).style("font-size",this.moreFontSize()+"px").style("height",this.moreWrapperHeight_exists()?this.moreWrapperHeight()+"px":null).transition().style("background-color",At(n.fill).darker(.75).toString());s.select("i").attr("class",function(t){return"fa "+t.moreIcon}),this.moreTextHTML()?s.select("span").each(function(t){this.innerHTML=t.moreText}):s.select("span").text(t=>t.moreText),a.exit().remove()}exit(t,e){super.exit(t,e)}},"_Summary"),S);Fe(kl,"Summary");let Al=kl;Al.prototype._class+=" chart_Summary",Al.prototype.implements(be.prototype),Al.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),Al.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:/* @__PURE__ */Fe(t=>t.iconColumn(),"disable")}),Al.prototype.publish("headerFontSize",null,"number","headerFontSize"),Al.prototype.publish("textFontSize",null,"number","textFontSize"),Al.prototype.publish("moreFontSize",null,"number","moreFontSize"),Al.prototype.publish("iconFontSize",null,"number","iconFontSize"),Al.prototype.publish("hideLabel",!1,"boolean","Hide label column"),Al.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */Fe(t=>t.hideLabel(),"disable")}),Al.prototype.publish("labelHTML",!1,"boolean","Allow HTML",null,{disable:/* @__PURE__ */Fe(t=>t.hideLabel(),"disable")}),Al.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Al.prototype.publish("valueHTML",!1,"boolean","Allow HTML"),Al.prototype.publish("hideMore",!1,"boolean","Hide More Information"),Al.prototype.publish("hideMoreWrapper",!1,"boolean","Hide More Information Wrapper"),Al.prototype.publish("moreWrapperHeight",null,"number","Height of the 'more' text wrapper (pixels)"),Al.prototype.publish("moreIconColumn",null,"set","Select More Icon Column",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */Fe(t=>t.hideMore(),"disable")}),Al.prototype.publish("moreIcon","fa-info-circle","string","FA Char icon class",null,{disable:/* @__PURE__ */Fe(t=>t.hideMore()||t.moreIconColumn(),"disable")}),Al.prototype.publish("moreTextColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:/* @__PURE__ */Fe(t=>t.hideMore(),"disable")}),Al.prototype.publish("moreText","More Info","string","More text",null,{disable:/* @__PURE__ */Fe(t=>t.hideMore()||t.moreTextColumn(),"disable")}),Al.prototype.publish("moreTextHTML",!1,"boolean","Allow HTML",null,{disable:/* @__PURE__ */Fe(t=>t.hideMore(),"disable")}),Al.prototype.publish("colorFillColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),Al.prototype.publish("colorFill","#3498db","html-color","Fill Color",null,{disable:/* @__PURE__ */Fe(t=>t.colorFillColumn(),"disable")}),Al.prototype.publish("colorStrokeColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),Al.prototype.publish("colorStroke","#ffffff","html-color","Fill Color",null,{disable:/* @__PURE__ */Fe(t=>t.colorStrokeColumn(),"disable")}),Al.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),Al.prototype.publish("minWidth",225,"number","Minimum Width"),Al.prototype.publish("minHeight",150,"number","Minimum Height"),Al.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0});const Cl=Al.prototype.playInterval;Al.prototype.playInterval=function(t){const e=Cl.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const Ml=(k=class extends Ct{_playIntervalIdx=0;constructor(){super(),be.call(this),this.playInterval(this.playInterval())}currentRow(){return this.data()[this._playIntervalIdx]}enter(t,e){super.enter.apply(this,arguments);const{width:i,height:n}=this.size();t.height=n,t.width=i}update(t,e){super.update.apply(this,arguments);const i=this;this._playIntervalIdx>=this.data().length&&(this._playIntervalIdx=0);const n=this.size(),o=Math.min(n.width,n.height),a=this.fontSizeRatio(),s=this.columns().indexOf(this.labelColumn()),r=this.columns().indexOf(this.valueColumn()),l=this.columns().indexOf(this.colorFillColumn()),h=this.columns().indexOf(this.colorStrokeColumn()),c=this.columns().indexOf(this.iconColumn()),u=-1!==c?this.currentRow()[c]:this.icon(),p=-1!==s?this.currentRow()[s]:"",d=-1!==r?this.currentRow()[r]:"",f=-1!==l?this.currentRow()[l]:this.colorFill(),y=-1!==h?this.currentRow()[h]:this.colorStroke();let _=n.height*(a-this.paddingSizeRatio());const x=n.height*(1-a-this.paddingSizeRatio()),m=n.height*(this.iconSizeRatio()-this.paddingSizeRatio()),g=o*this.paddingSizeRatio(),b=t.getContext("2d");b.clearRect(0,0,n.width,n.height);const v=i.fontFamily();function w(t,e,i,o){b.textBaseline="top",b.font=`${i}px ${v}`,b.fillStyle=y;let a=b.measureText(t);a.width>n.width-2*g&&(i*=(n.width-2*g)/a.width,b.font=`${i}px ${v}`,a=b.measureText(t));const s=k(a.width,o);return b.fillText(t,s,e),i}function S(t,e,o){if(void 0===t)return;b.textBaseline=i.iconBaseline(),b.font=`${e}px FontAwesome`,b.fillStyle=y;let a=b.measureText(t);if(a.width>n.width-2*g){const i=(n.width-2*g)/a.width;b.font=e*i+"px FontAwesome",a=b.measureText(t)}const s=k(a.width,o),r=A(i.iconBaseline());b.fillText(t,s,r)}function k(t,e){switch(e){case"start":return g;case"middle":return n.width/2-t/2;case"end":return n.width-t-g}}function A(t){switch(t){case"top":return g;case"middle":return n.height/2;case"bottom":return n.height-g}}M(w,"A"),M(S,"k"),M(k,"M"),M(A,"P"),b.fillStyle=f,b.fillRect(0,0,n.width,n.height),b.globalAlpha=this.iconOpacity(),S(tt.faChar(u),m,i.iconAnchor()),b.globalAlpha=this.valueOpacity(),_=w(d,g,_,i.valueAnchor()),b.globalAlpha=this.labelOpacity(),w(p,_+g,x,i.labelAnchor()),Fe(w,"drawText"),Fe(S,"drawIcon"),Fe(k,"getTextOffsetX"),Fe(A,"getTextOffsetY")}},M(k,"_SummaryC"),k);Fe(Ml,"SummaryC");let Pl=Ml;Pl.prototype._class+=" chart_SummaryC",Pl.prototype.implements(be.prototype),Pl.prototype.publish("iconBaseline","bottom","string","Text baseline for the icon",["top","middle","bottom"]),Pl.prototype.publish("iconAnchor","end","set","Anchors the icon either at the start, middle, or end of the summary",["start","middle","end"]),Pl.prototype.publish("valueAnchor","start","set","Anchors the value either at the start, middle, or end of the summary",["start","middle","end"]),Pl.prototype.publish("labelAnchor","start","set","Anchors the label either at the start, middle, or end of the summary",["start","middle","end"]),Pl.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),Pl.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:/* @__PURE__ */Fe(t=>t.iconColumn(),"disable")}),Pl.prototype.publish("fontFamily","Arial","string","Font Family"),Pl.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Pl.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),Pl.prototype.publish("colorFillColumn",null,"set","Column for background color",function(){return this.columns()},{optional:!0}),Pl.prototype.publish("colorFill","#0097e6","html-color","Background Color",null,{disable:/* @__PURE__ */Fe(t=>t.colorFillColumn(),"disable")}),Pl.prototype.publish("colorStrokeColumn",null,"set","Column for font color",function(){return this.columns()},{optional:!0}),Pl.prototype.publish("colorStroke","#2f3640","html-color","Font Color",null,{disable:/* @__PURE__ */Fe(t=>t.colorStrokeColumn(),"disable")}),Pl.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),Pl.prototype.publish("minWidth",225,"number","Minimum Width"),Pl.prototype.publish("minHeight",150,"number","Minimum Height"),Pl.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0}),Pl.prototype.publish("fontSizeRatio",.618,"number","Ratio between widget height and value font size"),Pl.prototype.publish("valueOpacity",1,"number","Opacity of value text (0..1)"),Pl.prototype.publish("labelOpacity",.9,"number","Opacity of label text (0..1)"),Pl.prototype.publish("iconOpacity",.3,"number","Opacity of icon text (0..1)"),Pl.prototype.publish("paddingSizeRatio",.1,"number","Ratio of the smallest dimension for edge padding (0..1)"),Pl.prototype.publish("iconSizeRatio",.9,"number","Ratio of the height for icon size (0..1)");const Tl=Pl.prototype.playInterval;Pl.prototype.playInterval=function(t){const e=Tl.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const Il=Math.PI/180,El=2048;function Fl(){const t=Pt("word","end"),e={};let i=[256,256],n=Dl,o=Rl,a=Ol,s=zl,r=zl,l=jl,h=Nl,c=[],u=$l,p=1/0,d=null,f=Math.random,y=Gl;function _(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=El/e;const i=t.getContext("2d");return i.fillStyle=i.strokeStyle="red",i.textAlign="center",{context:i,ratio:e}}function x(t,e,n){const o=e.x,a=e.y,s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),r=u(i),l=f()<.5?1:-1;let h,c,p,d=-l;for(;(h=r(d+=l))&&(c=~~h[0],p=~~h[1],!(Math.min(Math.abs(c),Math.abs(p))>=s));)if(e.x=o+c,e.y=a+p,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>i[0]||e.y+e.y1>i[1])&&(!n||!Bl(e,t,i[0]))&&(!n||Hl(e,n))){const n=e.sprite,o=e.width>>5,a=i[0]>>5,s=e.x-(o<<4),r=127&s,l=32-r,h=e.y1-e.y0;let c,u=(e.y+e.y0)*a+(s>>5);for(let e=0;e<h;e++){c=0;for(let i=0;i<=o;i++)t[u+i]|=c<<l|(i<o?(c=n[e*o+i])>>>r:0);u+=a}return delete e.sprite,!0}return!1}return M(_,"x"),M(x,"m"),e.canvas=function(t){return arguments.length?(y=Ul(t),e):y},e.start=function(){const u=_(y()),m=ql((i[0]>>5)*i[1]);let g=null;const b=c.length;let v=-1;const w=[],S=c.map(function(t,e){return t.text=n.call(this,t,e),t.font=o.call(this,t,e),t.style=s.call(this,t,e),t.weight=r.call(this,t,e),t.rotate=l.call(this,t,e),t.size=~~a.call(this,t,e),t.padding=h.call(this,t,e),t}).sort(function(t,e){return e.size-t.size});return d&&clearInterval(d),d=setInterval(k,0),k(),e;function k(){const n=Date.now();for(;Date.now()-n<p&&++v<b&&d;){const n=S[v];n.x=i[0]*(f()+.5)>>1,n.y=i[1]*(f()+.5)>>1,Ll(u,n,S,v),n.hasText&&x(m,n,g)&&(w.push(n),t.call("word",e,n),g?Vl(g,n):g=[{x:n.x+n.x0,y:n.y+n.y0},{x:n.x+n.x1,y:n.y+n.y1}],n.x-=i[0]>>1,n.y-=i[1]>>1)}v>=b&&(e.stop(),t.call("end",e,w,g))}},e.stop=function(){return d&&(clearInterval(d),d=null),e},Fe(_,"getContext"),Fe(x,"place"),e.timeInterval=function(t){return arguments.length?(p=null==t?1/0:t,e):p},e.words=function(t){return arguments.length?(c=t,e):c},e.size=function(t){return arguments.length?(i=[+t[0],+t[1]],e):i},e.font=function(t){return arguments.length?(o=Ul(t),e):o},e.fontStyle=function(t){return arguments.length?(s=Ul(t),e):s},e.fontWeight=function(t){return arguments.length?(r=Ul(t),e):r},e.rotate=function(t){return arguments.length?(l=Ul(t),e):l},e.text=function(t){return arguments.length?(n=Ul(t),e):n},e.spiral=function(t){return arguments.length?(u=Xl[t]||t,e):u},e.fontSize=function(t){return arguments.length?(a=Ul(t),e):a},e.padding=function(t){return arguments.length?(h=Ul(t),e):h},e.random=function(t){return arguments.length?(f=t,e):f},e.on=function(){const i=t.on.apply(t,arguments);return i===t?e:i},e}function Dl(t){return t.text}function Rl(){return"serif"}function zl(){return"normal"}function Ol(t){return Math.sqrt(t.value)}function jl(){return 30*(~~(6*Math.random())-3)}function Nl(){return 1}function Ll(t,e,i,n){if(e.sprite)return;const o=t.context,a=t.ratio;o.clearRect(0,0,2048/a,El/a);let s=0,r=0,l=0;const h=i.length;for(--n;++n<h;){e=i[n],o.save(),o.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;let t=o.measureText(e.text+"m").width*a,h=e.size<<1;if(e.rotate){const i=Math.sin(e.rotate*Il),n=Math.cos(e.rotate*Il),o=t*n,a=t*i,s=h*n,r=h*i;t=Math.max(Math.abs(o+r),Math.abs(o-r))+31>>5<<5,h=~~Math.max(Math.abs(a+s),Math.abs(a-s))}else t=t+31>>5<<5;if(h>l&&(l=h),s+t>=2048&&(s=0,r+=l,l=0),r+h>=El)break;o.translate((s+(t>>1))/a,(r+(h>>1))/a),e.rotate&&o.rotate(e.rotate*Il),o.fillText(e.text,0,0),e.padding&&(o.lineWidth=2*e.padding,o.strokeText(e.text,0,0)),o.restore(),e.width=t,e.height=h,e.xoff=s,e.yoff=r,e.x1=t>>1,e.y1=h>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,s+=t}const c=o.getImageData(0,0,2048/a,El/a).data,u=[];for(;--n>=0;){if(!(e=i[n]).hasText)continue;const t=e.width,o=t>>5;let a=e.y1-e.y0;for(let e=0;e<a*o;e++)u[e]=0;if(s=e.xoff,null==s)return;r=e.yoff;let l=0,h=-1;for(let i=0;i<a;i++){for(let e=0;e<t;e++){const t=o*i+(e>>5),n=c[2048*(r+i)+(s+e)<<2]?1<<31-e%32:0;u[t]|=n,l|=n}l?h=i:(e.y0++,a--,i--,r++)}e.y1=e.y0+h,e.sprite=u.slice(0,(e.y1-e.y0)*o)}}function Bl(t,e,i){i>>=5;const n=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,r=32-s,l=t.y1-t.y0;let h,c=(t.y+t.y0)*i+(a>>5);for(let u=0;u<l;u++){h=0;for(let t=0;t<=o;t++)if((h<<r|(t<o?(h=n[u*o+t])>>>s:0))&e[c+t])return!0;c+=i}return!1}function Vl(t,e){const i=t[0],n=t[1];e.x+e.x0<i.x&&(i.x=e.x+e.x0),e.y+e.y0<i.y&&(i.y=e.y+e.y0),e.x+e.x1>n.x&&(n.x=e.x+e.x1),e.y+e.y1>n.y&&(n.y=e.y+e.y1)}function Hl(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function $l(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function Wl(t){const e=4*t[0]/t[1];let i=0,n=0;return function(t){const o=t<0?-1:1;switch(Math.sqrt(1+4*o*t)-o&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}function ql(t){const e=[];let i=-1;for(;++i<t;)e[i]=0;return e}function Gl(){return document.createElement("canvas")}function Ul(t){return"function"==typeof t?t:function(){return t}}M(Fl,"tr"),M(Dl,"er"),M(Rl,"ir"),M(zl,"nr"),M(Ol,"or"),M(jl,"ar"),M(Nl,"sr"),M(Ll,"rr"),M(Bl,"lr"),M(Vl,"hr"),M(Hl,"cr"),M($l,"ur"),M(Wl,"pr"),M(ql,"dr"),M(Gl,"fr"),M(Ul,"yr"),Fe(Fl,"d3Cloud"),Fe(Dl,"cloudText"),Fe(Rl,"cloudFont"),Fe(zl,"cloudFontNormal"),Fe(Ol,"cloudFontSize"),Fe(jl,"cloudRotate"),Fe(Nl,"cloudPadding"),Fe(Ll,"cloudSprite"),Fe(Bl,"cloudCollide"),Fe(Vl,"cloudBounds"),Fe(Hl,"collideRects"),Fe($l,"archimedeanSpiral"),Fe(Wl,"rectangularSpiral"),Fe(ql,"zeroArray"),Fe(Gl,"cloudCanvas"),Fe(Ul,"functor");const Xl={archimedean:$l,rectangular:Wl},Yl=(A=class extends et{_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),be.call(this),Me.call(this),tt.SimpleSelectionMixin.call(this),this._prevOffsetX=this.offsetX(),this._prevOffsetY=this.offsetY(),this._prevZoom=this.zoom()}calcData(){return this.data().map(t=>({__viz_label:t[0],__viz_weight:t[1],__viz_row:t}))}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this._root=e.append("g"),this._canvas=document.createElement("canvas");const i=this;this._d3Zoom=Mt().scaleExtent([.1,10]),this._d3Zoom.on("zoom",function(t){const e=dt();e&&e.transform&&i.zoomed(i._d3Zoom,[e.transform.x,e.transform.y],e.transform.k)}),e.call(this._d3Zoom),this.tooltipHTML(function(t){const e=i.columns(),n=e&&e.length?e[0]:"Word";return i.tooltipFormat({label:t.__viz_label,series:n,value:t.__viz_weight})})}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._d3Cloud=Fl().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());const i=this.calcData(),n=this,o=xt(i,function(t){return t.__viz_weight});let a;switch(this.scaleMode()){case"log":a=at;break;case"sqrt":a=_t;break;case"pow":a=st;break;default:a=rt}const s=a().domain(o).range([this.fontSizeFrom(),this.fontSizeTo()]),r=rt().domain([0,n.angleCount()-1]).range([n.angleFrom(),n.angleTo()]);function l(t,e){const i=n._root.selectAll("text").data(t,function(t){return t.__viz_label?t.__viz_label.toLowerCase():""});i.enter().append("text").attr("text-anchor","middle").call(n._selection.enter.bind(n._selection)).text(function(t){return t.__viz_label}).on("click",function(t){n.click(n.rowToObj(t.__viz_row),n.columns()[1],n._selection.selected(this))}).on("dblclick",function(t){n.dblclick(n.rowToObj(t.__viz_row),n.columns()[1],n._selection.selected(this))}).on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).style("opacity",1e-6).merge(i).style("font-size",function(t){return s(t.__viz_weight)+"px"}).style("font-family",n.fontFamily()).transition().duration(1e3).attr("transform",function(t){return"translate("+[t.x,t.y]+")rotate("+t.rotate+")"}).style("fill",function(t){return n._palette(t.__viz_label?t.__viz_label.toLowerCase():"")}).style("opacity",1),i.exit().transition().duration(1e3).style("opacity",1e-4).remove()}M(l,"h"),this._d3Cloud.stop().size([this.width(),this.height()]).words(i).font(this.fontFamily()).padding(this.padding()).spiral(this.spiral()).text(function(t){return t.__viz_label.trim()}).fontSize(function(t){return s(t.__viz_weight)}).rotate((t,e)=>r(e%n.angleCount())).on("word",t=>{}).on("end",l).start(),Fe(l,"draw")}zoomed(t,e,i){if(e[0]!==this._prevOffsetX||e[1]!==this._prevOffsetY||i!==this._prevZoom){switch(this._root.attr("transform",e),t){case this:break;case this._d3Zoom:this.offsetX(e[0]),this.offsetY(e[1]),this.zoom(i)}this._prevOffsetX=e[0],this._prevOffsetY=e[1],this._prevZoom=i}}},M(A,"_WordCloud"),A);Fe(Yl,"WordCloud"),De(Yl,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let Ql=Yl;function Zl(){const t=ot(".%L"),e=ot(":%S"),i=ot("%H:%M"),n=ot("%H:00"),o=ot("%b %d"),a=ot("%b"),s=ot("%Y");return r=>0!==r.getMilliseconds()?t(r):0!==r.getSeconds()?e(r):0!==r.getMinutes()?i(r):0!==r.getHours()?n(r):1!==r.getDate()?o(r):0!==r.getMonth()?a(r):s(r)}M(Zl,"gr"),Ql.prototype._class+=" chart_WordCloud",Ql.prototype.implements(be.prototype),Ql.prototype.implements(Me.prototype),Ql.prototype.mixin(tt.SimpleSelectionMixin),Ql.prototype.publish("paletteID","default","set","Color palette for this widget",Ql.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ql.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ql.prototype.publish("fontFamily","Impact","string","Font Name",null,{tags:["Basic"]}),Ql.prototype.publish("fontSizeFrom",6,"number","Minimum font size (pixels)",null,{tags:["Basic"]}),Ql.prototype.publish("fontSizeTo",48,"number","Maximum font size (pixels)",null,{tags:["Basic"]}),Ql.prototype.publish("angleFrom",-60,"number","Minimum angle (degrees)",null,{tags:["Basic"]}),Ql.prototype.publish("angleTo",60,"number","Maximum angle (degrees)",null,{tags:["Basic"]}),Ql.prototype.publish("angleCount",5,"number","Number of different angles",null,{tags:["Basic"]}),Ql.prototype.publish("padding",0,"number","Padding between words (pixels)",null,{tags:["Intermediate"]}),Ql.prototype.publish("scaleMode","linear","set","Text scaling mode",["linear","log","sqrt","pow"],{tags:["Intermediate"]}),Ql.prototype.publish("spiral","archimedean","set","Text scaling mode",["archimedean","rectangular"],{tags:["Intermediate"]}),Ql.prototype.publish("offsetX",0,"number","X offset",null,{tags:["Advanced"]}),Ql.prototype.publish("offsetY",0,"number","Y offset",null,{tags:["Advanced"]}),Ql.prototype.publish("zoom",1,"number","Zoom",null,{tags:["Advanced"]}),Fe(Zl,"multiScale24Hours"),function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".chart_Axis{fill:#000;font:10px sans-serif}.chart_Axis .axis .tick>text{font:10px sans-serif}.chart_Axis .axis path.domain,.chart_Axis .axis .tick line{fill:none;stroke:#000}.chart_Axis .guide path.domain{fill:none;stroke:none}.chart_Axis .guide .tick line{fill:none;stroke:#d3d3d3;opacity:.7}.chart_Axis .guide .tick.guide-0 line{stroke:#000;stroke-width:1;stroke-dasharray:3 5}.chart_Axis line,.chart_Axis path{shape-rendering:crispEdges}.chart_XYAxis .axis{fill:#000;font:10px sans-serif}.chart_XYAxis .tick>text{font:10px sans-serif}.chart_XYAxis .focus .chart_Axis.value .tick{visibility:hidden}.chart_XYAxis .axis path,.chart_XYAxis .axis line{fill:none;stroke:#000;shape-rendering:crispEdges}.chart_XYAxis .region{opacity:.33}.chart_XYAxis .brush rect.background{z-index:-999}.chart_XYAxis .brush .selection{stroke:#4682b4;stroke-opacity:1;stroke-width:1px;fill:#4682b4;fill-opacity:.125;shape-rendering:crispEdges}.chart_XYAxis .brush path.handle--custom{fill:#eee;stroke:#666}.chart_Scatter .pointShape,.chart_Scatter .line,.chart_Scatter .area{pointer-events:none}.chart_Scatter .point .pointSelection{fill:none;stroke:transparent;stroke-width:2px;pointer-events:all;transition:all .2s ease}.chart_Scatter .point .pointSelection.selected{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection:hover{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Scatter .point .pointSelection:focus{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection.selected:focus{stroke:#6f42c1!important}.chart_Scatter .point .pointSelection:focus-visible{outline:none}.chart_Scatter .point .pointSelection:active{outline:none!important}.chart_Column .columnRect{fill:#4682b4;cursor:pointer}.chart_Column .data.axis path{display:none}.chart_Column .columnRect{stroke:transparent;border-width:2px}.chart_Column .dataCell.selected .columnRect{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Column .dataCell:hover .columnRect{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Column .dataCell:focus .columnRect{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Column .dataCell.selected:focus .columnRect{stroke:#6f42c1!important}.chart_Column .dataCell:focus-visible{outline:none}.chart_Column .dataCell:active{outline:none!important}.chart_Bubble circle{cursor:pointer}.chart_Bubble .selected circle{stroke:red;stroke-width:1.5px}.chart_Bubble .common_FAChar{fill:#fff;pointer-events:none}.chart_Bubble .common_Text{pointer-events:none}.chart_Bullet .domain{opacity:0}.chart_Bullet .bullet{border:solid 1px;border-color:transparent;font:10px sans-serif}.chart_Bullet .bullet.selected{border-color:red}.chart_Bullet .bullet.over{border-color:orange}.chart_Bullet .bullet.selected.over{border-color:red}.chart_Bullet .bullet .marker{stroke:#000;stroke-width:2px}.chart_Bullet .bullet .tick line{stroke:#666;stroke-width:.5px}.chart_Bullet .bullet .range.s0{fill:#eee}.chart_Bullet .bullet .range.s1{fill:#ddd}.chart_Bullet .bullet .range.s2{fill:#ccc}.chart_Bullet .bullet .measure.s0{fill:#b0c4de}.chart_Bullet .bullet .measure.s1{fill:#4682b4}.chart_Bullet .bullet .title{font-size:14px;font-weight:700}.chart_Bullet .bullet .subtitle{fill:#999}.chart_Pie path{cursor:pointer}.chart_Pie>g>text{cursor:pointer}.chart_Pie .arc path{stroke:transparent;stroke-width:2px}.chart_Pie .arc.selected path{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Pie polyline{opacity:.3;stroke:#000;stroke-width:2px;fill:none}.chart_Pie .arc:hover path{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Pie .arc:focus path{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important;transition:all .2s ease}.chart_Pie .arc.selected:focus path{stroke:#6f42c1!important}.chart_Pie .arc:focus-visible{outline:none}.chart_Pie .arc:active{outline:none!important}.chart_HexBin .hexagon{fill:none;stroke:#000;stroke-width:.5px}.chart_HexBin .hexagon.selected{stroke:red}.chart_Line .dataLine{fill:none;stroke:#4682b4;stroke-width:1.5px}.chart_Radar .pointShape,.chart_Radar .area{pointer-events:none}.chart_Radar .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Radar .point .pointSelection.selected{fill:none;stroke:red}.chart_RadialBar path.arc{opacity:.9;transition:opacity .5s}.chart_RadialBar path.arc.selected{stroke:red}.chart_RadialBar path.arc:hover{opacity:.7}.chart_RadialBar .axis line,.chart_RadialBar .axis circle{stroke:#ccc;stroke-width:1px}.chart_RadialBar .axis circle{fill:none}.chart_RadialBar .r.axis text{text-anchor:end}.chart_Summary{width:225px;height:150px;font-size:14px}.chart_Summary .content h2{font-weight:700;font-size:3em;margin-left:10px;margin-top:10px;margin-bottom:10px}.chart_Summary .bgIcon:before{position:absolute;font-family:FontAwesome;font-size:5.5em;opacity:.4;top:.5em;right:15px}.chart_Summary .bgIcon{position:relative}.chart_Summary .content{float:left;width:100%;height:100%;background-color:#efd752}.chart_Summary .content div{margin-top:-1.1em;font-size:1.1em;opacity:.8}.chart_Summary .content .text{padding-left:10px}.chart_Summary .content .more{position:absolute;bottom:0;width:100%;height:3em;line-height:3em}.chart_Summary .content .more i{padding-left:10px;padding-right:.5em}.other_Wordcloud text{cursor:pointer}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();const Jl=["label","start","end","icon","color","series"],Kl=class _WUTimeline extends Gt{_palette=X.ordinal("default");constructor(){super(),this.columns(Jl).titleColumn("label").iconColumn("icon").colorColumn("color").seriesColumn("series").timePattern("%Y-%m-%dT%H:%M:%S.%LZ").tickFormatFunc(Zl()).tooltipTimeFormat("%H:%M:%S.%L").tooltipHTML(t=>t[Jl.length].calcTooltip())}_prevHashSum;clear(){return delete this._prevHashSum,this}fetchScopes(){const t=O({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});if(this._prevHashSum!==t){this._prevHashSum=t;T.attach({baseUrl:this.baseUrl()},this.wuid()).fetchDetails(this.request()).then(t=>t.filter(t=>t.Id&&t.attr("WhenStarted").RawValue).map(t=>{const e=+t.attr("WhenStarted").RawValue/1e3,i=+t.attr("TimeElapsed").RawValue/1e6;return[t.Id,new Date(e).toISOString(),i?new Date(e+i).toISOString():void 0,null,this._palette(t.ScopeType),t.ScopeName.split("::").join(":").split(":").slice(0,1),t]})).then(t=>{this.data(t).render()})}}enter(t,e){super.enter(t,e)}update(t,e){this.fetchScopes(),super.update(t,e)}exit(t,e){super.exit(t,e)}};M(Kl,"WUTimeline");let th=Kl;th.prototype._class+=" eclwatch_WUTimeline",th.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),th.prototype.publish("wuid","","string","Workunit ID"),th.prototype.publish("request",{ScopeFilter:{MaxDepth:3,ScopeTypes:["graph","subgraph"]},NestedFilter:{Depth:0,ScopeTypes:[]},PropertiesToReturn:{AllProperties:!1,AllStatistics:!0,AllHints:!1,Properties:["WhenStarted","TimeElapsed"]},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},"object","WUDetails Request");export{Yt as BUILD_VERSION,Zt as ECLArchiveViewer,Ut as PKG_NAME,Xt as PKG_VERSION,de as STATUS,fe as STATUS_ACTIVE,se as WUGraph,pe as WUResult,oe as WUScopeController,_e as WUStatus,th as WUTimeline};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".eclwatch_WUGraphLegend .graph_Vertex{cursor:auto}.eclwatch_WUGraphLegend .graph_Vertex .common_Icon{cursor:pointer}.eclwatch_WUGraph .graph_Vertex{cursor:auto}.eclwatch_WUGraph .marker{fill:#656565;stroke:none;stroke-width:1px}.eclwatch_WUGraph .zoom{fill:none;pointer-events:all}.eclwatch_WUGraph .selectionBrush{fill:none;stroke:#a9a9a9}.d3-tip .eclwatch_WUGraph_Tooltip h3,.d3-tip .eclwatch_WUGraph_Tooltip h4{margin:0}.d3-tip .eclwatch_WUGraph_Tooltip table{border-collapse:separate;border-spacing:5px}.d3-tip .eclwatch_WUGraph_Tooltip table .key{font-weight:700}.d3-tip .eclwatch_WUGraph_Tooltip table .value{font-weight:400}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|